CreateWaitlistEntry 方法
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
客户端请求创建候位名单条目。合作伙伴后端会为所请求的商家、服务、就餐人数和用户创建候位名单条目。合作伙伴应在成功时返回候位名单条目 ID,在失败时返回业务逻辑错误(例如,出现人数超出上限或候位名单已满等情况)。应使用标准 HTTP 状态代码返回意外错误。
请求
CreateWaitlistEntryRequest
返回值
CreateWaitlistEntryResponse
// Request for a user to join the waitlist.
//
// Reserve with Google may retry REST HTTP requests if no response is
// received. If the exact same CreateWaitlistEntry is received a second time,
// then the same CreateWaitlistResponse must be returned. A second waitlist
// entry must not be created.
message CreateWaitlistEntryRequest {
// Required. Partner-provided ID for the merchant.
string merchant_id = 1;
// Required. Partner-provided ID for the service.
string service_id = 2;
// Required. The party size requested for the waitlist entry.
int32 party_size = 3;
// Required. Personal information of the user joining the waitlist.
UserInformation user_information = 4;
// A string from the user which contains any special requests or additional
// information that they would like to notify the merchant about.
// This will be populated when the user submits an additional request to
// Reserve with Google. The partner can disable this functionality at the
// service level by setting supports_additional_request to false in the
// service feed.
string additional_request = 5;
// Required. Used to differentiate retries from separate requests. If the
// exact same CreateWaitlistEntry is received a second time, (including
// idempotency_token) then the same CreateWaitlistResponse must be returned.
string idempotency_token = 6;
}
// Response for the CreateWaitlistEntry RPC with the waitlist entry ID or any
// failing business logic information.
message CreateWaitlistEntryResponse {
// Unique partner-provided ID for the newly created entry in the waitlist.
// Required if the waitlist entry was created successfully. Unique for all
// time.
string waitlist_entry_id = 1;
WaitlistBusinessLogicFailure waitlist_business_logic_failure = 2;
}
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" }
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003ePartners can create a waitlist entry for a user, specifying merchant, service, party size, and user details.\u003c/p\u003e\n"],["\u003cp\u003eThe request must include an \u003ccode\u003eidempotency_token\u003c/code\u003e to ensure that retries do not create duplicate entries.\u003c/p\u003e\n"],["\u003cp\u003eA successful response returns a unique \u003ccode\u003ewaitlist_entry_id\u003c/code\u003e generated by the partner.\u003c/p\u003e\n"],["\u003cp\u003eBusiness logic errors, such as exceeding party size limits or a full waitlist, are returned in the response.\u003c/p\u003e\n"],["\u003cp\u003eUnexpected errors are indicated using standard HTTP status codes.\u003c/p\u003e\n"]]],["The partner backend creates a waitlist entry upon receiving a `CreateWaitlistEntryRequest`, including merchant ID, service ID, party size, and user information. The partner must return a `waitlist_entry_id` for successful entries. In case of business logic errors (e.g., party size exceeds limit), the partner must provide the respective error, and use standard HTTP status codes for unexpected issues. An `idempotency_token` in the request helps handle retries, ensuring the same response for identical requests.\n"],null,["# CreateWaitlistEntry method\n\nThe client requests to create a waitlist entry. The partner backend makes a\nwaitlist entry for the requested merchant, service, party size and user. The\npartner should return the waitlist entry ID upon success, or business logic\nerror (e.g. if the party size is above the maximum allowed, or if the waitlist\nis full, etc.) upon failure. Unexpected error should be returned using\nstandard\n[HTTP status codes](/actions-center/verticals/reservations/waitlists/reference/booking-server-api-rest/e2e-methods/status-codes).\n\n**Request**\n\nCreateWaitlistEntryRequest\n\n**Return value**\n\nCreateWaitlistEntryResponse \n\n```scilab\n// Request for a user to join the waitlist.\n//\n// Reserve with Google may retry REST HTTP requests if no response is\n// received. If the exact same CreateWaitlistEntry is received a second time,\n// then the same CreateWaitlistResponse must be returned. A second waitlist\n// entry must not be created.\nmessage CreateWaitlistEntryRequest {\n // Required. Partner-provided ID for the merchant.\n string merchant_id = 1;\n\n // Required. Partner-provided ID for the service.\n string service_id = 2;\n\n // Required. The party size requested for the waitlist entry.\n int32 party_size = 3;\n\n // Required. Personal information of the user joining the waitlist.\n UserInformation user_information = 4;\n\n // A string from the user which contains any special requests or additional\n // information that they would like to notify the merchant about.\n // This will be populated when the user submits an additional request to\n // Reserve with Google. The partner can disable this functionality at the\n // service level by setting supports_additional_request to false in the\n // service feed.\n string additional_request = 5;\n\n // Required. Used to differentiate retries from separate requests. If the\n // exact same CreateWaitlistEntry is received a second time, (including\n // idempotency_token) then the same CreateWaitlistResponse must be returned.\n string idempotency_token = 6;\n}\n\n// Response for the CreateWaitlistEntry RPC with the waitlist entry ID or any\n// failing business logic information.\nmessage CreateWaitlistEntryResponse {\n // Unique partner-provided ID for the newly created entry in the waitlist.\n // Required if the waitlist entry was created successfully. Unique for all\n // time.\n string waitlist_entry_id = 1;\n WaitlistBusinessLogicFailure waitlist_business_logic_failure = 2;\n}\n```\n\nCreateWaitlistEntry samples\n---------------------------\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```"]]