webhooks

Create a webhook

Changed on

Create a webhook

post/webhooks

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/webhooks
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "attributes": {
      "name": "myorg-orders.place",
      "topic": "orders.place",
      "callback_url": "https://yourapp.com/webhooks",
      "include_resources": [
        "customer",
        "shipping_address",
        "billing_address"
      ],
      "_disable": true,
      "_enable": true,
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    }
  }
}

Response

The created webhook object

Changes

    • breaking

      request property / was restricted to a list of enum values

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      the request property default value webhooks was removed

    • info

      added the new webhooks enum value to the request property /

    • info

      added the media type application/vnd.api+json for the response with the status