Stay organized with collections
Save and categorize content based on your preferences.
Creating the lease is the first step when booking an appointment. The partner
backend verifies that the requested appointment slot is valid and still
available. Internally, the partner creates a temporary hold for the requested
slot, which is set up to expire automatically at lease_expiration_time. The
backend is allowed to modify lease_expiration_time, e.g. if the requested
lease time is excessively long. The created lease is returned to the client.
// Temporary lease for an inventory slotmessageLease{// ID of the lease. Ignored when creating a lease.stringlease_id=1;// ID of the merchant for the slotstringmerchant_id=2;// ID of the merchant servicestringservice_id=3;// Start time of the appointment slotgoogle.protobuf.Timestampstart_time=4;// Duration of the appointment slotgoogle.protobuf.Durationduration=5;// Opaque tag that identifies the availability slot and matches the value// provided in the availability feed.stringavailability_tag=8;// The set of resources that disambiguates the appointment slot, e.g. by// indicating the staff member and room selected by the user.Resourcesresources=9;// Unique identifier for this lease, chosen by the client. Serves as an// idempotency token for [ext.maps.booking.partner.v0.CreateLease] requests.stringclient_reference=6;// Expiration time of the leasegoogle.protobuf.Timestamplease_expiration_time=7;}// Reference to a [ext.maps.booking.partner.v0.Lease] that has been created via// [ext.maps.booking.partner.v0.CreateLease]messageLeaseReference{// Lease IDstringlease_id=1;}
[null,null,["Last updated 2025-05-20 UTC."],[[["\u003cp\u003eLeases are optional in v2 and primarily used for creating temporary holds on appointment slots before booking.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLease\u003c/code\u003e message contains information like merchant and service IDs, appointment details, resources, and an expiration time managed by the partner backend.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLeaseReference\u003c/code\u003e allows referencing a previously created \u003ccode\u003eLease\u003c/code\u003e using its unique ID.\u003c/p\u003e\n"],["\u003cp\u003ePartners verify slot availability and create a temporary hold using \u003ccode\u003eCreateLease\u003c/code\u003e, returning the \u003ccode\u003eLease\u003c/code\u003e to the client.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eclient_reference\u003c/code\u003e serves as an idempotency token for \u003ccode\u003eCreateLease\u003c/code\u003e requests ensuring unique lease creation.\u003c/p\u003e\n"]]],["When booking an appointment, a lease is created to temporarily hold the requested slot. The partner verifies the slot's availability and sets an automatic expiration (`lease_expiration_time`). This lease includes a unique `lease_id`, `merchant_id`, `service_id`, `start_time`, `duration`, `availability_tag`, and associated `resources`. The client provides a `client_reference` for idempotency. The backend can adjust the `lease_expiration_time`. The created lease or a `leaseReference` with the `lease_id` is returned. Leases are optional in v2 of the API.\n"],null,["# Lease specification\n\n| **Note:** Leases are optional in v2 of the API and we recommend using CheckAvailabilty instead.\n\nCreating the lease is the first step when booking an appointment. The partner\nbackend verifies that the requested appointment slot is valid and still\navailable. Internally, the partner creates a temporary hold for the requested\nslot, which is set up to expire automatically at `lease_expiration_time`. The\nbackend is allowed to modify `lease_expiration_time`, e.g. if the requested\nlease time is excessively long. The created lease is returned to the client. \n\n```scilab\n// Temporary lease for an inventory slot\nmessage Lease {\n // ID of the lease. Ignored when creating a lease.\n string lease_id = 1;\n\n // ID of the merchant for the slot\n string merchant_id = 2;\n\n // ID of the merchant service\n string service_id = 3;\n\n // Start time of the appointment slot\n google.protobuf.Timestamp start_time = 4;\n\n // Duration of the appointment slot\n google.protobuf.Duration duration = 5;\n\n // Opaque tag that identifies the availability slot and matches the value\n // provided in the availability feed.\n string availability_tag = 8;\n\n // The set of resources that disambiguates the appointment slot, e.g. by\n // indicating the staff member and room selected by the user.\n Resources resources = 9;\n\n // Unique identifier for this lease, chosen by the client. Serves as an\n // idempotency token for [ext.maps.booking.partner.v0.CreateLease] requests.\n string client_reference = 6;\n\n // Expiration time of the lease\n google.protobuf.Timestamp lease_expiration_time = 7;\n}\n\n// Reference to a [ext.maps.booking.partner.v0.Lease] that has been created via\n// [ext.maps.booking.partner.v0.CreateLease]\nmessage LeaseReference {\n // Lease ID\n string lease_id = 1;\n}\n```"]]