Skip to main content

Documentation Index

Fetch the complete documentation index at: https://neilyan.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Test your XPayLabs integration using blockchain testnets before processing real mainnet transactions. Testnet networks simulate the real blockchain environment without using real funds.

Supported Testnets

TestnetChain ValueFaucet
TRON ShastaTRON_TESTTRON Shasta Faucet
Ethereum SepoliaETH_SEPOLIASepolia Faucet
BSC TestnetBSC_TESTBSC Testnet Faucet
Polygon AmoyPOLYGON_AMOYPolygon Faucet
Avalanche FujiAVAX_FUJI_TESTAvalanche Faucet
SUI TestnetSUI_TESTSUI Faucet

Configuration

Configure testnet RPC endpoints in your gateway configuration:
xpay:
  blockchain:
    tron:
      mainnet:
        rpc-url: "https://api.trongrid.io"
      testnet:
        rpc-url: "https://api.shasta.trongrid.io"
    ethereum:
      sepolia:
        rpc-url: "https://rpc.sepolia.org"
    bsc:
      testnet:
        rpc-url: "https://data-seed-prebsc-1-s1.binance.org:8545"

Testing the Full Flow

1. Get Test Tokens

Visit the faucet for your chosen testnet and request test USDT or native tokens (TRX, ETH, BNB). You’ll need:
  • Native gas tokens (TRX, ETH, BNB) to pay blockchain fees
  • Test USDT to simulate customer payments

2. Create a Test Collection

curl -X POST http://your-gateway:3010/v1/order/createCollection \
  -H "Content-Type: application/json" \
  -d '{
    "sign": "<computed_sign>",
    "timestamp": 1717000000,
    "nonce": "test_nonce_001",
    "data": {
      "amount": "10.00",
      "symbol": "USDT",
      "chain": "TRON_TEST",
      "orderId": "test_order_001"
    }
  }'

3. Send Test USDT

Send the exact amount of test USDT to the deposit address returned in the response. For TRON Shasta:
  • Use a test wallet (e.g., TronLink on Shasta network)
  • Send test USDT from a faucet or another test wallet

4. Verify the Webhook

Your configured webhook endpoint should receive events:
  1. ORDER_PENDING — Order created
  2. ORDER_PENDING_CONFIRMATION — Transaction detected (within seconds)
  3. ORDER_SUCCESS — Payment confirmed

5. Test a Payout

curl -X POST http://your-gateway:3010/v1/order/createPayout \
  -H "Content-Type: application/json" \
  -d '{
    "sign": "<computed_sign>",
    "timestamp": 1717000000,
    "nonce": "test_nonce_002",
    "data": {
      "amount": "5.00",
      "symbol": "USDT",
      "chain": "TRON_TEST",
      "receiveAddress": "<your_test_wallet_address>",
      "orderId": "test_payout_001"
    }
  }'

Testing Edge Cases

ScenarioHow to Test
Expired orderCreate a collection and wait for the expiry time
Wrong amountSend a different amount than requested (less than or more than)
Wrong tokenSend a different token to the deposit address
Invalid payout addressUse an address from a different chain
Insufficient balanceTry to create a payout larger than your wallet balance
Duplicate nonceSend the same request twice with the same nonce

Going Live

When your integration is working correctly on testnet:
  1. Configure mainnet RPC endpoints in the gateway configuration.
  2. Switch chain values from testnet (e.g., TRON_TEST) to mainnet (e.g., TRON).
  3. Fund your gateway hot wallet with real tokens and gas.
  4. Test with a small real transaction before scaling up.
Testnet USDT and gas tokens have no real value. You can be as liberal as you like with test transactions. Use this to thoroughly verify your webhook handling, order status polling, and error handling logic.