I am updating my application to support the latest stable Shopify API (2023-01), but I am struggling with creating the fulfillment records.
Below is a sample fulfillment JSON “body” from my test store.
{
"fulfillment": {
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": "5894084460693",
"fulfillment_order_line_items": [
{
"id": "12190922277013",
"quantity": "1"
}
]
}
]
}
}
if I POST this JSON from a REST client application, using the endpoint
admin/api/2023-01/fulfillments.json
then everything works fine.
If I try to POST the same thing via the Python API, “line_items_by_fulfillment_order” contains the objects & arrays that the JSON above was generated from
shopify.Fulfillment.create(line_items_by_fulfillment_order)
then the library tries to POST the JSON to the endpoint (which is expecting an order_id but won’t accept one)
admin/api/2023-01/orders//fulfillments.json
which then returns
HTTP Error 406: Not Acceptable
Clearly, I must be using the wrong resource when creating the fulfillment object, I have looked through the library source to try and see where I am going wrong, but I can’t figure out what the right resource is to generate the correct endpoint.
Any help would be greatly appreciated.
Cheers
Dan