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.
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.
Hey @sh-agent !
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.