Skip to main content

Payload

The previous section of the documentation describes how to create a webhook. This section focuses on the payload of the POST-requests that the

system sends when a webhook is invoked.

Structure

The structure of the payload of a POST-request that is sent when a trigger invokes a webhook is listed below. This structure is consistent across all resources for which webhooks can be created.

  • meta:
    • user_id: the GUID of the user that initiated the trigger of the webhook.
    • user_name: the first and last name of the user that initiated the trigger of the webhook.
    • company_id: the company GUID of the company within which the trigger for webhook was initiated.
  • model:
    • guid: the GUID of the model for which the trigger was initiated.
    • type: the type of the model for which the trigger was initiated.
    • name: the name of the model for which the trigger was initiated.
  • change:
    • props: the latest values of all the properties for the model for which the trigger was initiated.
    • changes: the changed values for all the fields that have been changed in the model for which the trigger was initiated.
  • type: the trigger that invoked the webhook. This can be one of create, update, delete or scan.
  • time: the date and time when the webhook was invoked.

Event

There are four triggers that can invoke a webhook for an event: Create, Update, Delete and Scan. An update to an event can invoke up to two different webhook resources depending on the changed fields. Changes to an event-specific field (for example description or name) invoke the Event Update webhook while changes to the start and end dates of an event invoke the EventDate Update webhook. The code blocks below show the bodies of the POST-requests that the

system sends when one of these triggers invoke a webhook. It also shows the slightly different bodies for different update events.

{
"meta": {
"user_id": "535f11b0-0139-11ee-90b9-3766c05c0783",
"user_name": "Firstname Lastname",
"company_id": "53512e90-0139-11ee-8d31-79feaa0dd8b4",
},
"model": {
"guid": "b048af93-13d9-45d0-9c3a-10a747de0767",
"type": "event",
"name": "Some Event Name"
},
"change": {
"props": {
"created_at": "2023-06-23T10:17:28+02:00",
"updated_at": "2023-06-23T10:17:28+02:00",
"guid": "b048af93-13d9-45d0-9c3a-10a747de0767",
"company_id": "53512e90-0139-11ee-8d31-79feaa0dd8b4",
"location_id": "19dadee0-21df-4434-8592-f44a6ddd7fab",
"website": "",
"description": "With a description",
"name": "Some Event Name",
"subcategories": "other",
"category": "other",
"locale": "nl_NL",
"currency": "EUR",
"type": "once",
"gui_mode": "simple",
"status": "normal"
}
},
"type": "create",
"time": "2023-06-23T08:17:28Z"
}

Ticket

There are four triggers that can invoke a webhook for a ticket: Create, Update, Delete and Scan. The code blocks below show the bodies of the POST-requests that the

system sends when one of these triggers invoke a webhook.

note

When an invalid ticket is scanned, the direction will be invalid.

{
"meta": {
"user_id": "535f11b0-0139-11ee-90b9-3766c05c0783",
"user_name": "Firstname Lastname",
"company_id": "53512e90-0139-11ee-8d31-79feaa0dd8b4",
},
"model": {
"guid": "f535ab84-4a6b-43c9-9172-582b28e965c3",
"type": "ticket",
"name": "Ticket One"
},
"change": {
"props": {
"created_at": "2023-06-23T10:57:54+02:00",
"updated_at": "2023-06-23T10:57:54+02:00",
"guid": "f535ab84-4a6b-43c9-9172-582b28e965c3",
"company_id": "53512e90-0139-11ee-8d31-79feaa0dd8b4",
"event_id": "b048af93-13d9-45d0-9c3a-10a747de0767",
"name": "Ticket One",
"late_personalization": false,
"hide_without_coupon": false,
"combines_products": true,
"vat_percentage": 21,
"min_price": 0,
"available_stock": 0,
"status_overrule": "auto",
"swappable": true,
"percentage_service_costs_in_ticket": 0,
"availability_margin": 0,
"max_orderable_amount_per_order": 20,
"min_orderable_amount_per_order": 1,
"increment": 1
}
},
"type": "create",
"time": "2023-06-23T08:57:55Z"
}

Metadata

There are three triggers that can invoke a webhook for metadata: Create, Update and Delete. The code blocks below show the bodies of the POST-requests that the

system sends when one of these triggers invoke a webhook.

{
"meta": {
"user_id": "535f11b0-0139-11ee-90b9-3766c05c0783",
"user_name": "Firstname Lastname",
"company_id": "53512e90-0139-11ee-8d31-79feaa0dd8b4",
},
"model": {
"guid": "c19087db-0b2c-4545-a5de-8f98644dc17a",
"type": "metadata",
"name": "Test Metadata Name"
},
"change": {
"props": {
"public": false,
"created_at": "2023-06-23T13:05:29+02:00",
"updated_at": "2023-06-23T13:05:29+02:00",
"guid": "c19087db-0b2c-4545-a5de-8f98644dc17a",
"company_id": "53512e90-0139-11ee-8d31-79feaa0dd8b4",
"shop_description": "With extra information",
"name": "Test Metadata Name",
"forced": false,
"applies_to": "person",
"extra": "required",
"type": "string"
}
},
"type": "create",
"time": "2023-06-23T11:05:29Z"
}