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

Update open booking

POST
/v1/saveOpenBooking
Update an existing open booking (shopping cart) with modified details including traveler information, contact data, added items (activities, transfers), and pricing. The endpoint validates booking ownership, ensures the ProductID hasn't changed, cleans invalid items, validates voucher codes, and optionally performs real-time availability checks. Query parameters control availability checking behavior: checkAvailability=true validates item availability, while checkBeforePayment=true performs comprehensive pre-payment validation including price verification with the package provider. The UserID parameter identifies the end customer.

Request

Authorization
or
Query Params

Body Params application/json

Examples

Responses

🟢200OK
application/json
Successfully updated the open booking
Body

🟠400Bad Request
🟠401Unauthorized
🟠404Record Not Found
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.ygo.ai/v1/v1/saveOpenBooking?checkAvailability&checkBeforePayment' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ID": "A1B2C3D4",
    "UserID": "user_abc123xyz",
    "ProductID": 12345,
    "Status": "open",
    "Details": {
        "Trip": {
            "ProductID": 12345
        },
        "Items": [],
        "Travellers": [
            {
                "FirstName": "John",
                "LastName": "Doe",
                "DateOfBirth": "1985-03-20",
                "Age": 40,
                "Type": "adult"
            },
            {
                "FirstName": "Jane",
                "LastName": "Doe",
                "DateOfBirth": "1988-07-15",
                "Age": 37,
                "Type": "adult"
            }
        ],
        "FirstName": "John",
        "LastName": "Doe",
        "Email": "john.doe@example.com",
        "Phone": "+44 7700 900123",
        "TotalPrice": {
            "Amount": 1850,
            "Currency": "EUR"
        }
    }
}'
Response Response Example
200 - Successfully updated booking with travelers
{
    "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"
                    }
                ],
                "StartDate": "2025-11-15",
                "EndDate": "2025-11-22",
                "City": "Barcelona",
                "Country": "Spain",
                "CountryCode": "ES",
                "Latitude": 41.3851,
                "Longitude": 2.1734
            },
            "Items": [],
            "Travellers": [
                {
                    "FirstName": "John",
                    "LastName": "Doe",
                    "DateOfBirth": "1985-03-20",
                    "Age": 40,
                    "Type": "adult"
                },
                {
                    "FirstName": "Jane",
                    "LastName": "Doe",
                    "DateOfBirth": "1988-07-15",
                    "Age": 37,
                    "Type": "adult"
                }
            ],
            "FirstName": "John",
            "LastName": "Doe",
            "Email": "john.doe@example.com",
            "Phone": "+44 7700 900123",
            "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-16T10:15:00Z"
    },
    "Error": null
}
Modified at 2025-10-16 13:37:58
Previous
Get or create open booking
Next
Update booking status and trigger workflows
Built with