「保留」會暫時保留要求時段的擁有權。
合作夥伴後端會確認要求的預約時段是否有效且仍可供預訂。合作夥伴可於內部針對要求的時段建立暫時性保留,並設為在 lease_expiration_time
後自動到期。後端可修改 lease_expiration_time
;舉例來說,要求的保留時間過長時,則可從後端修改。
系統會將已建立的保留傳回用戶端,
我們的 Booking API 支援「保留」功能 (選用)。如果採用「保留」支援服務,則建立預訂的第一步是為要求的時段建立「保留」。
// Temporary lease for an inventory slot message Lease { // ID of the lease. // Not populated in CreateLeaseRequest. The value is chosen by the partner and // has to be returned in the response of CreateLease. (required) string lease_id = 1; // The appointment slot that the lease is created for. (required) Slot slot = 2; // Unique identifier for this lease, chosen by Reserve with Google. Serves as // an idempotency token for [ext.maps.booking.partner.v2.CreateLease] // requests. (required) string user_reference = 3; // Expiration time of the lease in UTC Timestamp (required) google.protobuf.Timestamp lease_expiration_time = 4; } // Reference to a [ext.maps.booking.partner.v2.Lease] that has been created via // [ext.maps.booking.partner.v2.CreateLease] message LeaseReference { // Lease ID (required) string lease_id = 1; }
與保留有關的其他資訊
保留功能為選用項目,適用於有意導入這項支援服務的合作夥伴。開始之前,請先與「動作中心」聯絡,確認是否符合使用資格。
如要支援保留,您必須導入建議的 API v2 組合;
- 此外,也必須導入 CreateLease。
- 您必須導入 CreateBooking,且其預期使用保留參考資料。合作夥伴後端會使用提供的保留參考資料進行預訂。
API v2 的需求條件也適用於保留支援;
- 此外,CreateBooking 預期使用保留參考資料。合作夥伴透過提供的保留參考資料進行預訂時會占用保留名額,導致該保留暫時無法供其他預訂使用。合作夥伴也必須使用要求訊息中的時段來確認已建立的預訂。
- NOT_FOUND 是額外的 gRPC 錯誤代碼,用於已提供保留參考資料但合作夥伴不知道該保留的 ID 時。