Beispiel für eine Wartelistennutzlast
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
BatchGetWaitEstimates
In diesem Beispiel wird ein Fall veranschaulicht, in dem ein Restaurant normalerweise party_size
-Werte von 2 bis 10 zulässt, zum Zeitpunkt der Anfrage aber keine party_size
-Werte über 7 mehr berücksichtigt werden können (z. B. kurz vor Geschäftsschluss) und bei einem party_size
-Wert von 2 tatsächlich keine Wartezeit besteht.
Warteanfrage abrufen
{
"merchant_id": "dining-1",
"party_size": [2, 3, 4, 5, 6, 7, 8, 9, 10],
"service_id": "reservation"
}
Warteantwort abrufen
{
"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
Anfrage erstellen
{
"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"
}
}
Antwort erstellen
{ "waitlist_entry_id": "MYS-1668739060" }
GetWaitlistEntry
Anfrage abrufen
{ "waitlist_entry_id": "MYS-1668739060" }
Antwort erhalten
{
"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
Anforderung löschen
{ "waitlist_entry_id": "MYS-1668739060" }
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\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```"]]