Overview
Tokens allow you to securely collect card details on your own payment form. Card data is tokenized in the browser using the JavaScript SDK and your publishable key, so raw card numbers never reach your server.Create Token
POST /v1/tokens
Authentication: Publishable key (pk_test_* / pk_live_*) via Bearer token
You can call this endpoint directly with
fetch or any HTTP client. The JavaScript SDK is optional — it provides client-side validation and a simpler API, but is not required.Request Parameters
object
required
Card details object
Response
string
Token ID (
tok_ prefix). Valid for 30 minutes, single use.object
Masked card details
string
Creation timestamp (ISO 8601)
string
Expiration timestamp (ISO 8601). 30 minutes after creation.
Token Errors
Using a Token for Payment
After creating a token, pass it toPOST /v1/payments:
JavaScript SDK
The JavaScript SDK is an optional convenience wrapper that provides client-side card validation and a simpler API.The SDK returns the token ID as
token (the API response field is id — the SDK renames it for convenience).