Skip to main content
Limited Release
Usage monitoring helps you track customer consumption of metrics and send alerts when usage exceeds your set limits. You can monitor usage in two ways:
  • Poll usage endpoints: Make API requests to retrieve current and past usage data.
  • Subscribe to webhooks: Receive automatic notifications when usage crosses a threshold.
This page covers the polling approach. When you poll usage data, you retrieve current usage at frequent intervals, derive insights, and take appropriate actions. For example, if usage exceeds a threshold, you can restrict services or send alerts to customers. You can also review past usage to understand usage patterns and set thresholds.

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. Include the following parameters:
curl -X GET 'https://api-m.sandbox.paypal.com/v1/commerce/billing/customers/5eb02857-a71e-4ea2-bcf9-1753826282/current_usage?subscription_id=sub_01H3YT8P7Q5R3S1T2U0V4W9X8' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS-TOKEN>'
A successful call returns a 200 OK response with current usage data for the customer.

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. Include the following parameters: For information on all parameters, see API reference.
Past usage data is available once a billing period closes, regardless of subscription status.
curl -X GET 'https://api-m.sandbox.paypal.com/v1/commerce/billing/customers/5eb02857-a71e-4ea2-bcf9-1753826282/past_usage?subscription_id=sub_01H3YT8P7Q5R3S1T2U0V4W9X8' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <ACCESS-TOKEN>'
A successful call returns a 200 OK response with past usage summaries.