How to test recurring charges

Lennyll
New Member
2 0 1

I need to retrieve the recurring charge to run some logic, but my app is not published yet so it is unable to find the recurring "test" charge and then when I try to add my app to a real store that is not possible because the app is no published.

 

I don't understand how there can be API calls which do not work in test mode!

0 Likes
SteveTT
Excursionist
16 2 3

Referring to: https://shopify.dev/api/admin/rest/reference/billing/recurringapplicationcharge#create-2021-07

All these do work when "test": true 

When you create a recurring application charge, you'll get "id"

You redirect the merchant to "confirmation_url" and then if they accept, shopify will redirect them back to your "return_url", with the charge_id as a parameter, something like "http://super-duper.shopifyapps.com/?charge_id=1029266957", if I remember correctly.

Using that charge_id, you can GET information about a specific recurring_application_charge_id

https://shopify.dev/api/admin/rest/reference/billing/recurringapplicationcharge#show-2021-07

or if you want to see a list of all recurring applicatiion charges:

https://shopify.dev/api/admin/rest/reference/billing/recurringapplicationcharge#index-2021-07

I think that's the flow ... 

 

0 Likes