Skip to main content
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 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.
On successful request processing, PayPal returns current usage data for the customer.
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>'
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.
On successful request processing, PayPal returns past usage summaries.
Note: 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>'
Note: For the exhaustive list of response parameters, see API reference.
I