Skip to main content

Create booking

Method POST

https://my.easyweek.io/api/public/v2/bookings

Description: This endpoint is used for creating a new booking at a specified location and service. It sets up an appointment for a customer, optionally with a chosen staff member, and captures essential details such as customer contact information and booking notes.

Example Request

curl -i -X POST \
https://my.easyweek.io/api/public/v2/bookings \
-H 'Authorization: Bearer <YOUR_SECRET>' \
-H 'Workspace: <YOUR_WORKSPACE>'

Request body

{
"staffer_uuid": "eac5a506-69c0-40c4-8758-85c501d26bcb",
"reserved_on": "2023-12-21T10:00:00Z",
"location_uuid": "123b2980-3506-4f8c-abce-97e1ab653406",
"service_uuid": "43537759-435b-4871-bf11-e3ace6a4464b",
"customer_phone": "+491621234567",
"customer_first_name": "Name",
"customer_last_name": "",
"customer_middle_name": "",
"customer_email": "user@example.com",
"booking_comment": "Hello world",
"source": "instagram",
"timezone": "Europe/Berlin",
"customer_browser_tz": "Europe/Berlin",
"customer_browser_language": "en",
"booking_callback": false,
"booking_google_meet_guest_emails": "test1@mail.com, test2@mail.com"
}

Body Parameters

  • location_uuid (string, required): The unique identifier of the location where the service is to be booked.
  • service_uuid (string, required): The UUID of the service being booked.
  • reserved_on (string, required): The date and time when the service is to be reserved, in ISO 8601 format.
  • customer_phone (string, required): The phone number of the customer making the booking.
  • customer_first_name (string, required): The first name of the customer.
  • customer_email (string, optional): The email address of the customer.
  • staffer_uuid (string, optional): The UUID of the staff member with whom the booking is to be made. Bookings can only be created with staff members who are marked as active in the booking widget. If this parameter is not specified, the booking will be automatically assigned to one of the available active staff members in the widget.
  • customer_last_name (string, optional): The last name of the customer.
  • customer_middle_name (string, optional): The middle name of the customer.
  • booking_comment (string, optional): Any notes or special instructions associated with the booking.
  • source (string, optional): The source from where the booking was made, such as a social media platform. If the source parameter is provided incorrectly or is empty, the system will automatically record it as unknown.
  • timezone (string, optional): The timezone in which the booking is made, used for time calculation.
  • customer_browser_tz (string, optional): The timezone of the customer's browser, useful for user experience customization.
  • customer_browser_language (string, optional): The preferred language of the customer's browser.
  • booking_callback (string, optional): A boolean flag indicating whether a callback is required for the booking.
  • booking_google_meet_guest_emails (string, optional): A list of guest email addresses for a Google Meet booking. This option is available only if the integration with Google Meet is enabled.

The designation of certain fields as optional or required may vary according to booking configurations. To set or verify the requirement status of these fields, navigate to Settings -> Administration -> Form Builder within the platform interface.

This endpoint captures the booking details submitted by the client and schedules the service accordingly. The response will confirm the successful creation of the booking and provide any relevant details or identification numbers associated with the booking.

Example Response

{
"uuid": "f017724b-d95a-4267-8704-df99a9edaf56",
"location_uuid": "123b2980-3506-4f8c-abce-97e1ab653406",
"start_time": "2023-12-21T10:00:00Z",
"end_time": "2023-12-21T10:30:00Z",
"timezone": "Europe/Berlin",
"duration": {
"value": 30,
"label": "minutes",
"iso_8601": "PT30M"
},
"quantity": 1,
"slots_count": 1,
"cancel_reason": null,
"canceled_by": null,
"is_canceled": false,
"is_completed": false,
"public_notes": "Hello world",
"currency": "EUR",
"policy": {
"policy_text": null,
"is_cancelable": true,
"cancellation_offset": 0,
"cancellation_text": null,
"is_changeable": true,
"change_offset": 0,
"change_text": null
},
"links": [
{
"type": "ical",
"link": "https://my.easyweek.io/api/notifications/bookings/6929741/icalendar"
},
{
"type": "google_meet",
"link": ""
},
{
"type": "zoom",
"link": ""
},
{
"type": "microsoft_teams",
"link": ""
}
],
"order": {
"tax": [],
"subtotal": 10000,
"subtotal_formatted": "€100.00",
"amount_paid": 0,
"amount_paid_formatted": "€0.00",
"total": 10000,
"total_formatted": "€100.00"
},
"ordered_services": [
{
"uuid": "ce889d66-dbf5-462f-bf67-a0dec4a48941",
"timezone": "Europe/Berlin",
"reserved_on": "2023-12-21T10:00:00Z",
"reserved_until": "2023-12-21T10:30:00Z",
"quantity": 1,
"name": "Beard trim",
"currency": "EUR",
"price": 10000,
"price_formatted": "€100.00",
"discount": 0,
"discount_formatted": "€0.00",
"original_price": 10000,
"original_price_formatted": "€100.00",
"tax_name": null,
"tax_value": null,
"duration": {
"value": 30,
"label": "minutes",
"iso_8601": "PT30M"
},
"original_duration": {
"value": 30,
"label": "minutes",
"iso_8601": "PT30M"
}
}
]
}
info

ISO 8601 is a set of standardized date and time formats in an attempt to tame every programmer's favorite challenge. Durations represent the amount of time between two dates or times.