- Poll usage endpoints: Make API requests to retrieve current and past usage data.
- Subscribe to webhooks: Receive automatic notifications when usage crosses a threshold.
Get current usage
Use a valid access token and send a GET request to/v1/commerce/billing/customers/{external_id}/current_usage?subscription_id={external_id}
.
- Path parameter:
external_id
is the customer’s unique identifier you provided when registering the customer. - Query parameter:
external_id
is the subscription’s unique identifier that you create and pass as part of the create subscription call.
Note: For the exhaustive list of response parameters, see API reference.
Get past usage
Use a valid access token and send a GET request to/v1/commerce/billing/customers/{external_id}/past_usage?subscription_id={external_id}
.
- Path parameter:
external_id
is the customer’s unique identifier you provided when registering the customer. - Query parameter:
external_id
is the subscription’s unique identifier that you create and pass as part of the create subscription call.
Note: Past usage data is available once a billing period closes, regardless of subscription status.
Note: For the exhaustive list of response parameters, see API reference.