Skip to content

Webhook Notifications — API Checkout

When a checkout order status changes, PSC sends a POST request to your callbackUrl.

Webhook Request Headers

HeaderTypeDescriptionExample
X-TimestampLongNotification timestamp (milliseconds)1640000000000
X-SignatureStringRequest signature (Base64-encoded). Algorithm: Base64(HMAC-SHA256(timestamp + "\n" + "POST" + "\n" + path + "\n" + Base64(SHA256(requestBody)), apiSecret))base64-hmac-sha256

Signature Verification

  1. Extract X-Timestamp and X-Signature from the request headers
  2. Read the complete raw request body as a string (do not re-serialize)
  3. Compute:
    • bodySha256Base64 = Base64(SHA256(requestBody))
    • signContent = timestamp + "\n" + "POST" + "\n" + path + "\n" + bodySha256Base64
    • expectedSignature = Base64(HMAC-SHA256(signContent, apiSecret))
  4. Compare expectedSignature with X-Signature
  5. Verify the timestamp is within 5 minutes to prevent replay attacks

Webhook Body Fields

FieldTypeDescriptionExample
acquiringOrderIdStringPlatform order IDORD_20240101_1234567890ABCDEF
paymentOrderIdStringPayment order IDPAY_20240101_1234567890ABCDEF
merchantIdStringMerchant IDMCH_20240101_ABC123
merchantOrderIdStringMerchant order IDORDER_2024010112345678
statusStringOrder status: PROCESSING / SUCCEEDED / FAILED / CLOSEDSUCCEEDED
finalStatusBooleanWhether this is a terminal statustrue
orderAmountObjectOrder amount{"value": "100.50", "currency": "USDC"}
cryptoPaymentAmountObjectRequired payment amount{"value": "101.00", "currency": "USDC"}
cryptoPaidAmountObjectActual amount paid{"value": "101.00", "currency": "USDC"}
depositAddressStringDeposit addressTYdRLmP9kN4oY3hZ8xT6wQ2vS5uW7aV1b
networkStringBlockchain network codetron
networkDisplayNameStringNetwork display nameTRON Network
cryptoPaymentDetailObjectOn-chain transaction details (same structure as Query Order)-
paymentMethodTypeStringPayment method typeON_CHAIN_TRANSFER
paymentMethodValueStringPayment method value (null for on-chain)null
callbackUrlStringMerchant's callback URLhttps://api.merchant.com/webhooks/payment

Response Requirements

Your endpoint must respond within 5 seconds with HTTP 200 and:

json
{
  "code": "00000"
}

Any non-200 response or timeout will trigger a retry.

Retry Schedule

AttemptDelay after previous failure
11 minute
25 minutes
315 minutes
430 minutes
51 hour
62 hours
74 hours
88 hours

After all retries are exhausted, query the order status manually using the Query Checkout Order API.

Webhook Example

json
{
  "acquiringOrderId": "ORD_20240101_1234567890ABCDEF",
  "paymentOrderId": "PAY_20240101_1234567890ABCDEF",
  "merchantId": "MCH_20240101_ABC123",
  "merchantOrderId": "ORDER_2024010112345678",
  "status": "SUCCEEDED",
  "finalStatus": true,
  "orderAmount": {
    "value": "100.50",
    "currency": "USDC"
  },
  "cryptoPaymentAmount": {
    "value": "101.00",
    "currency": "USDC"
  },
  "cryptoPaidAmount": {
    "value": "101.00",
    "currency": "USDC"
  },
  "depositAddress": "TYdRLmP9kN4oY3hZ8xT6wQ2vS5uW7aV1b",
  "network": "tron",
  "networkDisplayName": "TRON Network",
  "cryptoPaymentDetail": {
    "network": "tron",
    "cryptoCurrency": "USDC",
    "transactionHash": "0x1234567890abcdef1234567890abcdef",
    "fromAddress": "TXdQKjYz8f9vN3kYh2xL6mP8sR5wT7uV2a",
    "toAddress": "TYdRLmP9kN4oY3hZ8xT6wQ2vS5uW7aV1b",
    "amount": "101.00",
    "confirmations": 21,
    "requiredConfirmations": 21
  },
  "paymentMethodType": "ON_CHAIN_TRANSFER",
  "paymentMethodValue": null,
  "callbackUrl": "https://api.merchant.com/webhooks/payment"
}

Released under the MIT License.