Send Payment
curl --request POST \
--url https://api.example.com/v1/pay \
--header 'Content-Type: application/json' \
--data '
{
"recipient": {
"recipient.name": "<string>",
"recipient.account_number": "<string>",
"recipient.routing_number": "<string>",
"recipient.email": "<string>"
},
"amount_usd": 123,
"max_amount_usdc": 123,
"description": "<string>",
"idempotency_key": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>"
}
'import requests
url = "https://api.example.com/v1/pay"
payload = {
"recipient": {
"recipient.name": "<string>",
"recipient.account_number": "<string>",
"recipient.routing_number": "<string>",
"recipient.email": "<string>"
},
"amount_usd": 123,
"max_amount_usdc": 123,
"description": "<string>",
"idempotency_key": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
recipient: {
'recipient.name': '<string>',
'recipient.account_number': '<string>',
'recipient.routing_number': '<string>',
'recipient.email': '<string>'
},
amount_usd: 123,
max_amount_usdc: 123,
description: '<string>',
idempotency_key: '<string>',
method: '<string>',
headers: {},
body: JSON.stringify('<string>')
})
};
fetch('https://api.example.com/v1/pay', 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.example.com/v1/pay",
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([
'recipient' => [
'recipient.name' => '<string>',
'recipient.account_number' => '<string>',
'recipient.routing_number' => '<string>',
'recipient.email' => '<string>'
],
'amount_usd' => 123,
'max_amount_usdc' => 123,
'description' => '<string>',
'idempotency_key' => '<string>',
'method' => '<string>',
'headers' => [
],
'body' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/pay"
payload := strings.NewReader("{\n \"recipient\": {\n \"recipient.name\": \"<string>\",\n \"recipient.account_number\": \"<string>\",\n \"recipient.routing_number\": \"<string>\",\n \"recipient.email\": \"<string>\"\n },\n \"amount_usd\": 123,\n \"max_amount_usdc\": 123,\n \"description\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/pay")
.header("Content-Type", "application/json")
.body("{\n \"recipient\": {\n \"recipient.name\": \"<string>\",\n \"recipient.account_number\": \"<string>\",\n \"recipient.routing_number\": \"<string>\",\n \"recipient.email\": \"<string>\"\n },\n \"amount_usd\": 123,\n \"max_amount_usdc\": 123,\n \"description\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipient\": {\n \"recipient.name\": \"<string>\",\n \"recipient.account_number\": \"<string>\",\n \"recipient.routing_number\": \"<string>\",\n \"recipient.email\": \"<string>\"\n },\n \"amount_usd\": 123,\n \"max_amount_usdc\": 123,\n \"description\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"rail": "<string>",
"amount_charged": 123,
"fee": 123,
"currency": "<string>",
"recipient": "<string>",
"tx_hash": {},
"created_at": "<string>",
"estimated_arrival": {},
"response": {
"response.status_code": 123,
"response.headers": {},
"response.body": "<string>"
}
}Agent API
Send Payment
Unified payment endpoint — auto-routes to x402, USDC transfer, or fiat ACH based on the recipient.
POST
/
v1
/
pay
Send Payment
curl --request POST \
--url https://api.example.com/v1/pay \
--header 'Content-Type: application/json' \
--data '
{
"recipient": {
"recipient.name": "<string>",
"recipient.account_number": "<string>",
"recipient.routing_number": "<string>",
"recipient.email": "<string>"
},
"amount_usd": 123,
"max_amount_usdc": 123,
"description": "<string>",
"idempotency_key": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>"
}
'import requests
url = "https://api.example.com/v1/pay"
payload = {
"recipient": {
"recipient.name": "<string>",
"recipient.account_number": "<string>",
"recipient.routing_number": "<string>",
"recipient.email": "<string>"
},
"amount_usd": 123,
"max_amount_usdc": 123,
"description": "<string>",
"idempotency_key": "<string>",
"method": "<string>",
"headers": {},
"body": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
recipient: {
'recipient.name': '<string>',
'recipient.account_number': '<string>',
'recipient.routing_number': '<string>',
'recipient.email': '<string>'
},
amount_usd: 123,
max_amount_usdc: 123,
description: '<string>',
idempotency_key: '<string>',
method: '<string>',
headers: {},
body: JSON.stringify('<string>')
})
};
fetch('https://api.example.com/v1/pay', 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.example.com/v1/pay",
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([
'recipient' => [
'recipient.name' => '<string>',
'recipient.account_number' => '<string>',
'recipient.routing_number' => '<string>',
'recipient.email' => '<string>'
],
'amount_usd' => 123,
'max_amount_usdc' => 123,
'description' => '<string>',
'idempotency_key' => '<string>',
'method' => '<string>',
'headers' => [
],
'body' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/pay"
payload := strings.NewReader("{\n \"recipient\": {\n \"recipient.name\": \"<string>\",\n \"recipient.account_number\": \"<string>\",\n \"recipient.routing_number\": \"<string>\",\n \"recipient.email\": \"<string>\"\n },\n \"amount_usd\": 123,\n \"max_amount_usdc\": 123,\n \"description\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/pay")
.header("Content-Type", "application/json")
.body("{\n \"recipient\": {\n \"recipient.name\": \"<string>\",\n \"recipient.account_number\": \"<string>\",\n \"recipient.routing_number\": \"<string>\",\n \"recipient.email\": \"<string>\"\n },\n \"amount_usd\": 123,\n \"max_amount_usdc\": 123,\n \"description\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipient\": {\n \"recipient.name\": \"<string>\",\n \"recipient.account_number\": \"<string>\",\n \"recipient.routing_number\": \"<string>\",\n \"recipient.email\": \"<string>\"\n },\n \"amount_usd\": 123,\n \"max_amount_usdc\": 123,\n \"description\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"method\": \"<string>\",\n \"headers\": {},\n \"body\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"rail": "<string>",
"amount_charged": 123,
"fee": 123,
"currency": "<string>",
"recipient": "<string>",
"tx_hash": {},
"created_at": "<string>",
"estimated_arrival": {},
"response": {
"response.status_code": 123,
"response.headers": {},
"response.body": "<string>"
}
}The unified pay endpoint is the recommended way to send any payment through Unwall. It automatically detects the recipient type and routes to the appropriate rail:
- URL (e.g.,
https://api.example.com/...) — routes to the x402 protocol - EVM address (e.g.,
0x742d...) — routes to on-chain USDC transfer - Bank details object — routes to fiat ACH off-ramp
Requires a bearer token with the
pay permission. If the recipient is a URL, the token must also have the x402 permission.Request Body
string | object
required
The payment recipient. Accepts one of three formats:
- URL (string): An HTTPS URL for x402 protocol payments (e.g.,
"https://api.example.com/v1/data") - EVM address (string): A
0x-prefixed Ethereum address for USDC transfers (e.g.,"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28") - Bank details (object): An object with
name,account_number,routing_number, andemailfor fiat ACH payments
number
Payment amount in USD. Required for USDC transfer and fiat rails. Not used for x402 (the target API sets the price).
integer
Maximum micro-USDC to pay for x402 requests (safety cap). 1 USDC = 1,000,000 micro-USDC. Only used when recipient is a URL.
string
Payment description for record-keeping. Max 500 characters.
string
Unique key to prevent duplicate payments. Alphanumeric plus
_, -, :, .. Max 255 characters.string
default:"GET"
HTTP method for x402 requests. One of
GET, POST, PUT, DELETE. Only used when recipient is a URL.object
Additional HTTP headers for x402 requests. Only used when recipient is a URL.
string
Request body for x402
POST or PUT requests. Only used when recipient is a URL.Response
string
required
Unique transaction identifier.
string
required
Transaction status:
pending, processing, completed, or failed.string
required
Payment rail used:
x402, usdc_transfer, or fiat.integer
required
Amount charged in rail-native units. Micro-USDC for
x402 and usdc_transfer rails, cents for fiat rail.integer
required
Platform fee charged in rail-native units.
string
required
Currency of the amount:
usdc or usd.string
required
Recipient identifier (URL, EVM address, or recipient name).
string | null
required
On-chain transaction hash for USDC and x402 payments.
null for fiat payments.string
required
ISO 8601 timestamp of when the payment was created.
string | null
required
Estimated delivery time for fiat payments (e.g., “2-3 business days”).
null for crypto rails.object | null
required
Examples
x402 Payment (URL recipient)
curl -X POST https://api.unwall.xyz/v1/pay \
-H "Authorization: Bearer aw_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"recipient": "https://api.example.com/v1/data",
"max_amount_usdc": 1000000,
"description": "Fetch market data"
}'
import requests
resp = requests.post(
"https://api.unwall.xyz/v1/pay",
headers={"Authorization": "Bearer aw_live_xxxxxxxxxxxx"},
json={
"recipient": "https://api.example.com/v1/data",
"max_amount_usdc": 1000000,
"description": "Fetch market data",
},
)
result = resp.json()
print(f"Paid {result['amount_charged'] / 1_000_000} USDC via {result['rail']}")
const resp = await fetch("https://api.unwall.xyz/v1/pay", {
method: "POST",
headers: {
Authorization: "Bearer aw_live_xxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
recipient: "https://api.example.com/v1/data",
max_amount_usdc: 1000000,
description: "Fetch market data",
}),
});
const result = await resp.json();
console.log(`Paid ${result.amount_charged / 1_000_000} USDC via ${result.rail}`);
Response (200 OK)
{
"id": "tx_x402_abc123",
"status": "completed",
"rail": "x402",
"amount_charged": 500000,
"fee": 7500,
"currency": "usdc",
"recipient": "https://api.example.com/v1/data",
"tx_hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890",
"created_at": "2026-03-11T14:30:00Z",
"estimated_arrival": null,
"response": {
"status_code": 200,
"headers": {
"content-type": "application/json"
},
"body": "{\"data\": [{\"id\": 1, \"value\": \"premium result\"}]}"
}
}
USDC Transfer (EVM address recipient)
curl -X POST https://api.unwall.xyz/v1/pay \
-H "Authorization: Bearer aw_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",
"amount_usd": 50.00,
"description": "Vendor payment"
}'
import requests
resp = requests.post(
"https://api.unwall.xyz/v1/pay",
headers={"Authorization": "Bearer aw_live_xxxxxxxxxxxx"},
json={
"recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",
"amount_usd": 50.00,
"description": "Vendor payment",
},
)
result = resp.json()
print(f"Sent {result['amount_charged'] / 1_000_000} USDC to {result['recipient']}")
const resp = await fetch("https://api.unwall.xyz/v1/pay", {
method: "POST",
headers: {
Authorization: "Bearer aw_live_xxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
recipient: "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",
amount_usd: 50.0,
description: "Vendor payment",
}),
});
const result = await resp.json();
console.log(`Sent ${result.amount_charged / 1_000_000} USDC to ${result.recipient}`);
Response (201 Created)
{
"id": "tx_usdc_def456",
"status": "processing",
"rail": "usdc_transfer",
"amount_charged": 50000000,
"fee": 750000,
"currency": "usdc",
"recipient": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",
"tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"created_at": "2026-03-11T14:35:00Z",
"estimated_arrival": null,
"response": null
}
Fiat ACH Payment (Bank details recipient)
curl -X POST https://api.unwall.xyz/v1/pay \
-H "Authorization: Bearer aw_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"recipient": {
"name": "Acme Supplies Inc",
"account_number": "9876543210",
"routing_number": "021000021",
"email": "billing@acme.com"
},
"amount_usd": 2500.00,
"description": "Monthly supply order #47"
}'
import requests
resp = requests.post(
"https://api.unwall.xyz/v1/pay",
headers={"Authorization": "Bearer aw_live_xxxxxxxxxxxx"},
json={
"recipient": {
"name": "Acme Supplies Inc",
"account_number": "9876543210",
"routing_number": "021000021",
"email": "billing@acme.com",
},
"amount_usd": 2500.00,
"description": "Monthly supply order #47",
},
)
result = resp.json()
print(f"Payment {result['id']} — arrives {result['estimated_arrival']}")
const resp = await fetch("https://api.unwall.xyz/v1/pay", {
method: "POST",
headers: {
Authorization: "Bearer aw_live_xxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
recipient: {
name: "Acme Supplies Inc",
account_number: "9876543210",
routing_number: "021000021",
email: "billing@acme.com",
},
amount_usd: 2500.0,
description: "Monthly supply order #47",
}),
});
const result = await resp.json();
console.log(`Payment ${result.id} — arrives ${result.estimated_arrival}`);
Response (201 Created)
{
"id": "tx_fiat_ghi789",
"status": "processing",
"rail": "fiat",
"amount_charged": 250000,
"fee": 3750,
"currency": "usd",
"recipient": "Acme Supplies Inc",
"tx_hash": null,
"created_at": "2026-03-11T14:40:00Z",
"estimated_arrival": "2-3 business days",
"response": null
}