/ Cases / Tourism / Bookings

A tour booking engine connected live to GetYourGuide

The site is the single source of availability: GetYourGuide checks, books and cancels in real time. Checkout with deposits, split payments, multi-leg trips and balance charged to a saved card.

/ Atitlán Experience/ 2026.03/ 5 languages · ≈135 endpoints · 39 e2e test suites

5

languages

≈135

endpoints

39

e2e test suites

/ The problem

Selling the same spots on the company's own site and on GetYourGuide without overbooking, while collecting deposits and balances in several currencies and gateways.

/ What we built

  • Certified supplier integration with GetYourGuide: availability, booking and cancellation in real time.
  • The system pushes availability changes every 10 minutes.
  • Three-step checkout: deposit or full payment, split payment, multi-leg trips, balance on a saved card.
  • A 23-route back office and a site in 5 languages.

/ How it works

  1. 01Web, GetYourGuide, AI agents or partners
  2. 02Single availability engine
  3. 03Checkout
  4. 04Tickets and operations

/ Real code

api/_gyg-shared.tsts
    // Reintento del MISMO reserve (misma salida y personas, hold vigente):
    // se devuelve el mismo hold. Cualquier diferencia es un "Booking Change"
    // y lleva reserva nueva.
    // En paralelo: el SLA de reserve es < 1 s deseado (3 s p95) y eran tres
    // consultas en fila (1.7 s en el primer self-test).
    const [sameRef, reservations] = await Promise.all([
        store.findByGygBookingReference(String(gygBookingReference)),
        store.reservationsForCapacity(tour.id, addDays(slot.date, -1), addDays(slot.date, 1)),
    ]);
    const retry = sameRef.find(r => r.status === 'offered'
        && r.gyg_offered_expires_at && Date.parse(r.gyg_offered_expires_at) > now
        && r.tour_date === slot.date && String(r.start_time).slice(0, 8) === slot.time
        && Number(r.pax_count) === pax.total);
    if (retry) {
        return send(res, { data: { reservationReference: retry.gyg_reservation_reference, reservationExpiration: gygInstant(Date.parse(String(retry.gyg_offered_expires_at))) } });
    }

    const vacancies = vacanciesFor(tour, slot.date, slot.time, reservations, { now, excludeGygBookingReference: String(gygBookingReference) });
    if (vacancies < pax.total) {
        return fail(res, 'NO_AVAILABILITY', `This activity is sold out; requested ${pax.total}; available ${vacancies}.`);
    }

    const reservationReference = `res_${randomUUID().replace(/-/g, '').slice(0, 16)}`;

■ A GetYourGuide retry returns the same hold instead of creating another, and capacity is checked against real bookings before accepting.

/ Stack

ReactCloudflare WorkersPostgresStripeRecurrentePayPalTilopayPlaywright