Lease specification

A Lease temporarily holds the ownership of a requested Slot.

The partner's 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.

Our booking API provides optional support for Lease. With lease support, creating a Lease for the requested Slot is the first step when creating a Booking.

// 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;
}

Additional information about leases

Support for lease is optional. It applies to partners that are interested in implementing the support. Please contact the Actions Center to determine eligibility before you start.

To support lease, the recommended set of API v2 must be implemented; in addition,

  • CreateLease is required to be implemented.
  • CreateBooking is required to be implemented and expected to use lease reference. Partner backend makes a booking with the provided lease reference.

Requirements of API v2 also apply to support for lease; in addition,

  • CreateBooking is expected to use lease reference. When making a booking with the provided lease reference, partner consumes the lease and renders it invalid for any further bookings. Partner is also responsible for verfiying the created booking using slot in the request message.
  • As an additional gRPC error code, NOT_FOUND is used if lease ref is provided and the lease ID is unknown to the partner.
Figure: Create a Booking for a Lease