API Booking options (EN)

Extended explanation of booking options usage.

  • Booking options are information you need to collect from guest to process a booking. Please consider every booking option as input field to be dynamically generated and added to customer checkout form. There are 14 types of booking options, each has a corresponding HTML input type. Here you can see example implementation
    list of booking option types
    • type: "1" - "list" HTML input type "select"
    • type: "2" - "list multiple" HTML input type "select mutltiple"
    • type: "3" - "number" HTML input type "text" with number validation
    • type: "4" - "string" HTML input type "text" with string validation
    • type: "5" - "boolean" HTML input type checkbox
    • type: "6" - "date" HTML input type "text" with date validation
    • type: "7" - "file" HTML input type "file"
    • type: "8" - "image" HTML input type "file with image type validation
    • type: "9" - "address" HTML input type "text"
    • type: "10" - "time" HTML input type "text" with time validation
    • type: "11" - "datetime" HTML input type "text" with datetime validation
    • type: "12" - "string: country" HTML input type "text"
    • type: "13" - deprecated
    • type: "14" - "string: flight no" HTML input type "text" with flight no validation: ^[A-Z0-9][A-Z0-9][0-9]{0,4}$
    • You can build UI according to own design, for example use radio buttons instead of select, etc.
  • Booking options are present on product type level, but on product level there are two flags to mark their presence: 'hasOptions' means at least one product-type has booking options. 'allProductTypesHaveOptions' means all product-types have booking options.
    "hasOptions": true,
    "allProductTypesHaveOptions": true,

  • Booking options can be required to make a booking. They have a key required: true/false (fig. 1)
    Example on API demo
    product UUID: d3bfa3e1-edd4-5c24-a051-4d6c56aae621
    product-type UUID: 9a7b8133-6654-5a8d-94f2-e5680a030fa3

    "options": {
                "perBooking": [
                    {
                        "uuid": "6587c77f-97fb-47ed-b74b-bdd9f1e99bc1",
                        "name": "Flight Number",
                        "description": null,
                        "required": true,
                        "formatRegex": null,
                        "inputType": 4,
                        "validFrom": null,
                        "validTo": null
                    },
                    {
                        "uuid": "e9d7f9ba-8528-4920-a4b0-632bf4cfa4f9",
                        "name": "Airport Name",
                        "description": null,
                        "required": true,
                        "formatRegex": null,
                        "inputType": 4,
                        "validFrom": null,
                        "validTo": null
                    },
                    {
                        "uuid": "0cbebb60-fa25-4fc1-9712-fd7b716fc9d4",
                        "name": "Arrival Date/Time",
                        "description": null,
                        "required": true,
                        "formatRegex": null,
                        "inputType": 11,
                        "validFrom": null,
                        "validTo": null
                    },
                    {
                        "uuid": "79c17fb7-3891-4705-98e5-c3a9459bf639",
                        "name": "Drop-off Address",
                        "description": null,
                        "required": true,
                        "formatRegex": null,
                        "inputType": 9,
                        "validFrom": null,
                        "validTo": null
                    }
                ],
                "perPax": []
            }

  • Key explanation
    • `uuid` - uuid of booking option
    • `name` - the name of booking option for example "Full name"
    • `description` - description of booking option for example "as shown on passport", empty string when not present
    • `required` - true/false, if true can not make booking without including booking option in make booking payload
    • `formatRegex` - additional to be used to validate on the client side, for example flight number: '^[A-Z0-9][A-Z0-9][0-9]{0,4}$', null when not applicable
    • `inputType` - integer, defning type of input - explained below, for example 4: string, 1: list (provided),
    • `validFrom` - start date, if booking option is valid for limited time, null when not applicable
    • `validTo` - end date, if booking option is valid for limited time, null when not applicable
  • Booking options can be per Booking `perBooking` or/and per Guest `perGuest`. If per booking, one option per booking request is required. If per guest option is required for every guest (adult, senior, child).

    Example on API demo
    product UUID: d0ac2916-698c-54ef-bd1b-6ecf273c598f
    product-type UUID: b7883bc7-85c9-5ad9-b52f-cabba964e1ba
  • Booking options can be required to date. They are listed on pricing endpoint.
  • Booking options can have a price. Price can be per option or per item Example on API demo
    product UUID:
    d4398f47-9fc0-5f38-ba2d-d04a5fe8327e
    product-type UUID: 7b1fa020-2bac-56bc-b145-a3592493ac4f
    Pricing per option
    "options": {
                "perBooking": [
                    {
                        "uuid": "383f0b49-e7dc-4c24-9640-5ed0370533a1",
                        "name": "Raincoat",
                        "description": "Good for rainy days",
                        "required": false,
                        "formatRegex": null,
                        "inputType": 5,
                        "validFrom": null,
                        "validTo": null,
                        "price": 5
                    }
                ],
                "perPax": []
            },

    Example on API demo
    product UUID: e8f0b93c-ee5d-54b7-8813-8004c26c658c1
    product-type UUID: 23fa0c48-17e9-5716-8dac-4a8bb142a17f
    Pricing per item
    "options": {
                "perBooking": [
                    {
                        "uuid": "0b40932c-53e2-423d-bbf7-b12cc998342e",
                        "name": "Select pickup zone",
                        "description": "Zone 1: Some description where to meet.\nZone 2: Some other description where is the meeting place for this zone.",
                        "required": true,
                        "formatRegex": null,
                        "inputType": 1,
                        "validFrom": null,
                        "validTo": null,
                        "items": [
                            {
                                "label": "Zone 1 (SGD 10)",
                                "value": "Zone 1",
                                "price": 10
                            },
                            {
                                "label": "Zone 2 (SGD 5)",
                                "value": "Zone 2",
                                "price": 5
                            }
                        ]
                    }
                ],
                "perPax": []
            },

  • While POSTing booking, options perBooking are in array, options perPax are in array of arrays - one array per pax.
    {
      "productTypeUuid": "4dd361a3-a964-597a-8a99-06b2a2ca9224",
      "customer": {
        "email": "some.email@domain.com",
        "firstName": "Michal",
        "lastName": "S",
        "phone": "+65 0000 0000",
        "salutation": "Mr."
      },
      "adults": 1,
      "seniors": 0,
      "children": 2,
      "arrivalDate": "2018-08-07",
      "message": null,
      "partnerReference": null,
      "timeSlotUuid": "f1cc0983-e8ed-577c-8b93-a8a7bfdbff5c",
      "options": {
        "perBooking": [
            {
                "uuid": "46db421e-5727-46fc-9f2c-10679e026582",
                "value": "1"
            },
            {
                "uuid": "46db421e-5727-46fc-9f2c-10679e026582",
                "value": "2"
            }
                ],
        "perPax": [
          [
            {
                "uuid": "543f0e45-bdfe-4dc7-af73-e7fd5eda8246",
                "value": 5
            }],
            [
              {
                "uuid": "543f0e45-bdfe-4dc7-af73-e7fd5eda8246",
                "value": 9
              }
            ],
            [
              {
                "uuid": "543f0e45-bdfe-4dc7-af73-e7fd5eda8246",
                "value": 30
            }]
        ]
      }
    }