# Create or update webhook endpoints Create a new webhook endpoint or update an existing one. If an endpoint with the same URL already exists, it will be updated with the new event subscriptions. Endpoint: POST /webhooks Version: V5 Security: basicAuth ## Request fields (application/json): - `endpoint_url` (string, required) The HTTPS URL where webhook events will be sent. Must use HTTPS protocol. Example: "https://example.com/webhooks/resolve" - `events` (object, required) Object containing boolean flags for each available webhook event topic. Set to true to subscribe to that event, or false to unsubscribe. - `events.invoice.created` (boolean) Subscribe to invoice creation events Example: true - `events.invoice.balance_updated` (boolean) Subscribe to invoice balance update events - `events.customer.created` (boolean) Subscribe to customer creation events Example: true - `events.customer.status_updated` (boolean) Subscribe to customer status update events - `events.customer.line_amount_updated` (boolean) Subscribe to customer credit line amount update events - `events.customer.advance_rate_updated` (boolean) Subscribe to customer advance rate update events - `events.customer.credit_decision_created` (boolean) Subscribe to customer credit decision creation events Example: true - `events.payment.created` (boolean) Subscribe to payment creation events Example: true - `events.payment.status_changed` (boolean) Subscribe to payment status change events Example: true - `events.payout.created` (boolean) Subscribe to payout creation events - `events.payout.status_changed` (boolean) Subscribe to payout status change events ## Response 200 fields (application/json): - `id` (string) Unique identifier for the webhook endpoint Example: "whe_abc123def456" - `merchant_id` (string) The merchant ID associated with this webhook endpoint Example: "mer_xyz789" - `endpoint_url` (string) The HTTPS URL where webhook events will be sent Example: "https://example.com/webhooks/resolve" - `topic` (object) The event topic this endpoint is subscribed to - `topic.name` (string) The event topic name Example: "invoice.created" - `topic.description` (string) Human-readable description of the event topic Example: "Triggered when a new invoice record is created" - `created_at` (string) When this webhook endpoint subscription was created Example: "2021-05-20T09:23:53+00:00" - `updated_at` (string) When this webhook endpoint subscription was last updated Example: "2021-05-20T09:23:53+00:00" ## Response 401 fields (application/json): - `error` (object) - `error.message` (string) A short string, describing error details Example: "Invalid merchant credentials" - `error.type` (string) A short string, describing error type Enum: "authentication_error" ## Response 429 fields (application/json): - `error` (object) - `error.message` (string) A short string, describing error details Example: "Too many requests" - `error.type` (string) A short string, describing error type Enum: "rate_limit_error"