API_DOCUMENTATION

Accept crypto with a few lines of code.

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.

Public sandbox

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.

TEST KEYnwp_test_public SANDBOX

Base URL: https://nextwaypay.com/api/sandbox/ — same parameters as production, limit 60 requests per minute per IP.

TRY_IT_LIVE

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.

// REQUEST
Press “Create invoice”.
// RESPONSE
—

Quick start

// CURL
curl "https://nextwaypay.com/api/sandbox/invoice_create/?code=nwp_test_public&currency=2&amount=25.00&description=Order+1001"
// PHP
$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']; }
// JAVASCRIPT
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/.

API reference

Create invoicePRODUCTIONSANDBOX

GET https://nextwaypay.com/api/invoice_create/
ParameterDescription
codeCHARYour API key (sandbox: nwp_test_public).
currencyINTCurrency of the invoice amount: 1 BTC, 2 USD, 3 RUB, 4 EUR.
amountFLOATInvoice amount.
allowedPaymentCHAROptional. Comma-separated list of payment currency IDs (see table below). Empty = all currencies enabled.
callback_urlCHAROptional. URL-encoded. Receives a POST on successful payment.
descriptionCHAROptional. Free-text comment.
verINTOptional. Script version: 2 or 3.
Response fieldDescription
codeINT0 = error, 1 = success.
msgCHARSuccess message or error description.
walletCHARPayment address.
sumFLOATAmount to pay in BTC.
linkCHARInvoice page URL.
// EXAMPLE_RESPONSE
{"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

GET https://nextwaypay.com/api/sandbox/invoice_status/?code=nwp_test_public&id=INVOICE_ID

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 progress

Callback payload on successful payment:

// CALLBACK_PAYLOAD
{"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.

GET https://nextwaypay.com/api/invoice_confirm/?code=YOUR_KEY&id=INVOICE_ID
{"code":1,"msg":"Confirmed"}

ForwardingPRODUCTION

Generate an address that automatically forwards incoming payments to your wallet.

GET https://nextwaypay.com/api/forwarding/?code=YOUR_KEY&destination=YOUR_WALLET&callback_url=…
{"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.

// EMBED_SCRIPT
<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>
AttributeDescription
order_idOrder number shown to the customer.
keyYour API key (required).
currencyInvoice currency (required): 2 USD, 3 RUB, 4 EUR.
sumInvoice amount (required).
allowedPaymentOptional list of payment currency IDs. Empty = all.
description, callback_urlOptional.

Callback on status change: {"status_id":…,"msg":"description","order_id":"ID"}. Callback on success: {"status_id":1,"amount_get":"…","order_id":"ID"}.

Payment currency IDs

IDCurrencyNetwork
1Bitcoin (BTC)Bitcoin
2Litecoin (LTC)Litecoin
3Ethereum (ETH)Ethereum
4Tether (USDT)TRC-20 (TRON)
5Tether (USDT)ERC-20 (Ethereum)
6Solana (SOL)Solana
7Monero (XMR)Monero
8USD Coin (USDC)ERC-20 (Ethereum)
9Tether (USDT)BEP-20 (BNB Chain)

Sandbox rules

• 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.

Create free account →
© 2020 - 2026 NEXTWAY_PAYMENT // Support · Privacy