location_id must be specified when creating fulfillments error

Highlighted
Tourist
3 0 1

Hello , When I try to submit post fulfillment request I am getting "location_id must be specified when creating fulfillments" error.

Can you please advice ,is this something related to app or do I need to change some settings at store level?

Please let me know.

Thnak you 

Highlighted
Shopify Staff
Shopify Staff
295 32 74

Hey!

Due to the transition to support multi-location inventory, fulfillments now require a location_id at creation.

The following guide explains how to conduct an inventory migration: https://help.shopify.com/en/api/guides/inventory-migration-guide

Hopefully that helps!

0 Likes
Highlighted
Tourist
3 0 1

Hello Zameer, 

 

Isn't that suppos to work till August 1st?

Please let me know. 

Thank you 

0 Likes
Highlighted
Shopify Partner
6 0 2

hello I have a question, when you send my location_id in my request, your api answers the following error:

response: 
{"errors":"Not Found"}

request:

{"fulfillment":{"location_id":516876140657,"tracking_number":"794613732806","tracking_company":"FEDEX","tracking_url":"http:\/\/www.fedex.com\/Tracking?tracknumbers=794613732806","line_items":[{"id":1356647596145,"quantity":1}]}}

Highlighted
Tourist
3 0 1

Hi, Zameer ~

With the change that Shopify made, the 422 response now returns the body:

{"error":"location_id must be specified when creating fulfillments."}

All other error response bodies are formatted "errors", plural. 

Will Shopify be correcting this to {"errors":"location_id must be specified when creating fulfillments."}?

Thanks,
Joshua

0 Likes
Highlighted
Shopify Staff
Shopify Staff
295 32 74

Hey Joshua,

Yes, this is definitely something we can take a look at standardizing. Your feedback has been passed along to our developer team.

Thank you!

0 Likes
Highlighted
New Member
1 0 0

Hi Peter, did you get a solution to the location_id issue, I am finding I may have come up against something similar

Thanks

Mark

0 Likes
Highlighted
New Member
1 0 0

Any solution to the problem, I'm also facing the same issue. Not found - error when sending location_id and location_id is missing if not sending one.

0 Likes
Highlighted
New Member
1 0 0

Here is how to create a new fulfillment using the python Fulfillment API after the multi location update:

1. Create a store location. If you already have a store location, go to step 2.

2. Visit your admin page for locations: https://YOUR-STORE.myshopify.com/admin/settings/locations

 

3. Click a location from the list. Grab the id from the URL.

ex:  From this url https://YOUR-STORE.myshopify.com/admin/settings/locations/1234567890

your location id is: 1234567890

 

4. Get your order id in a similar manner. Then, use the following code:

def markFulfilled(order_id):

shop_url = "https://%s:%s@YOUR_STORE.myshopify.com/admin/api/%s" % (API_KEY, PASSWORD, API_VERSION)
shopify.ShopifyResource.set_site(shop_url)
shopify.Shop.current()

order = shopify.Order.find(order_id)

f = shopify.Fulfillment(prefix_options=dict(order_id=order.id))
f.line_items = order.line_items
f.tracking_company = 'USPS'
f.tracking_numbers = ['9261290116299900000000']
f.location_id = "1234567890"
f.save()

markFulfilled(ORDER_ID)

 This code works as of January 13 2020

0 Likes