Webhook Specifications

Object

event_type

각 웹훅의 이벤트를 선언합니다.
각 이벤트에 따라 호출하는 Body 값이 다릅니다.

예제:

"event_type": "contents_updated"

사용 가능한 event_type 값:

  • contents_updated
  • status_updated
  • inventory_updated

event_detail

event_type 에 대한 상내 내용을 담습니다. event_typeevent_detail 에 따라 포함되는 attribute 는 다를 수 있습니다. 아래 event_type / event_detail 별 Sample 을 참고해주세요.

inventory_updated 의 경우에는 event_details 복수 Array로 응답합니다.

Sample

contents_updated

event_typecontents_update 가 확인된다면, 지정된 target 의 컨텐츠가 업데이트 되었다는 의미입니다. 각 target 의 id 를 이용하여 컨텐츠 업데이트 할 수 있도록 각각의 컨텐츠 API 를 호출해 주세요.

만약 업데이트 할 property, roomtype, rateplan 이 없다면 새로 추가해주세요.

UPSERT

target = property Sample

{
	"event_type": "contents_updated",
	"event_detail": {
		"target": "property",
		"property_id": 32124
	},
	"timestamp": "2021-01-27T10:39:12+09:00"
}

target = roomtype Sample

{
	"event_type": "contents_updated",
	"event_detail": {
		"target": "roomtype",
		"property_id": 32124,
		"roomtype_id": 111111
	},
	"timestamp": "2021-01-27T10:39:12+09:00"
}

target = rateplan Sample

{
	"event_type": "contents_updated",
	"event_detail": {
		"target": "rateplan",
		"property_id": 32124,
		"roomtype_id": 111111,
		"rateplan_id": 1234567
	},
	"timestamp": "2021-01-27T10:39:12+09:00"
}

status_updated

event_typestatus_update 가 확인된다면, 지정된 target 의 상태가 변경 되었다는 의미입니다. 각 target 의 id 에 대한 상태 업데이트를 처리해주세요.

지원하는 상태(status) :

statusdescription
enabled판매상태가 활성 상태로 변경됨을 뜻합니다.
활성화 상태로 업데이트 해주세요.
disabled판매상태가 비활성 상태로 변경됨을 뜻합니다.
비활성화 상태로 업데이트 해주세요.
deleted더 이상 판매될 수 없도록 영구적으로 삭제됨을 뜻합니다.
삭제 상태 또는 비활성화 상태로 업데이트 해주세요.

target = property Sample / disabled case

{
	"event_type": "status_updated",
	"event_detail": {
		"target": "property",
		"property_id": 32124,
		"status": "disabled"
	},
	"timestamp": "2021-01-27T10:39:12+09:00"
}

target = roomtype Sample / enabled case

{
	"event_type": "status_updated",
	"event_detail": {
		"target": "roomtype",
		"property_id": 32124,
		"roomtype_id": 111111,
		"status": "enabled"
	},
	"timestamp": "2021-01-27T10:39:12+09:00"
}

target = rateplan Sample / deleted case

{
	"event_type": "status_updated",
	"event_detail": {
		"target": "rateplan",
		"property_id": 32124,
		"roomtype_id": 111111,
		"rateplan_id": 1234567,
		"status": "deleted"
	},
	"timestamp": "2021-01-27T10:39:12+09:00"
}

inventory_updated

새롭게 추가되거나 변경되는 요금 및 재고 정보를 포함합니다. rateplan_id 의 요금 및 재고를 정보 그대로 추가 하거나 업데이트 해주세요. UPSERT

여러 일자에 대한 업데이트 인 경우, 1개 웹훅에 event_detail 이 Array 로 응답됩니다.

지원하는 정보 Field

FieldDescription
date요금재고가 적용되는 Checkin 일자입니다.
basic_price기본 요금 입니다.
sale_price실제 판매 요금입니다. basic_price 보다 sale_price 가 클 수 없습니다.

basic_price 와의 차이를 통해 할인율을 계산 할 수 있습니다.
extra_adult성인 추가 비용입니다.
extra_child아동 추가 비용입니다.
extra_infant유아 추가 비용입니다.
promotion_typebasic_price 에 적용된 지정된 프로모션이 있을 경우 반환합니다. 없는 경우 Null 을 반환 합니다.
vacancy예약 가능한 재고 수 입니다.
0인 경우, 재고 없음으로 인해 예약이 불가능한 상태입니다.

available case / vacancy >= 1

{
	"event_type": "inventory_updated",
	"event_details": [
      {
        "property_id": 32124,
        "roomtype_id": 111111,
        "rateplan_id": 1234567,
        "date": "2022-10-10",
        "basic_price": 100000,
        "sale_price": 80000,
        "extra_adult": 10000,
        "extra_child": 0,                
        "extra_infant": 0,
        "promotion_type": null,
        "vacancy": 1
      }
  ],
	"timestamp": "2021-01-27T10:39:12+09:00"
}

unavailable case / vacancy = 0

{
	"event_type": "inventory_updated",
	"event_details": [
      {
        "property_id": 32124,
        "roomtype_id": 111111,
        "rateplan_id": 1234567,
        "date": "2022-10-10",
        "basic_price": 100000,
        "sale_price": 80000,
        "extra_adult": 10000,
        "extra_child": 0,                
        "extra_infant": 0,
        "promotion_type": null,
        "vacancy": 0
      }
  ],
	"timestamp": "2021-01-27T10:39:12+09:00"
}

update array case

{
	"event_type": "inventory_updated",
	"event_details": [
      {
        "property_id": 32124,
        "roomtype_id": 111111,
        "rateplan_id": 1234567,
        "date": "2022-10-10",
        "basic_price": 100000,
        "sale_price": 80000,
        "extra_adult": 10000,
        "extra_child": 0,                
        "extra_infant": 0,        
        "promotion_type": null,
        "vacancy": 1
      },
      {
        "property_id": 32124,
        "roomtype_id": 111111,
        "rateplan_id": 1234567,
        "date": "2022-10-11",
        "basic_price": 100000,
        "sale_price": 80000,
        "extra_adult": 10000,
        "extra_child": 0,                
        "extra_infant": 0,        
        "promotion_type": null,
        "vacancy": 1
      },
      {
        "property_id": 32124,
        "roomtype_id": 111111,
        "rateplan_id": 1234567,
        "date": "2022-10-12",
        "basic_price": 100000,
        "sale_price": 70000,
        "extra_adult": 10000,
        "extra_child": 0,                
        "extra_infant": 0,        
        "promotion_type": null,
        "vacancy": 0
      },
      {
        "property_id": 32124,
        "roomtype_id": 337222,
        "rateplan_id": 7654321,
        "date": "2022-10-10",
        "basic_price": 100000,
        "sale_price": 80000,
        "extra_adult": 10000,
        "extra_child": 0,                
        "extra_infant": 0,        
        "promotion_type": null,
        "vacancy": 0
      }
  ],
	"timestamp": "2021-01-27T10:39:12+09:00"
}