shopify - 422 Unprocessable Entity during fulfillment API call
I am receiving a 422 Unprocessable Entity error when attempting to add a tracking number to a fulfillment to an order via a POST to the below url with the message body below. The order is still open and all lines should be fulfilled with the same tracking number. The error body received is "All line items of a fulfillment must use the same fulfillment service". I am able to authenticate successfully first and the GET API for this order works correctly.
You cannot create a single fulfillment where line items cannot be contained in the same shipment. Check the line items you are trying to fulfill, if one of them uses a different service, you won't be able to create that fulfillment.
Instead you'll need to create N separate fulfillments where N is the distinct number of fulfillment services for the line items in that order.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.