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/customers" \ -H "Content-Type: application/json" \ -d '{ "name": "John Doe", "external_id": "ext_cust_12345", "email": "[email protected]" }'{
"name": "TechStart Solutions",
"external_id": "5eb02857-a71e-4ea2-bcf9-1753826282",
"email": "[email protected]",
"address": {
"line1": "123 Innovation Way",
"line2": "Suite 400",
"city": "San Francisco",
"state": "CA",
"postal_code": "94087",
"country": "US"
},
"phone": "+1 (555) 789-1234",
"payment_method_token": "6ta69628uw121251c",
"payment_method_type": "CARD",
"metadata": [
{
"key": "Purchase Order",
"value": "PO-2023-4521",
"display_in_invoice": true
},
{
"key": "Sales Region",
"value": "West Coast",
"display_in_invoice": false
}
],
"id": "f772b19c-c5c2-426d-8871-346a6cd094c5"
}{
"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"
}Full name of the customer
1 <= length <= 512External identifier for the customer. Must contain only alphanumeric characters, underscores, and hyphens.
^[a-zA-Z0-9_-]*$1 <= length <= 64The internationalized email address.
^.+@[^"\-].+$3 <= length <= 254Unique code used to identify the billing entity. Must contain only alphanumeric characters, underscores, and hyphens.
^[a-zA-Z0-9_-]*$Address of the customer or party.
Primary phone number of the customer, including country code if available.
phoneToken representing the customer's saved payment method in PayPal Vault.
1 <= length <= 36List of unique codes used to identify taxes to be applied.