- Resource: Availability
- Resources
- Recurrence
- ScheduleException
- Prepayment
- PriceInfo
- PriceRange
- DurationRequirement
- SchedulingRuleOverrides
- ConfirmationMode
- LinkoutRequiredReason
- Methods
Resource: Availability
An availability slot of the merchant's service, indicating time and number of spots.
JSON representation |
---|
{ "startTime": string, "duration": string, "spotsTotal": string, "spotsOpen": string, "availabilityTag": string, "resources": { object ( |
Fields | |
---|---|
start |
Start time of the appointment slot. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
duration |
Duration of the appointment slot A duration in seconds with up to nine fractional digits, ending with ' |
spots |
Number of total spots and open spots of this availability. Examples:
Note: If sending requests using the availability compression format defined below, these two fields will be inferred.
|
spots |
Number of open spots. |
availability |
An optional opaque string to identify this availability slot. If set, it will be included in the requests that book/update/cancel appointments. |
resources |
Optional resources used to disambiguate this availability slot from others when different staff members, or rooms are part of the service. E.g. the same Yoga class with two 2 instructors:
|
payment |
A list of ids referencing the payment options which can be used to pay for this slot. The actual payment options are defined at the Merchant level, and can also be shared among multiple Merchants. This field overrides any payment_option_ids specified in the service message. Similarly payment_option_ids specified here do NOT have to be present in the service message, though must be defined at the Merchant level. |
recurrence |
The recurrence information for the availability, representing more than one start time. A recurrence should contain appointments for one working day. |
schedule |
Times when this service cannot be scheduled. To limit the number of scheduleException messages, consider joining adjacent exceptions. |
deposit |
Optional deposit for this availability. Overrides the service deposit if one was specified. |
no |
Optional no show fee for this availability. Overrides the service no show fee if one was specified. |
prepayment |
Optional. Optional prepayment information for this availability. |
require |
Indicates whether the user must provide a credit card in order to book this availability slot. If the value is not set, it is inherited from the service level if it's set there. (optional) |
ticket |
Indicates a list of supported ticket types for this availability slot. If unset, all ticket types in the parent service are available for this slot. Note that the values of this field must be defined in the parent service. Examples:
To represent the inventory during the weekdays:
To indicate that all three ticket types are available for this time slot, use either (optional) |
duration |
The requirement to show the slots duration and/or endtime. This field will be ignored if the slot is unavailable. Not used in the Things-To-Do vertical. (optional) |
scheduling |
Availability scheduling rules. If fields are populated, they will override any corresponding scheduling rules on the service-level SchedulingRules. |
confirmation |
The confirmation mode that will be used when booking this availability. Attempts to create bookings for availabilities with a confirmation mode of CONFIRMATION_MODE_SYNCHRONOUS must be immediatlely confirmed or denied. Attempts to create bookings for availabilities with confirmation mode of CONFIRMATION_MODE_ASYNCHRONOUS must be either immediately denied or created with status PENDING. |
linkout |
Optional. The reason a linkout is required for this slot. If set, the Merchant resource for this slot must have a valid LinkoutTemplate. (optional) |
Resources
A resource is used to disambiguate availability slots from one another when different staff members, or rooms are part of the service. Multiple slots for the same service and time interval can co-exist when they have different resources.
JSON representation |
---|
{
"staffId": string,
"staffName": string,
"roomId": string,
"roomName": string,
"partySize": integer,
"roomDescription": {
object ( |
Fields | |
---|---|
staff |
Optional ID for a staff member providing the service. This field identifies the staff member across all merchants, services, and availability records. It also needs to be stable over time to allow correlation with past bookings. This field must be present if staffName is present. |
staff |
Optional name of a staff member providing the service. This field will be displayed to users making a booking, and should be human readable, as opposed to an opaque identifier. This field must be present if staffId is present. |
room |
An optional ID for the room the service is located in. This field identifies the room across all merchants, services, and availability records. It also needs to be stable over time to allow correlation with past bookings. This field must be present if roomName is present. |
room |
An optional name for the room the service is located in. This field will be displayed to users making a booking, and should be human readable, as opposed to an opaque identifier. (optional but required if roomId is present) In dining a room name should only be used for seating areas such as the bar or patio and should not be used for fixed price menus, special activities, or any other non-room value (such as reservation or dinner). It is strongly recommended that the default seating area not have a room associated with it. |
party |
Applicable only for Dining: The party size which can be accommodated during this time slot. A restaurant can be associated with multiple Slots for the same time, each specifying a different partySize, if for instance 2, 3, or 4 people can be seated with a reservation. |
room |
Optional. Localized room description. If set, a default value must be provided. It is preferred to also provide common languages for the merchant's locale. (optional) |
Recurrence
Recurrence messages are optional, but allow for a more compact representation of consistently repeating availability slots. They typically represent a day's working schedule. ScheduleException messages are then used to represent booked/unavailable time ranges within the work day.
Requirements:
- The expansion of availability slots or recurrences must NOT create identical slots. If the ids, startTime, duration, and resources match, slots are considered identical.
- Do NOT mix the standard availability format and recurrence within the slots of a single service. Recurrence benefits merchants/services that offer appointments. The standard format is geared towards merchants/services with regularly scheduled classes.
- Recurrences should not last for more than 24 hours.
JSON representation |
---|
{ "repeatUntil": string, "repeatEvery": string } |
Fields | |
---|---|
repeat |
The inclusive maximum UTC timestamp the availability repeats until. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
repeat |
Defines the time between successive availability slots. Example: An availability with a duration of 20 min, a repeatEvery of 30 min, a startTime of 9:00am, and a repeatUntil of 11:00am will yield slots at 9-9:20am, 9:30-9:50am, 10-10:20am, 10:30-10:50am, 11-11:20am. (required) A duration in seconds with up to nine fractional digits, ending with ' |
ScheduleException
ScheduleException messages represent booked/unavailable time ranges within the workday, which are exceptions to the recurrence described above. As time slots are booked, the list of exceptions should be updated to reflect the newly unavailable time ranges. The recurrence itself shouldn't be modified.
JSON representation |
---|
{
"timeRange": {
object ( |
Fields | |
---|---|
time |
The time range of the exception. Any slots described by the recurrence which overlap this closed-open time range will be considered unavailable. Example: If the recurrence specifies a duration of 20 min, a repeatEvery of 30 min, a startTime of 9:00am, and a repeatUntil of 11:00am, then a ScheduleException with a timeRange of 9:45am-11:00am would make unavailable the slots at 9:30-9:50am, 10-10:20am, and 10:30-10:50am. Note that because the time range is closed-open, the slot beginning at 11am slot would not be impacted. |
Prepayment
A payment the user may be charged as part of their reservation.
JSON representation |
---|
{
"priceInfo": {
object ( |
Fields | |
---|---|
price |
Container for price details. |
PriceInfo
Container for price details.
JSON representation |
---|
{ "priceType": enum ( |
Fields | |
---|---|
price |
Defines how price or price range is applied (per person or fixed) |
Union field price_options . Price options are to either specify an exact price or a range. price_options can be only one of the following: |
|
price |
The price of a service or a fee. |
price |
The upper and/or lower bound of a service or a fee. |
PriceRange
Wrapper for a range of monetary amount treated as unbounded unless both values are set. At least one of minAmount and maxAmount is required.
JSON representation |
---|
{ "minPrice": { object ( |
Fields | |
---|---|
min |
Minimum amount. |
max |
Maximum amount. Should always be > minPrice. |
DurationRequirement
This enum indicates what requirements exist for the user to acknowledge or view the requested slots duration/end time.
Enums | |
---|---|
DURATION_REQUIREMENT_UNSPECIFIED |
The handling of the end time is not specified. This is the default. |
DO_NOT_SHOW_DURATION |
The end time is not shown to the user. |
MUST_SHOW_DURATION |
The end time has to be shown to the user before an appointment can be made. |
SchedulingRuleOverrides
Availability level scheduling rules.
JSON representation |
---|
{ "lastBookableSec": string, "firstBookableSec": string, "lastOnlineCancellableSec": string } |
Fields | |
---|---|
last |
The last time (in seconds) that this slot is able to be booked. This timestamp must be before the startSec of the slot to be respected (if users should be able to book after the start time, use service level SchedulingRules.min_booking_before_end_time). If present, will override anything specified in the min_booking_buffer of the corresponding Service's SchedulingRules. |
first |
The first time (in seconds) that this slot is able to be booked. This timestamp must be before the startSec of the slot, or lastBookableSec if specified. |
last |
If set, the last time (in seconds since the Unix epoch) that this specific appointment slot can be cancelled through Reserve with Google. This field will override any service-level cancellation rules. (optional) |
ConfirmationMode
The confirmation modes used when booking availabilities.
Enums | |
---|---|
CONFIRMATION_MODE_UNSPECIFIED |
The confirmation mode was not specified. Synchronous confirmation will be assumed. |
CONFIRMATION_MODE_SYNCHRONOUS |
Bookings for this availability will be confirmed synchronously. |
CONFIRMATION_MODE_ASYNCHRONOUS |
Bookings for this availability will be confirmed asynchronously. |
LinkoutRequiredReason
The reason why a slot has a linkout experience.
Enums | |
---|---|
LINKOUT_REQUIRED_REASON_UNSPECIFIED |
Default value: Do not use, equates to unknown. |
PAYMENT_REQUIRED |
Slot requires payment in the partner platform to be booked. |
Methods |
|
---|---|
|
Replaces the Availability of an existing Service of a merchant managed by the specified aggregator, and returns it. |