Hope everything is OK. I’m trying to automate the order cancellation process.
Actually, we can cancel orders through the API, but this only works if they are not fulfilled. In other case, it says that the order already has shipping labels which is OK. But sometimes we have to cancel orders that have been already shipped. So we call Re-ship on the UI, and then cancel the order through the API.
Is there a way to call order re-ship through the API? or maybe some other process to emulate this, like creating a return? The requirement is that the inventory has to be restored after the order gets cancelled.
Thanks for reaching out.
There is no way to call the reship field through the Public API, but there might be a work around like you said. I’ll look into this and get back to you.
Apologies for the delay here. You’re pretty much spot on.
To mimic the “reset” of an order when being reshipped the operations being called would be:
Change the order fulfillment status using order_update_fulfillment_status
Update the fulfillment status of line items to pending and the quantity pending fulfillment. This can be done at the same time using the order_update_line_items mutation
Voiding the label(s) and re-adding the inventory are not necessarily done on every order that you reship, so I believe they are more conditional. If adding back inventory use the inventory_add mutation. The problem as you’ve found is that you cannot void a label through the API.
Please let me know if you have any questions or concerns.
OK @Rayanp I understand. The only problem is that we are trying to automate this process, so, if voiding the shipping labels is not possible from the API then it is not convenient to do this at all.
Is it possible to make a feature request to void/delete the shipping labels through the API? I don’t think it’s a lot of work because it is already possible to create them.
The other way is to use returns. Is it possible to create a return in Shiphero from the API, and process it in the warehouse to restore the inventory? I am just looking for a way to cancel an order that has already been shipped.
I’ve passed on your feedback regarding adding the shipment_void mutation to the Public API.
I’m not sure how the return would help here because it wouldn’t void any previous labels or set the order to canceled. In either case wouldn’t it be easier to use the inventory_add mutation to restore the inventory?
I was thinking that the return would work, because I could just skip the part of voiding the previous labels, since it would just restore the inventory, but I don’t know really how do returns work, we haven’t used them yet.
Ok I belive using the inventory_add mutation might work. The only problem here is that our system doesn’t know anything about the warehouse locations, so I couldn’t specify the one I want to restore the inventory at. I would like to restore the inventory in the same location that it was before. Is there a way to do that?
Ok @Rayanp , this is not good for us because the products should be reinstalled in the location that they were before, just as in the Re-Ship functionality of the Shiphero App.
I think that the only way that we can work this out is that you exposed the Re-ship operation in the public API so we could use it.
Please let me know if you will develop this. Regards,