Skip to main content
POST
/
v2
/
tokenize
Tokenization - Create
curl --request POST \
  --url https://sandbox.hyperswitch.io/v2/tokenize \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "customer_id": "12345_cus_0196d94b9c207333a297cbcf31f2e8c8",
  "token_request": {
    "payment_method_data": {
      "card": {
        "card_holder_name": "test name"
      }
    }
  }
}'
{
  "id": "12345_tok_01926c58bc6e77c09e809964e72af8c8",
  "created_at": "2024-02-24T11:04:09.922Z",
  "flag": "enabled"
}

Authorizations

api-key
string
header
required

Ephemeral keys provide temporary access to singular data, such as access to a single customer object for a short period of time.

Body

application/json
customer_id
string
required

Customer ID for which the tokenization is requested

Example:

"12345_cus_01926c58bc6e77c09e809964e72af8c8"

token_request
object
required

Request for tokenization which contains the data to be tokenized

Response

Token created successfully

id
string
required

Unique identifier returned by the tokenization service

Example:

"12345_tok_01926c58bc6e77c09e809964e72af8c8"

created_at
string<date-time>
required

Created time of the tokenization id

Example:

"2024-02-24T11:04:09.922Z"

flag
string
required

Status of the tokenization id created

Example:

"enabled"