API 网络挂钩3.0开发

简介

网络挂钩(Webhooks)是一个简单的HTTP请求,在发生制定的事件时发送出去。 您可以为每个事件开发一个统一或单独的处理程序(URL),当此事件处理程序收到网络挂接请求时,它将相应地返回http 200响应。
如果您对网络挂钩概念不熟悉,可以在此博客上阅读更详尽的解释。
网络挂钩 3.0 (Webhooks 3.0)是我们的最新版本。与我们之前的版本相比,此版本有更多的端点和更详细的产品和产品类型通知


网络挂钩有效载荷细节

  • 网络挂钩使用POST HTTP / 1.1请求和JSON有效载荷推送
  • 有效负载因事件而异,但始终包含 type,timestamp 和 signature
  • 网络挂钩是通过200 OK HTTP响应作为确认,这意味着该事件已被您的应用程序确认。

网络挂钩确认

  • 您的服务器中的网络挂钩处理程序将返回HTTP响应200 OK作为事件确认
  • 当网络挂钩从您的服务器处理程序收到http 200响应时,它会被标记为已确认,并且不会再次发送
  • 如果我们的网络挂钩在等待超过20秒之后得到任何其他HTTP响应或根本没有响应,则会被标记为失败并且将重试发送
  • 重试次数
    • 重试总次数是10次
    • 第一次重试将在原先网络挂钩发送后1分钟进行
    • 第二次重试将在第一次重试后2分钟进行
    • 后续重试之间的间隔时间为同一天的1,2,4,8,16,32,64分钟
    • 在第7次重试之后,接下来的3天内将每隔24小时重试一次
    • 如果在接下来的3天重试后仍然失败,则此网络挂钩事件将被自动停用。您必须解决您的服务器问题,然后登录到Agents Marketplace重新启用它

网络挂钩事件

名称
描述
product_available 当有新产品上线时, 系统将会发送通知
product_updated 当产品的信息(描述,定价,属性等)被更新时,系统将会发送通知
product_type_available 当有新产品类型上线时,系统将会发送通知
product_type_not_available 当有新产品类型下线时,系统将会发送通知
product_type_content_updated 当产品类型API端点中的现有内容字段数据发生更改,系统将会发送通知
product_type_availability_update 当产品类型可用日期被更新时,系统将会发送通知
product_type_pricing_updated 当产品类型基本价格被更新时,系统将会发送通知。注意:每个日期的产品类型价格可能有所不同,请使用产品类型价格API端点获取基于日期的最新价格
booking_status_updated 当订单状态被更新时,系统将会发送通知
booking_data_updated 当预订数据被更新时,不包括状态,系统将会发送通知
booking_tickets_updated 当您的订单已附上凭证后,或订单凭证有所更新,系统将会发送通知

网络挂钩保安

为了确保网络挂钩调用的来源,我们建议使用有效负载签名.
在Agents marketplace webhooks配置中,您可以(重新)生成散列密码,这将用于为网络挂钩调用创建HMAC。
Signature是带有哈希密钥的JSON格式的有效载荷的sha256 HMAC。它基于2个字段的值。 “type”,“timestamp”使用|连接。
在PHP中检查签名的示例:
注意* 启动网络挂钩之前,请确保您已生成网络挂钩密钥


$json = json_decode($request->getBody(), true);
$signature = $json['signature'];
$payload = $json;
$signature === hash_hmac('sha256', $payload['type'].'|'.$payload['timestamp'], 'MY_WEBHOOK_SECRET_KEY');


开发网络挂钩的步骤

  • 在服务器中创建网络挂钩事件处理程序
  • 此网络挂钩处理程序的主要任务是从网络挂钩服务器接收有效负载,将其保存为服务器队列中的作业,然后返回http 200响应。 您必须确保它能够在20秒内返回响应。
  • 在服务器中创建一个作业以循环访问服务器队列并相应地处理每个网络挂钩作业
  • 登录 Agents MarketPlace
  • 点击 API, 然后在点击 Webhooks 3 页面
  • 点击“生成”按钮创建网络挂钩密钥
  • 在每个网络挂钩事件中输入事件处理程序的有效链接URL
  • 更新服务器中的网络挂钩事件处理程序以使用此新密钥
  • 开始测试您的网络挂钩事件处理程序

网络挂钩事件JSON有效载荷样本

  • product_available

    
    {
        "type": "product_available",
        "data": {
                "uuid": "862a4a30-533f-57dc-94d0-dab9d59bacc5",
                "updatedAt": "2019-01-18 15:30:35",
                "title": "Sentosa Day Fun Pass",
                "titleTranslated": "Sentosa Day Fun Pass",
                "description": "Discover endless fun and surprises at Sentosa from alluring attractions, pristine beaches, action-packed activities and lush rainforests. To get the most out of your trip, all you need is the Sentosa FUN Pass — your ticket to The State of Fun!\n\nWhether you’re a thrill-seeker, nature lover, or simply out for some family fun, there’s definitely something for you with the Day Fun Pass, which offers you the freedom to cover up to 18 exciting attractions! Experience three, five, or all 18 attractions.",
                "descriptionTranslated": "Discover endless fun and surprises at Sentosa from alluring attractions, pristine beaches, action-packed activities and lush rainforests. To get the most out of your trip, all you need is the Sentosa FUN Pass — your ticket to The State of Fun!\n\nWhether you’re a thrill-seeker, nature lover, or simply out for some family fun, there’s definitely something for you with the Day Fun Pass, which offers you the freedom to cover up to 18 exciting attractions! Experience three, five, or all 18 attractions.",
                "highlights": "Experience the favourite attractions and activities in Sentosa\nChoose among 18 exciting attractions with up to 70% savings\nDecide on the spot which attractions you want to visit",
                "highlightsTranslated": "Experience the favourite attractions and activities in Sentosa\nChoose among 18 exciting attractions with up to 70% savings\nDecide on the spot which attractions you want to visit",
                "additionalInfo": "Notes:\n- The price of Fun Passes excludes island admission and Cable Car Sentosa Line.\n- Each ticket allows one visit per attraction per person only.\n",
                "additionalInfoTranslated": "Notes:\n- The price of Fun Passes excludes island admission and Cable Car Sentosa Line.\n- Each ticket allows one visit per attraction per person only.\n",
                "covid19Measures":  "Information on Covid-19 notice of Safety Standards of visiting the attractions",
                "covid19MeasuresTranslated": "Information on Covid-19 notice of Safety Standards of visiting the attractions on requested language",
                "priceIncludes": "Admission fee",
                "priceIncludesTranslated": "Admission fee",
                "priceExcludes": "Transfer services\nPersonal expenses\nTips",
                "priceExcludesTranslated": "Transfer services\nPersonal expenses\nTips",
                "validFrom": null,
                "validThrough": null,
                "itinerary": "",
                "itineraryTranslated": "",
                "warnings": "- In cases of extreme weather conditions, this tour may be cancelled. Your host will contact you directly.\n\nSafety and insurance:\n- Children must be accompanied by a paying adult at all times.",
                "warningsTranslated": "- In cases of extreme weather conditions, this tour may be cancelled. Your host will contact you directly.\n\nSafety and insurance:\n- Children must be accompanied by a paying adult at all times.",
                "safety": null,
                "safetyTranslated": null,
                "latitude": "1.2485520",
                "longitude": "103.8304437",
                "minPax": 1,
                "maxPax": 60,
                "basePrice": 45.58,
                "currency": {
                    "code": "SGD",
                    "symbol": "S$",
                    "uuid": "cd15153e-dfd1-5039-8aa3-115bec58e86e"
                },
                "isFlatPaxPrice": true,
                "reviewCount": 1,
                "reviewAverageScore": 4,
                "typeName": "Attraction",
                "typeUuid": "d3c54653-dd05-598f-b193-f6683d1064ab",
                "photosUrl": "https://s3.amazonaws.com/playground.bemyguest.com.sg",
                "businessHoursFrom": "09:00",
                "businessHoursTo": "22:00",
                "averageDelivery": 567,
                "hotelPickup": false,
                "airportPickup": false,
                "hasOptions": false,
                "allProductTypesHaveOptions": false,
                "photos": [
                    {
                        "caption": null,
                        "uuid": "f6f289e9-3545-51d4-9530-c4b5dfe1f5d8",
                        "paths": {
                            "original": "/images/content/original/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "75x50": "/images/content/75x50/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "175x112": "/images/content/175x112/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "680x325": "/images/content/680x325/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "1280x720": null,
                            "1920x1080": null,
                            "2048x1536": null
                        }
                    },
                    {
                        "caption": null,
                        "uuid": "9a03285e-e0d9-5c6b-b2d9-630aa466fd34",
                        "paths": {
                            "original": "/images/content/original/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "75x50": "/images/content/75x50/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "175x112": "/images/content/175x112/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "680x325": "/images/content/680x325/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "1280x720": null,
                            "1920x1080": null,
                            "2048x1536": null
                        }
                    },
                    {
                        "caption": null,
                        "uuid": "1c00c548-99aa-5f30-8bd9-b2d42579f339",
                        "paths": {
                            "original": "/images/content/original/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "75x50": "/images/content/75x50/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "175x112": "/images/content/175x112/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "680x325": "/images/content/680x325/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "1280x720": null,
                            "1920x1080": null,
                            "2048x1536": null
                        }
                    }
                ],
                "categories": [
                    {
                        "name": "Themeparks",
                        "uuid": "9384f408-a941-58ba-b958-4a814c23d1bc"
                    }
                ],
                "locations": [
                    {
                        "city": "Sentosa",
                        "cityUuid": "29ad1bd7-2000-5321-aff8-f71a6464142b",
                        "state": "Sentosa",
                        "stateUuid": "ab7d9ac9-036d-11e5-a2a9-d07e352b4840",
                        "country": "Singapore",
                        "countryUuid": "885e90a3-a83d-56d3-b5e8-040b4017c825"
                    }
                ],
                "guideLanguages": [
                    {
                        "name": "english",
                        "uuid": "790395c0-23b6-5dd9-8a6b-ca61b95dcfd4"
                    }
                ],
                "audioHeadsetLanguages": [
                    {
                        "name": "english",
                        "uuid": "790395c0-23b6-5dd9-8a6b-ca61b95dcfd4"
                    }
                ],
                "writtenLanguages": [
                    {
                        "name": "english",
                        "uuid": "790395c0-23b6-5dd9-8a6b-ca61b95dcfd4"
                    }
                ],
                "links": [
                    {
                        "method": "GET",
                        "rel": "self",
                        "href": "https://api.demo.bemyguest.com.sg/v2/products/862a4a30-533f-57dc-94d0-dab9d59bacc5"
                    },
                    {
                        "method": "GET",
                        "rel": "productTypes",
                        "href": "https://api.demo.bemyguest.com.sg/v2/products/862a4a30-533f-57dc-94d0-dab9d59bacc5/product-types"
                    }
                ],
                "translationLanguages": [
                    {
                        "code": "ZH-HANS",
                        "name": "chinese_simplified",
                        "uuid": "d182fbd9-4520-5c66-a513-94fcd3d46d9b"
                    }
                ]
        },
        "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
    
           

  • product_updated

    
    {
        "type": "product_updated",
        "data": {
                "uuid": "862a4a30-533f-57dc-94d0-dab9d59bacc5",
                "updatedAt": "2019-01-18 15:30:35",
                "title": "Sentosa Day Fun Pass",
                "titleTranslated": "Sentosa Day Fun Pass",
                "description": "Discover endless fun and surprises at Sentosa from alluring attractions, pristine beaches, action-packed activities and lush rainforests. To get the most out of your trip, all you need is the Sentosa FUN Pass — your ticket to The State of Fun!\n\nWhether you’re a thrill-seeker, nature lover, or simply out for some family fun, there’s definitely something for you with the Day Fun Pass, which offers you the freedom to cover up to 18 exciting attractions! Experience three, five, or all 18 attractions.",
                "descriptionTranslated": "Discover endless fun and surprises at Sentosa from alluring attractions, pristine beaches, action-packed activities and lush rainforests. To get the most out of your trip, all you need is the Sentosa FUN Pass — your ticket to The State of Fun!\n\nWhether you’re a thrill-seeker, nature lover, or simply out for some family fun, there’s definitely something for you with the Day Fun Pass, which offers you the freedom to cover up to 18 exciting attractions! Experience three, five, or all 18 attractions.",
                "highlights": "Experience the favourite attractions and activities in Sentosa\nChoose among 18 exciting attractions with up to 70% savings\nDecide on the spot which attractions you want to visit",
                "highlightsTranslated": "Experience the favourite attractions and activities in Sentosa\nChoose among 18 exciting attractions with up to 70% savings\nDecide on the spot which attractions you want to visit",
                "additionalInfo": "Notes:\n- The price of Fun Passes excludes island admission and Cable Car Sentosa Line.\n- Each ticket allows one visit per attraction per person only.\n",
                "additionalInfoTranslated": "Notes:\n- The price of Fun Passes excludes island admission and Cable Car Sentosa Line.\n- Each ticket allows one visit per attraction per person only.\n",
                "covid19Measures":  "Information on Covid-19 notice of Safety Standards of visiting the attractions",
                "covid19MeasuresTranslated": "Information on Covid-19 notice of Safety Standards of visiting the attractions on requested language",
                "priceIncludes": "Admission fee",
                "priceIncludesTranslated": "Admission fee",
                "priceExcludes": "Transfer services\nPersonal expenses\nTips",
                "priceExcludesTranslated": "Transfer services\nPersonal expenses\nTips",
                "validFrom": null,
                "validThrough": null,
                "itinerary": "",
                "itineraryTranslated": "",
                "warnings": "- In cases of extreme weather conditions, this tour may be cancelled. Your host will contact you directly.\n\nSafety and insurance:\n- Children must be accompanied by a paying adult at all times.",
                "warningsTranslated": "- In cases of extreme weather conditions, this tour may be cancelled. Your host will contact you directly.\n\nSafety and insurance:\n- Children must be accompanied by a paying adult at all times.",
                "safety": null,
                "safetyTranslated": null,
                "latitude": "1.2485520",
                "longitude": "103.8304437",
                "minPax": 1,
                "maxPax": 60,
                "basePrice": 45.58,
                "currency": {
                    "code": "SGD",
                    "symbol": "S$",
                    "uuid": "cd15153e-dfd1-5039-8aa3-115bec58e86e"
                },
                "isFlatPaxPrice": true,
                "reviewCount": 1,
                "reviewAverageScore": 4,
                "typeName": "Attraction",
                "typeUuid": "d3c54653-dd05-598f-b193-f6683d1064ab",
                "photosUrl": "https://s3.amazonaws.com/playground.bemyguest.com.sg",
                "businessHoursFrom": "09:00",
                "businessHoursTo": "22:00",
                "averageDelivery": 567,
                "hotelPickup": false,
                "airportPickup": false,
                "hasOptions": false,
                "allProductTypesHaveOptions": false,
                "photos": [
                    {
                        "caption": null,
                        "uuid": "f6f289e9-3545-51d4-9530-c4b5dfe1f5d8",
                        "paths": {
                            "original": "/images/content/original/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "75x50": "/images/content/75x50/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "175x112": "/images/content/175x112/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "680x325": "/images/content/680x325/f6f289e9-3545-51d4-9530-c4b5dfe1f5d8.jpg",
                            "1280x720": null,
                            "1920x1080": null,
                            "2048x1536": null
                        }
                    },
                    {
                        "caption": null,
                        "uuid": "9a03285e-e0d9-5c6b-b2d9-630aa466fd34",
                        "paths": {
                            "original": "/images/content/original/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "75x50": "/images/content/75x50/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "175x112": "/images/content/175x112/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "680x325": "/images/content/680x325/9a03285e-e0d9-5c6b-b2d9-630aa466fd34.jpg",
                            "1280x720": null,
                            "1920x1080": null,
                            "2048x1536": null
                        }
                    },
                    {
                        "caption": null,
                        "uuid": "1c00c548-99aa-5f30-8bd9-b2d42579f339",
                        "paths": {
                            "original": "/images/content/original/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "75x50": "/images/content/75x50/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "175x112": "/images/content/175x112/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "680x325": "/images/content/680x325/1c00c548-99aa-5f30-8bd9-b2d42579f339.jpg",
                            "1280x720": null,
                            "1920x1080": null,
                            "2048x1536": null
                        }
                    }
                ],
                "categories": [
                    {
                        "name": "Themeparks",
                        "uuid": "9384f408-a941-58ba-b958-4a814c23d1bc"
                    }
                ],
                "locations": [
                    {
                        "city": "Sentosa",
                        "cityUuid": "29ad1bd7-2000-5321-aff8-f71a6464142b",
                        "state": "Sentosa",
                        "stateUuid": "ab7d9ac9-036d-11e5-a2a9-d07e352b4840",
                        "country": "Singapore",
                        "countryUuid": "885e90a3-a83d-56d3-b5e8-040b4017c825"
                    }
                ],
                "guideLanguages": [
                    {
                        "name": "english",
                        "uuid": "790395c0-23b6-5dd9-8a6b-ca61b95dcfd4"
                    }
                ],
                "audioHeadsetLanguages": [
                    {
                        "name": "english",
                        "uuid": "790395c0-23b6-5dd9-8a6b-ca61b95dcfd4"
                    }
                ],
                "writtenLanguages": [
                    {
                        "name": "english",
                        "uuid": "790395c0-23b6-5dd9-8a6b-ca61b95dcfd4"
                    }
                ],
                "links": [
                    {
                        "method": "GET",
                        "rel": "self",
                        "href": "https://api.demo.bemyguest.com.sg/v2/products/862a4a30-533f-57dc-94d0-dab9d59bacc5"
                    },
                    {
                        "method": "GET",
                        "rel": "productTypes",
                        "href": "https://api.demo.bemyguest.com.sg/v2/products/862a4a30-533f-57dc-94d0-dab9d59bacc5/product-types"
                    }
                ],
                "translationLanguages": [
                    {
                        "code": "ZH-HANS",
                        "name": "chinese_simplified",
                        "uuid": "d182fbd9-4520-5c66-a513-94fcd3d46d9b"
                    }
                ]
        },
        "updatedFields": [
            "photos", 
            "warnings"
        ]
        "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
            

  • product_type_available

    
    {
       "type": "product_type_available",
        "productUuid": "862a4a30-533f-57dc-94d0-dab9d59bacc5",
        "productTypeUuid": "b92e76dc-6953-40dc-b0e6-8bb600f8e5b3",
        "endpoint": "http://api.demo.bemyguest.com.sg/v2/product-types/b92e76dc-6953-40dc-b0e6-8bb600f8e5b3/price-lists",
        "timestamp": "2019-08-29T13:45:52+08:00",
        "signature": "6c2e4efed3f902612ef1b9367221a7b3002c79d6714c5a183cafc4eda173ede2"
    }
            

  • product_type_not_available

    
    {
        "type": "product_type_not_available",
        "productUuid": "862a4a30-533f-57dc-94d0-dab9d59bacc5",
        "productTypeUuid": "e96a52d5-9488-5891-bf5a-ce60caec8d1f",
        "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
            

  • product_type_content_updated

    
    {
        "type": "product_type_content_updated",
        "data": {
                "uuid": "e96a52d5-9488-5891-bf5a-ce60caec8d1f",
                "title": "Fun Pass Play 3",
                "titleTranslated": "Fun Pass Play 3",
                "description": "Choose Fun Pass Play 3 to play 3 out of 18 attractions",
                "descriptionTranslated": "Choose Fun Pass Play 3 to play 3 out of 18 attractions",
                "durationDays": 0,
                "durationHours": 12,
                "durationMinutes": 0,
                "daysInAdvance": null,
                "cutOffTime": null,
                "firstAvailabilityDate": "2019-07-22",
                "isNonRefundable": true,
                "allowAdults": true,
                "minPax": 1,
                "maxPax": 60,
                "minAdultAge": 13,
                "maxAdultAge": 100,
                "hasChildPrice": true,
                "allowChildren": true,
                "minChildren": 0,
                "maxChildren": 20,
                "minChildAge": 3,
                "maxChildAge": 12,
                "allowSeniors": false,
                "minSeniors": null,
                "maxSeniors": null,
                "minSeniorAge": null,
                "maxSeniorAge": null,
                "allowInfant": false,
                "minInfantAge": null,
                "maxInfantAge": null,
                "maxGroup": null,
                "minGroup": null,
                "instantConfirmation": true,
                "nonInstantVoucher": true,
                "directAdmission": false,
                "voucherUse": "You will receive a voucher by email. It contains all the information for this activity. You will need to present this voucher.",
                "voucherUseTranslated": "You will receive a voucher by email. It contains all the information for this activity. You will need to present this voucher.",
                "voucherRedemptionAddress": "Sentosa Ticketing Counters\n- Beach Station (09:00 to 21:00)\n- Fort Siloso (10:00 to 17:30)\n- Imbiah Forecourt (09:00 to 18:00)\n- Imbiah Lookout (10:00 to 19:00)\n- Merlion Plaza (09:00 to 20:00)\n- Sentosa Boardwalk (09:00 to 17:00)\n- Sentosa Station, VivoCity, Lobby L, Level 3 (09:00 to 21:00) \n- Sentosa Merlion (10:00 to 19:30)\n- Waterfront Station (09:00 to 16:00)",
                "voucherRedemptionAddressTranslated": "Sentosa Ticketing Counters\n- Beach Station (09:00 to 21:00)\n- Fort Siloso (10:00 to 17:30)\n- Imbiah Forecourt (09:00 to 18:00)\n- Imbiah Lookout (10:00 to 19:00)\n- Merlion Plaza (09:00 to 20:00)\n- Sentosa Boardwalk (09:00 to 17:00)\n- Sentosa Station, VivoCity, Lobby L, Level 3 (09:00 to 21:00) \n- Sentosa Merlion (10:00 to 19:30)\n- Waterfront Station (09:00 to 16:00)",
                "voucherRequiresPrinting": false,
                "meetingTime": null,
                "meetingAddress": null,
                "meetingLocation": "Make your own way\nto Sentosa Ticketing Counters",
                "meetingLocationTranslated": "Make your own way\nto Sentosa Ticketing Counters",
                "cancellationPolicies": [],
                "recommendedMarkup": 6.67,
                "childRecommendedMarkup": null,
                "seniorRecommendedMarkup": null,
                "adultParityPrice": null,
                "childParityPrice": null,
                "seniorParityPrice": null,
                "adultGateRatePrice": 0,
                "childGateRatePrice": 0,
                "seniorGateRatePrice": null,
                "validity": {
                    "type": "after_issue_date",
                    "days": 90,
                    "date": null,
                    "hasBatchValidityDate": false
                },
                "timeslots": [],
                "options": {
                    "perBooking": [],
                    "perPax": []
                },
                "hasOptions": false,
                "hasFileUploadOptions": false,
                "hasPriceOptions": false,
                "links": [
                    {
                        "method": "GET",
                        "rel": "self",
                        "href": "https://api.demo.bemyguest.com.sg/v2/product-types/e96a52d5-9488-5891-bf5a-ce60caec8d1f"
                    },
                    {
                        "method": "GET",
                        "rel": "product",
                        "href": "https://api.demo.bemyguest.com.sg/v2/products/862a4a30-533f-57dc-94d0-dab9d59bacc5"
                    },
                    {
                        "method": "GET",
                        "rel": "priceLists",
                        "href": "https://api.demo.bemyguest.com.sg/v2/product-types/e96a52d5-9488-5891-bf5a-ce60caec8d1f/price-lists"
                    }
                ]
        },
        "updatedFields": [
            "minPax",
            "minChildren"
        ],
        "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
           

  • product_type_availability_updated

    
    {
        "productTypeUuid": "608a63b6-bdf7-4413-942c-7ad827d6f037",
        "dates": {
            "blackouts": {
                "0": "2019-01-22",
                "1": "2019-01-23",
                "2": "2019-03-06",
                "3": "2019-03-07"
            }
        },
        "type": "product_type_availability_updated",
        "timestamp": "2020-01-28T11:48:54+08:00",
        "signature": "056b7bc898cee89d38b92df71c0f90e3ea76dc172e1ebf3008d7fb2aff5c2365"
    }
           

  • product_type_pricing_updated

    
    {
        "type": "product_type_pricing_updated",
        "productTypeUuid": "e96a52d5-9488-5891-bf5a-ce60caec8d1f",
        "endpoint": "https://api.demo.bemyguest.com.sg/v2/product-types/e96a52d5-9488-5891-bf5a-ce60caec8d1f/price-lists",
        "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
           

  • booking_status_updated

    
     {
        "type": "booking_status_updated",
        "bookingUuid": "aae5cbca-c065-31c3-ab49-21fc53fade89"
        "previousStatus": "waiting",
        "currentStatus": "approved",
        "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
           

  • booking_data_updated

    
    {
        "type": "booking_data_updated",
        "bookingUuid": "aae5cbca-c065-31c3-ab49-21fc53fade89",
        "data": {
                "uuid": "aae5cbca-c065-31c3-ab49-21fc53fade89",
                "code": "2D5AD6G",
                "partnerReference": "Test-12345566",
                "status": "approved",
                "productTypeTitle": "National Orchid Garden E-ticket",
                "productTypeTitleTranslated": "National Orchid Garden E-ticket",
                "productTypeUuid": "f57358a6-4854-5d36-8eaf-0cecc053af59",
                "currencyCode": "SGD",
                "currencyUuid": "cd15153e-dfd1-5039-8aa3-115bec58e86e",
                "totalAmount": 2.84,
                "amountBreakdown": [
                    {
                        "name": "adult",
                        "quantity": 1,
                        "price": "2.84"
                    }
                ],
                "arrivalDate": "2019-08-12",
                "createdAt": "2019-08-11 14:18:52",
                "updatedAt": "2019-08-11 14:20:06",
                "salutation": "Mr.",
                "firstName": "Tester",
                "lastName": null,
                "email": "tester@bemyguest.com.sg",
                "phone": "+6512345678",
                "adults": 1,
                "children": 0,
                "seniors": null,
                "options": [],
                "completedAt": "2019-07-21 14:20:06",
                "cancellationRequestAt": null,
                "cancellationRequestStatus": "none",
                "cancellationStatus": null,
                "refundDate": null,
                "refundAmount": null,
                "refundTransaction": null,
                "links": [
                    {
                        "method": "GET",
                        "rel": "self",
                        "href": "https://api.demo.bemyguest.com.sg/v2/bookings/aae5cbca-c065-31c3-ab49-21fc53fade89"
                    },
                    {
                        "method": "GET",
                        "rel": "vouchers",
                        "href": "https://api.demo.bemyguest.com.sg/v2/bookings/aae5cbca-c065-31c3-ab49-21fc53fade89/vouchers"
                    },
                    {
                        "method": "GET",
                        "rel": "productType",
                        "href": "https://api.demo.bemyguest.com.sg/v2/product-types/f57358a6-4854-5d36-8eaf-0cecc053af59"
                    },
                    {
                        "method": "GET",
                        "rel": "product",
                        "href": "https://api.demo.bemyguest.com.sg/v2/products/6aca0761-c17d-56a4-87a2-adddcb987b7c"
                    }
                ]
        },
        "updatedFields": [
            "arrivalDate",
            "phone"
        ],
       "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
            

  • booking_tickets_updated

    
    { 
        "type": "booking_tickets_updated",
        "bookingUuid": "aae5cbca-c065-31c3-ab49-21fc53fade89"
        "data": [
              {
                "uuid": "45dffgg-g6h8-3f6j-6789-93b1dc90ba72",
                "generatedAt": "2019-07-22 14:19:57",
                "downloadedAt": null,
                "links": [
                    {
                        "method": "GET",
                        "rel": "download",
                        "href": "https://api.demo.bemyguest.com.sg/v2/bookings/aae5cbca-c065-31c3-ab49-21fc53fade89/download-voucher/9f5a925e-70ca5678-5566-f11f25d6c5fb"
                    },
                    {
                        "method": "GET",
                        "rel": "booking",
                        "href": "https://api.demo.bemyguest.com.sg/v2/bookings/aae5cbca-c065-31c3-ab49-21fc53fade89"
                    }
                ]
              }
        ],
       "signature": "gdfhgy786g78dfg7d7f8gdfghgfhgk6786786868",
        "timestamp": "2020-11-27T18:00:27+08:00"
    }
           

网络挂钩事件JSON响应示例


 {
    "code": 200,
    "message": "success",
    "timestamp": "2020-11-27T18:00:27+08:00"
}