Getting and Setting inventory_bin locations with Dynamic slotting

Hey Team,

Just an introduction to my problem. We have a 3PL account with 1 warehouse location, and are trying to allow one of our customer accounts sell products from all other customers accounts. Theoretically, the ideal relationship between stores and their products would be: Product A from Store A is being sold on store B with the same barcode and same sku. However, since Store A and Store B are different Customers, they can’t share the same warehouse_product instance. So, the same product will have 2 warehouse_product instances. Our solution to this was, have all inventory for Product A allocated to its warehouse_product under Store A, leaving its duplicate instance under Store B empty. Then, when an order comes into shipHero from Store B containing Product A, we would manually remove one from the inventory in Store A, and add one to the inventory in Store B at the same location_bin. This would allow for the physical inventory to stay in the same location prior to being picked for the order. Our issue is, dynamic slotting is enabled. So, when trying to set the location with a graphQL mutation, we get this as a response: {
“errors”: [
{
“message”: “Cannot change inventory bin in dynamic slotting accounts”,
“operation”: “warehouse_product_update”,
“field”: “warehouse_product_update”,
“request_id”: “5e7ec6e83c05512cd7becc5a”,
“code”: 9
}
],
“data”: {
“warehouse_product_update”: null
}
}

Similarly, when we try to find the location_bin of a product with a query, the result is an empty string. So, I was able to move 1 product from Product A in Store A and add it to Product A in Store B, but the bin location is unsigned. The order is now fulfillable, but our warehouse team can’t go pick the order because they aren’t told where it is. Any idea on how we can achieve this functionality?

Thanks,

Josh

Hi @Josh
I already submitted a request for this to be modified. The functionality was initially build to change inventory on Static Slotting accounts. Right now, the only way I can see of changing inventory on existing bins is through inventory_sync mutation, that works similar to inventory upload on the app.
I will let you know as soon as I have an update on this.
Thanks!,
Tom

Hi Tom,

Thank you for your reply! Very interesting. Would an inventory_sync be assigning random bin locations to unassigned bins? Or, would it be able to assign specific bin locations? I was able to capture all current bin location using an inventory_generate_snapshot mutation, now I just need to assign Product A in Store B the same bin. Do you think inventory_sync would be able to achieve this? I sincerely appreciate your help!

Thanks,
Josh

Hi @Josh!
Inventory Sync functionality allows you to sync inventory using a CSV file, and yes, you can assign a specific bin location.
The CSV you’ll be uploading will have the following fields: sku, quantity, action, reason, and location.
For now only replace is supported for action

There’s a section we have on our developers site about Inventory Sync. We have some examples of how it works, but feel free to ask if there’s anything not clear about the functionality.
Thanks again!
Tom

Hi @tomasw,

Would we be able to use a CSV with just the updated products? Or would the CSV also need all products in the warehouse? I just want to make sure the replace action doesn’t remove any products not in the CSV, but rather only replace the products in the CSV.

I really appreciate all your help on this topic!

Thanks,
Josh

Hi @Josh!
The update will be made ONLY for the SKUs set on the CSV, they can be as many as you need.

It will only replace those SKUs and if we are not able to find the SKU we will provide an error message for that SKU, but continue to replace the others on the CSV file

Hi @tomasw,

Really appreciate all your help with this topic. I was able to initiate an inventory_sync using a csv file, and noticed that there is a processing period for the inventory_sync. Do you know how long this an inventory_sync usually takes? We will need to be calling an inventory_sync with every order that comes in, but we are getting an error saying “There is a sync already scheduled/being processed for warehouse 11514: 5e8776d7fa943624d1e61951”. Could it be an error with the CSV? (here is the link to the CSV: https://drive.google.com/file/d/1NrFX5I8_XDTU0gAnTfU7xRAVGzr--Mm1/view )

Thank you,
Josh

Hi @Josh!
A couple of things that might help here:

  1. It looks like for this Sync you are using credentials from the Child Account*.
    Inventory Sync, as any other Inventory change should be done from the 3PL account. In this case, you have to use the Token from a user associated with the 3PL account (Fulfillment Center) and in the request, you should include the customer_account_id**

  2. As for the location in the CSV, you have to use the name of the bin, for example, Bin A1, or Unassigned

**To get the customer account id you can use the following query with a Token associated to the 3PL

query {
  account {
    request_id
    complexity
    data {
      id
      legacy_id
      customers {
        edges {
          node {
            id
            legacy_id
            email
            username
          }
        }
      }
    }
  }
}

*And then with that id you can make the sync again with the 3PL user credentials, for example like:

mutation {
  inventory_sync(
    data: {
      url: "https://some-url.com/inv-sync.csv"
      warehouse_id: "V2FyZdfhens73hsA="
      customer_account_id: "QWNjb3VurDo2MzAx"
    }
  ) {
    request_id
    complexity
    sync_id
  }
}

As for the pending sync, new ones are not allowed before the last sync finishes. It shouldn’t happen that it stays long on a pending state, so this is an issue we are currently looking at, and a file like the one you uploaded shouldn’t take long. I will let you know as soon as this gets fixed.
But If you would like to abort a previous batch so you can upload a new one you could use the inventory_sync_abort mutation to abort them manually.

Let me know if there’s anything else I can help out with or if I should explain better something about this.
Thanks again!
Tom

Hi @tomasw!

This is so helpful, thank you for the information. I do seem to be having an issue aborting the sync that is stuck. I am getting the following error:
{
“errors”: [
{
“message”: “Cannot access the requested sync job. Permission denied”,
“operation”: “inventory_sync_abort”,
“field”: “inventory_sync_abort”,
“request_id”: “5e8a9cb726d9c1ec8e2be250”,
“code”: 7
}
],
“data”: {
“inventory_sync_abort”: null
}
}

I updated our token to the admins token, but am still getting this error. Would I need to make this request with the token for the child account it was created with?

Sorry for all the questions! You have been extremely helpful during this project.

Thanks,
Josh

Hi @Josh
No problem at all!. I aborted that one for you, it looks like you were already using the abort batch on the Fulfillment Account and the batch was created on the Child Account.
Let me know if is working as expected now,
Thanks again
Tom

Hey @tomasw,

Unfortunately, the issue is still happening with a new sync. I accidentally used the same file without updating the bin location value, and the sync has been processing for the last 30 min. When trying to abort that sync, I get the same error. Am I using the correct token? Could it be the csv being used? The csv is stored on a google drive.

Follow up question, do you know if CSVs stored as a google sheets will work for the inventory_sync? These are a lot easier to update from their api. If you aren’t sure, I can run some tests after we get this inventory_sync issue sorted out.

Thank you,
Josh

Hi @Josh

I apologize for the confusion here so we have a couple of issues with this:

  1. Aborting a sync must be done using the token from the Child account.
    For example in this case you created the SYNC using the 3PL but specifying the customer_account_id
    So then if you wish to abort the SYNC you must use a Token from the customer_account_id
    I know this is not ideal or practical, so I already created a feature request to be able to abort a SYNC from the 3PL by specifying the customer_account_id

  2. An engineer is currently working on fixing a bug we have that is causing batches not to finish the SYNC (and they remain as pending). He es working on this as we speak, but I’ll let you know as soon as we have an update on this.

  3. The CSV should work as longs are ready to download, the URL provided should be to download. Not 100% sure how it works with google sheets because that URL you are using is to View the Doc. Should be something like this one:
    Download File
    Notice that when you click on the URL it downloads directly

Hi Thomas,

Thanks for this clarification. I was definitely using the wrong link. Unfortunately, I am still having troubles generating the token to make the abort. Do you mind aborting the current sync for me? Im expecting everything to work as expected when we use the correct link.

Thanks again for all your help!
Josh

Hi @Josh!
Sync should be aborted for that account you have been using, but let me know if you are using another account (Or if you have the sync id even better!)

On the other hand I double checked with one of our engineers and seems like that google file won’t work, and that might be whats causing the sync not to process right.
Thanks,
Tom

Hey @tomasw,

Thanks for aborting the sync. It makes sense that you say the google file won’t work, because I got the following error when using the downloadable link.

{
“errors”: [
{
“message”: "HEAD method on URL https://drive.google.com/uc?id=1NrFX5I8_XDTU0gAnTfU7xRAVGzr--Mm1&export=download returned Method Not Allowed (405): ",
“operation”: “inventory_sync”,
“field”: “inventory_sync”,
“request_id”: “5e8f623d1f8aa6a7fecb8a17”,
“code”: 9
}
],
“data”: {
“inventory_sync”: null
}
}

Is this because of google drives authentication? Or is the issue with this specific file? If not, do you have any recommendations on where to store the file to upload?

Hi @Josh!
As far as I could test, it is not specific to your file, that error happens with all the downloadable links from google drive, it seems that the URL is not allowing HEAD method, which is sent first from our side. I will try to make some research about it and provide more insight into this

Where we usually store this kind of files is on an Amazon S3 Bucket and making the file public, that way it works perfectly for us

Hi @tomasw,

Amazon S3 bucket worked perfectly! Thank you for the recommendation. I am having a bit of an issue assigning the inventory in the sync to a location for sync-id 5e9560332f94d23fcc5180d9. The location was provided in the csv, but it looks like the inventory just got added to the onHand value as there is no location for the product. I even tried adding the empty bin and seeing if the sync would populate the quantity into that bin, but it remained at 0. Could you advise a potential cause to this issue?

I am truly sorry to keep bothering you guys, and am truly grateful for all of your help.

Thanks,
Josh

Hi @Josh
I’m glad it helped, and there is no problem at all, as as many times as you need!
I see what might be happening there, it is not adding the Bin as its supposed to do. I already send a request for de engineering team to fix this behavior.
I will let you know as soon as I have an update on this.
Thanks again!
Tom

Thank you @tomasw,

Let me know if you need anything from me to help resolve this issue. If you need me to, I can be available for a phone or video call to describe exactly what we are trying to build here.

I did have another quick question. As of right now, the only way I was able to capture the bin location of a product in our dynamic slotting warehouse is through an inventory_generate_snapshot mutation where we then have to go fetch the results. Do you know why the warehouse products bin location is blank in a products query? It seems like this value should be the physical products bin location(s), and would be a lot easier to obtain, but the value remains blank for us. (request id 5e97f47f512589f18b50f706)

Hi @Josh!

I’m currently escalating the issue discussed previously.

As for the warehouse products bin locations that are actually meant for Static Slotting accounts, and it returns the Bin of the product (which is unique) but on Dynamic Slotting accounts you may have multiple bins, so this field doesn’t work on Dynamic Slotting accounts.

I will also request this to be added to our API

Thanks again for the patience on this, and I will let you know if there is any news about the fix