Skip to content

Webhook Notification

Payment Notification

Request Method

HTTP POST

Request Header

FieldData TypeMandatoryDescription
content-typestringYesHard code with application/json
x-api-keystringYesProvided by Paydify, equals to appId
x-api-timestampstringYesCurrent timestamp with millisecond
x-api-signaturestringYesSee Signature Mechanism

Request Body

FieldData TypeDescription
appIdstringProvided by Paydify
txnIdstringUnique order ID, generated by Paydify
mchTxnIdstringMerchant unique order ID
txnHashstringTransaction hash on-chain
txnAmountstringPayment order amount, e.g. 1.23
paidAmountstringPaid amount
mchReceivedAmountstringMerchant received amount
mchFeestringAmount of Paydify service fee
currencystringPayment currency
statestringPayment status, see Payment Status
mchExtInfostringAdditional extended information
errorMsgstringReason of failure
fromAddressstringPayer's address
paidTimeintDefault value is 0, a millisecond value is present only when the payment is successful
failedTimeintDefault value is 0, a millisecond value is present only when the payment is failed
createdTimeintPayment order created Time in millisecond

Response Body

The webhook service expects only two response values in TEXT, not JSON or others.

  • success
  • fail

If fail or other string is received, the webhook service will retry up to 10 times.

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": "A4156085xx",
    "createdTime": 1744698314883,
    "currency": "USDT",
    "errorMsg": "Timeout",
    "failedTime": 1744700130191,
    "fromAddress": "0xab5fB1426f20bAxx",
    "mchExtInfo": "{"JSON":"string"}",
    "mchTxnId": "17446983142083792",
    "paidAmount": "0.00",
    "paidTime": 0,
    "state": "failed",
    "txnAmount": "121.31",
    "mchReceivedAmount": "121.30",
    "mchFee": "0.01",
    "payMethod1": "BGW",
    "payMethod2": "bnb",
    "txnHash": "",
    "txnId": "P20250415142514"
}'
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": "A4156085xx",
    "createdTime": 1744698314883,
    "currency": "USDT",
    "errorMsg": "Timeout",
    "failedTime": 1744700130191,
    "fromAddress": "0xab5fB1426f20bAxx",
    "mchExtInfo": "{"JSON":"string"}",
    "mchTxnId": "17446983142083792",
    "paidAmount": "0.00",
    "paidTime": 0,
    "state": "failed",
    "txnAmount": "121.31",
    "mchReceivedAmount": "121.30",
    "mchFee": "0.01",
    "payMethod1": "BGW",
    "payMethod2": "bnb",
    "txnHash": "",
    "txnId": "P20250415142514"
}'

Retry Mechanism

If fail or other string is received, the webhook service will retry up to 10 times with the following mechanism.

Request Sequence NO.Time IntervalDescription
001st notification, executes immediately with no delay
115 seconds after the 1st request1st retry
245 seconds after the 1st request2nd retry
390 seconds after the 1st request3rd retry
43 minutes after the 1st request4th retry
510 minutes after the 1st request5th retry
630 minutes after the 1st request6th retry
71 hour after the 1st request7th retry
83 hours after the 1st request8th retry
96 hours after the 1st request9th retry
1012 hours after the 1st request10th retry