Jen143 Jen143 - 3 months ago 29
JSON Question

Cannot update fulfillment in Shopify

I have this:

PUT/admin/orders/450789469/fulfillments/255858046.json
in updating the fulfillment.

I have this following json data to update:

{ "fulfillment": {"id":3604167143,"order_id":4015640143,"status":"success","tracking_numbers":"6J700123456","variant_inventory_management":"shopify"}}


It returns a 400 error - Bad request.

Is there anything I've missed in passing the data to update? Thanks.

Answer

You'll want to send tracking_numbers as an array, rather than a string. Try something like this:

{
    "fulfillment": {
        "id": 3604167143,
        "order_id": 4015640143,
        "status": "success",
        "tracking_numbers": ["6J700123456"],
        "variant_inventory_management": "shopify"
    }
}

If you look in the body of the response from Shopify then you can sometimes find more info about what went wrong.