Hi,
My problem is that for a particular store, when I use the returnCreate API to create an exchange, the exchange FulfillmentOrder is not available in the API.
I am used to the behaviour that after calling returnCreate to create an exchange, that this will create a new FulfillmentOrder which can be fetched via the API (as described here in the Shopify Help Guide on Managing Exchanges).
For example, I have replicated the following on many returns for my client store (i.e., created exchangeLineItems, but no fulfiilmentOrders are available in the API even though it’s clear in the admin that the held FulfillmentOrder was created):
{
"data": {
"order": {
"id": "gid://shopify/Order/6016278069336",
"returns": {
"nodes": [
{
"exchangeLineItems": {
"nodes": [
{
"id": "gid://shopify/ExchangeLineItem/83132504"
}
]
}
}
]
},
"fulfillmentOrders": {
"nodes": []
}
}
}
Please help me understand how to get the fulfillment order for the exchange!
Hi Jake,
When you create a return with exchange items using the returnCreate
mutation, Shopify automatically creates fulfillment orders for the exchange items. These fulfillment orders are placed on hold with the status ON_HOLD
and the hold reason AWAITING_RETURN_ITEMS
.
After creating the return, you can query the fulfillmentOrders
associated with the order using the order
query. Ensure that you filter for fulfillment orders with the ON_HOLD
status and the AWAITING_RETURN_ITEMS
hold reason.
Here’s an example query to retrieve the fulfillment orders:
query GetFulfillmentOrders {
order(id: "gid://shopify/Order/6016278069336") {
id
fulfillmentOrders(first: 10) {
nodes {
id
status
fulfillmentHolds {
reason
}
}
}
}
}
Hi Liam,
Thanks for your reply!
I usually see exactly the behaviour you describe, however by problem is that on a particular client’s store, this is not happening. For example, see in this screenshot that the return & exchange were clearly created:
However, when I make your suggested query, I do not see any fulfillmentOrders
:
Could you help me troubleshoot why there may not be any fulfillment orders on the API when I create exchanges using returnCreate
for this particular merchant?
If this particular store is behaving differently to all others, I’m thinking there could be a store setting or another installed app that is impacting this. Do you have a headerId for an API call that we could check?
The shop name is petite-plume