Skip to main content

Crypto Integration Overview

TOPPAY TeamAbout 2 min

Overview

The Crypto (digital currency) Open API shares the same signature rules and unified response envelope as the fiat Open API, but the path prefix and some fields differ (recommended to share the unified host with fiat):

  • The path prefix is always /crypto (fiat uses /{countryCode}, e.g. /ph, /id).
  • Requests must carry the anti-replay header Nonce (not required by fiat endpoints).
  • Amounts are on-chain quantities rather than fiat amounts, with at most 6 decimal places. Balances and callback amounts are returned with 8 decimal places.
  • A transaction is identified by currency + netWork (coin + chain network), for example USDT + TRC20.

Field name case sensitivity

The API field is netWork (capital W), not network. Use the exact spelling in requests, responses, and signature concatenation.

Environments and domains

Crypto is not separated by country; the path prefix is always /crypto.

TypeDomainNotes
Unified domain (recommended)openapi.toppayment.comSame host as fiat; path remains /crypto/...
Legacy crypto domain (compatible)global-digit-openapi.toppayment.comRemains available

Path templates ({host} per the table above):

Sandbox: https://{host}/crypto/sandbox/...
Production: https://{host}/crypto/...

Examples (recommended):

Sandbox: https://openapi.toppayment.com/crypto/sandbox/...
Production: https://openapi.toppayment.com/crypto/...

Endpoint list

ScenarioSandbox URLProduction URLReference
Pay-in — cashier pre-orderhttps://openapi.toppayment.com/crypto/sandbox/pay/prePayhttps://openapi.toppayment.com/crypto/pay/prePayCrypto Pay-In
Pay-in — direct API orderhttps://openapi.toppayment.com/crypto/sandbox/pay/directlyPayhttps://openapi.toppayment.com/crypto/pay/orderDirectlyCrypto Pay-In
Pay-in — order inquiryhttps://openapi.toppayment.com/crypto/sandbox/pay/queryhttps://openapi.toppayment.com/crypto/pay/queryOrder Inquiry
Pay-out — create orderhttps://openapi.toppayment.com/crypto/sandbox/disbursement/cashhttps://openapi.toppayment.com/crypto/disbursement/cashCrypto Pay-Out
Pay-out — order inquiryhttps://openapi.toppayment.com/crypto/sandbox/disbursement/queryhttps://openapi.toppayment.com/crypto/disbursement/queryOrder Inquiry
Balance inquiryhttps://openapi.toppayment.com/crypto/sandbox/balance/v1https://openapi.toppayment.com/crypto/balance/v1Balance Inquiry
Callback notificationProvided by merchant via downNotifyUrlProvided by merchant via downNotifyUrlCallback

Sandbox path difference

The production direct-order path is /crypto/pay/orderDirectly, while the sandbox path is /crypto/sandbox/pay/directlyPay (/crypto/sandbox/pay/transOrder is also accepted). The request and response bodies are identical.

Common request headers

All crypto endpoints are POST with a JSON body.

FieldRequiredTypeDescription
Content-TypeMStringFixed value: application/json
NonceMString(16-64)Anti-replay random string
Charset A-Z a-z 0-9 _ -, length 16–64
Must be unique per mchNo within a 10-minute window; reuse returns 0001
Excluded from sign calculation
Not validated in sandbox, but sending it is recommended

Common request body fields

The fields below are shared by all endpoints and are not repeated in each reference page.

FieldRequiredTypeDescription
mchNoMString(32)Merchant number
In sandbox, use the sandbox merchant number prefixed with SD
timestampMString(13)Request timestamp (13-digit milliseconds)
Must be within ±5 minutes of server time, otherwise 0001 is returned
signMStringSignature, see Signature
tenantCodeOString(32)Sub-tenant code
Defaults to the merchant's default tenant
countryCodeOString(16)Country code, not needed for crypto

Unified response envelope

FieldRequiredTypeDescription
successMBooleanWhether the request succeeded
codeMStringResponse code
9999: success; otherwise see Exception Codes
msgOStringResponse message. null on success; on failure formatted as [0002]signature verification failed!
timeStampMNumberServer response time (milliseconds)
dataOObjectBusiness payload, see each endpoint

Supported coins and networks

Available currency / netWork combinations are enabled per merchant on the platform side. Refer to your merchant portal or account manager for the authoritative list. Common values:

currencyCommon netWork
USDTTRC20, ERC20
USDCTRC20, ERC20
TRXTRC20
ETHERC20
BTCBTC

Cashier method notation

In the cashier page, a payment method is expressed as {currency}-{netWork}, e.g. USDT-TRC20. The underscore form USDT_TRC20 is also accepted.

Sandbox notes

  • The merchant number must be prefixed with SD (production 123456 → sandbox SD123456), and the sandbox merchant public key must be uploaded in the merchant portal.
  • Sandbox never calls a real blockchain channel. Pay-in deposit addresses are mocked as SANDBOX_{platOrderNum}.
  • Sandbox fees are always calculated at 1%.
  • Sending money = 20000000 on a sandbox pay-out reliably triggers insufficient balance (1002), useful for testing failure branches.
  • Sandbox balance inquiry returns a fixed balance of 2000000 and uses a different response shape from production, see Balance Inquiry.

References