Submit payment
curl --request POST \
--url https://api-sandbox.sohopay.xyz/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": "ord_9f8e7d6c",
"agent_id": "agt_7d1e5b2f",
"signature": "0x9b3f...c21d"
}
'import requests
url = "https://api-sandbox.sohopay.xyz/v1/payments"
payload = {
"order_id": "ord_9f8e7d6c",
"agent_id": "agt_7d1e5b2f",
"signature": "0x9b3f...c21d"
}
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({order_id: 'ord_9f8e7d6c', agent_id: 'agt_7d1e5b2f', signature: '0x9b3f...c21d'})
};
fetch('https://api-sandbox.sohopay.xyz/v1/payments', 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-sandbox.sohopay.xyz/v1/payments",
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' => 'ord_9f8e7d6c',
'agent_id' => 'agt_7d1e5b2f',
'signature' => '0x9b3f...c21d'
]),
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-sandbox.sohopay.xyz/v1/payments"
payload := strings.NewReader("{\n \"order_id\": \"ord_9f8e7d6c\",\n \"agent_id\": \"agt_7d1e5b2f\",\n \"signature\": \"0x9b3f...c21d\"\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-sandbox.sohopay.xyz/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"ord_9f8e7d6c\",\n \"agent_id\": \"agt_7d1e5b2f\",\n \"signature\": \"0x9b3f...c21d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.sohopay.xyz/v1/payments")
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 \"order_id\": \"ord_9f8e7d6c\",\n \"agent_id\": \"agt_7d1e5b2f\",\n \"signature\": \"0x9b3f...c21d\"\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "pay_5c4b3a29",
"order_id": "ord_9f8e7d6c",
"agent_id": "agt_7d1e5b2f",
"amount": "25.00",
"status": "processing",
"settlement_tx": "0x4d5e...9a0b",
"settled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}Payments
Submit payment
Submits an agent’s EIP-712 signed payment for an order. The Policy Service validates allowlist, credit, rate limits, and AML status before co-signing (2-of-3 MPC) and settling on Base. Settlement typically finalizes in ~1 second.
POST
/
payments
Submit payment
curl --request POST \
--url https://api-sandbox.sohopay.xyz/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order_id": "ord_9f8e7d6c",
"agent_id": "agt_7d1e5b2f",
"signature": "0x9b3f...c21d"
}
'import requests
url = "https://api-sandbox.sohopay.xyz/v1/payments"
payload = {
"order_id": "ord_9f8e7d6c",
"agent_id": "agt_7d1e5b2f",
"signature": "0x9b3f...c21d"
}
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({order_id: 'ord_9f8e7d6c', agent_id: 'agt_7d1e5b2f', signature: '0x9b3f...c21d'})
};
fetch('https://api-sandbox.sohopay.xyz/v1/payments', 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-sandbox.sohopay.xyz/v1/payments",
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' => 'ord_9f8e7d6c',
'agent_id' => 'agt_7d1e5b2f',
'signature' => '0x9b3f...c21d'
]),
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-sandbox.sohopay.xyz/v1/payments"
payload := strings.NewReader("{\n \"order_id\": \"ord_9f8e7d6c\",\n \"agent_id\": \"agt_7d1e5b2f\",\n \"signature\": \"0x9b3f...c21d\"\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-sandbox.sohopay.xyz/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": \"ord_9f8e7d6c\",\n \"agent_id\": \"agt_7d1e5b2f\",\n \"signature\": \"0x9b3f...c21d\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.sohopay.xyz/v1/payments")
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 \"order_id\": \"ord_9f8e7d6c\",\n \"agent_id\": \"agt_7d1e5b2f\",\n \"signature\": \"0x9b3f...c21d\"\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "pay_5c4b3a29",
"order_id": "ord_9f8e7d6c",
"agent_id": "agt_7d1e5b2f",
"amount": "25.00",
"status": "processing",
"settlement_tx": "0x4d5e...9a0b",
"settled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}Authorizations
API key as Bearer token. Sandbox keys start with sk_test_, mainnet keys with sk_live_.
Headers
Unique key to make retries safe. Strongly recommended for all write requests.
Body
application/json
Response
Payment accepted and queued for settlement
Example:
"pay_5c4b3a29"
Example:
"ord_9f8e7d6c"
Example:
"agt_7d1e5b2f"
Example:
"25.00"
Available options:
processing, settled, failed Example:
"processing"
On-chain transaction hash once settled
Example:
"0x4d5e...9a0b"
⌘I

