Start booking process

Start booking process

#affiliate

https://api.worldota.net/api/b2b/v3/hotel/order/booking/finish/
ℹ️

The call starts the booking process.

⚠️
If invalid user data is used, the data may be added to the stop list.

Request example

curl --user '<KEY_ID>:<API_KEY>' 'https://api.worldota.net/api/b2b/v3/hotel/order/booking/finish/' \
--header 'Content-Type: application/json' \
--data '{
  "user": {
    "email": "[email protected]",
    "comment": "The user comment.",
    "phone": "12124567899"
  },
  "supplier_data": {
    "first_name_original": "Peter",
    "last_name_original": "Collins",
    "phone": "12124567880",
    "email": "[email protected]"
  },
  "partner": {
    "partner_order_id": "0b370500-5321-4046-92c5-5982f1a64fc6",
    "comment": "The partner comment.",
    "amount_sell_b2b2c": "10"
  },
  "language": "en",
  "rooms": [
    {
      "guests": [
        {
          "first_name": "Martin",
          "last_name": "Smith"
        },
        {
          "first_name": "Eliot",
          "last_name": "Smith"
        }
      ]
    }
  ],
  "payment_type": {
    "type": "deposit",
    "amount": "9",
    "currency_code": "EUR"
  },
  "return_path": "https://example.com"
}'

Request body

Response example

{
  "data": null,
  "debug": null,
  "error": null,
  "status": "ok"
}

Errors

The error field has the value specified in the headers below.

book_hash_not_found

A rare internal error when the ETG couldn’t recognize the book_hash used in the booking.

After getting the error, the only option is to find another rate and continue with it.

booking_form_expired

In case Create booking process has been expired.

Request a new Create booking process with a different partner_order_id.

chosen_payment_type_was_not_available_on_booking_form

The payment_type field values don’t match any of the payment_types field values in the response of the Create booking process call.

Try to change the payment_type field value according to the payment_types field values in the response.

double_booking_finish

An attempt to finish the booking for the second time while the status of the first attempt isn’t an error.

email

The provided email address isn’t valid.

incorrect_chosen_payment_type

The type field value is incorrect.

incorrect_guests_number

The adult guest number doesn’t match the adult guest number in the request of the Retrieve hotelpage call.

Try to change the rooms field item number according to the guests field values in the request.

incorrect_children_data

  • The children guest number doesn’t match the children guest number in the request of the Retrieve hotelpage call.
  • The children age is incorrect.

Try to change:

  • The rooms field item number according to the guests field values in the request.
  • The age field value.

incorrect_rooms_number

The room number doesn’t match the room number in the request of the Retrieve hotelpage call.

Try to change the rooms field item number according to the guests field values in the request.

insufficient_b2b_balance

The credit limit is reached. Contact your account manager.

order_not_found

The order with the partner_order_id field value isn’t found.

Send another booking creation request and change the partner_order_id field value.

rate_not_found

The rate isn’t found. Send another search request.

return_path_required

The return_path field is required if the rate you are booking has the payment_types field with the now value.

unauthorized_group_booking

An attempt to make a request with the conditions:

  • More than 9 bookings in the same hotel.
  • More than 9 bookings for the same dates.
  • In one request.

To make a group booking:

  • Contact the API support team.
  • Fill in the group booking form on the site.

invalid_upsell_attributes

Invalid name and attributes combination in upsell_data field.

invalid_upsell_uid

Invalid upsell uid in upsell_data field.

arrival_date_differs_from_checkin_date

The check-in date should be equal to or the day after the check-in date in the request of the Retrieve hotelpage call.

Try to change the checkin_datetime field value according to the checkin field value in the request.

not_enough_credit_card_data

The init_uuid and pay_uuid fields are required if the rate you are booking has the is_need_credit_card_data field with the true value.

incorrect_init_uuid_format

The init_uuid field values don’t match the regular expression.

incorrect_pay_uuid_format

The pay_uuid field values don’t match the regular expression.

sandbox_restriction

An attempt to book the test hotel with the hid = 6291619 or id = test_hotel_do_not_book in the production environment.

To book the test hotel, use the test environment.

supplier_data_required

The supplier_data field is required for your integration. Contact your account manager.

timeout, unknown, and 5xx

If you get the error, it doesn’t necessarily mean the booking isn’t created. These errors may occur because of the ETG services’ timeout. To check the booking finishing, send the Check booking process request.