On this page
No Headings
OAuth 2.0 authentication
Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/payments/realtimepaymenthttps://uri.paypal.com/services/payments/payments-readyBraintree:PaymentsReadyhttps://uri.paypal.com/services/payments/client-payments-eligibilityHolds authorization information for external API calls.
^.*$1 <= length <= 16000Header for an API client-provided JWT assertion that identifies the merchant. Establishing the consent to act-on-behalf of a merchant is a prerequisite for using this header.
^.*$1 <= length <= 10000A characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent. API calls made by PayPal SDKs SHOULD be identified using this request header.
^.*$1 <= length <= 16000A GUID value originating from Fraudnet and Dyson passed from external API clients via HTTP header. The value is used by Risk decisions to correlate calls which, in turn, might result in lower decline rates..
^[A-Za-z0-9-{}(),]*$1 <= length <= 68application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-m.sandbox.paypal.com/v2/payments/find-eligible-methods" \ -H "Authorization: Bearer A21AAGHr9qtiRRXH4oYcQokQgV99rGqEIfgrr8xHCclP0OzmD9KVgg5ppIIg1jzJgQkV4wd02svIvBJyg6cLFJjFow_SjBhxQ" \ -H "PayPal-Auth-Assertion: eyJhbGciOiJub25lIn0.eyJlbWFpbCI6Im15QGVtYWlsLmNvbSJ9" \ -H "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405" \ -H "PayPal-Client-Metadata-Id: 1295065d-6f34-42dc-ac65-fac0c86af250" \ -H "Content-Type: application/json" \ -d '{ "customer": { "country_code": "US", "channel": { "browser_type": "SAFARI", "device_type": "MOBILE", "client_os": "IOS" } }, "purchase_units": [ { "amount": { "currency_code": "USD", "value": "100.00" } } ], "preferences": { "payment_source_constraint": { "constraint_type": "EXCLUDE", "payment_sources": [ "PAYPAL" ] } } }'{
"eligible_methods": {
"venmo": {
"can_be_vaulted": true
}
}
}{
"name": "INVALID_REQUEST",
"debug_id": "b1d1f06c7246c",
"message": "Request is not well-formed, syntactically incorrect, or violates schema",
"details": [
{
"field": "/customer/country_code",
"value": "USA",
"location": "body",
"issue": "INVALID_STRING_LENGTH",
"description": "The value of a field is either too short or too long."
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/payments/v2/#errors",
"rel": "information_link",
"method": "GET",
"encType": "application/json"
}
]
}{
"name": "AUTHENTICATION_FAILURE",
"debug_id": "b1d1f06c7246c",
"message": "Authentication failed due to missing Authorization header, or invalid authentication credentials."
}{
"name": "NOT_AUTHORIZED",
"debug_id": "b1d1f06c7246c",
"message": "Authorization failed due to insufficient permissions."
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "90bff07028f7f",
"details": [
{
"field": "/purchase_units/amount/currency_code",
"value": "III",
"issue": "INVALID_CURRENCY_CODE",
"description": "Currency code is invalid. Please refer https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ for list of supported currency codes."
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/payments/v2/#errors",
"rel": "information_link",
"method": "GET"
}
]
}{
"name": "INTERNAL_SERVER_ERROR",
"debug_id": "b1d1f06c7246c",
"message": "An internal server error has occurred."
}{
"name": "INTERNAL_SERVER_ERROR",
"debug_id": "b1d1f06c7246c",
"message": "An internal server error has occurred."
}Customer who is making a purchase from the merchant/partner.
Array of purchase units.
1 <= items <= 10Preferences of merchant/partner consuming the API.