1. Bookings
YGO Client API
v1
  • v2
  • v1
  • Default Module
    • Overview
    • Core Concepts
    • Authentication
    • Quickstart Guide
    • AI Search & Trip Planning
    • Booking Flow
    • Environments
    • General
      • Check API health status
      • Get current API key context
    • AI Search & Trip Planning
      • Send message to YGO AI
    • Product Search (Deprecated)
      • Search for hotel & package offers
      • Get transfers for booking
      • Get package price calendar
    • Bookings
      • Get or create open booking
        POST
      • Check offer availability
        POST
      • Update open booking
        POST
      • Update booking status and trigger workflows
        POST
      • List bookings
        POST
      • Get booking
        POST
    • Schemas
      • Schemas
        • PackageSearchRequest
        • GetPackageCalendarRequest
        • GetBookingRequest
        • ListBookingsRequest
        • SaveBookingStatusRequest
        • SaveOpenBookingRequest
        • GetOpenBookingRequest
        • GetTransfersRequest
        • Product
        • Booking
        • TransferOptionsResponse
        • PackageCalendarResponse
        • ProductTexts
        • BookingDetails
        • TripReference
        • TransferOption
        • PackageCalendarDate
        • LocaleContent
        • BookingItemInput
        • Trip
        • ProductImage
        • TransferImage
        • BookingItem
        • Traveller
        • PickupInformation
        • ProductDetails
        • PackageOffer
        • PickupLocation
        • Image
        • Pickup
        • TourOperator
        • CheckPickup
        • Accommodation
        • TransferRemark
        • Room
        • CancellationPolicy
        • Transport
        • Flight
        • Airport
        • Price
        • PriceByPax
        • SuccessResponse
        • ErrorResponse
        • Hotel
        • HotelFeatures
        • FeatureState
        • RoomFeatures
        • RoomContent
        • Facility
      • Response
        • Unauthorized
  1. Bookings

Get or create open booking

POST
/getOpenBooking
Retrieve the current open booking (shopping cart) for a main trip product (see it as an "anchor") and user, or automatically create a new one if none exists. The ProductID must reference a main trip product which is either a hotel-only, hotel+flight package, or pre-bundled trip. Additional items like activities and transfers can be added to this booking later in a shopping cart fashion. This endpoint provides idempotent behavior - calling it multiple times with the same ProductID and UserID returns the same booking. If multiple open bookings are found for a user-product combination (edge case), the system logs a warning and returns the first one. The returned booking object includes complete trip details, traveler information, contact data, items, pricing, and payment status. This endpoint is essential for implementing persistent shopping cart functionality across user sessions. The UserID parameter identifies the end customer.

Request

Authorization
or
Body Params application/json

Examples

Responses

🟢200OK
application/json
Successfully retrieved or created open booking for the product
Bodyapplication/json

🟠400Bad Request
🟠401Unauthorized
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://api.ygo.ai/v1/getOpenBooking' \
--header 'Content-Type: application/json' \
--data '{
    "ProductID": 12345,
    "UserID": "user_abc123xyz"
}'
Response Response Example
200 - Hotel-only booking with basic trip details
{
    "Data": {
        "ID": "A1B2C3D4",
        "UserID": "user_abc123xyz",
        "ProductID": 12345,
        "Status": "open",
        "Details": {
            "Trip": {
                "ProductID": 12345,
                "Name": "Hotel Arts Barcelona - 7 Nights",
                "Description": "Luxurious 5-star beachfront hotel in Barcelona with stunning Mediterranean views",
                "Images": [
                    {
                        "URL": "https://cdn.ygo.ai/hotels/12345/main.jpg",
                        "Width": 1920,
                        "Height": 1080,
                        "Type": "main"
                    },
                    {
                        "URL": "https://cdn.ygo.ai/hotels/12345/pool.jpg",
                        "Width": 1920,
                        "Height": 1080,
                        "Type": "gallery"
                    }
                ],
                "StartDate": "2025-11-15",
                "EndDate": "2025-11-22",
                "City": "Barcelona",
                "Country": "Spain",
                "CountryCode": "ES",
                "Latitude": 41.3851,
                "Longitude": 2.1734
            },
            "Items": [],
            "Travellers": [],
            "FirstName": "",
            "LastName": "",
            "Email": "",
            "Phone": "",
            "Street": "",
            "ZipCode": "",
            "City": "",
            "CountryCode": "",
            "TotalPrice": {
                "Amount": 1850,
                "Currency": "EUR"
            },
            "Locale": "en",
            "IsRobot": false,
            "Shop": "ygotrips",
            "Host": "ygo.ai"
        },
        "CreatedAt": "2025-10-15T14:30:00Z",
        "UpdatedAt": "2025-10-15T14:30:00Z"
    },
    "Error": null
}
Modified at 2025-10-17 15:39:54
Previous
Get package price calendar
Next
Check offer availability
Built with