Pay-in Callback

The merchant server is called only after a pay-in completes successfully; the callback status is always completed.

Only final payment results are sent. Any HTTP 2xx response stops delivery immediately. After the first failure, the platform retries in 1 minute; after another failure, it makes a final retry in 5 minutes, for up to 3 attempts total. Callback business times use Beijing time in YYYY/MM/DD HH:mm:ss format.

POSTnotifyUrl from the create pay-in order request body

Request Headers

FieldTypeRequiredDescription
content-typeapplication/jsonYesAlways application/json.
x-callback-timestampstringYesCallback timestamp in milliseconds.
x-callback-noncestringYesCallback nonce.
x-callback-signaturestringYesHMAC-SHA256(apiKey, timestamp + "." + nonce + "." + rawBody)。
x-callback-signature-algorithmstringYesAlways HMAC-SHA256.
x-callback-signature-versionstringYesAlways v1.

Request Parameters

FieldTypeRequiredDescription
merchantUidstringYesMerchant UID.
orderNostringYesPlatform order number.
merchantOrderNostring | nullYesMerchant order number.
bindKeystring | nullYesBinding key for member recharge. Usually empty for shared pay-in orders.
expectedAmountstringYesOrder amount.
paidAmountstringYesActual paid amount.
chainCodestringYesChain code.
tokenSymbolstringYesToken symbol.
txHashstringYesOn-chain transaction hash.
fromAddressstring | nullYesSender address.
statusstringYesFinal successful pay-in status; always completed.

Request Example

{
  "merchantUid": "880001",
  "orderNo": "PI1776193200123ABCD1234",
  "merchantOrderNo": "M202604150001",
  "bindKey": "USER_90001",
  "expectedAmount": "100.000000",
  "paidAmount": "100.000000",
  "chainCode": "TRON",
  "tokenSymbol": "USDT",
  "txHash": "f7f17891f52c35d0c93170f0d12bb347ac16ab34853b4bc8dcf7fd0a8c9aa321",
  "fromAddress": "TS7b7iD8G2PaPqK1TqSmLJ9nrrYH4oKX1S",
  "status": "completed"
}

Response Fields

FieldTypeRequiredDescription
HTTP Status200-299YesAny 2xx response is treated as success.
Response Bodystring | jsonNoThe response body can be customized.

Response Example

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ok": true
}

Code Examples

Node.js Callback Verification Example
import express from 'express';
import { verifyCallbackSignature } from 'uugate-openapi-sdk';

const app = express();
app.use(express.json({
  verify: (req, _res, buffer) => {
    req.rawBody = buffer.toString('utf8');
  },
}));

app.post('/merchant/callback', (req, res) => {
  const valid = verifyCallbackSignature({
    apiKey: process.env.UUGATE_API_KEY,
    timestamp: req.header('x-callback-timestamp'),
    nonce: req.header('x-callback-nonce'),
    signature: req.header('x-callback-signature'),
    rawBody: req.rawBody || '',
  });

  if (!valid) {
    return res.status(401).json({ ok: false });
  }

  return res.status(200).json({ ok: true });
});

Notes

  • Callback verification uses apiKey, not the OpenAPI x-signature request header.
  • After verification, match the merchant, order, asset, network and amount. Persist payment and business results transactionally and idempotently by platform order number before returning 2xx; repeated notifications must not duplicate credits or fulfillment.
  • For member recharge, use bindKey directly as the member identifier so you do not need an extra orderNo-to-member mapping table.