Updated Deadline: Aug 1st -- [Deprecation] Important changes to ProductVariant, Refund and Fulfillment APIs

New Member
15 0 0

Is this a bug or intended and not documented?

When doing `POST /admin/inventory_levels/set.json` if the location_id belongs to a fulfillment_service the endpoint returns 422 without any error message even if you pass `disconnect_if_necessary: true`

Now if you try to circumvent this and do `POST /admin/inventory_levels/connect.json` to the fulfillment_service location_id and the product variant has a blank `SKU` then good luck figuring out the 422 response from the endpoint with an empty body(relocate_if_necessary: true is passed in). I stumbled upon the requirement when trying to set the fulfillment service through the dashboard.

UPDATE: setting the product's fulfillment_service through PUT products/variants/<id.json> actually returns

{
  "errors": {
    "sku": [
      "can't be blank"
    ]
  }
}

 

Can you guys make `POST /admin/inventory_levels/set.json` actually honor the `disconnect_if_necessary: true` so that an application doesn't have to call `connect.json` first.

 

 

 

 

0 Likes
Shopify Partner
6 0 1

Hi Ryan,

We are setting disconnect_if_necessary to true for all the set.json calls. Even if that flag set, Shopify is returns 403 or 422 randomly.

We created a new product with some inventory in the screen and inventory levels GET call shows the item is randomly assigned location_id = 1809842203 which doesn't exist when we lookup using GET location calls.

Then when we tried to set the inventory qty using set.json it throws 403 forbidden even when disconnect_if_necessary to true.

Is there any reason why the new product is assigned to a random location_id after creation ?

 

0 Likes
Shopify Partner
1 0 0

Our POST to Fulfillment have suddenly stopped working with the error "Required parameter missing or invalid".  I addeed location ID (our site doesn't have any defined fulfillment services, but when I call the Get for locations I do get one location and that's the ID I'm using).  

Here's the body I'm sending:

{"fulfillment": {"location_id": 15293071, "tracking_number":"9405510200882755885011","notify_customer": true, "line_items": [ { "id": 1261297664109, "quantity": 1 },{ "id": 1261297696877, "quantity": 1 }]}} 

what's the missing/invalid?

0 Likes
Shopify Partner
5 0 0

Hola Ryan,

I even tried with 200 inventory adjustment but it results the same error. Then I tried with only 14 inventory adjustment, it showed me the same.

But when I tried multiple times with 11 adjustment values, it showed me unreliable results, like, it results proper output while some time shows "TypeError: NetworkError when attempting to fetch resource." error again.

Even there is no issue regarding call cost. Below is the call cost value for 10 adjustment for your reference.

 

 "extensions": {
    "cost": {
      "requestedQueryCost": 50,
      "actualQueryCost": 50,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 950,
        "restoreRate": 50
      }
    }
  }

 

 

Thanks in advance.

0 Likes
Shopify Partner
4 0 0

Hi Ryan

Thanks for the advice

Hi Mark, what is the use case behind 600 fulfillment services? 

We have vendor's listing their product on our site and each vendor we assigned a fufillment service so they could revieve emails of when their product was fufilled. We have started to change this model but we still need to support the old products until the end of the year.

When an item is assigned to a fulfillment service, an order will contain a property for `fulfillment_service` with the name of the fulfillment service responsible for that line item.  All fulfillment services have a ` location_id` assigned to them, which is what you should 

 

line_items:[
  {
    ..
    "fulfillment_service": "xihe",
    ..
  }
]

I saw the fufillment service is just a name, so does that mean that i will need to search through the locations based on the name and find the location_id

0 Likes
Tourist
9 0 1

So, if my shop has "multi_location_enabled" set to false, confirmed by querying the "shop" endpoint - is there any action I need to take? This seems unclear.

From what I understand, for my POST requests to create Fulfillments, I need to add a "location_id" - but the only locations my shop has (found by querying the "locations" endpoint) are Point-Of-Sale iPad locations. (I'm guessing these are meant to be "legacy" locations now, but their "legacy" properties are false).

What should I be setting "location_id" to on my requests..??

-EDIT-

I'm seeing a "primary_location_id" - is this what I should be using? Is this property even mentioned in the documentation anywhere?

Also, the migration guide URL at the top of this page is still broken:
https://help.shopify.com/api/reference/shipping_and_fulfillment/fulfillment#create

0 Likes
Shopify Partner
4 0 0

Hi Ryan, 

I am still unsure if my fulfillment service is set to manual, which location_id should i use. I can't seem to find the answer for this in any of the documentation. Not sure is it because i am missing something or am unable to understand.

 

Thanks

0 Likes
Shopify Partner
3 0 0

Hi Ryan,

I've done the /admin/inventory_levels/set.json POST through php with json data, and I'm receiving an error message:

{"errors":{"inventory_item_id":"Required parameter missing or invalid"}}

I've sent inventory_item_id in the json string.  I got the inventory_item_id from the product api call in the variants section of the return.

What could be the problem here?

0 Likes
Tourist
12 0 1

Hi Ryan,

First of all, I am sorry to come back to this forum again, you must be drowning in different questions the developper community is bring up every day. 

We have been in touch with a couple of Shopify developpers and they reported an issue on Shopify side which is causing the inventory level updates to either fail with 422 error or reset the product filfillement services to Manual. 

The Shopify developpers confirmed that you guys are looking into these issues. Can you please let us know if the July 1st deprecation deadline will still apply even if these issues aren't fixed? 

Thanks in advance and again, sorry for all the back and forth. 

Tahar

0 Likes
New Member
2 0 1

To "ostalks Admin"

I had the same issue. I was sending my JSON POST via php curl.

I was first sending the encoded JSON like this:

{"inventory_levels":{"inventory_item_id":12345678901,"location_id":87654321,"available":100}}

Results: "{"errors":{"inventory_item_id":"Required parameter missing or invalid"}}"

I removed the "inventory_levels" from my request and now it works.

/admin/inventory_levels/set.json

{"inventory_item_id":"12345678901","location_id":"87654321","available":"100"}

I am using "manual" for fulfillment and the location_id is just the shopify store.

1 Like