Book a Package

Search, check availability, prebook, and pay.

The flow: find a package, price it, prebook, pay. Searching and pricing (steps 1-2) work with a test key. Creating the booking (steps 3-5) needs a live key.

1. Find a package

curl "https://services.vacayou.com/api/partner/v1/packages?title=wellness" \
  -H "Authorization: Bearer sk_test_..."
{
  "data": [
    { "id": 301, "title": "Wellness Retreat Package", "properties": [{ "id": 17, "name": "Lakeview Resort" }] }
  ]
}

Note the package id and a property id.

2. Check availability

Price the stay for a property. Pass a property_id and the response includes the availability_id of the room to book:

curl -X POST "https://services.vacayou.com/api/partner/v1/packages/301/availability" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "check_in": "2026-09-10", "check_out": "2026-09-13", "adults": 2, "property_id": 17 }'
{ "data": { "available": true, "total_price_cents": 420000, "currency": "USD", "availability_id": 90211 } }

Keep the availability_id.

3. Get a prebook token

Call availability again with mode: "prebook" and your selection, including the availability_id from step 2. You get a single-use prebook_token:

curl -X POST "https://services.vacayou.com/api/partner/v1/packages/301/availability" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "check_in": "2026-09-10", "check_out": "2026-09-13", "adults": 2,
    "property_id": 17, "mode": "prebook",
    "items": [{ "availability_id": 90211, "paxes": [{ "age": 34 }, { "age": 32 }] }]
  }'
{ "data": { "available": true, "prebook_token": "tok_abc123xyz", "expires_at": "2026-09-01T14:10:00Z" } }

Use the token before it expires.

4. Prebook

Hold the booking with the token and the traveler's details. Send the same property_id (as inventory_item_id) and the same items you used to mint the token — the token is bound to that exact selection, so any difference is rejected.

curl -X POST "https://services.vacayou.com/api/partner/v1/bookings/prebook" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "package_id": 301,
    "inventory_item_id": 17,
    "prebook_token": "tok_abc123xyz",
    "check_in": "2026-09-10", "check_out": "2026-09-13",
    "holder": { "name": "Jane", "surname": "Doe", "email": "[email protected]" },
    "items": [{ "availability_id": 90211, "paxes": [{ "age": 34 }, { "age": 32 }] }]
  }'

One pax entry per guest, matching the occupancy you priced. The traveler's lead name comes from holder.

{ "success": "Created!", "id": 7002, "status": "Pending" }

Keep the booking id.

5. Book and pay

Pay with a Stripe payment method token (pm_...). Raw card numbers are rejected, tokenize with Stripe first. You never send an amount; it's the prebooked total.

curl -X POST "https://services.vacayou.com/api/partner/v1/bookings/7002/book" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "payment_method_id": "pm_1AbCdEf...", "client_reference": "MY-ORDER-001" }'
{ "success": "OK!", "id": 7002, "status": "success", "booking_reference": "FHLC7V4H9M" }

The charge is authorized now and captured after the supplier confirms.

If the card needs 3-D Secure, you get a 402 with a client_secret:

{ "error": "payment_requires_action", "payment_intent_id": "pi_3Nxyz...", "client_secret": "pi_..._secret_abc" }

Complete it on your frontend with Stripe.js, then call book again with the payment_intent_id instead of payment_method_id.

6. Check the booking

Supplier confirmation can finish asynchronously. Poll for the final state and reference:

curl "https://services.vacayou.com/api/partner/v1/bookings/7002" \
  -H "Authorization: Bearer sk_live_..."
{ "data": { "id": 7002, "status": "Paid", "booking_reference": "FHLC7V4H9M" } }

Testing payments

If your organization is in test mode, use Stripe's test payment methods to run the flow without a real charge:

TokenResult
pm_card_visaSucceeds
pm_card_visa_chargeDeclinedDeclined (402)
pm_card_threeDSecure2Required3-D Secure (402)

Contact TripFusion support to enable test mode for your organization.


Did this page help you?