Error completing fulfillment

keiraarts
Shopify Partner
16 3 3

Hiya Shopify Forums!

I'm running into an issue of completing fulfillments.

A tracking number can get successfully attached to an order but any attempts to close the fulfillment so merchants stop seeing an 'open fulfillment' status on their dashboard returns an unknown error. The docs make it seem that the flow is to open fulfillment > fulfill the order with tracking > complete the fulfillment. Three distinct REST API calls.

When completing a fulfillment I get a successful response, here's a snippet.

id: HIDDEN,
order_id: HIDDEN,
status: 'open',
created_at: '2020-07-12T10:22:37-04:00',
service: 'HIDDEN',
updated_at: '2020-07-23T11:22:05-04:00',
tracking_company: 'USPS',
shipment_status: 'in_transit',

tracking_number: 'HIDDEN',
tracking_numbers: [ 'HIDDEN' ]

Now transitioning the fulfillment to be marked completed we call the API again using the provided order_id and id (fulfillment id) the successful response gives us.

https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/fulfillment?api[version]=...

Just like in the reference code, it's a POST request with no body, same authentication,  called on an fulfillment that has tracking

/admin/api/2020-07/orders/HIDDEN/fulfillments/HIDDEN/complete.json

>>> Shopify responds with Request failed with status code 406.

I'm thinking maybe the fulfillment is missing information before it can be completed, but unsure of what it could be!

Any clues would really be appreciated! 

 

0 Likes
CalD
Shopify Staff
Shopify Staff
91 8 12

Hey @keiraarts,

Can you provide the X-Request-Id response header so we can look at the logs?

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
msk
Excursionist
28 5 3

Hello,

if you want to attach tracking number and you want to change the status from unfulfill to fulfilled then please use this request. its perfect for you and also it will throw order in archived so shop owner can easily check tracking number and order status as fulfilled and order order in Archived.

please use this URL

https://******************.myshopify.com/admin/api/2020-01/orders/[ORDER_ID]/fulfillments.json

with this json data

-d'{"fulfillment": { "notify_customer": false,"location_id": [LOCATION_ID], "tracking_number": "[TRACKING_CODE]", "tracking_company": "[SHIPPING_COMPANY]" } }'

 

Thanks

0 Likes