Appointment Addons

📘

New Feature

This is a new feature, and may change. We'll do our best to give you a heads up if it does!

If you run into any issues, drop us a note at [email protected]

Acuity's service addons may now be used through our appointment API. Addons can add time and duration to an appointment before it is booked, so there are a couple things to consider when using them through the API:

  • picking addons which are available for a particular service
  • displaying valid slots for the service and its addons
  • displaying the total time and cost for a service and its addons
  • booking the appointment with addons

First, retrieve a full list of addons from the Acuity API from the /appointment-addons endpoint:

GET "https://acuityscheduling.com/api/v1/appointment-addons"

[
  {
    "id": 1,
    "name": "Butter Finger Cleanup",
    "duration": 15,
    "price": "15.00",
    "private": false
  },
  {
    "id": 3,
    "name": "Pirate Gear",
    "duration": 0,
    "price": "50.00",
    "private": false
  },
  {
    "id": 6,
    "name": "Full Day Build",
    "duration": 900,
    "price": "0.00",
    "private": true
  },
  ...
]

Next, fetch a list of services from /appointment-types. The addonIDs attribute should be used to filter for the addons available with a particular service:

GET "https://acuityscheduling.com/api/v1/appointment-types"
[
  {
    "id": 1,
    "name": "Small Build",
    "description": "",
    "duration": 30,
    "price": "30.00",
    "category": "Builds",
    "color": "#ADCDB8",
    "private": false,
    "type": "service",
    "classSize": null,
    "paddingAfter": 0,
    "paddingBefore": 0,
    "calendarIDs": [
      1,
      2
    ],
    "addonIDs": [
      1,
      6,
      5
    ]
  },
  ...
]

Once you have a service and some valid addons selected, the total duration and price can be calculated by adding them together. Simply add the service price together with the price of each of the selected addons, and the service duration with the duration of each addon. You can use that to display the total price and duration to clients before booking — after booking, the calculated values will be available on the appointment body.

To fetch available slots for the service and addons, use the addonIDs[] query parameter with the /availability/dates and /availability/times endpoints:

GET "https://acuityscheduling.com/api/v1/availability/dates?month=2017-02&appointmentTypeID=1&addonIDs[]=1"

[
  {
    "date": "2017-02-01"
  },
  ...
]

GET "https://acuityscheduling.com/api/v1/availability/times?date=2017-02-01&appointmentTypeID=1&addonIDs[]=1"

[
  {
    "time": "2017-02-01T09:00:00-0800",
    "slotsAvailable": 1
  },
  ...
]

Once you have a service, addons, and valid appointment slot (along with any other client details!) you should be ready to book the appointment. Simply include the list of addonIDs on the appointment body while scheduling:

POST "https://acuityscheduling.com/api/v1/appointments"

<<<
{
  "firstName": "Bob",
  "lastName": "Burger",
  "email": "[email protected]",
  "datetime": "2017-02-01T09:00:00-0800",
  "appointmentTypeID": 1,
  "addonIDs": [
    1
  ]
}

After an appointment has been booked with some addons, you'll be able to see the addonIDs in the appointment body retrieved from the /appointments and /appointments/:id endpoints.

If you have any questions on the Acuity API or run into any issues, let us know at [email protected]