Recurring Usage Charge

danielfv
New Member
2 0 0

I'm trying to create a Usage Charge on a Shop and it's not working. I have a lot of Shops using the same flow and it's working...

 

Data = {'usage_charge': {'description': 'Test', 'price': '0.05'}}

 

{"errors":{"base":["Failed to create usage charge"]}}
Request id: 5594f87f-1979-4c89-b469-e7f0e8e8193a

 

I tried creating a new recurring charge on the Shop and it's not working...

 

 

0 Likes
SBD_
Shopify Staff
Shopify Staff
1071 143 189

This appears to be because the usage charge was created before the base recurring application charge was activated.

0 Likes
danielfv
New Member
2 0 0

The charge is active, I cant create the usage charge on it, always receives the same error. I tried creating a new charge (which usually fixes this problem) but still not working on this particular store.

 

 

0 Likes
RobTheDeveloper
New Member
2 0 1

Same issue here. Recurring Charge is active but can't create usage charges.

Recurring charge:

    {
      "id": 123,
      "name": "",
      "api_client_id": 123,
      "price": "25.00",
      "status": "active",
      "return_url": ".",
      "billing_on": "2020-06-17",
      "created_at": "2020-06-01T17:00:36-04:00",
      "updated_at": "2020-06-01T17:04:40-04:00",
      "test": false,
      "activated_on": "2020-06-01",
      "cancelled_on": null,
      "trial_days": 0,
      "capped_amount": "5.00",
      "trial_ends_on": "2020-06-01",
      "balance_used": 0,
      "balance_remaining": 5,
      "risk_level": 0.8736666666666667,
      "decorated_return_url": "."
    },

But all attempts to create a usage charge with the ID of the RecurringCharge above fail with HTTP error 422 and this error:

{"errors":{"base":["Failed to create usage charge"]}}                                                                                                                                                                                 

API request ID as per HTTP Headers:

 

x-request-id: 90127d53-90bf-4c54-a6a0-7a9e2dd49235

 

fwiw, the recurring charge was recently updated by the shop owner. Usage charges worked just fine with the original recurring charge (which his no inactive).

0 Likes
SBD_
Shopify Staff
Shopify Staff
1071 143 189

Thanks @danielfv + @RobTheDeveloper 

Reporting this to the app billing team. Are you still able to replicate?

0 Likes
RobTheDeveloper
New Member
2 0 1

Yes, still able to replicate.

_JB
Shopify Staff
Shopify Staff
809 95 176

Hey @RobTheDeveloper @danielfv,

Just wanted to let you know our developers have shipped a fix which resolves the issue with updating usageCharges, so you shouldn't see errors any more regardless of when the original recurringCharge was created. Please don't hesitate to reach out if there are any questions we can answer.

JB | Developer 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

0 Likes