action squareup_search_availability { label: "SearchAvailability" description: "Searches for availabilities for booking." provider: squareup method: POST path: "/v2/bookings/availability/search" encoding: json input: { type: "object" required: ["query"] properties: { query: { type: "object" description: "Query conditions to search for availabilities of bookings." required: ["filter"] properties: { filter: { type: "object" description: "A query filter to search for availabilities by." required: ["start_at_range"] properties: { booking_id: { type: "string" description: "The query expression to search for availabilities for an existing booking by matching the specified `booking_id` value.\nThis is commonly used to reschedule an appointment.\nIf this expression is specified, the `location_id` and `segment_filters` expressions are not allowed." } location_id: { type: "string" description: "The query expression to search for availabilities matching the specified seller location IDs.\nThis query expression is not applicable when `booking_id` is present." } segment_filters: { type: "array" description: "The list of segment filters to apply. A query with `n` segment filters returns availabilities with `n` segments per\navailability. It is not applicable when `booking_id` is present." items: { type: "object" description: "A query filter to search for appointment segments by." required: ["service_variation_id"] properties: { service_variation_id: { type: "string" description: "The ID of the [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogItemVariation) representing the service booked in this segment." } team_member_id_filter: { type: "object" description: "A filter to select resources based on an exact field value. For any given\nvalue, the value can only be in one property. Depending on the field, either\nall properties can be set or only a subset will be available.\n\nRefer to the documentation of the field." properties: { all: { type: "array" description: "A list of terms that must be present on the field of the resource." items: { type: "string" } } any: { type: "array" description: "A list of terms where at least one of them must be present on the\nfield of the resource." items: { type: "string" } } none: { type: "array" description: "A list of terms that must not be present on the field the resource" items: { type: "string" } } } } } } } start_at_range: { type: "object" description: "Represents a generic time range. The start and end values are\nrepresented in RFC 3339 format. Time ranges are customized to be\ninclusive or exclusive based on the needs of a particular endpoint.\nRefer to the relevant endpoint-specific documentation to determine\nhow time ranges are handled." properties: { end_at: { type: "string" description: "A datetime value in RFC 3339 format indicating when the time range\nends." } start_at: { type: "string" description: "A datetime value in RFC 3339 format indicating when the time range\nstarts." } } } } } } } } } output: { type: "object" properties: { availabilities: { type: "array" description: "List of slots available for booking." items: { type: "object" description: "Describes a slot available for booking, encapsulating appointment segments, the location and starting time." properties: { appointment_segments: { type: "array" description: "The list of appointment segments available for booking" items: { type: "object" description: "Defines an appointment segment of a booking." required: ["duration_minutes", "service_variation_id", "team_member_id", "service_variation_version"] properties: { duration_minutes: { type: "integer" description: "The time span in minutes of an appointment segment." } service_variation_id: { type: "string" description: "The ID of the [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogItemVariation) object representing the service booked in this segment." } service_variation_version: { type: "integer" format: "int64" description: "The current version of the item variation representing the service booked in this segment." } team_member_id: { type: "string" description: "The ID of the [TeamMember](https://developer.squareup.com/reference/square_2021-08-18/objects/TeamMember) object representing the team member booked in this segment." } } } } location_id: { type: "string" description: "The ID of the location available for booking." } start_at: { type: "string" description: "The RFC 3339 timestamp specifying the beginning time of the slot available for booking." } } } } errors: { type: "array" description: "Any errors that occurred during the request." items: { type: "object" description: "Represents an error encountered during a request to the Connect API.\n\nSee [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information." required: ["category", "code"] properties: { category: { type: "string" description: "The high-level category for the error." } code: { type: "string" description: "The specific code of the error." } detail: { type: "string" description: "A human-readable description of the error for debugging purposes." } field: { type: "string" description: "The name of the field provided in the original request (if any) that\nthe error pertains to." } } } } } } }