Skip to main content
POST
/
v2
/
tokenize
Tokenization - Create
curl --request POST \
  --url https://sandbox.hyperswitch.io/v2/tokenize \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --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

Authorization
string
header
required

Format: api-key=<api_key>

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

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"