Create One Time Use Token (SDK Checkout)
Generates a one time volatile token for secure payment processing within an active checkout session
POST
/
checkout
/
sessions
/
{checkout_session}
/
token
cURL
curl --request POST \
--url https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token \
--header 'Content-Type: application/json' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"account_id": "{{account_id}}",
"card_data": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
},
"payment_method": {
"type": "CARD",
"card": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
}
}
}
'import requests
url = "https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token"
payload = {
"account_id": "{{account_id}}",
"card_data": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
},
"payment_method": {
"type": "CARD",
"card": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
}
}
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: '{{account_id}}',
card_data: {
number: '4111111111111111',
expiration_month: 12,
expiration_year: 29,
security_code: '123',
holder_name: 'John Doe'
},
payment_method: {
type: 'CARD',
card: {
number: '4111111111111111',
expiration_month: 12,
expiration_year: 29,
security_code: '123',
holder_name: 'John Doe'
}
}
})
};
fetch('https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token', 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-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token",
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([
'account_id' => '{{account_id}}',
'card_data' => [
'number' => '4111111111111111',
'expiration_month' => 12,
'expiration_year' => 29,
'security_code' => '123',
'holder_name' => 'John Doe'
],
'payment_method' => [
'type' => 'CARD',
'card' => [
'number' => '4111111111111111',
'expiration_month' => 12,
'expiration_year' => 29,
'security_code' => '123',
'holder_name' => 'John Doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token"
payload := strings.NewReader("{\n \"account_id\": \"{{account_id}}\",\n \"card_data\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n },\n \"payment_method\": {\n \"type\": \"CARD\",\n \"card\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{{account_id}}\",\n \"card_data\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n },\n \"payment_method\": {\n \"type\": \"CARD\",\n \"card\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"{{account_id}}\",\n \"card_data\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n },\n \"payment_method\": {\n \"type\": \"CARD\",\n \"card\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"token": "dab106a6-9067-4418-ae43-6045663531dc",
"vaulted_token": null,
"vault_on_success": false,
"type": "CARD",
"card_data": {
"holder_name": "John Doe",
"iin": "41111111",
"lfd": "1111",
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"type": "DEBIT",
"category": "CLASSIC",
"issuer_name": "CONOTOXIA SP Z O O",
"issuer_code": null,
"fingerprint": null,
"country_code": "PL"
},
"customer": null,
"installment": null,
"country": "BR",
"customer_session": null
}Creates a one-time volatile token for secure payment processing within a checkout session.
Authorizations
Path Parameters
Checkout session identifier (UUID).
Body
application/json
Response
201 - application/json
Created
Example:
"dab106a6-9067-4418-ae43-6045663531dc"
Example:
false
Example:
"CARD"
Show child attributes
Show child attributes
Example:
"BR"
ACH only. Bank transfer details derived from the token request.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
cURL
curl --request POST \
--url https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token \
--header 'Content-Type: application/json' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>' \
--data '
{
"account_id": "{{account_id}}",
"card_data": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
},
"payment_method": {
"type": "CARD",
"card": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
}
}
}
'import requests
url = "https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token"
payload = {
"account_id": "{{account_id}}",
"card_data": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
},
"payment_method": {
"type": "CARD",
"card": {
"number": "4111111111111111",
"expiration_month": 12,
"expiration_year": 29,
"security_code": "123",
"holder_name": "John Doe"
}
}
}
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
account_id: '{{account_id}}',
card_data: {
number: '4111111111111111',
expiration_month: 12,
expiration_year: 29,
security_code: '123',
holder_name: 'John Doe'
},
payment_method: {
type: 'CARD',
card: {
number: '4111111111111111',
expiration_month: 12,
expiration_year: 29,
security_code: '123',
holder_name: 'John Doe'
}
}
})
};
fetch('https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token', 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-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token",
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([
'account_id' => '{{account_id}}',
'card_data' => [
'number' => '4111111111111111',
'expiration_month' => 12,
'expiration_year' => 29,
'security_code' => '123',
'holder_name' => 'John Doe'
],
'payment_method' => [
'type' => 'CARD',
'card' => [
'number' => '4111111111111111',
'expiration_month' => 12,
'expiration_year' => 29,
'security_code' => '123',
'holder_name' => 'John Doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$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-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token"
payload := strings.NewReader("{\n \"account_id\": \"{{account_id}}\",\n \"card_data\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n },\n \"payment_method\": {\n \"type\": \"CARD\",\n \"card\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{{account_id}}\",\n \"card_data\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n },\n \"payment_method\": {\n \"type\": \"CARD\",\n \"card\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/checkout/sessions/{checkout_session}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"{{account_id}}\",\n \"card_data\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n },\n \"payment_method\": {\n \"type\": \"CARD\",\n \"card\": {\n \"number\": \"4111111111111111\",\n \"expiration_month\": 12,\n \"expiration_year\": 29,\n \"security_code\": \"123\",\n \"holder_name\": \"John Doe\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"token": "dab106a6-9067-4418-ae43-6045663531dc",
"vaulted_token": null,
"vault_on_success": false,
"type": "CARD",
"card_data": {
"holder_name": "John Doe",
"iin": "41111111",
"lfd": "1111",
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"type": "DEBIT",
"category": "CLASSIC",
"issuer_name": "CONOTOXIA SP Z O O",
"issuer_code": null,
"fingerprint": null,
"country_code": "PL"
},
"customer": null,
"installment": null,
"country": "BR",
"customer_session": null
}