Order item webhook

To receive live updates for an order item, we can set up a webhook notification for you. When an order item status changes (for example from PENDING to OK), details are sent directly to the URL you specify.

Authentication

For added security, our webhook supports basic access authentication. Provide us with a username and password of your choosing and the webhook will include them in the Authorization header of the request.

If this option is not possible for you, we can provide a list of our IP addresses so that you can set up a whitelist for your endpoint.

Response

The body of the response is ignored. A 200 status code response confirms the request has been received and will be processed. All other status codes are treated as a failed attempt - another webhook request will be sent later.

Example

Let's look at an example with our imaginary partner, Acme.

They've set up a URL for our webhook at https://www.acme-partner.com/api/v1/items/musement/webhook. They've added additional authentication:

  • Username : JohnSmith
  • Password : Swordfish

Before submitting the request, the username and password must be base-64 encoded first: Sm9oblNtaXRoOlN3b3JkZmlzaA==

The example below shows a typical webhook request along with the partner's URL and encoded authentication:

Copy
Copied
curl -X POST 'https://www.acme-partner.com/api/v1/items/musement/webhook' \
-H 'Authorization: Basic Sm9oblNtaXRoOlN3b3JkZmlzaA==' \
-H 'Content-Type: application/json' \
--data-raw '{
	"order_id": "13459345",
	"order_uuid": "8e9e5c6e-ea7d-4934-8753-f00954f30d00",
	"order_created": "2018-12-10T13:12:40+0000",
	"order_updated": "2018-12-10T13:12:40+0000",
	"order_version": "16",
	"order_item_uuid": "11045e18-e3ca-42e1-acb4-0d5be75036fd",
	"order_item_created": "2018-12-10T13:12:40+0000",
	"order_item_updated": "2018-12-10T13:12:40+0000",
	"order_item_version": "22",
	"order_item_status": "OK"
}'

Fallback

Unfortunately, webhook delivery is not guaranteed. It is strongly recommended to set up a fallback, allowing your integration to check an order item's status by calling /orders/{orderUuid}.

Copyright © TUI Musement. All rights reserved.