候补名单载荷示例
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
BatchGetWaitEstimates
以下示例说明了以下情况:一家餐厅通常允许 party_size
值介于 2 到 10 之间,但在请求时,party_size
值高于 7 时无法再容纳(例如接近打烊时间),而 party_size
值为 2 时实际上无需等待。
获取等待请求
{
"merchant_id": "dining-1",
"party_size": [2, 3, 4, 5, 6, 7, 8, 9, 10],
"service_id": "reservation"
}
获取等待响应
{
"waitlist_status": "OPEN",
"wait_estimate": [
{ "party_size": 2, "wait_length": {} },
{ "party_size": 3, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 4, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 5, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 6, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 7, "wait_length": { "parties_ahead_count": 3 } }
]
}
CreateWaitlistEntry
创建请求
{
"idempotency_token": "14620365692592881354",
"merchant_id": "dining-1",
"party_size": 3,
"service_id": "reservation",
"user_information": {
"family_name": "John",
"given_name": "Smith",
"telephone": "+81 80-1111-2222",
"user_id": "123456789"
}
}
创建响应
{ "waitlist_entry_id": "MYS-1668739060" }
GetWaitlistEntry
Get 请求
{ "waitlist_entry_id": "MYS-1668739060" }
获取响应
{
"waitlist_entry": {
"wait_estimate": {
"party_size": 3,
"wait_length": { "parties_ahead_count": 3 }
},
"waitlist_entry_state": "WAITING",
"waitlist_entry_state_times": { "created_time_seconds": 1234567890 }
}
}
DeleteWaitlistEntry
删除请求
{ "waitlist_entry_id": "MYS-1668739060" }
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eBatchGetWaitEstimates\u003c/code\u003e allows merchants to retrieve the current wait times for various party sizes for a specific service, such as reservations.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a \u003ccode\u003ewaitlist_status\u003c/code\u003e indicating if the waitlist is open and a list of \u003ccode\u003ewait_estimate\u003c/code\u003e objects detailing the estimated wait for each party size, potentially using \u003ccode\u003eparties_ahead_count\u003c/code\u003e or remaining empty for immediate seating.\u003c/p\u003e\n"],["\u003cp\u003eUsing \u003ccode\u003eCreateWaitlistEntry\u003c/code\u003e, \u003ccode\u003eGetWaitlistEntry\u003c/code\u003e, and \u003ccode\u003eDeleteWaitlistEntry\u003c/code\u003e, users can add themselves to the waitlist, check their status and estimated wait, and remove themselves from the waitlist, respectively.\u003c/p\u003e\n"],["\u003cp\u003eWait estimates can vary based on real-time availability and operational constraints, such as party size limitations near closing time.\u003c/p\u003e\n"]]],["The provided content details waitlist management for a restaurant. It begins by checking wait estimates for party sizes 2-10, revealing that parties over 7 cannot be accommodated and party size 2 has no wait. A new waitlist entry is then created for a party of 3, assigning it an ID. Retrieving that ID confirms the party is waiting with 3 parties ahead. Finally the entry is deleted.\n"],null,["# Waitlists Payload Sample\n\n### BatchGetWaitEstimates\n\n\nThis example illustrates a case where a restaurant usually allows `party_size` values\nfrom 2 to 10 but at the time of the request, `party_size` values higher than 7 can no\nlonger be accomodated (close to closing time, for example) and `party_size` of 2 has\nactually no wait. \n\n### Get wait request\n\n```scdoc\n{\n \"merchant_id\": \"dining-1\",\n \"party_size\": [2, 3, 4, 5, 6, 7, 8, 9, 10],\n \"service_id\": \"reservation\"\n}\n```\n\n### Get wait response\n\n```scdoc\n{\n \"waitlist_status\": \"OPEN\",\n \"wait_estimate\": [\n { \"party_size\": 2, \"wait_length\": {} },\n { \"party_size\": 3, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 4, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 5, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 6, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 7, \"wait_length\": { \"parties_ahead_count\": 3 } }\n ]\n}\n```\n\n### CreateWaitlistEntry\n\n### Create request\n\n```scdoc\n{\n \"idempotency_token\": \"14620365692592881354\",\n \"merchant_id\": \"dining-1\",\n \"party_size\": 3,\n \"service_id\": \"reservation\",\n \"user_information\": {\n \"family_name\": \"John\",\n \"given_name\": \"Smith\",\n \"telephone\": \"+81 80-1111-2222\",\n \"user_id\": \"123456789\"\n }\n}\n```\n\n### Create response\n\n```scdoc\n{ \"waitlist_entry_id\": \"MYS-1668739060\" }\n```\n\n### GetWaitlistEntry\n\n### Get request\n\n```scdoc\n{ \"waitlist_entry_id\": \"MYS-1668739060\" }\n```\n\n### Get response\n\n```scdoc\n{\n \"waitlist_entry\": {\n \"wait_estimate\": {\n \"party_size\": 3,\n \"wait_length\": { \"parties_ahead_count\": 3 }\n },\n \"waitlist_entry_state\": \"WAITING\",\n \"waitlist_entry_state_times\": { \"created_time_seconds\": 1234567890 }\n }\n}\n```\n\n### DeleteWaitlistEntry\n\n### Delete request\n\n```scdoc\n{ \"waitlist_entry_id\": \"MYS-1668739060\" }\n```\n\n### Delete response\n\n```text\n{}\n```"]]