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/events/batch" \ -H "Content-Type: application/json" \ -d '{ "events": [ { "transaction_id": "event_t1_1753838783", "external_subscription_id": "91624203-791a-4639-8c86-4693948b3a41", "metric_code": "Billable_Metrics_1753827008", "timestamp": "2023-01-01T00:00:00Z", "properties": { "gb": 10 } }, { "transaction_id": "event_t2_1753838783", "external_subscription_id": "91624203-791a-4639-8c86-4693948b3a41", "metric_code": "Billable_Metrics_1753827008", "timestamp": "2023-01-01T00:00:00Z", "properties": { "gb": 10 } } ] }'{
"status": "ACCEPTED",
"results": {
"success_count": 2,
"error_count": 0
}
}{
"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": "transaction_id",
"issue": "RESOURCE_ALREADY_EXISTS",
"description": "The resource identified by `field` already exists."
}
]
}{
"name": "INTERNAL_SERVER_ERROR",
"message": "An internal server error has occurred.",
"debug_id": "90957fca61718"
}