A simple HTTP API: create an invoice, get a payment address and a payment page, receive a callback when the payment is confirmed. Try every call below in the public sandbox — no signup, no real funds.
Use this key with the sandbox base URL. Sandbox invoices use fake addresses (SANDBOX_…) and fixed exchange rates. Nothing is sent to the blockchain and no callback is delivered.
Base URL: https://nextwaypay.com/api/sandbox/ — same parameters as production, limit 60 requests per minute per IP.
Tip: an amount ending in .02 ends as declined, .03 as cancelled, anything else completes. Status moves pending → in progress → final in about 30 seconds.
Press “Create invoice”.
—
curl "https://nextwaypay.com/api/sandbox/invoice_create/?code=nwp_test_public¤cy=2&amount=25.00&description=Order+1001"
$r = json_decode(file_get_contents(
'https://nextwaypay.com/api/sandbox/invoice_create/?' . http_build_query([
'code' => 'nwp_test_public', 'currency' => 2, 'amount' => 25.00,
'description' => 'Order 1001', 'callback_url' => 'https://your.site/callback'
])), true);
if ($r['code'] === 1) { echo $r['wallet'], ' ', $r['sum']; }
const q = new URLSearchParams({ code: 'nwp_test_public', currency: 2, amount: 25 });
const r = await (await fetch('https://nextwaypay.com/api/sandbox/invoice_create/?' + q)).json();
console.log(r.wallet, r.sum);
For production, register, copy your personal API key from the dashboard and replace /api/sandbox/ with /api/.
Create invoicePRODUCTIONSANDBOX
| Parameter | Description |
|---|---|
| codeCHAR | Your API key (sandbox: nwp_test_public). |
| currencyINT | Currency of the invoice amount: 1 BTC, 2 USD, 3 RUB, 4 EUR. |
| amountFLOAT | Invoice amount. |
| allowedPaymentCHAR | Optional. Comma-separated list of payment currency IDs (see table below). Empty = all currencies enabled. |
| callback_urlCHAR | Optional. URL-encoded. Receives a POST on successful payment. |
| descriptionCHAR | Optional. Free-text comment. |
| verINT | Optional. Script version: 2 or 3. |
| Response field | Description |
|---|---|
| codeINT | 0 = error, 1 = success. |
| msgCHAR | Success message or error description. |
| walletCHAR | Payment address. |
| sumFLOAT | Amount to pay in BTC. |
| linkCHAR | Invoice page URL. |
{"code":1,"msg":"Invoice created.","wallet":"wallet_address","sum":"1","link":"https://nextwaypay.com/check_invoice/transaction_num/"}
Sandbox responses additionally contain id, pay_in and note; the sandbox link points to the status endpoint.
Invoice statusSANDBOX ONLY
Returns status_id and a callback_preview showing the payload a real callback would contain. In production, status changes are delivered to your callback_url.
Payment status codes
-1 not confirmed0 pending1 complete2 declined3 cancelled4 in progressCallback payload on successful payment:
{"status_id":"invoice status","amount_get":"amount get from transactions"}
Confirm invoice manuallyPRODUCTION
An invoice can be completed manually if the received amount is greater than 0.
{"code":1,"msg":"Confirmed"}
ForwardingPRODUCTION
Generate an address that automatically forwards incoming payments to your wallet.
{"code":1,"msg":"Invoice created.","wallet":"wallet_address","destination":"your wallet"}
Callback (POST) on incoming payment: txid, amount_get (received BTC), commission.
Payment widget (JS embed)PRODUCTION
Embed the NextWay payment form on your site with a single script tag.
<script src="nextwaypay.js" type="text/javascript" id="nextwaypay_script" data-order_id="" data-key="" data-sum="" data-currency="" data-description="" data-callback_url="" data-allowedPayment=""></script>
| Attribute | Description |
|---|---|
| order_id | Order number shown to the customer. |
| key | Your API key (required). |
| currency | Invoice currency (required): 2 USD, 3 RUB, 4 EUR. |
| sum | Invoice amount (required). |
| allowedPayment | Optional list of payment currency IDs. Empty = all. |
| description, callback_url | Optional. |
Callback on status change: {"status_id":…,"msg":"description","order_id":"ID"}. Callback on success: {"status_id":1,"amount_get":"…","order_id":"ID"}.
| ID | Currency | Network |
|---|---|---|
| 1 | Bitcoin (BTC) | Bitcoin |
| 2 | Litecoin (LTC) | Litecoin |
| 3 | Ethereum (ETH) | Ethereum |
| 4 | Tether (USDT) | TRC-20 (TRON) |
| 5 | Tether (USDT) | ERC-20 (Ethereum) |
| 6 | Solana (SOL) | Solana |
| 7 | Monero (XMR) | Monero |
| 8 | USD Coin (USDC) | ERC-20 (Ethereum) |
| 9 | Tether (USDT) | BEP-20 (BNB Chain) |
• Fake addresses (SANDBOX_…), never real. Do not send funds to them.
• Fixed mock rates: 1 BTC = 100,000 USD = 92,000 EUR = 8,000,000 RUB.
• Callbacks are validated but never sent; use callback_preview in the status response.
• Limit: 60 requests per minute per IP. Sandbox data is not stored.