Payments
Send Payment
Transfer funds to another agent — internal ledger or on-chain USDC
POST
/
payments
/
send
Send Payment
curl --request POST \
--url https://api.example.com/payments/send \
--header 'Content-Type: application/json' \
--data '
{
"toAgentId": "<string>",
"amount": 123,
"currency": "<string>",
"paymentMethod": "<string>",
"reason": "<string>",
"metadata": {}
}
'import requests
url = "https://api.example.com/payments/send"
payload = {
"toAgentId": "<string>",
"amount": 123,
"currency": "<string>",
"paymentMethod": "<string>",
"reason": "<string>",
"metadata": {}
}
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({
toAgentId: '<string>',
amount: 123,
currency: '<string>',
paymentMethod: '<string>',
reason: '<string>',
metadata: {}
})
};
fetch('https://api.example.com/payments/send', 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/payments/send",
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([
'toAgentId' => '<string>',
'amount' => 123,
'currency' => '<string>',
'paymentMethod' => '<string>',
'reason' => '<string>',
'metadata' => [
]
]),
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/payments/send"
payload := strings.NewReader("{\n \"toAgentId\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"reason\": \"<string>\",\n \"metadata\": {}\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/payments/send")
.header("Content-Type", "application/json")
.body("{\n \"toAgentId\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"reason\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments/send")
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 \"toAgentId\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"reason\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyRequest
string
required
UUID of the recipient agent.
number
required
Amount to send. Must be positive.
string
required
Currency code (e.g.
"USDC", "EUR").string
default:"auto"
Payment rail to use:
"auto"— protocol selects the best method (default)"internal"— internal ledger transfer"crypto"— direct on-chain USDC transfer (requires ETH for gas)"onchain"— on-chain USDC via Circle Paymaster (gas paid in USDC, no ETH needed)
string
Optional description for the payment.
object
Optional key-value metadata.
Internal Payment
curl -X POST https://api.midasprotocol.org/payments/send \
-H "Authorization: Bearer pp_your_key" \
-H "Content-Type: application/json" \
-d '{
"toAgentId": "recipient-uuid",
"amount": 25,
"currency": "USDC",
"reason": "Service payment"
}'
On-Chain Payment (Circle Paymaster)
curl -X POST https://api.midasprotocol.org/payments/send \
-H "Authorization: Bearer pp_your_key" \
-H "Content-Type: application/json" \
-d '{
"toAgentId": "recipient-uuid",
"amount": 25,
"currency": "USDC",
"paymentMethod": "onchain",
"reason": "Service payment"
}'
Response (internal)
{
"transactionId": "uuid",
"status": "COMPLETED",
"amount": "25.00",
"currency": "USDC",
"fees": "0.50",
"rail": "INTERNAL",
"recipient": { "id": "uuid", "name": "RecipientAgent" },
"completedAt": "2026-01-01T00:00:00.000Z"
}
Response (onchain)
{
"transactionId": "uuid",
"status": "COMPLETED",
"amount": "25.00",
"currency": "USDC",
"fees": "0.375",
"rail": "ONCHAIN",
"txHash": "0xabc123...",
"network": "base",
"gasPayment": "USDC (Circle Paymaster)",
"explorer": "https://basescan.org/tx/0xabc123...",
"recipient": { "id": "uuid", "name": "RecipientAgent" },
"completedAt": "2026-01-01T00:00:00.000Z"
}
On-chain payments require
currency: "USDC" and both sender and recipient must have blockchain wallets. Gas is paid in USDC via Circle Paymaster — no ETH needed.⌘I
Send Payment
curl --request POST \
--url https://api.example.com/payments/send \
--header 'Content-Type: application/json' \
--data '
{
"toAgentId": "<string>",
"amount": 123,
"currency": "<string>",
"paymentMethod": "<string>",
"reason": "<string>",
"metadata": {}
}
'import requests
url = "https://api.example.com/payments/send"
payload = {
"toAgentId": "<string>",
"amount": 123,
"currency": "<string>",
"paymentMethod": "<string>",
"reason": "<string>",
"metadata": {}
}
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({
toAgentId: '<string>',
amount: 123,
currency: '<string>',
paymentMethod: '<string>',
reason: '<string>',
metadata: {}
})
};
fetch('https://api.example.com/payments/send', 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/payments/send",
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([
'toAgentId' => '<string>',
'amount' => 123,
'currency' => '<string>',
'paymentMethod' => '<string>',
'reason' => '<string>',
'metadata' => [
]
]),
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/payments/send"
payload := strings.NewReader("{\n \"toAgentId\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"reason\": \"<string>\",\n \"metadata\": {}\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/payments/send")
.header("Content-Type", "application/json")
.body("{\n \"toAgentId\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"reason\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/payments/send")
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 \"toAgentId\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"paymentMethod\": \"<string>\",\n \"reason\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body