Solved

Admin REST API: Getting a list of usage charges always returns an empty array

Yannik1
Shopify Partner
5 1 3

Hello,


when I am creating a usage charge via the Admin REST API, I get a successful result (201 Created) and it returns the created object. The property "balance_used" stays "0.0" (see screenshot). I expect that "balance_used" is will be increased by the "price". But it is not.

 
Bildschirmfoto 2022-07-11 um 14.26.30.png

Date: Mon, 11 Jul 2022 12:25:08 GMT
X-Request-ID: 1d52d9a7-329c-492b-a120-2f69b76359af


 

When I try to get a list of all usage charges, I always get an empty array instead of a filled array that includes the new created object.

In this test cases I used API version 2022-07, but I have the same issue with 2022-04.

I am testing the REST endpoints on a development shop. I used a working and approved plan in my test cases. The same test cases worked a week ago (04.07.22) as expected. I also tried using the GraphQL API with the same negative test results.

 

Bildschirmfoto 2022-07-11 um 14.28.46.png

Date: Mon, 11 Jul 2022 12:28:35 GMT
X-Request-ID: 3e932858-129a-4aa0-9503-70dc9b8629e9


Has anyone an idea how to solve this issue?

With kind regards
Yannik

Accepted Solution (1)

Yannik1
Shopify Partner
5 1 3

This is an accepted solution.

Shopify has fixed this issue. Now it is working as expected and described in their documentation.

View solution in original post

Replies 12 (12)

gentlemon
Shopify Partner
17 0 3

We have the same exact issue with our app. This seems to happen since a couple of days.

Any idea how to fix this? Seems to be a shopify api issue.

gentlemon
Shopify Partner
17 0 3

I just checked the changelog, at it seems our issues more or less match with this new change:

https://shopify.dev/changelog/new-webhooks-and-app-events-for-app-usage-spending-limits-and-changes-...

Since there was something changed on this endpoint, I assume this is connected to the issue. 

moondance4n
Shopify Partner
6 0 0

Having the same issue with UsageCharge: balance_used is always 0, UsageCharge list is always empty. Any changes / solutions so far?

gentlemon
Shopify Partner
17 0 3

Unfortunately not yet. I checked our logs and just confirmed that this worked at some point before shopify applied their changes. since then we see this issue. 

moondance4n
Shopify Partner
6 0 0

Is it possible to use GraphQL instead?
Can't figure out if this doc is suitable for that: https://shopify.dev/api/admin-graphql/2022-07/mutations/appUsageRecordCreate
Have no idea what does this param means and where to get it: subscriptionLineItemId

moondance4n
Shopify Partner
6 0 0

I've checked GraphQL version - doesn't work either

moondance4n
Shopify Partner
6 0 0

@Jason  hi, could you please help with the problem or at least clarify if Shopify really has the issue after the latest updates? Thanks in advance

Yannik1
Shopify Partner
5 1 3

I received an answer from the technical support. They confirmed that this is an issue with the Shopify API. They recorded this issue and created an internal ticket. So I guess we need to wait for the bugfix.

 

In addition the support told me, that this behavior should NOT appear at "real" shops. They recommended me to test the endpoints on a "real" shop. I will let you guys know as soon as i have tested it.

moondance4n
Shopify Partner
6 0 0

hi @Yannik1 , any results so far?

Yannik1
Shopify Partner
5 1 3

Unfortunately I am not able to test in on a live shop. When we use a not-listed app, the Billing API is not available and other wise the app needs to be in the app store (fully released) to install it on a real shop. Maybe someone else can test it with his released app on a live shop.

intrinsic_ds
Visitor
1 0 0

Running into the same issue on Rest using a 'real' shop. We're not developers creating our own app though, we're simply trying to pull a list of usage charges for apps we have already configured (plus other regular recurring charges). Have had the same issue on the RecurringApplicationCharge and ApplicationCharge endpoint(s). 

Yannik1
Shopify Partner
5 1 3

This is an accepted solution.

Shopify has fixed this issue. Now it is working as expected and described in their documentation.