# Obtain Lot Inventory when Inactive and move to none sellable bin

**URL:** <https://community.shiphero.com/t/obtain-lot-inventory-when-inactive-and-move-to-none-sellable-bin/2035>\
**Category:** GraphQL API\
**Created:** [June 15, 2022, 1:27pm UTC](https://community.shiphero.com/t/obtain-lot-inventory-when-inactive-and-move-to-none-sellable-bin/2035 "2022-06-15T13:27:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmora](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cmora](https://community.shiphero.com/u/cmora)\
**Post date:** [June 15, 2022, 1:27pm UTC](https://community.shiphero.com/t/obtain-lot-inventory-when-inactive-and-move-to-none-sellable-bin/2035/1 "2022-06-15T13:27:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [June 15, 2022, 3:11pm UTC](https://community.shiphero.com/t/obtain-lot-inventory-when-inactive-and-move-to-none-sellable-bin/2035/2 "2022-06-15T15:11:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sh-agent](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sh-agent](https://community.shiphero.com/u/sh-agent)\
**Post date:** [June 15, 2022, 5:01pm UTC](https://community.shiphero.com/t/obtain-lot-inventory-when-inactive-and-move-to-none-sellable-bin/2035/3 "2022-06-15T17:01:08Z")

</div>

Hey @cmora !

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

```auto
{
  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

---

<div class="post-metadata">

**Author:** ![cmora](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cmora](https://community.shiphero.com/u/cmora)\
**Post date:** [June 15, 2022, 5:14pm UTC](https://community.shiphero.com/t/obtain-lot-inventory-when-inactive-and-move-to-none-sellable-bin/2035/4 "2022-06-15T17:14:52Z")

</div>

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.

Best,  
Cristóbal
