Generate session
curl --request POST \
--url https://api.linkio.world/checkout/sessions/generate \
--header 'Content-Type: application/json' \
--header 'ngnc-sec-key: <api-key>' \
--data '
{
"business_id": "<string>",
"amount": 50,
"currency": "USD",
"reference_id": "ORDER-10294",
"success_url": "https://yourdomain.com/payment/success",
"cancel_url": "https://yourdomain.com/payment/cancelled"
}
'import requests
url = "https://api.linkio.world/checkout/sessions/generate"
payload = {
"business_id": "<string>",
"amount": 50,
"currency": "USD",
"reference_id": "ORDER-10294",
"success_url": "https://yourdomain.com/payment/success",
"cancel_url": "https://yourdomain.com/payment/cancelled"
}
headers = {
"ngnc-sec-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'ngnc-sec-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
business_id: '<string>',
amount: 50,
currency: 'USD',
reference_id: 'ORDER-10294',
success_url: 'https://yourdomain.com/payment/success',
cancel_url: 'https://yourdomain.com/payment/cancelled'
})
};
fetch('https://api.linkio.world/checkout/sessions/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.linkio.world/checkout/sessions/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([
'business_id' => '<string>',
'amount' => 50,
'currency' => 'USD',
'reference_id' => 'ORDER-10294',
'success_url' => 'https://yourdomain.com/payment/success',
'cancel_url' => 'https://yourdomain.com/payment/cancelled'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ngnc-sec-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.linkio.world/checkout/sessions/generate"
payload := strings.NewReader("{\n \"business_id\": \"<string>\",\n \"amount\": 50,\n \"currency\": \"USD\",\n \"reference_id\": \"ORDER-10294\",\n \"success_url\": \"https://yourdomain.com/payment/success\",\n \"cancel_url\": \"https://yourdomain.com/payment/cancelled\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ngnc-sec-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.linkio.world/checkout/sessions/generate")
.header("ngnc-sec-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"business_id\": \"<string>\",\n \"amount\": 50,\n \"currency\": \"USD\",\n \"reference_id\": \"ORDER-10294\",\n \"success_url\": \"https://yourdomain.com/payment/success\",\n \"cancel_url\": \"https://yourdomain.com/payment/cancelled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkio.world/checkout/sessions/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ngnc-sec-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_id\": \"<string>\",\n \"amount\": 50,\n \"currency\": \"USD\",\n \"reference_id\": \"ORDER-10294\",\n \"success_url\": \"https://yourdomain.com/payment/success\",\n \"cancel_url\": \"https://yourdomain.com/payment/cancelled\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"session_id": "6abb8e396b5c58fcba527a1c",
"url": "https://checkout.linkio.world/pay?sid=6abb8e396b5c58fcba527a1c"
}
}Checkout
Generate session
Create a hosted checkout session. Returns a session ID and a payment URL — redirect your customer to that URL to complete payment.
POST
/
checkout
/
sessions
/
generate
Generate session
curl --request POST \
--url https://api.linkio.world/checkout/sessions/generate \
--header 'Content-Type: application/json' \
--header 'ngnc-sec-key: <api-key>' \
--data '
{
"business_id": "<string>",
"amount": 50,
"currency": "USD",
"reference_id": "ORDER-10294",
"success_url": "https://yourdomain.com/payment/success",
"cancel_url": "https://yourdomain.com/payment/cancelled"
}
'import requests
url = "https://api.linkio.world/checkout/sessions/generate"
payload = {
"business_id": "<string>",
"amount": 50,
"currency": "USD",
"reference_id": "ORDER-10294",
"success_url": "https://yourdomain.com/payment/success",
"cancel_url": "https://yourdomain.com/payment/cancelled"
}
headers = {
"ngnc-sec-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'ngnc-sec-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
business_id: '<string>',
amount: 50,
currency: 'USD',
reference_id: 'ORDER-10294',
success_url: 'https://yourdomain.com/payment/success',
cancel_url: 'https://yourdomain.com/payment/cancelled'
})
};
fetch('https://api.linkio.world/checkout/sessions/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.linkio.world/checkout/sessions/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([
'business_id' => '<string>',
'amount' => 50,
'currency' => 'USD',
'reference_id' => 'ORDER-10294',
'success_url' => 'https://yourdomain.com/payment/success',
'cancel_url' => 'https://yourdomain.com/payment/cancelled'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ngnc-sec-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.linkio.world/checkout/sessions/generate"
payload := strings.NewReader("{\n \"business_id\": \"<string>\",\n \"amount\": 50,\n \"currency\": \"USD\",\n \"reference_id\": \"ORDER-10294\",\n \"success_url\": \"https://yourdomain.com/payment/success\",\n \"cancel_url\": \"https://yourdomain.com/payment/cancelled\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ngnc-sec-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.linkio.world/checkout/sessions/generate")
.header("ngnc-sec-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"business_id\": \"<string>\",\n \"amount\": 50,\n \"currency\": \"USD\",\n \"reference_id\": \"ORDER-10294\",\n \"success_url\": \"https://yourdomain.com/payment/success\",\n \"cancel_url\": \"https://yourdomain.com/payment/cancelled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.linkio.world/checkout/sessions/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ngnc-sec-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_id\": \"<string>\",\n \"amount\": 50,\n \"currency\": \"USD\",\n \"reference_id\": \"ORDER-10294\",\n \"success_url\": \"https://yourdomain.com/payment/success\",\n \"cancel_url\": \"https://yourdomain.com/payment/cancelled\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"session_id": "6abb8e396b5c58fcba527a1c",
"url": "https://checkout.linkio.world/pay?sid=6abb8e396b5c58fcba527a1c"
}
}Authorizations
Body
application/json
Your unique LINK business ID. Identifies the business collecting the payment.
Amount the customer pays at checkout, in the currency below.
Example:
50
Checkout currency. USD only.
Available options:
USD Your own reference for this payment, generated on your side. Use it to match the session back to your records.
Example:
"ORDER-10294"
Where the customer is redirected after a successful payment.
Example:
"https://yourdomain.com/payment/success"
Where the customer is redirected if the payment fails or is cancelled.
Example:
"https://yourdomain.com/payment/cancelled"

