- 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 make a GET call to the/v1/commerce/billing/customers/{external_customer_id}/current_usage?subscription_id={subscription_id} endpoint.
- Path parameter:
external_customer_idis theexternal_idyou provided when registering the customer. - Query parameter:
subscription_idis theexternal_idyou provided when you created the subscription.
For the exhaustive list of response parameters, see API reference.
Get past usage
Use a valid access token and make a GET call to the/v1/commerce/billing/customers/{external_customer_id}/past_usage?subscription_id={subscription_id} endpoint.
- Path parameter:
external_customer_idis theexternal_idyou provided when registering the customer. - Query parameter:
subscription_idis theexternal_idyou provided when you created the subscription.
This section documents only a subset of relevant query parameters. For the exhaustive list of query parameters, see API reference.
Past usage data is available once a billing period closes, regardless of subscription status.
For the exhaustive list of response parameters, see API reference.