Get Booking amount from API call

Hey,
I’m using a webhook that triggers when a new appointment is made, in order to activate my automated flow. The issue i’m having is i can’t find the booking amount in the webhook data,is there a way to get this information via api ?

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Onboard to Square Appointments
Payments API Webhooks
Bookings API Overview

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Yes, you can get the booking amount information via the API but it’s not directly available in the webhook data. When a booking is created or updated, the webhook event data includes the booking ID but not the booking amount.

To get the booking amount, you can use the booking ID from the webhook data to call the RetrieveBooking endpoint of the Bookings API. This will return a Booking object that includes the version and booking data, including the service variation which you can then use to call the RetrieveCatalogObject endpoint of the Catalog API to get the price of the service.

Please note that this assumes that the price of the booking is determined by the price of the service variation and doesn’t account for any additional items or discounts that might be applied to the booking.

This answer was reviewed by @Bryan-Square.

Thanks a ton for the reply, i will try this

Unfortunately, it doesn’t return an amount because i’m using a variable pricing, any clues on that ?

The service is variably priced? :slightly_smiling_face:

Yes, on each appointment has its own price, you can think of it as a ‘quote’ rather than a regular fixed price

If that’s the case then you won’t be able to get the cost till the appointment is paid for since the appointment order ins’t available till then. :slightly_smiling_face:

@Bryan-Square Stumbled on this thread after search on Google. Do you mind elaborate on how to get the cost of the services after the appointment is paid for? What specific APIs should I look at? I’ve tried the Order, Payment and Booking APIs, but no luck so far

You weren’t able to find the appointment cost from the paid for order? The order will have the services as the items which you can use to match up with the appointment. :slight_smile:

@Bryan-Square I’m able to get the order through the Order API, but the response payload doesn’t contain a booking_id to tie it back to an appointment. Upon further inspection, I noticed the Order response does contain customer_id, which can be combined with the Order’s list of services and be used as filters for Booking API. This workaround is somewhat brittle and only works under the assumption that the customer only made 1 appointment that day. Let me know if there’s a better way to go about this, thanks Bryan

Unfortunately, there isn’t any other workarounds at this time. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slight_smile: