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 booking status and trigger workflows

POST
/v1/saveBookingStatus
Update a booking's status to reflect payment completion, cancellation, or other lifecycle changes. Critical status transitions trigger automated workflows: transitioning to 'paid' automatically books items with suppliers, skipping items marked for manual booking or requiring pickup selection. The system synchronizes status changes to connected midoffice and supplier systems based on configured integrations. Status transitions must move forward in the booking lifecycle - reversing to 'open' status is not permitted. The UserID parameter identifies the end customer.

Request

Authorization
or
Body Params application/json

Examples

Responses

🟢200OK
application/json
Successfully updated booking status and triggered workflows
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/saveBookingStatus' \
--header 'Content-Type: application/json' \
--data-raw '{
    "BookingID": "X9Y8Z7W6",
    "UserID": "user_def456uvw",
    "Status": "paid"
}'
Response Response Example
200 - Booking marked as paid with supplier bookings initiated
{
    "Data": {
        "ID": "X9Y8Z7W6",
        "UserID": "user_def456uvw",
        "ProductID": 67890,
        "Status": "paid",
        "Details": {
            "Trip": {
                "ProductID": 67890,
                "Name": "Gran Hotel Bahía del Duque - 5 Nights + Flights",
                "Description": "Exclusive 5-star resort in Tenerife with direct flights from London",
                "Images": [
                    {
                        "URL": "https://cdn.ygo.ai/packages/67890/resort.jpg",
                        "Width": 2560,
                        "Height": 1440,
                        "Type": "main"
                    }
                ],
                "StartDate": "2025-12-10",
                "EndDate": "2025-12-15",
                "City": "Costa Adeje",
                "Country": "Spain",
                "CountryCode": "ES",
                "Latitude": 28.0916,
                "Longitude": -16.7352
            },
            "Items": [
                {
                    "ID": "item_activity_001",
                    "ProductID": 78901,
                    "Type": "activity",
                    "Provider": "Musement",
                    "ProviderID": "MUS-ACT-TF-001",
                    "Name": "Teide National Park Stargazing Tour",
                    "Description": "Evening tour to Mount Teide with professional astronomer guide and dinner",
                    "Quantity": 2,
                    "Status": "booked",
                    "TotalPrice": {
                        "Amount": 180,
                        "Currency": "EUR"
                    },
                    "Hash": "a3f8c9d2e1b4f7a6",
                    "Musement": {
                        "OrderID": "ORD-MUS-20251016-001",
                        "OrderStatus": "CONFIRMED",
                        "OrderUpdatedAt": "2025-10-16T16:05:00Z"
                    }
                },
                {
                    "ID": "item_activity_002",
                    "ProductID": 78902,
                    "Type": "activity",
                    "Provider": "Musement",
                    "ProviderID": "MUS-ACT-TF-002",
                    "Name": "Whale & Dolphin Watching Cruise",
                    "Description": "3-hour catamaran cruise with marine wildlife spotting and snorkeling",
                    "Quantity": 2,
                    "Status": "booked",
                    "TotalPrice": {
                        "Amount": 120,
                        "Currency": "EUR"
                    },
                    "Hash": "b4e9a3c7d2f8e1a5",
                    "Musement": {
                        "OrderID": "ORD-MUS-20251016-002",
                        "OrderStatus": "CONFIRMED",
                        "OrderUpdatedAt": "2025-10-16T16:05:30Z"
                    }
                },
                {
                    "ID": "item_transfer_001",
                    "ProductID": 78903,
                    "Type": "transfer",
                    "Provider": "Exfinity",
                    "ProviderID": "EXF-TRF-TFS-001",
                    "Name": "Airport Transfer - Tenerife South Airport to Hotel",
                    "Description": "Private transfer from TFS airport to Gran Hotel Bahía del Duque",
                    "Quantity": 1,
                    "Status": "booked",
                    "TotalPrice": {
                        "Amount": 45,
                        "Currency": "EUR"
                    },
                    "Hash": "c5d8b4a9e3c7f2b6",
                    "Exfinity": {
                        "BookingReference": "EXF-TFS-20251016-001",
                        "Status": "CONFIRMED"
                    }
                }
            ],
            "Travellers": [
                {
                    "FirstName": "John",
                    "LastName": "Smith",
                    "DateOfBirth": "1985-03-20",
                    "Age": 40,
                    "Type": "adult"
                },
                {
                    "FirstName": "Sarah",
                    "LastName": "Smith",
                    "DateOfBirth": "1988-07-15",
                    "Age": 37,
                    "Type": "adult"
                }
            ],
            "FirstName": "John",
            "LastName": "Smith",
            "Email": "john.smith@example.com",
            "Phone": "+44 7700 900123",
            "Street": "123 High Street",
            "ZipCode": "SW1A 1AA",
            "City": "London",
            "CountryCode": "GB",
            "PaymentMethod": "card",
            "PaymentID": "pi_3N1234567890",
            "PaymentIsSandbox": false,
            "TotalPrice": {
                "Amount": 2845,
                "Currency": "EUR"
            },
            "Locale": "en",
            "IsRobot": false,
            "Shop": "ygotrips",
            "Host": "ygo.ai",
            "UTMSource": "google",
            "UTMCampaign": "winter_sun_2025"
        },
        "CreatedAt": "2025-10-14T10:20:00Z",
        "UpdatedAt": "2025-10-16T16:00:00Z"
    },
    "Error": null
}
Modified at 2025-10-16 13:47:43
Previous
Update open booking
Next
List bookings
Built with