Use Cases
This section provides a step-by-step guide to the currently supported use cases for the Partner API.
Retrieving and Booking a Voucher
This use case demonstrates how to retrieve a voucher, check its booking status, and create a new booking.
1. Retrieve a Voucher
First, you need to retrieve the voucher details using the "Retrieves a voucher certificate" endpoint.
This is done by making a GET request to /api/v1/voucher-certificates/{referenceNumber} , where {referenceNumber} is the unique reference number of the voucher.
Depending on the voucher, this may be a 8 character alfanumeric code, such as 'ABCD1234', or a numeric code such as 1234567 (for our 'legacy' voucher codes).
2. Check the Booking Status
Once you have retrieved the voucher, you can check if it has an existing booking by examining the isBooked field in the response. If it's booked, the field bookingInfo will contain additional optional information related to the booking (such as date, time, notes or booking reference)
3. Create a Booking
If the voucher is not already booked, you can create a new booking by making a POST request to the "Create a booking" endpoint /api/v1/voucher-certificates/{referenceNumber}/booking endpoint. The request body should contain the booking details, such as the date, time, and any relevant notes, although none of these are mandatory. Please refer to the OpenAPI specification for the exact payload structure.
Upon successful creation of the booking, the API will return the updated voucher details, including the new booking information in the bookingInfo field.