Create Booking

This endpoint creates a new booking.

Important Notes

  • Requires bookings:write scope.
  • The booking notification and the reminders by email and WhatsApp are controlled by
    send_mail, send_whatsapp, send_email_reminder and send_whatsapp_reminder. All four
    default to false when omitted, so a booking created without them sends none of those four.
  • These fields can only disable a channel the company has enabled — never enable one the
    company has disabled. The company's notification settings still decide.
  • SMS reminders are not controlled by this API. They follow the company's own reminder
    settings regardless of what is sent here.
  • The creative_source is automatically set to connect.
  • company_comment is the company's internal note on the booking (free text, no length limit
    enforced by the API; the client never sees it). When the booking has service options, the
    platform appends , opciones: … to it.
  • external_reference is your own reference for the booking (an order or ticket id), with the
    online-booking site's rules: it is trimmed and accepted only when it has 1 to 128 characters
    of A-Z a-z 0-9 . _ ~ : -. A valid value is stored in company_comment (it replaces the
    company_comment of the same request); an invalid one is ignored without an error. Read it
    back from company_comment.
  • To create several bookings in one request use POST /v3/bookings/bulk (up to 50
    independent bookings).
  • The request acts as the business, as a booking made in the calendar: price, end_time,
    status_id and the send_* flags are taken as sent.
  • client instead of client_id creates the booking for the client that client identifies
    (identification_number, email or phone), found by those identifiers or created. Send one
    of the two, never both. The client is created only when the booking can be made; if the
    booking fails afterwards, retrying the same request finds that client instead of creating
    another one.
  • The answer carries links (see the Booking schema): the client's self-service URLs to confirm,
    cancel or edit the booking, pay it online, and open the company's booking site. confirm,
    cancel and edit carry the booking uuid: treat them as secrets.
  • Classes and group services (a service with a capacity, as the online booking site shows
    them): book them like any other service, one booking per attendee, on a time returned by
    GET /v3/available_slots (class slots carry capacity and bookings_count). Every booking of
    the same service, provider and time shares the capacity; when it is full the next one fails
    with 422 provider_not_available. The same answer comes when the provider already has a booking
    of another service at that time.
  • Services with sessions (has_sessions: true, a pack of sessions sold as one service) cannot
    be booked through this API yet: the request fails with 422 treatment_booking_unsupported and
    nothing is created. Book them from the web app or the online booking site.

Errors Dictionary

StatusErrorDetailDescription
400invalid_bodyexpected_objectRequest body is not a JSON object.
401unauthorizedinvalid_api_keyMissing or invalid Bearer token.
401unauthorizedapi_config_inactiveAPI access is inactive for this company.
400invalid_client—client is not an object, or it was sent together with client_id.
400missing_client_id—Neither client_id nor client was sent.
400missing_identifier—client has none of identification_number, email, phone.
403forbiddenscope_deniedAPI key lacks bookings:write scope.
422provider_not_available—The provider is busy at that time, or the class or group service is full.
422treatment_booking_unsupported—The service has sessions (has_sessions); it cannot be booked through this API.
422client_exclusive_not_found—client: exclusive clients and nothing matched.
422client_identification_mismatch—client: the identification number belongs to a client with another name.
422client_email_conflict · client_phone_conflict—client: validated email or phone that belongs to another person.
429rate_limitedburst_limit_exceededPer-minute request limit exceeded.
429rate_limiteddaily_quota_exceededDaily request quota exceeded.
502upstream_unavailableconnection_failedThe upstream service is unavailable.
502client_resolution_unavailable—client: the clients service did not answer; nothing was created.

Business errors of the bookings service arrive with their key in error and no detail (see Errors).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Request body for creating a booking. Send client_id or client, never both.

client
object

The client of the booking, found by its identifiers or created.
At least one of identification_number, email, phone is required.

date-time
required

Booking start time.

date-time

Booking end time. Calculated from start_time + service duration if not provided.

integer
required

Service ID.

integer
required

Service provider ID.

integer

Client ID. Required unless client is sent.

integer
required

Location ID.

integer

Booking status ID. Must be a non-cancelled status.

string

Booking price. Defaults to service price if not provided.

string | null

Booking notes.

string | null

Internal company note on the booking (free text). See createBooking.

string
length ≤ 128
^[A-Za-z0-9._~:-]{1,128}$

Your reference for the booking, stored in company_comment when valid (replacing the
company_comment of the same request) and ignored otherwise. See createBooking.

integer | null

Time resource ID. Required if the service requires a time resource.

boolean

Send the booking notification email to the client. false when omitted.

boolean

Send the booking notification to the client over WhatsApp. false when omitted.

boolean

Schedule the email reminder for this booking. false when omitted.

boolean

Schedule the WhatsApp reminder for this booking. false when omitted.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json