API documentation
Create orders, receive signed callbacks, query orders, refunds, payouts and your balance. Try every call in the sandbox first.
API Credentials
Every merchant account has three credentials in Merchant Settings. Use them on your server — never in browser or mobile client code.
App ID
Your merchant account identifier. Send it as the appid parameter when you create orders and query orders.
API Key
Your secret signing key. It is not sent as a request parameter. Use it only on your server to:
- Calculate the
signfield for/api/createorder(see Signature) - Verify payment notifications sent to your
notify_url(see Callback Notification)
Key
A separate query credential used with your App ID for read-only order lookups via GET /api/order. Pass it as the key query parameter together with appid.
Quick Integration
Follow these steps to accept your first payment. Start in the Sandbox Playground with test credentials before using live keys.
API base URL
All endpoints are relative to your gateway origin (this deployment: https://paymn.io):
POST https://paymn.io/api/createorder— JSON API (recommended for server-side checkout)GET …/api/createorder?…— hosted HTML checkout page (fastest to try; polls status and redirects toreturn_url)GET …/api/order— query order status
Choose an integration mode
| Mode | When to use | What you get |
|---|---|---|
| POST JSON | Production checkout on your site or app backend | JSON with redirectUrl / selectUrl — redirect the payer yourself |
| GET link | Quick test or simple “Pay now” link | HTML payment page (QR, polling, auto-redirect to return_url) |
Steps
- Register or sign in — Create an account at /merchant/register or sign in at /merchant/login.
- Copy your credentials — Open Merchant Settings and copy your App ID, API Key and Key (see API Credentials).
- Configure webhook delivery — Set a default callback URL in Settings or pass
notify_urlon each order. The saved URL is used for paid-order webhooks (see Callback Notification). If both are empty, no webhook is sent. - Create an order — Call
POST /api/createorder(JSON) or openGET /api/createorder(hosted page) withappid,clientip,action=createorder,amount,currency,paymentMethodandsign. Setclientipto the public IP of the machine making the request (see Authentication). - Redirect the customer to pay — From the JSON response, send the payer to
redirectUrlorselectUrl(whichever is present).selectUrlmeans an extra step (pick a payment method) before paying;nextActiondescribes that step. If both are absent, use/payment/{paymentId}on this gateway. - Handle the webhook — When payment succeeds, we send a GET request to the order’s callback URL, with every parameter in the query string. Verify the signature with your API Key and respond with HTTP 200 and body
success(see Callback Notification). -
Verify order status (optional) — When creating the order, set
return_urlwith the{paymentId}placeholder (see Create Order), for examplehttps://yoursite.com/success?paymentId={paymentId}. After payment, the customer is redirected to your page and{paymentId}is replaced with the real order ID. Read thepaymentIdquery parameter from that URL, then call Query Order on your server to sync the latest status before showing a success message:GET /api/order?action=order&appid=YOUR_APPID&paymentId=PAYMENT_ID_FROM_URL&sign=SIGN(signed with your key; see Query Order). Use the response fieldsstatus/status_strto update your local order. Webhooks remain the authoritative async notification; this pattern is for immediate confirmation when the payer lands on your return page.
End-to-end example (POST JSON)
Minimal server-side flow after you compute sign (see Signature):
// 1. Create order (run on your server; replace YOUR_* placeholders)
const res = await fetch('https://paymn.io/api/createorder', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ appid, clientip, action: 'createorder', amount: 100, currency: 'CNY',
paymentMethod: 'alipay', clientOrderId: 'ORDER-001', return_url, notify_url, sign, sign_type: 'MD5' })
});
const { data } = await res.json();
// 2. Redirect payer to checkout
const checkoutUrl = data.redirectUrl || data.selectUrl || `/payment/${data.paymentId}`;
// response.redirect(checkoutUrl) — your framework
// 3. Webhook handler (express example)
app.get('/api/notify', (req, res) => {
const expected = signStr(req.query, process.env.API_KEY); // same algorithm as #signature
if (expected !== req.query.sign) return res.status(400).send('invalid sign');
// update your order if req.query.status_str === 'paid'
res.status(200).send('success'); // must be the string "success"
});
Authentication
See API Credentials for your appid. Create-order requests also require clientip — the public IP of the client making the HTTP request (usually your backend server’s egress IP, or the payer’s IP when you proxy from the browser).
clientip must match the request IP. If they differ, /api/createorder returns HTTP 403 with Request IP does not match clientip. Behind a reverse proxy, ensure your server forwards the real client IP and pass that same value in clientip.
Request IP is not allowed for this merchant, so a leaked API Key cannot be used elsewhere. The same page can make timestamp + nonce mandatory on every signed request.
Signature Verification
All API requests that create or modify data require signature verification to ensure data integrity and prevent tampering.
How Signature Works
The signature is calculated using all request parameters (except sign and sign_type) and your API key (stored securely on the server).
- Collect all parameters except
signandsign_type - Sort parameters alphabetically by key
- Join parameters as
key=valuepairs with& - Append your API key to the string
- Calculate MD5 hash (lowercase) of the resulting string
Signature Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sign |
string | Required | MD5 signature of all parameters (calculated using your API key) |
sign_type |
string | Optional | Signature type, currently only MD5 is supported (default: MD5) |
/api/createorder (not a nested JSON object). Empty strings are included; omit only null / undefined fields.
Worked example (createorder)
Given API Key 42ba8e8f-7cbb-4bf9-ba2a-57904f3d9451 and these parameters (before adding sign):
Signing plaintext (sorted key=value, joined with &), then append API Key and MD5:
action=createorder&amount=100&appid=YOUR_APPID&clientOrderId=YOUR_ORDER_ID_123&clientip=127.0.0.1¤cy=CNY&description=Test order¬ify_url=https://example.com/api/notify&paymentMethod=alipay&return_url=https://example.com/payment/success?paymentId={paymentId}42ba8e8f-7cbb-4bf9-ba2a-57904f3d9451
sign = 9bb303e3116d862fbeb23bd8a8a8b07d
sign_type is sent in the request but excluded from the signature. Numeric amount in JSON is signed as sent (e.g. 100, not 100.00).
Code Examples
Calculate sign on your server using the same flat parameters you send in the request:
import hashlib
API_KEY = 'YOUR_API_KEY'
def sign_createorder(params: dict) -> str:
filtered = {
k: v for k, v in params.items()
if k not in ('sign', 'sign_type') and v is not None
}
plain = '&'.join(f'{k}={filtered[k]}' for k in sorted(filtered))
return hashlib.md5((plain + API_KEY).encode('utf-8')).hexdigest().lower()
payload = {
'appid': 'YOUR_APPID',
'clientip': '127.0.0.1',
'action': 'createorder',
'amount': 100,
'currency': 'CNY',
'paymentMethod': 'alipay',
'description': 'Test order',
'clientOrderId': 'YOUR_ORDER_ID_123',
'return_url': 'https://example.com/payment/success?paymentId={paymentId}',
'notify_url': 'https://example.com/api/notify',
}
payload['sign'] = sign_createorder(payload)
payload['sign_type'] = 'MD5'
const crypto = require('crypto');
const API_KEY = 'YOUR_API_KEY';
function signCreateorder(params) {
const filtered = {};
for (const [k, v] of Object.entries(params)) {
if (k === 'sign' || k === 'sign_type') continue;
if (v === null || v === undefined) continue;
filtered[k] = v;
}
const plain = Object.keys(filtered).sort()
.map((k) => `${k}=${filtered[k]}`)
.join('&');
return crypto.createHash('md5').update(plain + API_KEY).digest('hex').toLowerCase();
}
const payload = {
appid: 'YOUR_APPID',
clientip: '127.0.0.1',
action: 'createorder',
amount: 100,
currency: 'CNY',
paymentMethod: 'alipay',
description: 'Test order',
clientOrderId: 'YOUR_ORDER_ID_123',
return_url: 'https://example.com/payment/success?paymentId={paymentId}',
notify_url: 'https://example.com/api/notify',
};
payload.sign = signCreateorder(payload);
payload.sign_type = 'MD5';
<?php
$apiKey = 'YOUR_API_KEY';
function sign_createorder(array $params, string $apiKey): string {
unset($params['sign'], $params['sign_type']);
$params = array_filter($params, fn($v) => $v !== null);
ksort($params);
$plain = implode('&', array_map(
fn($k) => $k . '=' . $params[$k],
array_keys($params)
));
return md5($plain . $apiKey);
}
$payload = [
'appid' => 'YOUR_APPID',
'clientip' => '127.0.0.1',
'action' => 'createorder',
'amount' => 100,
'currency' => 'CNY',
'paymentMethod' => 'alipay',
'description' => 'Test order',
'clientOrderId' => 'YOUR_ORDER_ID_123',
'return_url' => 'https://example.com/payment/success?paymentId={paymentId}',
'notify_url' => 'https://example.com/api/notify',
];
$payload['sign'] = sign_createorder($payload, $apiKey);
$payload['sign_type'] = 'MD5';
Create Order
Create a payment order. The response includes checkout URLs (redirectUrl / selectUrl) and/or a QR image URL depending on the payment method.
Send a JSON body with Content-Type: application/json. Returns JSON with checkout URLs for your server to redirect the payer.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appid |
string | Required | Your application ID |
clientip |
string | Required | Your client IP address |
action |
string | Required | Must be createorder |
amount |
number | Required | Order amount (e.g., 100.00) |
currency |
string | Required | Currency code: CNY, USD, or BDT (use BDT with eps, paystation, or aamarpay) |
paymentMethod |
string | Required | Payment method (see Payment Methods section) |
sign |
string | Required | MD5 signature (see Signature section) |
sign_type |
string | Optional | Signature type (default: MD5) |
description |
string | Optional | Order description |
customerName |
string | Optional | Customer name |
customerEmail |
string | Optional | Customer email |
customerPhone |
string | Optional | Customer phone number |
allowedPaymentMethods |
string | Optional | When paymentMethod=select: comma-separated gateway codes to show on the payer selection page (e.g. alipay,wxpay,usdt_direct). Omit to show all methods enabled for the order currency and merchant account. USD orders include balance (logged-in customer account balance) by default; exclude with e.g. allowedPaymentMethods=alipay,wxpay. Included in signature. |
lang |
string | Optional | Locale for the payer selection page UI (e.g. en, zh, es). Default en. When not en, selectUrl uses a locale path prefix (e.g. /zh/payment/{orderId}?step=select). Included in signature when provided. |
return_url |
string | Optional | Return URL after payment completion (will redirect automatically if provided). You can use {paymentId} placeholder in the URL, which will be automatically replaced with the actual payment ID when redirecting. Example: https://example.com/success?paymentId={paymentId} |
notify_url |
string | Optional | Webhook URL for this order. If omitted, the default callback URL from Merchant Settings is used. If both are empty, no webhook is sent for that order. |
clientOrderId |
string | Optional | Client's own order identifier. Saved and returned in responses. When provided, duplicate create requests for the same merchant while the order is still pending or ready return the existing order (idempotent; safe to refresh the GET payment link). After paid, failed, or cancelled, a new order may be created with the same clientOrderId. |
payerRef |
string | Optional | Your own stable id for the paying customer (1–64 chars: A-Z a-z 0-9 _ . : -; do not send e-mail or phone). For crypto networks with automatic confirmation, the same payerRef always gets the same deposit address, so a returning customer can reuse it. Without payerRef, each order gets its own one-time address. Always create an order before each payment; transfers without a matching order are handled manually. |
- IP Address Verification: The
clientipparameter must match the actual request IP address, otherwise the request will be rejected (403 error). - Signature Verification: All requests must include a valid MD5 signature. Signature calculation errors will cause the request to fail (400 error).
- Return URL Placeholder: You can use
{paymentId}placeholder inreturn_url. The system will automatically replace it with the actual payment ID when redirecting after payment completion. - Callback URL: Per-order
notify_urloverrides Settings; otherwise the Settings default is stored on the order. Webhooks are only sent when the saved URL is non-empty. - Idempotent
clientOrderId: Repeating POST or refreshing the GET payment URL with the sameclientOrderIddoes not create another order while status ispendingorready.
Request Example
Success Response
Response fields (data)
| Field | Description |
|---|---|
paymentId / orderId |
Gateway order identifier (same value). Use for Query Order and return_url placeholder. |
redirectUrl |
URL to send the payer to pay immediately (gateway page, external PSP, or hosted checkout). |
selectUrl |
Present when the payer must choose a method first (paymentMethod=select, or USDT Direct). Often equals redirectUrl in that case. |
nextAction |
Hint when selectUrl is used: e.g. payment_method_select, usdt_direct_pay. |
payableAmount |
When paymentMethod=usdt_direct: exact USDT amount the payer must send (includes a small random suffix fingerprint). Also returned on idempotent re-fetch of an existing USDT Direct session. |
qrImageUrl |
QR code image URL when applicable (may be null for redirect-only methods). |
status / statusString |
Order state — see Order Status. Balance payments may return paid immediately. |
Redirect rule: redirectUrl || selectUrl || /payment/{paymentId}.
Error Response
sign and sign_type) and your API key. See the Signature section for details.
Create a new payment order and receive an HTML payment page. The page will automatically poll the order status every 4 seconds, timeout after 3 minutes, and automatically redirect to return_url when payment is completed.
Request Parameters
Note: All parameters are passed as query parameters (URL parameters). Parameters are the same as POST request above.
| Parameter | Type | Required | Description |
|---|---|---|---|
appid |
string | Required | Your application ID |
clientip |
string | Required | Your client IP address |
action |
string | Required | Must be createorder |
amount |
number | Required | Order amount (e.g., 100.00) |
currency |
string | Required | Currency code: CNY, USD, or BDT (use BDT with eps, paystation, or aamarpay) |
paymentMethod |
string | Required | Payment method (see Payment Methods section) |
sign |
string | Required | MD5 signature (see Signature section) |
sign_type |
string | Optional | Signature type (default: MD5) |
description |
string | Optional | Order description |
customerName |
string | Optional | Customer name |
customerEmail |
string | Optional | Customer email |
customerPhone |
string | Optional | Customer phone number |
allowedPaymentMethods |
string | Optional | When paymentMethod=select: comma-separated gateway codes to show on the payer selection page (e.g. alipay,wxpay,usdt_direct). Omit to show all methods enabled for the order currency and merchant account. USD orders include balance (logged-in customer account balance) by default; exclude with e.g. allowedPaymentMethods=alipay,wxpay. Included in signature. |
lang |
string | Optional | Locale for the payer selection page UI (e.g. en, zh, es). Default en. When not en, selectUrl uses a locale path prefix (e.g. /zh/payment/{orderId}?step=select). Included in signature when provided. |
return_url |
string | Optional | Return URL after payment completion (page will automatically redirect after 1 second if payment succeeds). You can use {paymentId} placeholder in the URL, which will be automatically replaced with the actual payment ID when redirecting. Example: https://example.com/success?paymentId={paymentId} |
notify_url |
string | Optional | Webhook URL for this order. If omitted, the default callback URL from Merchant Settings is used. If both are empty, no webhook is sent. |
clientOrderId |
string | Optional | Client's own order identifier. Saved and returned in responses. When provided, duplicate create requests for the same merchant while the order is still pending or ready return the existing order (idempotent; safe to refresh the GET payment link). After paid, failed, or cancelled, a new order may be created with the same clientOrderId. |
payerRef |
string | Optional | Your own stable id for the paying customer (1–64 chars: A-Z a-z 0-9 _ . : -; do not send e-mail or phone). For crypto networks with automatic confirmation, the same payerRef always gets the same deposit address, so a returning customer can reuse it. Without payerRef, each order gets its own one-time address. Always create an order before each payment; transfers without a matching order are handled manually. |
Request Example
GET /api/createorder?appid=YOUR_APPID&clientip=127.0.0.1&action=createorder&amount=100¤cy=CNY&paymentMethod=alipay&description=Test+order&clientOrderId=YOUR_ORDER_ID_123&return_url=https%3A%2F%2Fexample.com%2Fsuccess%3FpaymentId%3D%7BpaymentId%7D¬ify_url=https://example.com/api/notify&sign=CALCULATED_SIGNATURE&sign_type=MD5
- IP Address Verification: The
clientipparameter must match the actual request IP address, otherwise the request will be rejected (403 error). - Signature Verification: All requests must include a valid MD5 signature. Signature calculation errors will cause the request to fail (400 error).
- Return URL Placeholder: You can use
{paymentId}placeholder inreturn_url. The system will automatically replace it with the actual payment ID when redirecting after payment completion. - Callback URL: Per-order
notify_urloverrides Settings; otherwise the Settings default is stored on the order. - Idempotent
clientOrderId: Refreshing this payment URL (or repeating the request) with the sameclientOrderIddoes not create another order while status ispendingorready.
Response
Returns an HTML payment page that includes:
- Order information display
- QR code for payment (if order is ready)
- Automatic status polling (every 4 seconds)
- 3-minute countdown timer
- Automatic redirect to
return_urlwhen payment is completed
- Automatically polls order status every 4 seconds
- Shows a 3-minute countdown timer
- Automatically redirects to
return_urlwhen payment is completed (after 1 second delay) - Handles timeout after 3 minutes
- Displays QR code for payment scanning
sign and sign_type) and your API key. See the Signature section for details.
Query Order
Query single order details or list multiple orders.
Typical use: after the payer returns via return_url with paymentId={paymentId}, call this endpoint with the resolved paymentId to sync order status on your success page (see Quick Integration step 7).
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appid |
string | Required | Your application ID |
sign |
string | Required (or key) | Recommended. MD5 (lowercase) of all other parameters sorted by name as k=v&k=v, followed directly by your key, the same way as the createorder sign (which uses your apikey). The key then never appears in the URL. |
key |
string | Legacy | Your key (UUID format), sent in plain text. Still accepted, but anything that logs URLs (proxies, CDNs) can see it. Use sign instead; do not send both. |
timestamp, nonce |
number, string | Optional | Replay protection, available on every signed request including createorder. timestamp is Unix time in seconds or milliseconds and must be within 5 minutes of the server's time. nonce is a random string (up to 128 characters) that is accepted only once. Both are part of the signed parameters. They can be made mandatory for your account. |
action |
string | Required | order (single) or orders (list) |
paymentId |
string | Required if action=order | Payment ID to query |
page |
number | Optional | Page number (default: 1, only for action=orders) |
limit |
number | Optional | Items per page (max: 50, default: 10, only for action=orders) |
Request Example
GET /api/order?action=order&appid=YOUR_APPID&nonce=8f3a1c&paymentId=abc123def456×tamp=1793000000&sign=MD5_OF_SORTED_PARAMS_PLUS_KEY
Single Order Response
Order List Response
Refunds
Ask for a refund of a paid order and follow its status. Refunds are reviewed by Paymn before any money moves.
- Once approved, the refunded amount is taken from your balance (so it cannot be withdrawn).
- Orders paid from a Paymn account balance are refunded to that balance automatically.
- Orders paid through any other channel are refunded offline. You can refund your customer yourself and record the transfer under Refunds in the merchant portal; your balance is credited back after we confirm it. Otherwise Paymn refunds the customer.
JSON or form body, signed exactly like Create Order: sign = MD5 over all other parameters (sorted, without sign / sign_type) plus your API Key. timestamp (unix seconds, within 5 minutes) and a one-time nonce are required for action=refund (optional for refundquery) and signed like every other parameter. Parameter values must not contain & or =.
Request a refund — action=refund
| Parameter | Type | Required | Description |
|---|---|---|---|
appid | string | Required | Your App ID |
action | string | Required | refund |
paymentId | string | Optional* | The order to refund. *Give paymentId or clientOrderId; with both, they must belong to the same order. |
clientOrderId | string | Optional* | Your order id, as sent to Create Order. |
amount | number | Optional | Amount in the order currency. Omit to refund everything still refundable. |
reason | string | Required | Why the order is refunded (max 500 characters). |
merchantRefundId | string | Optional | Your own id for this refund (max 64 characters; longer is rejected). Sending it again returns the same refund instead of creating a second one. |
timestamp | number | Required | Unix time in seconds; must be within 5 minutes of ours. |
nonce | string | Required | Random one-time value (e.g. 16 hex characters); a nonce can be used once. |
sign | string | Required | MD5 signature (see above) |
Query refunds — action=refundquery
Send refundId or merchantRefundId for one refund, or paymentId / clientOrderId for every refund of an order (plus its refunded total).
Refund statuses
| status | Meaning |
|---|---|
requested | Waiting for review. No money has moved. |
rejected | Not approved; see decisionNote. |
completed | Refunded to the payer's Paymn balance (or back to yours for your own balance-paid order). |
awaiting_payout | Approved and taken from your balance; the customer is still to be refunded offline. |
merchant_claimed | You recorded your own transfer; waiting for our confirmation. |
paid_out | Paymn refunded the customer offline. |
merchant_paid | Your transfer was confirmed and your balance credited back. |
Response
Errors use the same shape as other endpoints, e.g. {"code":400,"message":"Refund amount cannot exceed the refundable amount ($90.00)."}. Sandbox orders, Swap deposits and orders whose credit is on hold cannot be refunded.
Account
Read your balance, the payment methods open to your account with their limits, and the rates used to settle your orders. Read-only.
JSON or form body (or the same parameters as a GET query), signed exactly like Create Order: sign = MD5 over all other parameters (sorted, without sign / sign_type) plus your API Key. timestamp + nonce are optional (checked when sent). Limited to 300 requests per minute by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
appid | string | Required | Your App ID |
action | string | Required | balance, methods or rates |
currency | string | Optional | With action=methods: only the methods that accept this order currency (USD, CNY, BDT, EUR, GBP, BRL, NZD). |
sign | string | Required | MD5 signature (see above) |
Balance — action=balance
All amounts in USD. availableForWithdrawal is what you can withdraw now: your balance minus payments still in their hold period (onHold) and amounts reserved for open refunds (reservedForRefunds). onHoldOrders lists each frozen payment with amount, method, received time, hold days, and release time.
Payment methods — action=methods
Methods enabled for your account. Limits are per order in USD (null = no maximum); feePercent is the fee on payments through the method and holdDays how long a payment stays on hold before it can be withdrawn.
Rates — action=rates
usdToCny is the rate for your Alipay / WeChat Pay orders (your own rate when one is set, else the platform rate); usdToBdt converts BDT orders. An order keeps the rate in force when its payment starts.
Payouts
Pay out from your balance to an account you name: your customer, an affiliate or yourself. Each payout is reviewed by Paymn and then paid through the chosen method; your balance is debited when the payout is approved, exactly like a withdrawal from the merchant portal.
- The payout API is enabled per account: ask support to turn it on.
- An API IP allowlist is required and every request must carry
timestampandnonce. - The total of your pending payouts cannot exceed what you can withdraw now.
JSON or form body, signed exactly like Create Order with your API Key. Parameter values must not contain & or =.
Request a payout — action=payout
| Parameter | Type | Required | Description |
|---|---|---|---|
appid | string | Required | Your App ID |
action | string | Required | payout |
amount | number | Required | Amount taken from your balance, in currency; fees are deducted from it. |
currency | string | Optional | USD (default) or BDT |
method | string | Required | A payout method id from action=methods, e.g. USDT |
account | string | Required | Where to pay: wallet address, email or number, as the method's accountLabel describes (max 200 characters). |
merchantPayoutId | string | Required | Your unique id (1-64 characters: letters, digits, _ . : -). Sending it again returns the same payout instead of creating a second one. |
info | string | Optional | Payee name, memo or anything we need to pay (max 500 characters). |
notify_url | string | Optional | Where to send the status callback; defaults to the callback URL in Merchant Settings. |
timestamp, nonce | number, string | Required | Replay protection, as for refunds. |
sign | string | Required | MD5 signature |
Query — action=payoutquery
Send payoutId or merchantPayoutId. action=methods lists the payout methods with their limits (USD) and fee.
Statuses
| status | Meaning |
|---|---|
processing | Waiting for review. Your balance has not been debited yet. |
paid | Approved and paid; your balance was debited. |
rejected | Not paid; see note. Your balance was not debited. |
Response
When a payout is paid or rejected, a GET callback with the same fields plus type=payout is sent once, signed with your API Key like order callbacks (check type to tell it from an order callback). Use action=payoutquery if you missed it.
Static wallets
Give each of your customers a permanent USDT / USDC deposit address. They can top up at any time without opening a checkout: every transfer becomes a paid order, is credited to your balance and is sent to your callback URL.
- The same
payerRefand network always return the same address. - Each transfer is credited minus the coin's payment fee (
feeUsd). Its callback haspayerRefset to your customer id and itsclientOrderIdstarts withSW-. - Only USDT and USDC are credited automatically. Other coins, or an amount that does not cover the fee, are reviewed by our team.
JSON or form body, signed exactly like Create Order with your API Key.
| Parameter | Type | Required | Description |
|---|---|---|---|
appid | string | Required | Your App ID |
action | string | Required | address, or networks to list the networks and coins available |
payerRef | string | Required | Your customer id (1-64 characters: letters, digits, _ . : -). Do not use an email or phone number. |
network | string | Required | e.g. TRC20, BEP20 |
notify_url | string | Optional | Callback URL for this wallet's deposits; defaults to the one in Merchant Settings. |
sign | string | Required | MD5 signature |
Response
Payment links
Payment links (no code)
In the merchant portal, open Payment links and create a link with a fixed price, or let the payer enter the amount (with an optional minimum and maximum). You can ask the payer for one piece of information, such as their panel username. Share the link anywhere, or copy the ready-made HTML button onto your website.
- The payer chooses the payment method on our page. Each payment is a normal order: it is credited to your balance and appears under Orders.
- If a callback URL is set in Merchant Settings, every paid order from a link is sent to it like an API order. The
clientOrderIdstarts withPL-followed by the link id and thedescriptionholds the link title and the payer's answer. - A link can be turned off at any time; it then shows an "invalid link" page.
Callback Notification
When an order status changes to paid, the system will automatically send a callback notification to your specified URL.
- Pass
notify_urlwhen creating an order to override the per-order webhook URL - If omitted, the default callback URL from Merchant Settings is saved on the order
- Webhooks are sent only when the order has a non-empty saved callback URL (from either source)
paymentId starts with test_) and shows exactly what was sent and what your server answered. The Webhook delivery log there lists every delivery attempt of the last 30 days with the HTTP status and your server's reply.
Callback Request
The system sends a GET request to your callback URL with the following parameters in the query string:
| Parameter | Type | Description |
|---|---|---|
paymentId |
string | Unique payment identifier |
amount |
string | Order amount (as string, e.g., "2.2") |
currency |
string | Currency code: CNY, USD, or BDT (use BDT with eps, paystation, or aamarpay) |
status |
string | Order status code: "2" (paid) |
status_str |
string | Order status string: "paid" |
paymentMethod |
string | Payment method used: alipay, wxpay, eps, paystation, or aamarpay |
description |
string | Order description (if provided) |
completedTime |
string | Payment completion time in ISO 8601 format (e.g., "2025-12-01T02:32:05.877Z") |
createdAt |
string | Order creation time in ISO 8601 format (e.g., "2025-12-01T02:31:43.997Z") |
clientOrderId |
string | Client order ID (if provided when creating the order) |
sign |
string | MD5 signature for verifying the callback authenticity |
sign_type |
string | Signature type: MD5 |
Callback Example
Signature Verification
You must verify the callback signature to ensure the request is authentic. The signature is calculated using the same algorithm as API requests:
- Collect all parameters except
signandsign_type - Sort parameters alphabetically by key
- Join parameters as
key=valuepairs with& - Append your API key to the string
- Calculate MD5 hash (lowercase) of the resulting string
- Compare the calculated signature with the
signparameter
Callback Response
Your callback endpoint must return a specific response to acknowledge successful receipt:
- Success: Return HTTP 200 status code with response body containing the string
"success"(case-insensitive). The response body must be exactly"success"(e.g.,"success","SUCCESS", or"Success"). Any other response will be considered a failure and trigger retry. - Failure: Return any non-200 status code, or return HTTP 200 with a response body that is not
"success"(case-insensitive) will trigger retry
- HTTP status code is 200
- Response body (trimmed and case-insensitive) equals
"success"
Examples of successful responses:
"success"✓"SUCCESS"✓"Success"✓
Examples of failed responses (will trigger retry):
{"code": 1, "message": "success"}✗ (not the string "success")"ok"✗ (not "success")"received"✗ (not "success")- HTTP 500 or any non-200 status code ✗
Retry Mechanism
The system implements an automatic retry mechanism for failed callbacks:
- Maximum attempts: 20 retries
- Retry intervals: Exponential backoff (increasing delays between retries)
- Retry conditions: Callbacks are retried if:
- Your server returns a non-200 status code
- Your server returns HTTP 200 but the response body is not
"success"(case-insensitive) - The request fails (network error, timeout, etc.)
- Success: Once your server returns HTTP 200 with response body
"success"(case-insensitive), no further callbacks will be sent for that order
- Implement idempotency: Check if the order has already been processed before processing again
- Verify the signature before processing
- Return HTTP 200 with response body
"success"immediately after receiving and validating the callback, then process the order asynchronously if needed - Log all callback requests for debugging and auditing
- Use HTTPS for callback URLs to ensure secure transmission
- Important: Ensure your callback endpoint returns exactly the string
"success"(case-insensitive) for successful processing
Order Status Codes
Orders have the following status values:
| Code | String | Description |
|---|---|---|
0 |
pending |
Order created, saved locally |
1 |
ready |
Order sent to payment provider, QR code generated |
2 |
paid |
Payment completed successfully |
3 |
failed |
Payment failed |
4 |
cancelled |
Order cancelled |
Payment Methods
Supported payment methods and their currency compatibility:
| Method | Code | Supported Currencies | Description |
|---|---|---|---|
| Alipay | alipay |
CNY, USD | Alipay mobile payment |
| WeChat Pay | wxpay |
CNY, USD | WeChat mobile payment |
| Credit / Debit Card | eps |
BDT, USD | Supports Credit / Debit Card payment. |
| Credit / Debit Card | paystation |
BDT, USD | PayStation (Bangladesh): card and local methods via PayStation checkout. USD orders are charged in BDT at the configured USD→BDT rate. |
| aamarpay | aamarpay |
BDT, USD | aamarpay (Bangladesh): redirect checkout. BDT is sent as-is. USD is converted locally with the system USD→BDT rate (same as EPS/PayStation) and charged in BDT. Callback: /api/gatewaynotification/aamarpay/return/success (verified via Search Transaction). |
| USDT Direct | usdt_direct |
CNY, USD, BDT | Hosted checkout at /payment/{orderId}/usdt-direct. Payer selects network (TRC20/BEP20, etc.), pays the exact payableAmount USDT shown, then submits the on-chain transaction hash. Auto-review uses chain verification, Binance hisrec, dual, or Binance Pay depending on coin config in Advanced Settings. No third-party IPN — settlement is internal after hash verification or Super Admin approval. Response includes nextAction=usdt_direct_pay and payableAmount when initialized. |
| Balance | balance |
CNY, USD | Pay from merchant account balance. Instant settlement; no redirect or QR code. Response includes paidWithBalance: true and status=2 (paid). |
| Payer choice (multi-gateway) | select |
CNY, USD, BDT, EUR, GBP, BRL, NZD | Deferred flow: createorder with paymentMethod=select returns selectUrl and nextAction=payment_method_select. Optional lang (default en) sets the payer selection page locale and URL prefix (e.g. /zh/payment/{orderId}?step=select). Payer sees order amount and each method's min/max limits, then POST ?step=confirm with paymentMethod. USD orders also offer balance: payer must log in at /merchant/login; funds are deducted from the payer's platform account balance and credited to the merchant. Optional allowedPaymentMethods restricts the list. usdt_direct redirects to the USDT Direct checkout after confirm. |
- CNY (Chinese Yuan): Supports
alipay,wxpay,usdt_directandbalance - USD (US Dollar): Supports
alipay,wxpay,eps,paystation,aamarpay,usdt_directandbalance - BDT (Bangladesh Taka): Supports
eps,paystation,aamarpayandusdt_direct
- Your merchant balance is kept in USD. Every paid order is credited in USD and refund
balanceAmountvalues are USD. - USD orders are credited the USD amount actually paid, whatever the channel. When the payer uses
alipayorwxpay, they are charged the USD amount × your USD→CNY rate in CNY; the rate is fixed on the order when its QR code is first made. - CNY orders are credited the CNY amount ÷ that same fixed rate. Your USD→CNY rate is set by Paymn and is shown read-only in Merchant Settings; without one, the platform rate applies.
- BDT orders are credited at the USD→BDT rate fixed when the payer starts the EPS / PayStation / aamarPay checkout.
Error Codes
Common error codes and their meanings:
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or business logic error |
| 401 | Unauthorized - Invalid appid or apikey |
| 403 | Forbidden — clientip does not match the request IP, or the merchant account is disabled |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server-side error |