Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I am suddenly getting "Failed to create usage charge" errors for a particular merchant. It has been working fine before and nothing has changed.
Others have reported waiting until the next billing cycle (https://community.shopify.com/c/Shopify-APIs-SDKs/422-Error-Failed-to-create-usage-charge/m-p/616997...)
But I have a lot of fees to be invoiced and waiting 2 weeks is not a good solution.
I am using GraphQL so I am sorry, I do not have Request IDs, but here are some details:
Mutation: appUsageRecordCreate
Variables
{ "subscriptionLineItemId": "gid://shopify/AppSubscriptionLineItem/13102743618?v=1&index=1", "amount": "0.75", "description": "$0.25 per ticket sold (3x July 16, 2020 03:00 PM #535318)" }
Example times (in PST -7)
Thanks for any help.
We are seeing the same problem
Hey @jineshshah36 @Jeff-Blake,
Thanks for bringing this up. Our developers were able to identify and push a fix for an issue causing usage charge updates to fail, please try those updates again and they should work as expected.
JB | Solutions Engineer @ Shopify
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey @_JB we are still getting the same error, is there a way we can provide additional details so we can get this resolved?
@_JB -- I am seeing this same error. I am able to create the subscription plan with recurring amount and usage charge.
{
"data": {
"appSubscriptionCreate": {
"userErrors": [],
"confirmationUrl": "https://chakrastonecandles-com.myshopify.com/admin/charges/17587798171/confirm_recurring_application_charge?signature=BAh7BzoHaWRsKwibgFAYBAA6EmF1dG9fYWN0aXZhdGVU--6df3bec7d9eee8c7dcf46a251311d9af4c2a4138",
"appSubscription": {
"id": "gid://shopify/AppSubscription/17587798171",
"lineItems": [
{
"id": "gid://shopify/AppSubscriptionLineItem/17587798171?v=1&index=0",
"plan": {
"pricingDetails": {
"__typename": "AppRecurringPricing"
}
}
},
{
"id": "gid://shopify/AppSubscriptionLineItem/17587798171?v=1&index=1",
"plan": {
"pricingDetails": {
"__typename": "AppUsagePricing"
}
}
}
]
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 13,
"actualQueryCost": 13,
"throttleStatus": {
"maximumAvailable": 20000.0,
"currentlyAvailable": 19987,
"restoreRate": 1000.0
}
}
}
}
When I try to update the recurring charge (the first item of the original response)
mutation {
appUsageRecordCreate(
subscriptionLineItemId: "gid://shopify/AppSubscriptionLineItem/17587798171?v=1&index=0",
price: { amount: 499.00, currencyCode: USD }
description: "Tier 2: $2M to $5M")
{
appUsageRecord {
id
}
userErrors {
field
message
}
}
}
I receive the error:
{
"data": {
"appUsageRecordCreate": {
"appUsageRecord": null,
"userErrors": [
{
"field": [
"subscriptionLineItemId"
],
"message": "Invalid id"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 20000.0,
"currentlyAvailable": 19990,
"restoreRate": 1000.0
}
}
}
}
Anything obvious that I'm doing something wrong?
Apologies, it seems I was confusing this with a different issue.
@JoeRzep thanks for the examples, I've forwarded those to our developers who are investigating as we speak.
@jineshshah36 If you'd like to provide query examples, feel free to send me a DM or share them here.
JB | Solutions Engineer @ Shopify
- 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 @_JB, I think I've figured it out. I believe I was using the WRONG ID. There were 2 "plans" in my subscription. I believe I was calling the API with the ID of the subscription, not the usage charge ID. Once I used the other ID it worked.
Not sure if this is the same issue for @jineshshah36
User | RANK |
---|---|
6 | |
4 | |
4 | |
4 | |
3 |