GraphQL appUsageRecordCreate - test mode?

Highlighted
Shopify Partner
29 0 3

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
Highlighted
Shopify Staff
Shopify Staff
1040 139 165

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