> For the complete documentation index, see [llms.txt](https://developer.gotadi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.gotadi.com/english/b2b2c-partner/api-method/booking-journey-handling.md).

# Booking Journey Handling

### 1. Commit API

* Calling the **Commit API** is considered the start of a booking journey flow. You must ensure that the current booking journey has been fully completed before initiating a new one.
* The Commit API only triggers two actions: **payment** and **ticket issuance**. It should not be used alone to determine the completion of a booking journey. Instead, it must be used together with the **booking-detail API** (which will be replaced by the **final-booking-detail API** as recommended in this document).

### 2. Final Booking Detail API

* The **final-detail-booking API** is used to determine the status of a booking through the following statuses:
  * Payment statuses
  * Issued statuses
* This API enhances the handling of both successful and failed cases:
  * In the **happy case** (success), the API immediately returns the result.
  * In the **failure case**, the API will automatically retry to retrieve the latest booking status and return the result until the preconfigured timeout is reached.
* Conditions where the booking journey is considered completed and a new journey can be started:
  * Payment failed: **`paymentStatus =`` `**<mark style="color:red;">**`Failed`**</mark>
  * Payment succeeded and ticket issuance succeeded: **`paymentStatus =`` `**<mark style="color:green;">**`Success`**</mark> and **`issueStatus =`` `**<mark style="color:green;">**`Success`**</mark>
* Conditions where the booking journey is considered incomplete (must be held and further processed):
  * Payment succeeded but ticket issuance not yet succeeded: **`paymentStatus =`` `**<mark style="color:green;">**`Success`**</mark> and **`issueStatus !=`` `**<mark style="color:green;">**`Succes`**</mark>

### 3. Recommendation

* When calling the **Commit API**, some errors may occur outside of the predefined error code table (e.g., API call failure, timeout, or long response time). In such cases, the **final-booking-detail API** should be used to determine the status of a booking.
* After retrieving the result from **final-booking-detail**:
  * If **`paymentStatus =`` `**<mark style="color:green;">**`Success`**</mark> but **`issueStatus !=`` `**<mark style="color:green;">**`Success`**</mark>, you should continue retrying **GET final-booking-detail** until the most accurate status is returned.
