Payment Methods API

Update the default saved payment method

POST
https://api.sandbox.primer.io/payment-instruments/:paymentMethodToken/default

Update a saved payment method to be the default stored payment method for a customer.

Path parameters

paymentMethodToken
string

Saved payment method token to set to default.

Response

This endpoint return an object.
createdAt
optional datetime

Creation date & time of the object (UTC)

deletedAt
optional datetime

Date & time when this object was revoked. (UTC)

deleted
optional boolean

Whether or not this object has been revoked.

token
optional string

The vaulted payment method token.

tokenType
optional string
  • MULTI_USE a vaulted token that can be re-used with subsequent payments
analyticsId
optional string

Unique analytics identifier corresponding to a payment method

paymentMethodType
optional enum

Payment method type associated with a token.

paymentMethodData
optional union

Payment method data

customerId
optional string

The ID representing the customer

description
optional string

A friendly description given by the user

default
optional boolean

Whether or not this payment method is the default

Errors

POST
/payment-instruments/:paymentMethodToken/default
1
2
curl -X POST "https://api.sandbox.primer.io/payment-instruments/payment-method-token/default" \
     -H "X-API-KEY: <apiKey>"
Response
1
2
3
{
  "paymentMethodType": "PAYMENT_CARD"
}