Creating Webhook Listener
This interface is used to create a callback URL to receive notifications for specific events. Supported event types include order events and merchant trade events.
Interface Information
Request Header:
Content-Type: application/json
Request Header:
X-BH-TOKEN: ******
Request Method:
POST
Request Path:
/openapi/v2/business/webhook
Authorization Required: Yes
Request Parameters
eventType
string
Yes
Event type, supported values: ORDER_WEBHOOK
(order event), MERCHANT_TRADE_WEBHOOK
(merchant trade event).
url
string
Yes
Callback URL for receiving event notifications.
Request Example
Response Parameters
code
number
Response status code, 200
indicates success.
msg
string
Response message, typically SUCCESS
.
data
object
Returned data object, containing the following fields:
data.webhookId
string
Unique identifier for the callback URL.
data.eventType
string
Event type, confirming the event type specified in the request.
data.url
string
Merchant transfer callback URL.
data.status
number
Callback configuration status, supported values: 10
(active), 20
(disabled), 30
(deleted).
data.publicKey
string
(Optional) Public key of RSA-SHA256, used to verify push messages.
Response Example
Notes
Ensure that the provided callback URL is valid and capable of handling POST requests.
The event type must be one of the supported types.
The public key is an optional field, used only when verification of push messages is required.