予約イベントのWebhookを設定することによって、ホテルはURLを介してJSON形式で予約情報を受け取ることができます。

ご注意下さい: この設定を行うには、Webhookに関する基本的な知識が必要です。サポートが必要な場合は、Web開発者に相談することをお勧めします。

予約の作成、変更、又はキャンセルが行われた際にWebhookは指定されたURLにコールバックを送信します。

予約イベントのWebhook機能は以下で実行されることがトリガーとなります。

  • Sirvoy予約フォーム
  • 予約確認フォーム
  • 予約サイトからの予約

この機能をアクティベートするには次のように進んで設定して下さい: 設定 -> あなたのアカウント -> 予約イベントのWebhook

受信サーバーは応答コード200 OKで応答する必要があります。その応答がない場合にはコールは30分ごとに3回まで再試行されます。プライバシーと機密性を守るために、TLSバージョン1.2以降を使用するHTTPSのみをサポートしています。HTTPS証明書も有効である必要があります。有効でない場合はデータは送信されません。予約のデータは、JSONリクエストボディーとともにPOSTとして送信されます。

貴サーバーがHTTP GET リクエストに200 OKで応答するようにしてください。これは、エンドポイントがアクティブであることを確認するためのヘルスチェックとして周期的に使用されます。ただし、HTTP GETを使用してデータが送信されることはありません。

Webhookのコールバックは以下のIPアドレスから行われます。貴サーバーへのトラフィックを制限するようにしている場合には、ファイアウォールで以下のアドレスをすべて許可してください。

  • 34.243.166.60
  • 52.18.11.99
  • 63.34.80.48
  • 54.194.0.85
  • 2a05:d018:e34:5300::/56

コールバックを行うサーバーは、ipv4とipv6を共存させるデュアルスタックです。貴ドメイン名にipv4アドレスとipv6アドレスの両方を追加すると、最初に応答したサーバーにWebhookコールバックが行われます。

以下は、新しい予約が作成されたときにJSON形式で生成されたデータの例です。

{
   "version":"1.0",
   "callbackId":2464764,
   "generatedTime":"2021-09-08T11:41:06+00:00",
   "event":"new",
   "propertyId":1,
   "bookingId":26006,
   "channelBookingId":null,
   "bookingDate":"2021-09-08T11:37:42+00:00",
   "arrivalDate":"2021-09-08",
   "departureDate":"2021-09-10",
   "cancelled":false,
   "eta":null,
   "totalAdults":2,
   "guest":{
      "firstName":"John",
      "lastName":"Doe",
      "businessName":"Acme Corporation",
      "address":"123 Main St",
      "postcode":"17101",
      "city":"AnyTown",
      "state":"DE",
      "country":"US",
      "phone":"+17184547453",
      "email":"john.doe@mailservice.us",
      "passportNo":null,
      "language":"en",
      "message":"Your hotel looks nice :)"
   },
   "guestReference":null,
   "internalComment":null,
   "couponCode":null,
   "bookingSource":"Front desk",
   "bookingIsCheckedIn":false,
   "bookingIsCheckedOut":false,
   "bookingIsConfirmed": false,
   "bookingIsProvisional":false,
   "bookingProvisionalId":null,
   "customFields":[
      {
         "name":"Custom field",
         "value":"custom field text filled by guest"
      },
      {
         "name":"Checkbox",
         "value":true
      },
      {
         "name":"new checkbox",
         "value":false
      }
   ],
   "rooms":[
      {
         "RoomTypeName":"Basic room",
         "RoomTypeDescription":"As basic as it gets, with a small window included.",
         "RoomName":"110",
         "RoomId": 52,
         "arrivalDate":"2021-09-08",
         "departureDate":"2021-09-10",
         "adults":2,
         "quantity":2,
         "price":100,
         "roomTotal":200,
         "guestName":null,
         "comment":null,
         "ledgerAccount":null
      }
   ],
   "additionalItems":[
      {
         "description":"Cleaning Fee",
         "specificDate":null,
         "quantity":1,
         "price":0,
         "itemTotal":0,
         "ledgerAccount":null
      }
   ],
   "bookedCategory":null,
   "currency":"EUR",
   "totalPrice":200,
   "totalSurcharges":20,
   "totalPriceIncludingSurcharges":220,
   "payments":[],
   "invoices":[]
}

以下は、領収書が作成され、支払いが領収書に移動された場合の例です。その予約の支払いと領収書のデータもWebhookコールバックに含まれます。その他の変更を実行した場合にも、そのデータを含むWebhookコールバックが発生します。この例の予約イベントのWebhookは、次のようになります。

{
   "version":"1.0",
   "callbackId":2464765,
   "generatedTime":"2021-09-08T11:45:01+00:00",
   "event":"modified",
   "propertyId":1,
   "bookingId":26006,
   "channelBookingId":null,
   "bookingDate":"2021-09-08T11:37:42+00:00",
   "arrivalDate":"2021-09-08",
   "departureDate":"2021-09-10",
   "cancelled":false,
   "eta":null,
   "totalAdults":2,
   "guest":{
      "firstName":"John",
      "lastName":"Doe",
      "businessName":"Acme Corporation",
      "address":"123 Main St",
      "postcode":"17101",
      "city":"AnyTown",
      "state":"DE",
      "country":"US",
      "phone":"+17184547453",
      "email":"john.doe@mailservice.us",
      "passportNo":null,
      "language":"en",
      "message":"Your hotel looks nice :)"
   },
   "guestReference":null,
   "internalComment":null,
   "couponCode":null,
   "bookingSource":"Front desk",
   "bookingIsCheckedIn":false,
   "bookingIsCheckedOut":false,
   "bookingIsConfirmed": false,
   "bookingIsProvisional":false,
   "bookingProvisionalId":null,
   "customFields":[
      {
         "name":"Custom field",
         "value":"custom field text filled by guest"
      },
      {
         "name":"Checkbox",
         "value":true
      },
      {
         "name":"new checkbox",
         "value":false
      }
   ],
   "rooms":[
      {
         "RoomTypeName":"Basic room",
         "RoomTypeDescription":"As basic as it gets, with a small window included.",
         "RoomName":"110",
         "RoomId": 52,
         "arrivalDate":"2021-09-08",
         "departureDate":"2021-09-10",
         "adults":2,
         "quantity":2,
         "price":100,
         "roomTotal":200,
         "guestName":null,
         "comment":null,
         "ledgerAccount":null
      }
   ],
   "additionalItems":[
      {
         "description":"Cleaning Fee",
         "specificDate":null,
         "quantity":1,
         "price":0,
         "itemTotal":0,
         "ledgerAccount":null
      }
   ],
   "bookedCategory":null,
   "currency":"EUR",
   "totalPrice":200,
   "totalSurcharges":20,
   "totalPriceIncludingSurcharges":220,
   "payments":[],
   "invoices":[
      {
         "invoiceNumber":"41001",
         "invoiceDate":"2021-09-08",
         "dueDate":"2021-09-08",
         "receiver":"Acme Corporation",
         "address":[
            "John Doe",
            "123 Main St",
            "AnyTown, DE 17101",
            "United States"
         ],
         "roundingAmount":0,
         "invoiceTotal":220,
         "originInvoice":null,
         "invoiceRows":[
            {
               "quantity":2,
               "price":100,
               "rowTotal":200,
               "ledgerAccount":"3010",
               "rowText":"Basic room",
               "vatRate":0,
               "vatAmount":0,
               "bookingId": 26005
            },
            {
               "quantity":1,
               "price":20,
               "rowTotal":20,
               "ledgerAccount":"sur1",
               "rowText":"10",
               "vatRate":0,
               "vatAmount":0
            }
         ],
         "payments":[
            {
               "paymentId": 26,
               "createdAt": "2023-10-12T20:43:08+00:00",
               "valueDate": "2023-10-13",
               "amount":220,
               "ledgerAccount":" ",
               "paymentReference":null,
               "comment":null
            }
         ]
      }
   ]
}