Webhooks

Create a webhook

Creates a new webhook for your merchant. The webhook's url must be https. There is a cap on how many webhooks you can hold in each mode; once you reach it, creating another webhook in that mode is rejected until you delete one.

post/v2/webhooks

Request

  • Base URL: https://test-api.kashier.io
  • URL: https://test-api.kashier.io/v2/webhooks
  • Auth: API key in header Authorization

Request body

namestring required

Your label for the webhook.

urlstring uri required

The endpoint Kashier delivers to. Must be a public https URL — non-https schemes, localhost, loopback, link-local, and private (RFC-1918) addresses are rejected.

headersobject

Optional. Custom headers to send with every delivery to this webhook, as a flat string-to-string map. Defaults to {}.

eventsWebhookEvent[] required

The event types a webhook is subscribed to.

mode'test' | 'live' required

The webhook only receives events emitted in this mode.

isActiveboolean

Optional. Whether the webhook is enabled. Defaults to true.

Response

The created webhook, in the same shape as an entry in the list response.

_idstring

Unique identifier for the webhook — this is the webhookId used in Update a webhook and Delete a webhook.

merchantIdstring

The merchant the webhook belongs to.

namestring

Your label for the webhook.

urlstring uri

The endpoint Kashier delivers to.

headersobject

Custom headers Kashier sends with every delivery to this webhook, as a flat string-to-string map.

eventsWebhookEvent[]

The event types a webhook is subscribed to.

mode'test' | 'live'

The webhook only receives events emitted in this mode.

isActiveboolean

Whether the webhook currently receives deliveries.

createdAtstring date-time
updatedAtstring date-time

Example response

{
  "_id": "66a1f2c3e4b0a1234567890a",
  "merchantId": "MID-10293"
}

Changes

No recorded changes to this operation across all 1 revision of this API.