curl --request POST \
--url https://{api}.subotiz.com/api/v1/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Request-Id: <request-id>' \
--data '
{
"order_id": "<string>",
"line_items": [
{
"price_id": "<string>",
"quantity": "<string>",
"quantity_editable": true,
"quantity_min": "<string>",
"quantity_max": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {
'Request-Id': '<request-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
order_id: '<string>',
line_items: [
{
price_id: '<string>',
quantity: '<string>',
quantity_editable: true,
quantity_min: '<string>',
quantity_max: '<string>'
}
]
})
};
fetch('https://{api}.subotiz.com/api/v1/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/session"
payload = {
"order_id": "<string>",
"line_items": [
{
"price_id": "<string>",
"quantity": "<string>",
"quantity_editable": True,
"quantity_min": "<string>",
"quantity_max": "<string>"
}
]
}
headers = {
"Request-Id": "<request-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api}.subotiz.com/api/v1/session",
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([
'order_id' => '<string>',
'line_items' => [
[
'price_id' => '<string>',
'quantity' => '<string>',
'quantity_editable' => true,
'quantity_min' => '<string>',
'quantity_max' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Request-Id: <request-id>"
],
]);
$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}.subotiz.com/api/v1/session"
payload := strings.NewReader("{\n \"order_id\": \"<string>\",\n \"line_items\": [\n {\n \"price_id\": \"<string>\",\n \"quantity\": \"<string>\",\n \"quantity_editable\": true,\n \"quantity_min\": \"<string>\",\n \"quantity_max\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Id", "<request-id>")
req.Header.Add("Authorization", "Bearer <token>")
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}.subotiz.com/api/v1/session")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"<string>\",\n \"line_items\": [\n {\n \"price_id\": \"<string>\",\n \"quantity\": \"<string>\",\n \"quantity_editable\": true,\n \"quantity_min\": \"<string>\",\n \"quantity_max\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Id"] = '<request-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": \"<string>\",\n \"line_items\": [\n {\n \"price_id\": \"<string>\",\n \"quantity\": \"<string>\",\n \"quantity_editable\": true,\n \"quantity_min\": \"<string>\",\n \"quantity_max\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"message": "<string>",
"data": {
"session_id": "<string>",
"session_url": "<string>"
}
}Create Checkout Session
Create Checkout Session
curl --request POST \
--url https://{api}.subotiz.com/api/v1/session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Request-Id: <request-id>' \
--data '
{
"order_id": "<string>",
"line_items": [
{
"price_id": "<string>",
"quantity": "<string>",
"quantity_editable": true,
"quantity_min": "<string>",
"quantity_max": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {
'Request-Id': '<request-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
order_id: '<string>',
line_items: [
{
price_id: '<string>',
quantity: '<string>',
quantity_editable: true,
quantity_min: '<string>',
quantity_max: '<string>'
}
]
})
};
fetch('https://{api}.subotiz.com/api/v1/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{api}.subotiz.com/api/v1/session"
payload = {
"order_id": "<string>",
"line_items": [
{
"price_id": "<string>",
"quantity": "<string>",
"quantity_editable": True,
"quantity_min": "<string>",
"quantity_max": "<string>"
}
]
}
headers = {
"Request-Id": "<request-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api}.subotiz.com/api/v1/session",
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([
'order_id' => '<string>',
'line_items' => [
[
'price_id' => '<string>',
'quantity' => '<string>',
'quantity_editable' => true,
'quantity_min' => '<string>',
'quantity_max' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Request-Id: <request-id>"
],
]);
$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}.subotiz.com/api/v1/session"
payload := strings.NewReader("{\n \"order_id\": \"<string>\",\n \"line_items\": [\n {\n \"price_id\": \"<string>\",\n \"quantity\": \"<string>\",\n \"quantity_editable\": true,\n \"quantity_min\": \"<string>\",\n \"quantity_max\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Id", "<request-id>")
req.Header.Add("Authorization", "Bearer <token>")
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}.subotiz.com/api/v1/session")
.header("Request-Id", "<request-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"<string>\",\n \"line_items\": [\n {\n \"price_id\": \"<string>\",\n \"quantity\": \"<string>\",\n \"quantity_editable\": true,\n \"quantity_min\": \"<string>\",\n \"quantity_max\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api}.subotiz.com/api/v1/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Id"] = '<request-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": \"<string>\",\n \"line_items\": [\n {\n \"price_id\": \"<string>\",\n \"quantity\": \"<string>\",\n \"quantity_editable\": true,\n \"quantity_min\": \"<string>\",\n \"quantity_max\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"message": "<string>",
"data": {
"session_id": "<string>",
"session_url": "<string>"
}
}Authorizations
Headers
Body
Create checkout session request
Specify the language for the checkout session. The default language is determined based on the browser language. Optional Values:
- ar-SA:Arabic (Saudi Arabia)
- de-DE:German (Germany)
- en-US:English (United States)
- es-ES:Spanish (Spain)
- fr-FR:French (France)
- id-ID:Indonesian (Indonesia)
- it-IT:Italian (Italy)
- ja-JP:Japanese (Japan)
- ko-KR:Korean (South Korea)
- nl-NL:Dutch (Netherlands)
- pl-PL:Polish (Poland)
- pt-PT:Portuguese (Portugal)
- ru-RU:Russian (Russia)
- th-TH:Thai (Thailand)
- zh-CN:Chinese (Mainland China)
- zh-TW:Chinese (Taiwan, China)
Specifies the settlement currency for the Checkout Session using a platform-supported ISO 4217 currency code, such as USD or CNY. The system uses the store's primary currency as the base currency and converts the order amount into this currency for display and pricing. If merchant_rate is not provided, the system uses the real-time exchange rate of the day by default.
Specifies a custom exchange rate from the store's primary currency to target_currency. The value must be a number greater than 0 and must be provided together with target_currency. This field is used only when the settlement currency differs from the store's primary currency. The exchange rate direction is: "1 unit of the store's primary currency = X units of target_currency". For example, if the store's primary currency is USD and target_currency is CNY, a value of 7.999 means 1 USD = 7.999 CNY, and the system will calculate the order amount using this rate.
Payment business mode:
onetime_payment: One-time payment mode. Processes a single payment transaction without creating any recurring payment tokens.subscription: Subscription payment mode. Processes the initial payment and generates a payment token for automatic recurring payments. Subsequent renewal charges will be processed using this token based on the subscription plan configuration.
Software as a service (SaaS): Software delivered over the internet as a subscription, no local installation required.Software: Downloadable or licensed standalone software that typically requires local installation (e.g. installers, license keys).Online Video Content: Video content delivered via streaming or download (e.g. courses, movies, live streams).Information Service: Digital data or reports (e.g. databases, industry reports, analytics).eBook: Electronic books or digital publications readable on devices.Digital Graphic / Template: Editable digital templates or design assets (e.g. PSD/templates, PowerPoint templates).Video Game: Digital games, including downloads, in-app purchases, or subscription services.Blockchain Digital Products: Blockchain-based digital assets (e.g. NFTs).Other Digital Products: Other virtual goods not covered above (e.g. event tickets).
Was this page helpful?