Developers
Accept payments with one API call
Your server creates an order, the buyer pays on the PayerNex hosted checkout, and PayerNex sends your server a signed notification once the payment is confirmed. The money goes straight to your own Binance, bank, crypto wallet or gateway account. PayerNex only checks and confirms it.
How it works #
01
Create order
Your server calls
POST /api/v1/create-order with the amount.02
Redirect buyer
Send the buyer to the
checkout_url you get back.03
Buyer pays
They choose one of your active gateways and pay you directly.
04
PayerNex confirms
It matches the payment (Binance, SMS/email bank alert, on-chain or gateway API).
05
You get a webhook
A signed POST hits your server. You mark the invoice paid.
PayerNex has no test mode or sandbox. Each API key is live, so test with a small real payment (for example 1 USDT).
Quickstart #
-
Create an account and choose a plan
Register and verify your email. To create orders through the API your account needs an active subscription. Without one,
create-orderreturns403 Merchant subscription expired. Please renew your plan.See pricing. - Connect at least one gateway In the dashboard, open Gateway settings and add a Binance Pay, bank, TRC20/BEP20 wallet, Stripe or other supported gateway. The checkout shows the buyer your active gateways.
- Copy your API key and webhook secret Open Dashboard → Developer (API Keys & Webhooks). The API key is a 54-character hex string and the Webhook Secret is a 64-character hex string. Keep both on your server only. Regenerate API Key stops the old key from working straight away.
- Create an order from your server Send the amount, your own reference and the URLs PayerNex should use for this order.
curl -X POST https://payernex.com/api/v1/create-order \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 25.00,
"currency": "USDT",
"customer_id": "user_1042",
"description": "Invoice #1042",
"ipn_url": "https://your-site.com/payernex/webhook",
"success_url": "https://your-site.com/orders/1042/thanks",
"cancel_url": "https://your-site.com/orders/1042"
}'
<?php
$ch = curl_init('https://payernex.com/api/v1/create-order');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PAYERNEX_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => 25.00,
'currency' => 'USDT',
'customer_id' => 'user_1042',
'description' => 'Invoice #1042',
'ipn_url' => 'https://your-site.com/payernex/webhook',
'success_url' => 'https://your-site.com/orders/1042/thanks',
'cancel_url' => 'https://your-site.com/orders/1042',
]),
]);
$res = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status !== 201 || empty($res['success'])) {
throw new RuntimeException('PayerNex: ' . ($res['error'] ?? "HTTP $status"));
}
// Store $res['data']['order_ref'] with invoice #1042, then send the buyer to checkout.
header('Location: ' . $res['data']['checkout_url']);
exit;
// Node.js 18+ (built-in fetch)
async function createOrder() {
const res = await fetch('https://payernex.com/api/v1/create-order', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PAYERNEX_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 25.0,
currency: 'USDT',
customer_id: 'user_1042',
description: 'Invoice #1042',
ipn_url: 'https://your-site.com/payernex/webhook',
success_url: 'https://your-site.com/orders/1042/thanks',
cancel_url: 'https://your-site.com/orders/1042',
}),
});
const json = await res.json();
if (res.status !== 201 || !json.success) {
throw new Error(`PayerNex: ${json.error || res.status}`);
}
// Store json.data.order_ref with invoice #1042, then redirect the buyer.
return json.data.checkout_url;
}
Response · 201 Created
{
"success": true,
"data": {
"order_ref": "ORD-9F2C61D04B7A3E58",
"note_code": "48213",
"amount": 25,
"currency": "USDT",
"status": "pending",
"checkout_url": "https://payernex.com/checkout/…",
"expires_at": "2026-10-25T10:32:41.000Z"
}
}
-
Redirect the buyer to
checkout_urlThe order expires 30 minutes after it is created (expires_at). After the payment is confirmed the checkout sends the buyer to yoursuccess_url. If the order expires, it sends them to yourcancel_url. -
Receive the webhook and check the signature
When the order becomes paid, PayerNex POSTs a JSON
payment.completedevent to youripn_url. If you didn't send one, it goes to the Callback URL saved in Dashboard → Developer. TheX-Signatureheader isHMAC-SHA256(raw body, webhook secret)in hex. See verifying signatures. -
Re-fetch the order before you fulfil it
Call
GET /api/v1/order/{order_ref}and use itsstatusandpaid_amount. The official plugins always do this. Respond to the webhook with any 2xx.
Using WooCommerce, WHMCS or Dhru Fusion? You don't need to write any code. Install the official plugin and paste your API key and webhook secret.
Key concepts #
| Concept | What it means |
|---|---|
| Base URL | https://payernex.com. Every API path starts with /api/v1. |
| Authentication | Authorization: Bearer YOUR_API_KEY on every request. One key per merchant account. Details |
order_ref | PayerNex's ID for an order, for example ORD-9F2C61D04B7A3E58 (ORD- + 16 uppercase hex characters). Use it to look up or cancel the order. |
note_code | A 6-digit code the buyer types into the Binance Pay note/memo so PayerNex can match their payment to your order. |
| Order status | pending → paid, or manual_review, expired, cancelled, rejected. Full list |
| Webhook | A signed server-to-server POST sent when an order is paid. Webhooks reference |
| Rate limit | 60 requests per minute per IP address across /api/*. Details |