Skip to content

Webhook Notifications to Merchants

Payment Callback

Notification Method

POST request

Request Headers

Field NameTypeRequiredDescription
content-typestringYesapplication/json
x-api-keystringYesProvided by Paydify, same as appId
x-api-timestampstringYesTimestamp in milliseconds
x-api-signaturestringYesSignature, see Signature Algorithm

Request Body

Field NameTypeDescription
appIdstringProvided by Paydify
txnIdstringPaydify payment order ID
mchTxnIdstringMerchant order ID
txnHashstringBlockchain transaction hash
txnAmountstringPayment order amount, if currency is USDT, then 1.23 means 1.23 USDT
paidAmountstringActual payment amount, if currency is USDT, then 1.23 means 1.23 USDT
mchReceivedAmountstringAmount merchant should receive, if currency is USDT, then 1.23 means 1.23 USDT
mchFeestringFee charged by Paydify, if currency is USDT, then 0.23 means 0.23 USDT
currencystringPayment currency
statestringPayment status, enum values see Payment Status
notifyTypestringNotification type, fixed value payment
fromAddressstringPayer address
paidTimeintPayment success timestamp in milliseconds, only has value when payment is successful
failedTimeintPayment failure timestamp in milliseconds, only has value when payment fails/times out

Response

Paydify can only recognize the following two plain text response values

  • success
  • fail

    If other values are returned, up to 10 retries will be initiated

Request Example

shell
curl -X POST '{endpoint}' \
-H 'content-type: application/json' \
-H 'x-api-key: xxx' \
-H 'x-api-timestamp: 121212121' \
-H 'x-api-signature: xxxx' \
-d '{
    "appId": "A14456006",
    "txnId": "P4687529510003120897",
    "mchTxnId": "DCS20250905175704ICVAa11111211",
    "currency": "USDC",
    "state": "paid",
    "txnHash": "0xf12b4e7aec3a19e8ccff31421b05f3830f23bf5a666e174542d9659a043b1df1",
    "fromAddress": "0xa123Afb8d31503eeee49566F9F77E4d4071B7d5f",
    "notifyType": "payment",
    "paidAmount": "0.22",
    "mchReceivedAmount": "0.22",
    "mchFee": "0",
    "txnAmount": "0.22",
    "paidTime": 1757328167000,
    "failedTime": 0
}'
curl -X POST '{endpoint}' \
-H 'content-type: application/json' \
-H 'x-api-key: xxx' \
-H 'x-api-timestamp: 121212121' \
-H 'x-api-signature: xxxx' \
-d '{
    "appId": "A14456006",
    "txnId": "P4687529510003120897",
    "mchTxnId": "DCS20250905175704ICVAa11111211",
    "currency": "USDC",
    "state": "paid",
    "txnHash": "0xf12b4e7aec3a19e8ccff31421b05f3830f23bf5a666e174542d9659a043b1df1",
    "fromAddress": "0xa123Afb8d31503eeee49566F9F77E4d4071B7d5f",
    "notifyType": "payment",
    "paidAmount": "0.22",
    "mchReceivedAmount": "0.22",
    "mchFee": "0",
    "txnAmount": "0.22",
    "paidTime": 1757328167000,
    "failedTime": 0
}'

Refund Callback

Notification Method

POST request

Request Headers

Field NameTypeRequiredDescription
content-typestringYesapplication/json
x-api-keystringYesProvided by Paydify, same as appId
x-api-timestampstringYesTimestamp in milliseconds
x-api-signaturestringYesSignature, see Signature Algorithm

Request Body

Field NameTypeDescription
appIdstringProvided by Paydify
txnIdstringPaydify refund order ID
mchTxnIdstringMerchant refund order ID
txnHashstringBlockchain transaction hash
txnAmountstringRefund amount, if currency is USDT, then 1.23 means 1.23 USDT
currencystringRefund currency
statestringRefund status, enum values: refunded(success), failed(failure)
notifyTypestringNotification type, fixed value refund
refundedTimeintRefund success timestamp in milliseconds, only has value when refund is successful
failedTimeintRefund failure timestamp in milliseconds, only has value when refund fails

Response

Paydify can only recognize the following two plain text response values

  • success
  • fail

    If other values are returned, up to 10 retries will be initiated

Request Example

shell
curl -X POST '{endpoint}' \
-H 'content-type: application/json' \
-H 'x-api-key: xxx' \
-H 'x-api-timestamp: 121212121' \
-H 'x-api-signature: xxxx' \
-d '{
    "appId": "A14456006",
    "txnId": "R4687326023007356672",
    "mchTxnId": "DCS20250905175704ICVAa1111",
    "currency": "USDC",
    "state": "refunded",
    "txnHash": "0xb2e811b1e6d40f11275378ce55c03427b79e94ea9f9edadb7a6c2e286ce474ad",
    "notifyType": "refund",
    "txnAmount": "0.11",
    "failedTime": 0,
    "refundedTime": 1757315967000
}'
curl -X POST '{endpoint}' \
-H 'content-type: application/json' \
-H 'x-api-key: xxx' \
-H 'x-api-timestamp: 121212121' \
-H 'x-api-signature: xxxx' \
-d '{
    "appId": "A14456006",
    "txnId": "R4687326023007356672",
    "mchTxnId": "DCS20250905175704ICVAa1111",
    "currency": "USDC",
    "state": "refunded",
    "txnHash": "0xb2e811b1e6d40f11275378ce55c03427b79e94ea9f9edadb7a6c2e286ce474ad",
    "notifyType": "refund",
    "txnAmount": "0.11",
    "failedTime": 0,
    "refundedTime": 1757315967000
}'

Callback Retry Mechanism

If the callback does not receive the expected response value success, it will retry up to 10 times according to the following strategy.

Request NumberTime DelayDescription
001st normal callback, executed immediately, no delay
115 seconds1st retry
245 seconds2nd retry
390 seconds3rd retry
43 minutes4th retry
510 minutes5th retry
630 minutes6th retry
760 minutes7th retry
83 hours8th retry
96 hours9th retry
1012 hours10th retry