Skip to main content
POST
/
webhook
/
endpoints
Create Webhook Endpoint
curl --request POST \
  --url https://uat-api.clinkbill.com/api/webhook/endpoints \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-Timestamp: <api-key>' \
  --data '
{
  "url": "https://example.com/api/clink/webhook",
  "events": [
    "session.complete",
    "order.succeeded",
    "invoice.paid"
  ],
  "description": "Created through the API",
  "enabled": true
}
'
{
  "code": 200,
  "msg": "Success",
  "data": {
    "id": "whk_xxxxx",
    "url": "https://example.com/api/clink/webhook",
    "events": [
      "session.complete",
      "order.succeeded"
    ],
    "enabled": true,
    "signingSecret": "whsec_xxxxx",
    "maskedSigningSecret": "whsec_...abcd",
    "description": "Created through the API",
    "createdAt": 1782112780956,
    "updatedAt": 1782113780956
  }
}

Authorizations

X-API-KEY
string
header
required

Your secret API key obtained from the Clink dashboard (Developers section)

X-Timestamp
string
header
required

Current timestamp in milliseconds since Unix epoch (required for request signing)

Body

application/json
url
string<uri>
required

HTTPS endpoint URL. Localhost, loopback IPs, private IPs, link-local addresses, and multicast addresses are rejected.

Maximum string length: 512
Example:

"https://example.com/api/clink/webhook"

events
enum<string>[]
required

Event names to subscribe to. Numeric event codes are not accepted.

Minimum array length: 1

Supported webhook event name. Public API requests use event names, not numeric event codes.

Available options:
order.created,
order.succeeded,
order.failed,
refund.created,
refund.succeeded,
refund.failed,
subscription.created,
subscription.trialing,
subscription.activated,
subscription.incomplete_expired,
subscription.past_due,
subscription.cancelled,
invoice.open,
invoice.paid,
invoice.void,
order.next_action,
subscription.updated.plan_changed,
subscription.updated.plan_change_canceled,
subscription.updated.renewed,
subscription.updated.cancel_at_period_end_set,
subscription.updated.cancel_at_period_end_revoked,
session.complete,
session.expired,
dispute.created,
dispute.updated,
dispute.won,
dispute.lost,
dispute.closed,
customer.verify,
payment_method.added,
payment_method.default_change,
risk_rule.updated,
agent_order.succeeded,
agent_order.failed,
agent_refund.succeeded,
agent_refund.failed,
agent_refund.approved,
agent_refund.rejected,
payment_method.update,
purchase_instruction.created,
purchase_instruction.activated,
purchase_instruction.updated,
purchase_instruction.cancelled,
vic_device.binding_succeeded
Example:
[
  "session.complete",
  "order.succeeded",
  "invoice.paid"
]
description
string

Optional endpoint description.

Maximum string length: 512
Example:

"Created through the API"

enabled
boolean
default:true

Whether the endpoint is enabled.

Response

Webhook endpoint created successfully

Body of the response message

code
integer<int32>

Response status code, 200 when success

Example:

200

msg
string

Brief description of what happened, 'success' when happy case

Example:

"Success"

data
object