Skip to content

Square: Create Booking

Square bookings.createBooking: arguments, response, policy and SDK examples.

← Bookings operations · Get started

Operation square.createbooking

Provider route: POST /v2/bookings. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["bookings"]["createBooking"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.bookings.createBooking(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_square import SquareIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.bookings.create_booking(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Create Booking — request body — body

Referenced models: Create Booking — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create Booking — response body

Referenced models: Create Booking — response body

7 more schemas are linked from the tables above, on the schema pages.

Create Booking — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
bookingModelRequired within parentExpand Create Booking — request body — body booking
The details of the booking to be created.
idempotency_keystringOptionalA unique key to make this request an idempotent operation.
Maximum length: 255

Referenced models: Create Booking — request body — body booking

Create Booking — response body
FieldTypePresenceDescription and constraints
$objectRoot
bookingModelOptionalExpand Cancel Booking — response body — booking
The booking that was created.
errorsarrayOptionalErrors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Cancel Booking — response body — booking, Get Shift — response body — errors item

Create Booking — request body — body booking
FieldTypePresenceDescription and constraints
$objectRootRepresents a booking as a time-bound service contract for a seller's staff member to provide a specified service
at a given location to a requesting customer in one or more appointment segments.
addressJSONOptional
address (anyOf 1)ModelAlternativeExpand Create Customer — request body — body address
Stores a customer address if the location type is `CUSTOMER_LOCATION`.
address (anyOf 2)nullAlternative
all_daybooleanOptionalWhether the booking is of a full business day.
Read only: true
appointment_segmentsJSONOptional
appointment_segments (anyOf 1)arrayAlternativeA list of appointment segments for this booking.
appointment_segments (anyOf 1)[]ModelEach itemExpand Create Booking — request body — body booking appointment segments A list of appointment segments for this booking item
appointment_segments (anyOf 2)nullAlternative
created_atstringOptionalThe RFC 3339 timestamp specifying the creation time of this booking.
Read only: true
creator_detailsModelOptionalExpand Create Booking — request body — body booking creator details
Information about the booking creator.
Read only: true
customer_idJSONOptional
customer_id (anyOf 1)stringAlternativeThe ID of the [Customer](entity:Customer) object representing the customer receiving the booked service.
Maximum length: 192
customer_id (anyOf 2)nullAlternative
customer_noteJSONOptional
customer_note (anyOf 1)stringAlternativeThe free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](entity:CatalogObject) instance.
Maximum length: 4096
customer_note (anyOf 2)nullAlternative
idstringOptionalA unique ID of this object representing a booking.
Maximum length: 36
Read only: true
location_idJSONOptional
location_id (anyOf 1)stringAlternativeThe ID of the [Location](entity:Location) object representing the location where the booked service is provided. Once set when the booking is created, its value cannot be changed.
Maximum length: 32
location_id (anyOf 2)nullAlternative
location_typeJSONOptional
location_type (anyOf 1)stringAlternativeSupported types of location where service is provided.
The type of location where the booking is held.
See [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values
One of: BUSINESS_LOCATION, CUSTOMER_LOCATION, PHONE
location_type (anyOf 2)nullAlternative
seller_noteJSONOptional
seller_note (anyOf 1)stringAlternativeThe free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](entity:CatalogObject) instance.
This field should not be visible to customers.
Maximum length: 4096
seller_note (anyOf 2)nullAlternative
sourcestringOptionalSupported sources a booking was created from.
The source of the booking.
Access to this field requires seller-level permissions.
See [BookingBookingSource](#type-bookingbookingsource) for possible values
One of: FIRST_PARTY_MERCHANT, FIRST_PARTY_BUYER, THIRD_PARTY_BUYER, API
Read only: true
start_atJSONOptional
start_at (anyOf 1)stringAlternativeThe RFC 3339 timestamp specifying the starting time of this booking.
start_at (anyOf 2)nullAlternative
statusstringOptionalSupported booking statuses.
The status of the booking, describing where the booking stands with respect to the booking state machine.
See [BookingStatus](#type-bookingstatus) for possible values
One of: PENDING, CANCELLED_BY_CUSTOMER, CANCELLED_BY_SELLER, DECLINED, ACCEPTED, NO_SHOW
Read only: true
transition_time_minutesintegerOptionalAdditional time at the end of a booking.
Applications should not make this field visible to customers of a seller.
Read only: true
updated_atstringOptionalThe RFC 3339 timestamp specifying the most recent update time of this booking.
Read only: true
versionintegerOptionalThe revision number for the booking used for optimistic concurrency.

Referenced models: Create Customer — request body — body address, Create Booking — request body — body booking appointment segments A list of appointment segments for this booking item, Create Booking — request body — body booking creator details

Get Shift — response body — errors item
FieldTypePresenceDescription and constraints
$objectRootRepresents an error encountered during a request to the Connect API.

See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.
categorystringRequired within parentIndicates which high-level category of error has occurred during a
request to the Connect API.
The high-level category for the error.
See [ErrorCategory](#type-errorcategory) for possible values
Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR
codeModelRequired within parentExpand Get Shift — response body — errors item code
The specific code of the error.
See [ErrorCode](#type-errorcode) for possible values
detailstringOptionalA human-readable description of the error for debugging purposes.
fieldstringOptionalThe name of the field provided in the original request (if any) that
the error pertains to.

Referenced models: Get Shift — response body — errors item code

Create Booking — request body — body booking creator details
FieldTypePresenceDescription and constraints
$objectRootInformation about a booking creator.
creator_typestringOptionalSupported types of a booking creator.
The seller-accessible type of the creator of the booking.
See [BookingCreatorDetailsCreatorType](#type-bookingcreatordetailscreatortype) for possible values
One of: TEAM_MEMBER, CUSTOMER
Read only: true
customer_idstringOptionalThe ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type.
Access to this field requires seller-level permissions.
Maximum length: 192
Read only: true
team_member_idstringOptionalThe ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` type.
Access to this field requires seller-level permissions.
Maximum length: 32
Read only: true
Cancel Booking — response body — booking creator details
FieldTypePresenceDescription and constraints
$objectRootInformation about a booking creator.
creator_typestringOptionalSupported types of a booking creator.
The seller-accessible type of the creator of the booking.
See [BookingCreatorDetailsCreatorType](#type-bookingcreatordetailscreatortype) for possible values
Known values: TEAM_MEMBER, CUSTOMER
Read only: true
customer_idstringOptionalThe ID of the customer who created the booking, when the booking creator is of the `CUSTOMER` type.
Access to this field requires seller-level permissions.
Maximum length: 192
Read only: true
team_member_idstringOptionalThe ID of the team member who created the booking, when the booking creator is of the `TEAM_MEMBER` type.
Access to this field requires seller-level permissions.
Maximum length: 32
Read only: true
Create Location — request body — body location country
FieldTypePresenceDescription and constraints
$stringRootIndicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm).
One of: ZZ, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW

SDK function policy ID: square.createbooking. Catalog operation: CreateBooking. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["APPOINTMENTS_WRITE"]

Pinned headers: {"Square-Version": "2026-11-18"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.