Obtain Lot Inventory when Inactive and move to none sellable bin

Hello,

I hope you’re all well.
I’m trying to transfer the remaining inventory from an expired lot (inactive lot) to a non sellable bin via API so I can automate this process. This is useful for us because the inventory of an expired lot still shows as Available and therefore can be purchased on the stores of our clients, a situation that has given us some problems in the past.

What I’d like to know if there’s a possible way to get the remaining inventory of an expired lot that’s associated with a sellable bin, and then transfer this to a non sellable bin.

I checked the expiration_lots query of graphQL, but it only gives info about the date of creation of the lot and if it’s active or not, not the remaining inventory or the bins associated to that lot.

Is this something that can be achieved through API? That is, get the expired inventory, get the bins associated to that expired inventory, move it to a non sellable bin so it doesn’t show as a sellable.
Is there any other workaround for this problem?
Our main issue is that expired products can still be purchased from clients, and then the orders that include these expired products can’t be picked because the lots are inactive since they’ve already expired.

Thanks.
Cristóbal

Hey @cmora !
Thanks for reaching out and welcome to our Community.

I’m currently looking into this and I’ll have an update for you shortly.

Best,
RayanP

Hey @cmora !

I’ve used this query example to find the inventory and bins as well as when they will expire:

{
  warehouse_products(
    warehouse_id: "11793"
    active: true
    customer_account_id: "7556"
    sku: "1122335448"
  ) {
    request_id
    complexity
    data(first: 1) {
      edges {
        node {
          id
          legacy_id
          account_id
          sku
          inventory_bin
          inventory_overstock_bin
          locations(first: 10) {
            edges {
              node {
                quantity
                location {
                  name
                  legacy_id
                }
                expiration_lot {
                  expires_at
                }
              }
            }
          }
        }
      }
    }
  }
}

I used “data(first:1)” because we sorted by SKU and warehouse ID. For “locations(first:10)” you can reduce the quantity to save credits if you know you don’t have more than 5 locations for each product.

The “legacy_id” within location is the Bin ID.

We’re still working on finding a way to transfer the expired inventory to a nonsellable bin.

Best,
RayanP

Hey @Rayanp !
Thanks! I’ll be checking out the solution you gave me, I’ll let you know if I manage to transfer the expired inventory to a non sellable bin.
I believe that with the inventory_add and inventory_substract mutations this can be achieved.

Best,
Cristóbal