curl --request POST \
--url https://api.agentaos.ai/api/v1/gateway/sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 49.99,
"currency": "EUR",
"description": "Order #123",
"successUrl": "https://myshop.com/success",
"cancelUrl": "https://myshop.com/cart",
"webhookUrl": "https://myshop.com/webhooks",
"buyerEmail": "john@example.com"
}
'import requests
url = "https://api.agentaos.ai/api/v1/gateway/sessions"
payload = {
"amount": 49.99,
"currency": "EUR",
"description": "Order #123",
"successUrl": "https://myshop.com/success",
"cancelUrl": "https://myshop.com/cart",
"webhookUrl": "https://myshop.com/webhooks",
"buyerEmail": "john@example.com"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 49.99,
currency: 'EUR',
description: 'Order #123',
successUrl: 'https://myshop.com/success',
cancelUrl: 'https://myshop.com/cart',
webhookUrl: 'https://myshop.com/webhooks',
buyerEmail: 'john@example.com'
})
};
fetch('https://api.agentaos.ai/api/v1/gateway/sessions', 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.agentaos.ai/api/v1/gateway/sessions",
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' => 49.99,
'currency' => 'EUR',
'description' => 'Order #123',
'successUrl' => 'https://myshop.com/success',
'cancelUrl' => 'https://myshop.com/cart',
'webhookUrl' => 'https://myshop.com/webhooks',
'buyerEmail' => 'john@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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.agentaos.ai/api/v1/gateway/sessions"
payload := strings.NewReader("{\n \"amount\": 49.99,\n \"currency\": \"EUR\",\n \"description\": \"Order #123\",\n \"successUrl\": \"https://myshop.com/success\",\n \"cancelUrl\": \"https://myshop.com/cart\",\n \"webhookUrl\": \"https://myshop.com/webhooks\",\n \"buyerEmail\": \"john@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-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.agentaos.ai/api/v1/gateway/sessions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 49.99,\n \"currency\": \"EUR\",\n \"description\": \"Order #123\",\n \"successUrl\": \"https://myshop.com/success\",\n \"cancelUrl\": \"https://myshop.com/cart\",\n \"webhookUrl\": \"https://myshop.com/webhooks\",\n \"buyerEmail\": \"john@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentaos.ai/api/v1/gateway/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 49.99,\n \"currency\": \"EUR\",\n \"description\": \"Order #123\",\n \"successUrl\": \"https://myshop.com/success\",\n \"cancelUrl\": \"https://myshop.com/cart\",\n \"webhookUrl\": \"https://myshop.com/webhooks\",\n \"buyerEmail\": \"john@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
"payment_link_id": null,
"org_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
"session_id": "mZrESFyR7RC9RPsJfZCVkg",
"idempotency_key": "order-48213",
"amount_override": 49.99,
"currency": "EUR",
"metadata": {
"payer": {
"email": "john@example.com"
}
},
"webhook_url": "https://myshop.com/webhooks",
"success_url": "https://myshop.com/success",
"cancel_url": "https://myshop.com/cart",
"tax_rate_id": null,
"supported_networks": [
"eip155:8453"
],
"expires_at": "2026-08-06T12:30:00.000Z",
"status": "open",
"created_at": "2026-08-06T12:00:00.000Z",
"updated_at": "2026-08-06T12:00:00.000Z",
"seller_mode": "mor",
"environment": "live",
"checkoutUrl": "https://app.agentaos.ai/checkout/mZrESFyR7RC9RPsJfZCVkg",
"invoiceId": "b2c3d4e5-f6a7-8b9c-0d1e-2f3a4b5c6d7e",
"invoiceNumber": "INV-2026-0142"
}{
"statusCode": 400,
"message": "amount is required when creating a session without a link",
"timestamp": "2026-08-06T12:00:00.000Z"
}{
"statusCode": 401,
"message": "Invalid API key",
"timestamp": "2026-08-06T12:00:00.000Z"
}{
"statusCode": 403,
"message": "Payment link belongs to another organization",
"timestamp": "2026-08-06T12:00:00.000Z"
}Create a checkout
Creates a checkout session, standalone or built from a payment link with linkId. The create and list responses do not include a plain amount, only amount_override (null unless you passed one). Call “Retrieve a checkout” for a computed, ready-to-display amount. Accepts an Idempotency-Key header (wins over a body idempotencyKey if both are sent); a repeat call with the same key returns the same checkout instead of creating a second one.
curl --request POST \
--url https://api.agentaos.ai/api/v1/gateway/sessions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 49.99,
"currency": "EUR",
"description": "Order #123",
"successUrl": "https://myshop.com/success",
"cancelUrl": "https://myshop.com/cart",
"webhookUrl": "https://myshop.com/webhooks",
"buyerEmail": "john@example.com"
}
'import requests
url = "https://api.agentaos.ai/api/v1/gateway/sessions"
payload = {
"amount": 49.99,
"currency": "EUR",
"description": "Order #123",
"successUrl": "https://myshop.com/success",
"cancelUrl": "https://myshop.com/cart",
"webhookUrl": "https://myshop.com/webhooks",
"buyerEmail": "john@example.com"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 49.99,
currency: 'EUR',
description: 'Order #123',
successUrl: 'https://myshop.com/success',
cancelUrl: 'https://myshop.com/cart',
webhookUrl: 'https://myshop.com/webhooks',
buyerEmail: 'john@example.com'
})
};
fetch('https://api.agentaos.ai/api/v1/gateway/sessions', 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.agentaos.ai/api/v1/gateway/sessions",
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' => 49.99,
'currency' => 'EUR',
'description' => 'Order #123',
'successUrl' => 'https://myshop.com/success',
'cancelUrl' => 'https://myshop.com/cart',
'webhookUrl' => 'https://myshop.com/webhooks',
'buyerEmail' => 'john@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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.agentaos.ai/api/v1/gateway/sessions"
payload := strings.NewReader("{\n \"amount\": 49.99,\n \"currency\": \"EUR\",\n \"description\": \"Order #123\",\n \"successUrl\": \"https://myshop.com/success\",\n \"cancelUrl\": \"https://myshop.com/cart\",\n \"webhookUrl\": \"https://myshop.com/webhooks\",\n \"buyerEmail\": \"john@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-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.agentaos.ai/api/v1/gateway/sessions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 49.99,\n \"currency\": \"EUR\",\n \"description\": \"Order #123\",\n \"successUrl\": \"https://myshop.com/success\",\n \"cancelUrl\": \"https://myshop.com/cart\",\n \"webhookUrl\": \"https://myshop.com/webhooks\",\n \"buyerEmail\": \"john@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentaos.ai/api/v1/gateway/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 49.99,\n \"currency\": \"EUR\",\n \"description\": \"Order #123\",\n \"successUrl\": \"https://myshop.com/success\",\n \"cancelUrl\": \"https://myshop.com/cart\",\n \"webhookUrl\": \"https://myshop.com/webhooks\",\n \"buyerEmail\": \"john@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
"payment_link_id": null,
"org_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
"session_id": "mZrESFyR7RC9RPsJfZCVkg",
"idempotency_key": "order-48213",
"amount_override": 49.99,
"currency": "EUR",
"metadata": {
"payer": {
"email": "john@example.com"
}
},
"webhook_url": "https://myshop.com/webhooks",
"success_url": "https://myshop.com/success",
"cancel_url": "https://myshop.com/cart",
"tax_rate_id": null,
"supported_networks": [
"eip155:8453"
],
"expires_at": "2026-08-06T12:30:00.000Z",
"status": "open",
"created_at": "2026-08-06T12:00:00.000Z",
"updated_at": "2026-08-06T12:00:00.000Z",
"seller_mode": "mor",
"environment": "live",
"checkoutUrl": "https://app.agentaos.ai/checkout/mZrESFyR7RC9RPsJfZCVkg",
"invoiceId": "b2c3d4e5-f6a7-8b9c-0d1e-2f3a4b5c6d7e",
"invoiceNumber": "INV-2026-0142"
}{
"statusCode": 400,
"message": "amount is required when creating a session without a link",
"timestamp": "2026-08-06T12:00:00.000Z"
}{
"statusCode": 401,
"message": "Invalid API key",
"timestamp": "2026-08-06T12:00:00.000Z"
}{
"statusCode": 403,
"message": "Payment link belongs to another organization",
"timestamp": "2026-08-06T12:00:00.000Z"
}/gateway/sessions (the underlying resource is called a “session”); the TypeScript SDK and the CLI both call it a checkout (agentaos.checkouts, agenta pay checkout).
amount, only amount_override (null unless you passed one). For a link-based checkout, the effective price is the link’s amount. To get a single, ready-to-display price, call Retrieve a checkout, which computes amount for you.Authorizations
Your secret key, from app.agentaos.ai -> Settings -> Developers -> API Keys. The key's prefix is both its identity and its environment: sk_test_... (sandbox, free, no verification) or sk_live_... (real money, requires business verification). A missing or invalid key returns 401.
Headers
Alternative to the body's idempotencyKey field. The header wins if both are sent.
Body
Either linkId or amount is required (amount is required when creating a standalone checkout with no link).
Payment link UUID to create from. Inherits amount, currency, description, taxRateId, and the seller mode. Omit for a standalone checkout.
Required if no linkId.
0.01 <= x <= 1000000With linkId, overrides the link's amount for this checkout only.
0.01 <= x <= 1000000Ignored (inherited from the link) when linkId is set.
EUR, USD, EURC, EURe, USDC 1000YYYY-MM-DD. Presentation only, stamped onto the invoice issued for this checkout.
320200200ISO 3166-1 alpha-2, e.g. DE. Drives destination-VAT calculation.
250020204820482048Seconds until expiry. Sessions eligible for SEPA bank transfer get a 48-hour window regardless of this value.
300 <= x <= 86400Up to 8KB serialized.
CAIP-2 network IDs. Defaults to Base mainnet for crypto-settlement checkouts.
Also settable via the Idempotency-Key request header (the header wins if both are sent).
Response
Checkout created.
Internal checkout UUID.
Public ID, used in the checkout URL and as the path parameter for every other call on this resource.
Set only if you passed amount or amountOverride at create.
open, completed, expired, cancelled mor, crypto test, live Send your buyer here. Computed, camelCase.
Set once an invoice has been issued for this session; null until then.