CreateLease method

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

Creating the lease is the first step when creating a booking with Lease support. The partner backend verifies that the requested appointment slot is valid and 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. Then the client requests to create a booking for the lease.

If creating a lease fails due to any business logic error, the error should be populated in the response. See Booking Failure for detailed information.

Request

CreateLeaseRequest

Return value

CreateLeaseResponse

Requirements:

  • lease_id must be created by the partner backend and set in the CreateLeaseResponse.
  • lease_expiration_time must be set in the CreateLeaseResponse.
  • If the resources field is specified in the CreateLeaseRequest, then it must be set in the CreateLeaseResponse, and match the CreateLeaseRequest.
  • All other fields in the CreateLeaseResponse must be set and match the CreateLeaseRequest.

Canonical gRPC error codes

  • INVALID_ARGUMENT (invalid merchant ID, service ID, or slot time specification)
// Request to create a [ext.maps.booking.partner.v2.Lease] for a slot in the
// inventory.  The expiration time in the returned Lease may be modified by the
// backend, e.g. if the requested lease period is too long.
message CreateLeaseRequest {
  // The lease to be created with information about the appointment slot
  // (required)
  Lease lease = 1;
}

// Response for the [ext.maps.booking.partner.v2.CreateLease] RPC with the
// created [ext.maps.booking.partner.v2.Lease]
message CreateLeaseResponse {
  // The created [ext.maps.booking.partner.v2.Lease] (required)
  Lease lease = 1;

  // If creating a lease fails, this field should reflect the business logic
  // error (e.g., slot has become unavailable) and lease field is expected to be
  // unset. (required if failure occurs)
  BookingFailure booking_failure = 2;
}