POST
/
merchants
/
webhooks
/
add
cURL
curl -X POST "https://api.onekhusa.com/sandbox/v1/merchants/webhooks/add" \
  --header "Authorization: Bearer your-jwt-token" \
  --header "Content-Type: application/json" \
  --header "X-Organisation-Id: FYH0NTVW0DXK" \
  --header "X-Merchant-Account-Number: 35253486" \
  --header "Accept-Language: en" \
  -d '{
    "merchantAccountNumber": 35253486,
    "eventCode": "payment.success",
    "callbackUrl": "https://merchant.example.com/webhooks/payment",
    "capturedBy": "johndoe@example.com"
    }'
"Merchant webhook has been created successfully"

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <Token>, where <Token> is your access token.

Headers

X-Organisation-Id
string
required

The organization identifier

X-Merchant-Account-Number
string
required

The merchant account number

Accept-Language
string
default:en

Preferred language for the response

Body

application/json
merchantAccountNumber
integer
required

The unique identifier of the merchant account

Required range: 10000000 <= x <= 99999999
Example:

35253486

eventCode
string
required

The event code to trigger the webhook (free-form string). See webhook events documentation for common codes.

Example:

"payment.success"

callbackUrl
string<uri>
required

The URL that will receive webhook notifications (must be reachable)

Example:

"https://merchant.example.com/webhooks/payment"

capturedBy
string<email>
required

Email address of the user creating the webhook

Example:

"johndoe@example.com"

Response

201 - application/json

Created - Webhook successfully created

message
string
Example:

"Merchant webhook has been created successfully"