Reputation: 1159
I am trying to add fulfillment for multiple(all) line items in an order. Following is the sample XML that I am generating:
<?xml version="1.0" encoding="UTF-8"?>
<fulfillment>
<line-items type="array">
<line-item>
<id>1234567</id>
<fulfillment-status>fulfilled</fulfillment-status>
<fulfillment-service>USPS</fulfillment-service>
</line-item>
<line-item>
<id>1234568</id>
<fulfillment-status>fulfilled</fulfillment-status>
<fulfillment-service>USPS</fulfillment-service>
</line-item>
</line-items>
<notify-customer type="boolean">true</notify-customer>
<tracking-number>4545454545454545</tracking-number>
</fulfillment>
But I get the following response from Shopify:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>All line items of a fulfillment must use the same fulfillment service</error>
</errors>
Note that above are the only two line items in the Order and none of these line items have been fulfilled yet.
In which cases does Shopify respond back with the above error? What am I doing incorrect thats causing the above error response & What can I do to add the fulfillments correctly?
Upvotes: 0
Views: 1931
Reputation: 1159
Shopify gives the above error if you have a Custom Order Fulfillment method defined in Shopify Admin under Settings --> Shipping The error message "All line items of a fulfillment must use the same fulfillment service" does not seem appropriate as it shows even if we are passing the same same fulfillment service for all line items in the order.
Upvotes: 0
Reputation: 234
The reason why this is occurring is because the variants in the shop don't have the same fulfillment service specified. If the line items are being fulfilled via different services, it would follow that a single tracking number won't suffice.
Upvotes: 1