A place to discuss charging merchants for your apps and services using the billing API.
We are asked to implement the billing API for our application to get approved but I don't see in the documentation what happens after a user clicks on approve payment or cancel it. What response body will I get from Shopify after it redirects to the return URL?
Thanks in advance.
Hi Grandshipper,
When a user approves or declines the payment, they are redirected to the return_url
you specified when creating the charge. The redirected request will include query parameters that give you the status of the charge.
For example, if the merchant approves the charge, they will be redirected to a URL similar to https://yourapp.com/your_return_url?charge_id=1234567
. You can then retrieve the charge by its ID to confirm its status.
If the merchant declines the charge, Shopify redirects the merchant to your return_url
without any query parameters.
Please note that the return_url
does not receive a response body. The status of the charge needs to be verified by your app by making an API call to Shopify using the charge ID in the return_url
.
You can use the GET /admin/api/2023-07/recurring_application_charges/{charge_id}.json
endpoint to fetch a single recurring charge by its ID and confirm its status.
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me 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