EraPay API v1
Base URL: https://pay.24era-etp.com/api/v1. Auth: header Authorization: Bearer ep_live_… (Settings → API key). Network: BNB Smart Chain, token USDT BEP-20 (0x55d398326f99059fF775485246999027B3197955).
Create invoice
POST /api/v1/invoices
Content-Type: application/json
{
"amount": 25.00, // USDT (or USD, 1:1)
"currency": "USDT", // USDT | USD
"order_id": "order-1001", // your id, returned in webhooks
"description": "Order #1001",
"fiat_amount": 9750, // optional, shown to the customer
"fiat_currency": "AMD", // optional
"success_url": "https://shop.example/thanks",
"cancel_url": "https://shop.example/cart",
"ttl_min": 30 // 5…1440, default 30
}
201 Created
{
"id": "inv_3f2a…", "status": "pending", "amount": "25.0037", "base_amount": "25",
"address": "0x…", "network": "BSC", "token": "USDT",
"pay_url": "https://pay.24era-etp.com/pay.php?id=inv_3f2a…", "expires_at": "…", …
}
Redirect the customer to pay_url. The customer must send exactly amount (a unique tag in the last decimals identifies the payment). Funds go straight to your wallet.
Get invoice
GET /api/v1/invoices/{id}
GET /api/v1/invoices?order_id=order-1001
Statuses: pending → paid | expired | cancelled. A payment that arrives up to 72 h after expiry still marks the invoice paid with "late": true. Transfers with a wrong amount appear in the dashboard under “Unmatched transfers” and can be attached manually.
Webhooks
On invoice.paid and invoice.expired EraPay sends POST to your Webhook URL with JSON {"event": "...", "invoice": {...}} and headers X-EraPay-Timestamp, X-EraPay-Signature = hex(HMAC-SHA256(timestamp + "." + raw_body, webhook_secret)). Reply 2xx; otherwise retries with backoff (up to 12 attempts). Always verify the signature and make your handler idempotent.
<?php
$body = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_ERAPAY_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_ERAPAY_SIGNATURE'] ?? '';
if (!hash_equals(hash_hmac('sha256', $ts . '.' . $body, getenv('ERAPAY_WEBHOOK_SECRET')), $sig)
|| abs(time() - (int)$ts) > 600) { http_response_code(401); exit; }
$e = json_decode($body, true);
if ($e['event'] === 'invoice.paid') { /* mark order $e['invoice']['order_id'] as paid (once) */ }
http_response_code(200);
Errors
401 bad key · 402 deposit too low to cover fees of open invoices · 422 validation · 503 temporary.
Plugins
WooCommerce — erapay-woocommerce.zip. Plugins → Add New → Upload, then WooCommerce → Settings → Payments → EraPay: API key, webhook secret, rate (1 for USD stores). Webhook URL: https://your-shop/?wc-api=erapay. Classic and block checkout supported.
OpenCart 3.x — erapay-opencart3.ocmod.zip. Extensions → Installer → upload, then Extensions → Payments → EraPay → Install → Edit. Webhook URL: https://your-shop/index.php?route=extension/payment/erapay/callback.
Put the webhook URL into EraPay → Settings. Orders become paid after 15 confirmations; expired invoices cancel pending orders.