'Order cancellation from customer interface in shopify
How can put an option to cancel an order from the customer interface or after the customer logins in his account in shopify? I'm not sure if this is possible, I know that orders are cancelled through the backend of shopify, so I'm hoping if there is a way that the customer himself can cancel their order. Thanks
Solution 1:[1]
There is a workaround for it. Use shopify's admin API to cancel the order. You'll be able to refund as well.
POST /admin/orders/#{order_id}/cancel.json
Ref: https://help.shopify.com/en/api/reference/orders/order#cancel
You may not be able to call this API directly from browser. You can follow below procedures to cancel the order:
- Make an API which takes order id from request and cancels the order using above mentioned API. This logic will live at server side.
- Make order cancellation request from customer's end with order id to cancel the order.
If someone has a different way, please share. Thanks
Pro tip: If you want extra security that no one should misuse the API that you built, pass order id, customer id, line item id etc and verify that order at your server end and then cancel the order.
Solution 2:[2]
If you look at any order in Shopify that is open, under the Shopify More Actions menu, there is link to click labelled Cancel Order.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Raj Kumar |
Solution 2 | David Lazar |