curl --request POST \
--url https://api-m.sandbox.paypal.com/v3/vault/payment-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_source": {
"token": {
"id": "5C991763VB2781612",
"type": "BILLING_AGREEMENT"
}
}
}
'{
"id": "8kk8451t",
"customer": {
"id": "customer_4029352050"
},
"payment_source": {
"card": {
"last_digits": "1111",
"expiry": "2027-02",
"brand": "VISA",
"name": "John Doe",
"billing_address": {
"address_line_1": "2211 N First Street",
"address_line_2": "17.3.160",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
},
"links": [
{
"rel": "self",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "GET",
"encType": "application/json"
},
{
"rel": "delete",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "DELETE",
"encType": "application/json"
}
]
}{
"id": "8kk8451t",
"customer": {
"id": "customer_4029352050"
},
"payment_source": {
"card": {
"last_digits": "1111",
"expiry": "2027-02",
"brand": "VISA",
"name": "John Doe",
"billing_address": {
"address_line_1": "2211 N First Street",
"address_line_2": "17.3.160",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
},
"links": [
{
"rel": "self",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "GET",
"encType": "application/json"
},
{
"rel": "delete",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "DELETE",
"encType": "application/json"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}Create payment token for a given payment source
Creates a Payment Token from the given payment source and adds it to the Vault of the associated customer.
curl --request POST \
--url https://api-m.sandbox.paypal.com/v3/vault/payment-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_source": {
"token": {
"id": "5C991763VB2781612",
"type": "BILLING_AGREEMENT"
}
}
}
'{
"id": "8kk8451t",
"customer": {
"id": "customer_4029352050"
},
"payment_source": {
"card": {
"last_digits": "1111",
"expiry": "2027-02",
"brand": "VISA",
"name": "John Doe",
"billing_address": {
"address_line_1": "2211 N First Street",
"address_line_2": "17.3.160",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
},
"links": [
{
"rel": "self",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "GET",
"encType": "application/json"
},
{
"rel": "delete",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "DELETE",
"encType": "application/json"
}
]
}{
"id": "8kk8451t",
"customer": {
"id": "customer_4029352050"
},
"payment_source": {
"card": {
"last_digits": "1111",
"expiry": "2027-02",
"brand": "VISA",
"name": "John Doe",
"billing_address": {
"address_line_1": "2211 N First Street",
"address_line_2": "17.3.160",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131",
"country_code": "US"
}
}
},
"links": [
{
"rel": "self",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "GET",
"encType": "application/json"
},
{
"rel": "delete",
"href": "https://api-m.paypal.com/v3/vault/payment-tokens/8kk8451t",
"method": "DELETE",
"encType": "application/json"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}{
"name": "<string>",
"message": "<string>",
"debug_id": "<string>",
"details": [
{
"issue": "<string>",
"field": "<string>",
"value": "<string>",
"location": "body",
"links": [
{
"href": "<string>",
"rel": "<string>"
}
],
"description": "<string>"
}
],
"links": [
{
"href": "<string>",
"rel": "<string>"
}
]
}Authorizations
Oauth 2.0 authentication
Headers
The server stores keys for 3 hours.
1 - 10000^.*$Body
Payment Token creation with a financial instrument and an optional customer_id.
Payment Token Request where the source defines the type of instrument to be stored.
The payment method to vault with the instrument details.
Show child attributes
Show child attributes
This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details.
Show child attributes
Show child attributes
Response
Idempotent response for a successful creation of payment token.
Full representation of a saved payment token.
The PayPal-generated ID for the vault token.
1 - 36^[0-9a-zA-Z_-]+$Customer in merchant's or partner's system of records.
Show child attributes
Show child attributes
The vaulted payment method details.
Show child attributes
Show child attributes
Was this page helpful?