Skip to main content
POST
/
api
/
public
/
v1
/
payment-instruments
/
create-from-token
curl --request POST \
  --url https://app.localhost:3000/api/public/v1/payment-instruments/create-from-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "tagadaToken": "eyJ0eXBlIjoiY2FyZCIsInRva2VuIjoiYnRfdG9rZW5fMTIzIiwicHJvdmlkZXIiOiJiYXNpc3RoZW9yeSIsIm5vblNlbnNpdGl2ZU1ldGFkYXRhIjp7Imxhc3Q0IjoiNDI0MiIsImJyYW5kIjoidmlzYSIsImV4cGlyeU1vbnRoIjoxMiwiZXhwaXJ5WWVhciI6MjAyNX19",
  "storeId": "store_eaa20d619f6b",
  "customerId": "cus_123"
}
'
{
  "paymentInstrument": {
    "id": "pi_123",
    "type": "card",
    "customerId": "cus_123",
    "accountId": "acc_123",
    "isActive": true,
    "isDefault": false,
    "tokenizer": "basistheory",
    "createdAt": "2024-03-20T10:30:00Z",
    "card": {
      "last4": "4242",
      "brand": "visa",
      "expYear": 2025,
      "expMonth": 12
    }
  },
  "customer": {
    "id": "cus_123",
    "email": "john@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "createdAt": "2024-03-20T10:30:00Z"
  }
}

Authorizations

Authorization
string
header
required

Enter your API key as: Bearer your-api-key

Body

application/json
tagadaToken
string
required
storeId
string
required
customerId
string
customerData
object

Response

Successful response