GraphQL appUsageRecordCreate - test mode?

Jeff-Blake
Shopify Partner
35 0 4

I'm migrating a few API calls from REST to GraphQL. In REST, there was a test parameter for creating Usage Charges. In GraphQL, this does not exist. I tried creating a usage record for a test subscription, and it worked, but no activity showed up in the App history.

 

Here is how I think it works, can someone from Shopify confirm?

  • A UsageCharge created for a test subscription is automatically set to a test. (i.e. not billed)
  • A UsageCharge created for a non-test subscription is a real charge
  • It is not possible to create a test usageCharge for a non-test subscription as the `test` parameter does not exist for the appUsageRecordCreate mutation

Thanks!

0 Likes
SBD_
Shopify Staff
Shopify Staff
1089 147 199

Hey @Jeff-Blake 

 

In REST, there was a test parameter for creating Usage Charges. 

I think the `test` parameter is part of the parent RecurringApplicationCharge, not the UsageCharge.

 

A UsageCharge created for a test subscription is automatically set to a test. (i.e. not billed). A UsageCharge created for a test subscription is automatically set to a test. (i.e. not billed). It is not possible to create a test usageCharge for a non-test subscription as the `test` parameter does not exist for the appUsageRecordCreate mutation.

Yep, that all sounds accurate.

 

 

 

 

0 Likes
sravans
Excursionist
18 1 4

@SBD_ Does that mean I will not see a charged amount for appUsageRecordCreate in a test mode(e.g., when the subscription is a test mode subscription)?

Upon appUsageRecordCreate I always get balanceUsed as "0.0" for test mode subscription, also there is no charge happened to the merchant at shop admin. As explained here.

In that case, how can I make sure I charge the merchant the correct amount before pushing live?

Thank you.

 

0 Likes
sravans
Excursionist
18 1 4

Never mind, app reinstall did the trick.

0 Likes