Cancel Order API from scratch

Highlighted
New Member
1 0 0

I want to use cancel order API but as i am new to shopify and its API call i m not able to find how and from where in shopify can i call this API . I have went through the documentation provided for the cancel order API but my doubt is as the cancel order API is an admin API , i am not able to fetch json data through POST request . I m able to fetch data when i call GET request API for order.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
493 98 88

Hi @hitshraj 

 

The steps would be the following: 

1. Find the order ID you want. Either through the API (GET) or in the admin

2. do a POST to /admin/api/2020-01/orders/#{order_id}/cancel.json where #{order_id} is replaced by the actual order ID

 

Also please see all the requirements for the order to be canceled: https://help.shopify.com/en/manual/orders/refund-cancel-order#cancel-an-order

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes