Create payment intent
curl --request POST \
--url https://api.kryptopay.xyz/v1/payment_intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_units": 1500000,
"chain": "base",
"expires_in_minutes": 15,
"lane": "sdk",
"metadata": {
"order_id": "ord_2026_1001"
}
}
'import requests
url = "https://api.kryptopay.xyz/v1/payment_intents"
payload = {
"amount_units": 1500000,
"chain": "base",
"expires_in_minutes": 15,
"lane": "sdk",
"metadata": { "order_id": "ord_2026_1001" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount_units: 1500000,
chain: 'base',
expires_in_minutes: 15,
lane: 'sdk',
metadata: {order_id: 'ord_2026_1001'}
})
};
fetch('https://api.kryptopay.xyz/v1/payment_intents', 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.kryptopay.xyz/v1/payment_intents",
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([
'amount_units' => 1500000,
'chain' => 'base',
'expires_in_minutes' => 15,
'lane' => 'sdk',
'metadata' => [
'order_id' => 'ord_2026_1001'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.kryptopay.xyz/v1/payment_intents"
payload := strings.NewReader("{\n \"amount_units\": 1500000,\n \"chain\": \"base\",\n \"expires_in_minutes\": 15,\n \"lane\": \"sdk\",\n \"metadata\": {\n \"order_id\": \"ord_2026_1001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.kryptopay.xyz/v1/payment_intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount_units\": 1500000,\n \"chain\": \"base\",\n \"expires_in_minutes\": 15,\n \"lane\": \"sdk\",\n \"metadata\": {\n \"order_id\": \"ord_2026_1001\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kryptopay.xyz/v1/payment_intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_units\": 1500000,\n \"chain\": \"base\",\n \"expires_in_minutes\": 15,\n \"lane\": \"sdk\",\n \"metadata\": {\n \"order_id\": \"ord_2026_1001\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "requires_payment",
"client_secret": "<string>",
"mode": "testnet",
"chain": "base",
"chain_id": 123,
"confirmations_required": 123,
"amount_units": 123,
"decimals": 6,
"token_symbol": "USDC",
"token_address": "<string>",
"expected_wallet": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"expires_in_minutes": 123,
"lane": "sdk",
"metadata": {}
}Public endpoints
Create payment intent
Create a new payment intent for checkout.
POST
/
v1
/
payment_intents
Create payment intent
curl --request POST \
--url https://api.kryptopay.xyz/v1/payment_intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_units": 1500000,
"chain": "base",
"expires_in_minutes": 15,
"lane": "sdk",
"metadata": {
"order_id": "ord_2026_1001"
}
}
'import requests
url = "https://api.kryptopay.xyz/v1/payment_intents"
payload = {
"amount_units": 1500000,
"chain": "base",
"expires_in_minutes": 15,
"lane": "sdk",
"metadata": { "order_id": "ord_2026_1001" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount_units: 1500000,
chain: 'base',
expires_in_minutes: 15,
lane: 'sdk',
metadata: {order_id: 'ord_2026_1001'}
})
};
fetch('https://api.kryptopay.xyz/v1/payment_intents', 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.kryptopay.xyz/v1/payment_intents",
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([
'amount_units' => 1500000,
'chain' => 'base',
'expires_in_minutes' => 15,
'lane' => 'sdk',
'metadata' => [
'order_id' => 'ord_2026_1001'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.kryptopay.xyz/v1/payment_intents"
payload := strings.NewReader("{\n \"amount_units\": 1500000,\n \"chain\": \"base\",\n \"expires_in_minutes\": 15,\n \"lane\": \"sdk\",\n \"metadata\": {\n \"order_id\": \"ord_2026_1001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.kryptopay.xyz/v1/payment_intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount_units\": 1500000,\n \"chain\": \"base\",\n \"expires_in_minutes\": 15,\n \"lane\": \"sdk\",\n \"metadata\": {\n \"order_id\": \"ord_2026_1001\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kryptopay.xyz/v1/payment_intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_units\": 1500000,\n \"chain\": \"base\",\n \"expires_in_minutes\": 15,\n \"lane\": \"sdk\",\n \"metadata\": {\n \"order_id\": \"ord_2026_1001\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "requires_payment",
"client_secret": "<string>",
"mode": "testnet",
"chain": "base",
"chain_id": 123,
"confirmations_required": 123,
"amount_units": 123,
"decimals": 6,
"token_symbol": "USDC",
"token_address": "<string>",
"expected_wallet": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"expires_in_minutes": 123,
"lane": "sdk",
"metadata": {}
}Creates a payment intent for the merchant identified by your API key.
- Base URL:
https://api.kryptopay.xyz - Auth:
Authorization: Bearer <api_key> - Mode is inferred from your API key (
testnetormainnet)
Integration examples
cURL
curl -X POST "https://api.kryptopay.xyz/v1/payment_intents" \
-H "Authorization: Bearer kp_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"amount_units": 1500000,
"chain": "base",
"expires_in_minutes": 15,
"lane": "sdk",
"metadata": { "order_id": "ord_2026_1001" }
}'
Node.js (server)
const response = await fetch("https://api.kryptopay.xyz/v1/payment_intents", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KRYPTOPAY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
amount_units: 1500000,
chain: "base",
expires_in_minutes: 15,
lane: "sdk",
metadata: { order_id: "ord_2026_1001" },
}),
});
const intent = await response.json();
Python (coming soon)
Python examples and helpers are planned. Until then, use normal HTTP requests with the same payload and Bearer auth.Field guide (plain language)
amount_units: integer amount in smallest unit (USDC usually 6 decimals)chain: target chain (baseorpolygon)wallet_address: optional payout wallet override (0x...)expires_in_minutes: checkout expiry window (server clamps to5..60)lane: checkout lane (sdkormanual)metadata: your internal identifiers (order_id,customer_id, etc)token: currentlyUSDC
What you should persist
Persist at minimum:- your internal order ID
- payment intent ID
- returned mode/chain
- status transitions in your backend
Error handling checklist
- Retry transient failures (
500, network) - Do not retry auth failures (
api_key_missing,api_key_invalid) - Fix request shape for
invalid_body - Log full response body for debugging and support
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Payment amount in smallest token units (USDC uses 6 decimals).
Required range:
x >= 1Available options:
base, polygon Optional recipient wallet override.
Pattern:
^0x[a-fA-F0-9]{40}$Intent expiry in minutes. Server clamps to 5..60.
Available options:
sdk, manual Optional token selector. Currently USDC only.
Available options:
USDC Response
Payment intent created
Example:
"requires_payment"
Available options:
testnet, mainnet Available options:
base, polygon Example:
6
Example:
"USDC"
Available options:
sdk, manual Was this page helpful?

