Payment Methods API

Save a payment method token

POST

Save a SINGLE_USE payment method token so it can be used again later.

If you try to vault an already vaulted token, you will get the existing vaulted token back.

Path parameters

paymentMethodTokenstringRequired
Payment method token to store.

Request

This endpoint expects an object.
customerId
stringRequired
The ID representing the customer

Response

This endpoint returns an object
analyticsId
stringOptional
Unique analytics identifier corresponding to a payment method
createdAt
datetimeOptional
Creation date & time of the object (UTC)
customerId
stringOptional
The ID representing the customer
default
booleanOptional
Whether or not this payment method is the default
deleted
booleanOptional
Whether or not this object has been revoked.
deletedAt
datetimeOptional
Date & time when this object was revoked. (UTC)
description
stringOptional
A friendly description given by the user
isVerified
booleanOptional
Whether or not this payment method was verified
paymentMethodData
unionOptional
Payment method data
paymentMethodType
enumOptional
Payment method type associated with a token.
token
stringOptional
The vaulted payment method token.
tokenType
stringOptional
  • MULTI_USE a vaulted token that can be re-used with subsequent payments

Errors

POST
$curl -X POST https://api.sandbox.primer.io/payment-instruments/string/vault \
> -H "X-API-KEY: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "customerId": "string"
>}'
Response
1{
2 "paymentMethodData": {
3 "last4Digits": "string",
4 "expirationMonth": "string",
5 "expirationYear": "string",
6 "binData": {
7 "network": "AMEX",
8 "issuerCountryCode": "AW",
9 "issuerCurrencyCode": "AED",
10 "regionalRestriction": "DOMESTIC_USE_ONLY",
11 "accountNumberType": "PRIMARY_ACCOUNT_NUMBER",
12 "accountFundingType": "CREDIT",
13 "prepaidReloadableIndicator": "RELOADABLE",
14 "productUsageType": "CONSUMER",
15 "productCode": "string",
16 "productName": "string"
17 }
18 },
19 "paymentMethodType": "PAYMENT_CARD"
20}