A place to discuss charging merchants for your apps and services using the billing API.
Hi
As per the documentation:
Recurring charged based on usage: Create app usage records to bill merchants based on their usage of the app. The total value of all usage records cannot exceed the cappedAmount.
The usage charge API however allows to use an amount that exceeds the cappedAmount.
Solved! Go to the solution
This is an accepted solution.
Hi Shivkumar_2512,
Thanks for your post. When the test flag is not true the system will reject any [REST API UsageCharge creation call] that would cause the cappedAmount to be exceeded.
The current behaviour of the UsageCharges creation call going through when the test flag is true and the cappedAmount would be exceeded is considered to be a bug which has now been flagged for repair, and a dev doc update request has been submitted to add some more notes about this to the REST API documentation.
The behaviour in production follows the same rule that the [GraphQL equivalent appUsageRecordCreate] is documented as following, which reads:
"If you create an app usage charge that causes the total usage charges in a billing interval to exceed the capped amount, then a Total price exceeds balance remaining
error is returned."
Hope you have a great day,
Jon551 | API Support @ 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 Shivkumar_2512,
Thanks for your post. When the test flag is not true the system will reject any [REST API UsageCharge creation call] that would cause the cappedAmount to be exceeded.
The current behaviour of the UsageCharges creation call going through when the test flag is true and the cappedAmount would be exceeded is considered to be a bug which has now been flagged for repair, and a dev doc update request has been submitted to add some more notes about this to the REST API documentation.
The behaviour in production follows the same rule that the [GraphQL equivalent appUsageRecordCreate] is documented as following, which reads:
"If you create an app usage charge that causes the total usage charges in a billing interval to exceed the capped amount, then a Total price exceeds balance remaining
error is returned."
Hope you have a great day,
Jon551 | API Support @ 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
Hi Jon551
Thanks for the update. We'll handle the response accordingly.
Hope you have a great day too!
Hi Jon551,
Any update about this bug?
It's been about 1 year and a half, and the "Total price exceeds balance remaining" error is still not raised when in test mode.