On this page
No Headings
Use the /v1/oauth2/token endpoint to obtain an access token and pass it as a Bearer token in the Authorization header.
Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
readwriteapplication/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-m.sandbox.paypal.com/v1/commerce/billing/events" \ -H "Content-Type: application/json" \ -d '{ "transaction_id": "txn_1234567890abcdef", "external_subscription_id": "sub_1234567890abcdef", "metric_code": "event_code_123456" }'{
"transaction_id": "event_1753818829",
"metric_code": "91624203-791a-4639-8c86-4693948b3a41",
"external_subscription_id": "d2d628e8-e7fb-412f-b09c-7f70ee58b50a",
"timestamp": "2025-07-29T12:53:49.076-07:00",
"properties": {
"gb": 10
},
"id": "d80447f2-0f34-4612-86ae-152160dc66c5",
"created_at": "2025-07-29T12:53:49-07:00"
}{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "dc99e3955cdd8",
"details": [
{
"field": "/email",
"value": "abc",
"location": "body",
"issue": "INVALID_PARAMETER_VALUE",
"description": "The value of a field does not conform to the expected format."
}
]
}{
"name": "NOT_AUTHORIZED",
"message": "Authorization failed due to insufficient permissions.",
"debug_id": "565f78f101498",
"details": [
{
"issue": "PERMISSION_DENIED",
"description": "You do not have permission to access or perform operations on this resource."
}
]
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "90957fca61718",
"details": [
{
"field": "/email",
"value": "[email protected]",
"location": "body",
"issue": "UNSUPPORTED_EMAIL",
"description": "The email provided is not supported."
}
]
}{
"name": "INTERNAL_SERVER_ERROR",
"message": "An internal server error has occurred.",
"debug_id": "90957fca61718"
}Unique identifier for the transaction associated with the event
External subscription ID associated with the event
Identifier for the targeted metric. This value must match the code property of an active metric; otherwise, it will be disregarded during processing.
Timestamp when the event occurred
date-time