I’m part of developing an intermediate application that connects our customers to Shopify. One of the flows is where our customers can cancel web orders in our ERP. Example:
- A customer orders something at Shopify
- The weborder gets synced to our ERP
- For some reason one of the lines has to be cancelled
- Our ERP will have to notify Shopify that the line should be cancelled
I have basically everything working except the very last step. I’m unsure what API calls to make or even what the functional flow should be.
Some suggestions I found:
- cancel the order when all fulfillable items have been fulfilled (not an option for us)
- create a refund for the specific lines
Going with the refundCreate for specific lines it just cancels the items with no open refund. When sending in a refund with an actual money amount I need to create a transaction, but I have no transaction. I found the suggestedRefund, but I’m not sure if that’s the way to go.
What I want to achieve is that our ERP can notify Shopify that a specific order line item has been cancelled and that a refund should be initiated. We don’t do anything with transactions on our side, it’s up to the shop owner to finish the cancellation.
For the Return variant we do: mutation returnCreate
and then mutation closeReturn
. I’m not exactly sure if this is the correct flow either. I did not develop this feature originally and I do not have experience with the functional flow of Shopify.