Bookings
Bookings made through the API follow the owner portal’s rules: the same checks for working hours, team leave and clashes, no online-only offers and no deposit. Each one records the app that made it in app_id. Home services can’t be booked or moved through the API in v1.
GET /bookings lists one customer’s bookings with customer, as in GET /bookings?customer=123.
Tiers and starting prices
Section titled “Tiers and starting prices”Every service has a pricing_type:
fixed: the service’spriceis what it costs.variable: it’s sold in tiers, such as hair length, listed in the service’stiers. Send the one the customer wants astier_idon the line, or the booking is refused withBOOKING_PRICING_OPTION_REQUIRED. A tier sets the line’s price and length.starting_from:priceis where it starts. The line is booked at that price withprice_is_fromtrue, and the business confirms the final price later.
A tier_id on a service that isn’t sold in tiers is refused with BOOKING_INVALID_PRICING_OPTION.
Retries never double-book
Section titled “Retries never double-book”Send an Idempotency-Key header on POST /bookings. A retry with the same key and body returns the first booking with 200. The same key with a different body answers 422 idempotency_key_reused.
Changing a booking
Section titled “Changing a booking”PATCH /bookings/{booking_id} takes only what changes: date, items, notes or special_requests. items is the booking’s whole list of services after the edit:
- Send a line with its
idto keep it. It keeps its price, tier, add-ons, length and session pack, even when you move its time or team member. - Give a kept line another
service_idand it is priced from today’s menu, and its add-ons are dropped. Send atier_idto change a kept line’s tier. - A change that would bring the booking below what the customer has paid is refused with
BOOKING_SERVICE_CHANGE_BELOW_PAID, orBOOKING_SERVICE_REMOVE_BELOW_PAIDwhen a line is left out. - A line without an
idis new and is priced from today’s menu. - A stored line you leave out is removed.
- Every edit that sends
itemsgives the lines new ids, so read them from the answer.
Every booking carries a version, also sent as the ETag header. Send it as If-Match and the edit is refused with 412 booking_changed when someone changed the booking after you read it, so you never overwrite a change you haven’t seen. If-Match also takes a list of versions, and * for any.
Notes change in any state, as the business’s own note does. Everything else changes only while the booking is booked and not yet checked out. A cancelled, completed or no-show booking refuses it with BOOKING_NOT_EDITABLE, and a checked-out one with BOOKING_ALREADY_CHECKED_OUT.
curl -s -X PATCH https://api.razza.sa/v1/bookings/BK-000123 \-H "Authorization: Bearer $ACCESS_TOKEN" \-H 'If-Match: "3f1c9b0e2d7a4c58a1e6f0b9d2c4e7a1"' \-H "Content-Type: application/json" \-d '{"items": [{"id": "981", "service_id": "52", "team_member_id": "7", "start_time": "15:30"}]}'Cancelling
Section titled “Cancelling”POST /bookings/{booking_id}/cancel cancels under the business’s cancellation policy. Send "cancelled_by": "business" when the business cancels, so the customer is refunded as the policy says for that case. Money razza can’t return by itself, such as cash, comes back in hand_backs for the business to return.