Track orders placed on other platforms
Orders that are created through third-party marketplaces, like Facebook or Google, use Shopify Payments as the payment processor.
This guide describes a high-level, recommended workflow for using the GraphQL Admin API to track orders placed through third-party marketplaces.
Requirements
Anchor link to section titled "Requirements"- Your app can make authenticated requests to the GraphQL Admin API.
- Your store has existing orders that are unfulfilled. If you need to make changes to an unfulfilled item, then you can edit an order.
- You're familiar with the API objects that pertain to fulfillment orders.
- You've met Shopify's protected customer data requirements.
How it works
Anchor link to section titled "How it works"Orders that are placed through third-party marketplaces and orders placed from other channels go through different workflows. The following diagram illustrates the differences between the workflows:
Orders placed through third-party marketplaces
Anchor link to section titled "Orders placed through third-party marketplaces"The following workflow considerations apply for orders that are placed through third-party marketplaces:
Orders aren't created with automatically captured transactions.
Merchants have to fulfill an order before the transaction is captured automatically and the order is marked as paid. Transaction capture is initiated by the third-party marketplace.
Orders can't be fulfilled immediately.
They must be held until a period between 30 minutes and 24 hours has passed before they can be fulfilled. This is to account for customer cancellation, payment authorization, and fraud and risk analysis.
From the time that a payment is authorized until it's captured, merchants can't perform the following actions on an order:
- Change the destination address
- Edit the order
- Issue refunds for custom amounts
- Capture the payment manually
Orders placed through other channels
Anchor link to section titled "Orders placed through other channels"For orders placed through other channels, transactions are automatically captured before the order is fulfilled. Merchants or third-party fulfillment services can also immediately act on orders to begin the fulfillment process.
To learn more about fulfillment workflows for orders placed through other channels, refer to the following guides:
Step 1: Migrate your app to use fulfillment orders
Anchor link to section titled "Step 1: Migrate your app to use fulfillment orders"In Shopify, the FulfillmentOrder
object models an end-to-end fulfillment process and is available in the GraphQL Admin API. The FulfillmentOrder
object enables fulfillment data to sync accurately between Shopify and apps.
To learn how to migrate your app, refer to Migrate to fulfillment orders.
Step 2: Determine the source channel of an order
Anchor link to section titled "Step 2: Determine the source channel of an order"You can use the DraftOrderInput
input object to determine the source channel of an order.
Identify orders processed with Shopify Payments or Facebook Payments
Anchor link to section titled "Identify orders processed with Shopify Payments or Facebook Payments"To identify an order that was processed with Shopify Payments or Facebook Payments, you can retrieve the order using the GraphQL Admin API and review the information in specific response fields.
The following table lists the response fields and values that you can review when you retrieve an order:
Field | Shopify Payments value | Facebook Payments value |
---|---|---|
displayFulfillmentStatus |
ON_HOLD | UNFULFILLED |
displayFinancialStatus |
AUTHORIZED | PAID |
paymentGatewayNames |
["shopify_payments"] | ["instagram"] |
Considerations
Anchor link to section titled "Considerations"Because orders that are placed through third-party marketplaces use Shopify Payments instead of a unique payment gateway, the
gateway
value doesn't reflect the channel in which the order is created. Fields likereference
andsource_identifier
aren't guaranteed across different apps.Orders that are created using the GraphQL Admin API can be assigned any of the
source_name
values that are listed in the Partner Dashboard.Use the
source_name
of an order to determine its channel source. Thesource_name
property can be set only during order creation. It's not writeable afterwards.Alternatively, orders can be assigned a custom string or left unspecified:
- If
source_name
is a custom string, then the order is unattributed. - If
source_name
is unspecified, then new orders are assigned the value of your app's ID.
- If
Step 3: Determine if the order can be fulfilled
Anchor link to section titled "Step 3: Determine if the order can be fulfilled"You can use the order financial status and fulfillment order status to determine if an order should be fulfilled. The following table describes the fields or properties, values, and webhooks that you can use to determine if an order can be fulfilled:
Object | Field | Value | Webhooks |
---|---|---|---|
Order | displayFinancialStatus |
AUTHORIZED or PAID | orders/updated |
FulfillmentOrder | status |
OPEN | fulfillment_orders/
fulfillment_orders/
fulfillment_orders/ (API version 2023-01 and higher) |
Order financial status
Anchor link to section titled "Order financial status"Sales channel apps for third-party marketplaces require that an order is fulfilled before payments are automatically captured by the marketplace.
To prevent the expiration of authorized payments, a post-order workflow shouldn't use payment captured as the condition for fulfillment. Instead, determine if an order has payment authorization ("status": "authorized"
) and an open fulfillment order ("status": "open"
) before fulfillment. You can do this by reviewing the following information the displayFinancialStatus
field in the GraphQL Admin API Order
object.
Fulfillment order status
Anchor link to section titled "Fulfillment order status"A fulfillment order is ready for fulfillment when its status is open. For more information about how a fulfillment order transitions to different statuses, refer to Statuses.
Each fulfillment order includes a list of supported fulfillment order actions to determine which actions it can take. For more information about fulfillment order actions, refer to determine which actions to take.
Considerations
Anchor link to section titled "Considerations"You can't use
line_items.fulfillable_quantity
to determine if an order is fulfillable if the fulfillment order is on hold. The value0
is returned.Check the
status
of the fulfillment order before you create a fulfillment following anorder/create
webhook. If thestatus
ison_hold
, then the API request to create a fulfillment fails.Avoid using a predetermined value for the on-hold time period. This value differs across marketplaces.
Avoid using the
gateway
field or property to determine if an order is created through a channel.For example, after migrating your app, the
gateway
value of an order created on the Facebook sales channel app changes frominstagram/facebook
toshopify_payments
. Instead, usesource_name
to determine the source of an order.
Best practices
Anchor link to section titled "Best practices"The following section provides some best practices for tracking orders that are placed through third-party marketplaces.
Don't rely on order creation events to initiate fulfillments
Anchor link to section titled "Don't rely on order creation events to initiate fulfillments"Avoid workflows that depend on the orders/create
, order_transactions/create
or order/paid
webhook events to initiate fulfillments.
Instead, use the fulfillment_orders/ready_to_fulfill
webhook (available only in the unstable version of the API) and the FulfillmentOrder
response body to determine if a fulfillment order is ready for fulfillment.
Support Facebook Payments and Shopify Payments workflows
Anchor link to section titled "Support Facebook Payments and Shopify Payments workflows"During the transition, apps need to support both the Facebook Payments and Shopify Payments workflows. For the transition period, we recommend determining the post-order workflow based on the gateway.
Orders that are created through a sales channel app on a Shopify Payments-enabled store will see transactions created in an authorized state. Orders have to complete fulfillment before payment is captured automatically by the marketplace. During the transition period, create a condition check on the payment gateways value to determine the post-order workflow.
- Learn how to manage fulfillments as an order management app.
- Learn how to manage fulfillments as a fulfillment service app.
- Edit existing orders using the GraphQL Admin API.