Cancel Order API

RetailByte
Shopify Partner
2 0 1

Couldn't find a post where this was properly answered.  At some point in the past I thought I was able to cancel an order 

Example resource:
https://xxxxxxxx.myshopify.com/admin/orders/298312803/cancel.json

My JSON Post:
{"order":{"amount":"35.26","restock":true,"reason":"other","email":true}}

The order looks to be cancelled in on shop’s web admin page, but I do not see the notification of restock or an email going out to the customer? 

However, it looks like I can accomplish what I need by adding some arguments to the resource.  Example:

https://xxxxxxxx.myshopify.com/admin/orders/298312803/cancel.json?&reason=other&restock=true&email=t...

But it fails when I try to add an amount and an argument.  The Argument approach seems like a work-around.  Anyone have some thoughts on my JSON post as to why it might not be working as expected?  

Thanks in advance.

Ken Kilar
Stacey7
New Member
7 0 0

I am interested in learning more about this as well.

0 Likes
Mohd_Imad
New Member
2 0 0

Hey Ken,

I was browsing around and found an article online which might help you, please have a look at this article:

http://shopifynation.com/shopify-tutorials/cancel-delete-order-shopify/

0 Likes
Mohd_Imad
New Member
2 0 0

Hey Ken,

I was browsing around and found an article online which might help you, please have a look at this article:

http://shopifynation.com/shopify-tutorials/cancel-delete-order-shopify/

0 Likes
Nick52
Shopify Expert
5 0 0

Hey Ken,

I was browsing around and found an article online which might help you, please have a look at this article:

http://shopifynation.com/shopify-tutorials/cancel-delete-order-shopify/

0 Likes
AngusPurcell
New Member
1 0 0

Hi Ken,

I think if you look at the documentation here https://shopify.dev/docs/admin-api/rest/reference/orders/order#cancel-2020-07

you can see that you don't need the {order: } wrapper in your json. If you send just the json:-

{"amount":"35.26","restock":true,"reason":"other","email":true}

then it should work as you are expecting I think.

Angus

0 Likes