Peek Reseller API
  • Introduction
  • Getting Started
    • Basics
    • Request Access
    • Headers
    • Capabilities
    • Errors
  • Booking Flow
    • Products
    • Availability
    • Booking
  • Capabilities
    • Pricing
    • Webhooks
Powered by GitBook
On this page
  • Create Webhook
  • List Webhooks
  • Delete Webhooks
  1. Capabilities

Webhooks

Get notifications sent to you when something changes

This capability allows you to create webhooks which will notify a given URL whenever an action happens in Peek Pro, e.g. Booking Update or Booking Cancellation.

Create Webhook

POST https://octo.peek.com/integrations/octo/webhooks

Create a new webhook

Request Body

Name
Type
Description

url*

String

The URL to call when the webhook is triggered

event*

String

The event that will trigger the webhook

{
  "id": "octohook_123",
  "event": "booking_update",
  "url": "https://example.com/webhooks/availability_update"
}

Field

Description

url

A fully formed URL. If you want to include basic authentication credentials that is supported also. For example:

  • https://user:pass@example.com/webook

  • https://example.com/webhook

event

The event that will trigger the webhook. Possible values are:

booking_update triggered when an existing booking is confirmed, updated or cancelled.

An example response will look like this:

{
  "id": "octohook_123",
  "event": "booking_update",
  "url": "https://example.com/webhooks/booking_update"
}

When an event is triggered the webhook will perform a POST HTTP request to the specified URL, the request body will look like this depending on the event type:

{
  "webhook": {
    "id": "octohook_123",
    "event": "booking_update",
    "url": "https://example.com/webhooks/booking_update"
  },
  "booking": {
    "uuid": "89fe0192-ddcd-430a-b285-e1396a4725d2",
    "testMode": true,
    "resellerReference": null,
    "supplierReference": "X749G9",
    "status": "ON_HOLD",
    "utcExpiresAt": "2020-06-07T17:06:37Z",
    "utcConfirmedAt": null,
    "productId": "av_123",
    "optionId": "av_123",
    "cancellable": true,
    "cancellation": null,
    "freesale": false,
    "notes": "optional notes on the booking",
    "availability": {
      "id": "20200701143000_720_5214a9d6-5271-4958-a306-14a07e4084c6",
      "localDateTimeStart": "2020-07-01T14:30:00-08:00",
      "localDateTimeEnd": "2020-07-02T02:30:00-08:00",
      "allDay": true,
      "openingHours": []
    },
    "contact": {
      "fullName": null,
      "emailAddress": null,
      "phoneNumber": null,
      "locales": [],
      "country": null
    },
    "deliveryMethods": [
      "VOUCHER"
    ],
    "voucher": {
      "redemptionMethod": "DIGITAL",
      "utcRedeemedAt": null,
      "deliveryOptions": []
    },
    "unitItems": [
      {
        "uuid": "eeddd74e-88e6-4dab-84e9-14f7af18935f",
        "resellerReference": null,
        "supplierReference": "408H44",
        "unitId": "ecbdb23e-9840-4d15-b6f4-254a9ea401b2"
      },
      {
        "uuid": "ec1e2622-1359-437b-83f8-15182759d605",
        "resellerReference": null,
        "supplierReference": "BSDYM4",
        "unitId": "ecbdb23e-9840-4d15-b6f4-254a9ea401b2"
      },
      {
        "uuid": "de9855fd-8176-4551-9ba9-ae8c997cb2bb",
        "resellerReference": null,
        "supplierReference": "E5K92G",
        "unitId": "480d0c3e-80a1-4bf2-a39b-aa06332739df"
      }
    ]
  }
}

This endpoint will return a list of all existing webhooks.

List Webhooks

GET https://octo.peek.com/integrations/octo/webhooks

List all webhooks

[
  {
    "id": "octohook_123",
    "event": "booking_update",
    "url": "https://example.com/webhooks/booking_update"
  }
]

Delete Webhooks

DELETE https://octo.peek.com/integrations/octo/webhooks/:id

Delete an existing webhook

Path Parameters

Name
Type
Description

id*

String

The webhook id

{
  "id": "octohook_123",
  "event": "booking_update",
  "url": "https://example.com/webhooks/booking_update"
  }
]
PreviousPricing

Last updated 3 years ago

We recommend for testing you can use to create an endpoint which connects to your localhost. You can then make test bookings with the same credentials and see the webhook requests arrive.

ngrok