# Check booking process

URL: https://docs.emergingtravel.com/docs/b2b-api/booking/check-booking-process/

Tags: b2b

---



**Sandbox**

```
https://api-sandbox.worldota.net/api/b2b/v3/hotel/order/booking/finish/status/
```

**Production**

```
https://api.worldota.net/api/b2b/v3/hotel/order/booking/finish/status/
```




> [!NOTE]
> * <strong>This call is required</strong> if you don’t use the [Receive booking status webhook](/docs/b2b-api/booking/receive-booking-status-webhook/) call.
> * As the booking process is made asynchronously, repeatedly request this call to know the status.



The call checks the booking process status.

## Sandbox limitations { #limitations }

> [!WARNING]
> Use only field values, IDs, API keys, and any static content from the sandbox environment within the sandbox. <strong>Do not use sandbox data in test or production environments, and do not mix data or configuration between different environments.</strong>




* The following features are not supported: 3D Secure check and cut-off logic.
* The `data_3ds` field is not supported.
* The possible values for the `status` field are: `ok`, `processing`, and `error`.
* The following errors are not supported: `block`, `charge`, `3ds`, and `not_allowed`.

## Usage scenarios

The only possible call requesting scenarios:
* General. No need for you to make additional steps except for receiving the [final status](#result-interpretation).
* [3D Secure check](#3d-secure-check). Needs you to make additional steps.

## 3D Secure check

> [!NOTE]
> <strong>The scenario is required to be completed</strong> if the rate you are booking has the `payment_types` field with the `now` value.



To complete the scenario, make the following steps:
1. Request this call and receive the [check details](#3d-secure-check-details).
1. Make the [3D Secure check request](#3d-secure-check-request).
1. After the 3D Secure check is completed, the payment gateway will redirect the user to the URL passed in the `return_path` field value of the [Start booking process](/docs/b2b-api/booking/start-booking-process/) call.
1. Request this call again and receive the [final status](#result-interpretation).

### 3D Secure check details

If the issuing bank supports 3D Secure cards, as the response to this call you will get:
* The `status` field with the `3ds` value.
* The special data in `data.data_3ds` field.

The response example:

```json
{
  "data": {
    "data_3ds": {
      "action_url": "https://example.com/ACS/auth/start.do",
      "data": {
        "MD": "94cf25b2-aa6d-4204-83e4-acf036d263f6",
        "PaReq": "eJxVkt1ygjAQhV/F4R7zIwI6azptqa2dAR0L0+s0RKAV0ADVvn0TC33833+zObs5G7g5l/vRp1RNUVcLi4yxNZKVqNOiyhZWEi9t37phEOdKyuBFik5JBqFsGp6JUZEurBl358xfpLbvSWw7U05sHzvU3hGyS92Z8DyfWww2t1t5ZNA3YrrPmAIaUCsqkfOqZcDF8W4VMYd6LsaAeoRSqlXACJ04U9fzAf0wVLyUTPFW5vz0AeiCIOquatUXc20JoAGgU3uWt+1hjtBwYSzqEpA5APQ3waYzUaOFzkXKwvfwHMXZaR08kHWQOGH8cIqC5BTGyQKQqYBUyzGKKcYOpiPszbEzx1NAlzzw0kzACJmYXE9wME1ur47+p0AbrfQehkcMBPJ8qCupK7R7vzGgv3nvn4yHotXuLPPZIY2ecbeLGlI8bulbkh2zzRZvXvfG2UuRUSy0P5Rg9yJpAJCRQf3SUL9vHV39g287E7qa",
        "TermUrl": "https://example.com/rebpayment/rest/finish3ds.do?ret_path=finish"
      },
      "method": "post"
    },
    "partner_order_id": "asd123",
    "percent": 66
  },
  "debug": null,
  "error": null,
  "status": "3ds"
}
```

### 3D Secure check request

Send the request with received data for the 3D Secure check:
* Via the GET method if the `data.data_3ds.method` field has the `get` value.
* Or via the POST method if the `data.data_3ds.method` field has the `post` value.

The request example:

```shell
curl -d '{"PaReq":"eJxVkt1ygjAQhV/F4R7zIwI6azptqa2dAR0L0+s0RKAV0ADVvn0TC33833+zObs5G7g5l/vRp1RNUVcLi4yxNZKVqNOiyhZWEi9t37phEOdKyuBFik5JBqFsGp6JUZEurBl358xfpLbvSWw7U05sHzvU3hGyS92Z8DyfWww2t1t5ZNA3YrrPmAIaUCsqkfOqZcDF8W4VMYd6LsaAeoRSqlXACJ04U9fzAf0wVLyUTPFW5vz0AeiCIOquatUXc20JoAGgU3uWt+1hjtBwYSzqEpA5APQ3waYzUaOFzkXKwvfwHMXZaR08kHWQOGH8cIqC5BTGyQKQqYBUyzGKKcYOpiPszbEzx1NAlzzw0kzACJmYXE9wME1ur47+p0AbrfQehkcMBPJ8qCupK7R7vzGgv3nvn4yHotXuLPPZIY2ecbeLGlI8bulbkh2zzRZvXvfG2UuRUSy0P5Rg9yJpAJCRQf3SUL9vHV39g287E7qa","termurl":"https://example.com/rebpayment/rest/finish3ds.do?ret_path=finish","MD":"94cf25b2-aa6d-4204-83e4-acf036d263f6}"' https://example.com/ACS/auth/start.do
```

## Result interpretation

The result is described in the `status` response field. The possible values:
* `ok` — the booking finishing has ended with success.
* `processing` — the booking finishing is in progress. Request the status change every second until you get the `ok` or `error` value.
* `3ds` — the booking finishing needs to complete the [3D Secure check](#3d-secure-check).
* `error` — the booking finishing has ended with an error.
   
> [!WARNING]
> Don’t forget that you might have the [`timeout`, `unknown`, and `5xx`](#timeout-unknown-and-5xx) error.



## Retry logic

During the maximum booking time request this call any time you like. The recommended time is once per 5 seconds.

> [!WARNING]
> Always send a final status request at the last second before the booking timeout, even if you check every 5 seconds. This reduces the risk of missing the correct status, especially with short timeouts.



## Request example


**Sandbox**

```shell
curl --user '<KEY_ID>:<API_KEY>' 'https://api-sandbox.worldota.net/api/b2b/v3/hotel/order/booking/finish/status/' \
--header 'Content-Type: application/json' \
--data '{
  "partner_order_id": "0b370500-5321-4046-92c5-5982f1a64fc6"
}'
```

**Production**

```shell
curl --user '<KEY_ID>:<API_KEY>' 'https://api.worldota.net/api/b2b/v3/hotel/order/booking/finish/status/' \
--header 'Content-Type: application/json' \
--data '{
  "partner_order_id": "0b370500-5321-4046-92c5-5982f1a64fc6"
}'
```




## Request body



- **partner_order_id** *(String, required)*

  <p>The unique partner booking ID.</p>
  > [!NOTE]
  > * The minimum length is `1` character.
  > * The maximum length is `256` characters.





## Response



[//]: # (data_3ds)
- **data_3ds** *(Object)*

  <p>The 3D Secure check information.</p>
  <ul>
  <li>
  <p><strong>action_url</strong> <em>(String)</em></p>
  <p>The URL of a new request for the 3D Secure check.</p>
  <p>Must have the <code>data</code> object field as the query parameter.</p>
  </li>
  <li>
  <p><strong>data</strong> <em>(Object, optional)</em></p>
  <p>The 3D Secure check information that should be sent back.</p>
  <ul>
  <li>
  <p><strong>MD</strong> <em>(String, optional)</em></p>
  <p>The payment session ID returned by the card issuer.</p>
  </li>
  <li>
  <p><strong>PaReq</strong> <em>(String, optional)</em></p>
  <p>The 3D Secure request data for the issuer.</p>
  > [!NOTE]
  > The line breaks in the value must be retained in all requests. Otherwise, the transaction will be declined.
  </li>
  <li>
  <p><strong>TermUrl</strong> <em>(String, optional)</em></p>
  <p>The URL of the merchant site page to redirect the user to after completing 3D Secure check on the card issuer site.</p>
  > [!NOTE]
  > * The maximum length is `1024` characters.
  </li>
  </ul>
  </li>
  <li>
  <p><strong>method</strong> <em>(String)</em></p>
  <p>The HTTP method of sending the information.</p>
  > [!NOTE]
  > * The possible values:
  >     * `get`.
  >     * `post`.
  </li>
  </ul>


[//]: # (partner_order_id)
- **partner_order_id** *(String)*

  <p>The external booking ID in the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
   format.</p>
  <p>The ID remains the same if you cancel a booking that:</p>
  <ul>
  <li>Is successful.</li>
  <li>Is failed.</li>
  <li>Has the fail status response from the [Check booking process](/docs/b2b-api/booking/check-booking-process/)
   call.</li>
  </ul>
  <p>Use this field for the rest of the booking calls.</p>
  > [!NOTE]
  > * The value should be unique for the order within the same contact.
  > * The minimum length is `3` character.
  > * The maximum length is `256` characters.


[//]: # (percent)
- **percent** *(Int, deprecated)*

  <p>The order confirmation percentage.</p>
  <p>All current statuses are described in the [Result interpretation](/docs/affiliate-api/booking/check-booking-process/#result-interpretation)
   section.</p>
  <p>The <code>ok</code> status in the response indicates that the order is confirmed.</p>





## Response example

```json
{
  "data": {
    "data_3ds": null,
    "partner_order_id": "0b370500-5321-4046-92c5-5982f1a64fc6",
    "percent": 100
  },
  "debug": null,
  "error": null,
  "status": "ok"
}
```

## Errors

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

### `block`

The card funds can’t be frozen (blocked) for the booking payment.

### `charge`

The card funds can’t be withdrawn for the booking payment due to:
* A failed freeze.
* Another reason.

### `3ds`

The `MD` field value is invalid.

### `soldout`

The rate is no longer available as its rooms are sold out.

### `book_limit`

The cut-off logic limit for the booking finishing is reached.

### `not_allowed`

There is no permission to use this call for this contract:
1. Contact the API support team.
1. Tell the user the booking error has occurred.

When contacting the API support team, provide at least:
* The hotel name where the booking is in process.
* The `order_id` field with the value from the [Create booking process](/docs/b2b-api/booking/create-booking-process/) call.
* The `user` and `rooms` fields with the values from the [Start booking process](/docs/b2b-api/booking/start-booking-process/) call.

This information will help to identify the request attempt.

### `provider`

A technical error at the rate provider side.

### `order_not_found`

The order with the `partner_order_id` field value isn’t found. Try to change the value.

### `booking_finish_did_not_succeed`

An attempt to request this call without a successful response from the [Start booking process](/docs/b2b-api/booking/start-booking-process/) call.

### `timeout`, `unknown`, and `5xx`

An internal error. Continue to request this call until you get the following response:

* The `status` field has the `ok` value.
* The `error` field has one of the values:
   * `3ds`.
   * `block`.
   * `book_limit`.
   * `booking_finish_did_not_succeed`.
   * `charge`.
   * `decoding_json`.
   * `endpoint_exceeded_limit`.
   * `endpoint_not_active`.
   * `endpoint_not_found`.
   * `incorrect_credentials`.
   * `invalid_auth_header`.
   * `invalid_params`.
   * `lock`.
   * `no_auth_header`.
   * `not_allowed`.
   * `not_allowed_host`.
   * `order_not_found`.
   * `overdue_debt`.
   * `provider`.
   * `soldout`.
   * `unexpected_method`.

> [!NOTE]
> The requests should be sent within the agreed booking timeout.



## Error Handling Diagram

Below is a sequence diagram describing how to handle errors during the booking check process:

```mermaid
sequenceDiagram
    participant User
    participant API

    User->>API: Check booking process
    alt status == "ok"
        API-->>User: Booking is successfully confirmed
    else status == "processing" or error is (timeout/unknown) or HTTP status code 5xx
        loop Wait and poll (until status is "ok", final error, or booking timeout reached)
            User->>API: Check Booking Process
            alt status == "ok"
                API-->>User: Booking is successfully confirmed
                User->>User: Stop polling
            else status == "processing" or error is (timeout/unknown) or HTTP status code 5xx
                API-->>User: Still processing or transient error, continue polling
            else status is final error (e.g., soldout, provider, book_limit) or booking timeout reached
                API-->>User: Return final error or booking timeout
                User->>User: Stop polling, show error
            end
        end
    else status is final error (e.g., soldout, provider, book_limit) or booking timeout reached
        API-->>User: Return final error or booking timeout
        User->>User: Stop, show error
    end
```
