Documentation
ANONPAY API
Accept crypto and PayPal with plain HTTP calls. Create a transaction, send the buyer to the hosted checkout, and receive a signed webhook when the money arrives.
Base URLs
The API is the same on both addresses. From a server that runs Tor, use the onion address: the request never leaves the Tor network, and the address itself proves which server answered.
- Clearnet
https://anonpay.org- Onion service
http://anonpay666ie3ah4nl55ssimvacwrdkbbji6h4a4snvry26lnemfaxid.onion- Checkout
https://anonpay.org/checkout/{transaction_id}
How requests work
GET or POSTEvery endpoint takes both. Send parameters as a form body or a query string; there is no JSON request body.
Bearer keysAuthenticate with
Authorization: Bearer <key>. Your key is under Developer in the dashboard.Decimal stringsMoney is a string such as
"0.00021". Parse it with a decimal type, never a float.Unix secondsEvery timestamp is an integer number of seconds, UTC.
Your first request
Create a transaction for 20 USD that the buyer can pay in Bitcoin, Monero or USDT on Ethereum.
curl https://anonpay.org/api/transaction/create \
-H "Authorization: Bearer $APA_KEY" \
-d amount=20 \
-d currency=usd \
-d allowed_payment_methods=btc,xmr,usdt-erc20 \
-d webhook=https://seller.example/hooks/apa \
-d idempotency_key=2c9a4e7b-8d1f-4a6cimport os
import requests
KEY = os.environ["APA_KEY"]
response = requests.post(
"https://anonpay.org/api/transaction/create",
headers={"Authorization": f"Bearer {KEY}"},
data={
"amount": "20",
"currency": "usd",
"allowed_payment_methods": "btc,xmr,usdt-erc20",
"webhook": "https://seller.example/hooks/apa",
"idempotency_key": "2c9a4e7b-8d1f-4a6c",
},
timeout=30,
)
print(response.json())const url = "https://anonpay.org/api/transaction/create";
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${process.env.APA_KEY}` },
body: new URLSearchParams({
amount: "20",
currency: "usd",
allowed_payment_methods: "btc,xmr,usdt-erc20",
webhook: "https://seller.example/hooks/apa",
idempotency_key: "2c9a4e7b-8d1f-4a6c",
}),
});
console.log(await response.json());$url = 'https://anonpay.org/api/transaction/create';
$key = getenv("APA_KEY");
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer $key"],
CURLOPT_POSTFIELDS => http_build_query([
"amount" => '20',
"currency" => 'usd',
"allowed_payment_methods" => 'btc,xmr,usdt-erc20',
"webhook" => 'https://seller.example/hooks/apa',
"idempotency_key" => '2c9a4e7b-8d1f-4a6c',
]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
{
"status": "success",
"transaction_id": "9c1f0b7a4e2d8f6a3b5c7d9e1f0a2b4c",
"private_key": "a3f9d0e1c2b4a6f8e0d2c4b6a8f0e2d4",
"expires": 1754006400
}