التوثيق

Webhook Endpoint

A webhook endpoint is a URL on your server where XPay sends event notifications, such as a payment succeeding or a refund completing. Each endpoint has a signing secret you use to verify that a delivery really came from XPay, and a list of enabled events that controls which notifications it receives. If deliveries to an endpoint keep failing, the endpoint is disabled automatically and its status changes to `disabled`.

A webhook endpoint is a URL on your server where XPay sends event notifications, such as a payment succeeding or a refund completing. Each endpoint has a signing secret you use to verify that a delivery really came from XPay, and a list of enabled events that controls which notifications it receives. If deliveries to an endpoint keep failing, the endpoint is disabled automatically and its status changes to disabled.

{
  "id": "we_abc123def456",
  "object": "webhook_endpoint",
  "url": "https://example.com/webhooks",
  "description": "Production webhook",
  "status": "enabled",
  "enabledEvents": [
    "charge.succeeded",
    "payment_intent.created"
  ],
  "livemode": false,
  "secret": "whsec_abc123def456ghi789",
  "metadata": {
    "environment": "production"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}