We are able to create usage record either via REST or GraphQL but the balance is always zero and balance remaining always the same. ‘Test charge’ is not an issue as it was working successfully for test charge during implementation. But all of a sudden, it just stopped working. The API reference is here:
GraphQL: https://shopify.dev/api/admin-graphql/2022-04/mutations/appUsageRecordCreate
The return from the API when we create the usage charge (Created Under Subscription ID: 21821161601):
{
"usage_charge": {
"id": 352908247041,
"description": "Test charge 3",
"price": "0.15",
"created_at": "2022-07-11T22:55:54-04:00",
"billing_on": "2022-07-11",
"balance_used": 0.0,
"balance_remaining": 45.0,
"risk_level": 0.0
}
}
{
"usage_charge": {
"id": 352970375169,
"description": "Test charge 4",
"price": "0.15",
"created_at": "2022-07-11T23:05:00-04:00",
"billing_on": "2022-07-11",
"balance_used": 0.0,
"balance_remaining": 45.0,
"risk_level": 0.0
}
}
Also, when we are trying to retrieve the usage charge, it is returning empty array in case of ‘list of usage charge’ and returning ‘Not found’ incase ‘single usage charge’
API reference: