Skip to content

Registration of new webhook

Request

Registers the webhook. For a single event (event, for example order:create) ONLY ONE URL can be registered.

Successful creation (registration) of webhook is signaled by code 201. The endpoint returns the info on the created webhook. One of the items is id, which is assigned to the webhook and is used for its identification

upon change or deletion.

Up to 50 webhooks can be registered in a single call. If all of them fail (duplicate event, event you have no rights to, invalid url, unsupported sendPayload for the event, ...), the response code is 422 and data is null. If at least one succeeds, the response is 201 and failed items are reported in errors.

The supported event can be found in code list Webhook event types.

Please note that url cannot be longer than 2000 characters.

Security
shoptetAccessToken or shoptetPrivateApiToken
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
dataArray of objectsrequired
curl -i -X POST \
  https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/webhooks \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "data": [
      {
        "event": "order:create",
        "url": "https://myapplication.tld/orders.php",
        "sendPayload": "full"
      }
    ]
  }'

Responses

Created

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "webhooks": [] }, "errors": [ {} ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }