Skip to main content
POST
/
v3
/
vault
/
setup-tokens
Create a setup token
curl --request POST \
  --url https://api-m.sandbox.paypal.com/v3/vault/setup-tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "payment_source": {
    "card": {
      "number": "4111111111111111",
      "expiry": "2027-02",
      "name": "John Doe",
      "billing_address": {
        "address_line_1": "2211 N First Street",
        "address_line_2": "17.3.160",
        "admin_area_1": "CA",
        "admin_area_2": "San Jose",
        "postal_code": "95131",
        "country_code": "US"
      },
      "experience_context": {
        "brand_name": "YourBrandName",
        "locale": "en-US",
        "return_url": "https://example.com/returnUrl",
        "cancel_url": "https://example.com/cancelUrl"
      }
    }
  }
}'
{
  "id": "5C991763VB2781612",
  "customer": {
    "id": "customer_4029352050"
  },
  "status": "APPROVED",
  "payment_source": {
    "card": {
      "last_digits": "1111",
      "expiry": "2027-02",
      "name": "John Doe",
      "billing_address": {
        "address_line_1": "2211 N First Street",
        "address_line_2": "17.3.160",
        "admin_area_1": "CA",
        "admin_area_2": "San Jose",
        "postal_code": "95131",
        "country_code": "US"
      }
    }
  },
  "links": [
    {
      "rel": "self",
      "href": "https://api-m.paypal.com/v3/vault/setup-tokens/5C991763VB2781612",
      "method": "GET",
      "encType": "application/json"
    },
    {
      "rel": "confirm",
      "href": "https://api-m.paypal.com/v3/vault/payment-token",
      "method": "POST",
      "encType": "application/json"
    }
  ]
}

Authorizations

Authorization
string
header
required

Oauth 2.0 authentication

Headers

PayPal-Request-Id
string

The server stores keys for 3 hours.

Required string length: 1 - 10000

Body

application/json

Setup Token creation with a instrument type optional financial instrument details and customer_id.

Setup Token Request where the source defines the type of instrument to be stored.

payment_source
object
required

The payment method to vault with the instrument details.

customer
object

This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details.

Response

Idempotent response for a successful creation of setup token.

Minimal representation of a cached setup token.

id
string

The PayPal-generated ID for the vault token.

Required string length: 1 - 36
customer
object

This object defines a customer in your system. Use it to manage customer profiles, save payment methods and contact details.

status
enum<string>
default:CREATED

The status of the payment token.

Available options:
CREATED,
PAYER_ACTION_REQUIRED,
APPROVED,
VAULTED,
TOKENIZED
payment_source
object

The setup payment method details.

An array of related HATEOAS links.

Required array length: 1 - 32 elements
I