Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Refunding an order before the capture via GraphQL

Solved

Refunding an order before the capture via GraphQL

JeremiahClaspel
Shopify Partner
2 0 1

Hello, 

I am looking at implementing the manual capture payment capture method and am wondering how this would impact creating refunds before the capture. A couple scenarios would be an order is cancelled, or a customer would like a partial refund from a coupon code they found after placing their order. 

Currently we are capturing payment at the time of sale, so creating a refund against that sale is the standard procedure, however I am unsure of how this would look pre-capture and could use some insight before migrating over to the manual capture. 

 

Thanks!

Jeremiah

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 519

This is an accepted solution.

Hey @JeremiahClaspel ! That's a great question. 

 

In the scenarios you mentioned, 

 

1. If an order is cancelled, the authorization is automatically voided, so in that scenario, the customer would need to make a new purchase as cancelling an order can't be reversed. Relevant mutation if you're wanting to cancel via API https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/orderCancel 

2. For orders where you have not yet captured the amount, and the customer is requesting a refund for a coupon code they found, then you just need to specify the amount you want to capture in your request. The remaining un-captured authorized amount (depending on the gateway and it's rules around multiple captures), will either be returned automatically, or returned once the authorization period ends (typically 7 days). https://shopify.dev/docs/api/admin-graphql/2024-01/input-objects/OrderCaptureInput#field-ordercaptur... 

 

There's a little more context in the help center here as well: https://help.shopify.com/en/manual/orders/get-paid 

 

Hope that helps! 

 

- Kyle G.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 238 519

This is an accepted solution.

Hey @JeremiahClaspel ! That's a great question. 

 

In the scenarios you mentioned, 

 

1. If an order is cancelled, the authorization is automatically voided, so in that scenario, the customer would need to make a new purchase as cancelling an order can't be reversed. Relevant mutation if you're wanting to cancel via API https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/orderCancel 

2. For orders where you have not yet captured the amount, and the customer is requesting a refund for a coupon code they found, then you just need to specify the amount you want to capture in your request. The remaining un-captured authorized amount (depending on the gateway and it's rules around multiple captures), will either be returned automatically, or returned once the authorization period ends (typically 7 days). https://shopify.dev/docs/api/admin-graphql/2024-01/input-objects/OrderCaptureInput#field-ordercaptur... 

 

There's a little more context in the help center here as well: https://help.shopify.com/en/manual/orders/get-paid 

 

Hope that helps! 

 

- Kyle G.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog