# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.gotadi.com/english/b2b2c-partner/api-method/booking-journey-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
