I'm trying to update an orders fulfillments[] but I'm getting
HTTPError: Response code 400 (Bad Request)
Every thing else is getting updated but not fulfillments[]
I'm using shopify-api-node package
Here's How I'm trying to update my Orders fulfillment
const fulfillments = [
{
"created_at": "2012-03-13T16:09:54-04:00",
"id": 255858046,
"order_id": orderId,
"status": "failure",
"tracking_company": "USPS",
"tracking_number": "1Z2345",
"updated_at": "2012-05-01T14:22:25-04:00"
}];
shopify.order.update(orderId, {
id : orderId, fulfillments }).catch((err) => {
console.log('err =====>' , err)
});
If you're trying to create a fulfillment event you don't need to call the order api. You should check the fulfillment api. https://shopify.dev/api/admin-rest/2022-04/resources/fulfillmentevent#post-orders-order-id-fulfillments-fulfillment-id-events
You should be doing something like this
session.FulfillmentEvent().create({
"order_id": orderId,
"fulfillment_id": 255858046,
"status": "in_transit"}
)