The examples reuse the OAuth 1.0 signing from the Quick start. Replace
{sessionId} with your session.Show the active promotion
GET /v2/{sessionId}/promotion returns the latest active public promotion for the session’s hotel, or 204 No Content when none is running. Use it to render a promotional banner, with a countdown when the promotion is a flash sale.
displayCountdown is true, and hide the banner on a 204.
Build a promo-code landing page
A promo code converts best when its landing page opens straight onto the offer it unlocks. Seed the code intocontext.promoCode when you create the session (see the Quick start), then search as usual: the results are scoped to the rates the code grants.
Confirm the code resolved by reading the session scope:
type tells you what the code is (RateCode, OfferCode, or DiscountCode), and rateIds lists the rates it unlocked. When the code does not apply, session creation can return 400 with Code: InvalidPromoCode (unknown code), InvalidPromoCodeBookingPeriod (booked outside the campaign window), or InvalidPromoCodeStayPeriod (stay dates outside the offer). Catch these codes and show a fallback explaining why the code is not valid for this stay, rather than a raw error.
Tips
- Pass the code through the URL. A campaign link like
https://book.example.com/offer?code=AUTUMN2026opens the page on the offer in one flow, with no form. - Treat a
204as “no promotion”, not an error. Hide the banner when no promotion is active. - Log every code, even unresolved ones. Marketing needs both how many guests arrived with a code and how many got a valid offer: the gap surfaces a misconfigured offer fast.
Related
Get a promotion
Full schema for the promotion endpoint.
Create a session
Seed
context.promoCode when you open the session.