New Shopify Certification now available: Liquid Storefronts for Theme Developers

404 Bad Request when trying to create fulfillment

Solved
JoeL68
Shopify Partner
12 1 2

Hello,

 

Any help with this is GREATLY appreciated. I am working on integrating a Shopify store to our ERP system. When an order is created in Shopify, it will be fulfilled from our warehouse. I then need to update the Shopify order to include the tracking number(s). If it is a split fulfillment, both tracking numbers need to be recorded in fulfillments. 

 

The error msg I am getting back is 

Error message received from Http Server, Code 400: Bad Request

 

I am using Boomi to send the fulfillment requests to Shopify. The URL it is sending to is

https://my-store.myshopify.com/admin/orders/4142698233917/fulfillments.json

This is a valid order ID. The payload being sent is

{
"fulfillment": {
"location_id": 3560475472,
"tracking_number": "a1a2a3a4a5a6a7a8a9a",
"tracking_company": "FedEx",
"notify_customer": true,
"line_items": [
{
"id": 6708444594237,
"quantity": 1
}
]
}
}

 

The location_id is this field from the sales order

"origin_location": {
"id": 3560475472,

 

line_items.id is from this field of the order

"product_id": 6708444594237,

 

I appreciate any help with this, as this is the last piece that needs to be completed.

 

Regards,

Joe

 

Accepted Solution (1)
garyrgilbert
Shopify Partner
378 38 151

This is an accepted solution.

 

Hi there,

 

The origin_location is badly named, it is not the actual location_id.

 

You can not obtain the location_id for an order from the order.json directly. If the shop only has a single location you can hard-code it, otherwise you will have to query the location_id for the specific fulfillment its a little convoluted to get the location_id that way but...

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 2 (2)
garyrgilbert
Shopify Partner
378 38 151

This is an accepted solution.

 

Hi there,

 

The origin_location is badly named, it is not the actual location_id.

 

You can not obtain the location_id for an order from the order.json directly. If the shop only has a single location you can hard-code it, otherwise you will have to query the location_id for the specific fulfillment its a little convoluted to get the location_id that way but...

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
JoeL68
Shopify Partner
12 1 2

Hi Gary,

Thanks for the valued feedback and info. At this time we do only have one location so I will hard code it. If that changes I'll grab it from the locations call.

 

Regards,

Joe