Can't get around "Total price exceeds balance remaining" error when applying Usage Charge

I am currently working on a Shopify app the employs the Recurring Application Charge billing model. The app has been installed by a store and a RecurringApplicationCharge has been created, in this case with a cap of $4.00. Below is a screenshot of the charge information returned from the API:

When I try to place a Usage Charge (of value $2.00) against this exact Recurring Application Charge, I am returned the following:

To summarise, I am constantly getting a response of:

Status: 422 (Unprocessable Entity) 

{
    "errors": {
        "base": [
            "Total price exceeds balance remaining"
        ]
    }
}

I have tried applying different amounts, all with the same outcome. In the past, we have been able to apply usage charges to this store with previous tests. However, upon most recently creating a RecurringApplicationCharge on this store, we haven’t been able to get past this issue.

I would be grateful for any help or insight into this.

Thanks.

Hello,

This seems more related to Apps then subscriptions, so we moved this question to shopify-apps.

But from looking at the API doc briefly, I have a hunch that the issue might be because the terms property wasn’t provided, which is required when capped_amount property is present: https://shopify.dev/api/admin-rest/2022-01/resources/recurringapplicationcharge#resource-object.

Thank you for your quick reply, and thanks for getting this post into the right place. I went back over the RecurringApplicationCharge creation and we did set terms upon creation so unfortunately doesn’t look like the problem.

We have also since (using the same code/configuration) created a new charge with the store which is working correctly and accepting UsageCharges.

Let me know if additional information is required to assist in understanding this problem, and thanks again for your help so far.

Looking in to this problem further it looks we have come up with 2 things we think could potentially be the problem and are wondering if you can help us with this,

  • that the first application charge was cancelled and then the next one is locked in to this “Total price exceeds balance remaining” state

  • or that there is an issue with the floating point problem as the balance remaining some time sis incorrect and looks like it due to this “balance_remaining”: 1.1099999999999999,

Hey there!

Ran into a similar issue with a client of ours. Here’s what looks to be going on:

E.g

  1. Client starts a subscription Jan 1 → Jan 30, 10$ cap. (created_at=jan 1, billing_on=jan 30)

  2. Jan 15, cap is reached.

  3. Jan 16, client cancels sub.

  4. Jan 17 client creates a new sub, max cap 20$ (Note the created_at=jan 17, and billing_on=jan 30)

  5. You charge the client 1$ on jan 18 → Technically even though the first sub is cancelled, that “max cap” is still being adhered to. From a merchant perspective this makes sense (I guess?), but anyways, the API responses should be updated IMO to make this more clear.

  6. On feb 1, if you try to charge the client 1$ it’ll work fine.

Generally the “hint” of this can be seen in the fact that you’re “created_at” date and the “billing_on” date aren’t 30 days apart in the new sub. That “billing_on” date is probably 30 days from the “first subscription”

TLDR: The client’s first sub limits are being adhered to regardless of a cancel/new sub. Once the “billing_on” date is reached, the new threshold will be used and things will go back to normal.

Hi Team,

I ran into a similar issue. Please find the seller’s subscription details below.
Subscribed on: 24 Apr 2022

Capped amount: 1000.0

Remaining balance: 965.89
Commission fee: 3.6

When we try to charge the seller, we get a “Total price exceeds balance remaining” error.

Full response:

{
    "cost": {
        "actualQueryCost": 10,
        "requestedQueryCost": 10,
        "throttleStatus": {
            "currentlyAvailable": 990,
            "maximumAvailable": 1000.0,
            "restoreRate": 50.0
        }
    }
}

Can you please check this?

Hello @swilcox , I have a question, with above response of recurring plan, when shopify monthly charge It will charge price + balance_used?