Skip to content

WebHook

Request URL

Provided by the merchant when calling the platform gateway API. Refer to the notifyUrl parameter in the payment/payout creation API request.

The WebHook address for disputes and refunds is configured in the merchant dashboard.

Request Parameters

HTTP Header

FieldData TypeLength LimitRequiredDescription
AcceptStringN/AThis field value only supports application/json.
Content-TypeStringN/AYESThis field value only supports application/json.
AuthorizationStringYESAuthorization: {type} {credentials}, refer to the Signature specifications section for details.
X-Notify-EventString50YESRefer to the Event Definition section for details.

HTTP Body

FieldData TypeRequiredDescription
eventStringYESRefer to the Event Definition section for details.
codeStringYESThe value is OK
errorMessageStringNOThe value is null
dataJSON ObjectYESThe data field represents the business entity object corresponding to the notification event, and the specific fields are the same as those in the data field of the response from each business query API.

Business Entity Object Field Description

Response Data

HTTP Status

When the merchant successfully receives the notification, respond with HTTP 200.

HTTP Header

FieldData TypeRequiredDescription
Content-TypeStringYESThis field value only supports application/json.
AuthorizationStringYESAuthorization: {type} {credentials}, refer to the Signature specifications section for details.

HTTP Body

FieldData TypeRequiredDescription
codeStringYESWhen code value is OK indicates the merchant has successfully received and processed the request. Any other value means the request was received successfully but processing failed.
errorMessageStringNO

Merchant Response Error Code

CodeExplanationSolution
OKProcessing successful
FAILProcessing failedThe platform will notify again.

Examples

Request By Platform

Bash
curl https://{{merchant_notify_url}} \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H 'Authorization: V2_SHA256 appId=483f6c9c743b4a9bbd34bee0c9c81eb7,sign=7363f5c7746b79863326940e8b25ffb0f1f7fec22382f036a6b06f8b9e290229,timestamp=1715410373693,nonce=29E890BE88FFAE17DCB2985502F50C92' \
  -d '{"key1": "value1", "key2": "value2"}'

Merchant Response

  • Response when processing is successful
HTTP
HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 06 Mar 2024 12:00:00 GMT

{
  "code": "OK"
}
  • Response when processing fails
HTTP
HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 06 Mar 2024 12:00:00 GMT

{
  "code": "FAIL",
  "errorMessage": "Populate with a relevant error message."
}

Gateway Processing Merchant Response Strategy

The gateway will retry the notification according to the policy if any of the following conditions are met, until the system-configured threshold is exceeded:

  • The notification interface responds with a non-200 status code.
  • The notification interface response code is not OK.
  • The notification interface times out without a response.

Event Definition

Event naming: {entity}.{domain_event}

EventDescriptionEnabled by default
PAYMENT.PAIDPayment successfulYES
PAYOUT.PAIDPayout successfulYES
PAYOUT.FAILUREPayout failedYES
PAYOUT.REVERSEDPayout reversedYES
PAYOUT.CANCELLEDPayout cancelledYES
SUBSCRIPTION.ACTIVATEDSubscription activated and first payment completedYES
SUBSCRIPTION.CHARGEDSubscription renewal succeededYES
SUBSCRIPTION.CANCELLEDSubscription cancelled by userYES
SUBSCRIPTION.CLOSEDSubscription closed (user-initiated refund or system action)YES
REFUND.SUCCEEDRefund succeededYES
REFUND.FAILEDRefund failedYES
REFUND.CANCELLEDRefund cancelledYES
REFUND.REVERSEDRefund reversed/adjustedYES
DISPUTE.OPENDispute createdYES
DISPUTE.UNDER_REVIEWUnder reviewYES
DISPUTE.WONDispute wonYES
DISPUTE.LOSTDispute lostYES
DISPUTE.CLOSEDDispute closedYES

Merchant Processing Recommendations

TIP

  • Implement idempotent processing for push messages to avoid duplicate handling.
  • After successfully receiving the push message, process the business logic asynchronously to prevent the gateway from retrying due to timeouts caused by long synchronous processing times.
  • When processing business logic after successfully receiving the push message, consider concurrency scenarios.