r=ping
Service availability check.
GET https://agdorpay.com/api?r=ping
There are two different scenarios. One for projects that work via API and webhooks. The second for operators who create invoices manually from the panel and send the ready payment page or builder view to the client.
project_code, api_key, wallet_code, invoice.confirmed
Manual Invoices from Panel
For operators, managers and administrators who create invoices themselves, configure templates and send a link or ready text to the client.
Project, wallet, templates, payment page, builder view
The API flow starts in the panel, but then works without manual actions. You create a project, attach wallets to it, save `api_key` and then your service creates invoices itself.
Open Dashboard → Projects. After saving, the project gets `project_code`, `api_key` and `webhook_secret`. `api_key` is shown only once.
In Dashboard → Wallets create the desired payment method, and then enable it in the project through the list of allowed wallets.
Your project calls `r=payment_methods`, gets active `wallet_code` and shows the client a list of available networks or Binance ID.
After the client selects a payment method, your server calls `r=create_invoice`, gets `invoice_id`, exact amount and destination address, and then shows this data to the user.
When Payment Service finds a payment, it changes the invoice status and sends `invoice.confirmed` to the `Webhook URL` of your project.
Each API request must pass `project_code` and `api_key`. Preferred method: HTTP headers.
| Field | Where to pass | Description |
|---|---|---|
X-Project-Code |
Header | Internal project code. |
X-API-Key |
Header | Project secret for API requests. |
project_code |
POST / GET | Fallback option if the client cannot send headers. |
api_key |
POST | Fallback option for server-to-server requests. |
curl -X POST "https://agdorpay.com/api?r=payment_methods" \ -H "X-Project-Code: project_demo_123" \ -H "X-API-Key: ********"
r=pingService availability check.
GET https://agdorpay.com/api?r=ping
r=payment_methodsReturns active `wallet_code`, currency, network and display name of the payment method for the selected project.
GET/POST https://agdorpay.com/api?r=payment_methods
r=create_invoiceCreates an invoice and returns the exact amount with micro-offset that the client must pay.
POST https://agdorpay.com/api?r=create_invoice
r=get_invoiceReturns the current invoice state by `invoice_id` or `external_id`.
GET/POST https://agdorpay.com/api?r=get_invoice
r=cancel_invoiceCancels the invoice while it is in `pending` status.
POST https://agdorpay.com/api?r=cancel_invoice
r=confirm_invoiceManual invoice confirmation from the project side. Used only for special scenarios.
POST https://agdorpay.com/api?r=confirm_invoice
{
"status": "success",
"data": {
"project_code": "project_demo_123",
"wallets": [
{
"wallet_code": "usdt_trc20_main",
"label": "USDT TRC20",
"payment_type": "crypto_wallet",
"currency": "USDT",
"network": "TRC20",
"address": "T..."
}
]
}
}
curl -X POST "https://agdorpay.com/api?r=create_invoice" \ -H "X-Project-Code: project_demo_123" \ -H "X-API-Key: ********" \ -d "amount=25.00" \ -d "wallet_code=usdt_trc20_main" \ -d "external_id=order_10452" \ -d "customer_id=user_42"
{
"status": "success",
"data": {
"invoice_id": "inv_87a3bfd",
"project_code": "project_demo_123",
"external_id": "order_10452",
"customer_id": "user_42",
"status": "pending",
"amount_requested": "25.00",
"amount": "25.0427",
"currency": "USDT",
"payment_type": "crypto_wallet",
"network": "TRC20",
"address": "T...",
"wallet_code": "usdt_trc20_main",
"wallet_label": "USDT TRC20",
"expires_at": "2026-06-13 18:30:00",
"confirmed_at": null,
"txid": null,
"metadata": {}
}
}
amount field in the response may be greater than the requested amount. You need to pay exactly this, otherwise automatic payment matching will not work.After invoice confirmation, the service sends a POST request to the `Webhook URL` specified in the project. Resubmission is possible, so the client handler must be idempotent.
| Header | Description |
|---|---|
X-Payment-Event-Id |
Unique webhook event identifier. |
X-Payment-Timestamp |
Unix timestamp that participates in the signature. |
X-Payment-Signature |
HMAC-SHA256 signature by the formula `timestamp.payload`. |
signature = HMAC_SHA256( timestamp + "." + raw_json_payload, webhook_secret )
{
"event_id": "evt_...",
"event_type": "invoice.confirmed",
"invoice_id": "inv_87a3bfd",
"project_code": "project_demo_123",
"external_id": "order_10452",
"customer_id": "user_42",
"status": "confirmed",
"amount_requested": "25.00",
"amount": "25.0427",
"currency": "USDT",
"payment_type": "crypto_wallet",
"network": "TRC20",
"address": "T...",
"wallet_code": "usdt_trc20_main",
"wallet_label": "USDT TRC20",
"txid": "transaction_hash",
"confirmed_at": "2026-06-13 18:41:20",
"metadata": {}
}
<?php
$rawBody = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_X_PAYMENT_TIMESTAMP'] ?? '';
$signature = $_SERVER['HTTP_X_PAYMENT_SIGNATURE'] ?? '';
$expected = hash_hmac('sha256', $timestamp . '.' . $rawBody, $webhookSecret);
if (!hash_equals($expected, $signature)) {
http_response_code(403);
exit('bad signature');
}
If you do not want to rely only on webhooks, you can periodically call `r=get_invoice` and check the status. This is especially useful for internal dashboards or long client sessions.
<?php
$ch = curl_init("https://agdorpay.com/api?r=create_invoice");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERAGENT => 'Mozilla/5.0 AGDor Pay Client',
CURLOPT_HTTPHEADER => [
'X-Project-Code: project_demo_123',
'X-API-Key: ********',
],
CURLOPT_POSTFIELDS => http_build_query([
'amount' => '25.00',
'wallet_code' => 'usdt_trc20_main',
'external_id' => 'order_10452',
]),
]);
$response = curl_exec($ch);
curl "https://agdorpay.com/api?r=get_invoice" \ -H "X-Project-Code: project_demo_123" \ -H "X-API-Key: ********" \ -d "invoice_id=inv_87a3bfd"
| Status | Meaning |
|---|---|
pending | Invoice created and waiting for payment. |
confirmed | Payment found automatically. |
manual_confirmed | Invoice confirmed manually. |
cancelled | Invoice cancelled by operator or project. |
expired | Invoice deadline expired before confirmation. |