curl --request POST \
--url https://api.example.com/api/v1/tokenization/generate \
--header 'Content-Type: application/json' \
--data '
{
"tokenRequestId": "<string>",
"merchantUserId": "<string>",
"tokenType": "<string>",
"merchantInfo": {
"merchantId": "<string>",
"subMerchantId": "<string>"
},
"notifyUrl": "<string>",
"tokenData": {
"pan": "<string>",
"expiry": "<string>",
"name": "<string>",
"cvv": "<string>"
},
"billingAddress": {
"countryCode": "<string>",
"region": "<string>",
"city": "<string>",
"postalCode": "<string>",
"address": "<string>"
}
}
'import requests
url = "https://api.example.com/api/v1/tokenization/generate"
payload = {
"tokenRequestId": "<string>",
"merchantUserId": "<string>",
"tokenType": "<string>",
"merchantInfo": {
"merchantId": "<string>",
"subMerchantId": "<string>"
},
"notifyUrl": "<string>",
"tokenData": {
"pan": "<string>",
"expiry": "<string>",
"name": "<string>",
"cvv": "<string>"
},
"billingAddress": {
"countryCode": "<string>",
"region": "<string>",
"city": "<string>",
"postalCode": "<string>",
"address": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
tokenRequestId: '<string>',
merchantUserId: '<string>',
tokenType: '<string>',
merchantInfo: {merchantId: '<string>', subMerchantId: '<string>'},
notifyUrl: '<string>',
tokenData: {pan: '<string>', expiry: '<string>', name: '<string>', cvv: '<string>'},
billingAddress: {
countryCode: '<string>',
region: '<string>',
city: '<string>',
postalCode: '<string>',
address: '<string>'
}
})
};
fetch('https://api.example.com/api/v1/tokenization/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/tokenization/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tokenRequestId' => '<string>',
'merchantUserId' => '<string>',
'tokenType' => '<string>',
'merchantInfo' => [
'merchantId' => '<string>',
'subMerchantId' => '<string>'
],
'notifyUrl' => '<string>',
'tokenData' => [
'pan' => '<string>',
'expiry' => '<string>',
'name' => '<string>',
'cvv' => '<string>'
],
'billingAddress' => [
'countryCode' => '<string>',
'region' => '<string>',
'city' => '<string>',
'postalCode' => '<string>',
'address' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/tokenization/generate"
payload := strings.NewReader("{\n \"tokenRequestId\": \"<string>\",\n \"merchantUserId\": \"<string>\",\n \"tokenType\": \"<string>\",\n \"merchantInfo\": {\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\"\n },\n \"notifyUrl\": \"<string>\",\n \"tokenData\": {\n \"pan\": \"<string>\",\n \"expiry\": \"<string>\",\n \"name\": \"<string>\",\n \"cvv\": \"<string>\"\n },\n \"billingAddress\": {\n \"countryCode\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"address\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/tokenization/generate")
.header("Content-Type", "application/json")
.body("{\n \"tokenRequestId\": \"<string>\",\n \"merchantUserId\": \"<string>\",\n \"tokenType\": \"<string>\",\n \"merchantInfo\": {\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\"\n },\n \"notifyUrl\": \"<string>\",\n \"tokenData\": {\n \"pan\": \"<string>\",\n \"expiry\": \"<string>\",\n \"name\": \"<string>\",\n \"cvv\": \"<string>\"\n },\n \"billingAddress\": {\n \"countryCode\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"address\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/tokenization/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tokenRequestId\": \"<string>\",\n \"merchantUserId\": \"<string>\",\n \"tokenType\": \"<string>\",\n \"merchantInfo\": {\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\"\n },\n \"notifyUrl\": \"<string>\",\n \"tokenData\": {\n \"pan\": \"<string>\",\n \"expiry\": \"<string>\",\n \"name\": \"<string>\",\n \"cvv\": \"<string>\"\n },\n \"billingAddress\": {\n \"countryCode\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"address\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"msg": "<string>",
"msgParams": {},
"data": {
"tokenRequestId": "<string>",
"tokenSessionId": "<string>",
"merchantUserId": "<string>",
"tokenId": "<string>"
},
"success": true,
"fail": true
}Tokenization Generate
curl --request POST \
--url https://api.example.com/api/v1/tokenization/generate \
--header 'Content-Type: application/json' \
--data '
{
"tokenRequestId": "<string>",
"merchantUserId": "<string>",
"tokenType": "<string>",
"merchantInfo": {
"merchantId": "<string>",
"subMerchantId": "<string>"
},
"notifyUrl": "<string>",
"tokenData": {
"pan": "<string>",
"expiry": "<string>",
"name": "<string>",
"cvv": "<string>"
},
"billingAddress": {
"countryCode": "<string>",
"region": "<string>",
"city": "<string>",
"postalCode": "<string>",
"address": "<string>"
}
}
'import requests
url = "https://api.example.com/api/v1/tokenization/generate"
payload = {
"tokenRequestId": "<string>",
"merchantUserId": "<string>",
"tokenType": "<string>",
"merchantInfo": {
"merchantId": "<string>",
"subMerchantId": "<string>"
},
"notifyUrl": "<string>",
"tokenData": {
"pan": "<string>",
"expiry": "<string>",
"name": "<string>",
"cvv": "<string>"
},
"billingAddress": {
"countryCode": "<string>",
"region": "<string>",
"city": "<string>",
"postalCode": "<string>",
"address": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
tokenRequestId: '<string>',
merchantUserId: '<string>',
tokenType: '<string>',
merchantInfo: {merchantId: '<string>', subMerchantId: '<string>'},
notifyUrl: '<string>',
tokenData: {pan: '<string>', expiry: '<string>', name: '<string>', cvv: '<string>'},
billingAddress: {
countryCode: '<string>',
region: '<string>',
city: '<string>',
postalCode: '<string>',
address: '<string>'
}
})
};
fetch('https://api.example.com/api/v1/tokenization/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/tokenization/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tokenRequestId' => '<string>',
'merchantUserId' => '<string>',
'tokenType' => '<string>',
'merchantInfo' => [
'merchantId' => '<string>',
'subMerchantId' => '<string>'
],
'notifyUrl' => '<string>',
'tokenData' => [
'pan' => '<string>',
'expiry' => '<string>',
'name' => '<string>',
'cvv' => '<string>'
],
'billingAddress' => [
'countryCode' => '<string>',
'region' => '<string>',
'city' => '<string>',
'postalCode' => '<string>',
'address' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/tokenization/generate"
payload := strings.NewReader("{\n \"tokenRequestId\": \"<string>\",\n \"merchantUserId\": \"<string>\",\n \"tokenType\": \"<string>\",\n \"merchantInfo\": {\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\"\n },\n \"notifyUrl\": \"<string>\",\n \"tokenData\": {\n \"pan\": \"<string>\",\n \"expiry\": \"<string>\",\n \"name\": \"<string>\",\n \"cvv\": \"<string>\"\n },\n \"billingAddress\": {\n \"countryCode\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"address\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/tokenization/generate")
.header("Content-Type", "application/json")
.body("{\n \"tokenRequestId\": \"<string>\",\n \"merchantUserId\": \"<string>\",\n \"tokenType\": \"<string>\",\n \"merchantInfo\": {\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\"\n },\n \"notifyUrl\": \"<string>\",\n \"tokenData\": {\n \"pan\": \"<string>\",\n \"expiry\": \"<string>\",\n \"name\": \"<string>\",\n \"cvv\": \"<string>\"\n },\n \"billingAddress\": {\n \"countryCode\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"address\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/tokenization/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tokenRequestId\": \"<string>\",\n \"merchantUserId\": \"<string>\",\n \"tokenType\": \"<string>\",\n \"merchantInfo\": {\n \"merchantId\": \"<string>\",\n \"subMerchantId\": \"<string>\"\n },\n \"notifyUrl\": \"<string>\",\n \"tokenData\": {\n \"pan\": \"<string>\",\n \"expiry\": \"<string>\",\n \"name\": \"<string>\",\n \"cvv\": \"<string>\"\n },\n \"billingAddress\": {\n \"countryCode\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"address\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"msg": "<string>",
"msgParams": {},
"data": {
"tokenRequestId": "<string>",
"tokenSessionId": "<string>",
"merchantUserId": "<string>",
"tokenId": "<string>"
},
"success": true,
"fail": true
}Body
Tokenization request ID sent from Merchant. It will also be used for idempotent check. For example: use uuid to generate a unique serial no.
64The merchant's userId must be unique for each user of merchants.
64Types of requested tokenization: CARD.
32Merchant info.
Show child attributes
Show child attributes
The callback address to notify the merchant after the Tokenization is completed or failed.
256If your organization possesses the necessary PCI-DSS certification to store and process raw cardholder data, you may pass the sensitive card details (including pan, expiry, cvv, and name) directly within the tokenData object when calling this endpoint.
Show child attributes
Show child attributes
The cardholder's billing address.
Show child attributes
Show child attributes
Callbacks
POST{$request.body#/notifyUrl}tokenizationNotification
Body
Webhook payload POSTed to merchant's notifyUrl when token status or data changes.
Response
Merchant acknowledgement
Merchant's acknowledgement to the tokenization notification webhook. If failed/unknown is received, Waffo will retry the notification for up to 24 hours.
Processing result. Allowed values: success, failed, unknown.
success, failed, unknown "success"
Response
OK
Standard API response envelope.
Result code. "0" indicates success; any other value indicates failure.
Human-readable message corresponding to the result code.
Key-value parameters associated with the error message, used for templated errors.
Show child attributes
Show child attributes
Response payload. Empty when the request fails.
Show child attributes
Show child attributes