Cost+Docs

Tokenize card details

Exchange a card PAN and setup token for a vault token. This endpoint is used as part of the custom card entry form flow — after creating an order with `setup_token: true`, use this endpoint to securely vault the card details. **Note:** This endpoint is authenticated via the `setup_token`, not your API key. No `Authorization` header is required.

POST
/tokens/

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST https://api.costplus.online/v1/tokens/ \  -H 'Content-Type: application/json' \  -d '{ "pan": "4111111111111111", "expiry_date": "1228", "setup_token": "SETUP_TOKEN_FROM_ORDER" }'
{
  "vault_token": "string"
}
Empty