Webhooks

Create a webhook endpoint

Changed on

Register a URL to receive event deliveries. The response includes the signing secret; store it, it is the only time the create call returns it.

post/v1/webhooks

Request

Request body

urlstring

The HTTPS URL Creem will deliver events to. Required unless delivery_mode is cli, in which case it is ignored.

delivery_mode'http' | 'cli'

How events reach this endpoint: http deliveries are POSTed to url; cli deliveries wait in the pending-events feed for a local creem listen session.

namestring

A human-readable label for the endpoint.

eventsWebhookEventType[]

Example request

{
  "url": "https://example.com/webhooks/creem",
  "name": "Production billing events",
  "events": [
    "checkout.completed",
    "subscription.paid"
  ]
}

Response

Successfully created the webhook endpoint

idstring required

Unique identifier for the object.

mode'test' | 'prod' | 'sandbox' required

String representing the environment.

objectstring required

A string representing the object’s type. Objects of the same type share the same value.

store_idstring required

The store this webhook endpoint belongs to.

namestring nullable required

A human-readable label for the endpoint.

urlstring required

The HTTPS URL Creem delivers events to. For cli endpoints this is a placeholder that is never called.

delivery_mode'http' | 'cli' required

How events reach this endpoint: http deliveries are POSTed to url; cli deliveries wait in the pending-events feed for a local creem listen session.

status'enabled' | 'disabled' required

Whether the endpoint receives deliveries. Disabled endpoints keep their configuration but receive nothing.

eventsWebhookEventType[] required
secretstring

The signing secret used to verify delivery signatures. Only returned when the endpoint is created; retrieve it later via the secret endpoint.

Example response

{
  "object": "webhook",
  "store_id": "sto_1234567890",
  "name": "Production billing events",
  "url": "https://example.com/webhooks/creem",
  "events": [
    "checkout.completed",
    "subscription.paid"
  ],
  "secret": "whsec_xxxxxxxxxxxxxxxxxxxx"
}

Changes

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      added the required property to the response with the status

    • info

      endpoint added