Unassigning lot from location

Hi,

Is it possible to unassign a lot from a location? The API supports assigning the lot to a location but not the inverse operation.

I was hoping to use such a function to make our receiving process simpler.

Hello @maarten_jacobs!

I am now looking into this concern.

I will let you know as soon as I have an update.

Kind regards,

1 Like

@iescobar Hi, any update on this?

Hi, @maarten_jacobs ,
I apologize for the late response. I did some tests to make sure it worked as well.
To achieve what you are asking for, you can use the following query:

mutation {
  lot_delete(data: { lot_id: "lot_id" }) {
    request_id
    complexity
    lot {
      id
      legacy_id
      account_id
      po_id
      name
      sku
      created_at
      updated_at
      expires_at
      received_at
      is_active
    }
  }
}

But before executing the mutation, the lot needs to have quantity = 0. If it isn’t, the mutation will don’t work.
Please let me know if this doesn’t solve your concern.

Ignacio

@iescobar Thank you for looking into this. Would lot_delete not delete the lot though? We’d prefer to keep a record of the lots and their expiration dates for the sake of recalling products.

Hi, @maarten_jacobs ,

You can use lot_delete to delete the lot from the location. But if you prefer to keep a record of the lots, you can use the lot_update mutation:

mutation {
  lot_update(data: {
    lot_id:"lot_id"
    name:"name"
    expires_at:"2022-08-30"
    is_active:false
  }) {
    request_id
    complexity
  }
}

With this mutation, you can deactivate and update the expiration dates.
I hope it helps! Please let me know if this doesn’t solve your concern.

Ignacio

@iescobar Making the lot inactive doesn’t clear its location though, unless you’re suggesting I delete the lot and then recreate it?

@iescobar Any update on this?

From what I can tell deactivating the lot doesn’t remove it from the location. Deleting the lot isn’t an option. Even if you try it, you get the error “Cannot remove a received lot”

Hey @maarten_jacobs,

Thanks for hanging in there!

I’ll look into this issue and get back to you shortly.
Please let me know if you have any questions or concerns.

Best,
RayanP