Callback API

The callback URL is provided in request body by the request initiator. For more details, see the callback_url parameter in the Create Payout API.

This API allows cregis to initiate callback request to the original API caller.

The callback comes in four scenarios, which are determined by the status in the callback content. These scenarios are mutually exclusive and only trigger once:

statusDescription
2Signature Rejected
4Approval Rejected
6Transaction Successful
7Transaction Failed

After initiating the callback, when the returned content is success, the callback is successful. Otherwise, the callback fails. If the callback fails, you can push it again, you can log into the cregis client, select the corresponding project in the menu, and re-push it from the callback record.

Note: Different types of callbacks will have different content. It is strongly recommended to use different APIs for different types of callbacks to ensure clear and specific business logic.

Request Method

HTTP POST application/json

Request Parameters

NameTypeDescription
pidinteger(int64)Project ID
cidinteger(int64)Cregis ID
chain_idstringChain ID
token_idstringToken ID
currencystringCurrency Identifier
addressstringAddress
amountstringAmount
third_party_idstringCaller’s Customized ID
remarkstringRemarks
statusinteger(int32)Status
txidstringTransaction Hash
block_heightstringBlock Height
block_timeinteger(int64)Block Time
noncestring6-digit random string
timestampinteger(int64)Timestamp
signstringSignature
Example
{
  "pid": 1382528827416576,
  "cid": 1391751691788288,
  "address": "TXsmKpEuW7qWnXzJLGP9eDLvWPR2GRn1FS",
  "chain_id": "195",
  "token_id": "195",
  "currency": "TRX",
  "amount": "1.1",
  "third_party_id": "1e0fb3a0a9454ad8928d26b592e8b3c7",
  "remark": "payout",
  "status": 0,
  "txid": "6dd05b0972075542219a3fcc116c58feaf9480f1f698cc46c4367ded83955cfd",
  "block_height": "34527604",
  "block_time": 1686814482000,
  "nonce": "ubqso3",
  "timestamp": 1687850657960,
  "sign": "f5be13fdd8c6f63951ca4427359457cb"
}