Kawa222-UK
Kawa222-UK

Reputation: 1

Shopify API - Create Fulfillment, One location works, Multiple locations does not

When using the code below, to fulfil a single location/fulfilment, it works fine.

If an order has 2 fulfilments (from 2 locations), it does not work saying "None of the items are stocked at the new location."

location_id and the single fulfillment_order_id are both specified.

Stock is 'in stock' at the location too.

The same stock lines, on a single fulfilment order, go through fine.

URL: https://.myshopify.com/admin/api/2022-04/orders/<order_id>/fulfillments.json

{"fulfillment":{"location_id":99999999041,"tracking_number":"https://tracking.com/5678","tracking_urls":["https://tracking.com/5678"],"notify_customer":true, "line_items_by_fulfillment_order":[{ "fulfillment_order_id":9999999999053,"fulfillment_order_line_items": [{"id":99999999990725,"quantity":1},{"id":99999999993493,"quantity":1},{"id":9999999997957,"quantity":1}] }] }}

EDIT: To clarify, if an order has 2 fulfilments (from 2 locations), it does not work - why?

EDIT: A solution was found, that if the other fulfilment (by the users own custom location) is created in the backend of shopify, then the above fulfilment code goes through fine.

Upvotes: 0

Views: 1151

Answers (0)

Related Questions