Issue: Post tracking info to Shopify via API. Previously used admin/api/2020-04/orders/{Order: Id}/fulfillments.json which has been deprecated. Trying to post via admin/api/2021-10/fulfillments.json or /admin/api/2022-07/fulfillments.json without success.
I have been pulling my hair out for a few days now. Reading everything here as well as Shopify Documentation and appear to be no closer to getting this solved. I seem to have this at a point where it is being recognized in some way, but I am now getting this fun error. I have checked my data and ensured that there are no “quantity” : 0 in the data. I am at a loss. Open to suggestions!
@Shopify_77 it would have been really cool if you let us know what method to use to pull in tracking data after you deprecated admin/api/2020-04/orders/{Order: Id}/fulfillments.json because based on my reading there are a lot of us struggling to find a workable replacement.
@Ralph-HA did you manage to find a fix?
UPDATE: I just realized that my issue is I tried to use the “order id” as the fulfillment id. Need to look at the code again. This is the code I used to create the json code. When you look at the sample, the “order id” line is missing.
{
"fulfillment": {
"notify_customer": true,
"location_id": 18014371875,
"tracking_number": {Fulfillments: Tracking Number},
"tracking_url": "{Tracking URL}",
"tracking_company": "{Carrier}",
"line_items_by_fulfillment_order" : [
{
"order_id": {Order: Id},
"fulfillment_order_line_items": [{Line Items Fulfillment Array}]
}
]
}
}
Current error message:
"Fulfillment payloads fulfillment order must be greater than 0"
API Endpoint: admin/api/2021-10/fulfillments.json
Method: POST
"fulfillment": {
"line_items_by_fulfillment_order": [
{
"fulfillment_order_line_items": [
{
"id": 1239874,
"quantity": 1
},
{
"id": 0983498723,
"quantity": 1
},
"order_id": 123456789
}
],
"location_id": 98765432,
"notify_customer": true,
"tracking_company": "Canada Post",
"tracking_number": 0123456789,
"tracking_url": "https://www.canadapost-postescanada.ca/track-reperage/"
}
}
For reference, I have read through the following & tried many, many incremental fixes.
https://community.shopify.com/topic/1564746
https://community.shopify.com/post/1754098
https://shopify.dev/api/admin-rest/2021-10/resources/fulfillment#post-fulfillments
https://shopify.dev/api/admin-rest/2022-07/resources/fulfillment#post-fulfillments
