CMT Sites Documentation

Booking API Reference

Last modified with commit 4551e16 on by Martin Jagodic.

The Booking API (Azure Functions) handles all dynamic booking operations including cart management, checkout, payment processing, and order placement.

For static program catalog data (build-time only), see the Programs Index API.

Overview

The Booking API provides endpoints for:

All endpoints require programId (and often bookingId or serviceId) to operate on specific program bookings.

Base URLs

Authentication

All endpoints are configured with anonymous access (auth_level=ANONYMOUS). If an external gateway enforces auth, that is outside this codebase.

Content Type

Response Envelope

Most endpoints return:

{
  "success": true,
  "data": <payload>
}

On error (500):

{
  "success": false,
  "error": "<message>"
}

Notes:

Endpoint Index

MethodPathPurpose
GET/keep-warmHealth keep-warm ping
GET/sync-allForce cache sync
GET/packagesList available packages
GET/productsGet cached products for a program element
GET/accommodationGet cached accommodation + units
GET/cross-saleGet cached cross-sale products
DELETE/cartEmpty cart in Salesforce
POST/cart/mainAdd main service to cart
POST/cart/cross-saleAdd cross-sale service to cart
DELETE/cart/cross-saleRemove cross-sale service from cart
GET/checkoutProceed to checkout (fees, totals)
POST/couponAdd coupon
DELETE/couponRemove coupon
POST/orderPlace order + handle payment

Endpoints

GET /keep-warm

Returns a successful response with an empty array.

Response data:

GET /sync-all

Forces cache refresh of active programs.

Response:

GET /packages

Lists packages for a program and date range. Proxies to Salesforce checkavailability.

Query parameters:

Response data:

GET /products

Returns cached products for a program element.

Query parameters:

Response data:

GET /accommodation

Returns cached accommodation details plus computed units for the date range.

Query parameters:

Response data:

GET /cross-sale

Returns cached cross-sale products for a program element and package.

Query parameters:

Response data:

DELETE /cart

Empties the cart in Salesforce for a booking.

Query parameters:

Response data:

POST /cart/main

Adds a main service to the cart.

Request body:

Response data:

POST /cart/cross-sale

Adds a cross-sale service to the cart.

Request body:

Response data:

DELETE /cart/cross-sale

Removes a cross-sale service from the cart.

Query parameters:

Response data:

GET /checkout

Proceeds to checkout and returns totals, fees, installments, and coupons.

Query parameters:

Response data:

POST /coupon

Adds a coupon to the booking.

Request body:

Response data:

DELETE /coupon

Removes a coupon from the booking.

Query parameters:

Response data:

POST /order

Places an order and handles payment initialization or finalization. When paymentMethod is not Bank transfer, this flow may return a payment URL for the next step.

Request body:

Response data (one of):

Known Gaps

Some field types and allowed enum values are defined by upstream Salesforce or Saferpay APIs and are not validated in this app. If you need strict schemas, confirm the upstream contracts for retdata shapes and supported paymentMethod or cardType values.