Merchants

Documentation API

Crypto payment integration: deposit wallets, callbacks (IPN), on-chain configuration (split). All content is self-contained in this file (HTML + CSS + JS).

General information

ItemDetail
FormatJSON — Content-Type: application/json for request bodies
EncodageUTF-8
CORSAccess-Control-Allow-Origin: * with appropriate headers
PreflightOPTIONS200 empty body

Base URL

Replace {BASE_URL} according to environment.

EnvironmentURL
Productionhttps://nxtgatew.com
Local (ex. MAMP)http://localhost:8888/nxtgatew

API paths: POST {BASE_URL}/api/v1/wallets/create · GET {BASE_URL}/api/v1/wallets/check-config

Authentication

Each request must include:

HeaderRequiredDescription
X-API-KeyYesAPI key (merchant, psp, or admin)
X-API-SecretYesMatching API secret

Credentials are created at signup (merchant / PSP; admin possible for operations). Do not publish the secret. Accounts must be active with role merchant, psp, or admin — otherwise 401.

HTTP codes & errors

Typical error schema:

Example
{
  "success": false,
  "error": "Human-readable message explaining the issue"
}

Additional fields may include: hint, json_error_code, raw_input_preview, debug, etc.

CodeMeaning
200Success (GET, OPTIONS)
201Resource created (POST create wallet)
400Invalid request (JSON, fields, network, URL, address)
401Invalid API credentials or inactive account
403Inactive merchant account (business rule)
404Not found (missing wallet or not yours)
405HTTP method not allowed
409Conflict (e.g. address already in database)
429Too many requests (other endpoints, e.g. cron)
500Server error

POST Create deposit wallet

Platform-generated receive address, IPN callback, optional affiliates. On Ethereum / Polygon, split_config in the 201 response is only for admin API keys; merchants use GET check-config.

POST {BASE_URL}/api/v1/wallets/create
KeyValue
Content-Typeapplication/json
X-API-KeyYour API key
X-API-SecretYour API secret

cURL

Shell
curl -X POST "https://nxtgatew.com/api/v1/wallets/create" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -H "X-API-Secret: YOUR_SECRET" \
  -d '{
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "callback": "https://your-site.com/webhooks/nxtgatew",
    "network": "polygon",
    "affiliate_address": "0x4B31D368067127D10C59e655b8B22937E35D1196",
    "affiliate_percent": 1,
    "subaff_address": "0x2222222222222222222222222222222222222222",
    "subaff_percent": 0.5
  }'

Response — 201 Created

Body 201 Created
{
  "success": true,
  "data": {
    "address": "0x…",
    "ipn_token": "64_hex_chars_or_your_token",
    "network": "polygon",
    "callback_url": "https://your-site.com/webhooks/nxtgatew",
    "created_at": "2026-04-17 12:00:00",
    "affiliate_wallet_address": "0x4B31D368067127D10C59e655b8B22937E35D1196",
    "subaff_wallet_address": "0x2222222222222222222222222222222222222222",
    "platform_percent": 1,
    "affiliate_percent": 1,
    "subaff_percent": 0.5
  },
  "message": "Wallet created successfully"
}

Merchant / PSP response on EVM: no split_config. With admin API key, data.split_config may include mode, created, contract_address, error, check_url.

data fieldDescription
addressGenerated address to give the payer
ipn_tokenKeep to link / secure callbacks
affiliate_wallet_address / subaff_wallet_addressOmitted from JSON if not provided at creation
platform_percentPlatform share — % of gross only (no *_bps in JSON response)
affiliate_percent / subaff_percent% of gross — omitted if no affiliate / sub-affiliate address at creation
split_configethereum / polygon and API role admin only; otherwise GET check-config

GET Verify split configuration

State of a deposit wallet you own: database + on-chain read (EVM if the server runs the verification script).

GET {BASE_URL}/api/v1/wallets/check-config?wallet_address=…&network=polygon
KeyValue
X-API-KeyYour API key
X-API-SecretYour API secret

Content-Type optional on bodyless GET.

cURL

Shell
curl -G "https://nxtgatew.com/api/v1/wallets/check-config" \
  -H "X-API-Key: YOUR_KEY" \
  -H "X-API-Secret: YOUR_SECRET" \
  --data-urlencode "wallet_address=0xYourGeneratedAddress" \
  --data-urlencode "network=polygon"

Response — 200 OK

Body 200 OK
{
  "success": true,
  "data": {
    "wallet_address": "0x…",
    "network": "polygon",
    "database": {
      "merchant_wallet": "0x…",
      "affiliate_wallet": "0x4B31D368067127D10C59e655b8B22937E35D1196",
      "subaff_wallet": "0x2222222222222222222222222222222222222222",
      "platform_percent": 1,
      "affiliate_percent": 1,
      "subaff_percent": 0.5,
      "contract_address": "0x…",
      "status": "active",
      "created_at": "2026-04-17 12:00:00"
    },
    "on_chain": {
      "config_exists": true,
      "merchant_wallet": "0x…",
      "affiliate_wallet": "0x4B31D368067127D10C59e655b8B22937E35D1196",
      "subaff_wallet": "0x2222222222222222222222222222222222222222",
      "is_active": true
    },
    "match": true
  }
}
ChampDescription
database.*Data stored in NxtGateW; platform_percent always; affiliate_percent / subaff_percent only if address is set in DB — no *_bps
on_chain.config_existsConfig read from chain
matchtrue if on-chain config + merchant address matches database

Basis points (bps)

10 000 bps = 100 %

bps%
1001 %
500.5%
10.01%

Platform fees and caps (platform + affiliates ≤ 100%) are enforced on-chain.

Best practices

Summary

MethodPathPurpose
POST/api/v1/wallets/createCreate deposit address + callback / split
GET/api/v1/wallets/check-configVerify database + on-chain

Source reference: api/v1/wallets/create.php, api/v1/wallets/check-config.php