A place to discuss charging merchants for your apps and services using the billing API.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
hello everyone, I'm setup billing for my app with recurring plan and usage plan following docs. Now I have a response when query into "/admin/api/2023-07/recurring_application_charges.json" like this:
{ "recurring_application_charge": { "id": xxxxxx, "name": "Silver", "price": "99.90", "billing_on": "2023-09-15", "status": "active", "created_at": "2023-09-14T23:41:14-04:00", "updated_at": "2023-09-14T23:41:42-04:00", "activated_on": "2023-09-15", "return_url": "xxxx", "test": true, "cancelled_on": null, "trial_days": 0, "trial_ends_on": "2023-09-15", "api_client_id": 53565095937, "decorated_return_url": "xxxx", "capped_amount": "500.00", "balance_used": 1.0, "balance_remaining": 499.0, "risk_level": 0.0, "currency": "USD" } }
Solved! Go to the solution
This is an accepted solution.
Hi Danhho,
Yes, the billing_on
field will be updated to the next billing date after a successful charge. It is essentially the start date of the next billing cycle. The balance_used
field also resets to 0 at the start of each new billing cycle.
Unfortunately, the app_subscription_update
webhook does not get triggered when the billing_on
field updates. It only gets triggered when the subscription itself is updated or cancelled.
You could potentially set up a task in your app to check the billing_on
date regularly, such as daily, and take action when the date changes.
Also, it's worth noting that Shopify does not provide a way to simulate recurring charges in a development store. So, you would need to use a real transaction to test the billing cycle.
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
This is an accepted solution.
Hi Danhho,
Yes, the billing_on
field will be updated to the next billing date after a successful charge. It is essentially the start date of the next billing cycle. The balance_used
field also resets to 0 at the start of each new billing cycle.
Unfortunately, the app_subscription_update
webhook does not get triggered when the billing_on
field updates. It only gets triggered when the subscription itself is updated or cancelled.
You could potentially set up a task in your app to check the billing_on
date regularly, such as daily, and take action when the date changes.
Also, it's worth noting that Shopify does not provide a way to simulate recurring charges in a development store. So, you would need to use a real transaction to test the billing cycle.
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
Thanks for your comfirm @Liam, it nearly close to clarify
You could potentially set up a task in your app to check the billing_on date regularly, such as daily, and take action when the date changes.
Your mean is we must set up a schedule function in my app and run per days to check and update billing_on in my DB. Is it right?
Hi Liam ,
that was an excellent answer.
will the app_subscription_update get triggered if status changes to "FROGEN" and "ACTIVE" from "FROGEN" ?