# Tổng quan

Tài liệu này được tạo ra để hỗ trợ các đối tác của chúng tôi tích hợp các API Du lịch của Gotadi. Bạn sẽ tìm thấy hướng dẫn và tài liệu về các sản phẩm của chúng tôi cũng như mô tả về các luồng xử lý trong hệ thống Gotadi.​ Các API Du lịch được cung cấp để kết nối các đối tác với tất cả dữ liệu bạn cần để xây dựng một trang web hoặc ứng dụng bằng nội dung du lịch do Gotadi cung cấp.

Với mục tiêu làm cho việc phát triển trang web của bạn trở nên dễ dàng hơn bao giờ hết bằng cách sử dụng các tùy chọn tìm kiếm giá linh hoạt để bạn có thể xây dựng các công cụ thú vị giúp mở rộng các tùy chọn tìm kiếm du lịch cho người dùng của bạn.&#x20;

Nếu có bất kỳ câu hỏi nào, bạn có thể tìm thêm thông tin và câu trả lời cho các câu hỏi trong phần [Câu hỏi thường gặp](/vietnamese/cau-hoi-thuong-gap) hoặc liên hệ với nhóm Hỗ trợ Đối tác của Gotadi&#x20;


# Đối tác B2B2C

{% hint style="info" %}
Đối tác B2B2C từ viewpoint của Gotadi, giúp đưa các sản phẩm của Gotadi tới tay người dùng trên chính sản phẩm hiện có của đối tác.&#x20;
{% endhint %}

## Có 3 phương thức tích hợp với đối tác B2B2C:&#x20;

{% content-ref url="/pages/X0iHGLCOdO94drprI3nd" %}
[Phương thức Webview](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview)
{% endcontent-ref %}

{% content-ref url="/pages/zkIbFeoyqRdGGl2JfzBJ" %}
[Phương thức API](/vietnamese/doi-tac-b2b2c/phuong-thuc-api)
{% endcontent-ref %}

{% content-ref url="/pages/9zSQN6kHtXjAo5pEjtHv" %}
[Phương thức SDK](/vietnamese/doi-tac-b2b2c/phuong-thuc-sdk)
{% endcontent-ref %}


# Phương thức Webview

Tài liệu mô tả các vấn đề liên quan đến việc triển khai hình thức kết nối Webview giữa Đối tác B2B2C (trong tài liệu này gọi là Đối tác) và Gotadi.

### Quy trình kết nối <a href="#quy-trinh-ket-noi" id="quy-trinh-ket-noi"></a>

<figure><img src="/files/0emV2UyVoMFj8yVhgDFu" alt=""><figcaption></figcaption></figure>

<details>

<summary>Bước 1: Khởi tạo tài khoản</summary>

Đối tác cung cấp thông tin để Gotadi khởi tạo tài khoản đại lý trên môi trường sandbox. Thông tin bao gồm:

* Thông tin công ty:
  * Tên công ty
  * Địa chỉ công ty
  * Địa chỉ website
* Thông tin quản trị viên:
  * Họ tên
  * Địa chỉ email
  * Số điện thoại
* Thông tin kết nối:
  * Đường dẫn tới hệ thống của đối tác: Link sản phẩm, Link cổng thanh toán, …
  * Các tài liệu tích hợp liên quan
  * Public key của đối tác. (RSA public key chiều dài tối thiểu 1024 bit)

</details>

<details>

<summary>Bước 2: Cung cấp tài khoản trên môi trường sandbox</summary>

Gotadi khởi tạo tài khoản dựa vào thông tin Đối tác cung cấp và gửi lại các thông tin tài khoản cho Đối tác. Thông tin bao gồm:

* Link kích hoạt tài khoản và đăng nhập vào B2B portal của Gotadi (Gửi vào email quản trị viên).
* Đường dẫn tới hệ thống của Gotadi: `<gotadi_api_gateway>`
* Public key của Gotadi. (RSA public key chiều dài tối thiểu 1024 bit)
* Tham số truyền vào request header:
  * Khóa truy cập API: `<api_key>`
  * Mã truy cập của đối tác: `<access_code>`

</details>

<details>

<summary>Bước 3: Kết nối và kiểm thử</summary>

Đối tác kích hoạt tài khoản và sử dụng thông tin ở bước 2 tiến hành kết nối và kiểm thử trên môi trường sandbox

</details>

<details>

<summary>Bước 4: Nghiệm thu</summary>

Nghiệm thu Sandbox và Golive dịch vụ

**Lưu ý:** Trong quá trình kiểm thử nếu phát sinh các đặt chỗ cần refund hoặc hoàn/ hủy. Vui lòng làm theo hướng dẫn sau

</details>

<details>

<summary>Bước 5: Training &#x26; phối hợp chăm sóc khách hàng</summary>

Kết nối giữa team CS của Gotadi và đối tác để xây dựng kênh tương tác chung.&#x20;

Ưu tiên các kênh trao đổi trực tiếp thông qua các ứng dụng OTA như Skype, Zalo, Viber hoặc các ứng dụng khác phù hợp với CS 2 bên. \
Training nghiệp vụ CS (nếu cần) để đảm bảo phục vụ khách hàng tốt nhất từ mỗi phía

</details>

### Giao diện Webview <a href="#http-response-code" id="http-response-code"></a>

Vui lòng tham khảo giao diện trong link dưới đây:

{% embed url="<https://uat-vendor.gotadi.com/embed_b2b2c_demo.html>" %}

{% hint style="info" %}
Gotadi có thể tùy biến về màu sắc theo yêu cầu để phù hợp với giao diện của Đối tác
{% endhint %}

### Thuật ngữ và viết tắt <a href="#thuat-ngu-va-viet-tat" id="thuat-ngu-va-viet-tat"></a>

| Viết tắt | Từ đầy đủ                          | Mô tả                                                                                                                                                                   |
| -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL      | Uniform Resource                   | được dùng để tham chiếu tới tài nguyên trên Internet.                                                                                                                   |
| SSL      | Secure Sockets Layer               | giao thức mật mã được thiết kế để cung cấp truyền thông an toàn qua Internet.                                                                                           |
| HTTPS    | Hypertext Transfer Protocol Secure | là một giao thức kết hợp giữa giao thức HTTP và giao thức bảo mật SSL hay TLS cho phép trao đổi thông tin một cách bảo mật trên Internet.                               |
| 3DES     | Triple DES (3DES hay TDES)         | là một thuật toán khóa đối xứng, áp dụng thuật toán mã hóa DES ba lần cho mỗi khối dữ liệu.                                                                             |
| RSA      | Rivest–Shamir–Adleman              | là một thuật toán mật mã hóa khóa công khai. Đây là thuật toán đầu tiên phù hợp với việc tạo ra chữ ký điện tử đồng thời với việc mã hóa.                               |
| SHA-256  | Secure Hash Algorithm              | là giải thuật dùng để chuyển một đoạn dữ liệu nhất định thành một đoạn dữ liệu có chiều dài không đổi với xác suất khác biệt cao. SHA-256 (trả lại kết quả dài 256 bit) |
|          | Chữ ký điện tử                     | Thông tin đi kèm theo dữ liệu (văn bản, hình ảnh, video…) nhằm mục đích xác định người chủ của dữ liệu đó                                                               |
| M        | Mandatory                          | Bắt buộc phải có khi gọi API.                                                                                                                                           |
| O        | Optional                           | Không yêu cầu khi gọi API, tùy từng mục đích sử dụng mà có truyền tham số này không                                                                                     |
| C        | Condition                          | Dựa trên Condition của field khác khi gọi API mà field này được quyết định là Mandatory hay Optional                                                                    |

### HTTP Response code <a href="#http-response-code" id="http-response-code"></a>

| Code | Mô tả                 |
| ---- | --------------------- |
| 200  | Success               |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 402  | Forbidden             |
| 402  | Not Found             |
| 500  | Internal Server Error |
| 503  | Service Unavailable   |

### Mã lỗi <a href="#ma-loi" id="ma-loi"></a>

<table><thead><tr><th width="115">Mã lỗi</th><th>Mô tả</th></tr></thead><tbody><tr><td>00</td><td>Yêu cầu đã được xử lý thành công.</td></tr><tr><td>01</td><td>Yêu cầu đang được xử lý.</td></tr><tr><td>02</td><td>Yêu cầu đã được xử lý thất bại.</td></tr><tr><td>03</td><td>Yêu bị từ chối do Xác thực tài khoản đại lý khoản thất bại.</td></tr><tr><td>04</td><td>Yêu bị từ chối do Chữ ký điện tử không hợp lệ.</td></tr><tr><td>05</td><td>Yêu bị từ chối do Giải mã dữ liệu không thành công.</td></tr><tr><td>06</td><td>Yêu bị từ chối do Mã xác thực (Access Code) không hợp lệ.</td></tr><tr><td>07</td><td>Yêu bị từ chối do Dữ liệu sai định dạng.</td></tr><tr><td>08</td><td>Yêu bị từ chối do Đã được xử lý trước đó.</td></tr><tr><td>09</td><td>Yêu cầu chưa được xử lý.</td></tr><tr><td>10</td><td>Thông tin tài khoản không tìm thấy</td></tr><tr><td>99</td><td>Lỗi khác.</td></tr></tbody></table>

### Các Email gửi cho khách hàng

* Email giữ chỗ thành công chờ thanh toán
* Email xuất vé thành công
* Email giữ chỗ thất bại
* Email thanh toán thất bại
* Email thanh toán thành công chưa xuất được vé

### Tài liệu liên quan <a href="#tai-lieu-lien-quan" id="tai-lieu-lien-quan"></a>

* Thông tin kết nối giữa Gotadi và Đối tác.
* Kịch bản kiểm kiểm thử.
* Source code mẫu.

![](https://developer.gotadi.com/img/9.jpg)


# API Login

Khởi tạo liên kết Webview

Đặc tả

* URL: \<API\_GATEWAY>/api/partner/login
* Method: POST
* Mô tả: Khởi tạo phiên làm việc mới cho người
* Yêu cầu bảo mật: [Mã hóa dữ liệu và kèm theo chữ ký điện tử](https://gotadi.gitbook.io/technical-documentation/~/changes/hxSZJK0E5x4hAwJJ8axI/vietnamese/yeu-cau-bao-mat)

#### Request <a href="#request" id="request"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). Cách thành lập tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>
  ```

  *Original data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * user\_id (String, required)

    Mã định danh người dùng trên hệ thống của Đối tác.
  * layout (String, optional)

    Có giá trị là `dual` hoặc `single` tương ứng với 2 loại layout Gotadi cung cấp cho đối tác.
  * product (String, required)

    Có giá trị là `flight` hoặc `hotel`. Tương ứng với 2 sản phẩm Gotadi cung cấp cho đối tác.

    Khi layout là `single`: Dùng để chọn dịch vụ hiển thị trên webview.

    Khi layout là `dual`: Dùng để focus dịch vụ hiển thị trên webview.

</details>

#### Example

{% code fullWidth="false" %}

```json
{
    "data": "...",
    "key": "..."
}
```

{% endcode %}

#### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* **key (String, required)**

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* **data (String, required)**

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>
  ```

  *Original data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * error\_code (String, required) [Mã lỗi](https://gotadi.gitbook.io/technical-documentation/~/changes/hxSZJK0E5x4hAwJJ8axI/vietnamese/tich-hop-doi-tac-b2b2c/phuong-thuc-webview#ma-loi)
  * redirect\_url (String, optional)

    Đường dẫn tới Webview Gotadi có kèm theo jwtToken.

    ```
    https://<gotadi_webview_url>?access_token=<jwtToken>
    ```

</details>

#### Example

```json
{
    "data": "...",
    "key": "..."
}
```


# Yêu cầu bảo mật

### Kênh truyền SSL/HTTPS <a href="#kenh-truyen-sslhttps" id="kenh-truyen-sslhttps"></a>

SSL/HTTPS được áp dụng để truyền nhận dữ liệu giữa hệ thống của đối tác và Gotadi. Mục đích sử dụng SSL/HTTPS là giúp dữ liệu trao đổi giữa đối tác và Gotadi được mã hóa, khó bị đánh cắp và giả mạo.

### Header bảo mật và thống kê lưu lượng truyền <a href="#header-bao-mat-va-thong-ke-luu-luong-truyen" id="header-bao-mat-va-thong-ke-luu-luong-truyen"></a>

Tất cả các request từ phía đối tác gọi sang hệ thống của Gotadi phải chứa các Headers bên dưới để phục vụ các nghiệp vụ về bảo mật và thống kê số liệu của Gotadi:

```
apikey: <api_key>
x-ibe-req-name: <access_code>
```

Lưu ý

Giá trị `<api_key>` và `<access_code>` do Gotadi cung cấp cho Đối tác.

### Mã hóa dữ liệu truyền và xác thực chữ ký điện tử <a href="#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu" id="ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu"></a>

Request/response giữa Gotadi và Đối tác ở một số API quan trọng được yêu cầu mã hóa bằng thuật toán mã hóa bất đối xứng 3DES và kèm theo chữ ký điện tử để xác thực. Thuật toán mã hóa, giải mã sẽ được mô tả cụ thể trong tài liệu này.

Lưu ý

Các API có yêu cầu mã hóa dữ liệu và kèm theo chữ ký điện tử sẽ được ghi chú ở phần Yêu cầu bảo mật.

#### Mã hóa dữ liệu gửi đi <a href="#ma-hoa-du-lieu-gui-i" id="ma-hoa-du-lieu-gui-i"></a>

* **Input** Original data, RSA PublicKey của bên nhận, RSA Private Key của bên gửi
* **Output** Encrypted Key, Encrypted Data

<details>

<summary>Bước 1: Khởi tạo khóa ngẫu nhiên (Random key)</summary>

![](/files/RFdXSrBKfHqQ3Pb83rEE)

Hàm 3DES Key Generate được dùng để tạo random key dựa theo tiêu chí DESedeKeySpec (Độ dài key: 24 byte). Mỗi request/response sẽ được cấp một random key riêng biệt.

#### Example:

```javascript
    public static byte[] generateKey() throws Exception {
        KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede");
        SecretKey secretKey = keyGenerator.generateKey();
        SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DESede");
        DESedeKeySpec deSedeKeySpec = (DESedeKeySpec)   secretKeyFactory.getKeySpec(secretKey, DESedeKeySpec.class);
        byte[] randomKey = deSedeKeySpec.getKey();
        return randomKey;
    }
```

</details>

<details>

<summary>Bước 2: Mã hóa khóa ngẫu nhiên (Encrypted random key)</summary>

![](/files/e5U1faHd5mKFzLfWzY7X)

Random key được tạo ra ở bước 1 sẽ được mã hóa bằng thuật toán mã hóa bất đối xứng RSA bằng **Public key của bên nhận**.

#### Example:

```javascript
public static String encryptRSA(byte[] randomKey, String xmlPublicKey) throws Exception {
    Cipher cipher = createCipherEncrypt(xmlPublicKey);
    byte[] encryptedKey = cipher.doFinal(randomKey);
    return Base64.encodeBase64URLSafeString(encryptedKey);
}
```

</details>

<details>

<summary>Bước 3: Khởi tạo chữ ký chữ ký điện tử (Signature)</summary>

![](/files/zin1m5qbAqwYD2rh8bxR)

Bên gửi áp dụng thuật toán **RSA-SHA256** kết hợp với **Private key của chính mình** để ký chữ ký điện tử trên signature data.

Lưu ý

Schema để thành lập signature data sẽ được mô tả cụ thể ở từng API.

#### Example:

```java
public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
```

</details>

<details>

<summary>Bước 4: Mã hóa dữ liệu (Encrypted data)</summary>

![](/files/7DoQbHIjfvjzdRDjJTJw)

**Original data có chứa signature** sẽ được mã hóa bằng thuật toán **3DES** với random key đã được tạo ra ở bước trước đó.

Lưu ý

Schema để thành lập original data sẽ được mô tả cụ thể ở từng API.

#### Example:

```javascript
public static String encryptTripleDes(String originalData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
    byte[] encryptedData = cipher.doFinal(originalData.getBytes("UTF-8"));
    return Base64.encodeBase64URLSafeString(encryptedData);
}
```

</details>

#### Giải mã dữ liệu nhận được và xác thực chữ ký điện tử <a href="#giai-ma-du-lieu-nhan-uoc-va-xac-thuc-chu-ky-ien-tu" id="giai-ma-du-lieu-nhan-uoc-va-xac-thuc-chu-ky-ien-tu"></a>

* **Input** Encrypted Key, Encrypted Data, RSA PrivateKey của bên nhận, RSA PublicKey của bên gửi
* **Output** Original Data, Verify Result

<details>

<summary>Bước 1: Giải mã khóa ngẫu nhiên 3DES (Decrypted random key)</summary>

![](/files/DSwaXG1fA9SEjRjlIwx2)

Bên nhận sử dụng **Private key của chính mình** để giải mã encrypted key nhận được.

#### Example:

```java
public static byte[] decryptRSAToByte(String encryptedKey, String xmlPrivateKey) throws Exception {
    Cipher cipher = createCipherDecrypt(xmlPrivateKey);
    byte[] bts = Base64.decodeBase64(encryptedKey);
    byte[] randomKey = cipher.doFinal(bts);
    return randomKey;
}
```

</details>

<details>

<summary>Bước 2: Giải mã dữ liệu (Decrypted data)</summary>

![](/files/lDWqmxvL61iTMZUx9hTF)

Bên nhận áp dụng thuật toán **3DES** kết hợp với random key có được ở bước trước đó, giải mã encrypted data để nhận được **original data có chứa signature**.

Lưu ý

Schema để thành lập original data sẽ được mô tả cụ thể ở từng API.

#### Example:

```java
public static String decryptTripleDes(String encryptedData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
    byte[] originalData  = cipher.doFinal(Base64.decodeBase64(encryptedData));
    return new String(originalData, "UTF-8");
}
```

</details>

<details>

<summary>Bước 3: Xác thực chữ ký điện tử</summary>

![](/files/QiaWWe7L3PsOBj0h2Eiw)

Bên nhận sử dụng Thuật toán **RSA-SHA256 và Public key của bên gửi** để xác thực signature được lấy ra từ original data.

#### Example:

```java
public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}
```

</details>

<br>


# Place Order

## URL Yêu cầu thanh toán

### Đặc tả <a href="#ac-ta" id="ac-ta"></a>

* URL: \<PARTNER\_PAYMENT\_URL>?key=\<encrypted\_key>?data=\<encrypted\_data>
* Method: REDIRECT
* Mô tả: Dùng chuyển hướng người dùng đến hệ thống thanh toán của đối tác
* Yêu cầu bảo mật: [Mã hóa dữ liệu và kèm theo chữ ký điện tử](https://gotadi.gitbook.io/technical-documentation/~/changes/hxSZJK0E5x4hAwJJ8axI/vietnamese/yeu-cau-bao-mat)

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<product_type>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<product_type>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, optional)

    Mã dùng tham chiếu đến booking
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * total\_amount (String, optional)

    Tổng số tiền phải thanh toán

</details>

#### Example

```url
https://partner_x.com/payment?key=...?data=...
```


# API Get Booking Detail

### Đặc tả <a href="#ac-ta" id="ac-ta"></a>

* URL: \<API\_GATEWAY>/api/products/booking-detail
* Method: GET
* Mô tả: API lấy chi tiết thông tin booking
* Yêu cầu bảo mật: [API Key](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/)

### Parameter <a href="#parameter" id="parameter"></a>

<details>

<summary>Model</summary>

booking\_number (String, Required) `Mã tham chiếu đến booking`

</details>

#### Example

```
<API_GATEWAY>/api/products/booking-detail?booking_number=ADCO2107201221234
```

### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* id `(String, Mandatory) Mã định danh chi tiết booking`
* bookingNumber `(String, Mandatory) Mã dùng tham chiếu đến booking. Mã này là duy nhất.`
* bookingDate `(String, Mandatory) Ngày tạo booking`
* updatedDate `(String, Optional) Ngày cập nhật booking`
* travelerInfo `(JsonObject, Optional) Thông tin hành khách và người liên hệ`
* bookingInfo `(JsonObject, Mandatory) Thông tin chi tiết booking`

</details>

#### Example

```json
{
  "id": "BOD::221112::d89a3a7f-7667-497a-8db0-7e72374c078e",
  "updatedDate": "2022-11-12T14:46:50.834Z",
  "cacheType": "TICKET",
  "orgCode": "A::1",
  "agencyCode": "A::1",
  "branchCode": null,
  "saleChannel": "B2C_WEB",
  "channelType": "ONLINE",
  "supplierType": "AIR",
  "bookingCode": "BOD::221112::d89a3a7f-7667-497a-8db0-7e72374c078e",
  "bookingType": "DOME",
  "agentCode": null,
  "customerCode": "C::A::1|-1",
  "bookingNumber": "ADCO2211121960553",
  "bookingDate": "2022-11-12T14:46:50.829Z",
  "markupType": "PER_PAX_PER_SEGMENT",
  "bookingInfo": {
    "id": 1960553,
    "orgCode": "A::1",
    "agencyCode": "A::1",
    "saleChannel": "B2C_WEB",
    "channelType": "ONLINE",
    "supplierType": "AIR",
    "bookingCode": "BOD::221112::d89a3a7f-7667-497a-8db0-7e72374c078e",
    "bookingType": "DOME",
    "agentCode": null,
    "agentId": null,
    "agentName": null,
    "branchCode": null,
    "customerCode": "C::A::1|-1",
    "customerId": -1,
    "bookingNumber": "ADCO2211121960553",
    "roundType": "OneWay",
    "fromLocationCode": "HAN",
    "fromLocationName": "Sân bay Nội Bài",
    "fromCity": "Hà Nội",
    "toLocationCode": "SGN",
    "toLocationName": "Sân bay Tân Sơn Nhất",
    "toCity": "Hồ Chí Minh",
    "status": "PENDING",
    "bookingDate": "2022-11-12T14:46:50.829Z",
    "departureDate": "2022-11-26T05:00:00Z",
    "returnDate": null,
    "baseFare": 6499000,
    "equivFare": 50000,
    "serviceTax": 1090000,
    "vat": null,
    "totalFare": 7639000,
    "totalTax": 1090000,
    "agencyMarkupValue": 50000,
    "markupValue": 50000,
    "totalSsrValue": 70000,
    "totalCombo": null,
    "paymentTotalAmount": 0,
    "paymentFee": 0,
    "paymentType": "OTHER",
    "paymentStatus": "PENDING",
    "paymentDate": null,
    "paymentRefNumber": null,
    "partnerOrderId": null,
    "issuedStatus": "PENDING",
    "issuedDate": null,
    "customerFirstName": "VAN A",
    "customerLastName": "NGUYEN",
    "customerPhoneNumber1": "012345678",
    "customerPhoneNumber2": null,
    "customerEmail": "nguyenvana@gotadi.com",
    "taxReceiptRequest": false,
    "taxCompanyName": null,
    "taxAddress1": null,
    "taxAddress2": null,
    "taxNumber": null,
    "paymentBy": null,
    "paymentByCode": null,
    "issuedByCode": null,
    "refundBy": null,
    "refundByCode": null,
    "bookBy": "GUEST",
    "bookByCode": "C::A::1|-1",
    "displayPriceInfo": {
      "bookingNumber": "ADCO2211121960553",
      "baseFare": 6499000,
      "equivFare": 50000,
      "serviceTax": 1090000,
      "totalFare": 7639000,
      "totalTax": 1090000,
      "agencyMarkupValue": 50000,
      "markupValue": 50000,
      "totalSsrValue": 70000,
      "cancellationFee": 0,
      "paymentFee": 0,
      "discountAmount": 0,
      "additionalFee": 0,
      "additionalTaxPerTraveler": 0,
      "vat": null
    },
    "transactionInfos": [
      {
        "id": 1960605,
        "saleChannel": "B2C_WEB",
        "channelType": "ONLINE",
        "supplierType": "AIR",
        "bookingCode": "ADCO2211121960553::HAN-SGN::domd71e7045-f116-4106-9390-b6cbc6f0781c",
        "bookingNumber": "ADCO2211121960553",
        "status": "PENDING",
        "bookingDate": "2022-11-12T14:46:50.829Z",
        "supplierCode": "VN",
        "supplierName": "Vietnam Airline",
        "bookingRefNo": null,
        "passengerNameRecord": null,
        "timeToLive": null,
        "signature": null,
        "detail": "HAN-SGN :: VN 205",
        "originLocationCode": "HAN",
        "destinationLocationCode": "SGN",
        "carrierNo": "205",
        "checkIn": "2022-11-26T07:15:00Z",
        "checkOut": "2022-11-26T05:00:00Z",
        "baseFare": 6499000,
        "equivFare": 50000,
        "serviceTax": 1090000,
        "totalFare": 7639000,
        "totalTax": 1090000,
        "agencyMarkupValue": 50000,
        "markupValue": null,
        "totalSsrValue": 70000,
        "markupKey": "F2C|A::1|A|DOME|BAS|VNA|BUSINESS|-1",
        "markupCode": null,
        "markupFormula": null,
        "paymentAmount": null,
        "issuedStatus": "PENDING",
        "issuedDate": null,
        "etickets": null,
        "listETickets": null,
        "productSeqNumber": "ibe858002371120552",
        "productClass": "BUSINESS",
        "bookingDirection": "DEPARTURE",
        "noAdult": 1,
        "noChild": 0,
        "noInfant": 0,
        "quantity": 0,
        "unitId": null,
        "b2cBasePrice": 0,
        "b2cTaxAndFees": 0,
        "adjustNet": 0,
        "adjustContract": 0,
        "b2cTotalPrice": 0,
        "supplierBookingStatus": "PENDING",
        "supplierPaymentStatus": null,
        "allowHold": true,
        "onlyPayLater": false,
        "refundable": false
      }
    ],
    "agencyMarkupInfos": [
      {
        "agencyCode": "A::1",
        "baseFare": 6499000,
        "equivFare": 50000,
        "serviceTax": 1090000,
        "totalFare": 7639000,
        "totalTax": 1090000,
        "markupValue": 50000,
        "agencyMarkupValue": 50000
      }
    ],
    "numberOfTransactionMarkup": 1,
    "numberOfTransaction": 1,
    "contactInfos": [
      {
        "id": 1960852,
        "bookingNumber": "ADCO2211121960553",
        "contactType": null,
        "contactLevel": null,
        "gender": null,
        "firstName": "VAN A",
        "surName": "NGUYEN",
        "email": "nguyenvana@gotadi.com",
        "ccEmail": null,
        "country": null,
        "city": null,
        "address1": null,
        "address2": null,
        "postalCode": null,
        "phoneCode1": "84",
        "phoneNumber1": "012345678",
        "phoneCode2": null,
        "phoneNumber2": null,
        "bookingId": null,
        "dob": "1988-02-03T17:00:00Z"
      }
    ],
    "travelerInfos": [
      {
        "id": null,
        "bookingNumber": "ADCO2211121960553",
        "bookingTransCode": null,
        "email": null,
        "gender": "MALE",
        "firstName": "VAN A",
        "surName": "NGUYEN",
        "dob": "1988-02-04T00:00:00Z",
        "adultType": "ADT",
        "country": null,
        "city": null,
        "address1": null,
        "address2": null,
        "postalCode": null,
        "phoneNumber1": null,
        "phoneNumber2": null,
        "phoneNumber3": null,
        "phoneNumber4": null,
        "phoneNumber5": null,
        "documentType": null,
        "nationality": null,
        "documentNumber": null,
        "documentExpiredDate": null,
        "documentIssuedDate": null,
        "documentIssuingCountry": null,
        "memberCard": false,
        "memberCardType": null,
        "memberCardNumber": null,
        "memberCardExpiredDate": null,
        "orderIdx": 0,
        "eticket": null,
        "eTicketList": {},
        "adminFee": {},
        "bookingId": null,
        "paxFee": 0,
        "baseFare": 6499000,
        "baseTax": 1090000,
        "personRepresentation": null,
        "serviceRequests": [
          {
            "id": 1960807,
            "bookingNumber": "ADCO2211121960553",
            "bookingTransCode": "ADCO2211121960553::HAN-SGN::domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "bookingTravelerId": 1960753,
            "serviceType": "BAGGAGE",
            "fareCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "ssrId": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
            "ssrCode": "FreeBAGGAGE",
            "ssrName": "Xách tay 2x9kg + Ký gửi 1x32kg",
            "ssrAmount": 0,
            "bookingId": null,
            "eTicket": null,
            "bookingDirection": "DEPARTURE"
          },
          {
            "id": 1960806,
            "bookingNumber": "ADCO2211121960553",
            "bookingTransCode": "ADCO2211121960553::HAN-SGN::domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "bookingTravelerId": 1960753,
            "serviceType": "INSURANCE",
            "fareCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "ssrId": "BV-GTD-TRAVEL FLEXI-TVC",
            "ssrCode": "INS_FLEXI_TVC_BRONZE",
            "ssrName": "B%E1%BA%A3o%20hi%E1%BB%83m%20du%20l%E1%BB%8Bch",
            "ssrAmount": 70000,
            "bookingId": null,
            "eTicket": null,
            "bookingDirection": null
          }
        ]
      }
    ],
    "timeToLive": null,
    "supplierBookingStatus": "PENDING",
    "passengerNameRecords": "",
    "etickets": "",
    "cancellationStatus": null,
    "cancellationFee": 0,
    "cancellationNotes": null,
    "cancellationBy": null,
    "cancellationDate": null,
    "discountAmount": 0,
    "discountVoucherCode": null,
    "discountVoucherName": null,
    "discountRedeemId": null,
    "discountRedeemCode": null,
    "discountDate": null,
    "additionalFee": null,
    "taxPersonalInfoContact": null,
    "bookingNote": null,
    "internalBookingNote": null,
    "promotionID": null,
    "reasonCodePaymentFailed": null,
    "bookingFinalStatus": null,
    "bookingIssuedType": null,
    "allowHold": true,
    "onlyPayLater": false,
    "showPayLaterOption": true,
    "showPayNowOption": true,
    "refundable": false,
    "ownerBooking": false,
    "deleted": null
  },
  "groupPricedItineraries": [
    {
      "groupId": "6ac63940-5aa8-463e-87a7-646bf66a5bcc",
      "airline": "VN",
      "airlineName": "Vietnam Airlines",
      "airSupplier": "VN",
      "fightNo": "205",
      "flightType": "DOMESTIC",
      "roundType": "ONEWAY",
      "originLocationCode": "HAN",
      "originLocationName": "Sân bay Nội Bài",
      "originCity": "Hà Nội",
      "originCountryCode": null,
      "originCountry": null,
      "destinationLocationCode": "SGN",
      "destinationLocationName": "Sân bay Tân Sơn Nhất",
      "destinationCity": "Hồ Chí Minh",
      "destinationCountryCode": null,
      "destinationCountry": null,
      "requiredFields": null,
      "aircraft": "Airbus A321",
      "vnaArea": "SouthTrip",
      "arrivalDateTime": "2022-11-26T07:15:00Z",
      "returnDateTime": null,
      "departureDateTime": "2022-11-26T05:00:00Z",
      "totalPricedItinerary": 1,
      "pricedItineraries": [
        {
          "sequenceNumber": "ibe858002371120552",
          "directionInd": "DEPARTURE",
          "ticketType": "ETICKET",
          "validatingAirlineCode": "VN",
          "validatingAirlineName": "Vietnam Airlines",
          "fightNo": "205",
          "airItineraryPricingInfo": {
            "fareSourceCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "fareType": "PUBLIC",
            "divideInPartyIndicator": false,
            "fareInfoReferences": null,
            "itinTotalFare": {
              "baseFare": {
                "amount": 6499000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "comboMarkup": null,
              "equivFare": {
                "amount": 50000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "serviceTax": {
                "amount": 1090000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "totalFare": {
                "amount": 7639000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "totalTax": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "totalPaxFee": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
              }
            },
            "adultFare": {
              "passengerTypeQuantities": {
                "code": "ADT",
                "quantity": 1
              },
              "fareBasisCodes": null,
              "passengerFare": {
                "baseFare": {
                  "amount": 6499000,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "comboMarkup": null,
                "equivFare": null,
                "serviceTax": {
                  "amount": 1090000,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "taxes": null,
                "totalFare": {
                  "amount": 7589000,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "totalPaxFee": {
                  "amount": 0,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "surcharges": [
                  {
                    "amount": 0,
                    "indicator": "Ticket fee per booking",
                    "type": "Ticket fee per booking"
                  }
                ]
              }
            },
            "childFare": null,
            "infantFare": null
          },
          "originDestinationOptions": [
            {
              "originLocationCode": "HAN",
              "originLocationName": "Sân bay Nội Bài",
              "originCity": "Hà Nội",
              "originDateTime": "2022-11-26T05:00:00Z",
              "destinationLocationCode": "SGN",
              "destinationLocationName": "Sân bay Tân Sơn Nhất",
              "destinationCity": "Hồ Chí Minh",
              "destinationDateTime": "2022-11-26T07:15:00Z",
              "flightDirection": "D",
              "journeyDuration": 135,
              "flightSegments": [
                {
                  "departureAirportLocationCode": "HAN",
                  "departureAirportLocationName": "Sân bay Nội Bài",
                  "departureCity": "Hà Nội",
                  "departureDateTime": "2022-11-26T05:00:00Z",
                  "arrivalAirportLocationCode": "SGN",
                  "arrivalAirportLocationName": "Sân bay Tân Sơn Nhất",
                  "arrivalCity": "Hồ Chí Minh",
                  "arrivalDateTime": "2022-11-26T07:15:00Z",
                  "departureAirport": {
                    "airport": "HAN",
                    "scheduledTime": "2022-11-25T22:00:00",
                    "utcOffset": {
                      "hours": 7,
                      "minutes": 420
                    }
                  },
                  "arrivalAirport": {
                    "airport": "SGN",
                    "scheduledTime": "2022-11-26T00:15:00",
                    "utcOffset": {
                      "hours": 7,
                      "minutes": 420
                    }
                  },
                  "cabinClassCode": "C",
                  "cabinClassName": "BUSINESS",
                  "cabinClassText": "Business Flex",
                  "eticket": true,
                  "flightNumber": "205",
                  "journeyDuration": 135,
                  "marketingAirlineCode": "VN",
                  "marriageGroup": null,
                  "mealCode": null,
                  "adultBaggage": null,
                  "childBaggage": null,
                  "infantBaggage": null,
                  "operatingAirline": {
                    "code": "VN",
                    "name": "Vietnam Airlines",
                    "equipment": null,
                    "flightNumber": "205"
                  },
                  "resBookDesignCode": "C",
                  "seatsRemaining": null,
                  "stopQuantity": 0,
                  "stopQuantityInfo": null,
                  "flightDirection": "D",
                  "fareCode": null,
                  "fareBasicCode": null,
                  "supplierJourneyKey": "b+T7Lz8Bk6JHev8ZaYn6JdksP71z9ZD2metfP5B9ooZW6R7siI3w/WBDkelhRaA/GU5MCdNYgtx+o5Th5+oS4ANw2mFbDR3jPyIFXZkJiG1Xxe8RXcWecVpXCUVOWsjLDmaO6GNYKdjgTzxoVC4fTLPA4kxTQMWp4y7aBysm/eI/pz3OR10FpI7tJO45Lmj6xiIIVI9PCT18TN1pVZ35/rNUG2MQJWEQe9akNYB9uVJnt0yZKGJ5Jh+znYqWMJGufVYhKrGXcZVUztrGNEjN5FAZOVgK/nWhy0oBmlhKT+YsM0p589zdfHeRe3Tbw3RuOa52GefkpZ9YlxH4RL1u6ZNK353DlVhsjJt/ze/ecZW6IB7fQrYma5znykdxOXFJtQxp68xt6AAdJVSt4oZUj7EvqHLYdLXgu2etX9wLtOio1JC7XOl+nu0Dz/NVdx27tC/XZtmPblJDnyTO/0BKidWtaRCy13WBNbBNZvEMuKTO9EMD52NSFUuAQFNn1glMqRgs32oD4M5AtFgPR4wvkpyxnGICY0cva6IRgsMPjuVaaEwFQJbWskY4kMjxCcpoMMOfVyWYykSzqBjrSxEbjlC2kfUf/qcH2a+VjzSftFZ4xgxv9BVcyjEvt6nfFl9eNxB0u2sH6O6Jr+V4yhqo8AEuXaK3q1A/SWJt5mmZ6q0hUQq+9gri90iOWfzJEIxAMM3/Xj0YWY8A0zb58m6zBBtIMuw3QYMiQ40hziEnfGj1NJcxcDm7+Q/+5YCEzKGYxHpQMLFjywU5Snmm0kD+Rf52kuJm2TTVlQvZ3J4xYUyD8/EREL2NLtyXe4hpsSTxfrQbnEqTtlQhBMCqKiBDfXIe6ci7LM0PDV06ki/Mr/h4Do3x/GW8+PZuH+80+CGOhlypqA9y5xI352R2wyFtYjiaevFmDjITagldXGi/OsN84gG9oWGy91MydmrEOD8WSKv4Er2lkz6pF+0LvDrlUkgfdGU7zaw51VWxbDL8lddV2rq3WOSfDl66hhlsRhHzMSV9RNwLYvoCJWKBfFChN/jlmHE7HesnOyp3JGvG+ZThwZ1DXwDzmD3t+XEtWTNy0vhH1Qg/yd7Wonh2Si9r0ClpwgzKx1ScV9oauAER/aCoc+z2aODeba83bcSiG9gYWU1S5MHsIluEPtWPzEcTQVQeuuwGkzNFbeAmgi77a2CEjDq42UQ+gQxhKrBqtIyXJRSqRIaQQWFoUTNLJYaz9x7Owr/BaR58MzDSDd7i8wOYcQMHtpFAelzER9UuAyrOylpuIH/1H/b4rntDUl2UT0iLKiZ0biSw7FiKNgbDfPeHK+i2lvMAxbVz50Kpf1SzCZ0AysZKjHoQRItdPi+CQhqPqR7ivcye5Y8NU9tgGXBo4WJ/J5QhXm+3VajARlJ7EREq6H8DV+2Dlzsiiy2IpMmB1DzsnBRaS5lKiOGMTnMHZuvOXPSKIz2jEpLpcjcG2Gt0GHO8B0fVrYo7dRRIuw==",
                  "supplierFareKey": null,
                  "aircraft": "Airbus A321"
                }
              ],
              "cabinClassName": "BUSINESS",
              "key": null
            }
          ],
          "cabinClassName": "BUSINESS",
          "validReturnCabinClasses": null,
          "baggageItems": [
            {
              "id": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
              "name": "Xách tay 2x9kg + Ký gửi 1x32kg",
              "code": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
              "amount": 0,
              "serviceType": "BAGGAGE",
              "fareCode": null,
              "direction": null,
              "note": ""
            }
          ],
          "mealItems": null,
          "allowHold": true,
          "onlyPayLater": false,
          "refundable": false,
          "passportMandatory": true
        }
      ],
      "tourCode": null,
      "osiCode": null
    }
  ],
  "hotelAvailability": null,
  "hotelProductPayload": null,
  "hotelProduct": null,
  "tourActivityProduct": null,
  "tourActivityBookingPayload": null,
  "offlineBooking": null,
  "offlineBookingRequest": null,
  "travelerInfo": {
    "airTravelers": [
      {
        "idx": 0,
        "transCode": null,
        "productCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
        "passengerId": null,
        "passengerType": "ADT",
        "gender": "MALE",
        "passengerName": {
          "title": "MALE",
          "firstName": "VAN A",
          "lastName": "NGUYEN"
        },
        "dateOfBirth": "1988-02-04T00:00:00Z",
        "passport": {
          "passportNumber": null,
          "passportType": null,
          "country": null,
          "expiryDate": null
        },
        "frequentFlyerType": null,
        "frequentFlyerNumber": null,
        "phone1": null,
        "phone2": null,
        "email": null,
        "specialServiceRequest": {
          "ssrItems": [
            {
              "id": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
              "name": "Xách tay 2x9kg + Ký gửi 1x32kg",
              "code": "FreeBAGGAGE",
              "amount": 0,
              "serviceType": "BAGGAGE",
              "fareCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
              "direction": "DEPARTURE",
              "note": ""
            }
          ],
          "mealPreference": "OTHER",
          "seatPreference": "AISLE"
        },
        "extraServicesRequest": null,
        "eticket": null
      }
    ],
    "contactInfos": [
      {
        "title": null,
        "firstName": "VAN A",
        "lastName": "NGUYEN",
        "areaCode": "84",
        "countryCode": null,
        "city": null,
        "phoneNumber1": "012345678",
        "phoneNumber2": null,
        "email": "nguyenvana@gotadi.com",
        "postCode": null
      }
    ]
  },
  "isPerBookingType": false
}
```


# API Commit

API Ghi nhận thanh toán và xác nhận xuất vé

### Đặc tả <a href="#ac-ta" id="ac-ta"></a>

* URL: \<API\_GATEWAY>/api/partner/commit
* Method: POST
* Mô tả: Yêu cầu commit booking được cập nhật đầy đủ thông tin và hoàn tất thanh toán
* Yêu cầu bảo mật: [Mã hóa dữ liệu và kèm theo chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

### Request <a href="#request" id="request"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, required)

    Mã dùng tham chiếu đến booking
  * partner\_trans\_id (String, optional)

    Mã định danh giao dịch của đối tác. Nếu đối tác không truyền giá trị cho trường này, giá trị mặc định sẽ được gán bằng booking\_number
  * product\_type (String, required)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```

### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* key (String, required)

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (String, required)

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking
  * error\_code (String, required)

    [Mã lỗi](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/overview/#ma-loi)
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * properties (String, optional)

    Các thông tin mở rộng trả về cho đối tác. `Json string`
  * return\_url (String, optional)

    Trang hiển thị kết quả giao dịch của Gotadi. Sử dụng trong trường hợp đối tác không tự xây dựng trang hiển thị kết quả cuối cùng.
  * total\_amount (Double, required)

    Tổng số tiền phải thanh toán.

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```

## Ví dụ về trang kết quả Gotadi

<figure><img src="/files/PN1e1Vs9gPjfpELYdUsX" alt=""><figcaption></figcaption></figure>


# API Check commit result

API Truy vấn kết quả xuất vé/phòng

### Đặc tả <a href="#ac-ta" id="ac-ta"></a>

* URL: \<API\_GATEWAY>api/partner/query-trans
* Method: POST
* Mô tả: API cho phép đối tác truy vấn kết quả xuất vé/phòng
* Yêu cầu bảo mật: [Mã hóa dữ liệu và kèm theo chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

### Request <a href="#request" id="request"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). Cách thành lập tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách thành lập tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, required)

    Mã dùng tham chiếu đến booking

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```

### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* key (String, required)

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (String, required)

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking
  * error\_code (String, required)

    [Mã lỗi](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview)
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * properties (String, optional)

    Các thông tin mở rộng trả về cho đối tác. `Json string`
  * return\_url (String, optional)

    Trang hiển thị kết quả giao dịch của Gotadi. Sử dụng trong trường hợp đối tác không tự xây dựng trang hiển thị kết quả cuối cùng.
  * total\_amount (Double, required)

    Tổng số tiền phải thanh toán.

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```


# Phương thức SDK

Tài liệu mô tả các vấn đề liên quan đến việc triển khai hình thức kết nối Mobile SDK giữa Đối tác B2B2C (trong tài liệu này gọi là Đối tác) và Gotadi.

### Tài liệu liên quan <a href="#tai-lieu-lien-quan" id="tai-lieu-lien-quan"></a>

* Thông tin kết nối giữa giữ Gotadi và Đối tác.
* Kịch bản kiểm kiểm thử.
* Source code mẫu.

***

### Thuật ngữ và viết tắt <a href="#thuat-ngu-va-viet-tat" id="thuat-ngu-va-viet-tat"></a>

| Viết tắt | Từ đầy đủ                          | Mô tả                                                                                                                                                                   |
| -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL      | Uniform Resource                   | được dùng để tham chiếu tới tài nguyên trên Internet.                                                                                                                   |
| SSL      | Secure Sockets Layer               | giao thức mật mã được thiết kế để cung cấp truyền thông an toàn qua Internet.                                                                                           |
| HTTPS    | Hypertext Transfer Protocol Secure | là một giao thức kết hợp giữa giao thức HTTP và giao thức bảo mật SSL hay TLS cho phép trao đổi thông tin một cách bảo mật trên Internet.                               |
| 3DES     | Triple DES (3DES hay TDES)         | là một thuật toán khóa đối xứng, áp dụng thuật toán mã hóa DES ba lần cho mỗi khối dữ liệu.                                                                             |
| RSA      | Rivest–Shamir–Adleman              | là một thuật toán mật mã hóa khóa công khai. Đây là thuật toán đầu tiên phù hợp với việc tạo ra chữ ký điện tử đồng thời với việc mã hóa.                               |
| SHA-256  | Secure Hash Algorithm              | là giải thuật dùng để chuyển một đoạn dữ liệu nhất định thành một đoạn dữ liệu có chiều dài không đổi với xác suất khác biệt cao. SHA-256 (trả lại kết quả dài 256 bit) |
|          | Chữ ký điện tử                     | Thông tin đi kèm theo dữ liệu (văn bản, hình ảnh, video…) nhằm mục đích xác định người chủ của dữ liệu đó                                                               |
| M        | Mandatory                          | Bắt buộc phải có khi gọi API.                                                                                                                                           |
| O        | Optional                           | Không yêu cầu khi gọi API, tùy từng mục đích sử dụng mà có truyền tham số này không                                                                                     |
| C        | Condition                          | Dựa trên Condition của field khác khi gọi API mà field này được quyết định là Mandatory hay Optional                                                                    |

### Quy trình kết nối <a href="#quy-trinh-ket-noi" id="quy-trinh-ket-noi"></a>

<details>

<summary>Bước 1</summary>

Đối tác cung cấp thông tin để Gotadi khởi tạo tài khoản đại lý trên môi trường sandbox. Thông tin bao gồm:

* Thông tin công ty:
  * Tên công ty
  * Địa chỉ công ty
  * Địa chỉ website
* Thông tin quản trị viên:
  * Họ tên
  * Địa chỉ email
  * Số điện thoại
* Thông tin kết nối:
  * Đường dẫn tới hệ thống của đối tác: Link sản phẩm, Link cổng thanh toán, …
  * Các tài liệu tích hợp liên quan
  * Public key của đối tác. (RSA public key chiều dài tối thiểu 1024 bit)

</details>

<details>

<summary>Bước 2</summary>

Gotadi khởi tạo tài khoản dựa vào thông tin Đối tác cung cấp và gửi lại các thông tin tài khoản cho Đối tác. Thông tin bao gồm:

* Link kích hoạt tài khoản và đăng nhập vào B2B portal của Gotadi (Gửi vào email quản trị viên).
* Đường dẫn tới hệ thống của Gotadi: `<gotadi_api_gateway>`
* Public key của Gotadi. (RSA public key chiều dài tối thiểu 1024 bit)
* Tham số truyền vào request header:
  * Khóa truy cập API: `<api_key>`
  * Mã truy cập của đối tác: `<access_code>`

</details>

<details>

<summary>Bước 3</summary>

Đối tác kích hoạt tài khoản và sử dụng thông tin ở bước 2 tiến hành kết nối và kiểm thử trên môi trường sandbox

</details>

<details>

<summary>Bước 4</summary>

Nghiệm thu Sandbox và Golive dịch vụ

</details>

### HTTP Response code <a href="#http-response-code" id="http-response-code"></a>

| Code | Mô tả                 |
| ---- | --------------------- |
| 200  | Success               |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 402  | Forbidden             |
| 402  | Not Found             |
| 500  | Internal Server Error |
| 503  | Service Unavailable   |

### Mã lỗi <a href="#ma-loi" id="ma-loi"></a>

| Mã lỗi | Mô tả                                                       |
| ------ | ----------------------------------------------------------- |
| 00     | Yêu cầu đã được xử lý thành công.                           |
| 01     | Yêu cầu đang được xử lý.                                    |
| 02     | Yêu cầu đã được xử lý thất bại.                             |
| 03     | Yêu bị từ chối do Xác thực tài khoản đại lý khoản thất bại. |
| 04     | Yêu bị từ chối do Chữ ký điện tử không hợp lệ.              |
| 05     | Yêu bị từ chối do Giải mã dữ liệu không thành công.         |
| 06     | Yêu bị từ chối do Mã xác thực (Access Code) không hợp lệ.   |
| 07     | Yêu bị từ chối do Dữ liệu sai định dạng.                    |
| 08     | Yêu bị từ chối do Đã được xử lý trước đó.                   |
| 09     | Yêu cầu chưa được xử lý.                                    |
| 10     | Thông tin tài khoản không tìm thấy                          |
| 99     | Lỗi khác.                                                   |

### Luồng tích hợp <a href="#luong-tich-hop" id="luong-tich-hop"></a>

![](https://developer.gotadi.com/img/b2b2c-sdk-integration-flow.jpg)

#### Mô tả chi tiết luồng tích hợp:&#x20;

**Bước 3 - 4:**&#x20;

1. Sau khi search-book ở GotadiSDK sẽ return callback có chứa thông tin BookingNumber.
2. Partner nhận thông tin BookingNumber -> push tới \[Screen Thanh toán của Partner] và gọi API /booking-detail để lấy thông tin thanh toán.
3. Partner thanh toán thành công/ thất bại -> push tới \[Screen Hoá đơn của Partner] và gọi API /booking-detail để lấy thông tin bookingInfo.
4. Ở \[Screen Hoá đơn của Partner] -> User chọn \[Quản lý vé] -> push tới \[Screen Quản lý Booking của GotadiSDK]


# API Login

{% content-ref url="/pages/YIPLbuqUqC088fTAaaac" %}
[API Login](/vietnamese/doi-tac-b2b2c/phuong-thuc-api/api-login)
{% endcontent-ref %}


# Yêu cầu bảo mật

{% content-ref url="/pages/F0qCqpb9wo0zWQDTVkiR" %}
[Yêu cầu bảo mật](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/yeu-cau-bao-mat)
{% endcontent-ref %}


# Initiate SDK


# Init IOS SDK

Hướng dẫn tích hợp IOS Gotadi SDK

{% hint style="info" %}
SDK link: <https://bitbucket.org/gotadigroup/gtd-ios-sdk>
{% endhint %}

### Import IOS Gotadi SDK vào project <a href="#import-ios-gotadi-sdk-vao-project" id="import-ios-gotadi-sdk-vao-project"></a>

Thêm thư viện Swift Package Manager sử dụng SDK link ở trên để add library vào project.

<div><figure><img src="/files/yglEucypuYYsRGdWaE8m" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Y5gHrllwrH2vFW4KXkvd" alt=""><figcaption></figcaption></figure> <figure><img src="/files/wwSf95JVKEcRKee81OFB" alt=""><figcaption></figcaption></figure></div>

```
Build Project lần đầu để có thể import thư viện GotadiSDK
```

### Example Code khởi tạo IOSGotadiSDK <a href="#example-code-khoi-tao-iosgotadisdk" id="example-code-khoi-tao-iosgotadisdk"></a>

* Import IOSGotadiSDK
* Khởi tạo `IOSGotadiSDK` ở viewDidLoad để tối ưu performance
* Init SDK and setup `environment` of partner with `params`:
  * `env` : Môi trường deploy `[uat | prod]`
  * `partnername`: Partner Name , example: `“vib”`
  * `language`: Ngôn ngữ hiển thị `[”vi” | “en”]`
  * `token`: `JWT Token` lấy được sau khi authorize từ API authentication của Gotadi
  * `theme`: `primary`, `secondary`

```swift
import UIKit
import IOSGotadiSDK
class ViewController: UIViewController {
    let gotadiSDK: IOSGotadiSDK = IOSGotadiSDK.shared
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

        //TODO: Call API authorize get Token from Gotadi
        gotadiSDK.setup(partnerSetting:
                        GotadiPartnerSetting(
                            env: "uat",
                            partnername: "vib",
                            language: "en", token: "token", theme: "primary"))
    }

        //TODO: Handle action push to gotadi search book
    @IBAction func gotoGotadiSearchBook(_ sender: Any) {
        gotadiSDK.pushToHomePartner(
            partnerViewController: self,
            handlePayment: {[weak self] gotadiViewController, bookingNumber in
                //TODO: Handle payment after checkout and receive bookingInfo
                print(bookingNumber)
                if let paymentViewController  =
                    self?.storyboard?.instantiateViewController(withIdentifier: "PaymentViewController")
                    as? PaymentViewController {
                        paymentViewController.bookingNumberResult = bookingNumber
                        gotadiViewController.navigationController?.pushViewController(paymentViewController, animated: true)
                }
        })
    }
}
```


# Init Android SDK

Hướng dẫn tích hợp Android Gotadi SDK

### Import Android Gotadi SDK vào project <a href="#import-android-gotadi-sdk-vao-project" id="import-android-gotadi-sdk-vao-project"></a>

#### 1. Download `AndroidGotadiSDK` từ SDK link. <a href="#id-1-download-androidgotadisdk-tu-sdk-link" id="id-1-download-androidgotadisdk-tu-sdk-link"></a>

#### 2. Import Module `AndroidGotadiSDK` vào project Android <a href="#id-2-import-module-androidgotadisdk-vao-project-android" id="id-2-import-module-androidgotadisdk-vao-project-android"></a>

<div><figure><img src="/files/qVtduIfqq2pmc7tEL7hm" alt=""><figcaption></figcaption></figure> <figure><img src="/files/VQp2ju2i90FhsRt6PydO" alt=""><figcaption></figcaption></figure> <figure><img src="/files/YOfXnzHmZ72sAIMsfODJ" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

```javascript
Sau khi import sẽ thấy config `include ':AndroidGotadiSDK'` trong file `settings.gradle`
```

{% endhint %}

```gradle
rootProject.name = "My Application"
include ':app'
include ':AndroidGotadiSDK'
```

#### 3. Add dependencies `AndroidGotadiSDK` trong file `build.gradle` để sử dụng thư viện <a href="#id-3-add-dependencies-androidgotadisdk-trong-file-buildgradle-e-su-dung-thu-vien" id="id-3-add-dependencies-androidgotadisdk-trong-file-buildgradle-e-su-dung-thu-vien"></a>

```gradle
dependencies {
    implementation project(path: ':AndroidGotadiSDK')
}
```

#### 4. Add maven repositories `AndroidGotadiSDK` trong file `build.gradle` để sử dụng libs của SDK <a href="#id-4-add-maven-repositories-androidgotadisdk-trong-file-buildgradle-e-su-dung-libs-cua-sdk" id="id-4-add-maven-repositories-androidgotadisdk-trong-file-buildgradle-e-su-dung-libs-cua-sdk"></a>

```gradle
allprojects {
    repositories {
        maven {
            url "${project.rootDir}/AndroidGotadiSDK/libs"
        }
        maven {
            url 'https://storage.googleapis.com/download.flutter.io'
        }
    }
}
```

### Example Code khởi tạo AndroidGotadiSDK <a href="#example-code-khoi-tao-androidgotadisdk" id="example-code-khoi-tao-androidgotadisdk"></a>

* Import package của SDK để sử dụng các function khởi tạo activity Gotadi Search Book

```kotlin
import com.gotadi.AndroidGotadiSDK.GotadiAdapter
import com.gotadi.AndroidGotadiSDK.GotadiCallback
import com.gotadi.AndroidGotadiSDK.GotadiPartnerSetting
```

* Khởi tạo GotadiSDK để tối ưu performance
* Init environment Setting trước khi run GotadiActivity
* Init setting `environment` of partner with `params`:
  * `env` : Môi trường deploy `[uat | prod]`
  * `partnername`: Partner Name , example: `“vib”`
  * `language`: Ngôn ngữ hiển thị `[”vi” | “en”]`
  * `token`: `JWT Token` lấy được sau khi authorize từ API authentication của Gotadi
  * `theme` : `primary`, `secondary`

```kotlin
import com.gotadi.AndroidGotadiSDK.AndroidGotadiSDK
import com.gotadi.AndroidGotadiSDK.GotadiCallback
import com.gotadi.AndroidGotadiSDK.GotadiPartnerSetting

class GTDExampleAppActivity : AppCompatActivity() {
    private var gotadiSDK: AndroidGotadiSDK? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_my_app)
        val button = findViewById<Button>(R.id.myappButton)
        //Call API and get gotadi Token
        gotadiSDK = AndroidGotadiSDK(
            this,
            setting = GotadiPartnerSetting("uat", "vib", "vi","token","
primary"))
        button.setOnClickListener {
            val intent = gotadiSDK?.createGotadiIntent()
            intent?.let {
                startActivity(intent)
            }
            gotadiSDK?.actionHandler?.bookkingResultCallback = object : GotadiCallback {
                override fun onCallPayment(gotadiActivity: Context, bookingNumber: String) {
                                        //Handle payment after checkout here
                    println("bookkingResultCallback - onCallPayment")
                    gotadiActivity.startActivity(Intent(gotadiActivity, GTDPartnerPaymentActivity::class.java))
                    println(bookingNumber)
                }
            }
        }
    }

    override fun onDestroy() {
        super.onDestroy()
                //Destroy SDK avoid leak memory
        gotadiSDK?.dispose()
        println("GTDExampleAppActivity is destroy")
    }
}
```


# Place order

{% content-ref url="/pages/yMglql9rTPD8c6UTFrTb" %}
[Place Order](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/place-order)
{% endcontent-ref %}


# API Commit

{% content-ref url="/pages/cmb2mk8ZSCJ2JfJjAJpP" %}
[API Commit](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/api-commit)
{% endcontent-ref %}


# API Get booking detail

{% content-ref url="/pages/Lk224zusTdUVpZeIoNlJ" %}
[API Get Booking Detail](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/api-get-booking-detail)
{% endcontent-ref %}


# API Check commit result

{% content-ref url="/pages/vxq1Kcm6X1SgMZ0kDa9C" %}
[API Check commit result](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/api-check-commit-result)
{% endcontent-ref %}


# Phương thức API

Tài liệu mô tả các vấn đề liên quan đến việc triển khai hình thức kết nối API giữa Đối tác B2B2C (trong tài liệu này gọi là Đối tác) và Gotadi.

### Tài liệu liên quan <a href="#tai-lieu-lien-quan" id="tai-lieu-lien-quan"></a>

* Thông tin kết nối giữa giữ Gotadi và Đối tác.
* Kịch bản kiểm kiểm thử.
* Source code mẫu.

***

### Thuật ngữ và viết tắt <a href="#thuat-ngu-va-viet-tat" id="thuat-ngu-va-viet-tat"></a>

* **URL** `Uniform Resource` *được dùng để tham chiếu tới tài nguyên trên Internet.*
* **SSL** `Secure Sockets Layer` *là các giao thức mật mã được thiết kế để cung cấp truyền thông an toàn qua Internet.*
* **HTTPS** `Hypertext Transfer Protocol Secure` *là một giao thức kết hợp giữa giao thức HTTP và giao thức bảo mật SSL hay TLS cho phép trao đổi thông tin một cách bảo mật trên Internet.*
* **3DES** `Triple DES (3DES hay TDES)` *là một thuật toán khóa đối xứng, áp dụng thuật toán mã hóa DES ba lần cho mỗi khối dữ liệu.*
* **RSA** `Rivest–Shamir–Adleman` *là một thuật toán mật mã hóa khóa công khai. Đây là thuật toán đầu tiên phù hợp với việc tạo ra chữ ký điện tử đồng thời với việc mã hóa.*
* **SHA-256** `Secure Hash Algorithm` *là giải thuật dùng để chuyển một đoạn dữ liệu nhất định thành một đoạn dữ liệu có chiều dài không đổi với xác suất khác biệt cao. SHA-256 (trả lại kết quả dài 256 bit)*
* **Chữ ký điện tử** *Thông tin đi kèm theo dữ liệu (văn bản, hình ảnh, video…) nhằm mục đích xác định người chủ của dữ liệu đó*

***

### Yêu cầu bảo mật <a href="#yeu-cau-bao-mat" id="yeu-cau-bao-mat"></a>

#### 1. Kênh truyền SSL/HTTPS <a href="#id-1-kenh-truyen-sslhttps" id="id-1-kenh-truyen-sslhttps"></a>

SSL/HTTPS được áp dụng để truyền nhận dữ liệu giữa hệ thống của đối tác và Gotadi. Mục đích sử dụng SSL/HTTPS là giúp dữ liệu trao đổi giữa đối tác và Gotadi được mã hóa, khó bị đánh cắp và giả mạo.

#### 2. Header bảo mật và thống kê lưu lượng truyền <a href="#id-2-header-bao-mat-va-thong-ke-luu-luong-truyen" id="id-2-header-bao-mat-va-thong-ke-luu-luong-truyen"></a>

Tất cả các request từ phía đối tác gọi sang hệ thống của Gotadi phải chứa các Headers bên dưới để phục vụ các nghiệp vụ về bảo mật và thống kê số liệu của Gotadi:

Lưu ý

Giá trị `<api_key>` và `<access_code>` do Gotadi cung cấp cho Đối tác.

#### 3. Mã hóa dữ liệu truyền và xác thực chữ ký điện tử <a href="#id-3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu" id="id-3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu"></a>

Request/response giữa Gotadi và Đối tác ở một số API quan trọng được yêu cầu mã hóa bằng thuật toán mã hóa bất đối xứng 3DES và kèm theo chữ ký điện tử để xác thực. Thuật toán mã hóa, giải mã sẽ được mô tả cụ thể trong tài liệu này.

Lưu ý

Các API có yêu cầu mã hóa dữ liệu và kèm theo chữ ký điện tử sẽ được ghi chú ở phần Yêu cầu bảo mật.

**3.1 Mã hóa dữ liệu gửi đi**

**Input** Original data, RSA PublicKey của bên nhận, RSA Private Key của bên gửi

**Output** Encrypted Key, Encrypted Data

<details>

<summary>Bước 1: Khởi tạo khóa ngẫu nhiên (Random key)</summary>

<img src="https://developer.gotadi.com/img/1.png" alt="" data-size="original">

Hàm 3DES Key Generate được dùng để tạo random key dựa theo tiêu chí DESedeKeySpec (Độ dài key: 24 byte). Mỗi request/response sẽ được cấp một random key riêng biệt.

Example:

Java

```
    public static byte[] generateKey() throws Exception {
        KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede");
        SecretKey secretKey = keyGenerator.generateKey();
        SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DESede");
        DESedeKeySpec deSedeKeySpec = (DESedeKeySpec)   secretKeyFactory.getKeySpec(secretKey, DESedeKeySpec.class);
        byte[] randomKey = deSedeKeySpec.getKey();
        return randomKey;
    }
```

</details>

<details>

<summary>Bước 2: Mã hóa khóa ngẫu nhiên (Encrypted random key)</summary>

<img src="https://developer.gotadi.com/img/2.png" alt="" data-size="original">

Random key được tạo ra ở bước 1 sẽ được mã hóa bằng thuật toán mã hóa bất đối xứng RSA bằng **Public key của bên nhận**.

Example:

Java

```
public static String encryptRSA(byte[] randomKey, String xmlPublicKey) throws Exception {
    Cipher cipher = createCipherEncrypt(xmlPublicKey);
    byte[] encryptedKey = cipher.doFinal(randomKey);
    return Base64.encodeBase64URLSafeString(encryptedKey);
}
```

</details>

<details>

<summary>Bước 3: Khởi tạo chữ ký chữ ký điện tử (Signature)</summary>

<img src="https://developer.gotadi.com/img/3.png" alt="" data-size="original">

Bên gửi áp dụng thuật toán **RSA-SHA256** kết hợp với **Private key của chính mình** để ký chữ ký điện tử trên signature data.

Lưu ý

Schema để thành lập signature data sẽ được mô tả cụ thể ở từng API.

Example:

Java

```
public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
```

</details>

<details>

<summary>Bước 4: Mã hóa dữ liệu (Encrypted data)</summary>

<img src="https://developer.gotadi.com/img/4.png" alt="" data-size="original">

**Original data có chứa signature** sẽ được mã hóa bằng thuật toán **3DES** với random key đã được tạo ra ở bước trước đó.

Lưu ý

Schema để thành lập original data sẽ được mô tả cụ thể ở từng API.

Example:

Java

```
public static String encryptTripleDes(String originalData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
    byte[] encryptedData = cipher.doFinal(originalData.getBytes("UTF-8"));
    return Base64.encodeBase64URLSafeString(encryptedData);
}
```

</details>

**3.2 Giải mã dữ liệu nhận được và xác thực chữ ký điện tử**

**Input** Encrypted Key, Encrypted Data, RSA PrivateKey của bên nhận, RSA PublicKey của bên gửi

**Output** Original Data, Verify Result

<details>

<summary>Bước 1: Giải mã khóa ngẫu nhiên 3DES (Decrypted random key)</summary>

<img src="https://developer.gotadi.com/img/5.png" alt="" data-size="original">

Bên nhận sử dụng **Private key của chính mình** để giải mã encrypted key nhận được.

Example:

Java

```
public static byte[] decryptRSAToByte(String encryptedKey, String xmlPrivateKey) throws Exception {
    Cipher cipher = createCipherDecrypt(xmlPrivateKey);
    byte[] bts = Base64.decodeBase64(encryptedKey);
    byte[] randomKey = cipher.doFinal(bts);
    return randomKey;
}
```

</details>

<details>

<summary>Bước 2: Giải mã dữ liệu (Decrypted data)</summary>

<img src="https://developer.gotadi.com/img/6.png" alt="" data-size="original">

Bên nhận áp dụng thuật toán **3DES** kết hợp với random key có được ở bước trước đó, giải mã encrypted data để nhận được **original data có chứa signature**.

Lưu ý

Schema để thành lập original data sẽ được mô tả cụ thể ở từng API.

Example:

Java

```
public static String decryptTripleDes(String encryptedData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
    byte[] originalData  = cipher.doFinal(Base64.decodeBase64(encryptedData));
    return new String(originalData, "UTF-8");
}
```

</details>

<details>

<summary>Bước 3: Xác thực chữ ký điện tử</summary>

<img src="https://developer.gotadi.com/img/7.png" alt="" data-size="original">

Bên nhận sử dụng Thuật toán **RSA-SHA256 và Public key của bên gửi** để xác thực signature được lấy ra từ original data.

Example:

Java

```
public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}
```

</details>

***

### Kết nối <a href="#ket-noi" id="ket-noi"></a>

#### 1. Quy trình kết nối <a href="#id-1-quy-trinh-ket-noi" id="id-1-quy-trinh-ket-noi"></a>

<details>

<summary>Bước 1</summary>

Đối tác cung cấp thông tin để Gotadi khởi tạo tài khoản đại lý trên môi trường sandbox. Thông tin bao gồm:

* Thông tin công ty:
  * Tên công ty
  * Địa chỉ công ty
  * Địa chỉ website
* Thông tin quản trị viên:
  * Họ tên
  * Địa chỉ email
  * Số điện thoại
* Thông tin kết nối:
  * Đường dẫn tới hệ thống của đối tác: Link sản phẩm, Link cổng thanh toán, …
  * Các tài liệu tích hợp liên quan
  * Public key của đối tác. (RSA public key chiều dài tối thiểu 1024 bit)

</details>

<details>

<summary>Bước 2</summary>

Gotadi khởi tạo tài khoản dựa vào thông tin Đối tác cung cấp và gửi lại các thông tin tài khoản cho Đối tác. Thông tin bao gồm:

* Link kích hoạt tài khoản và đăng nhập vào B2B portal của Gotadi (Gửi vào email quản trị viên).
* Đường dẫn tới hệ thống của Gotadi: `<gotadi_api_gateway>`
* Public key của Gotadi. (RSA public key chiều dài tối thiểu 1024 bit)
* Tham số truyền vào request header:
  * Khóa truy cập API: `<api_key>`
  * Mã truy cập của đối tác: `<access_code>`

</details>

<details>

<summary>Bước 3</summary>

Đối tác kích hoạt tài khoản và sử dụng thông tin ở bước 2 tiến hành kết nối và kiểm thử trên môi trường sandbox

</details>

<details>

<summary>Bước 4</summary>

Nghiệm thu Sandbox và Golive dịch vụ

</details>

#### 2. Các quy ước viết tắt <a href="#id-2-cac-quy-uoc-viet-tat" id="id-2-cac-quy-uoc-viet-tat"></a>

| Viết tắt | Từ đầy đủ   | Mô tả                                                                                                |
| -------- | ----------- | ---------------------------------------------------------------------------------------------------- |
| M        | `Mandatory` | Bắt buộc phải có khi gọi API.                                                                        |
| O        | `Optional`  | Không yêu cầu khi gọi API, tùy từng mục đích sử dụng mà có truyền tham số này không                  |
| C        | `Condition` | Dựa trên Condition của field khác khi gọi API mà field này được quyết định là Mandatory hay Optional |

#### 3. HTTP Response code <a href="#id-3-http-response-code" id="id-3-http-response-code"></a>

| Response code | Mô tả                 |
| ------------- | --------------------- |
| 200           | Success               |
| 400           | Bad Request           |
| 401           | Unauthorized          |
| 402           | Forbidden             |
| 402           | Not Found             |
| 500           | Internal Server Error |
| 503           | Service Unavailable   |

#### 5. Các tham số phổ biến <a href="#id-5-cac-tham-so-pho-bien" id="id-5-cac-tham-so-pho-bien"></a>

* page (Integer, Optional)

  Số thứ tự của trang (bắt đầu từ 0)
* size (Integer, Optional)

  Số lượng phần tử của mỗi trang
* sort (String, Optional)

  Mảng chứa tên trường và kiểu sắp xếp dữ liệu.

  VD: id,desc,createdDate,asc
* duration (String, Optional)

  Thời gian xử lý yêu cầu - Kể từ thời điểm nhận request đến thời điểm trả kết quả.
* success (Boolean, Required)

  Kết quả xử lý yêu cầu
* infos (Object\[], Optional)

  Mảng chứa thông tin mô tả kết quả ở các bước trong quá trình xử lý yêu cầu.
* errors (Object\[], Optional)

  Mảng chứa thông tin mô tả các lỗi đã xảy ra trong quá trình xử lý yêu cầu.
* textMessage (String, Optional)

  Thông báo được đề xuất hiển thị cho người dùng.
* pageDTO (PageDTO, Optional)

  Đối tượng mô tả các thông tin phân trang: Số thứ tự của trang được trả về, số phần tử của mỗi trang, tổng số trang, …

#### 6. Luồng tương tác <a href="#id-6-luong-tuong-tac" id="id-6-luong-tuong-tac"></a>

<figure><img src="/files/JdLqVbSOxKJ4nlmPtuGa" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/iO5OfQ4WmHZWIqcTIU9K" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/PdH0MBRLpBotR9FMRfIZ" alt=""><figcaption></figcaption></figure>

#### 7. Mã lỗi <a href="#id-7-ma-loi" id="id-7-ma-loi"></a>

| Mã lỗi | Mô tả                                                       |
| ------ | ----------------------------------------------------------- |
| 00     | Yêu cầu đã được xử lý thành công.                           |
| 01     | Yêu cầu đang được xử lý.                                    |
| 02     | Yêu cầu đã được xử lý thất bại.                             |
| 03     | Yêu bị từ chối do Xác thực tài khoản đại lý khoản thất bại. |
| 04     | Yêu bị từ chối do Chữ ký điện tử không hợp lệ.              |
| 05     | Yêu bị từ chối do Giải mã dữ liệu không thành công.         |
| 06     | Yêu bị từ chối do Mã xác thực (Access Code) không hợp lệ.   |
| 07     | Yêu bị từ chối do Dữ liệu sai định dạng.                    |
| 08     | Yêu bị từ chối do Đã được xử lý trước đó.                   |
| 09     | Yêu cầu chưa được xử lý.                                    |
| 10     | Thông tin tài khoản không tìm thấy                          |
| 99     | Lỗi khác.                                                   |

#### 8. Bảng mã lỗi chung

**Ghi chú:** Đây là các mã lỗi thông thường được dùng chung cho các API.\
Các mã lỗi riêng của từng API được mô tả bên dưới API đó.

| Mã lỗi                                  | Mô tả                                         |
| --------------------------------------- | --------------------------------------------- |
| INVALID\_REQUEST\_PARAM                 | <p>Request param không hợp lệ (Xem thêm       |
| <br>message để biết thêm chi tiết).</p> |                                               |
| UNKNOWN\_ERROR                          | <p>Lỗi chưa xác định. Liên hệ đội kỹ thuật để |
| <br>biết thêm chi tiết.</p>             |                                               |

**Example:** Response trả về với lỗi trùng booking

```json
{ 
    "duration": null, 
    "infos": null, 
    "isSuccess": true, 
    "textMessage": null, 
    "errors": [ 
        { 
            "code": "5_BOOKING_RESERVE_FAILED_DUPLICATED", 
            "id": "5013", 
            "message": "Cannot reserve booking with duplicated info" 
        } 
    ] 
}
```

**Giải thích:**

* Trong response, trường **success** (kiểu boolean) quy định kết quả trả  \
  về thành công hay thất bại.
* Nếu **success** là **false**, cần xem các lỗi trong trường **errors**.
* Mỗi error có ba trường thông tin: **mã ID**, **mã code** và **message** lỗi (chỉ dành cho developer). Quý đại lý vui lòng chỉ nên dùng **mã code** và tham chiếu với bảng mã lỗi được cung cấp ở mỗi API để biết thông tin lỗi tương ứng.


# API Login

{% content-ref url="/pages/XtFKv8ur589jdyKfoNw5" %}
[API Login](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/api-login)
{% endcontent-ref %}


# Yêu cầu bảo mật

{% content-ref url="/pages/F0qCqpb9wo0zWQDTVkiR" %}
[Yêu cầu bảo mật](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/yeu-cau-bao-mat)
{% endcontent-ref %}


# Flight


# Search API

### 1. API lấy danh sách sân bay <a href="#id-1-api-lay-danh-sach-san-bay" id="id-1-api-lay-danh-sach-san-bay"></a>

GET: /metasrv/api/\_search/airports

Tìm kiếm sân bay dựa theo từ khóa liên quan hoặc mã quốc gia/vùng lãnh thổ

Cho phép sắp xếp kết quả trả về

<details>

<summary>Parameters</summary>

* query `query` (String, Optional)

  Từ khóa tìm kiếm khu vực / tên sân bay (VD: SGN, Vietnam, Tokyo)
* country `query` (String, Optional)

  Mã quốc gia / vùng lãnh thổ (VD: VN)
* page `query` (Integer, Optional)

  Số trang đang muốn lấy kết quả (VD: 0)
* size `query` (Integer, Optional)

  Số kết quả muốn lấy trong 1 trang (VD: 20)
* sort `query` (String, Optional)

  Sắp xếp kết quả theo giá trị của thuộc tính trả về tăng dần hay giảm dần (VD: propertiesName,desc / propertiesName,asc)

</details>

#### Example

```
?query=ha&country=VN&page=0&size=20&sort=name,desc
```

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* Array\[AirportDTO] (Optional)

  Thông tin danh sách sân bay trả về

  * id (Long, Optional)

    Mã định danh danh sách sân bay
  * code (String, Optional)

    Mã ký hiệu sân bay
  * name (String, Optional)

    Tên sân bay
  * cityCode (String, Optional)

    Mã ký hiệu thành phố
  * city (String, Optional)

    Tên thành phố
  * countryCode (String, Optional)

    Mã ký hiệu quốc gia
  * country (String, Optional)

    Tên quốc gia
  * timeZone (Integer, Optional)

    Múi giờ
  * location (String, Optional)

    Vị trí
  * name2 (String, Optional)

    Tên sân bay tiếng anh (tên khác)
  * city2 (String, Optional)

    Tên thành phố tiếng anh (tên khác)

</details>

***

### 2. API tìm kiếm vé máy bay <a href="#id-2-api-tim-kiem-ve-may-bay" id="id-2-api-tim-kiem-ve-may-bay"></a>

GET: /api/air-tickets/low-fare-search-async

Tìm kiếm chuyến bay theo điểm khởi hành và điểm kết thúc / theo ngày giờ

<details>

<summary>Parameters</summary>

* origin\_code `query` (String, Required)

  Mã sân bay điểm đi

  VD: Sân bay ở Hồ Chí Minh có mã là SGN
* destination\_code `query` (String, Required)

  Mã sân bay điểm đến

  VD: Sân bay ở Hà Nội có mã là HAN
* departure\_date `query` (String, Required)

  Ngày khởi hành

  Định dạng theo MM-dd-YYYY

  VD: 07-07-2021
* returnure\_date `query` (String, Required)

  Ngày về

  Định dạng theo MM-dd-YYYY

  VD: 08-20-2021
* cabin\_class `query` (String, Required)

  Hạng ghế vé

  Truyền giá trị là E
* route\_type `query` (String, Required)

  Loại hành trình:

  * `ONEWAY`: Một chiều
  * `ROUNDTRIP`: Khứ hồi

  Nếu không truyền thì có giá trị là `ONEWAY`
* aduts\_qtt `query` (Integer, Required)

  Số lượng hành khách là người lớn ( `12 tuổi trở lên` )

  Nếu không truyền giá trị mặc định là 1
* children\_qtt `query` (Integer, Required)

  Số lượng hành khách là trẻ em ( `từ 2 tuổi và nhỏ hơn 12 tuổi` )

  Nếu không truyền giá trị mặc định là 0
* infants\_qtt `query` (Integer, Required)

  Số lượng hành khách là trẻ sơ sinh ( `dưới 2 tuổi` )

  Nếu không truyền giá trị mặc định là 0
* skip\_filter `query` (Boolean, Optional)\
  Mặc định là false sẽ trả về kết quả groupPricedItineraries thông tin danh sách hành trình trả về theo kết quả tìm kiếm. Ngược lại sẽ không hiển thị.
* time `query` (String, Required)

  Thời điểm gọi API (UnixTimeStamp)

  VD: 1625545845
* key `query` (String, Required)

  Key để checksum

  Cách tạo giá trị:

  `MAC (Message Authentication Code)-> SHA256(<origin_code><destination_code><departure_time><returnure_date><cabin_class><route_type><aduts_qtt><children_qtt><infants_qtt><page><size><time>, 'Gotadi')`
* include-equivfare `query` (Boolean, Optional)

  Yêu cầu trả thêm thông tin phí xuất vé (EquivFare)
* suppliers `query` (Array\[string])\
  VN (vietnamairline), VJ (Vietjet), QH  &#x20;(Bamboo), 1A….
* page `query` (Integer, Required)

  Số trang đang muốn lấy kết quả (VD: 0)
* size `query` (Integer, Required)

  Số kết quả muốn lấy trong 1 trang (VD: 20)
* sort `query` (String, Optional)

  Sắp xếp kết quả theo giá trị của thuộc tính trả về tăng dần hay giảm dần (VD: propertiesName,desc / propertiesName,asc)

</details>

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* searchId (String, Required)

  Mã tham chiếu đến search vé máy bay, được lấy từ kết quả search vé máy bay
* departureSearchId (String, Required)

  Mã tham chiếu đến search chiều đi vé máy bay

  Được lấy từ searchId
* returnSearchId (String, Required)

  Mã tham chiếu đến search chiều về vé máy bay

  Được lấy từ searchID kết hợp với `-R` ở phía cuối
* groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)

  Thông tin danh sách hành trình trả về theo kết quả tìm kiếm

  * airSupplier (String, Required)

    Hãng cung cấp (VietnamAirline - VNA, VjetJet - VJ, BamBoo - QH, …)
  * aircraft (String, Optional)

    Loại máy bay (Airbus A330, Boeing 787, .....)
  * airline (String, Optional)

    Hãng bay (VJ, VNA, …)
  * airlineName (String, Optional)

    Tên hãng bay (Vietjet Air, Vietnam Airline, Bamboo, …)
  * arrivalDateTime (String, Required)

    Ngày giờ đến, sử dụng múi giờ UTC/GMT+7
  * departureDateTime (String, Required)

    Ngãy giờ bay, sử dụng múi giờ UTC/GMT+7
  * destinationLocationCode (String, Optional)

    Mã thành phố kết thúc chuyến bay
  * destinationCountry (String, Optional)

    Tên quốc gia kết thúc chuyến bay
  * destinationCountryCode (String, Optional)

    Mã quốc gia kết thúc chuyến bay
  * destinationCity (String, Optional)

    Tên thành phố kết thúc chuyến bay
  * destinationLocationName (String, Optional)

    Tên sân bay ở điểm dừng
  * flightNo (String, Optional)

    Số hiệu máy bay
  * flightNo (String, Optional)

    Số hiệu máy bay
  * flightType (String, Optional)

    Loại hình bay bay trong nước hay quốc tế

    Loại hình bay:

    * `DOMESTIC`: trong nước
    * `INTERNATIONAL`: quốc tế
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * originCity (String, Optional)

    Tên thành phố ở điểm khởi hành
  * originCountry (String, Optional)

    Tên quốc gia ở điểm khởi hành
  * originCountryCode (String, Optional)

    Mã ký hiệu quốc gia ở điểm khởi hành
  * originLocationCode (String, Optional)

    Mã thành phố khởi hành chuyến bay
  * originLocationName (String, Optional)

    Tên sân bay ở điểm khởi hành
  * totalPricedItinerary (Integer, Required)

    Tổng số lượng hành trình chi tiết
  * pricedItineraries (Array\[PricedItineraries], Required)

    Chi tiết hành trình

    * airItineraryPricingInfo (AirItineraryPricingInfo, Required)

      Thông tin giá chi tiết của hành trình

      * adultFare (FareBreakdown, Required)
        * passengerFare (PassengerFare, Required)

          Thông tin giá vé người lớn

          * baseFare (FareInfo, required)

            Thông tin giá vé cơ bản

            * amount (Double, Required)

              Số tiền
            * decimalPlaces (Integer, Optional)

              Vị trí số thập phân làm tròn đến
          * equivFare (FareInfo, Optional)

            Tương tự như baseFare

            Thông tin phí xuất vé
          * serviceTax (FareInfo, Required)

            Tương tự như baseFare

            Thông tin phí dịch vụ
          * totalFare (FareInfo, Required)

            Tương tự như baseFare

            Thông tin tổng cộng giá vé
          * surcharges (Array\[Surcharge], Required)

            Thông tin phụ phí tính trên mỗi booking / mỗi segment
        * passengerTypeQuantities (PassengerTypeQuantities, Optional)

          Số lượng / loại của hành khách

          * code (String, Required)

            Mã định danh người lớn / trẻ em / trẻ sơ sinh

            Bao gồm: `ADT` - người lớn / `CHD` - trẻ em / `INF` - trẻ sơ sinh
          * quantity (Integer, Required)

            Số lượng người lớn / trẻ em / trẻ sơ sinh
      * childFare (PassengerFare, Optional)

        Thông tin giá vé trẻ em

        Tương tự thông tin giá vé người lớn
      * infantFare (PassengerFare, Optional)

        Thông tin giá vé trẻ sơ sinh

        Tương tự thông tin giá vé người lớn
      * itinTotalFare (PassengerFare, Required)

        Thông tin tổng giá vé của hành trình

        Tương tự thông tin giá vé người lớn
      * fareSourceCode (String, Required)

        Thông tin mã định danh hành trình

        Được sử dụng để đi lấy thông tin điều kiện vé
    * allowHold (Boolean, Required)

      Thông tin cho phép giữ đặt chỗ hay không
    * cabinClassName (String, Required)

      Thông tin hạng ghế:

      * `ECONOMY` - ghế phổ thông
      * `PREMIUM` - ghế phổ thông đặc biệt
      * `BUSINESS` - ghế thương gia
    * fightNo (String, Optional)

      Thể hiện thông tin số hiệu máy bay
    * originDestinationOptions (Array(OriginDestinationOptions), Required)

      Thông tin chặn / dừng của hành trình

      * flightDirection (String, Required)

        Thể hiện thông tin chiều bay của hành trình

        * `D` - chiều đi
        * `R` - chiều về
      * journeyDuration (Integer, Required)

        Thể hiện thời gian bay
      * flightSegments (Array(FlightSegments), Required)

        Thể hiện thông tin chi tiết điểm khởi hành / điểm kết thúc trong hành trình
* page (AirPage, Required)

  Đối tượng mô tả các thông tin về phân trang.

  Số thứ tự của mỗi trang được trả về, phần tử của mỗi trang, tổng số trang
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

***

### 3. API lấy thông tin danh sách bộ lọc <a href="#id-3-api-lay-thong-tin-danh-sach-bo-loc" id="id-3-api-lay-thong-tin-danh-sach-bo-loc"></a>

POST: /api/air-tickets/filter-options

Lấy danh sách các giá trị có thể tham áp dụng trên bộ lọc trên kết quả tìm kiếm

<details>

<summary>Request Body</summary>

* searchId (String, Required)

  Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

  Dữ liệu này lấy từ kết quả trả về của tìm vé máy bay
* departureItinerary (AirItineraryInfo, Optional)

  Thông tin vé chiều đi trong trường hợp lấy filter-options cho vé chiều về

  * airlineCode (String, Required)

    Ký hiệu hãng bay

    * `VN`: VietNam Airline
    * `VJ`: VietJet
    * `QH`: Bamboo
    * `BL`: Pacific Airline …
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * fareSourceCode (String, Required)

    Thông tin mã định danh hành trình
  * supplierCode (String, Required)

    Mã hãng cũng cấp
  * searchId (String, Required)

    Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* searchId (String, Required)

  Mã tham chiếu đến search vé máy bay, được lấy từ kết quả search vé máy bay
* itineraryFilter (ItineraryFilter, Required)

  Thông tin thể hiện các giá trị có thể áp dụng trên kết quả bộ lọc tìm kiếm

  * airlineOptions (Array\[String], Optional)

    Thông tin thể hiện các hãng bay với vé có giá thấp nhất
  * cabinClassOptions (Array\[String], Optional)

    Thông tin thể hiện hạng ghế hiện hành
  * stopOptions (Array\[String], Optional)

    Thông tin thể hiện chặn dừng hiện hành
  * filterToPrice (Double, Optional)

    Thông tin thể hiện giá vé cao nhất hiện hành
  * filterFromPrice (Double, Optional)

    Thông tin thể hiện giá vé thấp nhất hiện hành
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

***

### 4.API lọc / sắp xếp kết quả tìm kiếm chuyến bay <a href="#id-4api-loc-sap-xep-ket-qua-tim-kiem-chuyen-bay" id="id-4api-loc-sap-xep-ket-qua-tim-kiem-chuyen-bay"></a>

POST: /api/air-tickets/filter-availability

Lọc và sắp xếp kết quả tìm kiếm chuyến bay

#### Paramaters <a href="#paramaters" id="paramaters"></a>

<details>

<summary>Parameters</summary>

* include-equivfare `query` (Boolean, Optional)

  Yêu cầu trả thêm thông tin phí xuất vé
* page `query` (Integer, Optional)

  Số trang đang muốn lấy kết quả (VD: 0)
* size `query` (Integer, Optional)

  Số kết quả muốn lấy trong 1 trang (VD: 20)
* sort `query` (String, Optional)

  Sắp xếp kết quả theo giá trị của thuộc tính trả về tăng dần hay giảm dần (VD: propertiesName,desc / propertiesName,asc)

</details>

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

<details>

<summary>Request Body</summary>

* searchId (String, Required)

  Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

  Dữ liệu này lấy từ kết quả trả về của tìm vé máy bay
* departureItinerary (AirItineraryInfo, Optional)

  Thông tin vé chiều đi trong trường hợp lấy filter-availability cho vé chiều về

  * airlineCode (String, Required)

    Ký hiệu hãng bay

    * `VN`: VietNam Airline
    * `VJ`: VietJet
    * `QH`: Bamboo
    * `BL`: Pacific Airline …
  * groupId (String, Optional)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * fareSourceCode (String, Required)

    Thông tin mã định danh hành trình
  * supplierCode (String, Required)

    Mã hãng cũng cấp
  * searchId (String, Required)

    Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm
* filter (ItineraryFilter, Required)

  Dùng để đưa các tiêu chí lọc và sắp xếp mong muốn vào

  * cabinClassOptions (Array\[String], Optional)

    Thông tin hạng ghế muốn đưa vào lọc và sắp xếp
  * step (String, Required)

    Thông tin dùng để phân biệt giữa chiều đi và chiều về

    * `1` : chiều đi
    * `2` : chiều về
  * flightType (String, Required)

    Thông tin loại chuyến bay

    * `DOMESTIC`: trong nước
    * `INTERNATIONAL`: quốc tế
  * stopOption (Array\[String], Optional)

    Thông tin điểm dừng
  * airlineOptions (Array\[String], Optional)

    Thông tin hãng bay
  * departureDateTimeOptions (Array\[String], Optional)

    Thông tin giờ khởi hành bắt đầu ở khoảng hay thời điểm nào

    VD: departureDateTimeOptions: `["+18", "+12-18"]`

    * `+18`: từ 18h đến 24h
    * `+12-18`: từ 12h đến 18h
  * arrivalDateTimeReturnOptions (Array\[String], Optional)

    Thông tin giờ kết thúc bắt đầu ở khoảng hay thời điểm nào

    VD: arrivalDateTimeReturnOptions: `["+18", "+12-18"]`

    * `+18`: từ 18h đến 24h
    * `+12-18`: từ 12h đến 18h

</details>

#### Response <a href="#response_3" id="response_3"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* searchId (String, Required)

  Mã tham chiếu đến search vé máy bay, được lấy từ kết quả search vé máy bay
* groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)

  Thông tin danh sách hành trình trả về theo kết quả tìm kiếm

  * airSupplier (String, Required)

    Hãng cung cấp (VietnamAirline - VNA, VjetJet - VJ, BamBoo - QH, …)
  * aircraft (String, Optional)

    Loại máy bay (Airbus A330, Boeing 787, .....)
  * airline (String, Optional)

    Hãng bay (VJ, VNA, …)
  * airlineName (String, Optional)

    Tên hãng bay (Vietjet Air, Vietnam Airline, Bamboo, …)
  * arrivalDateTime (String, Required)

    Ngày giờ đến, sử dụng múi giờ UTC/GMT+7
  * departureDateTime (String, Required)

    Ngãy giờ bay, sử dụng múi giờ UTC/GMT+7
  * destinationLocationCode (String, Optional)

    Mã thành phố kết thúc chuyến bay
  * destinationCountry (String, Optional)

    Tên quốc gia kết thúc chuyến bay
  * destinationCountryCode (String, Optional)

    Mã quốc gia kết thúc chuyến bay
  * destinationCity (String, Optional)

    Tên thành phố kết thúc chuyến bay
  * destinationLocationName (String, Optional)

    Tên sân bay ở điểm dừng
  * flightNo (String, Optional)

    Số hiệu máy bay
  * flightNo (String, Optional)

    Số hiệu máy bay
  * flightType (String, Optional)

    Loại hình bay bay trong nước hay quốc tế

    Loại hình bay:

    * `DOMESTIC`: trong nước
    * `INTERNATIONAL`: quốc tế
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * originCity (String, Optional)

    Tên thành phố ở điểm khởi hành
  * originCountry (String, Optional)

    Tên quốc gia ở điểm khởi hành
  * originCountryCode (String, Optional)

    Mã ký hiệu quốc gia ở điểm khởi hành
  * originLocationCode (String, Optional)

    Mã thành phố khởi hành chuyến bay
  * originLocationName (String, Optional)

    Tên sân bay ở điểm khởi hành
  * totalPricedItinerary (Integer, Required)

    Tổng số lượng hành trình chi tiết
  * pricedItineraries (Array\[PricedItineraries], Required)

    Chi tiết hành trình

    * airItineraryPricingInfo (AirItineraryPricingInfo, Required)

      Thông tin giá chi tiết của hành trình

      * adultFare (FareBreakdown, Required)
        * passengerFare (PassengerFare, Required)

          Thông tin giá vé người lớn

          * baseFare (FareInfo, required)

            Thông tin giá vé cơ bản

            * amount (Double, Required)

              Số tiền
            * decimalPlaces (Integer, Optional)

              Vị trí số thập phân làm tròn đến
          * equivFare (FareInfo, Optional)

            Tương tự như baseFare

            Thông tin phí xuất vé
          * serviceTax (FareInfo, Required)

            Tương tự như baseFare

            Thông tin phí dịch vụ
          * totalFare (FareInfo, Required)

            Tương tự như baseFare

            Thông tin tổng cộng giá vé
          * surcharges (Array\[Surcharge], Required)

            Thông tin phụ phí tính trên mỗi booking / mỗi segment
        * passengerTypeQuantities (PassengerTypeQuantities, Optional)

          Số lượng / loại của hành khách

          * code (String, Required)

            Mã định danh người lớn / trẻ em / trẻ sơ sinh

            Bao gồm: `ADT` - người lớn / `CHD` - trẻ em / `INF` - trẻ sơ sinh
          * quantity (Integer, Required)

            Số lượng người lớn / trẻ em / trẻ sơ sinh
      * childFare (PassengerFare, Optional)

        Thông tin giá vé trẻ em

        Tương tự thông tin giá vé người lớn
      * infantFare (PassengerFare, Optional)

        Thông tin giá vé trẻ sơ sinh

        Tương tự thông tin giá vé người lớn
      * itinTotalFare (PassengerFare, Required)

        Thông tin tổng giá vé của hành trình

        Tương tự thông tin giá vé người lớn
      * fareSourceCode (String, Required)

        Thông tin mã định danh hành trình

        Được sử dụng để đi lấy thông tin điều kiện vé
    * allowHold (Boolean, Required)

      Thông tin cho phép giữ đặt chỗ hay không
    * cabinClassName (String, Required)

      Thông tin hạng ghế:

      * `ECONOMY` - ghế phổ thông
      * `PREMIUM` - ghế phổ thông đặc biệt
      * `BUSINESS` - ghế thương gia
    * fightNo (String, Optional)

      Thể hiện thông tin số hiệu máy bay
    * originDestinationOptions (Array(OriginDestinationOptions), Required)

      Thông tin chặn / dừng của hành trình

      * flightDirection (String, Required)

        Thể hiện thông tin chiều bay của hành trình

        * `D` - chiều đi
        * `R` - chiều về
      * journeyDuration (Integer, Required)

        Thể hiện thời gian bay
      * flightSegments (Array(FlightSegments), Required)

        Thể hiện thông tin chi tiết điểm khởi hành / điểm kết thúc trong hành trình
* page (AirPage, Required)

  Đối tượng mô tả các thông tin về phân trang.

  Số thứ tự của mỗi trang được trả về, phần tử của mỗi trang, tổng số trang
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

***

### 5.API lấy danh sách vé mở bán trên một chuyến bay <a href="#id-5api-lay-danh-sach-ve-mo-ban-tren-mot-chuyen-bay" id="id-5api-lay-danh-sach-ve-mo-ban-tren-mot-chuyen-bay"></a>

POST: /api/air-tickets/group-itinerary/{id}

Lấy danh sách vé được mở bán trên một chuyến bay cụ thể

#### Paramaters <a href="#paramaters_1" id="paramaters_1"></a>

<details>

<summary>Parameters</summary>

* id `path` (String, Required)

  Dùng để tham chiếu đến danh sách các vé được mở bán trên một chuyến bay
* include-equivfare `query` (Boolean, Optional)

  Yêu cầu trả thêm thông tin phí xuất vé
* page `query` (Integer, Optional)

  Số trang đang muốn lấy kết quả (VD: 0)
* size `query` (Integer, Optional)

  Số kết quả muốn lấy trong 1 trang (VD: 20)
* sort `query` (String, Optional)

  Sắp xếp kết quả theo giá trị của thuộc tính trả về tăng dần hay giảm dần (VD: propertiesName,desc / propertiesName,asc)

</details>

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

<details>

<summary>Request Body</summary>

* searchId (String, Required)

  Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

  Dữ liệu này lấy từ kết quả trả về của tìm vé máy bay
* departureItinerary (AirItineraryInfo, Optional)

  Thông tin vé chiều đi trong trường hợp lấy filter-availability cho vé chiều về

  * airlineCode (String, Required)

    Ký hiệu hãng bay

    * `VN`: VietNam Airline
    * `VJ`: VietJet
    * `QH`: Bamboo
    * `BL`: Pacific Airline …
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * fareSourceCode (String, Required)

    Thông tin mã định danh hành trình
  * supplierCode (String, Required)

    Mã hãng cũng cấp
  * searchId (String, Required)

    Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm
* filter (ItineraryFilter, Required)

  Dùng để đưa các tiêu chí lọc và sắp xếp mong muốn vào

  * cabinClassOptions (Array\[String], Optional)

    Thông tin hạng ghế muốn đưa vào lọc và sắp xếp
  * step (String, Required)

    Thông tin dùng để phân biệt giữa chiều đi và chiều về

    * `1` : chiều đi
    * `2` : chiều về
  * flightType (String, Required)

    Thông tin loại chuyến bay

    * `DOMESTIC`: trong nước
    * `INTERNATIONAL`: quốc tế
  * stopOption (Array\[String], Optional)

    Thông tin điểm dừng
  * airlineOptions (Array\[String], Optional)

    Thông tin hãng bay
  * departureDateTimeOptions (Array\[String], Optional)

    Thông tin giờ khởi hành bắt đầu ở khoảng hay thời điểm nào

    VD: departureDateTimeOptions: `["+18", "+12-18"]`

    * `+18`: từ 18h đến 24h
    * `+12-18`: từ 12h đến 18h
  * arrivalDateTimeReturnOptions (Array\[String], Optional)

    Thông tin giờ kết thúc bắt đầu ở khoảng hay thời điểm nào

    VD: arrivalDateTimeReturnOptions: `["+18", "+12-18"]`

    * `+18`: từ 18h đến 24h
    * `+12-18`: từ 12h đến 18h
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình lấy được từ kết quả tìm kiếm

</details>

#### Response <a href="#response_4" id="response_4"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* searchId (String, Required)

  Mã tham chiếu đến search vé máy bay, được lấy từ kết quả search vé máy bay
* groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)

  Thông tin danh sách hành trình trả về theo kết quả tìm kiếm

  * airSupplier (String, Required)

    Hãng cung cấp (VietnamAirline - VNA, VjetJet - VJ, BamBoo - QH, …)
  * aircraft (String, Optional)

    Loại máy bay (Airbus A330, Boeing 787, .....)
  * airline (String, Optional)

    Hãng bay (VJ, VNA, …)
  * airlineName (String, Optional)

    Tên hãng bay (Vietjet Air, Vietnam Airline, Bamboo, …)
  * arrivalDateTime (String, Required)

    Ngày giờ đến, sử dụng múi giờ UTC/GMT+7
  * departureDateTime (String, Required)

    Ngãy giờ bay, sử dụng múi giờ UTC/GMT+7
  * destinationLocationCode (String, Optional)

    Mã thành phố kết thúc chuyến bay
  * destinationCountry (String, Optional)

    Tên quốc gia kết thúc chuyến bay
  * destinationCountryCode (String, Optional)

    Mã quốc gia kết thúc chuyến bay
  * destinationCity (String, Optional)

    Tên thành phố kết thúc chuyến bay
  * destinationLocationName (String, Optional)

    Tên sân bay ở điểm dừng
  * flightNo (String, Optional)

    Số hiệu máy bay
  * flightNo (String, Optional)

    Số hiệu máy bay
  * flightType (String, Optional)

    Loại hình bay bay trong nước hay quốc tế

    Loại hình bay:

    * `DOMESTIC`: trong nước
    * `INTERNATIONAL`: quốc tế
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * originCity (String, Optional)

    Tên thành phố ở điểm khởi hành
  * originCountry (String, Optional)

    Tên quốc gia ở điểm khởi hành
  * originCountryCode (String, Optional)

    Mã ký hiệu quốc gia ở điểm khởi hành
  * originLocationCode (String, Optional)

    Mã thành phố khởi hành chuyến bay
  * originLocationName (String, Optional)

    Tên sân bay ở điểm khởi hành
  * totalPricedItinerary (Integer, Required)

    Tổng số lượng hành trình chi tiết
  * pricedItineraries (Array\[PricedItineraries], Required)

    Chi tiết hành trình

    * airItineraryPricingInfo (AirItineraryPricingInfo, Required)

      Thông tin giá chi tiết của hành trình

      * adultFare (FareBreakdown, Required)
        * passengerFare (PassengerFare, Required)

          Thông tin giá vé người lớn

          * baseFare (FareInfo, required)

            Thông tin giá vé cơ bản

            * amount (Double, Required)

              Số tiền
            * decimalPlaces (Integer, Optional)

              Vị trí số thập phân làm tròn đến
          * equivFare (FareInfo, Optional)

            Tương tự như baseFare

            Thông tin phí xuất vé
          * serviceTax (FareInfo, Required)

            Tương tự như baseFare

            Thông tin phí dịch vụ
          * totalFare (FareInfo, Required)

            Tương tự như baseFare

            Thông tin tổng cộng giá vé
          * surcharges (Array\[Surcharge], Required)

            Thông tin phụ phí tính trên mỗi booking / mỗi segment
        * passengerTypeQuantities (PassengerTypeQuantities, Optional)

          Số lượng / loại của hành khách

          * code (String, Required)

            Mã định danh người lớn / trẻ em / trẻ sơ sinh

            Bao gồm: `ADT` - người lớn / `CHD` - trẻ em / `INF` - trẻ sơ sinh
          * quantity (Integer, Required)

            Số lượng người lớn / trẻ em / trẻ sơ sinh
      * childFare (PassengerFare, Optional)

        Thông tin giá vé trẻ em

        Tương tự thông tin giá vé người lớn
      * infantFare (PassengerFare, Optional)

        Thông tin giá vé trẻ sơ sinh

        Tương tự thông tin giá vé người lớn
      * itinTotalFare (PassengerFare, Required)

        Thông tin tổng giá vé của hành trình

        Tương tự thông tin giá vé người lớn
      * fareSourceCode (String, Required)

        Thông tin mã định danh hành trình

        Được sử dụng để đi lấy thông tin điều kiện vé
    * allowHold (Boolean, Required)

      Thông tin cho phép giữ đặt chỗ hay không
    * cabinClassName (String, Required)

      Thông tin hạng ghế:

      * `ECONOMY` - ghế phổ thông
      * `PREMIUM` - ghế phổ thông đặc biệt
      * `BUSINESS` - ghế thương gia
    * fightNo (String, Optional)

      Thể hiện thông tin số hiệu máy bay
    * originDestinationOptions (Array(OriginDestinationOptions), Required)

      Thông tin chặn / dừng của hành trình

      * flightDirection (String, Required)

        Thể hiện thông tin chiều bay của hành trình

        * `D` - chiều đi
        * `R` - chiều về
      * journeyDuration (Integer, Required)

        Thể hiện thời gian bay
      * flightSegments (Array(FlightSegments), Required)

        Thể hiện thông tin chi tiết điểm khởi hành / điểm kết thúc trong hành trình
* page (AirPage, Required)

  Đối tượng mô tả các thông tin về phân trang.

  Số thứ tự của mỗi trang được trả về, phần tử của mỗi trang, tổng số trang
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

***

### 6.API lấy điều kiện vé <a href="#id-6api-lay-ieu-kien-ve" id="id-6api-lay-ieu-kien-ve"></a>

POST: /api/air-tickets/farerules

Lấy điều kiện vé của chuyến bay

#### Paramaters <a href="#paramaters_2" id="paramaters_2"></a>

<details>

<summary>Parameters</summary>

* language `query` (String, Optional)

  Ngôn ngữ muốn lấy (VI hoặc EN)

</details>

#### Request Body <a href="#request-body_3" id="request-body_3"></a>

<details>

<summary>Request Body</summary>

* searchId (String, Required)

  Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

  Dữ liệu này lấy từ kết quả trả về của tìm vé máy bay
* groupId (String, Required)

  Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
* fareSourceCode(String, Required)

  Thông tin mã định danh hành trình

</details>

#### Response <a href="#response_5" id="response_5"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* fareRules (Array\[FareRules], Required)

  Danh sách điều kiện vé trả về

  * arrivalAirportLocationCode (String, Required)

    Điểm đến
  * departureAirportLocationCode (String, Required)

    Điểm khởi hành
  * departureDateTime (String, Required)

    Giờ khởi hành

    Định danh theo `yyyy-MM-dd'T'HH:mm:ss'Z'`
  * arrivalDateTime (String, Required)

    Giờ đến

    Định dạng theo `yyyy-MM-dd'T'HH:mm:ss'Z'`
  * fareRuleItems (Array\[FareRuleItem], Required)

    Danh sách chi tiết điều kiện vé

    * detail (String, Required)

      Chi tiết thông tin điều kiện vé

      Định dạng HTML
    * title (String, Required)

      Thông tin cho biết điều kiện vé chiều đi / điều kiện vé chiều về
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>


# Booking API

### 1.API kiểm tra tình trạng vé <a href="#id-1api-kiem-tra-tinh-trang-ve" id="id-1api-kiem-tra-tinh-trang-ve"></a>

POST: /api/air-tickets/revalidate

Kiểm tra tình trạng vé còn hữu dụng trước khi đi booking

#### Request Body <a href="#request-body" id="request-body"></a>

Model

<details>

<summary>Request Body</summary>

* searchId (String, Required)

  Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

  Dữ liệu này lấy từ kết quả trả về của tìm vé máy bay
* groupId (String, Required)

  Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
* fareSourceCode(String, Required)

  Thông tin mã định danh hành trình

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* valid (Boolean, Required)

  Thông tin vé còn hữu dụng hay không
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

Example

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 503**

> Service Unavailable

***

### 2.API khởi tạo thông tin booking <a href="#id-2api-khoi-tao-thong-tin-booking" id="id-2api-khoi-tao-thong-tin-booking"></a>

POST: /api/air-tickets/draft-booking

Kiểm tra tình trạng vé còn hữu dụng trước khi đi booking

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

<details>

<summary>Request Body</summary>

* itineraryInfos (Array\[ItineraryInfo], Required)

  Thông tin hành trình chiều đi + chiều về (nếu có)

  * searchId (String, Required)

    Dữ liệu dùng để tham chiếu đến kết quả tìm kiếm

    Dữ liệu này lấy từ kết quả trả về của tìm vé máy bay
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * fareSourceCode(String, Required)

    Thông tin mã định danh hành trình

</details>

Example

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* bookingCode (BookingCode, Required)

  Thông tin mã định danh Booking

  * bookingCode (String, Required)

    Mã định danh booking
  * bookingNumber (String, Required)

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* bookingType (String, Required)

  Thông tin thể hiện loại booking: Trong nước hay quốc tế

  * `DOME`: Trong nước
  * `INTE`: Quốc tế
* departDraftItineraryInfo (DraftItineraryInfo, Required)

  Thông tin hành trình chiều đi

  * bookingDirection (String, Required)

    Thông tin chiều đi

    * `DEPARTURE`: chiều đi
    * `RETURN`: chiều về
    * `TRIP`: dùng cho vé quốc tế (chiều đi + chiều về)
  * fareSourceCode(String, Required)

    Thông tin mã định danh hành trình
  * groupId (String, Required)

    Mã định danh hành trình trong danh sách hành trình trả về theo kết quả tìm kiếm
  * itinTotalFare (ItinTotalFare, Required)

    Thông tin các loại giá của hành trình

    * baseFare (FareInfo, required)

      Thông tin giá vé cơ bản

      * amount (Double, Required)

        Số tiền
      * decimalPlaces (Integer, Optional)

        Vị trí số thập phân làm tròn đến
    * equivFare (FareInfo, Optional)

      Tương tự như baseFare

      Thông tin phí xuất vé
    * serviceTax (FareInfo, Required)

      Tương tự như baseFare

      Thông tin phí dịch vụ
    * totalTax (FareInfo, Required)

      Tương tự như baseFare

      Thông tin tổng phí dịch vụ
    * totalFare (FareInfo, Required)

      Tương tự như baseFare

      Thông tin tổng cộng giá vé
* returnDraftItineraryInfo (DraftItineraryInfo, Optional)

  Tương tự như thông tin chi tiết hành trình chiều đi

  Thông tin hành trình chiều về
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

Example

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 503**

> Service Unavailable

***

### 3.API lấy chi tiết thông tin booking <a href="#id-3api-lay-chi-tiet-thong-tin-booking" id="id-3api-lay-chi-tiet-thong-tin-booking"></a>

GET: /api/products/booking-detail

Lấy thông tin chi tiết của booking

#### Parameter <a href="#parameter" id="parameter"></a>

<details>

<summary>Parameter</summary>

* booking\_number(String, Required)

  Mã tham chiếu đến booking

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* id (String, Optional),

  Mã định danh chi tiết booking
* agencyCode (String, Optional),

  Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
* agentCode (String, Optional),

  Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
* bookingCode (String, Optional),

  Mã dùng mô tả các thông tin cơ bản của booking
* bookingDate (String, Optional),

  Ngày tạo booking
* bookingInfo (BookingInfo, Optional),

  Thông tin booking

  * additionalFee (Number, Optional),

    Các khoản phí khác
  * agencyCode (String, Optional),

    Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
  * ~~agencyMarkupInfos (Array\[BookingAgencyMarkupInfo], Optional),~~
  * ~~agencyMarkupValue (Number, Optional),~~
  * agentCode (String, Optional),

    Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentId (Integer, Optional),

    Id nhân viên đại lý
  * agentName (String, Optional),

    Tên nhân viên đại lý
  * allowHold (Boolean, Optional),

    Cho phép giữ vé máy bay hay không

    `true`: cho phép giữ vé

    `false`: Không cho phép giữ vé
  * baseFare (Number, Optional),

    Giá phòng chưa bao gồm thuế phí
  * bookBy (String, Optional),

    Người đặt booking
  * bookByCode (String, Optional),

    Mã người đặt
  * bookingCode (String, Optional),

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingDate (String, Optional),

    Ngày tạo booking
  * ~~bookingIssuedType (String, Optional) = \[‘INSTANT\_BOOKING’, ‘CONFIRM\_OFFLINE’],~~
  * bookingNote (String, Optional),

    Ghi chú của booking
  * bookingNumber (String, Optional),

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * bookingType (String, Optional) = \[‘DOME’, ‘INTE’],

    Xác định điểm đến là trong nước hay quốc tế

    * `DOME`: Trong nước
    * `INTE`: Quốc tế
  * branchCode (String, Optional),

    Mã chi nhánh
  * cancellationBy (String, Optional),

    Hủy vé bởi …
  * cancellationDate (String, Optional),

    Ngày hủy vé
  * cancellationFee (Number, Optional),

    Phí hủy đặt phòng
  * cancellationNotes (String, Optional),

    Ghi chú hủy
  * channelType (String, Optional) = \[‘ONLINE’, ‘OFFLINE’],

    Loại kênh đặt phòng
  * contactInfos (Array\[BookingContactInfo], Optional),

    Mảng đối tượng chứ thông tin người liên hệ

    * bookingNumber (String, Optional),

      Mã tham chiếu đến booking
    * contactLevel (String, Optional) = \[‘PRIMARY’, ‘SECONDARY’, ‘OTHER’],

      Cấp của người liên hệ
    * contactType (String, Optional) = \[‘CUSTOMER’, ‘AGENCY’],

      Loại của người liên hệ
    * email (String, Optional),

      Địa chỉ email
    * firstName (String, Optional),

      Tên đêm và tên người liên hệ
    * phoneCode1 (String, Optional),

      Mã quốc gia
    * phoneNumber1 (String, Optional),

      Số điện thoại 1
    * surName (String, Optional)

      Họ người liên hệ
  * customerCode (String, Optional),

    Mã khách hàng
  * customerEmail (String, Optional),

    Email của khách hàng
  * customerFirstName (String, Optional),

    Họ của khách hàng
  * customerId (Integer, Optional),

    Id của khách hàng
  * customerLastName (String, Optional),

    Tên của khách hàng
  * customerPhoneNumber1 (String, Optional),

    Số điện thoại 1 của khách hàng
  * customerPhoneNumber2 (String, Optional),

    Số điện thoại 2 của khách hàng
  * ~~deleted (Boolean, Optional),~~
  * departureDate (String, Optional),

    Ngày khởi hành
  * discountAmount (Number, Optional),

    Số tiền được giảm
  * discountDate (String, Optional),

    Ngày sử dụng mã giảm giá
  * discountRedeemCode (String, Optional),

    Mã liên kết đổi thưởng
  * discountRedeemId (String, Optional),

    Id định danh liên kết đổi thường
  * discountVoucherCode (String, Optional),

    Mã voucher
  * discountVoucherName (String, Optional),

    Tên voucher
  * ~~displayPriceInfo (BookingPriceInfo, Optional),~~
  * equivFare (Number, Optional),

    Phí xuất vé
  * etickets (String, Optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận vé máy bay
  * fromCity (String, Optional),

    Tên thành phố khởi hành
  * fromLocationCode (String, Optional),

    Mã định danh sân bay khởi hành
  * fromLocationName (String, Optional),

    Tên sân bay khởi hành
  * id (integer, Optional),

    Id của booking
  * ~~internalBookingNote (String, Optional),~~
  * issuedByCode (String, Optional),

    Xuất vé bởi …
  * issuedDate (String, Optional),

    Ngày xuất phòng
  * issuedStatus (String, Optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

    Trạng thái xuất vé

    * `PENDING`: Đợi xuất vé
    * `TICKET_ON_PROCESS`: Xuất vé đang được xử lý
    * `SUCCEEDED`: Xuất vé thành công
    * `FAILED`: Xuất vé thất bại
  * ~~markupValue (Number, Optional),~~
  * ~~onlyPayLater (Boolean, Optional),~~
  * orgCode (String, Optional),

    Mã tổ chức
  * ~~ownerBooking (Boolean, Optional),~~
  * passengerNameRecords (String, Optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận vé máy bay
  * paymentBy (String, Optional),

    Thanh toán bởi …
  * paymentByCode (String, Optional),

    Mã người thanh toán
  * paymentDate (String, Optional),

    Thời gian thanh toán
  * paymentFee (Number, Optional),

    Phí thanh toán
  * paymentRefNumber (String, Optional),

    Mã tham chiếu thanh toán
  * paymentStatus (String, Optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],

    Trạng thái thanh toán

    * `PENDING`: Chờ thanh toán
    * `SUCCEEDED`: Thanh toán thành công
    * `FAILED`: Thanh toán thất bại
    * `REFUNDED`: Hoàn tiền
  * paymentTotalAmount (Number, Optional),

    Tổng số tiền thanh toán
  * paymentType (String, Optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘AIRPAY’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘PAYOO’, ‘CASH’, ‘TRANSFER’, ‘PARTNER’, ‘OTHER’],

    Hình thức thanh toán
  * ~~promotionID (Array\[String], Optional),~~
  * ~~reasonCodePaymentFailed (String, Optional),~~
  * refundBy (String, Optional),

    Người hoàn trả
  * refundByCode (String, Optional),

    Mã của người thực hiện hoàn trả
  * refundable (Boolean, Optional),

    Ngày hoàn trả
  * returnDate (String, Optional),

    Ngày trả phòng
  * roundType (String, Optional) = \[‘RoundTrip],
  * saleChannel (String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

    Kênh phân phối
  * serviceTax (Number, Optional),

    Thuế và phí
  * ~~showPayLaterOption (Boolean, Optional),~~
  * ~~showPayNowOption (Boolean, Optional),~~
  * status (String, Optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

    Trạng thái của booking

    * `PENDING`: Chờ xác nhận booking
    * `BOOKING_ON_PROCESS`: Booking đang được xử lý
    * `BOOKED`: Booking đã được xác nhận
    * `FAILED`: Booking thất bại
    * `EXPIRED`: Booking hết hạn
    * `CANCELLED`: Booking đã bị hủy
  * ~~supplierBookingStatus (String, Optional),~~
  * supplierType (String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

    Loại nhà cung cấp
  * taxAddress1 (String, Optional),

    Địa chỉ xuất hóa đơn dòng 1
  * taxAddress2 (String, Optional),

    Địa chỉ xuất hóa đơn dòng 2
  * taxCompanyName (String, Optional),

    Tên công ty xuất hóa đơn
  * taxNumber (String, Optional),

    Mã số thuế cần xuất hóa đơn
  * taxPersonalInfoContact (String, Optional),

    Người nhận hóa đơn
  * taxReceiptRequest (Boolean, Optional),

    Yêu cầu xuất hóa đơn hay không
  * timeToLive (String, Optional),

    Thời gian chờ thanh toán, sau thời gian này trạng thái của booking sẽ chuyển sang `EXPIRED`
  * toCity (String, Optional),

    Tên tỉnh, thành phố điểm đến
  * toLocationCode (String, Optional),

    Mã định danh điểm đến
  * toLocationName (String, Optional),

    Tên sân bay điểm đến
  * totalFare (Number, Optional),

    Tổng giá phòng
  * totalSsrValue (Number, Optional),

    Tổng giá hành lý / dịch vụ thêm
  * totalTax (Number, Optional),

    Tổng số tiền thuế phí
  * transactionInfos (Array\[BookingTransactionInfo], Optional),

    Mảng đối tượng chứa thông tin giao dịch

    * id (integer, Optional),

      Id định danh giao dịch
    * ~~agencyMarkupValue (Number, Optional),~~
    * allowHold (Boolean, Optional),

      Cho phép giữ vé hay không
    * bookingCode (String, Optional),

      Mã dùng mô tả các thông tin cơ bản của booking
    * bookingDate (String, Optional),

      Ngày tạo booking
    * bookingDirection (String, Optional) = \[‘DEPARTURE’, ‘RETURN’],
    * bookingNumber (String, Optional),

      Mã dùng tham chiếu đến booking.
    * bookingRefNo (String, Optional),

      Mã liên kết với nhà cung cấp
    * channelType (String, Optional) = \[‘ONLINE’, ‘OFFLINE’],

      Loại kênh bán
    * checkIn (String, Optional),

      Ngày giờ bay
    * checkOut (String, Optional),

      Ngày giờ đến
    * destinationLocationCode (String, Optional),

      Mã định danh sân bây
    * detail (String, Optional),

      Tên khách sạn
    * etickets (String, Optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận vé
    * issuedDate (String, Optional),

      Ngày xuất vé
    * issuedStatus (String, Optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

      Trạng thái xuất vé

      * `PENDING`: Đợi xuất vé
      * `TICKET_ON_PROCESS`: Xuất vé đang được xử lý
      * `SUCCEEDED`: Xuất vé thành công
      * `FAILED`: Xuất vé thất bại
    * ~~markupCode (String, Optional),~~
    * ~~markupFormula (String, Optional),~~
    * ~~markupKey (String, Optional),~~
    * ~~markupValue (Number, Optional),~~
    * noAdult (integer, Optional),

      Số người lớn
    * noChild (integer, Optional),

      Số trể em
    * onlyPayLater (Boolean, Optional),

      Cho phép trả sau hay không
    * passengerNameRecord (String, Optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận vé
    * paymentAmount (Number, Optional),

      Số tiền thanh toán
    * productSeqNumber (String, Optional),

      Mã sản phẩm
    * refundable (Boolean, Optional),

      Có hoàn tiền khi hủy vé hay không
    * saleChannel (String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

      Kênh phân phối
    * serviceTax (Number, Optional),

      Thuế và phí
    * status (String, Optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

      Trạng thái của booking

      * `PENDING`: Chờ xác nhận booking
      * `BOOKING_ON_PROCESS`: Booking đang được xử lý
      * `BOOKED`: Booking đã được xác nhận
      * `FAILED`: Booking thất bại
      * `EXPIRED`: Booking hết hạn
      * `CANCELLED`: Booking đã bị hủy
    * supplierCode (String, Optional),

      Mã nhà cung cấp
    * supplierName (String, Optional),

      Tên nhà cung cấp
    * supplierType (String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’]

      Loại sản phẩm
    * totalFare (Number, Optional),

      Tổng giá vé
    * totalTax (Number, Optional)

      Tổng thuế và phí
    * baseFare (Number, Optional),

      Giá vé không bao gồm thuế phí
  * travelerInfos (Array\[BookingTravelerInfo], Optional),

    Mảng đối tượng chứa thông tin hành khách.

    * bookingNumber (String),

      Mã tham chiếu đến booking
    * firstName (String),

      Tên đêm và tên hành khách
    * surName (String)

      Họ của hành khách
* bookingNumber (String, Optional),

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* bookingType (String, Optional),

  Xác định điểm đến là trong nước hay quốc tế

  * `DOME`: Trong nước
  * `INTE`: Quốc tế
* branchCode (String, Optional),

  Mã chi nhánh
* cacheType (String, Optional) = \[‘COMBO’],
* ~~channelType (String, Optional) = \[‘ONLINE’, ‘OFFLINE’],~~

  Loại kênh đặt vé máy bay
* ~~customerCode (String, Optional),~~

  Mã khách hàng
* groupPricedItineraries (Array\[GroupPricedItinerary], Optional),

  Thông tin danh sách hành trình trả về theo kết quả tìm kiếm

  Tương tự như lấy thông tin tìm kiếm vé máy bay
* ~~hotelAvailability (HotelAvailability, Optional),~~
* ~~hotelProduct (HotelProduct, Optional)~~,
* ~~hotelProductPayload (HotelProductPayload, Optional)~~,
* ~~isPerBookingType (Boolean, Optional),~~
* ~~markupType (String, Optional),~~
* ~~offlineBooking (OfflineBooking, Optional),~~
* orgCode (String, Optional),

  Mã tổ chức
* saleChannel (String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

  Kênh phân phối
* supplierType (String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

  Loại nhà cung cấp
* ~~travelerInfo (TravelerInfo, Optional),~~
* ~~updatedDate (String, Optional)~~

</details>

Example

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 503**

> Service Unavailable

***

### 4.API lấy thông tin tiện ích được mua kèm <a href="#id-4api-lay-thong-tin-tien-ich-uoc-mua-kem" id="id-4api-lay-thong-tin-tien-ich-uoc-mua-kem"></a>

GET: /api/air-tickets/ssr-offer/{bookingNumber}

Lấy thông tin tiện ích được mua kèm

#### Parameter <a href="#parameter_1" id="parameter_1"></a>

Parameters

<details>

<summary>Parameter</summary>

* bookingNumber (String, Required)

  Mã tham chiếu đến booking

</details>

#### Response <a href="#response_3" id="response_3"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* bookingNumber (String, Optional),

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* departSsrOfferItems (SSROfferItem, Optional)

  Quote

  Các tiện ích cho vé chiều đi

  * departureAirportLocationCode (String, Optional)

    Mã định danh sân bay tại điểm khởi hành
  * arrivalAirportLocationCode (String, Optional)

    Mã định danh sân bay tại điểm đến
  * departureDateTime (String, Optional)

    Ngày giờ khởi hành
  * arrivalDateTime (String, Optional)

    Ngày giờ đến
  * ssrItems (Array\[SSRItem], Optional)

    Danh sách tiện ích hữu dụng

    * amount (Number, Optional)

      Giá tiền
    * code (String, Optional)

      Mã định danh tiện ích mua thêm của nhà cung cấp

    -~~direction (String, Optional)~~

    * id (String, Optional)

      Mã định danh tiện ích. Mỗi mã là duy nhất không trùng trong cùng 1 hành trình
    * name (String, Optional)

      Tên tiện ích dịch vụ mua thêm
    * serviceType (String, Optional)

      Loại tiện ích dịch vụ mua thêm

      * `BAGGAGE`: hành lý mua thêm
      * `MEAL`: bữa ăn kèm
  * returnSsrOfferItems (SSROfferItem, Optional)

    Các tiện ích cho vé chiều về

    Tương tự tiện ích cho vé chiều đi
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

Example

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 503**

> Service Unavailable

***

### 5.API lấy thông tin bảo hiểm trễ chuyến <a href="#id-5api-lay-thong-tin-bao-hiem-tre-chuyen" id="id-5api-lay-thong-tin-bao-hiem-tre-chuyen"></a>

GET: /gtd\_service\_inventory/api/insurance/available\_plans

Lấy thông bảo hiểm trễ chuyến

#### Parameter <a href="#parameter_2" id="parameter_2"></a>

<details>

<summary>Parameter</summary>

* adult (Integer, Required)

  Số lượng người lớn
* child (Integer, Required)

  Số lượng trẻ em
* infant (Integer, Required)

  Số lượng em bé
* departureDate (String, Required)

  Ngày đi

  Định dạng: yyyy-mm-dd
* returnDate (String, Optional)

  Ngày về

  Định dạng: yyyy-mm-dd
* fromLocation (String, Required)

  Mã sân bay chiều đi
* toLocation (String, Required)

  Mã sân bay chiều về

</details>

#### Response <a href="#response_4" id="response_4"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* data(Array\[InsuranceDTO], Optional)

  Danh sách thông tin bảo hiểm trễ chuyến

  * InsuranceDTO
    * id (String, Required)

      ID định danh cho bảo hiểm trễ chuyến
    * amount (Double, Required)

      Tổng tiền bảo hiểm trễ chuyến
    * code (String, Required)

      Mã định danh cho bảo hiểm trễ chuyến
    * name (String, Required)

      Tên gói bảo hiểm trễ chuyến
    * extras

      Thông tin của gói bảo hiểm trễ chuyến

      * chargeType (String, Required)

        Loại hình của gói
      * content (String, Optional)

        Nội dung của gói bảo hiểm trễ chuyến
      * description (String, Optional)

        Nội dung mô tả của gói bảo hiểm trễ chuyến
      * pricingBreakdown:
        * currencyCode (String, Optional)

          Mã tiền tệ
        * minAge (Integer, Optional)
        * maxAge (Integer, Optional)
* errors (Integer, Required),
* success (Boolean, Required),
* message (String, Optional)

</details>

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 50**

> Service Unavailable

***

### 6.API cập nhật thông tin booking <a href="#id-6api-cap-nhat-thong-tin-booking-va-giu-cho" id="id-6api-cap-nhat-thong-tin-booking-va-giu-cho"></a>

POST: /api/air-tickets/add-booking-traveller

Cập nhật các thông tin: Hành khách, người liên hệ, thông tin xuất hóa đơn, … và yêu cầu giữ chỗ

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (String, Required),

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* bookingContacts (Array\[BookingContactDTO], Required)

  Danh sách thông tin liên hệ

  * email (String, Required)

    Email của người liên hệ
  * firstName (String, Required)

    Tên và tên đệm của người liên hệ
  * surName (String, Required)

    Họ của người liên hệ
  * phoneCode1(String, Required)

    Mã vùng
  * phoneNumber1 (String, Required)

    Số điện thoại của người liên hệ
* bookingTravelerInfos (Array(BookingTravelerInfoDTO), Required)

  Danh sách thông tin hàng khách, dịch vụ đi kèm

  * serviceRequests(Array\[BookingServiceRequestDTO], Optional)

    Thông tin các dịch vụ đi kèm

    \*Chú ý: Nếu SSR là bảo hiểm trễ chuyến khi bay 2 chiều thì bắt buộc phải mua cả 2 chứ không thể mua 1 chiều bỏ 1 chiều. Giá bảo hiểm trễ chuyến không bao gồm trẻ sơ sinh chỉ tính người lớn + trẻ em

    * bookingDirection (String, Required)

      Chiều đi

      * Hành lý

      ```
      - `DEPARTURE` : chiều đi

      - `RETURN`: chiều về
      ```

      * Bảo hiểm

      <pre><code><strong>- `ONEWAY`: cho 1 chiều
      </strong>
      - `ROUNDTRIP`: cho cả 2 chiều
      </code></pre>
    * ssrAmount (Number, Required)

      Giá tiền
    * ssrCode (String, Required)

      Mã định danh tiện ích mua thêm của nhà cung cấp
    * ssrId (String, Required)

      Mã định danh tiện ích. Mỗi mã là duy nhất không trùng trong cùng 1 hành trình
    * ssrName (String, Required)

      Tên tiện ích dịch vụ mua thêm
    * serviceType (String, Required)

      Loại tiện ích dịch vụ mua thêm

      * `BAGGAGE`: hành lý mua thêm
      * `MEAL`: bữa ăn kèm
      * `INSURANCE`: bảo hiểm trễ chuyến
    * fareCode(String, Required)

      Thông tin mã định danh hành trình
    * bookingNumber (String, Required),

      Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * traveler (BookingTravelerDTO, Required)

    Thông tin hành khách

    * adultType (String, Required)

      Thể hiện loại hành khách

      * `ADT`: người lớn
      * `CHD`: trẻ em
      * `INF`: em bé
    * firstName(String, Required)

      Tên và tên đệm
    * gender (String, Required)

      Giới tính

      * `MALE`: nam
      * `FEMALE`: nữ
      * `BOY`: bé trai
      * `GIRL`: bé gái
      * `INF`: trẻ sơ sinh
    * country (String, Required)\
      Mã quốc tịch (2 ký tự)
    * documentType (String, Required)

      Phân biệt mã định danh (PID – CCCD, PP – Passport)
    * documentNumber(String, Required)

    &#x20;      Mã CCCD / Passport

    * documentIssuingCountry (String, Required)

    &#x20;      Mã quốc gia cấp (2 ký tự, bắt buộc đối với Passport)

    * documentExpiredDate (String, Optional)

    &#x20;      Ngày hết hạn Passport    &#x20;(bắt buộc đối với    &#x20;Passport)

    * memberCard (Boolean, Optional)

      Có thẻ thành viên hay không
    * memberCardType (String, Optional)

      Loại thẻ thành viên
    * memberCardNumber (String, Optional)

      Số thẻ thành viên
    * surName (String, Required)

      Họ
    * dob (String, Optional)

      Ngày tháng năm sinh (yyyy-MM-dd)

    **Lưu ý đối với mã định danh CCCD / Passport:**\
    **- Áp dụng CCCD cho hành trình nội địa và Passport cho hành trình quốc tế.** \
    **- CCCD không cần điền đối với hành khách trẻ em và em bé (khi adultType tương ứng là CHD và INF). Ngược lại với Passport, mọi hành khách đều bắt buộc nhập.**\
    **- Đối với CCCD, field documentIssuingCountry không bắt buộc và có giá trị mặc định là “VN”.**
* taxReceiptRequest(BookingTaxReceiptRequestDTO, Required)

  Thông tin mã định danh hành trình

  * bookingNumber (String, Required)
  * taxReceiptRequest(Boolean, Required)

    Thông tin có xuất hóa đơn không
  * taxAddress1 (String, Optional)

    Địa chỉ xuất hóa đơn
  * taxCompanyName (String, Optional)

    Tên công ty xuất hóa đơn
  * taxNumber (String, Optional)

    Mã số thuế
  * taxPersonalInfoContact (String, Optional)

    Tên cá nhân liên hệ

</details>

#### Response <a href="#response_5" id="response_5"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* bookingCode (BookingCode, Optional)

  Cập nhật thông tin và giữ chỗ

  * bookingCode (String, Optional)

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingNumber (String, Optional)

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* duration (Long, Optional),
* errors (Array\[ErrorsDTO], Optional),
* infos (Array\[InfosDTO], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

Example

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 503**

> Service Unavailable

#### **Code 5\_BOOKING\_PROCESS\_PENDING**

> Không thể thay đổi thông tin booking sau khi giữ chỗ. Lỗi xảy ra do gọi API nhiều lần.

#### **Code 5\_BOOKING\_RESERVE\_FAILED\_DUPLICATED**

> <mark style="color:$info;">Thông tin hành trình và hành khách bị trùng với booking khác đã thanh toán thành công trước đó. Vui lòng liên hệ với đội kỹ thuật để biết chính xác thông tin booking bị trùng.</mark>

#### **Code 5\_BOOKING\_PARAMS\_NULL**

> Thiếu thông tin liên hệ hoặc thông tin hành khách

#### **Code 5\_BOOKING\_TRANSAC TION\_STATUS\_INFO\_EMPTY**

> Lỗi không thể đặt vé từ hãng bay

#### **Code 8\_TRAVELLER\_DOB\_IN VALID\_ADT**

> Ngày sinh người lớn không hợp lệ

#### **Code 8\_TRAVELLER\_DOB\_IN VALID\_CHD**

> Ngày sinh trẻ em không hợp lệ

#### **Code 8\_TRAVELLER\_DOB\_IN VALID\_INF**

> Ngày sinh em bé không hợp lệ

#### **Code 8\_RESERVE\_TICKET\_FAILED**

> Không đặt được vé máy bay

#### Code FLEXI\_INSURANCE\_FAI LED

> Tạo bảo hiểm du lịch thất bại

#### **Code UNKNOWN\_ERROR**

> Lỗi chưa xác định. Liên hệ đội kỹ thuật để biết thêm chi tiết

***

### 7. API xác nhận voucher <a href="#id-7api-xac-nhan-voucher" id="id-7api-xac-nhan-voucher"></a>

GET: /api/payments/voucher/validate

Validate voucher cho booking cụ thể

#### Request Body <a href="#request-body_3" id="request-body_3"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (String, Required)

  Mã định danh booking
* voucherCode (String, Required)

  Mã giảm giá

</details>

Example

#### Response <a href="#response_6" id="response_6"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* bookingNumber (String)

  Mã định dang booking
* discountAmount (Double)

  Số tiền giảm
* trackingCode (String)

  Mã định danh cho booking có voucher
* voucherCode (String)

  Mã giảm giá
* voucherValid (Boolean)

  Mã giảm giá hợp lệ
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

**Code 400**

> Bad Request

**Code 401**

> Unauthorized

**Code 403**

> Forbidden

**Code 404**

> Not Found

**Code 500**

> Unknown Internal Error

**Code 503**

> Service Unavailable


# Hotel


# Search API

### 1. API Tìm kiếm địa điểm, khách sạn theo từ khoá <a href="#id-1-api-tim-kiem-ia-iem-khach-san-theo-tu-khoa" id="id-1-api-tim-kiem-ia-iem-khach-san-theo-tu-khoa"></a>

GET: api/v3/hotel/search-keyword

Tìm kiếm địa điểm, khách sạn theo từ khoá.

<details>

<summary>Parameters</summary>

* keyword `query` (String, optional)

  Từ khoá tìm kiếm
* language `query` (String, Required)

  Ngôn ngữ

  * `vi` : Tiếng Việt
  * `en`: Tiếng Anh
* pageNumber `query` (String, Optional)

  Trang số
* pageSize `query` (String, Optional)

  Số phần tử trên trang

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

<details>

<summary>Model</summary>

* result (SearchKeywordResult, optional)

  Thông tin kết quả trả về

  * contents (Array\[Content], optional),

    Danh sách khu vực, khách sạn

    * searchCode (String, optional),

      Mã định danh tìm kiếm
    * searchType (string, optional) = \[`CONTINENT`, `COUNTRY`, `PROVINCE_STATE`, `HIGH_LEVEL_REGION`, `MULTI_CITY_VICINITY`, `CITY`, `NEIGHBORHOOD`, `AIRPORT`, `POINT_OF_INTEREST`, `TRAIN_STATION`, `METRO_STATION`, `HOTEL`],

      Loại tìm kiếm
    * name (String, optional),

      Tên khu vực, khách sạn
    * supplier (String, optional) = \[`EXPEDIA`, `AXISROOM`, `BEDLINKER`, `VINPEARL`],

      Nhà cung cấp
    * address (Address, optional)

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * tags (Array\[String], optional),

      Thẻ
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 2. API Tìm kiếm khách sạn với lựa chọn giá tốt nhất (search-best-rate) <a href="#id-2-api-tim-kiem-khach-san-voi-lua-chon-gia-tot-nhat-search-best-rate" id="id-2-api-tim-kiem-khach-san-voi-lua-chon-gia-tot-nhat-search-best-rate"></a>

GET: /api/v3/hotel/search-best-rates

Trả về kết quả tìm kiếm khách sạn với lựa chọn giá tốt nhất.

Dữ liệu sẽ được caching trong một khoảng thời gian theo với key là searchId. Thời gian caching khoảng 30 phút, thời gian này có thể bị thay đổi.

Cho phép lọc và sắp xếp kết quả trả về.

Chú ý

API sử dụng cơ chế lazy load các kết quả sẽ được push thêm trong khoảng 30s. Nếu thấy không có kết quả vui lòng retry 2-3 lần. Khi đã load hết các kết quả, dữ liệu này sẽ được catching trong vòng 30min

Lọc theo tọa độ, khoảng cách yêu cầu 3 tham số:

* filterGeoDistanceLat
* filterGeoDistanceLon
* filterGeoDistanceMeters

#### Parameters <a href="#parameters_1" id="parameters_1"></a>

<details>

<summary>Parameters</summary>

* rateOption `query` (String, optional)

  Tuỳ chọn giá. Có 2 tuỳ chọn giá là `OTA, TA`. Mặc định là `OTA`.

  Chú ý

  * Chỉ nhưng đối tác ký hợp đồng TA mới được sử dụng tuỳ chọn giá TA.
  * Muốn lấy cả 2 option giá thì `?rateOption=TA,OTA&...`
* searchCode `query` (String, Required)

  Mã khu vực hoặc mã khách sạn.

  * Search khu vực : mã khu vực
  * Search khác sạn : 1 hoặc nhiều mã khách sạn tương ứng với supplier
    * Trường hợp mong muốn tìm kiếm theo danh sách khách sạn cụ thể, trước tiên phải [lấy danh sách khách sạn](https://developer.gotadi.com/dev-guide/api-hotel/api-searching/#4-api-lay-danh-sach-khach-san) có chứa id để tìm kiếm.
    * Trường hợp sử dụng mã khách sạn tương ứng với supplier GOTADI thì hệ thống sẽ tự động chọn giá khách sạn theo tiêu chí ưu tiên
      * Cú pháp tìm nhiều khách sạn `...&searchCode=id1,id2,id3&searchType=HOTEL&supplier=GOTADI&...`
* searchType `query` (String, Required)

  Kiểu mã khu vực. Vd: CITY, HOTEL, …
* language `query` (String, Required)

  Ngôn ngữ. (vi, en)
* currency `query` (String, Required)

  Tiền tệ. (VND, USD)
* checkIn `query` (String, Required)

  Ngày nhận phòng.\
  Định dạng: `yyyy-MM-dd`
* checkOut `query` (String, Required)

  Ngày trả phòng.\
  Định dạng: `yyyy-MM-dd`
* paxInfos `query` (String\[], Required)

  Thông tin phòng và khách ở\
  Định dạng: `SoNguoiLon-TuoiTreEm1,TuoiTreEm2`

  Ví dụ:

  * 2 người lớn và 2 trẻ em, 1 trẻ 4 tuổi, 1 trẻ 6 tuổi: `...&paxInfos=2-4,6&...`
  * 2 phòng, phòng 1 gồm 2 người lớn, phòng 2 gồm 2 người lớn và 2 trẻ em, 1 trẻ em 4 tuổi và 1 trẻ em 6 tuổi: `...&paxInfos=2&paxInfos=2-4,6&...`
* supplier `query` (String, Required)
  * Nhà cung cấp, Lấy thông tin từ kết quả trả về mục 4.2
  * Mỗi bộ search code sẽ tương ứng riêng với từng nhà cung cấp khác nhau
  * Xem [quy tắc nhà cung cấp](https://developer.gotadi.com/dev-guide/api-hotel/api-searching#4-quy-tac-supplier)
* targertSupplier `query` (String, Optional)
  * Khi có giá trị này hệ thống sẽ bỏ qua các quy trình chọn nhà cung cấp tự động theo tiêu chí
* locationCoordinates `query` (String, Optional)
  * **Require khi không có searchCode và searchType**
  * Toạ độ trung tâm địa điểm, tìm kiếm theo bán kính mặc định
  * Cú pháp : `&locationCoordinates=10.7568,10.5689`
* radius `query` (Double, Optional)\
  Bán kính tìm kiếm tuỳ chọn (km)
* filterHotelName `query` (String, Optional)

  Lọc theo tên bắt đầu bằng
* filterHotelCategories `query` (String, Optional)

  Lọc theo danh mục khách sạn
* filterFromPrice `query` (Double, Optional)

  Lọc theo giá bắt đầu từ
* filterToPrice `query` (Double, Optional)

  Lọc theo giá kết thúc đến
* filterFromStarRating `query` (Double, Optional)

  Lọc theo hạng sao bắt đầu từ
* filterToStarRating `query` (Double, Optional)

  Lọc theo hạng sao kết thúc đến
* filterFromGuestRating `query` (Double, Optional)

  Lọc theo đánh giá của khách bắt đầu từ
* filterToGuestRating `query` (Double, Optional)

  Lọc theo đánh giá của khách kết thúc đến
* filterAmenities `query` (String\[], Optional)

  Lọc theo tiên nghi khách sạn
* filterRoomAmenities `query` (String\[], Optional)

  Lọc theo tiện nghi phòng
* filterRoomViews `query` (String\[], Optional)

  Lọc theo hướng nhìn của phòng
* filterThemes `query` (String\[], Optional)

  Lọc theo chủ đề của khách sạn
* filterMealPlans `query` (String\[], Optional)

  Lọc theo bữa ăn
* filterGeoDistanceLat `query` (Double, Optional)

  Lọc theo tọa độ lat
* filterGeoDistanceLon `query` (Double, Optional)

  Lọc theo tọa độ lon
* filterGeoDistanceMeters `query` (Integer, Optional)

  Lọc theo tọa độ và khoảng cách. Đơn vị mét
* filterBreakfastIncluded `query` (Boolean, Optional)\
  Lọc theo bao gồm bữa ăn sáng
* filterCancelFree `query` (Boolean, Optional)\
  Lọc theo bao gồm huỷ miễn phí
* sortField `query` (String, Optional)

  Sắp xếp theo: price, starRating, guestRating
* sortOrder `query` (String, Optional)

  Sắp xếp theo thứ tự: ASC, DESC
* pageNumber `query` (String, Optional)

  Trang số
* pageSize `query` (String, Optional)

  Số phần tử trên trang

</details>

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (Object, Optional)

  Thông tin kết quả trả về

  * searchId (String, Optional)
    * Mã tham chiếu đến kết quả tìm kiếm
    * searchId được tạo ra dựa trên các tham số bắt buộc, nếu các tham số không thay đổi thì searchId sẽ không thay đổi
    * Được dùng làm tham số khi search-all-rates
  * propertyAvailable (Array\[PropertyAvailable], Optional)

    Mảng chứa đối tượng thông tin khách sạn

    * address (Address, optional),

      Thông tin địa chỉ khách sạn

      * city (string, optional),

        Thành phố
      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * amenities (Array\[Amenity], optional),

      Thông tin danh sách tện nghi kèm theo của tùy chọn giá

      * id (string, optional),

        Id của tiện nghi
      * name (string, optional)

        Tên của tiện nghi
      * ~~value (string, optional)~~
      * ~~group (string, optional)~~
    * basePrice (number, optional),

      Giá cơ bản
    * basePriceBeforePromo (number, optional),

      Giá cơ bản trước khuyến mãi. Nếu không có khuyến mãi thì giá trị là 0
    * breakfastIncluded (boolean, optional),

      Có bao gồm bữa ăn sáng hay không
    * cancelFree (boolean, optional),

      Cho phép hủy phòng miễn phí hay không
    * currency (string, optional) = \[‘VND’, ‘USD’],

      Tiền tệ
    * images (Array\[HotelImage], optional),

      Thông tin hình ảnh của khách sạn

      * caption (string, optional),

        Tiêu đề hình ảnh
      * link (string, optional),

        Liên kết hình ảnh, là đường dẫn tuyệt đối
      * position (integer, optional)

        Vị trí sắp xếp của hình ảnh
    * language (string, optional) = \[‘vi’, ‘en’],

      Ngôn ngữ
    * latitude (number, optional),

      Vĩ độ
    * longitude (number, optional),

      Kinh độ
    * promo (boolean, optional),

      Có khuyến mãi hay không
    * propertyCategory (PropertyCategory, optional),

      Danh mục khách sạn

      * id (string, optional),

        Id danh mục khách sạn
      * name (string, optional)

        Tên danh mục khách sạn
    * propertyId (string, optional),

      Id định danh khách sạn
    * propertyName (string, optional),

      Tên khách sạn
    * refundable (boolean, optional),

      Có được trả tiền khi hủy phòng hay không
    * reviewCount (string, optional),

      Số lượng đánh giá của khách
    * ~~reviewRecommendPercent (string, optional),~~
    * reviewScore (string, optional),

      Điểm đánh giá trung bình của khách. Lớn nhất là 5
    * stars (string, optional),

      Hạng sao khách sạn
    * supplier (string, require) = \[‘EXPEDIA’, ‘AXISROOM’, ‘BEDLINKER’],

      Nguồn cung cấp khách sạn
    * tags (Array\[string], optional),

      Thẻ cuả khách sạn
    * taxAndServiceFree (number, optional),

      Thuế và phí kèm theo
    * totalPrice (number, optional),

      Tổng giá tiền tạm tính
    * totalRooms (Integer, optional),

      Số lượng phòng còn trống có thể book
    * ~~tripAdvisor (TripAdvisor, optional)~~
    * rateOption (String, optional)

      Tuỳ chọn giá. Có 2 tuỳ chọn giá là `OTA, TA`. Mặc định là `OTA`.
    * masterPropertyId (Long, optional)

      Mã định danh khách sạn chính.
    * distanceToCenter (String, optional)\
      Khoảng cách từ khách sạn đến điểm trung tâm nếu search bằng toạ độ
    * availableType (String, require)\
      Loại kết quả search&#x20;

      ```
      ON_REQUEST : liên hệ để đặt
      SOLD_OUT: vừa hết phòng
      AVAILABLE : khách sạn còn phòng
      RECOMMENDED : khách sạn đề xuất
      ```
  * shortLinkId (String, require)\
    id thay thế một số param cho API search-all-rate
  * pageResult (Object, Optional)

    Thông tin trang trả về

    * pageSize (Integer, Optional)

      Kích thước trang
    * pageNumber (Integer, Optional)

      Thứ tự trang
    * totalPage (Integer, Optional)

      Tổng số trang
    * totalItems (Integer, Optional)

      Tổng số phần tử
* duration (Integer, Optional)
* success (Integer, Bool)
* infos (Array\[InfosDTO], Optional)
* errors (Array\[ErrorsDTO], Optional)
* textMessage (String, Optional)

</details>

Example

### 3. API Tùy chọn bộ lọc <a href="#id-3-api-tuy-chon-bo-loc" id="id-3-api-tuy-chon-bo-loc"></a>

GET: /api/v3/hotel/filter-options

Lấy danh sách các giá trị có thể áp dụng trên bộ lọc trên kết quả tìm kiếm. Có thể áp dụng cùng lúc nhiều bộ lọc với nhau.

#### Parameters <a href="#parameters_2" id="parameters_2"></a>

<details>

<summary>Parameters</summary>

* language `query` (String, Required)

  Ngôn ngữ

  * `vi` : Tiếng Việt
  * `en`: Tiếng Anh

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

<details>

<summary>Model</summary>

* result (FilterOptionsResult, optional)

  Thông tin kết quả trả về

  * guestRatings (Array\[FilterItemDouble], optional),

    Thông tin đánh giá khách sạn của khách. Cao nhất là 5

    * name (string, optional),

      Tên bộ lọc đánh giá của khách
    * value (number, optional)

      Giá trị bộ lọc đánh gía của khách
  * language (string, optional) = \[‘vi’, ‘en’],

    Ngôn ngữ trả về
  * mealPlans (Array\[FilterItemString], optional),

    Thông tin tùy chọn bộ lọc theo bữa ăn

    * name (string, optional),

      Mô tả bữa ăn
    * value (string, optional)

      Id của bộ lọc bữa ăn
  * prices (Array\[FilterPrice], optional),

    Thông tin tùy chọn theo bộ lọc giá

    * operator (string, optional),

      Phương thức so sánh

      * `less_than`: Giá nhỏ hơn
      * `range`: Giá trong khoảng
      * `greater_than`: Giá lớn hơn
    * from (number, optional),

      Giá từ
    * to (number, optional)

      Giá đến
  * propertyAmenities (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo tiện nghi khách sạn

    * name (string, optional),

      Mô tả tiện nghi
    * value (string, optional)

      Id của bộ lọc tiện nghi
  * propertyCategories (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo danh mục khách sạn

    * name (string, optional),

      Mô tả danh mục khách sạn
    * value (string, optional)

      Id của bộ lọc theo danh mục khách sạn
  * propertyRatings (Array\[FilterItemDouble], optional),

    Thông tin bộ lọc theo hạng sao

    * name (string, optional),

      Mô tả hạng sao
    * value (number, optional)

      Giá trị hạng sao
  * roomAmenities (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo tiện nghi trong phòng

    * name (string, optional),

      Mô tả tiện nghi trong phòng
    * value (string, optional)

      Id của bộ lọc theo tiện nghi trong phòng
  * roomViews (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo hướng nhìn phòng

    * name (string, optional),

      Mô tả hướng nhìn phòng
    * value (string, optional)

      Id của bộ lọc theo hướng nhìn phòng
  * themes (Array\[FilterItemString], optional)

    Thông tin bộ lọc theo chủ đề của khách sạn

    * name (string, optional),

      Mô tả chủ đề của khách sạn
    * value (string, optional)

      Id của bộ lọc theo chủ đề
  * bedTypes (Array\[FilterItemString], optional)

    Thông tin bộ lọc theo loại giường của khách sạn

    * name (string, optional),

      Mô tả loại giường của khách sạn
    * value (string, optional)

      Id của bộ lọc theo loại giường
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 4. API Tìm kiếm khách sạn với tất cả tùy chọn giá (search-all-rates) <a href="#id-4-api-tim-kiem-khach-san-voi-tat-ca-tuy-chon-gia-search-all-rates" id="id-4-api-tim-kiem-khach-san-voi-tat-ca-tuy-chon-gia-search-all-rates"></a>

GET: /api/v3/hotel/search-all-rates

Kết quả trả về thông tin chi tiết của một khách sạn, thông tin phòng và thông tin của tất cả tùy chọn giá.

Mỗi một khách sạn có thể có 1 hoặc nhiều phòng, mỗi phòng sẽ có một hoặc nhiều tùy chọn giá khác nhau tùy theo bữa ăn và dịch vụ kèm theo.

#### Parameters <a href="#parameters_3" id="parameters_3"></a>

<details>

<summary>Parameters</summary>

* searchId `query` (string, required)

  Mã tìm kiếm, được lấy từ mục search-all-rate
* propertyId `query` (string, required)

  Mã định danh khách sạn theo supplier. Được lấy từ kết quả trả về của search-best-rate
* supplier `query` (String, required)

  Nhà cung cấp. Được lấy từ kết quả trả về của search-best-rate
* checkIn `query` (String, required)

  Ngày nhận phòng.

  Định dạng: `yyyy-MM-dd`
* checkOut `query` (String, required)

  Ngày trả phòng.

  Định dạng: `yyyy-MM-dd`
* paxInfos `query` (String\[], required)

  Thông tin phòng và khách ở

  Định dạng: `SoNguoiLon-TuoiTreEm1,TuoiTreEm2`

  Ví dụ:

  * 2 người lớn và 2 trẻ em, 1 trẻ 4 tuổi, 1 trẻ 6 tuổi: \`…\&paxInfos=2-4,6&…
  * 2 phòng, phòng 1 gồm 2 người lớn, phòng 2 gồm 2 người lớn và 2 trẻ em, 1 trẻ em 4 tuổi và 1 trẻ em 6 tuổi: \`…\&paxInfos=2\&paxInfos=2-4,6&…
* shortLinkId `query` (String, Optional)
  * Giá trị thay thế cho các param: **searchId, checkIn, checkout, paxInfos**
* masterPropertyId `query`( String, Optional)
  * id khách sạn ưng với supplier GOTADI
  * **Require nếu sử dụng shorlinkId**

</details>

#### Response <a href="#response_3" id="response_3"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (SearchAllRatesResult, optional),
  * tripId (string, optional),

    Mã định danh kết quả search-all-rate, mỗi lần gọi search-all-rate sẽ tạo ra tripId mới, nó được sử dụng khi đi thao tác đặt phòng
  * searchId (string, optional),

    Mã tham chiếu đến search-best-rate, được lấy từ kết quả search-best-rate
  * propertyAllRate (PropertyAllRate, optional)

    Thông tin trả về chi tiết của một khách sạn, thông tin phòng và thông tin của tất cả tùy chọn giá

    * address (Address, optional)

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * airportCode (string, optional),

      Mã sân bay
    * amenities (Array\[Amenity], optional),

      Mảng đối tượng chứa thông tin tiện nghi của khách sạn

      * id (string, optional),

        Mã tiện nghi khách sạn
      * name (string, optional),

        Tên của tiện nghi khách sạn
      * symbol (string, optional),

        Biểu tượng hiển thị của tiện nghi khách sạn
      * ~~value (string, optional)~~
      * group (string, optional)

        Thông tin tiện nghi của khách sạn được gom nhóm, với các nhóm sau

        * `OTHER`: Tiện nghi khác
        * `POPULAR_FACILITIES`: Tiện nghi phổ biến
        * `SERVICE`: Dịch vụ
        * `BUSINESS_SERVICE`: Dịch vụ doanh nghiệp
        * `RECREATION`: Cơ sở giải trí
        * `ENTERTAINMENT`: Giải trí đa phương tiện
        * `FITNESS_AND_SPA`: fitness và spa
        * `FOOD_AND_DRINK`: Khu vực ăn uống
        * `CONVENIENCES`: Tiện ích
        * `INTERNET`: Mạng intenet
        * `PARKING_AND_TRANSPORT`: Khu vực để xe và đưa đón
        * `PET`: Thú cưng
    * ~~attributes (Array\[Attribute], optional),~~
    * checkin (Checkin, optional),

      Khoảng thời gian nhận phòng, theo giờ địa phương của khách sạn

      * beginTime (string, optional),

        Thời gian bắt đầu được nhận phòng. Mặc định: 14:00
      * endTime (string, optional)

        Thời gian kết thúc được nhận phòng. Mặc định: 24:00
    * checkout (Checkout, optional),

      Thông tin thời gian trả phòng. Mặc định trước 12:00

      * endTime (string, optional)

        Thời gian trả phòng tối đa. Mặc định trước 12:00
    * currency (string, optional) = \[‘VND’, ‘USD’],

      Thông tin tiền tệ trả về
    * descriptions (Array\[Attribute], optional),

      Thông tin mô tả về khách sạn

      * id (string, optional),

        Mã định danh thuộc tính mô tả
      * name (string, optional),

        Tên thuộc tính

        * `description`: mô tả chung
        * `amenities`: mô tả chung về tiện nghi của khách sạn
        * `dining`: Mô tả về chỗ ăn uống của khách sạn
        * `renovations`: Mô tả về quá trình cải tạo phòng hoặc khách sạn mới đây
        * `national_ratings`: Nêu rõ nguồn xếp hạng sao của khách sạn
        * `business_amenities`: Mô tả về tiện nghi dành cho doanh nghiệp tại chỗ nghỉ, Ví dụ: phòng hội nghị
        * `rooms`: Mô tả về phòng
        * `attractions`: Mô tả về điểm tham quan gần khách sạn
        * `location`: Mô tả về vị trí của khách sạn
        * `headline`: Mô tả tóm tắt
      * value (string, optional)

        Thông tin mô tả
    * fees (Array\[Attribute], optional),

      Thông tin mô tả về một số khoản phụ phí kèm theo

      * id (string, optional),

        Mã định danh thuộc tính phí
      * name (string, optional),

        Tên thuộc tính phí

        * `mandatory`: Phí bắt buộc
        * `optional`: Phí không bắt buộc
      * value (string, optional)

        Mô tả về khoản phí
    * images (Array\[HotelImage], optional),

      Hình ảnh của khách sạn

      * caption (string, optional),

        Tiêu đề của hình ảnh
      * link (string, optional),

        Liên kết tới hình ảnh. Liên kết tuyệt đối
      * position (integer, optional)

        Vị trí sắp xếp hình ảnh
    * inclusions (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin mô tả về thuộc tính của khách sạn

      * id (string, optional),

        Mã định danh thuộc tính
      * name (string, optional),

        Mô tả thuộc tính
      * ~~value (string, optional)~~
    * language (string, optional) = \[‘vi’, ‘en’],

      Ngôn ngữ trả về
    * latitude (number, optional),

      Vĩ độ của khách sạn
    * longitude (number, optional),

      Kinh độ của khách sạn
    * policies (Array\[Attribute], optional),

      Thông tin về chính sách khách sạn mà khách cần lưu ý.

      * id (string, optional),

        Mã định danh chính sách
      * name (string, optional),

        Tên thuộc chính sách

        * `know_before_you_go`: Mô tả thông tin có thể hữu ích khi lập kế hoạch cho chuyến đi đến nơi này
      * value (string, optional)

        Mô tả về chính sách
    * propertyCategory (PropertyCategory, optional),

      Danh mục của khách sạn

      * id (string, optional),

        Mã định danh danh mục khách sạn
      * name (string, optional)

        Tên danh mục khách sạn
    * propertyId (string, optional),

      Mã định danh khách sạn
    * propertyName (string, optional),

      Tên khách sạn
    * ~~rank (integer, optional),~~
    * rating (Rating, optional),

      Đánh giá về khách sạn

      * ratingGuest (RatingGuest, optional)

        Đánh giá của khách

        * amenities (string, optional),

          Xếp hạng cho các tiện nghi do khách sạn cung cấp, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * cleanliness (string, optional),

          Đánh giá mức độ sạch sẽ cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * comfort (string, optional),

          Đánh giá mức độ thoải mái của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * condition (string, optional),

          Xếp hạng cho tình trạng của chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * count (integer, optional),

          Tất cả xếp hạng đánh giá của khách giành cho khách sạn
        * location (string, optional),

          Xếp hạng về mức độ hấp dẫn của vị trí của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * neighborhood (string, optional),

          Xếp hạng về mức độ hài lòng của khu vực lân cận của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * overall (string, optional),

          Đánh giá chung cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * quality (string, optional),

          Xếp hạng chất lượng của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * recommendationPercent (string, optional),

          Phần trăm khách giới thiệu ở tại chỗ nghỉ này.
        * ~~score (string, optional),~~
        * service (string, optional),

          Đánh giá về dịch vụ của nhân viên đối với chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * value (string, optional)

          Xếp hạng cho giá trị của bất động sản cung cấp cho chi phí lưu trú, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
      * ratingProperty (RatingProperty, optional)

        Đánh giá hạng sao khách sạn

        * rating (string, optional),

          Giá trị sếp hạng. Trả về giá trị từ 0,0 đến 5,0. Giá trị 0,0 hoặc giá trị trống cho biết không có xếp hạng nào.
        * type (string, optional)

          Loại đánh giá

          * `Star`: Xếp hạng sao của khách sạn
    * rooms (Array\[PropertyRoom], optional),

      Mảng đối tượng chứa thông tin phòng

      * descriptions (Array\[Attribute], optional),

        Thông tin mô tả

        * id (string, optional),

          Mã định danh
        * name (string, optional),

          Tên mô tả

          * `overview`: Thông tin mô tả tổng quan về căn phòng
        * value (string, optional)

          Thông tin mô tả
      * id (string, optional),

        Mã định danh cho loại phòng
      * images (Array\[RoomImage], optional),

        Mảng đối tượng chứa thông tin hình ảnh của loại phòng

        * caption (string, optional),

          Tiêu đề của hình ảnh
        * link (string, optional),

          Liên kết tới hình ảnh, là liên kết tuyệt đối
        * position (integer, optional)

          Vị trí sắp xếp của hình ảnh
      * name (string, optional),

        Tên của loại phòng
      * ratePlans (Array\[RatePlan], optional),

        Mảng đối tượng chứa thông tin về tùy chọn giá

        * amenities (Array\[Amenity], optional),

          Mảng đối tượng chứa thông tin tiện nghi của tùy chọn giá

          * id (string, optional),

            Mã định danh tiện nghi
          * name (string, optional),

            Tên tiện nghi
          * ~~value (string, optional)~~
          * ~~group (sting, optional)~~
        * basePrice (number, optional),

          Giá cơ bản
        * basePriceBeforePromo (number, optional),

          Giá cơ bản trước khuyến mãi
        * bedGroups (Array\[BedGroup], optional),

          Mảng đối tượng nhóm giường trong phòng

          * configurations (Array\[ConfigurationBedGroup], optional),

            Thông tin cấu hình giường cho phòng

            * quantity (integer, optional),

              Số lượng giường
            * size (string, optional),

              Kích thước của giường
            * type (string, optional)

              Loại giường
          * description (string, optional),

            Mô tả hiển thị giường cho phòng này
          * id (string, optional)

            Mã định danh nhóm giường
        * breakfastIncluded (boolean, optional),

          Tùy chọn giá có bao gồm bữa sáng hay không
        * cancelFree (boolean, optional),

          Mô tả thông tin được phép hủy đặt phòng với tùy chọn giá này có tốn phí phạt hay không

          * `true`: Hủy đặt phòng miễn phí
          * `false`: Không đặt hủy đặt phòng miễn phí
        * cancelFreeBeforeDate (string, optional),

          Ngày giới hạn cho phép hủy đặt phòng với tùy chọn giá này một cách miễn phí
        * cancelPenalties (Array\[CancelPenalty], optional),

          Mô tả các hình thức phạt khi hủy đặt phòng với tùy chọn giá này. [Xem mô tả thêm ở đây](https://developer.gotadi.com/dev-guide/api-hotel/api-cancellation/#cac-hinh-thuc-phat)

          * type (string, optional)

            Loại hình phạt

            * `NIGHTS`: Số đêm bị phạt
            * `AMOUNT`: Số tiền bị phạt
            * `PERCENT`: Số phần trăm bị phạt
          * currency (string, optional) = \[‘VND’, ‘USD’],

            Đơn vị tiền tệ đối với `type = AMOUNT`
          * amount (string, optional),

            Số tiền của hình phạt
          * description (string, optional),

            Mô tả về hình phạt
          * nights (string, optional),

            Số đêm bị tính phí phạt
          * percent (string, optional),

            Số phần trăm bị phạt
          * startDate (string, optional),

            Ngày bắt đầu có hiệu lực của hình phạt
          * endDate (string, optional),

            Ngày kết thúc của hình phạt
        * fees (Map, optional),

          Thông tin các loại phí được phu bởi khách sạn Giá trị mối loại phí là tổng của loại đó. Phạm vi ảnh hưởng của mô tả này chỉ là thông tin thông báo cho khách hàng biết.

          * `mandatory_fee`: Một khoản phí bắt buộc do khách sạn thu khi nhận phòng hoặc trả phòng.
          * `resort_fee`: Một khoản phí cho các tiện nghi và dịch vụ bổ sung và được khách sạn thu khi nhận phòng hoặc trả phòng.
          * `mandatory_tax`: Khoản thuế bắt buộc do chỗ nghỉ thu khi nhận phòng hoặc trả phòng.
        * paxPrice (Array\[PaxPrice], optional),

          Mảng đối tượng chứa thông tin giá theo số lượng người ở trong một phòng

          * nightPrices (Array\[NightPrice], optional),

            Mảng đối tượng chứa thông tin giá theo từng đêm

            * nightKey (string, optional),

              Khóa định danh của từng đêm
            * nightPriceDetails (Array\[NightPriceDetail], optional)

              Mảng đối tượng chứ thông tin giá chi tiết theo từng đêm

              * name (string, optional),

                Tên loại giá

                * `base_rate`: Giá cơ bản không bao gồm thuế phí
                * `tax_and_service_fee`: Thuế và phí
              * value (number, optional),

                Số tiền
              * ~~valueByHotelCurrency (string, optional)~~
          * paxInfo (PaxInfo, optional)

            Mô tả thông tin người ở

            * adultQuantity (integer, optional),

              Số lượng người lớn
            * childAges (Array\[integer], optional),

              Mảng chứa thông tin tuổi của trẻ em, số lượng phần từ mảng bằng với số lượng trẻ em
            * childQuantity (integer, optional),

              Số lượng trẻ em
            * ~~infantQuantity (integer, optional)~~
        * promo (boolean, optional),

          Thông tin xác định có khuyến mãi hay không

          * `true`: Có khuyến mãi
          * `false`: Không có khuyến mãi
        * promoDescription (string, optional),

          Mô tả thông tin khuyến mãi
        * ratePlanId (string, optional),

          Mã định danh tùy chọn giá
        * ratePlanName (string, optional),

          Tên của tùy chọn giá
        * refundable (boolean, optional),

          Thông tin xác định khi hủy phòng có được hoàn tiền hay không

          * `true`: Được hoàn tiền khi hủy
          * `false`: Không được hoàn tiền khi hủy
        * taxAndFees (number, optional),

          Thuế và phí của tùy chọn giá
        * totalPrice (number, optional),

          Giá tổng cộng đã bao gồm thuế phí
        * ~~totalPriceByHotelCurrency (number, optional),~~
        * totalRooms (integer, optional)

          Số lượng phòng còn trống
      * roomArea (RoomArea, optional)

        Thông tin về diện tích căn phòng

        * `squareFeet`: Diện tích của phòng được tính bằng feet vuông
        * `squareMeters`: Diện tích của phòng được tính bằng mét vuông
      * bedGroupStatics (Array\[BedGroupStatic], optional)

        Mảng các đối tượng nhóm giường trong phòng

        * id (String, optional)

          mã định danh nhóm giường
        * name (String, optional)

          Tên nhóm giường
        * ~~value (String, optional)~~
      * views (Array\[View], optional)

        Thông tin mô tả hướng nhìn của phòng

        * id (String, optional)

          mã định danh hướng nhìn
        * name (String, optional)

          Mô tả hướng nhìn
        * ~~value (String, optional)~~
      * occupancyAllowed (OccupancyAllowed, optional)

        Thông tin về số người ở được phép

        * roomMaxAllowed (RoomMaxAllowed, optional)

          Sức chứa tối đa

          * adult (integer, optional)

            Số người lớn
          * children (integer, optional)

            Số trẻ em
          * total (integer, optional)

            Tổng số người
        * ~~roomAgeCategories (Array\[Attribute], optional)~~
      * amenities (Array\[Amenity], optional)

        Mảng chứa đối tương thông tin tiện nghi của phòng

        * id (string, optional),

          Mã định danh tiện nghi phòng
        * name (string, optional),

          Tên tiện nghi phòng
        * symbol (string, optional),

          Biểu tượng hiện thị của nghi phòng
        * ~~value (string, optional)~~
        * group (string, optional)

          Thông tin tiện nghi của phòng được gom nhóm, với các nhóm sau

          * `OTHER`: Tiện nghi khác
          * `BEDROOM`: Tiện nghi phòng ngủ
          * `BATHROOM`: Tiện nghi phòng tắm
          * `ENTERTAINMENT`: Giải trí đa phương tiện trong phòng
          * `FOOD_AND_DRINK`: Tiện nghi về đồ ăn thức uống trong phòng
          * `ROOM_VIEW`: Hướng nhìn
          * `INTERNET`: Mạng intenet
          * `SMOKING`: Hút thuốc
    * spokenLanguage (Array\[Attribute], optional),

      Các ngôn ngữ giao tiếp với nhân viên khách sạn.

      * id (string, optional),

        Mã định danh ngôn ngữ
      * name (string, optional),

        Tên ngôn ngữ
      * ~~value (string, optional)~~
    * statistics (Array\[Attribute], optional),

      Thống kê về tài sản, chẳng hạn như số tầng

      * id (string, optional),

        Mã định danh thống kê
      * name (string, optional),

        Mô tả thống kê bao gồm tên và giá trị thống kê

        ```
        {
            "id": "52",
            "name": "Tổng số phòng: - 335",
            "value": "335"
        }
        ```
      * value (string, optional)

        Giá trị của thống kê
    * supplier (string, optional) = \[EXPEDIA, AXISROOM, BEDLINKER],

      Nguồn khách sạn
    * tags (Array\[string], optional),

      Thẻ được gắn cho khách sạn, để xác định một số yêu cầu đặc biệt
    * themes (Array\[Attribute], optional)

      Mảng đối tượng chứa thông tin về chủ đề của khách sạn

      * id (string, optional),

        Mã định chủ đề
      * name (string, optional),

        Tên chủ đề
      * ~~value (string, optional)~~
    * masterPropertyId (Long, optional)

      Mã định danh khách sạn chính.
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 5. API Lấy danh sách khách sạn <a href="#id-5-api-lay-danh-sach-khach-san" id="id-5-api-lay-danh-sach-khach-san"></a>

GET: /api/v3/hotel/get-master-properties

Lấy danh sách thông tin cơ bản của khách sạn.

#### Parameters <a href="#parameters_4" id="parameters_4"></a>

<details>

<summary>Parameters</summary>

* id `query` (String, optional)

  Mã định danh khách sạn
* language `query` (String, Required)

  Ngôn ngữ

  * `vi` : Tiếng Việt
  * `en`: Tiếng Anh
* lastModifiedDate `query` (String, optional)

  Ngày cập nhật
* pageNumber `query` (String, Optional)

  Trang số
* pageSize `query` (String, Optional)

  Số phần tử trên trang

</details>

Example

#### Response <a href="#response_4" id="response_4"></a>

**Code 200**

Model

<details>

<summary>Model</summary>

* result (FilterOptionsResult, optional)

  Thông tin kết quả trả về

  * masterProperties (Array\[MasterProperty], optional),

    Danh sách thông tin khách sạn

    * id (Long, optional),

      Mã định danh
    * propertyName (string, optional),

      Tên khách sạn
    * address (Address, optional)

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * propertyLocation (PropertyLocation, optional) = \[‘vi’, ‘en’],

      Vị trí toạ độ

      * longitude (string, optional),

        Kinh độ
      * latitude (string, optional),

        Vĩ độ
    * activated (boolean, required),

      Trạng thái `true`: hoạt động / `false`: không hoạt động
    * legacyIds (Array\[Long], optional),

      Danh sách mã định danh cũ
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>


# Booking API

### 1. API Kiểm tra tình trạng phòng (checkout) <a href="#id-1-api-kiem-tra-tinh-trang-phong-checkout" id="id-1-api-kiem-tra-tinh-trang-phong-checkout"></a>

POST: /api/v3/hotel/checkout

Trả về kết quả tình trạng của phòng

#### Request Body <a href="#request-body" id="request-body"></a>

<details>

<summary>Request Body</summary>

* tripId (String, Required)

  Mã định danh kết quả search-all-rate, lấy từ kết quả trả về search-all-rates
* roomId (String, Required)

  Mã định danh phòng, lấy từ kết quả trả về search-all-rates
* ratePlanId (String, Required)

  Mã định danh tùy chọn giá, lấy từ kết quả trả về search-all-rates
* metadata (String, Required)

  Thông tin mở rộng

  * customer-ip (String, Required)

    Địa chỉ IP của người dùng cuối

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (CheckoutResult, Optional)

  Thông tin kết quả trả về

  * status (string, optional) = \[‘AVAILABLE’, ‘PRICE\_CHANGED’, ‘SOLD\_OUT’, ‘UNKNOWN’]

    Thông tin xác định trạng thái của phòng

    * `AVAILABLE`: Phòng đang tồn tại sẳn sàng để book
    * `PRICE_CHANGED`: Giá phòng đã bị thay đổi, thông tin giá thay đổi được cập nhật trong HotelProduct
    * `SOLD_OUT`: Phòng đã hết
    * `UNKNOWN`: Không xác định trạng thái phòng
  * hotelProduct (HotelProduct, optional),

    Thông tin phòng trả về

    * address (Address, optional),

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * amenities (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin tiện nghi của khách sạn

      * id (string, optional),

      Mã tiện nghi khách sạn

      * name (string, optional),

        Tên của tiện nghi khách sạn
      * ~~value (string, optional)~~
    * ~~attributes (Array\[Attribute], optional),~~
    * checkin (Checkin, optional),

      Khoảng thời gian nhận phòng, theo giờ địa phương của khách sạn

      * beginTime (string, optional),

        Thời gian bắt đầu được nhận phòng. Mặc định: 14:00
      * endTime (string, optional)

        Thời gian kết thúc được nhận phòng. Mặc định: 24:00
    * checkout (Checkout, optional),

      Thông tin thời gian trả phòng. Mặc định trước 12:00

      * endTime (string, optional)

        Thời gian trả phòng tối đa. Mặc định trước 12:00
    * currency (string, optional) = \[‘VND’, ‘USD’],

      Thông tin tiền tệ trả về
    * customerIp (string, optional),

      Thông tin địa chỉ ip của người dùng cuối
    * descriptions (Array\[Attribute], optional),

      Thông tin mô tả về khách sạn

      * id (string, optional),

        Mã định danh thuộc tính mô tả
      * name (string, optional),

        Tên thuộc tính

        * `description`: mô tả chung
        * `amenities`: mô tả chung về tiện nghi của khách sạn
        * `dining`: Mô tả về chỗ ăn uống của khách sạn
        * `renovations`: Mô tả về quá trình cải tạo phòng hoặc khách sạn mới đây
        * `national_ratings`: Nêu rõ nguồn xếp hạng sao của khách sạn
        * `business_amenities`: Mô tả về tiện nghi dành cho doanh nghiệp tại chỗ nghỉ, Ví dụ: phòng hội nghị
        * `rooms`: Mô tả về phòng
        * `attractions`: Mô tả về điểm tham quan gần khách sạn
        * `location`: Mô tả về vị trí của khách sạn
        * `headline`: Mô tả tóm tắt
      * value (string, optional)

        Thông tin mô tả
    * fees (Array\[Attribute], optional),

      Thông tin mô tả về một số khoản phụ phí kèm theo

      * id (string, optional),

        Mã định danh thuộc tính phí
      * name (string, optional),

        Tên thuộc tính phí

        * `mandatory`: Phí bắt buộc
        * `optional`: Phí không bắt buộc
      * value (string, optional)

        Mô tả về khoản phí
    * images (Array\[HotelImage], optional),

      Hình ảnh của khách sạn

      * caption (string, optional),

        Tiêu đề của hình ảnh
      * link (string, optional),

        Liên kết tới hình ảnh. Liên kết tuyệt đối
      * position (integer, optional)

        Vị trí sắp xếp hình ảnh
    * inclusions (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin mô tả về thuộc tính của khách sạn

      * id (string, optional),

        Mã định danh thuộc tính
      * name (string, optional),

        Mô tả thuộc tính
      * ~~value (string, optional)~~
    * language (string, optional) = \[‘vi’, ‘en’],

      Ngôn ngữ trả về
    * latitude (number, optional),

      Vĩ độ của khách sạn
    * longitude (number, optional),

      Kinh độ của khách sạn
    * policies (Array\[Attribute], optional),

      Thông tin về chính sách khách sạn mà khách cần lưu ý.

      * id (string, optional),

        Mã định danh chính sách
      * name (string, optional),

        Tên thuộc chính sách

        * `know_before_you_go`: Mô tả thông tin có thể hữu ích khi lập kế hoạch cho chuyến đi đến nơi này
      * value (string, optional)

        Mô tả về chính sách
    * productId (string, optional),

      Mã định danh sản phẩm
    * propertyCategory (PropertyCategory, optional),

      Danh mục của khách sạn

      * id (string, optional),

        Mã định danh danh mục khách sạn
      * name (string, optional)

        Tên danh mục khách sạn
    * propertyId (string, optional),

      Mã định danh khách sạn
    * propertyName (string, optional),

      Tên khách sạn
    * ~~rank (integer, optional),~~
    * rating (Rating, optional),

      Đánh giá về khách sạn

      * ratingGuest (RatingGuest, optional)

        Đánh giá của khách

        * amenities (string, optional),

          Xếp hạng cho các tiện nghi do khách sạn cung cấp, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * cleanliness (string, optional),

          Đánh giá mức độ sạch sẽ cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * comfort (string, optional),

          Đánh giá mức độ thoải mái của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * condition (string, optional),

          Xếp hạng cho tình trạng của chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * count (integer, optional),

          Tất cả xếp hạng đánh giá của khách giành cho khách sạn
        * location (string, optional),

          Xếp hạng về mức độ hấp dẫn của vị trí của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * neighborhood (string, optional),

          Xếp hạng về mức độ hài lòng của khu vực lân cận của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * overall (string, optional),

          Đánh giá chung cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * quality (string, optional),

          Xếp hạng chất lượng của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * recommendationPercent (string, optional),

          Phần trăm khách giới thiệu ở tại chỗ nghỉ này.
        * ~~score (string, optional),~~
        * service (string, optional),

          Đánh giá về dịch vụ của nhân viên đối với chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * value (string, optional)

          Xếp hạng cho giá trị của bất động sản cung cấp cho chi phí lưu trú, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
      * ratingProperty (RatingProperty, optional)

        Đánh giá hạng sao khách sạn

        * rating (string, optional),

          Giá trị sếp hạng. Trả về giá trị từ 0,0 đến 5,0. Giá trị 0,0 hoặc giá trị trống cho biết không có xếp hạng nào.
        * type (string, optional)

          Loại đánh giá

          * `Star`: Xếp hạng sao của khách sạn
    * rooms (Array\[PropertyRoom], optional),

      Mảng đối tượng chứa thông tin phòng

      * descriptions (Array\[Attribute], optional),

        Thông tin mô tả

        * id (string, optional),

          Mã định danh
        * name (string, optional),

          Tên mô tả

          * `overview`: Thông tin mô tả tổng quan về căn phòng
        * value (string, optional)

          Thông tin mô tả
      * id (string, optional),

        Mã định danh cho loại phòng
      * images (Array\[RoomImage], optional),

        Mảng đối tượng chứa thông tin hình ảnh của loại phòng

        * caption (string, optional),

          Tiêu đề của hình ảnh
        * link (string, optional),

          Liên kết tới hình ảnh, là liên kết tuyệt đối
        * position (integer, optional)

          Vị trí sắp xếp của hình ảnh
      * name (string, optional),

        Tên của loại phòng
      * ratePlans (Array\[RatePlan], optional),

        Mảng đối tượng chứa thông tin về tùy chọn giá

        * amenities (Array\[Amenity], optional),

          Mảng đối tượng chứa thông tin tiện nghi của tùy chọn giá

          * id (string, optional),

            Mã định danh tiện nghi
          * name (string, optional),

            Tên tiện nghi
          * ~~value (string, optional)~~
          * ~~group (sting, optional)~~
        * basePrice (number, optional),

          Giá cơ bản
        * basePriceBeforePromo (number, optional),

          Giá cơ bản trước khuyến mãi
        * bedGroups (Array\[BedGroup], optional),

          Mảng đối tượng nhóm giường trong phòng

          * configurations (Array\[ConfigurationBedGroup], optional),

            Thông tin cấu hình giường cho phòng

            * quantity (integer, optional),

              Số lượng giường
            * size (string, optional),

              Kích thước của giường
            * type (string, optional)

              Loại giường
          * description (string, optional),

            Mô tả hiển thị giường cho phòng này
          * id (string, optional)

            Mã định danh nhóm giường
        * breakfastIncluded (boolean, optional),

          Tùy chọn giá có bao gồm bữa sáng hay không
        * cancelFree (boolean, optional),

          Mô tả thông tin được phép hủy đặt phòng với tùy chọn giá này có tốn phí phạt hay không

          * `true`: Hủy đặt phòng miễn phí
          * `false`: Không đặt hủy đặt phòng miễn phí
        * cancelFreeBeforeDate (string, optional),

          Ngày giới hạn cho phép hủy đặt phòng với tùy chọn giá này một cách miễn phí
        * cancelPenalties (Array\[CancelPenalty], optional),

          Mô tả các hình thức phạt khi hủy đặt phòng với tùy chọn giá này. Xem thêm chi tiết ở tài liệu api search-all-rates.

          * type (string, optional)

            Loại hình phạt

            * `NIGHTS`: Số đêm bị phạt
            * `AMOUNT`: Số tiền bị phạt
            * `PERCENT`: Số phần trăm bị phạt
          * currency (string, optional) = \[‘VND’, ‘USD’],

            Đơn vị tiền tệ đối với `type = AMOUNT`
          * amount (string, optional),

            Số tiền của hình phạt
          * description (string, optional),

            Mô tả về hình phạt
          * nights (string, optional),

            Số đêm bị tính phí phạt
          * percent (string, optional),

            Số phần trăm bị phạt
          * startDate (string, optional),

            Ngày bắt đầu có hiệu lực của hình phạt
          * endDate (string, optional),

            Ngày kết thúc của hình phạt
        * fees (Map, optional),

          Thông tin các loại phí được phu bởi khách sạn Giá trị mối loại phí là tổng của loại đó. Phạm vi ảnh hưởng của mô tả này chỉ là thông tin thông báo cho khách hàng biết.

          * `mandatory_fee`: Một khoản phí bắt buộc do khách sạn thu khi nhận phòng hoặc trả phòng.
          * `resort_fee`: Một khoản phí cho các tiện nghi và dịch vụ bổ sung và được khách sạn thu khi nhận phòng hoặc trả phòng.
          * `mandatory_tax`: Khoản thuế bắt buộc do chỗ nghỉ thu khi nhận phòng hoặc trả phòng.
        * paxPrice (Array\[PaxPrice], optional),

          Mảng đối tượng chứa thông tin giá theo số lượng người ở trong một phòng

          * nightPrices (Array\[NightPrice], optional),

            Mảng đối tượng chứa thông tin giá theo từng đêm

            * nightKey (string, optional),

              Khóa định danh của từng đêm
            * nightPriceDetails (Array\[NightPriceDetail], optional)

              Mảng đối tượng chứ thông tin giá chi tiết theo từng đêm

              * name (string, optional),

                Tên loại giá

                * `base_rate`: Giá cơ bản không bao gồm thuế phí
                * `tax_and_service_fee`: Thuế và phí
              * value (number, optional),

                Số tiền
              * ~~valueByHotelCurrency (string, optional)~~
          * paxInfo (PaxInfo, optional)

            Mô tả thông tin người ở

            * adultQuantity (integer, optional),

              Số lượng người lớn
            * childAges (Array\[integer], optional),

              Mảng chứa thông tin tuổi của trẻ em, số lượng phần từ mảng bằng với số lượng trẻ em
            * childQuantity (integer, optional),

              Số lượng trẻ em
            * ~~infantQuantity (integer, optional)~~
        * promo (boolean, optional),

          Thông tin xác định có khuyến mãi hay không

          * `true`: Có khuyến mãi
          * `false`: Không có khuyến mãi
        * promoDescription (string, optional),

          Mô tả thông tin khuyến mãi
        * ratePlanId (string, optional),

          Mã định danh tùy chọn giá
        * ratePlanName (string, optional),

          Tên của tùy chọn giá
        * refundable (boolean, optional),

          Thông tin xác định khi hủy phòng có được hoàn tiền hay không

          * `true`: Được hoàn tiền khi hủy
          * `false`: Không được hoàn tiền khi hủy
        * taxAndFees (number, optional),

          Thuế và phí của tùy chọn giá
        * totalPrice (number, optional),

          Giá tổng cộng đã bao gồm thuế phí
        * ~~totalPriceByHotelCurrency (number, optional),~~
        * totalRooms (integer, optional)

          Số lượng phòng còn trống
      * roomArea (RoomArea, optional)

        Thông tin về diện tích căn phòng

        * `squareFeet`: Diện tích của phòng được tính bằng feet vuông
        * `squareMeters`: Diện tích của phòng được tính bằng mét vuông
    * searchId (string, optional),
      * Mã tham chiếu đến kết quả tìm kiếm (search-best-rate)
    * statistics (Array\[Attribute], optional),

      Thống kê về tài sản, chẳng hạn như số tầng

      * id (string, optional),

        Mã định danh thống kê
      * name (string, optional),

        Mô tả thống kê bao gồm tên và giá trị thống kê

        ```
        {
            "id": "52",
            "name": "Tổng số phòng: - 335",
            "value": "335"
        }
        ```
      * value (string, optional)

        Giá trị của thống kê
    * supplier (string, optional) = \[‘EXPEDIA’, ‘AXISROOM’, ‘BEDLINKER’],

      Nguồn khách sạn
    * themes (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin về chủ đề của khách sạn

      * id (string, optional),

        Mã định chủ đề
      * name (string, optional),

        Tên chủ đề
      * ~~value (string, optional)~~
    * tripId (string, optional),

      Mã liên kết đến kết quả search-all-rates
    * hotelContact (HotelContact, optional),

      Thông tin liên hệ trực tiếp của khách sạn

      * phone (string, optional),

        Số điện thoại khách sạn
      * email (string, optional),

        Email khách sạn
      * fax (integer, optional)

        Số fax khách sạn
    * mealPlans (Array\[Attribute], optional),

      Mảng chứa thông tin bữa ăn của ratePlan

      * id (string, optional),

        Mã định danh bữa ăn
      * name (string, optional),

        Tên gói bữa ăn
      * ~~value (string, optional)~~
* duration (Integer, Optional)
* success (Integer, Bool)
* infos (Array\[InfosDTO], Optional)
* errors (Array\[ErrorsDTO], Optional)
* textMessage (String, Optional)

</details>

***

### 2. API Khởi tạo booking <a href="#id-2-api-khoi-tao-booking" id="id-2-api-khoi-tao-booking"></a>

POST: /api/v3/hotel/create-draft-booking

Khởi tạo booking

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

<details>

<summary>Request Body</summary>

* tripId (String, Required)

  Mã định danh kết quả search-all-rate, lấy từ kết quả trả về search-all-rates
* roomId (String, Required)

  Mã định danh phòng, lấy từ kết quả trả về search-all-rates
* ratePlanId (String, Required)

  Mã định danh tùy chọn giá, lấy từ kết quả trả về search-all-rates
* metadata (String, Required)

  Thông tin mở rộng

  * customer-ip (String, Required)

    Địa chỉ IP của người dùng cuối

</details>

Example

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

<details>

<summary>Model</summary>

* result (Booking, optional)

  Thông tin booking đã tạo

  * additionalFee (number, optional),

    Các khoản phí khác
  * agencyCode (string, optional),

    Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
  * ~~agencyMarkupValue (number, optional),~~
  * agentCode (string, optional),

    Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentId (integer, optional),

    Id nhân viên đại lý
  * agentName (string, optional),

    Tên nhân viên đại lý
  * baseFare (number, optional),

    Giá phòng chưa bao gồm thuế phí
  * bookBy (string, optional),

    Người đặt booking
  * bookByCode (string, optional),

    Mã người đặt
  * bookingCode (string, optional),

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingDate (string, optional),

    Ngày tạo booking
  * bookingNote (string, optional),

    Ghi chú của booking
  * bookingNumber (string, optional),

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * bookingType (string, optional) = \[‘DOME’, ‘INTE’],

    Xác định điểm đến là trong nước hay quốc tế

    * `DOME`: Trong nước
    * `INTE`: Quốc tế
  * branchCode (string, optional),

    Mã chi nhánh
  * cancellationBy (string, optional),

    Hủy đặt phòng bởi …
  * cancellationDate (string, optional),

    Ngày hủy đặt phòng
  * cancellationFee (number, optional),

    Phí hủy đặt phòng
  * cancellationNotes (string, optional),

    Ghi chú hủy
  * channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],

    Loại kênh đặt phòng
  * commissionValue (number, optional),

    Giá trị hoa hồng
  * createdBy (string, optional),

    Người tạo booking
  * createdDate (string, optional),

    Ngày tạo booking
  * customerCode (string, optional),

    Mã khách hàng
  * customerEmail (string, optional),

    Email của khách hàng
  * customerFirstName (string, optional),

    Họ của khách hàng
  * customerId (integer, optional),

    Id của khách hàng
  * customerLastName (string, optional),

    Tên của khách hàng
  * customerPhoneNumber1 (string, optional),

    Số điện thoại 1 của khách hàng
  * customerPhoneNumber2 (string, optional),

    Số điện thoại 2 của khách hàng
  * departureDate (string, optional),

    Ngày nhận phòng
  * discountAmount (number, optional),

    Số tiền được giảm
  * discountDate (string, optional),

    Ngày sử dụng mã giảm giá
  * discountRedeemCode (string, optional),

    Mã liên kết đổi thưởng
  * discountRedeemId (string, optional),

    Id định danh liên kết đổi thường
  * discountTrackingCode (string, optional),

    Mã theo dõi thông tin giảm giá
  * discountVoucherCode (string, optional),

    Mã voucher
  * discountVoucherName (string, optional),

    Tên voucher
  * ~~equivFare (number, optional),~~
  * ~~fromCity (string, optional),~~
  * ~~fromLocationCode (string, optional),~~
  * ~~fromLocationName (string, optional),~~
  * id (integer, optional),

    Id của booking
  * ~~internalBookingNote (string, optional),~~
  * ~~isDeleted (boolean, optional),~~
  * issuedBy (string, optional),

    Xuất phòng bởi …
  * issuedByCode (string, optional),

    Mã người xuất phòng
  * issuedDate (string, optional),

    Ngày xuất phòng
  * issuedStatus (string, optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

    Trạng thái xuất phòng

    * `PENDING`: Đợi xuất phòng
    * `TICKET_ON_PROCESS`: Xuất phòng đang được xử lý
    * `SUCCEEDED`: Xuất phòng thành công
    * `FAILED`: Xuất phòng thất bại
  * ~~markupValue (number, optional),~~
  * orgCode (string),

    Mã tổ chức
  * partnerOrderId (string, optional),

    Id định danh đặt hàng của đối tác
  * partnerRequestId (string, optional),

    Id định danh request của đối tác
  * paymentBy (string, optional),

    Thanh toán bởi …
  * paymentByCode (string, optional),

    Mã người thanh toán
  * paymentDate (string, optional),

    Thời gian thanh toán
  * paymentFee (number, optional),

    Phí thanh toán
  * paymentRefNumber (string, optional),

    Mã tham chiếu thanh toán
  * paymentStatus (string, optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],

    Trạng thái thanh toán

    * `PENDING`: Chờ thanh toán
    * `SUCCEEDED`: Thanh toán thành công
    * `FAILED`: Thanh toán thất bại
    * `REFUNDED`: Hoàn tiền
  * paymentTotalAmount (number, optional),

    Tổng số tiền thanh toán
  * paymentType (string, optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘AIRPAY’, ‘PAYOO’, ‘CASH’, ‘TRANSFER’, ‘PARTNER’, ‘OTHER’],

    Hình thức thanh toán
  * ~~promotionID (Array\[string], optional),~~
  * ~~reconciliationType (string, optional) = \[‘NEW’, ‘ALREADY\_RECONCILIATION’],~~
  * refundAmount (number, optional),

    Số tiền hoàn trả
  * refundBy (string, optional),

    Người hoàn trả
  * refundByCode (string, optional),

    Mã của người thực hiện hoàn trả
  * refundDate (string, optional),

    Ngày hoàn trả
  * ~~refundNextVoidDate (string, optional),~~
  * returnDate (string, optional),

    Ngày trả phòng
  * roundType (string, optional) = \[‘RoundTrip],
  * saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

    Kênh phân phối
  * serviceTax (number, optional),

    Thuế và phí
  * ~~sessionSearchId (string, optional),~~
  * status (string, optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

    Trạng thái của booking

    * `PENDING`: Chờ xác nhận booking
    * `BOOKING_ON_PROCESS`: Booking đang được xử lý
    * `BOOKED`: Booking đã được xác nhận
    * `FAILED`: Booking thất bại
    * `EXPIRED`: Booking hết hạn
    * `CANCELLED`: Booking đã bị hủy
  * supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

    Loại sản phẩm
  * ~~tags (string, optional),~~
  * taxAddress1 (string, optional),

    Địa chỉ xuất hóa đơn dòng 1
  * taxAddress2 (string, optional),

    Địa chỉ xuất hóa đơn dòng 2
  * taxCompanyName (string, optional),

    Tên công ty xuất hóa đơn
  * taxNumber (string, optional),

    Mã số thuế cần xuất hóa đơn
  * taxPersonalInfoContact (string, optional),

    Người nhận hóa đơn
  * taxReceiptRequest (boolean, optional),

    Yêu cầu xuất hóa đơn hay không
  * timeToLive (string, optional),

    Thời gian chờ thanh toán, sau thời gian này trạng thái của booking sẽ chuyển sang `EXPIRED`
  * ~~timeToLiveExpired (string, optional),~~
  * toCity (string, optional),

    Tên tỉnh, thành phố nơi đặt phòng khách sạn
  * toLocationCode (string, optional),

    Mã định danh khách sạn
  * toLocationName (string, optional),

    Tên khách sạn
  * totalFare (number, optional),

    Tổng giá phòng
  * ~~totalSsrValue (number, optional),~~
  * totalTax (number, optional),

    Tổng số tiền thuế phí
  * updatedBy (string, optional),

    Người cập nhật
  * updatedDate (string, optional),

    Ngày cập nhật
  * ~~vat (number, optional)~~
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 3. API Lấy chi tiết booking <a href="#id-3-api-lay-chi-tiet-booking" id="id-3-api-lay-chi-tiet-booking"></a>

POST: /api/products/booking-detail

Lấy thông tin chi tiết của booking

#### Parameters <a href="#parameters" id="parameters"></a>

<details>

<summary>Parameters</summary>

* bookingNumber `query` (string, required),

  Mã tham chiếu đến booking

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**[**¶**](https://developer.gotadi.com/dev-guide/b2b2c-partner-api/api-hotel/api-booking/#code-200_2)

> OK

Model

<details>

<summary>Model</summary>

* id (string, optional),

  Mã định danh chi tiết booking
* agencyCode (string, optional),

  Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
* agentCode (string, optional),

  Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
* bookingCode (string, optional),

  Mã dùng mô tả các thông tin cơ bản của booking
* bookingDate (string, optional),

  Ngày tạo booking
* bookingInfo (BookingInfo, optional),

  Thông tin booking

  * additionalFee (number, optional),

    Các khoản phí khác
  * agencyCode (string, optional),

    Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
  * ~~agencyMarkupInfos (Array\[BookingAgencyMarkupInfo], optional),~~
  * ~~agencyMarkupValue (number, optional),~~
  * agentCode (string, optional),

    Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentId (integer, optional),

    Id nhân viên đại lý
  * agentName (string, optional),

    Tên nhân viên đại lý
  * allowHold (boolean, optional),

    Cho phép giữ phòng hay không

    `true`: cho phép giữ phòng

    `false`: Không cho phép giữ phòng
  * baseFare (number, optional),

    Giá phòng chưa bao gồm thuế phí
  * bookBy (string, optional),

    Người đặt booking
  * bookByCode (string, optional),

    Mã người đặt
  * bookingCode (string, optional),

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingDate (string, optional),

    Ngày tạo booking
  * ~~bookingIssuedType (string, optional) = \[‘INSTANT\_BOOKING’, ‘CONFIRM\_OFFLINE’],~~
  * bookingNote (string, optional),

    Ghi chú của booking
  * bookingNumber (string, optional),

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * bookingType (string, optional) = \[‘DOME’, ‘INTE’],

    Xác định điểm đến là trong nước hay quốc tế

    * `DOME`: Trong nước
    * `INTE`: Quốc tế
  * branchCode (string, optional),

    Mã chi nhánh
  * cancellationBy (string, optional),

    Hủy đặt phòng bởi …
  * cancellationDate (string, optional),

    Ngày hủy đặt phòng
  * cancellationFee (number, optional),

    Phí hủy đặt phòng
  * cancellationNotes (string, optional),

    Ghi chú hủy
  * channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],

    Loại kênh đặt phòng
  * contactInfos (Array\[BookingContactInfo], optional),

    Mảng đối tượng chứ thông tin người liên hệ

    * bookingNumber (string, optional),

      Mã tham chiếu đến booking
    * contactLevel (string, optional) = \[‘PRIMARY’, ‘SECONDARY’, ‘OTHER’],

      Cấp của người liên hệ
    * contactType (string, optional) = \[‘CUSTOMER’, ‘AGENCY’],

      Loại của người liên hệ
    * email (string, optional),

      Địa chỉ email
    * firstName (string, optional),

      Tên đêm và tên người liên hệ
    * phoneCode1 (string, optional),

      Mã quốc gia
    * phoneNumber1 (string, optional),

      Số điện thoại 1
    * surName (string, optional)

      Họ người liên hệ
  * customerCode (string, optional),

    Mã khách hàng
  * customerEmail (string, optional),

    Email của khách hàng
  * customerFirstName (string, optional),

    Họ của khách hàng
  * customerId (integer, optional),

    Id của khách hàng
  * customerLastName (string, optional),

    Tên của khách hàng
  * customerPhoneNumber1 (string, optional),

    Số điện thoại 1 của khách hàng
  * customerPhoneNumber2 (string, optional),

    Số điện thoại 2 của khách hàng
  * ~~deleted (boolean, optional),~~
  * departureDate (string, optional),

    Ngày nhận phòng
  * discountAmount (number, optional),

    Số tiền được giảm
  * discountDate (string, optional),

    Ngày sử dụng mã giảm giá
  * discountRedeemCode (string, optional),

    Mã liên kết đổi thưởng
  * discountRedeemId (string, optional),

    Id định danh liên kết đổi thường
  * discountVoucherCode (string, optional),

    Mã voucher
  * discountVoucherName (string, optional),

    Tên voucher
  * ~~displayPriceInfo (BookingPriceInfo, optional),~~
  * ~~equivFare (number, optional),~~
  * etickets (string, optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
  * ~~fromCity (string, optional),~~
  * ~~fromLocationCode (string, optional),~~
  * ~~fromLocationName (string, optional),~~
  * id (integer, optional),

    Id của booking
  * ~~internalBookingNote (string, optional),~~
  * issuedByCode (string, optional),

    Xuất phòng bởi …
  * issuedDate (string, optional),

    Ngày xuất phòng
  * issuedStatus (string, optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

    Trạng thái xuất phòng

    * `PENDING`: Đợi xuất phòng
    * `TICKET_ON_PROCESS`: Xuất phòng đang được xử lý
    * `SUCCEEDED`: Xuất phòng thành công
    * `FAILED`: Xuất phòng thất bại
  * ~~markupValue (number, optional),~~
  * ~~onlyPayLater (boolean, optional),~~
  * orgCode (string, optional),

    Mã tổ chức
  * ownerBooking (boolean, optional),

    Chủ sở hữu đặt chỗ
  * passengerNameRecords (string, optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
  * paymentBy (string, optional),

    Thanh toán bởi …
  * paymentByCode (string, optional),

    Mã người thanh toán
  * paymentDate (string, optional),

    Thời gian thanh toán
  * paymentFee (number, optional),

    Phí thanh toán
  * paymentRefNumber (string, optional),

    Mã tham chiếu thanh toán
  * paymentStatus (string, optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],

    Trạng thái thanh toán

    * `PENDING`: Chờ thanh toán
    * `SUCCEEDED`: Thanh toán thành công
    * `FAILED`: Thanh toán thất bại
    * `REFUNDED`: Hoàn tiền
  * paymentTotalAmount (number, optional),

    Tổng số tiền thanh toán
  * paymentType (string, optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘AIRPAY’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘PAYOO’, ‘CASH’, ‘TRANSFER’, ‘PARTNER’, ‘OTHER’],

    Hình thức thanh toán
  * ~~promotionID (Array\[string], optional),~~
  * ~~reasonCodePaymentFailed (string, optional),~~
  * refundBy (string, optional),

    Người hoàn trả
  * refundByCode (string, optional),

    Mã của người thực hiện hoàn trả
  * refundable (boolean, optional),

    Ngày hoàn trả
  * returnDate (string, optional),

    Ngày trả phòng
  * roundType (string, optional) = \[‘RoundTrip],
  * saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

    Kênh phân phối
  * serviceTax (number, optional),

    Thuế và phí
  * ~~showPayLaterOption (boolean, optional),~~
  * ~~showPayNowOption (boolean, optional),~~
  * status (string, optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

    Trạng thái của booking

    * `PENDING`: Chờ xác nhận booking
    * `BOOKING_ON_PROCESS`: Booking đang được xử lý
    * `BOOKED`: Booking đã được xác nhận
    * `FAILED`: Booking thất bại
    * `EXPIRED`: Booking hết hạn
    * `CANCELLED`: Booking đã bị hủy
  * ~~supplierBookingStatus (string, optional),~~
  * supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

    Loại nhà cung cấp
  * taxAddress1 (string, optional),

    Địa chỉ xuất hóa đơn dòng 1
  * taxAddress2 (string, optional),

    Địa chỉ xuất hóa đơn dòng 2
  * taxCompanyName (string, optional),

    Tên công ty xuất hóa đơn
  * taxNumber (string, optional),

    Mã số thuế cần xuất hóa đơn
  * taxPersonalInfoContact (string, optional),

    Người nhận hóa đơn
  * taxReceiptRequest (boolean, optional),

    Yêu cầu xuất hóa đơn hay không
  * timeToLive (string, optional),

    Thời gian chờ thanh toán, sau thời gian này trạng thái của booking sẽ chuyển sang `EXPIRED`
  * toCity (string, optional),

    Tên tỉnh, thành phố nơi đặt phòng khách sạn
  * toLocationCode (string, optional),

    Mã định danh khách sạn
  * toLocationName (string, optional),

    Tên khách sạn
  * totalFare (number, optional),

    Tổng giá phòng
  * ~~totalSsrValue (number, optional),~~
  * totalTax (number, optional),

    Tổng số tiền thuế phí
  * transactionInfos (Array\[BookingTransactionInfo], optional),

    Mảng đối tượng chứa thông tin giao dịch

    * id (integer, optional),

      Id định danh giao dịch
    * ~~agencyMarkupValue (number, optional),~~
    * allowHold (boolean, optional),

      Cho phép giữ phòng hay không
    * bookingCode (string, optional),

      Mã dùng mô tả các thông tin cơ bản của booking
    * bookingDate (string, optional),

      Ngày tạo booking
    * bookingDirection (string, optional) = \[‘TRIP’],
    * bookingNumber (string, optional),

      Mã dùng tham chiếu đến booking.
    * bookingRefNo (string, optional),

      Mã liên kết với nhà cung cấp
    * channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],

      Loại kênh bán
    * checkIn (string, optional),

      Ngày nhận phòng
    * checkOut (string, optional),

      Ngày trả phòng
    * destinationLocationCode (string, optional),

      Mã định danh khách sạn
    * detail (string, optional),

      Tên khách sạn
    * etickets (string, optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
    * issuedDate (string, optional),

      Ngày xuất phòng
    * issuedStatus (string, optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

      Trạng thái xuất phòng

      * `PENDING`: Đợi xuất phòng
      * `TICKET_ON_PROCESS`: Xuất phòng đang được xử lý
      * `SUCCEEDED`: Xuất phòng thành công
      * `FAILED`: Xuất phòng thất bại
    * ~~markupCode (string, optional),~~
    * ~~markupFormula (string, optional),~~
    * ~~markupKey (string, optional),~~
    * ~~markupValue (number, optional),~~
    * noAdult (integer, optional),

      Số người lớn
    * noChild (integer, optional),

      Số trể em
    * onlyPayLater (boolean, optional),

      Cho phép trả sau hay không
    * passengerNameRecord (string, optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
    * paymentAmount (number, optional),

      Số tiền thanh toán
    * productSeqNumber (string, optional),

      Mã sản phẩm
    * refundable (boolean, optional),

      Có hoàn tiền khi hủy phòng hay không
    * saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

      Kênh phân phối
    * serviceTax (number, optional),

      Thuế và phí
    * status (string, optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

      Trạng thái của booking

      * `PENDING`: Chờ xác nhận booking
      * `BOOKING_ON_PROCESS`: Booking đang được xử lý
      * `BOOKED`: Booking đã được xác nhận
      * `FAILED`: Booking thất bại
      * `EXPIRED`: Booking hết hạn
      * `CANCELLED`: Booking đã bị hủy
    * supplierCode (string, optional),

      Mã nhà cung cấp
    * supplierName (string, optional),

      Tên nhà cung cấp
    * supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’]

      Loại sản phẩm
    * totalFare (number, optional),

      Tổng giá phòng
    * totalTax (number, optional)

      Tổng thuế và phí
    * baseFare (number, optional),

      Giá phòng không bao gồm thuế phí
  * travelerInfos (Array\[BookingTravelerInfo], optional),

    Mảng đối tượng chứa thông tin người nhận phòng. Người nhận phòng phải là người lớn. Mỗi một phòng tương ứng với 1 phần tử của mảng.

    * bookingNumber (string),

      Mã tham chiếu đến booking
    * firstName (string),

      Tên đêm và tên người nhận phòng
    * surName (string)

      Họ của người nhận phòng
* bookingNumber (string, optional),

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* bookingType (string, optional),

  Xác định điểm đến là trong nước hay quốc tế

  * `DOME`: Trong nước
  * `INTE`: Quốc tế
* branchCode (string, optional),

  Mã chi nhánh
* cacheType (string, optional) = \[‘HOTEL’],
* ~~channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],~~

  Loại kênh đặt phòng
* ~~customerCode (string, optional),~~

  Mã khách hàng
* ~~groupPricedItineraries (Array\[GroupPricedItinerary], optional),~~
* ~~hotelAvailability (HotelAvailability, optional),~~
* hotelProduct (HotelProduct, optional),

  Đối tượng chứa thông tin phòng (Xem thêm ở response API checkout)
* hotelProductPayload (HotelProductPayload, optional),

  Đối tượng chứa thông tin định danh sản phẩm

  * tripId (String, optional)

    Mã định danh kết quả search-all-rate
  * roomId (String, optional)

    Mã định danh phòng
  * ratePlanId (String, optional)

    Mã định danh tùy chọn giá
* ~~isPerBookingType (boolean, optional),~~
* ~~markupType (string, optional),~~
* ~~offlineBooking (OfflineBooking, optional),~~
* orgCode (string, optional),

  Mã tổ chức
* saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

  Kênh phân phối
* supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

  Loại nhà cung cấp
* ~~travelerInfo (TravelerInfo, optional),~~
* ~~updatedDate (string, optional)~~

</details>

***

### 4. API Cập nhật thông tin booking và giữ chỗ[¶](https://developer.gotadi.com/dev-guide/b2b2c-partner-api/api-hotel/api-booking/#4-api-cap-nhat-thong-tin-booking-va-giu-cho) <a href="#id-4-api-cap-nhat-thong-tin-booking-va-giu-cho" id="id-4-api-cap-nhat-thong-tin-booking-va-giu-cho"></a>

POST: /api/v3/hotel/add-booking-traveller

Cập nhật các thông tin: Hành khách, người liên hệ, thông tin xuất hóa đơn, … và yêu cầu giữ chỗ

#### Request Body[¶](https://developer.gotadi.com/dev-guide/b2b2c-partner-api/api-hotel/api-booking/#request-body_2) <a href="#request-body_2" id="request-body_2"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (string, required),

  Mã tham chiếu đến booking
* bookingContacts (Array\[BookingContactDTO], required),

  Mảng đối tượng chứ thông tin người liên hệ

  * bookingNumber (string),

    Mã tham chiếu đến booking
  * phoneNumber1 (string, optional),

    Số điện thoại 1
  * email (string, optional),

    Địa chỉ email người liên hệ
  * surName (string)

    Họ người liên hệ
  * firstName (string),

    Tên đêm và tên người liên hệ
  * phoneCode1 (string, optional),

    Mã quốc gia
* bookingTravelerInfos (Array\[BookingTravelerInfoDTO], required),

  Mảng đối tượng chứa thông tin người nhận phòng. Người nhận phòng phải là người lớn. Mỗi một phòng tương ứng với 1 phần tử của mảng.

  * traveler (BookingTravelerDTO, optional)

    Thông tin người nhận phòng

    * bookingNumber (string),

      Mã tham chiếu đến booking
    * firstName (string),

      Tên đêm và tên người nhận phòng
    * surName (string)

      Họ của người nhận phòng
* taxReceiptRequest (BookingTaxReceiptRequestDTO, optional)

  Yêu cầu xuất hóa đơn. Nếu không yêu cầu xuất hóa đơn thì để trống

  * bookingNumber (string, optional),

    Mã tham chiếu đến booking
  * taxAddress1 (string, optional),

    Địa chỉ công ty
  * taxCompanyName (string, optional),

    Tên công ty
  * taxNumber (string, optional),

    Mã số thuế
  * taxPersonalInfoContact (string, optional),

    Thông tin liên hệ người yêu cầu xuất hóa đơn

    Là chuỗi json của đối tượng:

    * name (string, required)

      Họ người liên hệ
    * fname (string, required)

      Tên đệm và tên người liên hệ
    * phone (string, required)

      Số điện thoại người liên hệ
    * email (string, required)

      Email người liên hệ
    * phonecode3 (string, required)

      Mã điện thoại
  * taxReceiptRequest (boolean, optional)

    Yêu cầu xuất hóa đơn

    * `true`: Yêu cầu xuất hóa đơn

</details>

Example

#### Response[¶](https://developer.gotadi.com/dev-guide/b2b2c-partner-api/api-hotel/api-booking/#response_3) <a href="#response_3" id="response_3"></a>

**Code 200**[**¶**](https://developer.gotadi.com/dev-guide/b2b2c-partner-api/api-hotel/api-booking/#code-200_3)

> OK

<details>

<summary>Model</summary>

* result (SearchAllRatesResult, optional),
  * bookingCode (BookingCode, optional),

    Mã định danh kết quả search-all-rate, mỗi lần gọi search-all-rate sẽ tạo ra tripId mới, nó được sử dụng khi đi thao tác đặt phòng

    * bookingCode (string, optional)

      Mã dùng mô tả các thông tin cơ bản của booking
    * bookingNumber (string, optional)

      Mã dùng tham chiếu đến booking
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

{% embed url="<https://gotadi.gitbook.io/technical-documentation/~/changes/jpnb0igjjbjF20px6gfz/vietnamese/doi-tac-b2b2c/phuong-thuc-api#7-ma-loi>" %}


# Cancellation API

## Document Hotel API Cancellation <a href="#document-hotel-api-cancellation" id="document-hotel-api-cancellation"></a>

![Luồng huỷ phòng khách sạn](https://developer.gotadi.com/img/cancellation-process.png)

### Mô tả hình thức phạt khi huỷ <a href="#mo-ta-hinh-thuc-phat-khi-huy" id="mo-ta-hinh-thuc-phat-khi-huy"></a>

Nếu không nhận phòng, hoặc nếu hủy hay thay đổi đặt phòng này sau thời gian nhận phòng, thì bạn có thể phải chịu phí phạt lên đến `100%` giá trị đặt phòng.

#### Các hình thức phạt <a href="#cac-hinh-thuc-phat" id="cac-hinh-thuc-phat"></a>

**Ví dụ 1: Phạt theo đêm**

```json
[{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "NIGHTS",
    "currency": "VND",  
    "percent": "",  
    "nights": "1.0",
    "amount": "",
    "description": ""
}]
```

* Được hủy miễn phí đến trước ngày `2021-05-12T18:00:00.000+07:00`
* Phạt `1` đêm khi hủy phòng từ ngày `2021-05-12T18:00:00.000+07:00` đến ngày `2021-05-13T18:00:00.000+07:00`

**Ví dụ 2: Phạt theo giá tiền**

```json
[{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "AMOUNT",
    "currency": "VND",
    "percent": "",
    "nights": "",
    "amount": "200000",
    "description": ""
}]
```

* Được hủy miễn phí đến trước ngày `2021-05-12T18:00:00.000+07:00`
* Bị Phạt `200000` `VND` khi hủy phòng từ ngày `2021-05-12T18:00:00.000+07:00` đến ngày `2021-05-13T18:00:00.000+07:00`

**Ví dụ 3: Phạt theo phần trăm**

```json
[{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "70%",
    "nights": "",
    "amount": "",
    "description": ""
}]
```

* Được hủy miễn phí đến trước ngày `2021-05-12T18:00:00.000+07:00`
* Bị Phạt `70%` giá trị của phòng khi hủy phòng từ ngày `2021-05-12T18:00:00.000+07:00` đến ngày `2021-05-13T18:00:00.000+07:00`

**Ví dụ 4: Nhiều hình phạt**

```json
[{
    "startDate": "2021-05-10T18:00:00.000+07:00",
    "endDate": "2021-05-12T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "50%",
    "nights": "",
    "amount": "",
    "description": ""
},
{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "70%",
    "nights": "",
    "amount": "",
    "description": ""
}]
```

* Được hủy miễn phí đến trước ngày `2021-05-10T18:00:00.000+07:00`
* Bị Phạt `50%` giá trị của phòng khi hủy phòng từ ngày `2021-05-10T18:00:00.000+07:00` đến ngày `2021-05-12T18:00:00.000+07:00`
* Bị Phạt `70%` giá trị của phòng khi hủy phòng từ ngày `2021-05-12T18:00:00.000+07:00` đến ngày `2021-05-13T18:00:00.000+07:00`

**Ví dụ 5: Nhiều hình phạt**

```json
[{
    "startDate": "2021-05-10T18:00:00.000+07:00",
    "endDate": "2021-05-12T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "50%",
    "nights": "",
    "amount": "25000",
    "description": ""
}]
```

* Được hủy miễn phí đến trước ngày `2021-05-10T18:00:00.000+07:00`
* Bị Phạt `50%` giá trị của phòng khi hủy phòng từ ngày `2021-05-10T18:00:00.000+07:00` đến ngày `2021-05-12T18:00:00.000+07:00` kèm theo khoản phí
* Bị phạt `25000` `VND` tiền phí khi hủy phòng từ ngày `2021-05-10T18:00:00.000+07:00` đến ngày `2021-05-12T18:00:00.000+07:00`

**Ví dụ 6: Hủy miễn phí**

```json
[{
    "startDate": "2021-05-01T18:00:00.000+07:00",
    "endDate": "2021-05-12T18:00:00.000+07:00",
    "type": "NIGHTS",
    "currency": "VND",
    "percent": "",
    "nights": "0",
    "amount": "",
    "description": ""
}]
```

* Được hủy miễn phí đến trước ngày `2021-05-12T18:00:00.000+07:00`

***

### 1. API Kiểm tra khả năng huỷ phòng và phí phạt <a href="#id-1-api-kiem-tra-kha-nang-huy-phong-va-phi-phat" id="id-1-api-kiem-tra-kha-nang-huy-phong-va-phi-phat"></a>

POST: /api/v3/hotel/check-cancel-penalty

Trả về thông tin trạng thái khả năng huỷ phòng, và thông tin phí phạt khi huỷ.

#### Request Body <a href="#request-body" id="request-body"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (String, Required)

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* result (CheckCancelPenaltyResult, Optional)

  Thông tin kết quả trả về

  * status (string, optional) = \[‘ALLOW\_CANCELLATION’, ‘NOT\_ALLOW\_CANCELLATION’, ‘UNKNOWN’]

    Thông tin xác định trạng thái huỷ phòng

    * `ALLOW_CANCELLATION`: Chấp nhận huỷ phòng
    * `NOT_ALLOW_CANCELLATION`: Không chấp nhận huỷ phòng
    * `UNKNOWN`: Không xác định trạng thái, cần được xác định lại
  * cancelPenalties (Array\[CancelPenalty], optional),

    Thông tin phí phạt khi huỷ phòng. [Xem mô tả thêm ở đây](https://developer.gotadi.com/dev-guide/api-hotel/api-cancellation/#cac-hinh-thuc-phat)
  * cancelPenaltyTotal (number, optional),

    Thông tin phí phạt khi huỷ phòng
* duration (Integer, Optional)
* success (Integer, Bool)
* infos (Array\[InfosDTO], Optional)
* errors (Array\[ErrorsDTO], Optional)
* textMessage (String, Optional)

</details>

***

### 2. API yêu cầu huỷ booking hotel <a href="#id-2-api-yeu-cau-huy-booking-hotel" id="id-2-api-yeu-cau-huy-booking-hotel"></a>

POST: /api/partner/cancellation

API gửi yêu cầu huỷ booking đợi trả lời từ nhà cung cấp

Chú ý

Yêu cầu bảo mật: Mã hóa dữ liệu và kèm theo chữ ký điện tử

* Request: Không yêu cầu phải được mã hóa và kèm theo chữ ký điện tử
* Response: Một phần dữ liệu của response được yêu cầu phải mã hóa và kèm theo chữ ký điện tử

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<cancel_penalty_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<cancel_penalty_amount>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, required)

    Mã dùng tham chiếu đến booking
  * cancel\_penalty\_amount (String, optional)

    Số tiền phí phạt. Được định dạng 2 chữ số thập phân `0.00`

</details>

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)

  Key giải mã dữ liệu (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (String, required)

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking
  * error\_code (String, required)

    [Mã lỗi](https://developer.gotadi.com/dev-guide/#7-ma-loi)
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * cancellation\_status (String, optional)

    Thông tin trạng thái huỷ:

    * `CANCEL_UNKNOWN` Trạng thái không xác định, cần kiểm tra lại.
    * `CANCEL_PENALTY_MISMATCH` Phí phạt không khớp. Cần gọi lại [API Kiểm tra khả năng huỷ phòng và phí phạt](https://developer.gotadi.com/dev-guide/api-hotel/api-cancellation/#1-api-kiem-tra-kha-nang-huy-phong-va-phi-phat) để lấy thông tin phí phạt sau đó gủi lại yêu cầu huỷ phòng
    * `CANCEL_WAITING_CONFIRM` Gửi yêu cầu huỷ thành công, đợi nhà cung cấp xác nhận
    * `CANCEL_CONFIRMED` Huỷ thành công
    * `CANCEL_EXPIRED` Yêu cầu huỷ quá hạn

</details>

### 3. API Kiểm tra trạng thái huỷ phòng <a href="#id-3-api-kiem-tra-trang-thai-huy-phong" id="id-3-api-kiem-tra-trang-thai-huy-phong"></a>

POST: /api/partner/cancellation-check

API kiểm tra trạng thái huỷ phòng

Chú ý

Yêu cầu bảo mật: Mã hóa dữ liệu và kèm theo chữ ký điện tử

* Request: Không yêu cầu phải được mã hóa và kèm theo chữ ký điện tử
* Response: Một phần dữ liệu của response được yêu cầu phải mã hóa và kèm theo chữ ký điện tử

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, required)

    Mã dùng tham chiếu đến booking

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)

  Key giải mã dữ liệu (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (String, required)

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). [Tham khảo thêm tại đây](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>|<cancel_penalty_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>|<cancellation_feee>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking
  * error\_code (String, required)

    [Mã lỗi](https://developer.gotadi.com/dev-guide/#7-ma-loi)
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * cancellation\_status (String, optional)

    Thông tin trạng thái huỷ:

    * `CANCEL_UNKNOWN` Trạng thái không xác định, cần kiểm tra lại.
    * `CANCEL_PENALTY_MISMATCH` Phí phạt không khớp. Cần gọi lại [API Kiểm tra khả năng huỷ phòng và phí phạt](https://developer.gotadi.com/dev-guide/api-hotel/api-cancellation/#1-api-kiem-tra-kha-nang-huy-phong-va-phi-phat) để lấy thông tin phí phạt sau đó gủi lại yêu cầu huỷ phòng
    * `CANCEL_WAITING_CONFIRM` Gửi yêu cầu huỷ thành công, đợi nhà cung cấp xác nhận
    * `CANCEL_CONFIRMED` Huỷ thành công
    * `CANCEL_EXPIRED` Yêu cầu huỷ quá hạn
  * product\_type (String, optional)

    Số tiền phí huỷ. Được định dạng 2 chữ số thập phân `0.00`

</details>


# Payment API

### 1. API xác nhận voucher <a href="#id-1api-xac-nhan-voucher" id="id-1api-xac-nhan-voucher"></a>

GET: /api/payments/voucher/validate

Validate voucher cho booking cụ thể

#### Request Body <a href="#request-body" id="request-body"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (String, Required)

  Mã định danh booking
* voucherCode (String, Required)

  Mã giảm giá

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* bookingNumber (String)

  Mã định dang booking
* discountAmount (Double)

  Số tiền giảm
* trackingCode (String)

  Mã định danh cho booking có voucher
* voucherCode (String)

  Mã giảm giá
* voucherValid (Boolean)

  Mã giảm giá hợp lệ
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

***

### 2. API xác nhận sử dụng voucher <a href="#id-2api-xac-nhan-su-dung-voucher" id="id-2api-xac-nhan-su-dung-voucher"></a>

GET: /api/payments/voucher/redeem

Redeem voucher cho booking cụ thể

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (String, Required)

  Mã định danh booking
* voucherCode (String, Required)

  Mã giảm giá
* trackingCode (String, Required)

  Mã tracking sử dụng ở api validate

</details>

Example

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* bookingNumber (String)

  Mã định dang booking
* redeemValid (Boolean)

  Xác nhận sử dụng voucher thành công
* voucherCode (String)

  Mã giảm giá
* duration (Integer, Optional),
* errors (Array\[Error], Optional),
* infos (Array\[Info], Optional),
* success (Boolean, Optional),
* textMessage (String, Optional)

</details>

***

### 3. API Yêu cầu thanh toán booking <a href="#id-3-api-yeu-cau-thanh-toan-booking" id="id-3-api-yeu-cau-thanh-toan-booking"></a>

GET: /api/partner/place-order

Yêu cầu thanh toán booking - khởi tạo payment order

Chú ý

Yêu cầu bảo mật: Mã hóa dữ liệu và kèm theo chữ ký điện tử

* Request: Không yêu cầu phải được mã hóa và kèm theo chữ ký điện tử
* Response: Một phần dữ liệu của respond được yêu cầu phải mã hóa và kèm theo chữ ký điện tử

#### Parameters <a href="#parameters" id="parameters"></a>

<details>

<summary>Parameters</summary>

* bookingNumber `query` (string, required),

  Mã tham chiếu đến booking

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (String, optional),

  Thông tin trả về dưới định dạng:

  ```
  <payment_url>?key=<encrypted_key>?data=<encrypted_data>
  ```

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<product_type>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<product_type>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, optional)

    Mã dùng tham chiếu đến booking
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * total\_amount (String, optional)

    Tổng số tiền phải thanh toán
  * payment\_url (String, required)

    Đường dẫn đến trang thanh toán
  * encrypted\_key (String, required)

    Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/yeu-cau-bao-mat#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
  * encrypted\_data (String, required)

    Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/yeu-cau-bao-mat#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 4. API Ghi nhận thanh toán và commit booking <a href="#id-4-api-ghi-nhan-thanh-toan-va-commit-booking" id="id-4-api-ghi-nhan-thanh-toan-va-commit-booking"></a>

POST: /api/partner/commit

Yêu cầu commit booking được cập nhật đầy đủ thông tin và hoàn tất thanh toán

Chú ý

Yêu cầu bảo mật: Mã hóa dữ liệu và kèm theo chữ ký điện tử

* Request: Không yêu cầu phải được mã hóa và kèm theo chữ ký điện tử
* Response: Một phần dữ liệu của response được yêu cầu phải mã hóa và kèm theo chữ ký điện tử

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

Model

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). **Cách giải mã tham khảo mục: Mã hóa dữ liệu truyền và xác thực chữ ký điện tử**
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). **Cách giải mã tham khảo mục: Mã hóa dữ liệu truyền và xác thực chữ ký điện tử**

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * bookingNumber (String, required)

    Mã dùng tham chiếu đến booking
  * partner\_trans\_id (String, optional)

    Mã định danh giao dịch của đối tác. Nếu đối tác không truyền giá trị cho trường này, giá trị mặc định sẽ được gán bằng booking\_number
  * product\_type (String, required)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua

</details>

#### Response <a href="#response_3" id="response_3"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/yeu-cau-bao-mat#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (String, required)

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview/yeu-cau-bao-mat#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking
  * error\_code (String, required)\
    [Phương thức Webview](/vietnamese/doi-tac-b2b2c/phuong-thuc-webview#ma-loi)
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * properties (String, optional)

    Các thông tin mở rộng trả về cho đối tác. `Json string`
  * return\_url (String, optional)

    Trang hiển thị kết quả giao dịch của Gotadi. Sử dụng trong trường hợp đối tác không tự xây dựng trang hiển thị kết quả cuối cùng.
  * total\_amount (Double, required)

    Tổng số tiền phải thanh toán.

</details>

***

### 5. API lấy chi tiết booking sau khi xuất vé

GET: /api/products/final-booking-detail

#### Mô tả:

* API được tối ưu hóa để lấy trạng thái booking sử dụng trong quy trình thanh toán (cách sử dụng tương tự như API (booking-detail). API này bổ sung thêm tính năng xử lý giữa các trường hợp thành công và thất bại.
* Cụ thể, trong trường hợp thành công (happy case), API sẽ ngay lập tức trả về kết quả. Trong trường hợp thất bại (failure case), API sẽ tự động thử lại để lấy trạng thái mới nhất của booking và trả về kết quả đến khi hết thời gian đặt sẵn.

#### Parameter

<details>

<summary>Parameter</summary>

* booking\_number (String, Required)

  Mã tham chiếu đến booking

</details>

#### Response

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

`Chỉ định danh những trường/field cần thiết`

* id (String, Optional),

  Mã định danh chi tiết booking
* agencyCode (String, Optional),

  Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
* agentCode (String, Optional),

  Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
* bookingCode (String, Optional),

  Mã dùng mô tả các thông tin cơ bản của booking
* bookingDate (String, Optional),

  Ngày tạo booking
* bookingInfo (BookingInfo, Optional),

  Thông tin booking

  * additionalFee (Number, Optional),

    Các khoản phí khác
  * agencyCode (String, Optional),

    Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentCode (String, Optional),

    Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentId (Integer, Optional),

    Id nhân viên đại lý
  * agentName (String, Optional),

    Tên nhân viên đại lý
  * allowHold (Boolean, Optional),

    Cho phép giữ vé máy bay hay không

    `true`: cho phép giữ vé

    `false`: Không cho phép giữ vé
  * baseFare (Number, Optional),

    Giá phòng chưa bao gồm thuế phí
  * bookBy (String, Optional),

    Người đặt booking
  * bookByCode (String, Optional),

    Mã người đặt
  * bookingCode (String, Optional),

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingDate (String, Optional),

    Ngày tạo booking
  * bookingNote (String, Optional),

    Ghi chú của booking
  * bookingNumber (String, Optional),

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * bookingType (String, Optional) = \[‘DOME’, ‘INTE’],

    Xác định điểm đến là trong nước hay quốc tế

    * `DOME`: Trong nước
    * `INTE`: Quốc tế
  * branchCode (String, Optional),

    Mã chi nhánh
  * cancellationBy (String, Optional),

    Hủy vé bởi …
  * cancellationDate (String, Optional),

    Ngày hủy vé
  * cancellationFee (Number, Optional),

    Phí hủy đặt phòng
  * cancellationNotes (String, Optional),

    Ghi chú hủy
  * channelType (String, Optional) = \[‘ONLINE’, ‘OFFLINE’],

    Loại kênh đặt phòng
  * contactInfos (Array\[BookingContactInfo], Optional),

    Mảng đối tượng chứ thông tin người liên hệ

    * bookingNumber (String, Optional),

      Mã tham chiếu đến booking
    * contactLevel (String, Optional) = \[‘PRIMARY’, ‘SECONDARY’, ‘OTHER’],

      Cấp của người liên hệ
    * contactType (String, Optional) = \[‘CUSTOMER’, ‘AGENCY’],

      Loại của người liên hệ
    * email (String, Optional),

      Địa chỉ email
    * firstName (String, Optional),

      Tên đêm và tên người liên hệ
    * phoneCode1 (String, Optional),

      Mã quốc gia
    * phoneNumber1 (String, Optional),

      Số điện thoại 1
    * surName (String, Optional)

      Họ người liên hệ
  * customerCode (String, Optional),

    Mã khách hàng
  * customerEmail (String, Optional),

    Email của khách hàng
  * customerFirstName (String, Optional),

    Họ của khách hàng
  * customerId (Integer, Optional),

    Id của khách hàng
  * customerLastName (String, Optional),

    Tên của khách hàng
  * customerPhoneNumber1 (String, Optional),

    Số điện thoại 1 của khách hàng
  * customerPhoneNumber2 (String, Optional),

    Số điện thoại 2 của khách hàng
  * departureDate (String, Optional),

    Ngày khởi hành
  * discountAmount (Number, Optional),

    Số tiền được giảm
  * discountDate (String, Optional),

    Ngày sử dụng mã giảm giá
  * discountRedeemCode (String, Optional),

    Mã liên kết đổi thưởng
  * discountRedeemId (String, Optional),

    Id định danh liên kết đổi thường
  * discountVoucherCode (String, Optional),

    Mã voucher
  * discountVoucherName (String, Optional),

    Tên voucher
  * equivFare (Number, Optional),

    Phí xuất vé
  * etickets (String, Optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận vé máy bay
  * fromCity (String, Optional),

    Tên thành phố khởi hành
  * fromLocationCode (String, Optional),

    Mã định danh sân bay khởi hành
  * fromLocationName (String, Optional),

    Tên sân bay khởi hành
  * id (integer, Optional),

    Id của booking
  * issuedByCode (String, Optional),

    Xuất vé bởi …
  * issuedDate (String, Optional),

    Ngày xuất phòng
  * issuedStatus (String, Optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

    Trạng thái xuất vé

    * `PENDING`: Đợi xuất vé
    * `TICKET_ON_PROCESS`: Xuất vé đang được xử lý
    * `SUCCEEDED`: Xuất vé thành công
    * `FAILED`: Xuất vé thất bại
  * orgCode (String, Optional),

    Mã tổ chức
  * passengerNameRecords (String, Optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận vé máy bay
  * paymentBy (String, Optional),

    Thanh toán bởi …
  * paymentByCode (String, Optional),

    Mã người thanh toán
  * paymentDate (String, Optional),

    Thời gian thanh toán
  * paymentFee (Number, Optional),

    Phí thanh toán
  * paymentRefNumber (String, Optional),

    Mã tham chiếu thanh toán
  * paymentStatus (String, Optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],

    Trạng thái thanh toán

    * `PENDING`: Chờ thanh toán
    * `SUCCEEDED`: Thanh toán thành công
    * `FAILED`: Thanh toán thất bại
    * `REFUNDED`: Hoàn tiền
  * paymentTotalAmount (Number, Optional),

    Tổng số tiền thanh toán
  * paymentType (String, Optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘AIRPAY’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘PAYOO’, ‘CASH’, ‘TRANSFER’, ‘PARTNER’, ‘OTHER’],

    Hình thức thanh toán
  * refundBy (String, Optional),

    Người hoàn trả
  * refundByCode (String, Optional),

    Mã của người thực hiện hoàn trả
  * refundable (Boolean, Optional),

    Ngày hoàn trả
  * returnDate (String, Optional),

    Ngày trả phòng
  * roundType (String, Optional) = \[‘RoundTrip],
  * saleChannel (String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

    Kênh phân phối
  * serviceTax (Number, Optional),

    Thuế và phí
  * status (String, Optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

    Trạng thái của booking

    * `PENDING`: Chờ xác nhận booking
    * `BOOKING_ON_PROCESS`: Booking đang được xử lý
    * `BOOKED`: Booking đã được xác nhận
    * `FAILED`: Booking thất bại
    * `EXPIRED`: Booking hết hạn
    * `CANCELLED`: Booking đã bị hủy
  * supplierType (String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

    Loại nhà cung cấp
  * taxAddress1 (String, Optional),

    Địa chỉ xuất hóa đơn dòng 1
  * taxAddress2 (String, Optional),

    Địa chỉ xuất hóa đơn dòng 2
  * taxCompanyName (String, Optional),

    Tên công ty xuất hóa đơn
  * taxNumber (String, Optional),

    Mã số thuế cần xuất hóa đơn
  * taxPersonalInfoContact (String, Optional),

    Người nhận hóa đơn
  * taxReceiptRequest (Boolean, Optional),

    Yêu cầu xuất hóa đơn hay không
  * timeToLive (String, Optional),

    Thời gian chờ thanh toán, sau thời gian này trạng thái của booking sẽ chuyển sang `EXPIRED`
  * toCity (String, Optional),

    Tên tỉnh, thành phố điểm đến
  * toLocationCode (String, Optional),

    Mã định danh điểm đến
  * toLocationName (String, Optional),

    Tên sân bay điểm đến
  * totalFare (Number, Optional),

    Tổng giá phòng
  * totalSsrValue (Number, Optional),

    Tổng giá hành lý / dịch vụ thêm
  * totalTax (Number, Optional),

    Tổng số tiền thuế phí
  * transactionInfos (Array\[BookingTransactionInfo], Optional),

    Mảng đối tượng chứa thông tin giao dịch

    * id (integer, Optional),

      Id định danh giao dịch
    * allowHold (Boolean, Optional),

      Cho phép giữ vé hay không
    * bookingCode (String, Optional),

      Mã dùng mô tả các thông tin cơ bản của booking
    * bookingDate (String, Optional),

      Ngày tạo booking
    * bookingDirection (String, Optional) = \[‘DEPARTURE’, ‘RETURN’],
    * bookingNumber (String, Optional),

      Mã dùng tham chiếu đến booking.
    * bookingRefNo (String, Optional),

      Mã liên kết với nhà cung cấp
    * channelType (String, Optional) = \[‘ONLINE’, ‘OFFLINE’],

      Loại kênh bán
    * checkIn (String, Optional),

      Ngày giờ bay
    * checkOut (String, Optional),

      Ngày giờ đến
    * destinationLocationCode (String, Optional),

      Mã định danh sân bây
    * detail (String, Optional),

      Tên khách sạn
    * etickets (String, Optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận vé
    * issuedDate (String, Optional),

      Ngày xuất vé
    * issuedStatus (String, Optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

      Trạng thái xuất vé

      * `PENDING`: Đợi xuất vé
      * `TICKET_ON_PROCESS`: Xuất vé đang được xử lý
      * `SUCCEEDED`: Xuất vé thành công
      * `FAILED`: Xuất vé thất bại
    * noAdult (integer, Optional),

      Số người lớn
    * noChild (integer, Optional),

      Số trể em
    * onlyPayLater (Boolean, Optional),

      Cho phép trả sau hay không
    * passengerNameRecord (String, Optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận vé
    * paymentAmount (Number, Optional),

      Số tiền thanh toán
    * productSeqNumber (String, Optional),

      Mã sản phẩm
    * refundable (Boolean, Optional),

      Có hoàn tiền khi hủy vé hay không
    * saleChannel (String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

      Kênh phân phối
    * serviceTax (Number, Optional),

      Thuế và phí
    * status (String, Optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

      Trạng thái của booking

      * `PENDING`: Chờ xác nhận booking
      * `BOOKING_ON_PROCESS`: Booking đang được xử lý
      * `BOOKED`: Booking đã được xác nhận
      * `FAILED`: Booking thất bại
      * `EXPIRED`: Booking hết hạn
      * `CANCELLED`: Booking đã bị hủy
    * supplierCode (String, Optional),

      Mã nhà cung cấp
    * supplierName (String, Optional),

      Tên nhà cung cấp
    * supplierType (String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’]

      Loại sản phẩm
    * totalFare (Number, Optional),

      Tổng giá vé
    * totalTax (Number, Optional)

      Tổng thuế và phí
    * baseFare (Number, Optional),

      Giá vé không bao gồm thuế phí
  * travelerInfos (Array\[BookingTravelerInfo], Optional),

    Mảng đối tượng chứa thông tin hành khách.

    * bookingNumber (String),

      Mã tham chiếu đến booking
    * firstName (String),

      Tên đêm và tên hành khách
    * surName (String)

      Họ của hành khách
* bookingNumber (String, Optional),

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* bookingType (String, Optional),

  Xác định điểm đến là trong nước hay quốc tế

  * `DOME`: Trong nước
  * `INTE`: Quốc tế
* branchCode (String, Optional),

  Mã chi nhánh
* cacheType (String, Optional) = \[‘COMBO’],
* Mã khách hàng
* groupPricedItineraries (Array\[GroupPricedItinerary], Optional),

  Thông tin danh sách hành trình trả về theo kết quả tìm kiếm

  Tương tự như lấy thông tin tìm kiếm vé máy bay
* orgCode (String, Optional),

  Mã tổ chức
* saleChannel (String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

  Kênh phân phối
* supplierType (String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

  Loại nhà cung cấp

</details>


# Xử lý BOOKING JOURNEY

### 1. API commit

* Khi gọi API Commit, sẽ được tính là bắt đầu một luồng đặt chỗ. Cần đảm bảo rằng hành trình đặt chỗ đã thực sự kết thúc trước khi tạo một luồng đặt chỗ mới.
* API Commit chỉ có nhiệm vụ kích hoạt hai hành động: thanh toán và xuất vé. Không thể chỉ sử dụng API Commit để xác định kết thúc một hành trình đặt chỗ mà còn phải kết hợp với API booking-detail [Booking API](/vietnamese/doi-tac-b2b2c/phuong-thuc-api/flight/booking-api#id-3api-lay-chi-tiet-thong-tin-booking) (mình sẽ chuyển sang sử dụng API final-booking-detail [/pages/9mDZFrbWTlSK6y2kstDH#id-5.-api-lay-chi-tiet-booking-sau-khi-xuat-ve](https://developer.gotadi.com/vietnamese/doi-tac-b2b2c/phuong-thuc-api/pages/9mDZFrbWTlSK6y2kstDH#id-5.-api-lay-chi-tiet-booking-sau-khi-xuat-ve "mention") theo khuyến cáo bên dưới trong document này).

### 2. API final booking detail

* API final-detail-booking được sử dụng để xác định trạng thái của một  \
  booking thông qua các status sau:
  * Payment statuses
  * Issued statuses
* API final-detail-booking này bổ sung thêm tính năng xử lý giữa các trường hợp thành công và thất bại. Cụ thể, trong trường hợp thành công (happy case), API sẽ ngay lập tức trả về kết quả. Trong trường hợp thất bại (failure case), API sẽ tự động thử lại để lấy trạng thái mới nhất của booking và trả về kết quả đến khi hết thời gian đặt sẵn.
* Các trường hợp được coi là hành trình booking đã kết thúc và có thể  \
  bắt đầu một hành trình mới:
  * Thanh toán thất bại: **paymentStatus** = <mark style="color:red;">**failed**</mark>
  * Thanh toán thành công và xuất vé thành công: **paymentStatus** = <mark style="color:green;">**Success**</mark> và **issueStatus** = <mark style="color:green;">**Success**</mark>
* Các cases được consider là booking journey chưa kết thúc, cần hold và xử lý tiếp.
  * Thanh toán thành công: **paymentStatus** = <mark style="color:green;">**Success**</mark> and **issueStatus&#x20;**<mark style="color:red;">**!=**</mark> <mark style="color:green;">**Success**</mark>

### 3. Khuyến cáo

* Khi gọi API Commit, có thể gặp một số thông báo lỗi ngoài bảng mã lỗi (ví dụ: lỗi không gọi được API, lỗi timeout, thời gian phản hồi quá lâu...). Người dùng cần sử dụng API final-booking-detail để xác định trạng thái của một booking.
* Sau khi get-final-booking-detail nếu: **paymentStatus =&#x20;**<mark style="color:green;">**success**</mark> mà **issueStatus&#x20;**<mark style="color:red;">**!=**</mark> <mark style="color:green;">**success**</mark> vẫn nên retry `GET` **final-booking-detail** để lấy được status đúng nhất.


# Booking Management API

### 1. Tìm kiếm booking <a href="#id-1-tim-kiem-booking" id="id-1-tim-kiem-booking"></a>

GET: /bookingsrv/api/bookings/search

Tìm kiếm booking

#### Headers <a href="#headers" id="headers"></a>

<details>

<summary>Headers</summary>

* Authorization (string, required)

  Token để xác thực người dùng

  VD: `Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1ZjhkMThjOThiNDgxMTFkZDQ3MTJhYmZfdGNkbEBnb3RhZGkuY29tIiwiYXV0aCI6IlJPTEVfQjJDLFJPTEVfUEFSVE5FUiIsIlgtaWJlLWQiOiIzMjU3MTM1MTcwM2U3MTc4ZmJmNTFjYzI4YzhkYTBkZDU5YTA5YWY3NTQ0NTU0YmMwMzk2YjY1ODVjNTExMjkzYmFjYTAzY2FlNmEyZTUzNGI1ODY3ODhiZWYyZjhiMjllNDQ1OTQyM2Y2MzAyMzE5M2M4NDg2NzkyMGE3M2YzNmM1YjIzOTljNzIxZWI5ZmMwZjJiMWJkZTAwZmViZjE3YWNhNjc2M2JjZjNhZDRkNWNhMTkxMmUzNWQ3MmZkZTIxMjUxMDhhZDlmNzFjZTU4ODNkN2YzN2JiNTM3NDFiNjhmYTk3NWEwZTk1YjhhZDI1MGNjM2YyZDdjNmViY2QxMmE0OTQ5MjJhMjY1MzU2NDI5YmMxN2EwYWU5ZWJiYzU2MzI5YzQ0NDk4ZDQ1YmFkOTMxZGY4ODFiOTM5MmUwOWI1ZmRmOWMzMThlY2NlZDc3MjFmMDY3NGQxNDZhZTZmMzI1YjNhMDBmM2E0YmE4YTMyNzJjMWQ1MDNhODNlZmU5YTVkOGYwNjcyMTM2ZWU3N2Q1ZTAzNDg3ZjBmMjExMWQ2YWIyMTdmMjNhZDY0MmZmNDQ0MTMzMjc3YmRhMGE3MDQzOTk3NWExMTM1ZWRmMDRmNjJiNDY3YjE3MDMyZGEyNmQzZjMyYzk3NmQzOTA0ZDI4NDUxZWVhYzBkNDcyYWU3N2RmOWFiNTFkNDhiY2EwZDEyNjA2NTRjMWQ2NzhiMmYwZjYxYWFiMGQwNWQwZjdmNmY3NTI1NDcyMDczZDQ3MjA2NWFkOWJkYmQ5NjljNjYzMDE4YTVlOTBjNzkyZTkxY2Q0ZjgyZmFiNjk3MTJmYTkyMzEyMDY1YTI1OTUzYTJhNDMzYzY3OWYzYzc1ZTI2MWUzMDI3NjAxYmYxZDUzY2NkNjUxZmY1MDBmYjYwNTgwNDg3YzIzYjRlZGI0YWJlMTI3OGQ5MTEwYjUwNzA4ODQ2MjEwMWRjZTdkYzEyODg4ZTZkZDJjZWQxNWQ4ZDczOGMwOGVhNzA1MjBlMTM1NGM4YzRkMTkwNTVhYWMzNzg4Y2QwMGEwZDdkMzQxODRkMGJmOWI4OTU1MTU0ZDg1MzBmYWU5NWFjOTM2ZmVlMzYwYjM3OGU0OTcyYjYzYWY2MGVjYzBkY2RlODY1NzFiZjRlYTE4MTkwNTRmYjkzNjU1NTlmY2NmOWYyZjRmNmJiZjkxY2ZlODhiOTI3ODMwYjU4ODZkMTBlYjUxZDAwYjkwY2JjMjFiYzdkYThkNGY2NjY0YzlhYTgxMjRlMDBmYjI4MTcyZTVkYzJlODY1YzUwZGRkMjdhMDVjZTJhMjg1NmViNjY5OWM5NWI1NmE2NzZjZDg1N2JjYWU4MjU0YTNhOTgzZGI5YTRhYTllYzM3NDE4NGEwNGY3ZmUwMDg0ZTQ0OTRiOGY3NGQ3Y2I2MWJjNzIwZWI1MDM5NTE2NzdlNmNlMjNkN2YzYTcxOGZhMTFmYzEzNTBmZTFmZTU3ZWFhNzFjMGIxNGU1OTNjZGEzYzJkNGFiMWMzZjc3MzU4MzY1NjQzYmVmN2MxNmI5Njc4ZDc5Y2NhZjU0ODgxODYyNmUyYjRhMWVkMjhlZjQ1NGNjNzllZThkNDlmOWY0ZmMxNzI0YzhkNmI4ZWE4MTc3N2E3M2NiNGE4OGEzNDhjMGNlYmNmZTNkOGQxYzBkZTQzN2NkYmI0ZTVhNGQ0Nzk3YWNmZmNjMzgxZjRlMzJmNTZkMzUzMmI5YTk3NjZiZDIxMWEzNjU5YzUwMGY0YzY5YTNkMTUyOTBlNzA2YTUzM2FhOGNkMzRhNTM5NDdmNzAxOWViZjUxMTIwNTRmMGQxZTk3MWI0NmJmMmM3YTJlM2YzYThlNjhmZmNjNjkwNmJkOTE1NGZjM2UxNTQ0MzZkMTJkNWFmMDU5MTZkMjg5ODEyMTVhMWUyMWE1Yjg4NjUxNGZjM2JhMjUyNTYwMzIzNTA4ODYzNzkzYTgyNTg1YjI5ODBhMDYxYjg4MzM1ZTlhYmZlMzYwYTgwNjI5YjhjMjY5M2MwMDRiMTllNWM3ODFlNDU4MDJlNTFhZjI3OTFjOTEzZTM4YWZiYTgyOTcwZmYzMjRjYjhkZDZiMmE1NDE4MzQyNGU1Y2QzNThiYmI5MDY1NmU3Y2VmYjhlNDBiZTM4MzAxZjM0ZDVmMmE0ZDdkZTIyODIzMjVlYmRlMDQzNTU3MzVkZTAzODA0Y2NlYjAxZjI1ZGEzZWVjYzI4ZjdhOTFkYjljNTZhZDVjYjdiN2RiZjEzYjI0ZGNkY2U4YTJkNjI3MzVmZTY3MjI2MDBjYjJiZmEwODM2NTc5ODFmMWI5MDdhZDllNjljMmVmNDQ0ZDBiNmY0NDA4ZTQ0ZDllNzYzZmRmZTBhZDQxNjFhOGJjYmJjNDI1MjBhZTYxNzFmMzYyZGZlNzY1OWEyYTJiMzBmYzY5ZjFlMDFiNjAyYzRkZGUyY2ZhOTJlNWZmY2UwNTU0NzlmOTdjMjk3OGM4MTI5YmM4MWZjOGJmMzJiYmI5OTY4YTc0NjM5ODE3YTE5YzFkMGJkYTYwMDY2Zjg4OTY4MjljN2M3YzdhMjE5NTM4YWQyZTMwMjcwNTIwOTUyOWQwNjNkMzFiYzNhYjJjMDVjOWYxYTk3OTg2YzkwOWNlZjNlOTgxMWMxNzY1ODRlMjcwM2YxMTdlMmI3ZjY5ZTQ3MjY0ZGQ0YTA3NjJmYzI2YTQ2NzUzYWM0OGE3YTdiNzhlOTM3ZDBjMjMxMWNiZTFhYzljMTNiZTE5OGI4NmJhNzU3MzY4ZDZhOWZkNjAxMWQ5NjRjYTMyNGQ1NjM1MzA3N2JlYWNjOTg0MTVmNzIzNmNjMjA3OTRiNDhlMjQwMmQ0ZjJiMDI4MDk5ODM1Y2E5YWM4MjE4MmY5YzVhYWVkZWVjZWRiMTlmOTM1NzMxZmE4Y2M5MzFhYzBhZmZhMTQzMTBhN2E1OTBmNDlmMmYwZTZiMTgyODljMGJjMzI5YjAzNGQxOGU5N2U1NDlmNzM4YjY4MzhmOTk0YzI4ZmIwY2UyMjJmYzY3OGFjY2IyYzAwMmE3MzJmYTY5MmFiOWUxYjRjZDE5NzdmMDgxMzY3Y2I0NWQ5MTliODAyMjU3NDliZGM0OWQ1NDFkMjkwNDllNTU5MGFiMzlmYTE4ZTlkMjZlNDM5MWEyNGE5ZmRhNmM2OWI0ZmM3ZDUzM2VhNTQzNTJlMzVjOTQyMGJiZGYwMDg0NjY5MWIyYmY0ZmI0ZDA1ZTA3MGIxYjU2MjMzYjg5NDJkMDg4NWU3YjJjYzkzOTc4YmZiYTE4ZDM1NDlmZGJiNWUxNzdlNDY0NjY1NWViMWI4OWM4NDFlOWU3MTFjOTdkYjI1MTE4ZWUyNThkZTg4YjNlNTAzYjFmMWQ3Y2EyY2Q0YzY3MzRmOGJiY2Q5ZmY2NDc0YzM4MDljNjg4NzJhMjg0MjMwN2EzZmFlMjE0N2RmOThjMmJlOTliZDE0ZmE5N2I3Y2EyMzhmYjE5NjVlNzI2ZGI4MDdhMzJkNGVjOGU1ZjI1OGQ0Zjg5ZjhjYjY3N2ZjZWQ4OGRhZTA5OTM5MjdmOGM1YThmZjEzOWI4ZGViNTMwMTk0ODM5MWJlM2E2OWI0YjI3NmI5OWQ1N2U1NjU2YjY1MjYxMDM3NmQxZTBhZjBlNTRjNTg3OGE0ZGJhMjE5OWNjYzU4M2E1MDRkNDdlNzI2OTAyMTQxMzRjYWUyZDg2N2U3ZTRkYTFmNzgzMzg5OTA4NDhhZDE3YzU0MDEyOWFkNjViN2Y3NTY5YWRhMmMyMDNlMWMzZTIwNGExOWY3OTc1ZWI1NGQxNmNlMTRkMDMxNTI3ZjkwYmZjNTdiNWNhYzUxYmUxNjA2NGVmODNkYWEwNDgwNjllOThkMjM5NGFkZWNlMjAwNmVkZTEwMzkwZmFhNDcwZmViM2Y5NTc0ZjA3MTVkYmJhN2ZjNzY2NGUyYTdmZTBjMjJmYWNkOTRiMDFiYWYyYzEyNTEwMmFiNmY5YTEwM2QzNzRmZmFkYTUzYWJhZmE2Zjc5NTcwZGZmMTNhYjBiOTE1ZmIwZjFmYjBlMWJjMjY5N2I0ZjUxNjczMjdiMzc1OGQzNGRmYzI3ZDZlZGIwZWU5OTFhYjJmMmUyNGJkYWUxZWNlMTgxMTMwMjgwNjliNTNhMDM5MDcyNzg3YmRkNDdmNjVhNTQ3MDc3NjVhMmI5NDJiNjJlYWQ2MTgwMGQxNTQ3M2FjZmFmYmE2MTZjZWQwOWFlZmE5ZjZkODY5MGZkNDgyMWY5OGIzYjM3YjJlZTE5MjY1NTZlMWZjMGYyNjE2NDllNzMyNWYwNDFkZTNhOTkwYmE1N2ZiZjFjZWJkYjE3ZWNkZmFhZDUxYjk2ZGE4YzllOTcwNzQyYmM4YTFkZjJhMzk3ZmQwMzQyMDhkOTJhZWVjNGIzNWRlZjVmMzEzMGU1ZTU1MzNjZGJlMDk2YzgwZDY0YzA1ZDYyNjQ4YzJmYjRlMjgzZjNhM2VmNjg4YjAyMjFlNDY4OGZkYTg3Yzc5YWI0YzVjZTc5Y2RiYzgxODNmMzE4Y2E3MGQyZDJkOGY5ODQ2MmU2MmMwYTQ5NjE5Zjc4MGU0OTI1ZjYwZGRkZjVhZDNlNDkxZmMzZTM4YTk5MTMzMmY4ODBlYjA0N2E1ODJkNDc1MjgxMDAyMzUxZTE1OTAzNDRiM2VhMzJiNjQ3NjFiMjQ3OWU0NGRmYTUyNjUxNzMzZDNiYmNjOTYwOTQ2ZDQyNGM4ZjkxMmQ1OWVlMzEzMTUwODQ4OGY2ODY2MWQ4YTM2ZmNjZDllOGIxNjAzNjg1NzNkNmFlMGE0NWZhOWQwNzczNGI3ZjllNmRiYzRhYjJhZGEyYWQ1YmJmOGFjNDMwNDc3YjcwZTE2MDAxNmZiNmQ1NGRjZTc2NTQ1NDExNDIxODc4OTlkNThhMDk0YzE1M2I4ZGVkMGIzNjhjYTBmYjg5NjdlZjJiZDlhZjIyMTJhODI2MGI4ZDRiYzBhYzBjYjliZjAyMTExYjZhNjQyNDg3MzlmZWU3Y2EyMzUxYzRkZmYwMjc0N2FkNzhlZTg5NTMxODZlMTZiNTJlZDQxNDI3NjJjN2Y4NzZmMmRlMzk1ZjI2OGViYjM2ZjM0NTI3NjgyMzA5OWYwYmFlYjhkNDYwOTE2MWUyODNkYmMxZWNjNTU0NmU3ZTJlYjMyZjUxOTUzNDFhMjE0ZmYwZDMzNmE4Mjc5ZWI1NDZiMmZmNGM3YjY0MWZiNWU4ZGFhMjZkMmFhYzEyYTc2YzI1M2I4Y2JmZWU0MmRlY2Q3NWM5ZDYyYjI2ZTVkNTY1ZDRhNWQwNDQ5YjA5NTA2OTkxNWU5M2U5N2JhOWQ4N2VmZTVjMzRjNWY3NjhmMTM0YmVjMjBlOTY0MjE5YmUxMDg4MGE2NDA2Y2RhM2FkMDRmM2IyMjRhMmJmMDY2YjI3NWY0MWI5YTM0OGI1MjAzZWUyYjM4Y2EzOGZiMjk0ZGQzZTZkZDJiYzIxN2E0NTA3YzllMzhkMzZkYzcwM2I1YjlkNzE3ZGM3NDM4MGRmNzYzY2E2ZGRkOWIxODliMGIyODY4ZDgyYmMyMmQwMGNlYjc4ODE1Mzg4ZTFlMjE2ZmVjZDUzMDIyMTU0MWVhY2Y1NmI1ZjJlMzU5ODMyZjY4YzBiMGE3Mzg2YTJhZDY4YWM1YTE3NGJjM2ZlZTcxMzk4OGM1YTdlOTkyODYyNDAwNTdmOThiOTg1ZmY4NmRjN2NkOTM5MjgyYjM4YjNkOGZkZDQyYTRlNmYxZDI4NGIyNDE2MjQxNGVjMTEwMTU4YjM2NmNiYmY3NmE2NTZhZjNkODc3ODVjNmY1MTk5ZDM4ZjA0NTA5MGQxZmU1NDliNmRiMmQ0NmMzNDE5NWI0ZWQ4OTg3NTMyOTljNmM5MjRkMDdlMGIwNDY1ODI0YTE5NjBiNWVhNTc1ODM4NDg5MDkzMDI4NmM3Y2M5NzE3YjUyMGE4YzQxZDY4ZTc2NzQ4OTMwMjI1MjYxMTNjNWI3Y2E4Njg2M2E3ODgwMmExOGQzODIxMjc3YTU1YzAwN2M5MTE1ZjFjM2RmYWNkZDhiYmI5YzczYmFkYWMyMTkwZGZlMmMyZTViNGJmM2JhOWFhZWJlODhiYTg0ZDlkMmI5MWU3YzRmYzk4OWYzMmVlOWU4OTViOTM5ZWY0NTRkZjEyMmFmZWMyYjg0YmQ5OGU3YzdmZWVkNjdhMTE0OTM3MzljZmE2MjY4MDNjNjFlMWUwNWI5OTNhNTE3ODNhN2IwYjA5YTQ4ZWRjMzg0Yjg5ZTE1NzMwZTE4ZjdmZmYyNDIyOTdiMWI3MWQxYzk4MzI2ZGRmOTllNzQwMjVjMmQwMGIzNWVkMDQzZDg4MTgyNWMyZjgxMmE4NTg0YTM5MTkzN2UxMWRiZDQwOTJlMDBmMDAxOGRjMzFhOTkxM2Y0M2Q0MTU5MTEzYmQ4ZTliZTZhNzJkZTE5MTE1YjAzNmI4ODZmODUxYTYwNTlhY2E4NWU5NGMxMjFkODQyMzA1ZjkyOTljMWQxYjk1MjJmZDJmODE1ZDE0MTc3YTg4NWNkMDJjZDc4OGFlYWJlYjViMmIwZmQwYTZkZGJmZWNiYWRiYjI1NDQzYjk4MDllZWFmMzc3MmVkYTNmN2I2MDQ0MTA2OGE4ZmVhMTM1OWRmNWI2YWIzYTcxNjcyZTAwNDQxMWYxMzA4ZDMwODFmNzAzMTE2MThlNTU1YTUxZWIxYjY5Y2ViNmQzNzFjMDY1YjhmNDEyNWM1NmIyYTA5NjRmOGExOGU4NmM0ZWFmYzA1OThkYWNjZmI1N2YyMDAzMGE1ZjFiNmVhNGFmZjE5MGY4ZTIxZDg2Mjg1ODA4Y2FkOTI1NmE1YTY0ZmEwYjEwMzk4MjY1ZDM3NDUyMGFhMTM5MDQwZThlMTVlZjUxNjZhNDQ2NTJhMDQzZTU5MThmMWE4M2NhODY4MDg0OTQzY2ZjNWFmYTk4ZTg0OTc0NjljNjVmYjM3MjlhMTgzY2I1MGIyYzc3NDYwZjJjNGViNjY0YmIyM2NjMzZlZmYyOGY5MjNjNGQ0MzA0OGIxMTViZDA3ODllYmNiZTFlNDEzMGNmNWFiZTRhNzM0NTQyZDU3ZDE0ZjUzM2RlNjFhYTI2MDBiODgzMTA1Yzk4MjBjNGI4ZGVlOGMwNTJjNDU0NTdmMDU4ZGY3Y2Q4MTc0ZmNiOGI4NTZlMWZhOWZkNWRjMzU0NjE2NDQ3ZWY5ZjFkN2Y5YjlmMjQ0NzA2MzdiNzM3YTJiOGE4ZThhYjk5YzEwZWU5OTc2ZGMzYmQ1NTZhOTBiMmQzYTNjMGU3OWJlOGFhYWQ4MTIxODU3N2VjNzM5NDBhYWY2YzA3NmI4OGQzNWY4MjNjNzYyYTZiZGJkZDJkOGI2MWViMjAzODE3MmY5NmQyZmI4YzQzZTEyMGE0NjU0MmMwODVlOTNjYzMyMTlhNmRhOTdmMjVkOWU5YjBjZjc1NWFhNDFiOWVjNzk2NTFiYTcyYTkzNTg1MzlhNDlmMmRhYjU5MTA1NDdmN2NhMGQ2ZDc0YWE4YjhkNzg2OGYwOWRkNmE0ZDQ1NTZkODc2NDI0ODA0Yzg2ZWMyMWFhMDM0ODVhZmY1YzQ2ZjRiMWY2YmU4Nzk4YTk3NTBmMGRhZGE1MzkwMzI0ZTE3N2RmM2Y1M2NhMzg5YTlkZWQ3MTVkNzlmNzRmNzIyOTU2NjcwZTAwOGFhZTMwMjUzN2E5YWY0ODZlZTgzZDM1ZmQ3NWZkYzQ5ZDcwMzI1OGUzYzNmZWFlNjU1YzMzYmMzZjIwN2EzNWM5NzQzYjlmYTA5NjlmNGUxNDVjMDNjZmNlNWE0Mzk3ZGMyNmJiYWE2N2E0NTNlY2M4MGNhY2IzNjFkYWQwMWVhNzAzMDdiNzNjMWQ4OWEwNTg4ZjFlZjU1MWIzODc1NzQ1MTUzYTFhZmM3YTU0ZDgzMzk4ZGZjODY4NGE2ZjM5MzY1ZTZlM2Q3ZjYwMzdmODEyNDAxYTMyMjFlN2VhMzc1NzdjNzJiMGU0YmI0MmUxYmY1MWFmNjFhZDZjNDFjOWI2YmVkMTk1MTE5ODFkNjhmYThkNzI4MTFkNzJmYjAwOTkyZWVmMWRkNDE3ODRmN2VmMTYxZjczNTU4YTA4MWJjNGU4YjVmYmRlNjZiMzY4YjY3YzNiNDczNjc5ZTQ5NWY2YWZjNzdiY2NiYmQ5NTViNzFjMGNiMzJkODlmNDg4NWQ2N2U2NDZiZGFhNTM0ZTA1YjZjY2I5ZDI3ZDE2MGE5ODc2NTc1MjhiYzZkMzU3MDVlZGU2NDkxYWM1OTZlYjllMTgwOTJjYThkNThjMWFmN2Q2ZTA3NzRlMzUwNmZiNGI3MmJlNTI5OTkzZmJkNzU1YWRhMGZiNWY5ZGFhMWY5MTgzYWYxMzM4YmE3ODM5NjM4MWNiYjNmNmYxYWU5ZTA5YjY2OGM0NThiMDk1MmE1MDE5NDQ5OGE2NzcyYzIzMDZmYjM5MDU1OTE0ZGYwMTNlNmRkNGMwMmEyNzIyNTI0NzEzYmZiYjZmMzM0NjYzOTFmOTc5YTA3YzVhNzY2MDk2MmRmMTIyMWNhZTQxZDNmYjEwOGY0NzRmNDA1NDU2NmMwMDU4YzhlMDA4ZjNjZjcwMjQxMmY5ZjZjYThlN2RiZjllZjY4MTgxMTZiYzdjYTIzMWRiZDE2ODAzN2ViZDZiNDgwYzI4MDllYTkwY2I5YzMzYmM3NDA3YWJhZWU1YTk4NjQ0M2MxNzc4ZDEyMjZjODU1MGUwYmU5YzE4MmIyYjNkZjU5ZTgxNzE5MDI0M2ZmZWJhZTU0NzIxNjg2YTBiMzI4NDAzMDI1ZTk4NmJlM2ZlYWZlYmE2YzhhNDQxNmNhNDgxMzVmODQ1OTlmNmQxOThlYWI1MmFhMjdiZWMzNmU4YWYyMTMzOWRiMWNmZjY4ZDY4ZDg4MzM2OGY1MTcyYzY3OTRhMzFiMmE5ODdiNDYxMWMyOTEwZmY1OTVlOGQ2NTIzYzQxZTg1OWZjMGRjMzI3NWNlNmVlNjUyMjNkNTkyOTQ5ODcxZTI3NTA3MjhkZWM0NjcwZGEyZWEwZWQ5YTY2ZDM3MmQxNmE2MzdhZjU4NmM2MjBkNjNlZjkyZGQyMGY1N2UzMmM2Zjg0NWZmNGMzZTRkZTU5ZjM0ODVmYWM2NzlmYzZkY2VjMzJkMzRhNTg2ZjlhNGE3MWRhYzc2ZWQ4MDUxNTFhZDQ2OTY1YzljNDUyY2FlMmI1ZWEzMTQ0NjllOTAwYWZmOGJjZmFlODc4MGQ3OTUwNDBlYTNhMzAyZTBjYzgzOTAxZjU3OGJlODlkYzdiYjE2M2Y4NGYxOGU0M2JmMjY0ZGI3MjUzNDY3M2RhZTAyMTljYjNkYTY1NGRlODI4MTRhMjQzZWYxYTI4ZjQ5ZDhhMzU2OGE3Njg4OWYwZDc2NzdkNGYxY2Y0YjcyMThlYjA5MTQ4MGQyYTRiYzNlZDFhY2EwYTBjYmZhNjdjNWJjYWNmMTgyNjM0ODM5ZDFkOGZmYTViNzgwYjBhNjc4MTdlNDM3MzhmMzlmNWM0MThmZTdmYTc1NTQ2ODg4NWVjZjY5YThlOGUyOGQzMDk3OTUzNjZjNWFiNGYzZGJhYmFhMmZlNTI5YjQ1MzJiMjZiMGY5MWFhNzdkZjBkM2E2NmYwMTM1ZmU5ODNhMGE5YmZlOWUwMTdjNWJkZTg0ZTFhYTMyYTkiLCJYLWliZS1rIjoiZGE1NDA1MWNmZjI0ZWFjMCIsImV4cCI6MTY0NTI0NDU3Nn0.44O8keCfnY_3qQVLZ9Np5FQFUZsVO9rj1GQ9eQIP95XGfb4nUS5RktE6uBOsxmt8BB1-sKnJEtVEv9lAIaW7AQ`

</details>

#### Parameters <a href="#parameters" id="parameters"></a>

<details>

<summary>Parameters</summary>

* bookingCode `query` (string, optional),

  Mã tham chiếu đến booking
* supplierType `query` (string, required),

  Loại nhà cung cấp `AIR`, `HOTEL`, …
* listBookingStatus `query` (string\[], optional),

  Trạng thái booking. Các trạng thái booking: `PENDING`, `BOOKED`, `TICKET_ON_PROCESS`, `CONFIRMED`, `FAILED`, `EXPIRED`
* fromLocationName `query` (string, optional),

  Điểm đi
* toLocationName `query` (string, optional),

  Điểm đến
* fromDate `query` (string, optional),

  Tìm các booking có bookingDate lớn hơn hoặc bằng fromDate. Format `yyyy-MM-dd`
* toDate `query` (string, optional),

  Tìm các booking có bookingDate nhỏ hơn hoặc bằng toDate. Format `yyyy-MM-dd`

</details>

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (Array\[BookingDTO], optional),
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)
* page (Array\[pageDTO], optional)

</details>

***

### 2. API Truy vấn kết quả xuất commit booking <a href="#id-2-api-truy-van-ket-qua-xuat-commit-booking" id="id-2-api-truy-van-ket-qua-xuat-commit-booking"></a>

POST: /api/partner/query-trans

Truy vấn kết quả xuất commit booking

Chú ý

Yêu cầu bảo mật: Mã hóa dữ liệu và kèm theo chữ ký điện tử

#### Request Body <a href="#request-body" id="request-body"></a>

Model

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking

</details>

Example

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* key (String, required)

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (String, required)

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/#3-ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * booking\_number (String, required)

    Mã dùng tham chiếu đến booking
  * error\_code (String, required)

    [Mã lỗi](https://developer.gotadi.com/dev-guide/#7-ma-loi)
  * product\_type (String, optional)

    Loại sản phẩm, có giá trị là `AIR` hoặc `HOTEL` tương ứng với loại sản phẩm được mua
  * properties (String, optional)

    Các thông tin mở rộng trả về cho đối tác. `Json string`
  * return\_url (String, optional)

    Trang hiển thị kết quả giao dịch của Gotadi. Sử dụng trong trường hợp đối tác không tự xây dựng trang hiển thị kết quả cuối cùng.
  * total\_amount (Double, required)

    Tổng số tiền phải thanh toán.

</details>

***

### 3. API Lấy chi tiết booking

<kbd>`GET: /api/products/booking-detail`</kbd>

Lấy chi tiết booking tại booking history

#### Request Param

<details>

<summary>Parameters</summary>

* booking\_number `query` (String, Required)

</details>

**Response**

**Code 200**

> OK

<details>

<summary>Model</summary>

* orgCode (String, Optional)\
  Mã dùng tham chiếu đến tác giả của booking: Mã tổ chức
* branchCode (String, Optional)\
  Mã chi nhánh
* agencyCode (String, Optional)\
  Mã đại lý
* agentCode (String, Optional)\
  Mã nhân viên đại lý
* customerCode (String, Optional)\
  Mã khách hàng
* id (String, Optional)\
  id của Booking
* bookingNumber (String, Optional)\
  Mã dùng tham chiếu đến booking
* booking code (String, Optional)\
  Mã dùng mô tả các thông tin cơ bản của booking
* bookingType (String, Optional)\
  Loại Booking, có giá trị là FLIGHT hoặc HOTEL tương ứng với loại sản phẩm được mua
* bookingInfo (BookingInfoDTO, Optional)\
  Thông tin booking
* groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)\
  Đã đặc tả ở phần search
* travelerInfo (TravelerInfoDTO, Optional)\
  Thông tin hành khách và người liên hệ
* channelType (String, Optional)\
  Loại kênh phân phối, có giá trị là B2B hoặc B2C
* saleChannel (String, Optional)\
  Kênh phân phối VD: B2B\_WEB, B2B\_APP,...
* supplierType (String, Optional)\
  Loại nhà cung cấp VD:  AIR, HOTEL,...
* bookingDate (String, Optional)\
  Ngày giữ chỗ<br>

</details>


# Đối tác Corporate Agent (CA)

{% content-ref url="/pages/J0kPfqWPaJCWcY52tTO4" %}
[Qui trình tích hợp](/vietnamese/doi-tac-corporate-agent-ca/qui-trinh-tich-hop)
{% endcontent-ref %}

{% content-ref url="/pages/RgVE3zsDfN7xQHa0buwF" %}
[API Chứng thực](/vietnamese/doi-tac-corporate-agent-ca/api-chung-thuc)
{% endcontent-ref %}


# Qui trình tích hợp

Đối tác cần tích hợp [1 API duy nhất (1)](/vietnamese/doi-tac-corporate-agent-ca/api-chung-thuc) để chứng thực & khởi tạo đường dẫn dùng truy cập Website Gotadi.\
Toàn bộ các luồng nghiệp vụ (bao gồm nhưng không giới hạn ở Search, Book, Payment) sẽ được triển khai trong Gotadi Website. (2)\
Tài liệu này cung thông tin giúp đối tác tích hợp với API đã đề cập.

### 1. Trước khi bạn bắt đầu <a href="#id-1-truoc-khi-ban-bat-au" id="id-1-truoc-khi-ban-bat-au"></a>

Đối tác cung cấp thông tin khởi tạo tài khoản đại lý trên môi trường Sanbox:

#### Thông tin công ty: <a href="#thong-tin-cong-ty" id="thong-tin-cong-ty"></a>

* Tên công ty
* Địa chỉ công ty
* Địa chỉ trang web
* Mã số thuế

#### Thông tin quản trị viên: <a href="#thong-tin-quan-tri-vien" id="thong-tin-quan-tri-vien"></a>

* Họ và tên
* Địa chỉ email
* Số điện thoại

#### Thông tin kết nối: <a href="#thong-tin-ket-noi" id="thong-tin-ket-noi"></a>

* Liên kết với hệ thống của đối tác: Liên kết sản phẩm, liên kết cổng thanh toán, …
* Public key của đối tác. (RSA public key chiều dài tối thiểu 1024 bit) dùng cho việc xác thực chữ ký điện tử.

### 2. Thiết lập môi trường tích hợp <a href="#id-2-thiet-lap-moi-truong-tich-hop" id="id-2-thiet-lap-moi-truong-tich-hop"></a>

* Gotadi khởi tạo tài khoản đại lý, môi trường tích hợp (Sanbox) dựa theo thông tin được cung cấp và gửi lại cho đối tác:
* Tài khoản đại lý: Link portal, username, password.
* API Gateway
* API key
* Thiết lập group trao đổi kỹ thuật (skype) để giải đáp các vấn đề phát sinh trong quá trình tích hợp.
* Public key của Gotadi. (RSA public key chiều dài tối thiểu 1024 bit) dùng cho việc xác thực chữ ký điện tử.

### 3. Tiến hành tích hợp. <a href="#id-3-tien-hanh-tich-hop" id="id-3-tien-hanh-tich-hop"></a>

* Đối tác tiến hành tích hợp trên môi trường Sanbox do Gotadi cung cấp.

### 4. Nghiệm thu và Golive dịch vụ. <a href="#id-4-nghiem-thu-va-golive-dich-vu" id="id-4-nghiem-thu-va-golive-dich-vu"></a>

* Step 1: Nghiệm thu sản phẩm trên môi trường Sanbox.
* Step 2: Gotadi cung cấp tài khoản đại lý và thông tin tích hợp môi trường live.
* Step 3: Setup White list IP cho API gateway môi trường live.
* Step 4: Nghiệm thu sản phẩm trên môi trường Live và launching.


# API Chứng thực

<details>

<summary>Đặc tả API</summary>

* URL: \<API\_GATEWAY>/api/partnership/v1/login
* Method: POST
* Mô tả: API Chứng thực cho Booker và PreBooker
* Yêu cầu bảo mật: [API Key](https://developer.gotadi.com/dev-guide/agent-partner/api-security/#api-key) và [Chữ ký điện tử](https://developer.gotadi.com/dev-guide/agent-partner/api-security/#chu-ky-ien-tu-signature)

</details>

<details>

<summary>Request</summary>

Signature data schema

ACCESSCODE|agencyInfo.partnerRefCode|userInfo.partnerRefCode|userInfo.email|userInfo.phoneNumber

Example:

```json
{
    "agencyInfo": {
        "partnerRefCode": "CHI_NHANH_123",
        "fullName": "Chi nhanh Sai Gon",
        "shortName": "Cty X, Chi nhanh Sai Gon",
        "taxCode": "123456",
        "faxNumber": "123456",
        "phoneNumber": "0123456789",
        "address": "194 Nguyen Thi Minh Khai, Phuong 17, Quan Phu Nhuan",
        "email": "user_y@partner_x.com",
        "representativeName": "Nguyen Van A",
        "representativePhone": "0123456789",
        "representativeEmail": "user_y@partner_x.com",
        "extends": {
            "key": "value",
            "key1": "value1"
        }
    },
    "userInfo": {
        "partnerRefCode": "USER_123",
        "firstName": "Nguyen",
        "lastName": "Van A",
        "address": "194 Nguyen Thi Minh Khai, Phuong 17, Quan Phu Nhuan",
        "email": "user_y@partner_x.com",
        "phoneNumber": "0932909474",
        "roles": [
            "BOOKER", "PRE_BOOKER"
        ],
        "extends": {
            "key": "value",
            "key1": "value1"
        }
    },
    "signature": "..."
}
```

</details>

<details>

<summary>Response</summary>

#### Example

```json
{
    "url": "https://uat-v2-vendor.gotadi.com/?merchant_code=A::1_29001&access_token=...",
    "signature": "...",
    "errorCode": "00"
}
```

</details>

<details>

<summary>HTTP Code</summary>

* &#x20;400: Bad Request
* 401: Unauthorized
* 403: Forbidden
* 404: Not Found
* 500: Unknown Internal Error
* 503: Service Unavailable

</details>

[PreviousQui trình tích hợp](https://developer.gotadi.com/dev-guide/agent-partner/integration-process/)[NextYêu cầu bảo mật](https://developer.gotadi.com/dev-guide/agent-partner/api-security/)Made with [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/)


# Yêu cầu bảo mật

### API Key <a href="#api-key" id="api-key"></a>

Tất cả các request từ phía đối tác gọi sang hệ thống của Gotadi phải chứa các Headers bên dưới để phục vụ các nghiệp vụ về bảo mật và thống kê số liệu của Gotadi:

* apikey: \<api\_key>
* x-ibe-req-name: \<access\_code>

Lưu ý

Giá trị \<api\_key> và \<access\_code> do Gotadi cung cấp cho Đối tác.

***

### Chữ ký điện tử (Signature) <a href="#chu-ky-ien-tu-signature" id="chu-ky-ien-tu-signature"></a>

Một số API quan trọng được yêu cầu đính kèm chữ ký điện tử vào request và response để xác thực.

<details>

<summary>Khởi tạo chữ ký chữ ký điện tử</summary>

<img src="https://developer.gotadi.com/img/3.png" alt="" data-size="original">

Bên gửi áp dụng thuật toán **RSA-SHA256** kết hợp với **Private key của chính mình** để ký chữ ký điện tử trên signature data.

Lưu ý

Schema để thành lập signature data sẽ được mô tả cụ thể ở từng API.

Java example code

```
public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
```

</details>

<details>

<summary>Xác thực chữ ký điện tử</summary>

<img src="https://developer.gotadi.com/img/7.png" alt="" data-size="original">

Bên nhận sử dụng Thuật toán **RSA-SHA256 và Public key của bên gửi** để xác thực signature được bên gửi tạo ra.

Java example code

```
public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}
```

</details>

<br>


# Đối tác Affiliate

### Affiliate Tracking URL Parameter <a href="#id-1-affiliate-tracking-url-parameter" id="id-1-affiliate-tracking-url-parameter"></a>

```
URL: ?utm_source=[Source]&aff_sid=[ID]
```

Dựa vào source để biết booking đến từ nguồn nào / khách hàng nào

<details>

<summary>Parameters</summary>

* utm\_source `query` (String, Optional)

  Nguồn tiếp thị đến từ đâu
* aff\_sid `query` (String, Optional)

  ID khách hàng có trên hệ thống

</details>

<details>

<summary>Example</summary>

```
https://www.gotadi.com/?utm_source=ZALO&aff_sid=Gotadi_User_2021
```

</details>


# Câu hỏi thường gặp

<details>

<summary>Các trạng thái đặt chỗ trong hệ thống Gotadi như thế nào?  </summary>

Trạng thái đặt chỗ trên hệ thống Gotadi là tổ hợp của 3 trạng thái:&#x20;

* Booking status: trạng thái đặt&#x20;
* Payment status: trạng thái thanh toán&#x20;
* Issued status: trạng thái xuất vé (phát hành vé), được hiểu là trạng thái xác nhận của nhà cung cấp dịch vụ sau khi thanh toán thành công

Chi tiết vui lòng xem thêm trong tài liệu sau:

[Các status trong luồng booking Gotadi](/vietnamese/cau-hoi-thuong-gap/cac-status-trong-luong-booking-gotadi)

</details>

<details>

<summary>Để hoàn thành tích hợp B2B2C với Gotadi, cần thông qua các test case như thế nào? </summary>

Vui lòng tham khảo bộ testcase tiêu chuẩn dành cho đối tác B2B2C tại đây

[Bộ Testcase dành cho đối tác B2B2C](/vietnamese/cau-hoi-thuong-gap/bo-testcase-danh-cho-doi-tac-b2b2c)

</details>

<details>

<summary>Quy định về cách test và hoàn hủy đối với các vé đã đặt khi test như thế nào?</summary>

Vui lòng tham khảo Quy định test vé máy bay & khách sạn dành cho 2 nhóm hành trình quốc tế và nội địa theo nội dung dưới đây:\
[Quy định Test](/vietnamese/cau-hoi-thuong-gap/quy-dinh-test)

</details>

<details>

<summary>Quy trình tích hợp gồm những bước nào?</summary>

Quy trình tích hợp về có thể khác nhau tùy vào hình thức hợp tác, tuy nhiên giống nhau ở 2 bước cuối bao gồm: \
\- Nghiệm thu: Thông qua bộ test case & hoàn hủy đối với các vé đã đặt trong quá trình test\
\- Xây dựng kênh kết nối bộ phận chăm sóc khách hàng

Chi tiết về quy trình tích hợp, vui lòng tham khảo trang tổng quan giới thiệu các phương thức

[Đối tác B2B2C](/vietnamese/doi-tac-b2b2c)

[Đối tác Affiliate](/vietnamese/doi-tac-affiliate)

[Đối tác Corporate Agent (CA)](/vietnamese/doi-tac-corporate-agent-ca)

</details>


# Các status trong luồng booking Gotadi

## Các trạng thái từ quản lý booking

Hệ thống Gotadi có 3 trạng thái để tổng hợp thành 1 trạng thái cuối cùng show ra cho User. Bao gồm: Booking, Payment & Issued status

<details>

<summary>Booking statuses (Trạng thái booking)</summary>

* Pending
* Booking on Process
* Booked
* Failed
* Expired

</details>

<details>

<summary>Payment statuses (Trạng thái thanh toán)</summary>

* Pending
* Success
* Failed
* Refund

</details>

<details>

<summary>Issued statuses (Trạng thái phát hành)</summary>

* Pending
* Ticket on Process
* Success
* Failed
* Cancel

</details>

Các trạng thái sẽ thay đổi khác nhau theo Flow booking của User, chi tiết như sau:

<figure><img src="/files/JvgdV3xEd0p9W42SkhIN" alt=""><figcaption></figcaption></figure>

*Xem hình chất lượng cao trong file dưới đây*

[Flow chart.png](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/23924465-c7b8-4665-992d-15be86d4356d/Flow_chart.png)

## Chi tiết ý nghĩa các status

| Thông báo cho người dùng              | Booking Status     | Payment status | Issued status     | Final Status  | Ý nghĩa                                                                                                                                               | Áp dụng cho                |   |
| ------------------------------------- | ------------------ | -------------- | ----------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | - |
| Chưa thực hiện đặt vé                 | Pending            | Pending        | Pending           | BOOK\_PENDING | <p>Trạng thái mặc định, xảy ra sau khi search & xem chi tiết. </p><p>Không hiển thị trong MIS và với người dùng</p>                                   | Combo, Flight, Hotel, Tour |   |
| Giao dịch thất bại                    | Failed             | Pending        | Pending           | BOOK\_FAILED  | Không còn Slot để Book                                                                                                                                | Combo, Flight, Hotel, Tour |   |
| Giữ chỗ, chờ thanh toán               | Booked             | Pending        | Pending           | <p><br></p>   | Book thành công, chờ thanh toán, vé chưa phát hành                                                                                                    | Combo, Flight, Hotel, Tour |   |
| Thanh toán thành công, chờ xuất vé    | Booked             | Success        | Pending           | <p><br></p>   | Book thành công, thanh toán thành công, chờ xuất vé                                                                                                   | Combo, Flight, Hotel, Tour |   |
| Đã gửi yêu cầu, chờ xử lý             | Booking On Process | Pending        | Pending           | <p><br></p>   | <p>Yêu cầu đặt chỗ, chờ xác nhận. </p><p>Yêu cầu gửi về team Operation kiểm tra & liên hệ trực tiếp với khách hàng </p>                               | Tour                       |   |
| Thanh toán thất bại                   | Booked             | Failed         | Pending           | <p><br></p>   | Book thành công, thanh toán thất bại, chưa xuất vé                                                                                                    | Combo, Flight, Hotel, Tour |   |
| Giao dịch hết hiệu lực                | Expired            | Pending        | Pending           | <p><br></p>   | Book thành công, Chờ xuất vé, Hết thời gian thanh toán                                                                                                | Combo, Flight, Hotel, Tour |   |
| Giao dịch thành công                  | Booked             | Success        | Success           | <p><br></p>   | Book thành công, thanh toán thành công, xuất vé thành công                                                                                            | Combo, Flight, Hotel, Tour |   |
| Thanh toán thành công, xuất vé lỗi    | Booked             | Success        | Failed            | <p><br></p>   | Book thành công, thanh toán thành công, xuất vé thất bại trong quá trình làm việc trực tiếp                                                           | Combo, Flight              |   |
| Thanh toán thành công, xuất phòng lỗi | Booked             | Success        | Failed            | <p><br></p>   | Book thành công, thanh toán thành công, xuất vé thất bại trong quá trình làm việc trực tiếp                                                           | Combo, Hotel               |   |
| Giao dịch hết hiệu lực                | Booked             | Expired        | Failed            | <p><br></p>   | Book thành công, Xuất vé thất bại, Hết thời gian thanh toán                                                                                           | Combo, Flight, Hotel, Tour |   |
| Giao dịch đang xử lý                  | Booked             | Success        | Ticket on Process | <p><br></p>   | Book thành công, thanh toán thành công nhưng do lỗi bất kỳ (đường truyền, hạ tầng,…) dẫn tới không gửi được thông tin cho đối tác. Cần xử lý thủ công | Combo, Flight, Hotel, Tour |   |
| Đã hủy vé lỗi                         | Cancel             | Success        | Ticket on Process | <p><br></p>   | Book thành công, Thanh toán thành công, Yêu cầu xuất đang được xử lý, sau đó hủy booking                                                              | Combo, Flight, Hotel, Tour |   |
| Đã hủy vé thành công                  | Cancel             | Success        | Success           | <p><br></p>   | Book thành công, Thanh toán thành công, Yêu cầu xuất đã thành công, sau đó hủy booking                                                                | Combo, Flight, Hotel, Tour |   |
| Đã hoàn tiền vé lỗi                   | Cancel             | Refuned        | Ticket on Process | <p><br></p>   | Booking đã hủy khi vé lỗi, refund tiền cho khách                                                                                                      | Combo, Flight, Hotel, Tour |   |
| Đã hoàn tiền vé thành công            | Cancel             | Refuned        | Success           | <p><br></p>   | Booking đã hủy khi vé đã xuất thành công, refund tiền cho khách                                                                                       | Combo, Flight, Hotel, Tour |   |


# Quy định Test


# Vé máy bay

## Giới thiệu

Mô tả các bước thực hiện & quy định khi đặt vé máy bay **Nội địa Việt Nam** trong quá trình kết nối giữa các đối tác và Gotadi trên cả 2 môi trường:&#x20;

* Môi trường thực tế - Production Environment&#x20;
* Môi trường kiểm thử - UAT Environment&#x20;

## Hành trình nội địa

{% hint style="warning" %}
Vui lòng thông báo trước khi thực hiện test vé
{% endhint %}

1. Có thể search, đặt vé (không xuất vé) của các hãng
2. Chỉ test xuất vé hãng VietnamAirlines và chỉ đặt tối đa 4 khách/booking
3. Tên hành khách, số điện thoại, email phải đặt bằng chính tên người test và thông tin thật
4. Không sử dụng các dữ liệu test giả (dummy data): NGUYEN VAN A, 0900000000, <test@email.com>,....
5. Các vé cần test xuất (VNA) phải đặt cách xa ít nhất 30 ngày và không được trên cùng 1 chuyến bay, ngày bay
6. Yêu cầu hoàn, hủy vé test trên UAT/PRODUCTION, vui lòng email tới địa chỉ <system@gotadi.com> trong ngày **trước 16h**. Nội dung yêu cầu hủy vé và refund số tiền cần hoàn trả (nếu có).

<details>

<summary>Email mẫu yêu cầu hoàn / hủy </summary>

Subject: \[\<Tên đối tác>-Testing] - Yêu cầu hoàn hủy vé máy bay \<mã đặt chỗ>

Nội dung email:&#x20;

\<Nội dung tùy chọn>&#x20;

Kèm theo thông tin đặt chỗ cần hoàn hủy:&#x20;

* Mã đặt chỗ
* Mã tham chiếu
* Hành trình&#x20;
* Tên các hành khách&#x20;

</details>

## Hành trình quốc tế

{% hint style="warning" %}
Vui lòng thông báo trước khi thực hiện test vé
{% endhint %}

1. Có thể search, đặt vé (không xuất vé) của các hãng và **thông báo lại cho Gotadi các vé đã đặt**
2. Chỉ test xuất vé hãng VietnamAirlines và chỉ đặt tối đa 4 khách/booking, mỗi ngày chỉ xuất\
   1 đến 2 booking.
3. Tên hành khách, số điện thoại, email phải đặt bằng chính tên người test và thông tin thật
4. Không sử dụng các dữ liệu test giả (dummy data): NGUYEN VAN A, 0900000000, <test@email.com>,....
5. Các vé cần test xuất (VNA) phải đặt cách xa ít nhất 30 ngày và không được trên cùng 1 chuyến bay, ngày bay
6. Yêu cầu hoàn, hủy vé test trên UAT/PRODUCTION, vui lòng email tới địa chỉ <system@gotadi.com> trong ngày **trước 16h**. Nội dung yêu cầu hủy vé và refund số tiền cần hoàn trả (nếu có).
7. Nếu cần test xuất vé hãng khác ngoài VNA, vui lòng liên hệ Gotadi và chỉ test trên các hãng do Gotadi chỉ định

{% hint style="danger" %}
Ngoài Vietnam Airlines, nếu có nhu cầu test các hãng khác, vui lòng chỉ test trên các hãng do Gotadi cung cấp.&#x20;

Tùy thuộc vào thời điểm test, vui lòng liên hệ đội ngũ hỗ trợ kỹ thuật của Gotadi để lấy danh sách hãng hàng không quốc tế tại thời điểm test.
{% endhint %}


# Khách sạn

## Giới thiệu:&#x20;

Mô tả các bước thực hiện & quy định khi đặt vé máy bay và khách sạn **Quốc tế** trong quá trình kết nối giữa các đối tác và Gotadi trên cả 2 môi trường:&#x20;

* Môi trường thực tế - Production Environment&#x20;
* Môi trường kiểm thử - UAT Environment&#x20;

## Với vé máy bay:

{% hint style="warning" %}
Vui lòng thông báo trước khi thực hiện test vé
{% endhint %}

1. Có thể search, đặt vé (không xuất vé) của các hãng và **thông báo lại cho Gotadi các vé đã đặt**
2. Chỉ test xuất vé hãng VietnamAirlines và chỉ đặt tối đa 4 khách/booking, mỗi ngày chỉ xuất\
   1 đến 2 booking.
3. Tên hành khách, số điện thoại, email phải đặt bằng chính tên người test và thông tin thật
4. Không sử dụng các dữ liệu test giả (dummy data): NGUYEN VAN A, 0900000000, <test@email.com>,....
5. Các vé cần test xuất (VNA) phải đặt cách xa ít nhất 30 ngày và không được trên cùng 1 chuyến bay, ngày bay
6. Yêu cầu hoàn, hủy vé test trên UAT/PRODUCTION, vui lòng email tới địa chỉ <system@gotadi.com> trong ngày **trước 16h**. Nội dung yêu cầu hủy vé và refund số tiền cần hoàn trả (nếu có).
7. Nếu cần test xuất vé hãng khác ngoài VNA, vui lòng liên hệ Gotadi và chỉ test trên các hãng do Gotadi chỉ định

{% hint style="danger" %}
Ngoài Vietnam Airlines, nếu có nhu cầu test các hãng khác, vui lòng chỉ test trên các hãng do Gotadi cung cấp.&#x20;

Tùy thuộc vào thời điểm test, vui lòng liên hệ đội ngũ hỗ trợ kỹ thuật của Gotadi để lấy danh sách hãng hàng không quốc tế tại thời điểm test.
{% endhint %}

<details>

<summary>Email mẫu yêu cầu hoàn / hủy </summary>

Subject: \[\<Tên đối tác>-Testing] - Yêu cầu hoàn hủy vé máy bay \<mã đặt chỗ>

Nội dung email:&#x20;

\<Nội dung tùy chọn>&#x20;

Kèm theo thông tin đặt chỗ cần hoàn hủy:&#x20;

* Mã đặt chỗ
* Mã tham chiếu
* Hành trình&#x20;
* Tên các hành khách&#x20;

</details>

## Với khách sạn

{% hint style="warning" %}
Vui lòng thông báo trước khi thực hiện test vé
{% endhint %}

{% hint style="danger" %}
Chỉ được test trên các khách sạn do Gotadi cung cấp. Tùy thuộc vào thời điểm test, vui lòng liên hệ đội ngũ hỗ trợ kỹ thuật của Gotadi để lấy danh sách khách sạn tại thời điểm test.
{% endhint %}

1. Chọn ngày check in/out cách thời điểm test là 3 tháng
2. Thông tin khách nhận phòng, email và số điện thoại phải đặt bằng chính tên người test và là thông tin thật
3. Không sử dụng các dữ liệu test giả (dummy data): NGUYEN VAN A, 090000000, <Test@gmail.com>,.....
4. Yêu cầu hoàn, hủy vé test trên UAT/PRODUCTION, vui lòng email tới địa chỉ <system@gotadi.com> và cc <ota@gotadi.com> trong ngày **trước 16h**. Nội dung yêu cầu hủy vé và refund số tiền cần hoàn trả (nếu có)

<details>

<summary>Email mẫu yêu cầu hoàn / hủy </summary>

Subject: \[\<Tên đối tác>-Testing] - Yêu cầu hoàn hủy khách sạn \<mã đặt chỗ>

Nội dung email:&#x20;

\<Nội dung tùy chọn>&#x20;

Kèm theo thông tin đặt chỗ cần hoàn hủy:&#x20;

* Mã đặt chỗ
* Mã tham chiếu
* Tên khách sạn
* Tên các hành khách&#x20;
* Số tiền thanh toán&#x20;
* Ngày check in - check out

</details>

{% hint style="info" %}
Thời điểm yêu cầu hủy phòng phải trước thời gian được hủy miễn phí ít nhất 48 tiếng

**Ví dụ:**&#x20;

*Điều kiện booking phòng: Hủy miễn phí trước 11:00 ngày 15/5/2022*

*Yêu cầu hủy đặt phòng phải được gửi trước 11:00 ngày 13/5/2022*
{% endhint %}


# Bộ Testcase dành cho đối tác B2B2C

Bộ testcase tham khảo cho các đối tác B2B2C

## Tải file offline tại đây:

{% hint style="warning" %}
Các testcase liên quan tới trang xác nhận kết quả. Với trường hợp quý đối tác tự xây dựng trang kết quả riêng của mình. Vui lòng lưu ý các test case từ 7-11
{% endhint %}

{% file src="/files/YYdcGRGBnWl4XHhU8Ooz" %}

***

## Bộ testcase tham khảo:&#x20;

### Vé máy bay

<table data-full-width="true"><thead><tr><th width="68">ID</th><th>Test Scenario</th><th>Test Cases</th><th>Test Steps</th><th>Test Data</th><th>Expected Result</th><th data-hidden>Pass/Fail</th><th data-hidden>Actual Result</th><th data-hidden>Note</th></tr></thead><tbody><tr><td>1</td><td>Luồng đăng nhập và khởi tạo webview</td><td>Người dùng đã đăng nhập truy cập vào chức năng đặt vé</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng đặt Vé máy bay.</td><td>Tài khoản người dùng trên ứng dụng của Đối tác</td><td>Truy cập thành công vào chức năng đặt Vé máy bay và hiển thị giao diện webview đặt Vé máy bay của Gotadi.</td><td></td><td></td><td></td></tr><tr><td>2</td><td>Luồng đăng nhập và khởi tạo webview</td><td>Người dùng không đăng nhập truy cập vào chức năng đặt vé</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng xuất khỏi ứng dụng nếu đã đăng nhập trước đó.<br>3. Truy cập vào chức năng đặt Vé máy bay.</td><td></td><td>Không truy cập được vào chức năng đặt Vé máy bay.</td><td></td><td></td><td></td></tr><tr><td>3</td><td>Luồng Giữ chỗ và yêu cầu thanh toán</td><td>Giữ chỗ và khởi tạo yêu cầu thanh toán thành công</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng đặt Vé máy bay.<br>4. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>5. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>6. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>7. Xác nhận thông tin và click vào "Đến thanh toán".</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN A<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN A</td><td>Người dùng được chuyển đến chức năng toán trên ứng dụng của Đối tác để thanh toán Vé máy bay vừa chọn mua với số tiền chính xác.<br>Hiển thị thông tin Time limit vé Gotadi trả về để yêu cầu khách hàng thanh toán đúng thời hạn vé</td><td></td><td></td><td></td></tr><tr><td>4</td><td>Luồng Giữ chỗ và yêu cầu thanh toán</td><td>Giữ chỗ thành công và hủy thanh toán</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng đặt Vé máy bay.<br>4. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>5. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>6. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>7. Xác nhận thông tin và click vào "Đến thanh toán".<br>8. Hủy thanh toán.</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN A<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN A</td><td>Người dùng được chuyển về chức năng đặt vé máy bay để tìm kiếm vé mới.<br><br>Người dùng không bị trừ tiền trên tài khoản thanh toán, vé máy bay không được xuất.</td><td></td><td></td><td></td></tr><tr><td>5</td><td>Luồng Giữ chỗ và yêu cầu thanh toán</td><td>Giữ chỗ thất bại</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng đặt Vé máy bay.<br>4. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>5. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>6. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>7. Xác nhận thông tin và click vào "Đến thanh toán".</td><td>Hành khách:<br>Last name: TEST<br>First name: BOOK FAILED<br><br>Người liên hệ:<br>Last name: TEST<br>First name: BOOK FAILED</td><td>Xuất hiện pop-up thông báo trên webview của Gotadi - nội dung thông báo "Đặt vé thất bại".<br>Hiển thị button Tìm kiếm lại để thực hiện đặt lại vé mới</td><td></td><td></td><td></td></tr><tr><td>6</td><td>Luồng Giữ chỗ và yêu cầu thanh toán</td><td>Thực hiện tìm kiếm lại do hết hạn giữ chỗ</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng đặt Vé máy bay.<br>4. Tìm kiếm vé máy bay hãng VJ với hành trình bất kỳ, ngày bay là sát ngày(trong vòng 24h trước giờ khởi hành) cho 1 người lớn (Loại vé chỉ cho phép Giữ chỗ trong 15 phút).<br>5. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp"<br>6. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp"<br>7. Xác nhận thông tin và click vào "Đến thanh toán"<br>8. Dừng lại ở chức năng thanh toán tối thiểu 15 phút chờ cho vé hết hạn giữ chỗ</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN TEST<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN TEST</td><td>Người dùng được chuyển đến chức năng thanh toán trên ứng dụng của Đối tác<br>Sau khi hết thời gian time limit của booking (time này Gotadi trả về, có thể load lên màn hình) -> expired trang và hiển thị button Tìm kiếm lại<br>Booking đã expired không cho thanh toán lại</td><td></td><td></td><td></td></tr><tr><td>7</td><td>Luồng yêu cầu ghi nợ và xuất vé</td><td>Ghi nợ và xuất vé thành công</td><td>1. Yêu cầu Admin Gotadi cấp hạn mức cho Tài khoản đại lý Đối tác.<br>2. Mở ứng dụng của Đối tác.<br>3. Đăng nhập vào ứng dụng.<br>4. Truy cập vào chức năng đặt Vé máy bay.<br>5. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>6. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>7. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>8. Xác nhận thông tin và click vào "Đến thanh toán".<br>9. Thực hiện thanh toán thành công trên Ứng dụng của đối tác.</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN TEST<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN TEST</td><td>- Đối tác sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo "Xuất vé thành công".<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Xuất vé thành công".<br>3. Tin nhắn SMS được gửi về cho người liên hệ - nội dung tin nhắn thông báo "Xuất vé thành công".<br>* Tin nhắn SMS chỉ được gửi trên môi trường real.<br><br>- Đối tác không sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin:<br>Trạng thái thanh toán/trạng thái đặt chỗ (xuất vé)/mã booking ID tương ứng với trạng thái Xuất vé thành công<br>Tóm tắt đặt chỗ bao gồm: Mã đặt chỗ (PNR)/Hành trình và ngày giờ bay<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Xuất vé thành công". (được gửi từ Gotadi)<br>3. Tin nhắn SMS được gửi về cho người liên hệ - nội dung tin nhắn thông báo "Xuất vé thành công".(được gửi từ Gotadi)<br>* Tin nhắn SMS chỉ được gửi trên môi trường real.</td><td></td><td></td><td></td></tr><tr><td>8</td><td>Luồng yêu cầu ghi nợ và xuất vé</td><td>Yêu cầu xuất vé thất bại do hết hạn mức ghi nợ ở tài khoản Balance gotadi</td><td>1. Yêu cầu Admin Gotadi thu hồi hạn mức của Tài khoản đại lý Đối tác.<br>2. Mở ứng dụng của Đối tác.<br>3. Đăng nhập vào ứng dụng.<br>4. Truy cập vào chức năng đặt Vé máy bay.<br>5. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>6. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>7. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>8. Xác nhận thông tin và click vào "Đến thanh toán".<br>9. Thực hiện thanh toán thành công trên Ứng dụng của đối tác.</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN TEST<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN TEST</td><td>- Đối tác sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo "Thanh toán thất bại".<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Thanh toán thất bại".<br>3. Người dùng được hoàn tiền vào tài khoản thanh toán của đối tác.<br><br>- Đối tác không sử dụng payment và trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin:<br>Trạng thái thanh toán/trạng thái đặt chỗ (xuất vé)/mã booking ID tương ứng với trạng thái Thanh toán thất bại<br>Tóm tắt đặt chỗ bao gồm: Mã đặt chỗ (PNR)/Hành trình và ngày giờ bay<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Thanh toán thất bại". (được gửi từ Gotadi)<br>3. Người dùng được hoàn tiền vào tài khoản thanh toán của đối tác.</td><td></td><td></td><td></td></tr><tr><td>9</td><td>Luồng yêu cầu ghi nợ và xuất vé</td><td>Thanh toán thành công, Xuất vé lỗi</td><td>1. Yêu cầu Admin Gotadi cấp hạn mức cho Tài khoản đại lý Đối tác.<br>2. Mở ứng dụng của Đối tác.<br>3. Đăng nhập vào ứng dụng.<br>4. Truy cập vào chức năng đặt Vé máy bay.<br>5. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>6. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>7. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>8. Xác nhận thông tin và click vào "Đến thanh toán".<br>9. Thực hiện thanh toán thành công trên Ứng dụng của đối tác.</td><td>Hành khách:<br>Last name: ISSUE<br>First name: TICKET ON PROCESS<br><br>Người liên hệ:<br>Last name: ISSUE<br>First name: TICKET ON PROCESS</td><td><p></p><ul><li>Đối tác sử dụng trang webview Booking result của Gotadi:</li></ul><ol><li>Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo "Xuất vé đang chờ xử lý".</li><li>Email được gửi về cho người liên hệ - nội dung email thông báo "Xuất vé đang chờ xử lý".</li><li>Không hoàn tiền cho người dùng, chờ GTD xử lý.</li></ol><ul><li>Đối tác không sử dụng payment và trang webview Booking result của Gotadi:</li></ul><ol><li>Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin: Trạng thái thanh toán/trạng thái đặt chỗ (xuất vé)/mã booking ID tương ứng với trạng thái Xuất vé đang chờ xử lý Tóm tắt đặt chỗ bao gồm: Mã đặt chỗ (PNR)/Hành trình và ngày giờ bay</li><li>Email được gửi về cho người liên hệ - nội dung email thông báo "Xuất vé đang chờ xử lý". (được gửi từ Gotadi)</li><li>Không hoàn tiền cho người dùng, chờ GTD xử lý.</li></ol></td><td></td><td></td><td></td></tr><tr><td>10</td><td>Luồng yêu cầu ghi nợ và xuất vé</td><td>Tiếp theo của case số 9<br>GTD hỗ trợ xuất lại vé => xuất thành công</td><td>1. Yêu cầu Admin Gotadi cấp hạn mức cho Tài khoản đại lý Đối tác.<br>2. Mở ứng dụng của Đối tác.<br>3. Đăng nhập vào ứng dụng.<br>4. Truy cập vào chức năng đặt Vé máy bay.<br>5. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>6. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>7. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>8. Xác nhận thông tin và click vào "Đến thanh toán".<br>9. Thực hiện thanh toán thành công trên Ứng dụng của đối tác.<br>10. CS Gotadi hỗ trợ xữ lý vé thành công.</td><td>Hành khách:<br>Last name: ISSUE<br>First name: TICKET ON PROCESS<br><br>Người liên hệ:<br>Last name: ISSUE<br>First name: TICKET ON PROCESS</td><td><p></p><ul><li>Đối tác sử dụng trang webview Booking result của Gotadi:</li></ul><ol><li>Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo "Xuất vé đang chờ xử lý" -> Không hoàn tiền cho người dùng, chờ GTD xử lý. Tương ứng case số 9</li><li>Sau khi CS GTD hỗ trợ xử lý vé theo yêu cầu của khách thì sẽ gửi Email về cho người liên hệ - nội dung email thông báo "Xuất vé thành công".</li><li>Tin nhắn SMS được gửi về cho người liên hệ - nội dung tin nhắn thông báo "Xuất vé thành công".</li></ol><ul><li>Tin nhắn SMS chỉ được gửi trên môi trường real.</li><li>Đối tác không sử dụng payment và trang webview Booking result của Gotadi:</li></ul><ol><li>Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin Tương ứng case số 9</li><li>Sau khi CS GTD hỗ trợ xử lý vé theo yêu cầu của khách thì sẽ gửi Email về cho người liên hệ - nội dung email thông báo "Xuất vé thành công". (được gửi từ Gotadi)</li><li>Tin nhắn SMS được gửi về cho người liên hệ - nội dung tin nhắn thông báo "Xuất vé thành công".</li></ol><ul><li>Tin nhắn SMS chỉ được gửi trên môi trường real.</li></ul><ol start="4"><li>Đối tác có thể gọi lại api check trạng thái đặt chỗ và update cho chính xác trạng thái cuối cùng của booking là Xuất vé thành công</li></ol></td><td></td><td></td><td></td></tr><tr><td>11</td><td>Luồng yêu cầu ghi nợ và xuất vé</td><td>Tiếp theo của case số 9<br>GTD hỗ trợ xuất lại vé => vẫn thất bại</td><td>1. Yêu cầu Admin Gotadi cấp hạn mức cho Tài khoản đại lý Đối tác.<br>2. Mở ứng dụng của Đối tác.<br>3. Đăng nhập vào ứng dụng.<br>4. Truy cập vào chức năng đặt Vé máy bay.<br>5. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>6. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>7. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>8. Xác nhận thông tin và click vào "Đến thanh toán".<br>9. Thực hiện thanh toán thành công trên Ứng dụng của đối tác.<br>11. CS Gotadi hỗ trợ xử lý vé thất bại.</td><td>Hành khách:<br>Last name: ISSUE<br>First name: TICKET ON PROCESS<br><br>Người liên hệ:<br>Last name: ISSUE<br>First name: TICKET ON PROCESS</td><td><p></p><ul><li>Đối tác sử dụng trang webview Booking result của Gotadi:</li></ul><ol><li>Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo "Xuất vé đang chờ xử lý" -> Không hoàn tiền cho người dùng, chờ GTD xử lý.</li><li>Sau khi CS GTD hỗ trợ xử lý vé theo yêu cầu của khách thì sẽ gửi Email về cho người liên hệ - nội dung email thông báo "Hoàn tiền".</li><li>Người dùng được hoàn tiền vào tài khoản thanh toán.</li></ol><ul><li>Đối tác không sử dụng payment và trang webview Booking result của Gotadi:</li></ul><ol><li>Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin Tương ứng case số 9</li><li>Sau khi CS GTD hỗ trợ xử lý vé theo yêu cầu của khách thì sẽ gửi Email về cho người liên hệ - nội dung email thông báo "Hoàn tiền". (được gửi từ Gotadi)</li><li>Người dùng được hoàn tiền vào tài khoản thanh toán.</li><li>Đối tác có thể gọi lại api check trạng thái đặt chỗ và update cho chính xác trạng thái cuối cùng của booking là Cancelled</li></ol></td><td></td><td></td><td></td></tr><tr><td>12</td><td>Luồng my booking</td><td>Load danh sách booking cũ</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng lịch sử booking.</td><td></td><td><p>Truy cập thành công vào chức năng my booking.</p><p>Danh sách các booking được load ra đúng tài khoản của người dùng đã thực hiện book vé trước đó trên giao diện webview Gotadi.</p></td><td></td><td></td><td></td></tr><tr><td>13</td><td>Luồng my booking</td><td>Thanh toán lại booking cũ</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng đặt Vé máy bay.<br>4. Tìm kiếm vé máy bay với hành trình bất kỳ cho 1 người lớn.<br>5. Nhập thông tin hành khách / Người liên hệ và click vào "Đi tiếp".<br>6. Chọn gói hành lý mua thêm / bảo hiểm và click vào "Đi tiếp".<br>7. Xác nhận thông tin và click vào "Đến thanh toán".<br>8. Hủy thanh toán.<br>9. Truy cập vào chức năng My Booking và Tìm lại booking vừa tạo.<br>10. Click vào "Đến thanh toán".</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN A<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN A</td><td>Người dùng được chuyển đến chức năng thanh toán toán trên ứng dụng của Đối tác để thanh toán Vé máy bay vừa chọn mua với số tiền chính xác.</td><td></td><td></td><td></td></tr></tbody></table>

### Khách sạn

<table data-full-width="true"><thead><tr><th>ID</th><th>Test Scenario</th><th>Test Cases</th><th>Test Steps</th><th>Test Data</th><th>Expected Result</th><th>Pass/Fail</th></tr></thead><tbody><tr><td>1</td><td>Đăng nhập và khởi tạo webview</td><td>Người dùng đã đăng nhập truy cập vào chức năng đặt phòng khách sạn</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn</td><td>Tài khoản người dùng trên ứng dụng của Đối tác</td><td>Truy cập thành công vào chức năng đặt Khách sạn và hiển thị giao diện webview đặt Khách sạn của Gotadi</td><td></td></tr><tr><td>2</td><td>Đăng nhập và khởi tạo webview</td><td>Người dùng không đăng nhập truy cập vào chức năng đặt phòng khách sạn</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng xuất khỏi ứng dụng nếu đã đăng nhập trước đó<br>3. Truy cập vào chức năng đặt Khách sạn</td><td></td><td>Không truy cập được vào chức năng đặt Khách sạn</td><td></td></tr><tr><td>3</td><td>Tìm kiếm khách sạn</td><td>Gợi ý địa điểm liên quan đến tên Quốc Gia</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Tìm kiếm điểm đến theo tên Quốc Gia<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;Nhập tên Quốc Gia></td><td>Hiển thị các địa điểm phổ biến; tỉnh/thành/khu vực; địa danh của Quốc gia đang tìm kiếm trong danh sách địa điểm liên quan</td><td></td></tr><tr><td>4</td><td>Tìm kiếm khách sạn</td><td>Gợi ý địa điểm liên quan với từ khóa</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Tìm kiếm điểm đến với từ khóa<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;Nhập từ khóa></td><td>Hiển thị tất cả các địa điểm có chứa từ khóa trong danh sách địa điểm liên quan</td><td></td></tr><tr><td>5</td><td>Tìm kiếm khách sạn</td><td>Gợi ý khách sạn liên quan đến tên tỉnh/thành</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Tìm kiếm điểm đến với tên tỉnh/thành<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;Nhập tên tỉnh/thành></td><td>Hiển thị các khách sạn của tỉnh/thành đã chọn trong danh sách khách sạn liên quan</td><td></td></tr><tr><td>6</td><td>Tìm kiếm khách sạn</td><td>Gợi ý khách sạn liên quan đến từ khóa có trong tên khách sạn</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Tìm kiếm điểm đến với từ khóa có trong tên Khách sạn<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;Nhập từ khóa></td><td>Hiển thị tất cả khách sạn trong tên có chứa từ khóa đã tìm kiếm</td><td></td></tr><tr><td>7</td><td>Tìm kiếm khách sạn</td><td>Ngày checkin / checkout</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Chọn ngày checkin - checkout<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;chọn ngày checkin - checkout></td><td>- Không thể chọn ngày checkin - checkout trong quá khứ<br>- Không thể chọn ngày checkout nhỏ hơn hoặc bằng với ngày checkin</td><td></td></tr><tr><td>8</td><td>Tìm kiếm khách sạn</td><td>Số lượng phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Chọn số lượng phòng<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;chọn số lượng phòng></td><td>Số lượng phòng không được = 0</td><td></td></tr><tr><td>9</td><td>Tìm kiếm khách sạn</td><td>Số lượng khách</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Chọn số lượng khách<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. &#x3C;chọn số lượng khách></td><td>- Số lượng khách Người Lớn và Trẻ em/ 1 phòng không được vượt quá số lượng cho phép ( Người lớn tối đa 8 khách &#x26; Trẻ em tối đa 4 khách)<br>- Số lượng Người lớn không được phép = 0<br>- Độ tuổi trẻ em phải được nhập đúng &#x26; đầy đủ</td><td></td></tr><tr><td>10</td><td>Kết quả tìm kiếm</td><td>Danh sách khách sạn theo kết quả tìm kiếm</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Xem kết quả hiển thị</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng</td><td>- Danh sách khách sạn hiển thị đúng điểm đến/ checkin - checkout/ số khách/ số phòng đã chọn<br>- Giá hiển thị từng khách sạn hiển thị đúng và không lỗi font chữ/số</td><td></td></tr><tr><td>11</td><td>Chi tiết khách sạn</td><td>Tìm kiếm khách sạn - 1 người lớn/1 phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Xem chi tiết</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn</td><td>- Hiển thị đúng các thông tin: địa điểm/ngày checkin - checkout/ số khách đã chọn<br>- Giá tiền từng loại phòng hiển thị đúng và không lỗi font chữ/số<br>- Chi tiết khách sạn hiển thị đúng, đủ và không lỗi font chữ/số/chính tả<br>- Hiển thị đúng số lượng phòng/đêm đã chọn</td><td></td></tr><tr><td>12</td><td>Nhập thông tin booking</td><td>Thông tin chi tiết cho booking có số lượng 1 người lớn/1 phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>6. Xem chi tiết</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng</td><td>- Hiển thị đúng tất cả các thông tin: khách sạn; ngày checkin-checkout; số đêm; số phòng; số khách; loại phòng<br>- Giá tổng cộng sau khi chọn phòng hiển thị chính xác<br>- Ở box nhập thông tin khách nhận phòng: yêu cầu nhập thông tin cho 1 phòng<br>- Yêu cầu nhập thông tin liên hệ</td><td></td></tr><tr><td>13</td><td>Xác nhận thông tin</td><td>Xác nhận thông tin chi tiết cho booking có số lượng 1 người lớn/1 phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; Người liên hệ</td><td>- Thông tin đặt phòng và khách nhận phòng hiển thị đúng và đầy đủ<br>- Thông tin liên hệ hiển thị đúng thông tin đã nhập<br>- Giá tiền hiển thị đúng</td><td></td></tr><tr><td>14</td><td>Thanh toán</td><td>Khởi tạo yêu cầu thanh toán thành công với booking 01 khách/phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking &#x26; click vào " Đi tiếp"<br>9. Xác nhận đặt chỗ và click vào " Đến thanh toán"<br></td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; Người liên hệ</td><td>Người dùng được chuyển đến chức năng toán trên ứng dụng của Đối tác để thanh toán booking vừa chọn với số tiền chính xác.</td><td></td></tr><tr><td>15</td><td>Thanh toán</td><td>Hủy thanh toán booking 01 khách/1 phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking &#x26; click vào " Đi tiếp"<br>9. Xác nhận đặt chỗ và click vào " Đến thanh toán"<br>10. Hủy thanh toán<br></td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; Người liên hệ</td><td>Người dùng được chuyển về trang chủ để tìm kiếm khách sạn mới<br>Người dùng không bị trừ tiền trên tài khoản thanh toán, Phòng không được xuất.</td><td></td></tr><tr><td>16</td><td>Kết quả đặt phòng và Confirm email</td><td>Thanh toán thất bại với booking 01 khách/phòng</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking &#x26; click vào " Đi tiếp"<br>9. Xác nhận đặt chỗ và click vào " Đến thanh toán"<br>10. Thực hiện thanh toán thất bại</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; Người liên hệ</td><td>- Đối tác sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo "Thanh toán thất bại".<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Thanh toán thất bại".<br>3. Người dùng được hoàn tiền vào tài khoản thanh toán của đối tác.<br><br>- Đối tác không sử dụng payment và trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin:<br>Trạng thái thanh toán/trạng thái đặt chỗ (xuất vé)/mã booking ID tương ứng với trạng thái Thanh toán thất bại<br>Tóm tắt đặt chỗ bao gồm: Mã đặt chỗ (PNR)/Hành trình và ngày giờ bay<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Thanh toán thất bại".<br>3. Người dùng được hoàn tiền vào tài khoản thanh toán của đối tác.</td><td></td></tr><tr><td>17</td><td>Kết quả đặt phòng và Confirm email</td><td>Đặt phòng thành công</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking &#x26; click vào " Đi tiếp"<br>9. Xác nhận đặt chỗ và click vào " Đến thanh toán"<br>10. Thực hiện thanh toán thành công</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; Người liên hệ</td><td>- Đối tác sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo " Giao dịch thành công"<br>2. Email được gửi về email người liên hệ - nội dung email thông báo " Booking Successfully" và hiển thị đúng tất cả thông tin<br><br>- Đối tác không sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin:<br>Trạng thái thanh toán/trạng thái đặt chỗ (xuất vé)/mã booking ID tương ứng với trạng thái Booking Successfully<br>Tóm tắt đặt chỗ bao gồm: Mã đặt phòng (PNR)/ Tên khách sạn và ngày check in/check out<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Booking Successfully".</td><td></td></tr><tr><td>18</td><td>Kết quả đặt phòng và Confirm email</td><td>Xuất phòng thất bại - Chờ xử lý</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking &#x26; click vào " Đi tiếp"<br>9. Xác nhận đặt chỗ và click vào " Đến thanh toán"<br>10. Thực hiện thanh toán thành công</td><td>2. Tài khoản người dùng trên ứng dụng của Đối Tác<br>4. chọn thông tin điểm đến/ checkin - checkout/ số khách/ số phòng<br>5. chọn khách sạn<br>6. chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; Người liên hệ</td><td>- Đối tác sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result trên webview của Gotadi - giao diện thông báo " Xuất phòng thất bại - chờ xử lý"<br>2. Email booking gửi về email người liên hệ - nội dung email thông báo " Your Reservation is in Process" với các thông tin chính xác<br>3. Không hoàn tiền cho người dùng, chờ GTD xử lý.<br><br>- Đối tác không sử dụng trang webview Booking result của Gotadi:<br>1. Người dùng được chuyển đến trang booking result của đối tác và yêu cầu phải có các trường thông tin:<br>Trạng thái thanh toán/trạng thái đặt chỗ (xuất vé)/mã booking ID tương ứng với trạng thái Xuất phòng thất bại - chờ xử lý<br>Tóm tắt đặt chỗ bao gồm: Mã đặt phòng (PNR)/ Tên khách sạn và ngày check in/check out<br>2. Email được gửi về cho người liên hệ - nội dung email thông báo "Your Reservation is in Process".<br>3. Không hoàn tiền cho người dùng, chờ GTD xử lý.</td><td></td></tr><tr><td>19</td><td>Luồng my booking</td><td>Load danh sách booking cũ</td><td>1. Mở ứng dụng của Đối tác.<br>2. Đăng nhập vào ứng dụng.<br>3. Truy cập vào chức năng lịch sử booking.</td><td></td><td><p>Truy cập thành công vào chức năng my booking.</p><p>Danh sách các booking được load ra đúng tài khoản của người dùng đã thực hiện book vé trước đó trên giao diện webview Gotadi.</p></td><td></td></tr><tr><td>20</td><td>Luồng my booking</td><td>Thanh toán lại booking cũ</td><td>1. Mở ứng dụng của Đối tác<br>2. Đăng nhập vào ứng dụng<br>3. Truy cập vào chức năng đặt Khách sạn<br>4. Nhập thông tin Điểm đến/ checkin - checkout/ số khách/ số phòng và click vào " Tìm Khách sạn"<br>5. Chọn khách sạn<br>6. Chọn phòng<br>7. Điền thông tin khách nhận phòng &#x26; người liên hệ và click vào " Đi tiếp"<br>8. Kiểm tra chi tiết booking &#x26; click vào " Đi tiếp"<br>9. Xác nhận đặt chỗ và click vào " Đến thanh toán"<br>10. Hủy thanh toán.<br>11. Truy cập vào chức năng My Booking và Tìm lại booking vừa tạo.<br>12. Click vào "Đến thanh toán".</td><td>Hành khách:<br>Last name: NGUYEN<br>First name: VAN A<br><br>Người liên hệ:<br>Last name: NGUYEN<br>First name: VAN A</td><td>Người dùng được chuyển đến chức năng thanh toán toán trên ứng dụng của Đối tác để thanh toán Vé máy bay vừa chọn mua với số tiền chính xác.</td><td></td></tr></tbody></table>


# Quy trình hỗ trợ từ CS

<figure><img src="/files/8lvXSqHro0tKuYhoH1uD" alt="CS Support Flow VI"><figcaption></figcaption></figure>


# Danh sách Airlines

Dưới đây là bảng thông tin Mapping & danh sách mã code hãng hàng không Gotadi đang cung cấp

{% hint style="info" %}
Vui lòng request để được access
{% endhint %}

{% embed url="<https://drive.google.com/file/d/1A-tiSyL_IKmIIGSI3pR7LtAvcBlfVWQL/view?usp=drive_link>" %}


# Overview

This document is created to support our partners in integrating Gotadi’s Travel APIs. You will find guides and documentation on our products, as well as descriptions of processing flows within the Gotadi system. The Travel APIs are provided to connect partners with all the data you need to build a website or application using travel content from Gotadi.

Our goal is to make developing your website easier than ever by offering flexible pricing search options, allowing you to create exciting tools that expand travel search options for your users.

If you have any questions, you can find more information and answers in the [FAQ section](/english/faq-section) or contact Gotadi’s Partner Support team.


# B2B2C Partner

{% hint style="info" %}
From Gotadi's viewpoint, B2B2C partners help deliver Gotadi's products to end users through the partners' existing platforms.
{% endhint %}

## There are three integration methods for B2B2C partners:

{% content-ref url="/pages/OtTZrySHk2FPbfuy43we" %}
[Webview method](/english/b2b2c-partner/webview-method)
{% endcontent-ref %}

{% content-ref url="/pages/n4yL6CGdAXsQS54QEPvD" %}
[API method](/english/b2b2c-partner/api-method)
{% endcontent-ref %}

{% content-ref url="/pages/pnZCSuERtnGULAvH6mBk" %}
[SDK method](/english/b2b2c-partner/sdk-method)
{% endcontent-ref %}


# Webview method

This document describes issues related to implementing Webview integration between B2B2C partners (referred to as "Partners" in this document) and Gotadi.

### Connection Process

<figure><img src="/files/rXEacgzL5tdFQKenySFx" alt=""><figcaption></figcaption></figure>

<details>

<summary>Step 1: Account Initialization</summary>

The partner provides the necessary information for Gotadi to create an agency account in the sandbox environment. The required information includes:

**Company Information:**

* Company Name
* Company Address
* Website Address

**Administrator Information:**

* Full Name
* Email Address
* Phone Number

**Integration Information:**

* Links to the partner’s system (e.g., product link, payment gateway link, etc.)
* Relevant integration documents
* Partner’s public key (RSA public key with a minimum length of 1024 bits)

</details>

<details>

<summary>Step 2: Providing Sandbox Environment Account</summary>

Gotadi creates an account based on the information provided by the partner and sends the account details back. The provided information includes:

* **Activation link and login credentials** for Gotadi’s B2B portal (sent to the administrator’s email).
* **Gotadi system endpoint:** `<gotadi_api_gateway>`
* **Gotadi's public key** (RSA public key with a minimum length of 1024 bits).
* **Request header parameters:**
  * **API access key:** `<api_key>`
  * **Partner access code:** `<access_code>`

</details>

<details>

<summary>Step 3: Integration and Testing</summary>

The partner activates the account and uses the information from **Step 2** to establish the connection and conduct testing in the sandbox environment.

</details>

<details>

<summary>Step 4: Acceptance Testing</summary>

Acceptance Testing in Sandbox and Go-Live

**Note:** During the testing phase, if any bookings require a refund, cancellation, or modification, please follow the instructions below.

</details>

<details>

<summary>Step 5: Training &#x26; Customer Support Coordination</summary>

Establish a communication channel between Gotadi’s customer support team and the partner.

Prioritize direct communication via OTA applications such as **Skype, Zalo, Viber**, or other suitable platforms.

Conduct **customer support training** (if needed) to ensure optimal service quality from both sides.

</details>

### **Webview Interface**

Please refer to the interface at the link below:

{% embed url="<https://uat-vendor.gotadi.com/embed_b2b2c_demo.html>" %}

{% hint style="info" %}
Gotadi can customize the color scheme upon request to match the partner's interface.
{% endhint %}

### **Terminology and Abbreviations**

| Viết tắt | Từ đầy đủ                          | Mô tả                                                                                                                                                      |
| -------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL      | Uniform Resource                   | Used to reference resources on the Internet.                                                                                                               |
| SSL      | Secure Sockets Layer               | A cryptographic protocol designed to provide secure communication over the Internet.                                                                       |
| HTTPS    | Hypertext Transfer Protocol Secure | A protocol that combines HTTP with SSL or TLS to enable secure information exchange over the Internet.                                                     |
| 3DES     | Triple DES (3DES hay TDES)         | A symmetric key algorithm that applies the DES encryption algorithm three times to each data block.                                                        |
| RSA      | Rivest–Shamir–Adleman              | A public-key cryptographic algorithm. It is the first algorithm suitable for both digital signature generation and encryption.                             |
| SHA-256  | Secure Hash Algorithm              | An algorithm used to transform a specific data segment into a fixed-length output with a high probability of uniqueness. SHA-256 returns a 256-bit result. |
|          | Chữ ký điện tử                     | Information attached to data (text, images, videos, etc.) to identify the owner of that data.                                                              |
| M        | Mandatory                          | Mandatory when calling the API                                                                                                                             |
| O        | Optional                           | Not required when calling the API; this parameter is optional depending on the use case.                                                                   |
| C        | Condition                          | This field is determined as Mandatory or Optional based on the Condition of another field when calling the API                                             |

### HTTP Response code <a href="#http-response-code" id="http-response-code"></a>

| Code | Description           |
| ---- | --------------------- |
| 200  | Success               |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 402  | Forbidden             |
| 402  | Not Found             |
| 500  | Internal Server Error |
| 503  | Service Unavailable   |

### Error code <a href="#ma-loi" id="ma-loi"></a>

| Mã lỗi | Mô tả                                                          |
| ------ | -------------------------------------------------------------- |
| 00     | Request processed successfully.                                |
| 01     | Request is being processed.                                    |
| 02     | Request processing failed.                                     |
| 03     | Request rejected due to agency account authentication failure. |
| 04     | Request rejected due to an invalid digital signature.          |
| 05     | Request rejected due to data decryption failure.               |
| 06     | Request rejected due to an invalid access code.                |
| 07     | Request rejected due to incorrect data format.                 |
| 08     | Request rejected as it has already been processed.             |
| 09     | Request not yet provessed.                                     |
| 10     | Account information not found.                                 |
| 99     | Other errors.                                                  |

### Customer Email Types

* Successful Reservation – Pending Payment
* Ticket Issued Successfully
* Reservation Failed
* Payment Failed
* Payment Successful – Ticket Not Yet Issued

### **Related Documents**

* Integration Information between Gotadi and the Partner.
* Testing Scenarios.
* Sample Source Code.


# API Login

Initialize Webview Integration

Specification

* URL: \<API\_GATEWAY>/api/partner/login
* Method: POST
* Description: Initialize a new session for the user.
* Security Requirements: [Encrypt data and include a digital signature.](/english/b2b2c-partner/webview-method/security-requirements)

#### Request <a href="#request" id="request"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key giải mã dữ liệu (đã được mã hóa). Cách thành lập tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* data (string, required),

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>
  ```

  *Original data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * user\_id (String, required)

    Mã định danh người dùng trên hệ thống của Đối tác.
  * layout (String, optional)

    Có giá trị là `dual` hoặc `single` tương ứng với 2 loại layout Gotadi cung cấp cho đối tác.
  * product (String, required)

    Có giá trị là `flight` hoặc `hotel`. Tương ứng với 2 sản phẩm Gotadi cung cấp cho đối tác.

    Khi layout là `single`: Dùng để chọn dịch vụ hiển thị trên webview.

    Khi layout là `dual`: Dùng để focus dịch vụ hiển thị trên webview.

</details>

#### Example

{% code fullWidth="false" %}

```json
{
    "data": "...",
    "key": "..."
}
```

{% endcode %}

#### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* **key (String, required)**

  Key giải mã dữ liệu (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)
* **data (String, required)**

  Dữ liệu kèm theo chữ ký điện tử (đã được mã hóa). Cách giải mã tham khảo mục: [Mã hóa dữ liệu truyền và xác thực chữ ký điện tử](https://developer.gotadi.com/dev-guide/b2b2c-partner-webview/api-security/#ma-hoa-du-lieu-truyen-va-xac-thuc-chu-ky-ien-tu)

  *Signature data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>
  ```

  *Original data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>|<signature>
  ```

  * access\_code (String, required)

    Access code do Gotadi cung cấp cho Đối tác.
  * error\_code (String, required) [Mã lỗi](https://gotadi.gitbook.io/technical-documentation/~/changes/hxSZJK0E5x4hAwJJ8axI/vietnamese/tich-hop-doi-tac-b2b2c/phuong-thuc-webview#ma-loi)
  * redirect\_url (String, optional)

    Đường dẫn tới Webview Gotadi có kèm theo jwtToken.

    ```
    https://<gotadi_webview_url>?access_token=<jwtToken>
    ```

</details>

#### Example

```json
{
    "data": "...",
    "key": "..."
}
```


# Security Requirements

### **SSL/HTTPS Transmission Channel**

SSL/HTTPS is applied for data transmission between the partner's system and Gotadi. The purpose of using SSL/HTTPS is to ensure that the exchanged data is encrypted, making it difficult to be stolen or forged.

### Security Headers and Traffic Monitoring

All requests from the partner system to Gotadi must include the following headers to support Gotadi's security operations and data analytics:

```
apikey: <api_key>
x-ibe-req-name: <access_code>
```

**Note**

The values of `<api_key>` and `<access_code>` are provided by Gotadi to the Partner.

### Data Encryption and Digital Signature Authentication

The request/response between Gotadi and the Partner for certain critical APIs requires encryption using the **asymmetric 3DES encryption algorithm** and includes a **digital signature** for authentication. The encryption and decryption algorithms will be described in detail in this document.

**Notes:**

* APIs that require data encryption and digital signatures will be specified in the **Security Requirements** section.

#### **Outgoing Data Encryption**

* **Input:**
  * Original data
  * RSA Public Key of the recipient
  * RSA Private Key of the sender
* **Output:**
  * Encrypted Key
  * Encrypted Data

<details>

<summary>Step 1: Generate a Random Key</summary>

![](/files/RFdXSrBKfHqQ3Pb83rEE)

The **3DES Key Generate** function is used to create a **random key** based on the **DESedeKeySpec** standard (**Key length: 24 bytes**). Each **request/response** will be assigned a unique **random key** to ensure security and prevent replay attacks..

#### Example:

```javascript
    public static byte[] generateKey() throws Exception {
        KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede");
        SecretKey secretKey = keyGenerator.generateKey();
        SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DESede");
        DESedeKeySpec deSedeKeySpec = (DESedeKeySpec)   secretKeyFactory.getKeySpec(secretKey, DESedeKeySpec.class);
        byte[] randomKey = deSedeKeySpec.getKey();
        return randomKey;
    }
```

</details>

<details>

<summary>Step 2: Encrypted random key</summary>

![](/files/e5U1faHd5mKFzLfWzY7X)

The **random key** generated in Step 1 will be encrypted using the **asymmetric encryption algorithm RSA** with the **receiver’s Public Key**.

#### Example:

```javascript
public static String encryptRSA(byte[] randomKey, String xmlPublicKey) throws Exception {
    Cipher cipher = createCipherEncrypt(xmlPublicKey);
    byte[] encryptedKey = cipher.doFinal(randomKey);
    return Base64.encodeBase64URLSafeString(encryptedKey);
}
```

</details>

<details>

<summary>Step 3: Signature</summary>

![](/files/zin1m5qbAqwYD2rh8bxR)

The **sender** applies the **RSA-SHA256 algorithm** combined with its own **Private Key** to generate the **digital signature** on the **signature data**.

**Note:**\
The schema for constructing the **signature data** will be specifically described for each API.

#### Example:

```java
public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
```

</details>

<details>

<summary>Step 4: Encrypted data</summary>

![](/files/7DoQbHIjfvjzdRDjJTJw)

The **Original Data**, which includes the **signature**, will be **encrypted using the 3DES algorithm** with the **random key** generated in the previous step.

**Note:**\
The **schema** for constructing the **Original Data** will be specifically described for each API.

#### Example:

```javascript
public static String encryptTripleDes(String originalData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
    byte[] encryptedData = cipher.doFinal(originalData.getBytes("UTF-8"));
    return Base64.encodeBase64URLSafeString(encryptedData);
}
```

</details>

#### **Decrypting Received Data and Verifying Digital Signature**

**Input:**

* **Encrypted Key**
* **Encrypted Data**
* **RSA Private Key** (of the recipient)
* **RSA Public Key** (of the sender)

**Output:**

* **Original Data**
* **Verification Result**

<details>

<summary>Step 1: Decrypted random key</summary>

![](/files/DSwaXG1fA9SEjRjlIwx2)

The recipient **uses their own Private Key** to decrypt the received **Encrypted Key**.

#### Example:

```java
public static byte[] decryptRSAToByte(String encryptedKey, String xmlPrivateKey) throws Exception {
    Cipher cipher = createCipherDecrypt(xmlPrivateKey);
    byte[] bts = Base64.decodeBase64(encryptedKey);
    byte[] randomKey = cipher.doFinal(bts);
    return randomKey;
}
```

</details>

<details>

<summary>Step 2: Decrypted data</summary>

![](/files/lDWqmxvL61iTMZUx9hTF)

The recipient applies the **3DES algorithm** using the **random key** obtained in the previous step to decrypt the **Encrypted Data**, retrieving the **Original Data**, which contains the **signature**.

**Note:**\
The **schema** for constructing the **Original Data** will be specifically described for each API.

#### Example:

```java
public static String decryptTripleDes(String encryptedData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
    byte[] originalData  = cipher.doFinal(Base64.decodeBase64(encryptedData));
    return new String(originalData, "UTF-8");
}
```

</details>

<details>

<summary>Step 3: Verify the electronic signature</summary>

![](/files/QiaWWe7L3PsOBj0h2Eiw)

The recipient applies the **RSA-SHA256 algorithm** along with the **sender’s Public Key** to verify the **signature** extracted from the **Original Data**.

#### Example:

```java
public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}
```

</details>

<br>


# Place Order

## Payment request URL

### Specification <a href="#ac-ta" id="ac-ta"></a>

* **URL:** `<PARTNER_PAYMENT_URL>?key=<encrypted_key>?data=<encrypted_data>`
* **Method:** REDIRECT
* **Description:** Used to redirect users to the partner's payment system.
* **Security Requirements:** Data must be encrypted and include an electronic signature.

<details>

<summary>Model</summary>

* **key** (string, required):\
  The decryption key for the data (already encrypted).\
  Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.
* **data** (string, required):\
  Encrypted data including an electronic signature.\
  Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<product_type>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<product_type>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to the Partner.
  * bookingNumber (String, optional)

    Reference code used for booking.
  * product\_type (String, optional)

    Product type, with values **AIR** or **HOTEL**, corresponding to the purchased product type.
  * total\_amount (String, optional)

    Total amount to be paid.

</details>

#### Example

```url
https://partner_x.com/payment?key=...?data=...
```


# API Get Booking Detail

### Specification <a href="#ac-ta" id="ac-ta"></a>

* URL: \<API\_GATEWAY>/api/products/booking-detail
* Method: GET
* **Description:** API to retrieve booking details.
* **Security Requirement:** API Key.

### Parameter <a href="#parameter" id="parameter"></a>

<details>

<summary>Model</summary>

booking\_number (String, Required) `Refference code`

</details>

#### Example

```
<API_GATEWAY>/api/products/booking-detail?booking_number=ADCO2107201221234
```

### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* **id** (String, Mandatory): Unique identifier for booking details.
* **bookingNumber** (String, Mandatory): Unique reference code for the booking.
* **bookingDate** (String, Mandatory): Booking creation date.
* **updatedDate** (String, Optional): Last updated date of the booking.
* **travelerInfo** (JsonObject, Optional): Passenger and contact person information.

</details>

#### Example

```json
{
  "id": "BOD::221112::d89a3a7f-7667-497a-8db0-7e72374c078e",
  "updatedDate": "2022-11-12T14:46:50.834Z",
  "cacheType": "TICKET",
  "orgCode": "A::1",
  "agencyCode": "A::1",
  "branchCode": null,
  "saleChannel": "B2C_WEB",
  "channelType": "ONLINE",
  "supplierType": "AIR",
  "bookingCode": "BOD::221112::d89a3a7f-7667-497a-8db0-7e72374c078e",
  "bookingType": "DOME",
  "agentCode": null,
  "customerCode": "C::A::1|-1",
  "bookingNumber": "ADCO2211121960553",
  "bookingDate": "2022-11-12T14:46:50.829Z",
  "markupType": "PER_PAX_PER_SEGMENT",
  "bookingInfo": {
    "id": 1960553,
    "orgCode": "A::1",
    "agencyCode": "A::1",
    "saleChannel": "B2C_WEB",
    "channelType": "ONLINE",
    "supplierType": "AIR",
    "bookingCode": "BOD::221112::d89a3a7f-7667-497a-8db0-7e72374c078e",
    "bookingType": "DOME",
    "agentCode": null,
    "agentId": null,
    "agentName": null,
    "branchCode": null,
    "customerCode": "C::A::1|-1",
    "customerId": -1,
    "bookingNumber": "ADCO2211121960553",
    "roundType": "OneWay",
    "fromLocationCode": "HAN",
    "fromLocationName": "Sân bay Nội Bài",
    "fromCity": "Hà Nội",
    "toLocationCode": "SGN",
    "toLocationName": "Sân bay Tân Sơn Nhất",
    "toCity": "Hồ Chí Minh",
    "status": "PENDING",
    "bookingDate": "2022-11-12T14:46:50.829Z",
    "departureDate": "2022-11-26T05:00:00Z",
    "returnDate": null,
    "baseFare": 6499000,
    "equivFare": 50000,
    "serviceTax": 1090000,
    "vat": null,
    "totalFare": 7639000,
    "totalTax": 1090000,
    "agencyMarkupValue": 50000,
    "markupValue": 50000,
    "totalSsrValue": 70000,
    "totalCombo": null,
    "paymentTotalAmount": 0,
    "paymentFee": 0,
    "paymentType": "OTHER",
    "paymentStatus": "PENDING",
    "paymentDate": null,
    "paymentRefNumber": null,
    "partnerOrderId": null,
    "issuedStatus": "PENDING",
    "issuedDate": null,
    "customerFirstName": "VAN A",
    "customerLastName": "NGUYEN",
    "customerPhoneNumber1": "012345678",
    "customerPhoneNumber2": null,
    "customerEmail": "nguyenvana@gotadi.com",
    "taxReceiptRequest": false,
    "taxCompanyName": null,
    "taxAddress1": null,
    "taxAddress2": null,
    "taxNumber": null,
    "paymentBy": null,
    "paymentByCode": null,
    "issuedByCode": null,
    "refundBy": null,
    "refundByCode": null,
    "bookBy": "GUEST",
    "bookByCode": "C::A::1|-1",
    "displayPriceInfo": {
      "bookingNumber": "ADCO2211121960553",
      "baseFare": 6499000,
      "equivFare": 50000,
      "serviceTax": 1090000,
      "totalFare": 7639000,
      "totalTax": 1090000,
      "agencyMarkupValue": 50000,
      "markupValue": 50000,
      "totalSsrValue": 70000,
      "cancellationFee": 0,
      "paymentFee": 0,
      "discountAmount": 0,
      "additionalFee": 0,
      "additionalTaxPerTraveler": 0,
      "vat": null
    },
    "transactionInfos": [
      {
        "id": 1960605,
        "saleChannel": "B2C_WEB",
        "channelType": "ONLINE",
        "supplierType": "AIR",
        "bookingCode": "ADCO2211121960553::HAN-SGN::domd71e7045-f116-4106-9390-b6cbc6f0781c",
        "bookingNumber": "ADCO2211121960553",
        "status": "PENDING",
        "bookingDate": "2022-11-12T14:46:50.829Z",
        "supplierCode": "VN",
        "supplierName": "Vietnam Airline",
        "bookingRefNo": null,
        "passengerNameRecord": null,
        "timeToLive": null,
        "signature": null,
        "detail": "HAN-SGN :: VN 205",
        "originLocationCode": "HAN",
        "destinationLocationCode": "SGN",
        "carrierNo": "205",
        "checkIn": "2022-11-26T07:15:00Z",
        "checkOut": "2022-11-26T05:00:00Z",
        "baseFare": 6499000,
        "equivFare": 50000,
        "serviceTax": 1090000,
        "totalFare": 7639000,
        "totalTax": 1090000,
        "agencyMarkupValue": 50000,
        "markupValue": null,
        "totalSsrValue": 70000,
        "markupKey": "F2C|A::1|A|DOME|BAS|VNA|BUSINESS|-1",
        "markupCode": null,
        "markupFormula": null,
        "paymentAmount": null,
        "issuedStatus": "PENDING",
        "issuedDate": null,
        "etickets": null,
        "listETickets": null,
        "productSeqNumber": "ibe858002371120552",
        "productClass": "BUSINESS",
        "bookingDirection": "DEPARTURE",
        "noAdult": 1,
        "noChild": 0,
        "noInfant": 0,
        "quantity": 0,
        "unitId": null,
        "b2cBasePrice": 0,
        "b2cTaxAndFees": 0,
        "adjustNet": 0,
        "adjustContract": 0,
        "b2cTotalPrice": 0,
        "supplierBookingStatus": "PENDING",
        "supplierPaymentStatus": null,
        "allowHold": true,
        "onlyPayLater": false,
        "refundable": false
      }
    ],
    "agencyMarkupInfos": [
      {
        "agencyCode": "A::1",
        "baseFare": 6499000,
        "equivFare": 50000,
        "serviceTax": 1090000,
        "totalFare": 7639000,
        "totalTax": 1090000,
        "markupValue": 50000,
        "agencyMarkupValue": 50000
      }
    ],
    "numberOfTransactionMarkup": 1,
    "numberOfTransaction": 1,
    "contactInfos": [
      {
        "id": 1960852,
        "bookingNumber": "ADCO2211121960553",
        "contactType": null,
        "contactLevel": null,
        "gender": null,
        "firstName": "VAN A",
        "surName": "NGUYEN",
        "email": "nguyenvana@gotadi.com",
        "ccEmail": null,
        "country": null,
        "city": null,
        "address1": null,
        "address2": null,
        "postalCode": null,
        "phoneCode1": "84",
        "phoneNumber1": "012345678",
        "phoneCode2": null,
        "phoneNumber2": null,
        "bookingId": null,
        "dob": "1988-02-03T17:00:00Z"
      }
    ],
    "travelerInfos": [
      {
        "id": null,
        "bookingNumber": "ADCO2211121960553",
        "bookingTransCode": null,
        "email": null,
        "gender": "MALE",
        "firstName": "VAN A",
        "surName": "NGUYEN",
        "dob": "1988-02-04T00:00:00Z",
        "adultType": "ADT",
        "country": null,
        "city": null,
        "address1": null,
        "address2": null,
        "postalCode": null,
        "phoneNumber1": null,
        "phoneNumber2": null,
        "phoneNumber3": null,
        "phoneNumber4": null,
        "phoneNumber5": null,
        "documentType": null,
        "nationality": null,
        "documentNumber": null,
        "documentExpiredDate": null,
        "documentIssuedDate": null,
        "documentIssuingCountry": null,
        "memberCard": false,
        "memberCardType": null,
        "memberCardNumber": null,
        "memberCardExpiredDate": null,
        "orderIdx": 0,
        "eticket": null,
        "eTicketList": {},
        "adminFee": {},
        "bookingId": null,
        "paxFee": 0,
        "baseFare": 6499000,
        "baseTax": 1090000,
        "personRepresentation": null,
        "serviceRequests": [
          {
            "id": 1960807,
            "bookingNumber": "ADCO2211121960553",
            "bookingTransCode": "ADCO2211121960553::HAN-SGN::domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "bookingTravelerId": 1960753,
            "serviceType": "BAGGAGE",
            "fareCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "ssrId": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
            "ssrCode": "FreeBAGGAGE",
            "ssrName": "Xách tay 2x9kg + Ký gửi 1x32kg",
            "ssrAmount": 0,
            "bookingId": null,
            "eTicket": null,
            "bookingDirection": "DEPARTURE"
          },
          {
            "id": 1960806,
            "bookingNumber": "ADCO2211121960553",
            "bookingTransCode": "ADCO2211121960553::HAN-SGN::domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "bookingTravelerId": 1960753,
            "serviceType": "INSURANCE",
            "fareCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "ssrId": "BV-GTD-TRAVEL FLEXI-TVC",
            "ssrCode": "INS_FLEXI_TVC_BRONZE",
            "ssrName": "B%E1%BA%A3o%20hi%E1%BB%83m%20du%20l%E1%BB%8Bch",
            "ssrAmount": 70000,
            "bookingId": null,
            "eTicket": null,
            "bookingDirection": null
          }
        ]
      }
    ],
    "timeToLive": null,
    "supplierBookingStatus": "PENDING",
    "passengerNameRecords": "",
    "etickets": "",
    "cancellationStatus": null,
    "cancellationFee": 0,
    "cancellationNotes": null,
    "cancellationBy": null,
    "cancellationDate": null,
    "discountAmount": 0,
    "discountVoucherCode": null,
    "discountVoucherName": null,
    "discountRedeemId": null,
    "discountRedeemCode": null,
    "discountDate": null,
    "additionalFee": null,
    "taxPersonalInfoContact": null,
    "bookingNote": null,
    "internalBookingNote": null,
    "promotionID": null,
    "reasonCodePaymentFailed": null,
    "bookingFinalStatus": null,
    "bookingIssuedType": null,
    "allowHold": true,
    "onlyPayLater": false,
    "showPayLaterOption": true,
    "showPayNowOption": true,
    "refundable": false,
    "ownerBooking": false,
    "deleted": null
  },
  "groupPricedItineraries": [
    {
      "groupId": "6ac63940-5aa8-463e-87a7-646bf66a5bcc",
      "airline": "VN",
      "airlineName": "Vietnam Airlines",
      "airSupplier": "VN",
      "fightNo": "205",
      "flightType": "DOMESTIC",
      "roundType": "ONEWAY",
      "originLocationCode": "HAN",
      "originLocationName": "Sân bay Nội Bài",
      "originCity": "Hà Nội",
      "originCountryCode": null,
      "originCountry": null,
      "destinationLocationCode": "SGN",
      "destinationLocationName": "Sân bay Tân Sơn Nhất",
      "destinationCity": "Hồ Chí Minh",
      "destinationCountryCode": null,
      "destinationCountry": null,
      "requiredFields": null,
      "aircraft": "Airbus A321",
      "vnaArea": "SouthTrip",
      "arrivalDateTime": "2022-11-26T07:15:00Z",
      "returnDateTime": null,
      "departureDateTime": "2022-11-26T05:00:00Z",
      "totalPricedItinerary": 1,
      "pricedItineraries": [
        {
          "sequenceNumber": "ibe858002371120552",
          "directionInd": "DEPARTURE",
          "ticketType": "ETICKET",
          "validatingAirlineCode": "VN",
          "validatingAirlineName": "Vietnam Airlines",
          "fightNo": "205",
          "airItineraryPricingInfo": {
            "fareSourceCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
            "fareType": "PUBLIC",
            "divideInPartyIndicator": false,
            "fareInfoReferences": null,
            "itinTotalFare": {
              "baseFare": {
                "amount": 6499000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "comboMarkup": null,
              "equivFare": {
                "amount": 50000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "serviceTax": {
                "amount": 1090000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "totalFare": {
                "amount": 7639000,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "totalTax": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
              },
              "totalPaxFee": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
              }
            },
            "adultFare": {
              "passengerTypeQuantities": {
                "code": "ADT",
                "quantity": 1
              },
              "fareBasisCodes": null,
              "passengerFare": {
                "baseFare": {
                  "amount": 6499000,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "comboMarkup": null,
                "equivFare": null,
                "serviceTax": {
                  "amount": 1090000,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "taxes": null,
                "totalFare": {
                  "amount": 7589000,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "totalPaxFee": {
                  "amount": 0,
                  "currencyCode": null,
                  "decimalPlaces": 2
                },
                "surcharges": [
                  {
                    "amount": 0,
                    "indicator": "Ticket fee per booking",
                    "type": "Ticket fee per booking"
                  }
                ]
              }
            },
            "childFare": null,
            "infantFare": null
          },
          "originDestinationOptions": [
            {
              "originLocationCode": "HAN",
              "originLocationName": "Sân bay Nội Bài",
              "originCity": "Hà Nội",
              "originDateTime": "2022-11-26T05:00:00Z",
              "destinationLocationCode": "SGN",
              "destinationLocationName": "Sân bay Tân Sơn Nhất",
              "destinationCity": "Hồ Chí Minh",
              "destinationDateTime": "2022-11-26T07:15:00Z",
              "flightDirection": "D",
              "journeyDuration": 135,
              "flightSegments": [
                {
                  "departureAirportLocationCode": "HAN",
                  "departureAirportLocationName": "Sân bay Nội Bài",
                  "departureCity": "Hà Nội",
                  "departureDateTime": "2022-11-26T05:00:00Z",
                  "arrivalAirportLocationCode": "SGN",
                  "arrivalAirportLocationName": "Sân bay Tân Sơn Nhất",
                  "arrivalCity": "Hồ Chí Minh",
                  "arrivalDateTime": "2022-11-26T07:15:00Z",
                  "departureAirport": {
                    "airport": "HAN",
                    "scheduledTime": "2022-11-25T22:00:00",
                    "utcOffset": {
                      "hours": 7,
                      "minutes": 420
                    }
                  },
                  "arrivalAirport": {
                    "airport": "SGN",
                    "scheduledTime": "2022-11-26T00:15:00",
                    "utcOffset": {
                      "hours": 7,
                      "minutes": 420
                    }
                  },
                  "cabinClassCode": "C",
                  "cabinClassName": "BUSINESS",
                  "cabinClassText": "Business Flex",
                  "eticket": true,
                  "flightNumber": "205",
                  "journeyDuration": 135,
                  "marketingAirlineCode": "VN",
                  "marriageGroup": null,
                  "mealCode": null,
                  "adultBaggage": null,
                  "childBaggage": null,
                  "infantBaggage": null,
                  "operatingAirline": {
                    "code": "VN",
                    "name": "Vietnam Airlines",
                    "equipment": null,
                    "flightNumber": "205"
                  },
                  "resBookDesignCode": "C",
                  "seatsRemaining": null,
                  "stopQuantity": 0,
                  "stopQuantityInfo": null,
                  "flightDirection": "D",
                  "fareCode": null,
                  "fareBasicCode": null,
                  "supplierJourneyKey": "b+T7Lz8Bk6JHev8ZaYn6JdksP71z9ZD2metfP5B9ooZW6R7siI3w/WBDkelhRaA/GU5MCdNYgtx+o5Th5+oS4ANw2mFbDR3jPyIFXZkJiG1Xxe8RXcWecVpXCUVOWsjLDmaO6GNYKdjgTzxoVC4fTLPA4kxTQMWp4y7aBysm/eI/pz3OR10FpI7tJO45Lmj6xiIIVI9PCT18TN1pVZ35/rNUG2MQJWEQe9akNYB9uVJnt0yZKGJ5Jh+znYqWMJGufVYhKrGXcZVUztrGNEjN5FAZOVgK/nWhy0oBmlhKT+YsM0p589zdfHeRe3Tbw3RuOa52GefkpZ9YlxH4RL1u6ZNK353DlVhsjJt/ze/ecZW6IB7fQrYma5znykdxOXFJtQxp68xt6AAdJVSt4oZUj7EvqHLYdLXgu2etX9wLtOio1JC7XOl+nu0Dz/NVdx27tC/XZtmPblJDnyTO/0BKidWtaRCy13WBNbBNZvEMuKTO9EMD52NSFUuAQFNn1glMqRgs32oD4M5AtFgPR4wvkpyxnGICY0cva6IRgsMPjuVaaEwFQJbWskY4kMjxCcpoMMOfVyWYykSzqBjrSxEbjlC2kfUf/qcH2a+VjzSftFZ4xgxv9BVcyjEvt6nfFl9eNxB0u2sH6O6Jr+V4yhqo8AEuXaK3q1A/SWJt5mmZ6q0hUQq+9gri90iOWfzJEIxAMM3/Xj0YWY8A0zb58m6zBBtIMuw3QYMiQ40hziEnfGj1NJcxcDm7+Q/+5YCEzKGYxHpQMLFjywU5Snmm0kD+Rf52kuJm2TTVlQvZ3J4xYUyD8/EREL2NLtyXe4hpsSTxfrQbnEqTtlQhBMCqKiBDfXIe6ci7LM0PDV06ki/Mr/h4Do3x/GW8+PZuH+80+CGOhlypqA9y5xI352R2wyFtYjiaevFmDjITagldXGi/OsN84gG9oWGy91MydmrEOD8WSKv4Er2lkz6pF+0LvDrlUkgfdGU7zaw51VWxbDL8lddV2rq3WOSfDl66hhlsRhHzMSV9RNwLYvoCJWKBfFChN/jlmHE7HesnOyp3JGvG+ZThwZ1DXwDzmD3t+XEtWTNy0vhH1Qg/yd7Wonh2Si9r0ClpwgzKx1ScV9oauAER/aCoc+z2aODeba83bcSiG9gYWU1S5MHsIluEPtWPzEcTQVQeuuwGkzNFbeAmgi77a2CEjDq42UQ+gQxhKrBqtIyXJRSqRIaQQWFoUTNLJYaz9x7Owr/BaR58MzDSDd7i8wOYcQMHtpFAelzER9UuAyrOylpuIH/1H/b4rntDUl2UT0iLKiZ0biSw7FiKNgbDfPeHK+i2lvMAxbVz50Kpf1SzCZ0AysZKjHoQRItdPi+CQhqPqR7ivcye5Y8NU9tgGXBo4WJ/J5QhXm+3VajARlJ7EREq6H8DV+2Dlzsiiy2IpMmB1DzsnBRaS5lKiOGMTnMHZuvOXPSKIz2jEpLpcjcG2Gt0GHO8B0fVrYo7dRRIuw==",
                  "supplierFareKey": null,
                  "aircraft": "Airbus A321"
                }
              ],
              "cabinClassName": "BUSINESS",
              "key": null
            }
          ],
          "cabinClassName": "BUSINESS",
          "validReturnCabinClasses": null,
          "baggageItems": [
            {
              "id": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
              "name": "Xách tay 2x9kg + Ký gửi 1x32kg",
              "code": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
              "amount": 0,
              "serviceType": "BAGGAGE",
              "fareCode": null,
              "direction": null,
              "note": ""
            }
          ],
          "mealItems": null,
          "allowHold": true,
          "onlyPayLater": false,
          "refundable": false,
          "passportMandatory": true
        }
      ],
      "tourCode": null,
      "osiCode": null
    }
  ],
  "hotelAvailability": null,
  "hotelProductPayload": null,
  "hotelProduct": null,
  "tourActivityProduct": null,
  "tourActivityBookingPayload": null,
  "offlineBooking": null,
  "offlineBookingRequest": null,
  "travelerInfo": {
    "airTravelers": [
      {
        "idx": 0,
        "transCode": null,
        "productCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
        "passengerId": null,
        "passengerType": "ADT",
        "gender": "MALE",
        "passengerName": {
          "title": "MALE",
          "firstName": "VAN A",
          "lastName": "NGUYEN"
        },
        "dateOfBirth": "1988-02-04T00:00:00Z",
        "passport": {
          "passportNumber": null,
          "passportType": null,
          "country": null,
          "expiryDate": null
        },
        "frequentFlyerType": null,
        "frequentFlyerNumber": null,
        "phone1": null,
        "phone2": null,
        "email": null,
        "specialServiceRequest": {
          "ssrItems": [
            {
              "id": "air-tickets.baggage-items.vn.adult-child.2x9kg-1x32kg.free",
              "name": "Xách tay 2x9kg + Ký gửi 1x32kg",
              "code": "FreeBAGGAGE",
              "amount": 0,
              "serviceType": "BAGGAGE",
              "fareCode": "domd71e7045-f116-4106-9390-b6cbc6f0781c",
              "direction": "DEPARTURE",
              "note": ""
            }
          ],
          "mealPreference": "OTHER",
          "seatPreference": "AISLE"
        },
        "extraServicesRequest": null,
        "eticket": null
      }
    ],
    "contactInfos": [
      {
        "title": null,
        "firstName": "VAN A",
        "lastName": "NGUYEN",
        "areaCode": "84",
        "countryCode": null,
        "city": null,
        "phoneNumber1": "012345678",
        "phoneNumber2": null,
        "email": "nguyenvana@gotadi.com",
        "postCode": null
      }
    ]
  },
  "isPerBookingType": false
}
```


# API Commit

API Ghi nhận thanh toán và xác nhận xuất vé

### Specification <a href="#ac-ta" id="ac-ta"></a>

* **URL:** `<API_GATEWAY>/api/partner/commit`
* **Method:** **POST**
* **Description:** Request to commit a booking with complete information and finalize payment.
* **Security Requirements:** Data must be encrypted and include an electronic signature.

### Request <a href="#request" id="request"></a>

<details>

<summary>Model</summary>

* **key** (string, required): Decryption key for the data (already encrypted). Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.
* **data** (string, required): Encrypted data including an electronic signature. Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.
* *Signature data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>|<signature>
  ```

  * **access\_code** (String, required): Access code provided by Gotadi to the Partner.
  * **bookingNumber** (String, required): Unique reference code for the booking.
  * **partner\_trans\_id** (String, optional): Partner's transaction identifier. If not provided, the default value will be set to **bookingNumber**.
  * **product\_type** (String, required): Product type, with values **AIR** or **HOTEL**, corresponding to the purchased product type.

    ứng với loại sản phẩm được mua

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```

### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* **key** (String, required): Decryption key for the data (already encrypted). Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.
* **data** (String, required): Encrypted data including an electronic signature. Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.
* *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * **access\_code** (String, required): Access code provided by Gotadi to the Partner.
  * **booking\_number** (String, required): Unique reference code for the booking.
  * **error\_code** (String, required): Error code.
  * **product\_type** (String, optional): Product type, with values **AIR** or **HOTEL**, corresponding to the purchased product type.
  * **properties** (String, optional): Additional information returned to the partner in JSON string format.
  * **return\_url** (String, optional): Gotadi’s transaction result page, used if the partner does not build their own final result page.
  * **total\_amount** (Double, required): Total amount to be paid.

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```

### Example of Gotadi result page:

<figure><img src="/files/PN1e1Vs9gPjfpELYdUsX" alt=""><figcaption></figcaption></figure>


# API Check commit result

API Truy vấn kết quả xuất vé/phòng

### Specification <a href="#ac-ta" id="ac-ta"></a>

* **URL:** `<API_GATEWAY>/api/partner/query-trans`
* **Method:** **POST**
* **Description:** API allows partners to query the ticket/room issuance result.
* **Security Requirements:** Data must be encrypted and include an electronic signature.

### Request <a href="#request" id="request"></a>

<details>

<summary>Model</summary>

* **key** (string, required): Decryption key for the data (already encrypted). Refer to the section **"Data Encryption and Electronic Signature Verification"** for details on how it is generated.
* **data** (string, required): Encrypted data including an electronic signature. Refer to the section **"Data Encryption and Electronic Signature Verification"** for details on how it is generated.
* *Signature data schema:*

  ```
  <access_code>|<booking_number>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<signature>
  ```

  * access\_code (String, required)

    **Access code** provided by Gotadi to the Partner.
  * bookingNumber (String, required)

    **Reference code** used for the booking.đến booking

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```

### Response <a href="#response" id="response"></a>

<details>

<summary>Model</summary>

* **key** (String, required): Decryption key for the data (already encrypted). Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.
* **data** (String, required): Encrypted data including an electronic signature. Refer to the section **"Data Encryption and Electronic Signature Verification"** for decryption instructions.

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * **access\_code** (String, required): Access code provided by Gotadi to the Partner.
  * **booking\_number** (String, required): Unique reference code for the booking.
  * **error\_code** (String, required): Error code.
  * **product\_type** (String, optional): Product type, with values **AIR** or **HOTEL**, corresponding to the purchased product type.
  * **properties** (String, optional): Additional information returned to the partner in JSON string format.
  * **return\_url** (String, optional): Gotadi’s transaction result page, used if the partner does not build their own final result page.
  * **total\_amount** (Double, required): Total amount to be paid.

</details>

#### Example

```json
{
"data": "...",
"key": "..."
}
```


# SDK method

This document describes issues related to implementing Webview integration between B2B2C partners (referred to as "Partners" in this document) and Gotadi.

### **Related Documents**

* Connection information between Gotadi and Partners.
* Test scenarios.
* Sample source code.

***

### **Terminology and Abbreviations**

| Viết tắt | Từ đầy đủ                          | Mô tả                                                                                                                                                      |
| -------- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL      | Uniform Resource                   | Used to reference resources on the Internet.                                                                                                               |
| SSL      | Secure Sockets Layer               | A cryptographic protocol designed to provide secure communication over the Internet.                                                                       |
| HTTPS    | Hypertext Transfer Protocol Secure | A protocol that combines HTTP with SSL or TLS to enable secure information exchange over the Internet.                                                     |
| 3DES     | Triple DES (3DES hay TDES)         | A symmetric key algorithm that applies the DES encryption algorithm three times to each data block.                                                        |
| RSA      | Rivest–Shamir–Adleman              | A public-key cryptographic algorithm. It is the first algorithm suitable for both digital signature generation and encryption.                             |
| SHA-256  | Secure Hash Algorithm              | An algorithm used to transform a specific data segment into a fixed-length output with a high probability of uniqueness. SHA-256 returns a 256-bit result. |
|          | Chữ ký điện tử                     | Information attached to data (text, images, videos, etc.) to identify the owner of that data.                                                              |
| M        | Mandatory                          | Mandatory when calling the API                                                                                                                             |
| O        | Optional                           | Not required when calling the API; this parameter is optional depending on the use case.                                                                   |
| C        | Condition                          | This field is determined as Mandatory or Optional based on the Condition of another field when calling the API                                             |

### Connection Process <a href="#quy-trinh-ket-noi" id="quy-trinh-ket-noi"></a>

<details>

<summary>Step 1</summary>

The partner provides information for Gotadi to create an agency account in the sandbox environment. The information includes:

* **Company Information:**
  * Company name
  * Company address
  * Website address
* **Administrator Information:**
  * Full name
  * Email address
  * Phone number
* **Connection Information:**
  * Partner's system URLs: Product link, Payment gateway link, etc.
  * Relevant integration documents
  * Partner’s public key (RSA public key with a minimum length of 1024 bits)

</details>

<details>

<summary>Step 2</summary>

Gotadi creates an account based on the information provided by the Partner and sends back the account details, including:

* Account activation link and login access to Gotadi's B2B portal (sent to the administrator's email).
* Gotadi system URL: `<gotadi_api_gateway>`
* Gotadi's Public key (RSA public key with a minimum length of 1024 bits)
* Parameters for request headers:
  * API access key: `<api_key>`
  * Partner access code: `<access_code>`

</details>

<details>

<summary>Step 3</summary>

The partner activates the account and uses the information from Step 2 to establish a connection and perform testing in the sandbox environment.

</details>

<details>

<summary>Step 4</summary>

Sandbox Acceptance and Service Go-Live

</details>

### HTTP Response code <a href="#http-response-code" id="http-response-code"></a>

| Code | Mô tả                 |
| ---- | --------------------- |
| 200  | Success               |
| 400  | Bad Request           |
| 401  | Unauthorized          |
| 402  | Forbidden             |
| 402  | Not Found             |
| 500  | Internal Server Error |
| 503  | Service Unavailable   |

### Error codes <a href="#ma-loi" id="ma-loi"></a>

| Mã lỗi | Mô tả                                                          |
| ------ | -------------------------------------------------------------- |
| 00     | Request processed successfully.                                |
| 01     | Request is being processed.                                    |
| 02     | Request processing failed.                                     |
| 03     | Request rejected due to agency account authentication failure. |
| 04     | Request rejected due to an invalid digital signature.          |
| 05     | Request rejected due to data decryption failure.               |
| 06     | Request rejected due to an invalid access code.                |
| 07     | Request rejected due to incorrect data format.                 |
| 08     | Request rejected as it has already been processed.             |
| 09     | Request not yet provessed.                                     |
| 10     | Account information not found.                                 |
| 99     | Other errors.                                                  |

### Detailed Integration Flows  (**Step 3 - 4)**&#x20;

1. **After searching and booking in GotadiSDK**, a callback is returned containing the `BookingNumber`.
2. **The partner receives the `BookingNumber`** and:
   1. Redirects the user to the **\[Partner's Payment Screen]**.
   2. Calls the `/booking-detail` API to retrieve payment details.
3. **Upon successful or failed payment**, the partner:
   1. Redirects the user to the **\[Partner's Invoice Screen]**.
   2. Calls the `/booking-detail` API to retrieve `bookingInfo`.
4. **On the \[Partner's Invoice Screen]**, if the user selects **\[Manage Tickets]**:
   1. Redirects the user to the **\[GotadiSDK Booking Management Screen]**.


# API Login

{% content-ref url="/pages/lhC7GP3bpK7BUMmymSV8" %}
[API Login](/english/b2b2c-partner/webview-method/api-login)
{% endcontent-ref %}


# Security Requirments

{% content-ref url="/pages/GEzBSBzBdbbGtROb8gGP" %}
[Security Requirements](/english/b2b2c-partner/webview-method/security-requirements)
{% endcontent-ref %}


# Initiate SDK


# Init IOS SDK

Gotadi SDK Integration Guide for iOS

{% hint style="info" %}
SDK link: <https://bitbucket.org/gotadigroup/gtd-ios-sdk>
{% endhint %}

### **Import Gotadi SDK into an iOS Project**

**Add the Library Using Swift Package Manager**

Use the SDK link above to add the library to your project via Swift Package Manager.

<div><figure><img src="/files/yglEucypuYYsRGdWaE8m" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Y5gHrllwrH2vFW4KXkvd" alt=""><figcaption></figcaption></figure> <figure><img src="/files/wwSf95JVKEcRKee81OFB" alt=""><figcaption></figcaption></figure></div>

```
Build the project for the first time to import the GotadiSDK library.
```

### Example Code to Initialize IOSGotadiSDK

* **Import IOSGotadiSDK**
* Initialize **IOSGotadiSDK** in `viewDidLoad` for performance optimization.
* Init SDK and set up the partner environment with the following parameters:
  * `env`: Deployment environment \[`uat` | `prod`]
  * `partnername`: Partner name, e.g., `"vib"`
  * `language`: Display language \[`"vi"` | `"en"`]
  * `token`: JWT token obtained after authentication via Gotadi's API
  * `theme`: `primary`, `secondary`

```swift
import UIKit
import IOSGotadiSDK
class ViewController: UIViewController {
    let gotadiSDK: IOSGotadiSDK = IOSGotadiSDK.shared
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

        //TODO: Call API authorize get Token from Gotadi
        gotadiSDK.setup(partnerSetting:
                        GotadiPartnerSetting(
                            env: "uat",
                            partnername: "vib",
                            language: "en", token: "token", theme: "primary"))
    }

        //TODO: Handle action push to gotadi search book
    @IBAction func gotoGotadiSearchBook(_ sender: Any) {
        gotadiSDK.pushToHomePartner(
            partnerViewController: self,
            handlePayment: {[weak self] gotadiViewController, bookingNumber in
                //TODO: Handle payment after checkout and receive bookingInfo
                print(bookingNumber)
                if let paymentViewController  =
                    self?.storyboard?.instantiateViewController(withIdentifier: "PaymentViewController")
                    as? PaymentViewController {
                        paymentViewController.bookingNumberResult = bookingNumber
                        gotadiViewController.navigationController?.pushViewController(paymentViewController, animated: true)
                }
        })
    }
}
```


# Init Android SDK

Gotadi SDK Integration Guide for Android

### **Import Gotadi SDK into an Android Project** <a href="#import-android-gotadi-sdk-vao-project" id="import-android-gotadi-sdk-vao-project"></a>

#### 1. Download `AndroidGotadiSDK` from SDK link. <a href="#id-1-download-androidgotadisdk-tu-sdk-link" id="id-1-download-androidgotadisdk-tu-sdk-link"></a>

#### 2. **Import the AndroidGotadiSDK Module into an Android Project** <a href="#id-2-import-module-androidgotadisdk-vao-project-android" id="id-2-import-module-androidgotadisdk-vao-project-android"></a>

<div><figure><img src="/files/qVtduIfqq2pmc7tEL7hm" alt=""><figcaption></figcaption></figure> <figure><img src="/files/VQp2ju2i90FhsRt6PydO" alt=""><figcaption></figcaption></figure> <figure><img src="/files/YOfXnzHmZ72sAIMsfODJ" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}

```javascript
After importing, you will see the configuration include ':AndroidGotadiSDK' in the settings.gradle file.
```

{% endhint %}

```gradle
rootProject.name = "My Application"
include ':app'
include ':AndroidGotadiSDK'
```

#### 3. Add AndroidGotadiSDK Dependencies in `build.gradle` to Use the Library. <a href="#id-3-add-dependencies-androidgotadisdk-trong-file-buildgradle-e-su-dung-thu-vien" id="id-3-add-dependencies-androidgotadisdk-trong-file-buildgradle-e-su-dung-thu-vien"></a>

```gradle
dependencies {
    implementation project(path: ':AndroidGotadiSDK')
}
```

#### 4. Add Maven Repositories for AndroidGotadiSDK in build.gradle to Use SDK Libraries. <a href="#id-4-add-maven-repositories-androidgotadisdk-trong-file-buildgradle-e-su-dung-libs-cua-sdk" id="id-4-add-maven-repositories-androidgotadisdk-trong-file-buildgradle-e-su-dung-libs-cua-sdk"></a>

```gradle
allprojects {
    repositories {
        maven {
            url "${project.rootDir}/AndroidGotadiSDK/libs"
        }
        maven {
            url 'https://storage.googleapis.com/download.flutter.io'
        }
    }
}
```

### Example Code khởi tạo AndroidGotadiSDK <a href="#example-code-khoi-tao-androidgotadisdk" id="example-code-khoi-tao-androidgotadisdk"></a>

* Import the SDK Package to Use Functions for Initializing Gotadi Search Book Activity.

```kotlin
import com.gotadi.AndroidGotadiSDK.GotadiAdapter
import com.gotadi.AndroidGotadiSDK.GotadiCallback
import com.gotadi.AndroidGotadiSDK.GotadiPartnerSetting
```

* Initialize GotadiSDK for Performance Optimization
* Set up the environment before running GotadiActivity.
* Init setting `environment` of partner with `params`:
  * `env` : deploy environment `[uat | prod]`
  * `partnername`: Partner Name , example: `“vib”`
  * `language`: Display languages `[”vi” | “en”]`
  * `token`: JWT Token obtained after authorization from Gotadi's authentication API.
  * `theme` : `primary`, `secondary`

```kotlin
import com.gotadi.AndroidGotadiSDK.AndroidGotadiSDK
import com.gotadi.AndroidGotadiSDK.GotadiCallback
import com.gotadi.AndroidGotadiSDK.GotadiPartnerSetting

class GTDExampleAppActivity : AppCompatActivity() {
    private var gotadiSDK: AndroidGotadiSDK? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_my_app)
        val button = findViewById<Button>(R.id.myappButton)
        //Call API and get gotadi Token
        gotadiSDK = AndroidGotadiSDK(
            this,
            setting = GotadiPartnerSetting("uat", "vib", "vi","token","
primary"))
        button.setOnClickListener {
            val intent = gotadiSDK?.createGotadiIntent()
            intent?.let {
                startActivity(intent)
            }
            gotadiSDK?.actionHandler?.bookkingResultCallback = object : GotadiCallback {
                override fun onCallPayment(gotadiActivity: Context, bookingNumber: String) {
                                        //Handle payment after checkout here
                    println("bookkingResultCallback - onCallPayment")
                    gotadiActivity.startActivity(Intent(gotadiActivity, GTDPartnerPaymentActivity::class.java))
                    println(bookingNumber)
                }
            }
        }
    }

    override fun onDestroy() {
        super.onDestroy()
                //Destroy SDK avoid leak memory
        gotadiSDK?.dispose()
        println("GTDExampleAppActivity is destroy")
    }
}
```


# Place order

{% content-ref url="/pages/DWzHbkQUkrIyBBxApYgW" %}
[Place Order](/english/b2b2c-partner/webview-method/place-order)
{% endcontent-ref %}


# API Commit

{% content-ref url="/pages/TaeHksfswEoXVfqlNUq6" %}
[API Commit](/english/b2b2c-partner/webview-method/api-commit)
{% endcontent-ref %}


# API Get booking detail

{% content-ref url="/pages/F3rBTNFUBkGE9l7rczAS" %}
[API Get Booking Detail](/english/b2b2c-partner/webview-method/api-get-booking-detail)
{% endcontent-ref %}


# API Check commit result

{% content-ref url="/pages/Vlt2kHG7UUCaoG2i98eq" %}
[API Check commit result](/english/b2b2c-partner/webview-method/api-check-commit-result)
{% endcontent-ref %}


# API method

### Summary <a href="#summary" id="summary"></a>

This document describes issues related to the implementation of an API connection between a Agency Partner (hereinafter referred to as a Partner) and Gotadi. Allows users on the Partner’s system to search and book flights/hotels/tours/combos of Gotadi through the application provided by the Partner.

***

### Refferrence documentation <a href="#refferrence-documentation" id="refferrence-documentation"></a>

* Connection information between Gotadi and the Partner.
* Test script
* Sample source code

***

### Terms <a href="#terms" id="terms"></a>

* **URL** `Uniform Resource` are used to refer to resources on the Internet.
* **SSL** `Secure Sockets Layer` are cryptographic protocols designed to provide secure communications over the Internet.
* **HTTPS** `Hypertext Transfer Protocol Secure` is a protocol that combines the HTTP protocol and the SSL or TLS security protocol that allows the secure exchange of information on the Internet.
* **3DES** `Triple DES (3DES or TDES)` is a symmetric key algorithm that applies the DES encryption algorithm three times to each block of data.
* **RSA** `Rivest–Shamir–Adleman` is a public key cryptographic algorithm. This is the first algorithm that appropriate for generating digital signatures at the same time as encryption.
* **SHA-256** `Secure Hash Algorithm` is an algorithm used to convert a certain piece of data into a constant length data segment with high distinct probability. SHA-256 (returns a 256-bit long result)
* **Electronic signature** Information accompanying data (text, images, videos, etc.) for the purpose of identifying the owner of such data

***

### Security Requirements <a href="#security-requirements" id="security-requirements"></a>

#### SSL/HTTPS channel <a href="#sslhttps-channel" id="sslhttps-channel"></a>

SSL/HTTPS is applied to transmit and receive data between the partner’s system and Gotadi. The purpose of using SSL/HTTPS is to make the data exchanged between partners and Gotadi encrypted, and challenging to be stolen and tampered with.

#### Security header and traffic statistics <a href="#security-header-and-traffic-statistics" id="security-header-and-traffic-statistics"></a>

Note

`<api_key>` and `<access_code>` values provided by Gotadi to Partners.

#### Encryption of transmitted data and digital signature authentication <a href="#encryption-of-transmitted-data-and-digital-signature-authentication" id="encryption-of-transmitted-data-and-digital-signature-authentication"></a>

Note

APIs that require data encryption and digital signatures are noted in the Security requirements section

**Encrypt outgoing data**

**Input** Original data, receiver’s RSA PublicKey, sender’s RSA Private Key

**Output** Encrypted Key, Encrypted Data

<details>

<summary>Step 1: Generate random key</summary>

<img src="https://developer.gotadi.com/img/1.png" alt="" data-size="original">

The 3DES Key Generate function is used to generate a random key based on the criteria DESedeKeySpec (Key length: 24 bytes). Each request/response will be given a unique random key.

Example:

Java

```
    public static byte[] generateKey() throws Exception {
        KeyGenerator keyGenerator = KeyGenerator.getInstance("DESede");
        SecretKey secretKey = keyGenerator.generateKey();
        SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DESede");
        DESedeKeySpec deSedeKeySpec = (DESedeKeySpec)   secretKeyFactory.getKeySpec(secretKey, DESedeKeySpec.class);
        byte[] randomKey = deSedeKeySpec.getKey();
        return randomKey;
    }
```

</details>

<details>

<summary>Step 2: Encrypt random key</summary>

<img src="https://developer.gotadi.com/img/2.png" alt="" data-size="original">

The random key generated in step 1 will be encrypted using the RSA asymmetric encryption algorithm using the recipient’s public key.

Example:

Java

```
public static String encryptRSA(byte[] randomKey, String xmlPublicKey) throws Exception {
    Cipher cipher = createCipherEncrypt(xmlPublicKey);
    byte[] encryptedKey = cipher.doFinal(randomKey);
    return Base64.encodeBase64URLSafeString(encryptedKey);
}
```

</details>

<details>

<summary>Step 3: Generate digital signature</summary>

<img src="https://developer.gotadi.com/dev-guide-en/agency-partner/img/3.png" alt="" data-size="original">

The sender applies the RSA-SHA256 algorithm in combination with its own private key to sign the digital signature on the signature data.

Note

Schema to establish signature data will be described in detail in each API.

Example:

Java

```
public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
```

</details>

<details>

<summary>Step 4: Encrypt data</summary>

<img src="https://developer.gotadi.com/img/4.png" alt="" data-size="original">

Original data containing the signature will be encrypted using the 3DES algorithm with the random key generated in the previous step.

Note

Schema to establish signature data will be described in detail in each API.

Example:

Java

```
public static String encryptTripleDes(String originalData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);
    byte[] encryptedData = cipher.doFinal(originalData.getBytes("UTF-8"));
    return Base64.encodeBase64URLSafeString(encryptedData);
}
```

</details>

**Decrypt the received data and verify the electronic signature**

**Input** Encrypted Key, Encrypted Data, Receiver’s RSA PrivateKey, Sender’s RSA PublicKey

**Output** Original Data, Verify Result

<details>

<summary>Step 1: Decrypt 3DES random key</summary>

<img src="https://developer.gotadi.com/img/5.png" alt="" data-size="original">

The Receiver uses its Own private key to decrypt the received encrypted key.

Example:

Java

```
public static byte[] decryptRSAToByte(String encryptedKey, String xmlPrivateKey) throws Exception {
    Cipher cipher = createCipherDecrypt(xmlPrivateKey);
    byte[] bts = Base64.decodeBase64(encryptedKey);
    byte[] randomKey = cipher.doFinal(bts);
    return randomKey;
}
```

</details>

<details>

<summary>Step 2: Decrypt Data</summary>

<img src="https://developer.gotadi.com/img/5.png" alt="" data-size="original">

The receiver applies the 3DES algorithm combined with the random key obtained in the previous step, decrypting the encrypted data to receive the original data containing the signature.

Note

The receiver applies the 3DES algorithm combined with the random key obtained in the previous step, decrypting the encrypted data to receive the original data containing the signature.

Example:

Java

```
public static String decryptTripleDes(String encryptedData, byte[] randomKey) throws Exception {
    Cipher cipher = Cipher.getInstance("DESede");
    SecretKeySpec secretKeySpec = new SecretKeySpec(randomKey, "DESede");
    cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
    byte[] originalData  = cipher.doFinal(Base64.decodeBase64(encryptedData));
    return new String(originalData, "UTF-8");
}
```

</details>

<details>

<summary>Step 3: Verify digital signature</summary>

<img src="https://developer.gotadi.com/img/6.png" alt="" data-size="original">

The receiver uses the RSA-SHA256 Algorithm and the sender’s Public key to verify the signature extracted from the original data.

Example:

Java

```
public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}
```

</details>

***

#### Abbreviation convention <a href="#abbreviation-conventions" id="abbreviation-conventions"></a>

| Acronym | Full Word   | Description                                                                                                  |
| ------- | ----------- | ------------------------------------------------------------------------------------------------------------ |
| M       | `Mandatory` | Required when calling API                                                                                    |
| O       | `Optional`  | Not required when calling the API, depending on the purpose of use, whether this parameter is passed         |
| C       | `Condition` | Based on the Condition of another field when calling the API, this field is decided as Mandatory or Optional |

#### HTTP Response code <a href="#http-response-code" id="http-response-code"></a>

| Response code | Description           |
| ------------- | --------------------- |
| 200           | Success               |
| 400           | Bad Request           |
| 401           | Unauthorized          |
| 402           | Forbidden             |
| 402           | Not Found             |
| 500           | Internal Server Error |
| 503           | Service Unavailable   |

#### Common parameters <a href="#common-parameters" id="common-parameters"></a>

| Parameter   | Type                | Description                                                                                                                               |
| ----------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| page        | Integer, Optional   | Page number (starting at 0)                                                                                                               |
| size        | Integer, Optional   | Number of elements of each page                                                                                                           |
| sort        | String, Optional    | Arrays contain field names and data types. Ex: id, desc, createdDate, asc                                                                 |
| duration    | String, Optional    | Request processing time - From the time of receiving the request to the time of returning the result.                                     |
| success     | Boolean, Required   | Result of request processing                                                                                                              |
| infos       | Object\[], Optional | The array contains information describing the results at the steps in the request processing.                                             |
| errors      | Object\[], Optional | The array contains information describing the errors that occurred during request processing.                                             |
| textMessage | String, Optional    | Suggested messages are shown to the user.                                                                                                 |
| pageDTO     | PageDTO, Optional   | Object that describes pagination information: Sequence number of pages returned, number of elements per page, total number of pages, etc. |

#### Interactive flow <a href="#interactive-flow" id="interactive-flow"></a>

![](https://developer.gotadi.com/img/interactive-flow.png)

#### Error Code <a href="#error-code" id="error-code"></a>

| Error Code | Description                                                                    |
| ---------- | ------------------------------------------------------------------------------ |
| 00         | The request has been processed successfully                                    |
| 01         | The request is being processed                                                 |
| 02         | The request was processed failed                                               |
| 03         | The request was denied due to a failure of the Reseller Account Authentication |
| 04         | Request rejected due to invalid e-Signature                                    |
| 05         | Request rejected due to failed Data Decryption                                 |
| 06         | Request denied due to invalid Access Code                                      |
| 07         | Request rejected due to malformed data                                         |
| 08         | The request was rejected because it has been processed before                  |
| 09         | The request has not been processed                                             |
| 10         | Account information not found                                                  |
| 99         | Other error                                                                    |

**Common Error Codes**

**Note:** These are common error codes shared across APIs.\
Error codes specific to each API are described under their respective API sections.

| Error Code              | Description                                                         |
| ----------------------- | ------------------------------------------------------------------- |
| INVALID\_REQUEST\_PARAM | Invalid request parameter (see `message` for more details).         |
| UNKNOWN\_ERROR          | Unknown error. Please contact the technical team for further detail |

**Example:** Response returned when a duplicate booking error occurs.

```json
{ 
    "duration": null, 
    "infos": null, 
    "isSuccess": true, 
    "textMessage": null, 
    "errors": [ 
        { 
            "code": "5_BOOKING_RESERVE_FAILED_DUPLICATED", 
            "id": "5013", 
            "message": "Cannot reserve booking with duplicated info" 
        } 
    ] 
}
```

**Explanation:**

* In the response, the **`success`** field (boolean) indicates whether the request was successful or failed.
* If **`success`** is **`false`**, check the **`errors`** field for error details.
* Each error contains three attributes:
  * **id** – error identifier
  * **code** – error code
  * **message** – error message (intended for developers only)
* Agents should only rely on the **code** field and cross-reference it with the error code table provided for each API to determine the corresponding error information.


# Integration process

### Before start <a href="#before-start" id="before-start"></a>

Partner provides agent account initialization information on Sandbox environment

#### Company information: <a href="#company-information" id="company-information"></a>

* Company name
* Company address
* Website address
* Tax code

#### Administrator information: <a href="#administrator-information" id="administrator-information"></a>

* Full name
* Email address
* Phone number

#### Connection information: <a href="#connection-information" id="connection-information"></a>

* Link to partner’s system: Product link, payment gateway link, …

### Set up the integration environment <a href="#set-up-the-integration-environment" id="set-up-the-integration-environment"></a>

Gotadi creates an agent account, an integrated environment (Sandbox) based on the information provided and sends it back to the partner:

* Agent account: Link portal, username, password.
* API Gateway
* API key

Set up a technical exchange group (skype) to solve problems arising during the integration process

### Integrating. <a href="#integrating" id="integrating"></a>

Partners conduct the integration on the Sandbox environment provided by Gotadi

### Acceptance and release the service. <a href="#acceptance-and-release-the-service" id="acceptance-and-release-the-service"></a>

* **Step 1:** Product acceptance on Sandbox environment
* **Step 2:** Gotadi provides reseller account and live environment integration information
* **Step 3:** Setup White list IP for API gateway live environment
* **Step 4:** Product acceptance on Live and launching environment


# Login API

```
POST: /api/partner/login
```

Create a new session for the user

{% hint style="info" %}
Security requirements: Encrypt data and include a digital signature
{% endhint %}

#### Request Body <a href="#request-body" id="request-body"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key decrypts (encrypted) data. How to establish refer to the section: Encryption of transmitted data and authentication of digital signature
* data (string, required),

  Data with electronic signature (encrypted). How to decrypt refer to the section: Encryption of transmitted data and authentication of digital signature

  *Signature data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>
  ```

  *Original data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * user\_id (String, required)

    User identifier on the Partner’s system.
  * layout (String, optional)

    The value is dual or single corresponding to 2 types of layout Gotadi provides to partners.
  * product (String, required)
    * The value is flight or hotel. Corresponding to 2 products Gotadi provided to partners.
    * When the layout is single: Used to select the display service on the webview.
    * When the layout is dual: Used to focus the service displayed on the webview.

</details>

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)

  Key decrypts (encrypted) data. How to establish refer to the section: Encryption of transmitted data and authentication of digital signature
* data (String, required)

  Data with electronic signature (encrypted). How to decrypt refer to the section: Encryption of transmitted data and authentication of digital signature

  *Signature data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>
  ```

  *Original data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * error\_code (String, required)

    [Error code](https://developer.gotadi.com/dev-guide-en/agency-partner/integration-documentation/#error-code)
  * redirect\_url (String, optional)

    Link to Gotadi Webview with jwtToken included.

    ```
    https://<gotadi_webview_url>?access_token=<jwtToken>
    ```

</details>


# Flight


# Search API

### Get airport list API <a href="#get-airport-list-api" id="get-airport-list-api"></a>

GET: /metasrv/api/\_search/airports

Search for airports by relevant keywords or country/region codes Allows to sort the returned results

#### Parameter <a href="#parameter" id="parameter"></a>

| Parameter                  | Description                                                                                                                   |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| query (String, Optional)   | Search keyword area / airport name (eg: SGN, Vietnam, Tokyo)                                                                  |
| country (String, Optional) | Country/Region Code (Example: VN)                                                                                             |
| page (Integer, Optional)   | Number of pages you want to get results (eg: 0)                                                                               |
| size (Integer, Optional)   | Number of results you want to get in 1 page (eg 20)                                                                           |
| sort (String, Optional)    | Sort the results by the value of the returned property ascending or descending (eg: propertiesName,desc / propertiesName,asc) |

**Example**

?query=`ha`\&country=`VN`\&page=`0`\&size=`20`\&sort=`name,desc`

#### Response <a href="#response" id="response"></a>

**Model**

| Parameter                      | Description                       |
| ------------------------------ | --------------------------------- |
| Array\[AirportDTO] (Optional)  | Return airport list information   |
| id (Long, Optional)            | Airport List Identifier           |
| code (String, Optional)        | Airport code                      |
| name (String, Optional)        | Airport name                      |
| cityCode (String, Optional)    | City symbol code                  |
| city (String, Optional)        | City name                         |
| countryCode (String, Optional) | Country symbol code               |
| country (String, Optional)     | Country name                      |
| timeZone (Integer, Optional)   | Time zone                         |
| location (String, Optional)    | Location name                     |
| name2 (String, Optional)       | English airport name (other name) |
| city2 (String, Optional)       | English city name (other name)    |

**Example**

```json
[
    {
        "id": 4,
        "code": "SGN",
        "name": "Sân bay Tân Sơn Nhất",
        "cityCode": "SGN",
        "city": "Hồ Chí Minh",
        "countryCode": "VN",
        "country": "Vietnam",
        "iata": "SGN",
        "groupName": "Popular,INT_VN,Vietnam",
        "name2": "Tansonnhat Intl",
        "city2": "Ho Chi Minh City",
        "location": "Tp. Hồ Chí Minh",
        "timezone": 7,
        "index": 2,
        "icao": null,
        "latitude": null,
        "longitude": null,
        "altitude": null,
        "dts": null,
        "tzTimezone": null,
        "updatedAt": null,
        "connectedPorts": null,
        "stateCode": null,
        "status": null,
        "keywords": null
    }
]
```

### Search flight ticket API <a href="#search-flight-ticket-api" id="search-flight-ticket-api"></a>

GET: /api/air-tickets/low-fare-search-async

Search for flights by departure and end points / by date and time

#### Parameter <a href="#parameter_1" id="parameter_1"></a>

| Parameter                             | Description                                                                                                                                                                                 |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| origin\_code (String, Required)       | <p>Departure airport code<br>Example: The airport in Ho Chi Minh has the code SGN</p>                                                                                                       |
| destination\_code (String, Required)  | <p>Destination airport code<br>Example, the airport in Hanoi has the code HAN .</p>                                                                                                         |
| departure\_date (String, Required)    | <p>Departure day<br>Format in MM-dd-YYYY<br>Example: 07-07-2021</p>                                                                                                                         |
| returnure\_date (String, Required)    | <p>Return day<br>Format in MM-dd-YYYY<br>Example: 08-20-2021</p>                                                                                                                            |
| cabin\_class (String, Required)       | <p>Ticket class<br>Pass the value as E</p>                                                                                                                                                  |
| route\_type (String, Optional)        | <p>Journey type:<br>- Oneway: One-way<br>- ROUNDTRIP: Round trip<br>If not transmitted, the value is ONEWAY .</p>                                                                           |
| aduts\_qtt (Integer, Optional)        | <p>Number of adult passengers (12 years old and above)<br>Otherwise, the default value is 1 .</p>                                                                                           |
| children\_qtt (Integer, Optional)     | <p>Number of passengers who are children (from 2 years old and under 12 years old)<br>Otherwise, the default value is 0</p>                                                                 |
| infants\_qtt (Integer, Optional)      | <p>Number of passengers who are infants (under 2 years old)<br>Otherwise, the default value is 0</p>                                                                                        |
| time (String, Optional)               | <p>API Call Time (UnixTimeStamp)<br>Example: 1625545845</p>                                                                                                                                 |
| key (String, Optional)                | Key to checksum. How to create value:MAC-SHA256(, ‘Gotadi’)                                                                                                                                 |
| skip\_filter (Boolean, Optional)      | By default, when `false`, the response will include `groupPricedItineraries`, which contains the list of itineraries returned from the search results. Otherwise, it will not be displayed. |
| include-equivfare (Boolean, Optional) | Request to pay additional ticketing fee information (EquivFare)                                                                                                                             |
| page (Integer, Optional)              | Number of pages you want to get results (eg: 0)                                                                                                                                             |
| size (Integer, Optional)              | Number of results you want to get in 1 page (eg 20)                                                                                                                                         |
| sort (String, Optional)               | Sort the results by the value of the returned property ascending or descending (eg: propertiesName,desc / propertiesName,asc)                                                               |

**Example**

```
?origin_code=SGN&destination_code=HAN&departure_date=07-21-2021&returnture_date=07-28-2021&cabin_class=E&route_type=ROUNDTRIP&aduts_qtt=1&children_qtt=0&infants_qtt=0&time=1625552814666&key=/xNr15RmY0dqSUkhvpKI1bIbKIuyZr1Q38rLi3bqxVk=&page=0&size=15
```

#### Response <a href="#response_1" id="response_1"></a>

**Model**

| Parameter                                                            | Description                                                                                                                                      |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| searchId(String, Required)                                           | The reference code to the search for air tickets, taken from the search results for air tickets                                                  |
| departureSearchId(String, Required)                                  | <p>Reference code to search for flight tickets<br>Retrieved from searchId</p>                                                                    |
| returnSearchId(String, Required)                                     | <p>Reference code to search for air tickets<br>Derived from searchID combined with -R at the end</p>                                             |
| groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)   | Information about the list of journeys returned by search results                                                                                |
| airSupplier(String, Required)                                        | Carriers (VietnamAirline - VNA, VjetJet - VJ, BamBoo - QH, …)                                                                                    |
| aircraft (String, Optional)                                          | Type of aircraft (Airbus A330, Boeing 787, .....)                                                                                                |
| airline(String, Optional)                                            | Airlines (VJ, VNA, …)                                                                                                                            |
| airlineName(String, Optional)                                        | Name of airline (Vietjet Air, Vietnam Airlines, Bamboo, …)                                                                                       |
| arrivalDateTime(String, Required)                                    | Arrival date and time, using UTC/GMT+7 time zone                                                                                                 |
| departureDateTime (String, Required)                                 | Split flight time, using UTC/GMT+7 time zone                                                                                                     |
| destinationLocationCode (String, Optional)                           | Flight end city code                                                                                                                             |
| destinationCountry(String, Optional)                                 | The name of the country where the flight ended                                                                                                   |
| destinationCountryCode (String, Optional)                            | Flight end country code                                                                                                                          |
| destinationCity(String, Optional)                                    | The name of the city where the flight ends                                                                                                       |
| destinationLocationName (String, Optional)                           | Airport name where the flight ends                                                                                                               |
| flightNo(String, Optional)                                           | Airplane number                                                                                                                                  |
| flightNo(String, Optional)                                           | Airplane number                                                                                                                                  |
| flightType(String, Optional)                                         | <p>Type of flight domestic or international<br>DOMESTIC: domestic<br>INTERNATIONAL: international</p>                                            |
| groupId(String, Required)                                            | Journey identifier in the list of journeys returned by search results                                                                            |
| originCity(String, Optional)                                         | City name at departure point                                                                                                                     |
| originCountry(String, Optional)                                      | Country name at departure point                                                                                                                  |
| originCountryCode(String, Optional)                                  | Country code at departure point                                                                                                                  |
| originLocationCode(String, Optional)                                 | Flight departure city code                                                                                                                       |
| originLocationName(String, Optional)                                 | Airport name at departure point                                                                                                                  |
| totalPricedItinerary (Integer, Required)                             | Total number of detailed journeys                                                                                                                |
| pricedItineraries (Array\[PricedItineraries], Required)              | Itinerary details                                                                                                                                |
| airItineraryPricingInfo (AirItineraryPricingInfo, Required)          | Detailed price information of the itinerary                                                                                                      |
| adultFare (FareBreakdown, Required)                                  |                                                                                                                                                  |
| passengerFare (PassengerFare, Required)                              | Adult fare information                                                                                                                           |
| baseFare(FareInfo, required)                                         | Basic fare information                                                                                                                           |
| amount (Double, Required)                                            | Amount of money                                                                                                                                  |
| decimalPlaces(Integer, Optional)                                     | Decimal places rounded to                                                                                                                        |
| equivFare (FareInfo, Optional)                                       | <p>Similar to baseFare<br>Ticketing fee information</p>                                                                                          |
| serviceTax (FareInfo, Required)                                      | <p>Similar to baseFare<br>Service fee information</p>                                                                                            |
| totalFare (FareInfo, Required)                                       | <p>Similar to baseFare<br>Total ticket price information</p>                                                                                     |
| surcharges (Array\[Surcharge], Required)                             | Information about surcharges per booking / per segment                                                                                           |
| passengerTypeQuantities (PassengerTypeQuantities, Optional)          | Number/type of passengers                                                                                                                        |
| code(String, Required)                                               | <p>Adult/Child/Infant Identifier<br>Includes: ADT - adult / CHD - child / INF - infant</p>                                                       |
| quantity (Integer, Required)                                         | Number of adults / children / infants                                                                                                            |
| childFare(PassengerFare, Optional)                                   | <p>Child fare information<br>Similar to adult fare information</p>                                                                               |
| infantFare (PassengerFare, Optional)                                 | <p>Infant fare information<br>Similar to adult fare information</p>                                                                              |
| itinTotalFare (PassengerFare, Required)                              | <p>Total fare information of the journey<br>Similar to adult fare information</p>                                                                |
| fareSourceCode(String, Required)                                     | <p>Journey identifier information<br>Used to get ticket condition information</p>                                                                |
| allowHold (Boolean, Required)                                        | Information to allow to hold a reservation or not                                                                                                |
| cabinClassName(String, Required)                                     | <p>Seat class information:<br>ECONOMY - universal seat<br>PREMIUM - special economy seat<br>BUSINESS - business chair</p>                        |
| fightNo(String, Optional)                                            | Displays aircraft number information                                                                                                             |
| originDestinationOptions (Array(OriginDestinationOptions), Required) | Cruise’s blocking/stopping information                                                                                                           |
| flightDirection(String, Required)                                    | <p>Show flight direction information of the journey<br>D - departure direction<br>R - return direction</p>                                       |
| journeyDuration (Integer, Required)                                  | Show flight time                                                                                                                                 |
| flightSegments (Array(FlightSegments), Required)                     | Show detailed information of departure / end points in the journey                                                                               |
| page (AirPage, Required)                                             | <p>Object that describes information about pagination.<br>Sequence number of each page returned, element of each page, total number of pages</p> |
| duration(Integer, Optional),                                         |                                                                                                                                                  |
| errors (Array\[Error], Optional)                                     |                                                                                                                                                  |
| infos(Array\[Info], Optional)                                        |                                                                                                                                                  |
| success(Boolean, Optional)                                           |                                                                                                                                                  |
| textMessage(String, Optional)                                        |                                                                                                                                                  |

**Example**

```json
{
    "returnSearchId": "ATD::210706::519f4508-b6df-4d96-8d43-538c96a0d90b-R",
    "departureSearchId": "ATD::210706::519f4508-b6df-4d96-8d43-538c96a0d90b",
    "duration": 46854,
    "errors": null,
    "groupPricedItineraries": [
        {
        "airSupplier": "VJ",
        "aircraft": "Airbus A330",
        "vnaArea": null,
        "airline": "VJ",
        "airlineName": "VietJet Air",
        "arrivalDateTime": "2021-07-21T21:45:00.000Z",
        "departureDateTime": "2021-07-21T19:35:00.000Z",
        "destinationCity": "Hà Nội",
        "destinationCountry": "Vietnam",
        "destinationCountryCode": "VN",
        "destinationLocationCode": "HAN",
        "destinationLocationName": "Sân bay Nội Bài",
        "fightNo": "156",
        "flightType": "DOMESTIC",
        "groupId": "599a7a20-32b8-4e6b-b167-27feb4f324f5",
        "originCity": "Hồ Chí Minh",
        "originCountry": "Vietnam",
        "originCountryCode": "VN",
        "originLocationCode": "SGN",
        "originLocationName": "Sân bay Tân Sơn Nhất",
        "pricedItineraries": [
            {
            "airItineraryPricingInfo": {
                "adultFare": {
                "fareBasisCodes": null,
                "passengerFare": {
                    "baseFare": {
                    "amount": 399000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                    },
                    "comboMarkup": null,
                    "equivFare": null,
                    "serviceTax": {
                    "amount": 258900,
                    "currencyCode": null,
                    "decimalPlaces": 2
                    },
                    "surcharges": [
                    {
                        "amount": 0,
                        "indicator": "Ticket fee per segment",
                        "type": "Ticket fee per segment"
                    }
                    ],
                    "taxes": null,
                    "totalFare": {
                    "amount": 657900,
                    "currencyCode": null,
                    "decimalPlaces": 2
                    },
                    "totalPaxFee": null
                },
                "passengerTypeQuantities": {
                    "code": "ADT",
                    "quantity": 1
                }
                },
                "childFare": null,
                "divideInPartyIndicator": false,
                "fareInfoReferences": null,
                "fareSourceCode": "dom5226c7ae-e46c-48de-ae99-a7d4e3bf0782",
                "fareType": "PUBLIC",
                "infantFare": null,
                "itinTotalFare": {
                "baseFare": {
                    "amount": 399000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                },
                "comboMarkup": null,
                "equivFare": null,
                "serviceTax": {
                    "amount": 258900,
                    "currencyCode": null,
                    "decimalPlaces": 2
                },
                "totalFare": {
                    "amount": 657900,
                    "currencyCode": null,
                    "decimalPlaces": 2
                },
                "totalPaxFee": null,
                "totalTax": {
                    "amount": 0,
                    "currencyCode": null,
                    "decimalPlaces": 2
                }
                }
            },
            "allowHold": true,
            "baggageItems": [
                {
                "amount": 0,
                "code": "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
                "direction": null,
                "fareCode": null,
                "id": "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
                "name": "7kg xách tay",
                "serviceType": "BAGGAGE"
                }
            ],
            "cabinClassName": "ECONOMY",
            "directionInd": "DEPARTURE",
            "fightNo": "156",
            "mealItems": null,
            "onlyPayLater": false,
            "originDestinationOptions": [
                {
                "cabinClassName": "ECONOMY",
                "destinationCity": "Hà Nội",
                "destinationDateTime": "2021-07-21T21:45:00.000Z",
                "destinationLocationCode": "HAN",
                "destinationLocationName": "Sân bay Nội Bài",
                "flightDirection": "D",
                "flightSegments": [
                    {
                    "adultBaggage": null,
                    "aircraft": "Airbus A330",
                    "arrivalAirportLocationCode": "HAN",
                    "arrivalAirportLocationName": "Sân bay Nội Bài",
                    "arrivalCity": "Hà Nội",
                    "arrivalDateTime": "2021-07-21T21:45:00.000Z",
                    "cabinClassCode": "Z1_ECO",
                    "cabinClassName": "ECONOMY",
                    "cabinClassText": "Economy",
                    "childBaggage": null,
                    "departureAirportLocationCode": "SGN",
                    "departureAirportLocationName": "Sân bay Tân Sơn Nhất",
                    "departureCity": "Hồ Chí Minh",
                    "departureDateTime": "2021-07-21T19:35:00.000Z",
                    "eticket": true,
                    "fareBasicCode": null,
                    "fareCode": null,
                    "flightDirection": "D",
                    "flightNumber": "156",
                    "infantBaggage": null,
                    "journeyDuration": 130,
                    "marketingAirlineCode": "VJ",
                    "marriageGroup": null,
                    "mealCode": null,
                    "operatingAirline": {
                        "code": "VJ",
                        "equipment": null,
                        "flightNumber": "156",
                        "name": "VietJet Air"
                    },
                    "resBookDesignCode": "Z1_ECO",
                    "seatsRemaining": null,
                    "stopQuantity": 0,
                    "stopQuantityInfo": null,
                    "supplierFareKey": null,
                    "supplierJourneyKey": "qPHglSL8tSGƒ3tYhxs32unUB07y8mK5BDYQX2BnPQJuYvXBionML¥MStNiƒK98yyAOIpSQgCYƒdoFP¥a2VnwgUPQJAmkk89BX1s9VLDde6FRhlAFf34qJAHS3DNEEwbaCBRcmqPevNTjFuizmUVPBSKBj6HlNSuyrpPZEREJgN8ThsfKqQnB6zAkEhnwV0rNNPzwWYQqRMFAZYiXy5p0roZGgAxbnU6itFQzVmWzpƒƒd1GUseZ6vDwLWRqbO2lnJcw7qbRbSƒ9Lw0btZKtBHz2zAUgpGG97MNdAf1xN2g2cFSƒxTc7lrjWfIJsC53YbqXvqMhzgmUSDj¥B5dxg4bloOeLI5¥YWAlkIGawk57IcgpyzGprHK5Pn3Bv2CR4sMsg7ey0Z5eGFvalCScS72idlrgHBzOYnbwZ21mkGjsXVus¥ƒoEJSpWVB3meJug14SIGSd88mzGXtT4ƒQg1Tam4wvySRzi9gO4QGGXpcbBF4ƒs="
                    }
                ],
                "journeyDuration": 130,
                "originCity": "Hồ Chí Minh",
                "originDateTime": "2021-07-21T19:35:00.000Z",
                "originLocationCode": "SGN",
                "originLocationName": "Sân bay Tân Sơn Nhất"
                }
            ],
            "passportMandatory": true,
            "refundable": false,
            "sequenceNumber": "ibe3541984955292126",
            "ticketType": "ETICKET",
            "validReturnCabinClasses": null,
            "validatingAirlineCode": "VJ",
            "validatingAirlineName": "VietJet Air"
            }
        ],
        "requiredFields": null,
        "returnDateTime": null,
        "roundType": "ROUNDTRIP",
        "totalPricedItinerary": 3
        }
    ],
    "infos": null,
    "page": {
        "nextPageNumber": 1,
        "offset": 15,
        "pageNumber": 0,
        "previousPageNumber": -1,
        "totalElements": 57,
        "totalPage": 4
    },
    "searchId": "ATD::210706::519f4508-b6df-4d96-8d43-538c96a0d90b",
    "success": true,
    "textMessage": null
}
```

***

### Get filter list information API <a href="#get-filter-list-information-api" id="get-filter-list-information-api"></a>

POST: /api/air-tickets/filter-options

Get a list of values that can be applied on the filter on the search results

#### Request Body <a href="#request-body" id="request-body"></a>

| Parameter                                       | Description                                                                                                        |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| searchId (String, Required)                     | <p>Data used to refer to search results<br>This data is taken from the return results of airline ticket search</p> |
| departureItinerary (AirItineraryInfo, Optional) | Outbound ticket information in case of getting filter-options for return ticket                                    |
| airlineCode (String, Required)                  | <p>VN: Vietnam Airlines<br>VJ: VietJet<br>QH: Bamboo<br>BL: Pacific Airlines…</p>                                  |
| groupId (String, Required)                      | Journey identifier in the list of journeys returned by search results                                              |
| fareSourceCode (String, Required)               | Journey identifier information                                                                                     |
| supplierCode (String, Required)                 | The company code is also provided                                                                                  |
| searchId (String, Required)                     | Data used to refer to search results                                                                               |

**Example**

```json
{
    "searchId": "ATD::210707::01a59301-d1f7-4302-954a-7047ee06e001-R",
    "departureItinerary": {
        "groupId": "01e650b9-2771-48cb-80fa-3004d0bd9eef",
        "airlineCode": "VN",
        "fareSourceCode": "dom5fb76509-3ac6-4c7b-baaa-b1ea844e3d7e",
        "supplierCode": "VN",
        "searchId": "ATD::210707::01a59301-d1f7-4302-954a-7047ee06e001"
    }
}
```

#### Response <a href="#response_2" id="response_2"></a>

| Parameter                                    | Description                                                                                     |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| searchId(String, Required)                   | The reference code to the search for air tickets, taken from the search results for air tickets |
| itineraryFilter (ItineraryFilter, Required)  | Information representing applicable values on search filter results                             |
| airlineOptions (Array\[String], Optional)    | Information showing airlines with the lowest fares                                              |
| cabinClassOptions (Array\[String], Optional) | Information showing current seat class                                                          |
| stopOptions (Array\[String], Optional)       | Information showing current stop                                                                |
| filterToPrice (Double, Optional)             | Information showing the current highest ticket price                                            |
| filterFromPrice (Double, Optional)           | Information showing the current lowest fares                                                    |
| duration (Integer, Optional),                |                                                                                                 |
| errors (Array\[Error], Optional),            |                                                                                                 |
| infos (Array\[Info], Optional),              |                                                                                                 |
| success (Boolean, Optional),                 |                                                                                                 |
| textMessage (String, Optional)               |                                                                                                 |

**Example**

```json
{
    "isSuccess" : true,
    "duration" : 1131,
    "textMessage" : null,
    "errors" : null,
    "infos" : null,
    "searchId" : "ATD::210707::01a59301-d1f7-4302-954a-7047ee06e001-R",
    "itineraryFilter" : {
        "airlineOptions" : [ "VJ:VietJet Air:657900.0", "QH:Bamboo Airways:1461000.0", "BL:Pacific Airlines:2054000.0", "VN:Vietnam Airlines:2164000.0" ],
        "arrivalDateTimeOptions" : null,
        "arrivalDateTimeReturnOptions" : null,
        "cabinClassOptions" : [ "ECONOMY", "PREMIUM", "BUSINESS" ],
        "departureDateTimeOptions" : null,
        "departureDateTimeReturnOptions" : null,
        "flightType" : null,
        "groupId" : null,
        "loadMore" : null,
        "minPrice" : null,
        "filterToPrice" : 5202000.0,
        "filterFromPrice" : 657900.0,
        "priceItineraryId" : null,
        "step" : null,
        "stopOptions" : [ "1" ],
        "ticketPolicyOptions" : null
    },
    "success" : true
}
```

### Filter/sort flight search results API <a href="#filtersort-flight-search-results-api" id="filtersort-flight-search-results-api"></a>

POST: /api/air-tickets/filter-availability

Filter and sort flight search results

#### Paramaters <a href="#paramaters" id="paramaters"></a>

| Parameter                             | Description                                                                                                                   |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| include-equivfare (Boolean, Optional) | Request to pay more ticketing fee information                                                                                 |
| page (Integer, Optional)              | Number of pages you want to get results (eg: 0)                                                                               |
| size (Integer, Optional)              | Number of results you want to get in 1 page (eg: 20)                                                                          |
| sort(String, Optional)                | Sort the results by the value of the returned property ascending or descending (eg: propertiesName,desc / propertiesName,asc) |

**Example**

?include-equivfare=`false`\&page=`0`\&size=`20`\&sort=`departureDate,asc`

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

| Parameter                                               | Description                                                                                                                                                                      |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| searchId(String, Required)                              | <p>Data used to refer to search results<br>This data is taken from the return results of airline ticket search</p>                                                               |
| departureItinerary (AirItineraryInfo, Optional)         | Outbound ticket information in case of getting filter-availability for return ticket                                                                                             |
| airlineCode (String, Required)                          | <p>VN: Vietnam Airlines<br>VJ: VietJet<br>QH: Bamboo<br>BL: Pacific Airlines…</p>                                                                                                |
| groupId(String, Optional)                               | Journey identifier in the list of journeys returned by search results                                                                                                            |
| fareSourceCode(String, Required)                        | Journey identifier information                                                                                                                                                   |
| supplierCode(String, Required)                          | The company code is also provided                                                                                                                                                |
| searchId(String, Required)                              | Data used to refer to search results                                                                                                                                             |
| filter (ItineraryFilter, Required)                      | Used to input the desired filtering and sorting criteria                                                                                                                         |
| cabinClassOptions(Array\[String], Optional)             | Information about the seat class you want to filter and sort                                                                                                                     |
| step(String, Required)                                  | <p>Information used to distinguish between departure and return<br>1: Departure direction<br>2: Return direction</p>                                                             |
| flightType(String, Required)                            | <p>Flight type information<br>DOMESTIC: domestic<br>INTERNATIONAL: international</p>                                                                                             |
| stopOption(Array\[String], Optional)                    | Stop Information                                                                                                                                                                 |
| airlineOptions(Array\[String], Optional)                | Airline information                                                                                                                                                              |
| departureDateTimeOptions (Array\[String], Optional)     | <p>Information about departure time starts at around or at what time<br>Ex: departureDateTimeOptions: \[“+18”, “+12-18”]<br>+18: from 18h to 24h<br>+12-18: from 12pm to 6pm</p> |
| arrivalDateTimeReturnOptions (Array\[String], Optional) | <p>The end time information starts at what time or interval<br>Ex: arrivalDateTimeReturnOptions: \[“+18”, “+12-18”]<br>+18: from 18h to 24h<br>+12-18: from 12pm to 6pm</p>      |

**Example**

```json
    {
        "searchId": "ATD::210707::01a59301-d1f7-4302-954a-7047ee06e001",
        "filter": {
            "cabinClassOptions": [],
            "ticketPolicyOptions": [],
            "airlineOptions": [],
            "stopOptions": [],
            "step": "1",
            "flightType": "DOMESTIC",
            "departureDateTimeOptions": [],
            "arrivalDateTimeReturnOptions": [],
            "arrivalDateTimeOptions": [],
            "priceItineraryId": "",
            "loadMore": false,
            "departureDateTimeReturnOptions": []
        },
        "departureItinerary": null
    }
```

#### Response <a href="#response_3" id="response_3"></a>

#### Model <a href="#model" id="model"></a>

| Parameter                                                            | Description                                                                                                                                      |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| searchId(String, Required)                                           | The reference code to the search for air tickets, taken from the search results for air tickets                                                  |
| groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)   | Information about the list of journeys returned by search results                                                                                |
| airSupplier(String, Required)                                        | Carriers (VietnamAirline - VNA, VjetJet - VJ, BamBoo - QH, …)                                                                                    |
| aircraft (String, Optional)                                          | Type of aircraft (Airbus A330, Boeing 787, .....)                                                                                                |
| airline (String, Optional)                                           | Airlines (VJ, VNA, …)                                                                                                                            |
| airlineName (String, Optional)                                       | Name of airline (Vietjet Air, Vietnam Airlines, Bamboo, …)                                                                                       |
| arrivalDateTime (String, Required)                                   | Arrival date and time, using UTC/GMT+7 time zone                                                                                                 |
| departureDateTime (String, Required)                                 | Split flight time, using UTC/GMT+7 time zone                                                                                                     |
| destinationLocationCode (String, Optional)                           | Flight end city code                                                                                                                             |
| destinationCountry (String, Optional)                                | The name of the country where the flight ended                                                                                                   |
| destinationCountryCode (String, Optional)                            | Flight end country code                                                                                                                          |
| destinationCity (String, Optional)                                   | The name of the city where the flight ends                                                                                                       |
| destinationLocationName (String, Optional)                           | Airport name where the flight ends                                                                                                               |
| flightNo (String, Optional)                                          | Airplane number                                                                                                                                  |
| flightNo (String, Optional)                                          | Airplane number                                                                                                                                  |
| flightType (String, Optional)                                        | <p>Type of flight domestic or international? Flight type:<br>DOMESTIC: domestic<br>INTERNATIONAL: international</p>                              |
| groupId(String, Required)                                            | Journey identifier in the list of journeys returned by search results                                                                            |
| originCity(String, Optional)                                         | City name at departure point                                                                                                                     |
| originCountry(String, Optional)                                      | Country name at departure point                                                                                                                  |
| originCountryCode(String, Optional)                                  | Country code at departure point                                                                                                                  |
| originLocationCode(String, Optional)                                 | Flight departure city code                                                                                                                       |
| originLocationName(String, Optional)                                 | Airport name at departure point                                                                                                                  |
| totalPricedItinerary (Integer, Required)                             | Total number of detailed journeys                                                                                                                |
| pricedItineraries (Array\[PricedItineraries], Required)              | Itinerary details                                                                                                                                |
| airItineraryPricingInfo (AirItineraryPricingInfo, Required)          | Detailed price information of the itinerary                                                                                                      |
| adultFare (FareBreakdown, Required)                                  |                                                                                                                                                  |
| passengerFare (PassengerFare, Required)                              | Adult fare information                                                                                                                           |
| baseFare(FareInfo, required)                                         | Basic fare information                                                                                                                           |
| amount (Double, Required)                                            | Amount of money                                                                                                                                  |
| decimalPlaces(Integer, Optional)                                     | Decimal places rounded to                                                                                                                        |
| equivFare (FareInfo, Optional)                                       | <p>Similar to baseFare<br>Ticketing fee information</p>                                                                                          |
| serviceTax (FareInfo, Required)                                      | <p>Similar to baseFare<br>Service fee information</p>                                                                                            |
| totalFare (FareInfo, Required)                                       | <p>Similar to baseFare<br>Total ticket price information</p>                                                                                     |
| surcharges (Array\[Surcharge], Required)                             | Information about surcharges per booking / per segment                                                                                           |
| passengerTypeQuantities (PassengerTypeQuantities, Optional)          | Number/type of passengers                                                                                                                        |
| code(String, Required)                                               | <p>Adult/Child/Infant Identifier<br>Includes: ADT - adult / CHD - child / INF - infant</p>                                                       |
| quantity (Integer, Required)                                         | Number of adults / children / infants                                                                                                            |
| childFare(PassengerFare, Optional)                                   | <p>Child fare information<br>Similar to adult fare information</p>                                                                               |
| infantFare (PassengerFare, Optional)                                 | <p>Infant fare information<br>Similar to adult fare information</p>                                                                              |
| itinTotalFare (PassengerFare, Required)                              | <p>Total fare information of the journey<br>Similar to adult fare information</p>                                                                |
| fareSourceCode(String, Required)                                     | <p>Journey identifier information<br>Used to get ticket condition information</p>                                                                |
| allowHold (Boolean, Required)                                        | Information to allow to hold a reservation or not                                                                                                |
| cabinClassName(String, Required)                                     | <p>Seat class information:<br>ECONOMY - universal seat<br>PREMIUM - special economy seat<br>BUSINESS - business chair</p>                        |
| fightNo(String, Optional)                                            | Displays aircraft number information                                                                                                             |
| originDestinationOptions (Array(OriginDestinationOptions), Required) | Cruise’s blocking/stopping information                                                                                                           |
| flightDirection(String, Required)                                    | <p>Show flight direction information of the journey<br>D - departure direction<br>R - return direction</p>                                       |
| journeyDuration (Integer, Required)                                  | Show flight time                                                                                                                                 |
| flightSegments (Array(FlightSegments), Required)                     | Show detailed information of departure / end points in the journey                                                                               |
| page (AirPage, Required)                                             | <p>Object that describes information about pagination.<br>Sequence number of each page returned, element of each page, total number of pages</p> |
| duration(Integer, Optional),                                         |                                                                                                                                                  |
| errors (Array\[Error], Optional)                                     |                                                                                                                                                  |
| infos(Array\[Info], Optional)                                        |                                                                                                                                                  |
| success(Boolean, Optional)                                           |                                                                                                                                                  |
| textMessage(String, Optional)                                        |                                                                                                                                                  |

**Example**

```
{
    "searchId": "ATD::210707::1f5e34da-24d5-46bf-993e-8cda8d716d15",
    "duration": 1034,
    "errors": null,
    "groupPricedItineraries": [
        {
        "airSupplier": "VN",
        "aircraft": "Airbus A321",
        "vnaArea": "NorthTrip",
        "airline": "VN",
        "airlineName": "Vietnam Airlines",
        "arrivalDateTime": "2021-07-23T07:15:00.000Z",
        "departureDateTime": "2021-07-23T05:00:00.000Z",
        "destinationCity": "Hồ Chí Minh",
        "destinationCountry": "Vietnam",
        "destinationCountryCode": "VN",
        "destinationLocationCode": "SGN",
        "destinationLocationName": "Sân bay Tân Sơn Nhất",
        "fightNo": "205",
        "flightType": "DOMESTIC",
        "groupId": "8527f1e5-5291-42cf-8b76-c6874889b6c6",
        "originCity": "Hà Nội",
        "originCountry": "Vietnam",
        "originCountryCode": "VN",
        "originLocationCode": "HAN",
        "originLocationName": "Sân bay Nội Bài",
        "pricedItineraries": [
            {
            "airItineraryPricingInfo": {
                "adultFare": {
                "fareBasisCodes": null,
                "passengerFare": {
                    "baseFare": {
                    "amount": 2739000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                    },
                    "comboMarkup": null,
                    "equivFare": null,
                    "serviceTax": {
                    "amount": 844000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                    },
                    "surcharges": [
                    {
                        "amount": 0,
                        "indicator": "Ticket fee per segment",
                        "type": "Ticket fee per segment"
                    }
                    ],
                    "taxes": null,
                    "totalFare": {
                    "amount": 3583000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                    },
                    "totalPaxFee": null
                },
                "passengerTypeQuantities": {
                    "code": "ADT",
                    "quantity": 1
                }
                },
                "childFare": null,
                "divideInPartyIndicator": false,
                "fareInfoReferences": null,
                "fareSourceCode": "dom2ac8e775-85a1-4a3a-a945-7c2e8eee905e",
                "fareType": "PUBLIC",
                "infantFare": null,
                "itinTotalFare": {
                "baseFare": {
                    "amount": 2739000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                },
                "comboMarkup": null,
                "equivFare": null,
                "serviceTax": {
                    "amount": 844000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                },
                "totalFare": {
                    "amount": 3583000,
                    "currencyCode": null,
                    "decimalPlaces": 2
                },
                "totalPaxFee": null,
                "totalTax": {
                    "amount": 0,
                    "currencyCode": null,
                    "decimalPlaces": 2
                }
                }
            },
            "allowHold": true,
            "baggageItems": [
                {
                "amount": 0,
                "code": "air-tickets.baggage-items.vn.adult-child.12kg-1x23kg.free",
                "direction": null,
                "fareCode": null,
                "id": "air-tickets.baggage-items.vn.adult-child.12kg-1x23kg.free",
                "name": "Xách tay 12kg + Ký gửi 1x23kg",
                "serviceType": "BAGGAGE"
                }
            ],
            "cabinClassName": "ECONOMY",
            "directionInd": "DEPARTURE",
            "fightNo": "205",
            "mealItems": null,
            "onlyPayLater": false,
            "originDestinationOptions": [
                {
                "cabinClassName": "ECONOMY",
                "destinationCity": "Hồ Chí Minh",
                "destinationDateTime": "2021-07-23T07:15:00.000Z",
                "destinationLocationCode": "SGN",
                "destinationLocationName": "Sân bay Tân Sơn Nhất",
                "flightDirection": "D",
                "flightSegments": [
                    {
                    "adultBaggage": null,
                    "aircraft": "Airbus A321",
                    "arrivalAirportLocationCode": "SGN",
                    "arrivalAirportLocationName": "Sân bay Tân Sơn Nhất",
                    "arrivalCity": "Hồ Chí Minh",
                    "arrivalDateTime": "2021-07-23T07:15:00.000Z",
                    "cabinClassCode": "M",
                    "cabinClassName": "ECONOMY",
                    "cabinClassText": "Economy Flex",
                    "childBaggage": null,
                    "departureAirportLocationCode": "HAN",
                    "departureAirportLocationName": "Sân bay Nội Bài",
                    "departureCity": "Hà Nội",
                    "departureDateTime": "2021-07-23T05:00:00.000Z",
                    "eticket": true,
                    "fareBasicCode": null,
                    "fareCode": null,
                    "flightDirection": "D",
                    "flightNumber": "205",
                    "infantBaggage": null,
                    "journeyDuration": 135,
                    "marketingAirlineCode": "VN",
                    "marriageGroup": null,
                    "mealCode": null,
                    "operatingAirline": {
                        "code": "VN",
                        "equipment": null,
                        "flightNumber": "205",
                        "name": "Vietnam Airlines"
                    },
                    "resBookDesignCode": "M",
                    "seatsRemaining": null,
                    "stopQuantity": 0,
                    "stopQuantityInfo": null,
                    "supplierFareKey": null,
                    "supplierJourneyKey": "b+T7Lz8Bk6JHev8ZaYn6JdksP71z9ZD2metfP5B9ooYsM9jko+XIuxjgA14ghnjgUaj450N5VDUtJjP9AGhuOW+4XTufOS5VZDXm0TvXcwMXZzjJrTD4yzKE2HcSkpV2GU4fA4JI8HBo2DdLJAOlMuSGTpcN0/ylBtnM8MWr9faFvtwUUNLcIEma87mvAT2djGS7D2B65bkfIudjgUgMzxbClvY862C1Fkqt6J1iU8QvNRJygV+tIM581jkWISXEqEBWynub65QcCSh37U/HZ7vCCNWM0CbjqbnEJDbIFDJMWEPs/reBsAdLJ1oQVj/XMMOfVyWYykSzqBjrSxEbjlC2kfUf/qcH2a+VjzSftFZ4xgxv9BVcyjEvt6nfFl9eNxB0u2sH6O6Jr+V4yhqo8MHUvHs61leE3ihqaZr2WOW0tagXPQjFe/IRySSO/gsZvNE8SnbYsjkmvY0YDSdfgzGbkxJQVHTcIztxg1JG5c0MlwrGdbVINsLXyL9s5TOANlBpNtr9ArzEcr2/M7lZy4PjAlRZqPhyAl6dK4cR1gZaz/P+LivHga86vjAGHUcMqbZsicH4D44YFGqjeYKbhTmudhnn5KWfWJcR+ES9bumTSt+dw5VYbIybf83v3nGVuiAe30K2Jmuc58pHcTlxSbUMaevMbegAHSVUreKGVI9Rzh69kmTuVo3uFsEeAgMKIGPXSuHX0T6SY0wFXhEPk9xpFbMEs3fHicGr5KwZGGQHXZyCzD2BcWJhFCfWvTBwzL517DWLdUl7I4ac9b9DrGu1hUkt0Tr1999yumGvley4csmh5p/BiJJryCF7/igdMlBV8oXwHiWF8zfscyHfodL4xYL+jWseqE00zGfgKUvRY8kMyOtxfR0yEWP3sJjQ9AXfMjpTdCCIpulJfwAkY9pgvipjnwN4P2URX7Vfk+dvm0lAOo8QtEqupcQNeUaNv/H0jO1OHwpdUFRzUzALfJycZXI0aq0gBPNrz+4VWUF4EXXss1DJRVLBO4Z1SLNW+yxrB3uK3g9QDbkKfcsmvdGd/5LA9NuSSqXqzD5O92kn0TtDH5Ne4IuN2B8/6UqJWz5VNUVeT+ph1k24Uv9/iotAuUYfvsqosCb2BvokHpa4rIvDLTLAsmC5f1WeMsY8Ydnwf2e0cmZLXPVwQcKDE3zP8PnI91Fd+oL5Zx7+sdGa4QFs8dtV9y2hgYarchiugXf5tcIzDdDOm7FnBj8/Y64D7ZuSZCu16w7VvBEjHcuJwIf/Z/OhKKTv50JKU8a5RNcD3/7CCCrIvtxOK8F57arqMPJHtOXkD7dtns4NpRaghfCGX6OphkRNdJxzzx2KQzo39Lj4xEaWqwYD/3FRJiRap+5WGLonTpOIlN5ryMLLyL59lXSa7ZvfuAipLvm5TrmBlVt7FHvVj/BZ/PmpLUSTNg25tw+hJVpXCGOn+4EI7AH0Ph0SuVGKv8dnEM0P/mFWnSjpKNUb6mmm3ippgIjQwonVKbnhO3eDF9F7Ll0="
                    }
                ],
                "journeyDuration": 135,
                "originCity": "Hà Nội",
                "originDateTime": "2021-07-23T05:00:00.000Z",
                "originLocationCode": "HAN",
                "originLocationName": "Sân bay Nội Bài"
                }
            ],
            "passportMandatory": true,
            "refundable": false,
            "sequenceNumber": "ibe3638861560249232",
            "ticketType": "ETICKET",
            "validReturnCabinClasses": null,
            "validatingAirlineCode": "VN",
            "validatingAirlineName": "Vietnam Airlines"
            }
        ],
        "requiredFields": null,
        "returnDateTime": null,
        "roundType": "ROUNDTRIP",
        "totalPricedItinerary": 1
        }
    ],
    "infos": null,
    "page": {
        "nextPageNumber": 1,
        "offset": 15,
        "pageNumber": 0,
        "previousPageNumber": -1,
        "totalElements": 67,
        "totalPage": 5
    },
    "success": true,
    "textMessage": null
}
```

***

### Get the list of tickets open for sale on a flight API <a href="#get-the-list-of-tickets-open-for-sale-on-a-flight-api" id="get-the-list-of-tickets-open-for-sale-on-a-flight-api"></a>

POST: /api/air-tickets/group-itinerary/{id}

Get a list of tickets available for sale on a specific flight

#### Paramaters <a href="#paramaters_1" id="paramaters_1"></a>

| Parameter                             | Description                                                                                                                   |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| id path (String, Required)            | Used to refer to the list of tickets available for sale on a flight                                                           |
| include-equivfare (Boolean, Optional) | Request to pay more ticketing fee information                                                                                 |
| page (Integer, Optional)              | Number of pages you want to get results (eg: 0)                                                                               |
| size (Integer, Optional)              | Number of results you want to get in 1 page (eg 20)                                                                           |
| sort (String, Optional)               | Sort the results by the value of the returned property ascending or descending (eg: propertiesName,desc / propertiesName,asc) |

**Example**

```
052a9f35-12eb-430b-baa0-7ea85a98e8b3?include-equivfare=false&page=0&size=20&sort=departureDate,asc
```

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

#### Parameter <a href="#parameter_2" id="parameter_2"></a>

| Parameter                                               | Description                                                                                                                                                                      |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| searchId(String, Required)                              | <p>Data used to refer to search results<br>This data is taken from the return results of airline ticket search</p>                                                               |
| departureItinerary (AirItineraryInfo, Optional)         | Outbound ticket information in case of getting filter-availability for return ticket                                                                                             |
| airlineCode(String, Required)                           | <p>VN: Vietnam Airlines<br>VJ: VietJet<br>QH: Bamboo<br>BL: Pacific Airlines…</p>                                                                                                |
| groupId(String, Optional)                               | Journey identifier in the list of journeys returned by search results                                                                                                            |
| fareSourceCode(String, Required)                        | Journey identifier information                                                                                                                                                   |
| supplierCode(String, Required)                          | The company code is also provided                                                                                                                                                |
| searchId(String, Required)                              | Data used to refer to search results                                                                                                                                             |
| filter (ItineraryFilter, Required)                      | Used to input the desired filtering and sorting criteria                                                                                                                         |
| cabinClassOptions(Array\[String], Optional)             | Information about the seat class you want to filter and sort                                                                                                                     |
| step(String, Required)                                  | <p>Information used to distinguish between departure and return<br>1: Departure direction<br>2: Return direction</p>                                                             |
| flightType(String, Required)                            | <p>Flight type information<br>DOMESTIC: domestic<br>INTERNATIONAL: international</p>                                                                                             |
| stopOption(Array\[String], Optional)                    | Stop Information                                                                                                                                                                 |
| airlineOptions(Array\[String], Optional)                | Airline information                                                                                                                                                              |
| departureDateTimeOptions (Array\[String], Optional)     | <p>Information about departure time starts at around or at what time<br>Ex: departureDateTimeOptions: \[“+18”, “+12-18”]<br>+18: from 18h to 24h<br>+12-18: from 12pm to 6pm</p> |
| arrivalDateTimeReturnOptions (Array\[String], Optional) | <p>The end time information starts at what time or interval<br>Ex: arrivalDateTimeReturnOptions: \[“+18”, “+12-18”]<br>+18: from 18h to 24h<br>+12-18: from 12pm to 6pm</p>      |
| groupId(String, Required)                               | Itinerary identifier in the itinerary list retrieved from the search results                                                                                                     |

**Example**

```json
    {
        "searchId": "ATD::210707::66c84a6f-fa81-4526-a2d9-2f7b7975214b",
        "departureItinerary": null,
        "filter": {
            "stopOptions": [],
            "airlineOptions": [],
            "cabinClassOptions": [],
            "ticketPolicyOptions": [],
            "departureDateTimeOptions": [],
            "arrivalDateTimeOptions": [],
            "departureDateTimeReturnOptions": [],
            "arrivalDateTimeReturnOptions": [],
            "flightType": "DOMESTIC",
            "groupId": "052a9f35-12eb-430b-baa0-7ea85a98e8b3",
            "loadMore": true,
            "step": "1"
        }
    }
```

#### Response <a href="#response_4" id="response_4"></a>

| Parameter                                                            | Description                                                                                                                                      |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| searchId(String, Required)                                           | The reference code to the search for air tickets, taken from the search results for air tickets                                                  |
| groupPricedItineraries (Array\[GroupPricedItineraryDTO], Optional)   | Information about the list of journeys returned by search results                                                                                |
| airSupplier(String, Required)                                        | Carriers (VietnamAirline - VNA, VjetJet - VJ, BamBoo - QH, …)                                                                                    |
| aircraft (String, Optional)                                          | Type of aircraft (Airbus A330, Boeing 787, .....)                                                                                                |
| airline(String, Optional)                                            | Airlines (VJ, VNA, …)                                                                                                                            |
| airlineName(String, Optional)                                        | Name of airline (Vietjet Air, Vietnam Airlines, Bamboo, …)                                                                                       |
| arrivalDateTime(String, Required)                                    | Arrival date and time, using UTC/GMT+7 time zone                                                                                                 |
| departureDateTime (String, Required)                                 | Split flight time, using UTC/GMT+7 time zone                                                                                                     |
| destinationLocationCode (String, Optional)                           | Flight end city code                                                                                                                             |
| destinationCountry(String, Optional)                                 | The name of the country where the flight ended                                                                                                   |
| destinationCountryCode (String, Optional)                            | Flight end country code                                                                                                                          |
| destinationCity(String, Optional)                                    | The name of the city where the flight ends                                                                                                       |
| destinationLocationName (String, Optional)                           | Airport name where the flight ends                                                                                                               |
| flightNo(String, Optional)                                           | Airplane number                                                                                                                                  |
| flightNo(String, Optional)                                           | Airplane number                                                                                                                                  |
| flightType(String, Optional)                                         | <p>Type of flight domestic or international? Flight type:<br>DOMESTIC: domestic<br>INTERNATIONAL: international</p>                              |
| groupId(String, Required)                                            | Journey identifier in the list of journeys returned by search results                                                                            |
| originCity(String, Optional)                                         | City name at departure point                                                                                                                     |
| originCountry(String, Optional)                                      | Country name at departure point                                                                                                                  |
| originCountryCode(String, Optional)                                  | Country code at departure point                                                                                                                  |
| originLocationCode(String, Optional)                                 | Flight departure city code                                                                                                                       |
| originLocationName(String, Optional)                                 | Airport name at departure point                                                                                                                  |
| totalPricedItinerary (Integer, Required)                             | Total number of detailed journeys                                                                                                                |
| pricedItineraries (Array\[PricedItineraries], Required)              | Itinerary details                                                                                                                                |
| airItineraryPricingInfo (AirItineraryPricingInfo, Required)          | Detailed price information of the itinerary                                                                                                      |
| adultFare (FareBreakdown, Required)                                  |                                                                                                                                                  |
| passengerFare (PassengerFare, Required)                              | Adult fare information                                                                                                                           |
| baseFare(FareInfo, required)                                         | Basic fare information                                                                                                                           |
| amount (Double, Required)                                            | Amount of money                                                                                                                                  |
| decimalPlaces(Integer, Optional)                                     | Decimal places rounded to                                                                                                                        |
| equivFare (FareInfo, Optional)                                       | <p>Similar to baseFare<br>Ticketing fee information</p>                                                                                          |
| serviceTax (FareInfo, Required)                                      | <p>Similar to baseFare<br>Service fee information</p>                                                                                            |
| totalFare (FareInfo, Required)                                       | <p>Similar to baseFare<br>Total ticket price information</p>                                                                                     |
| surcharges (Array\[Surcharge], Required)                             | Information about surcharges per booking / per segment                                                                                           |
| passengerTypeQuantities (PassengerTypeQuantities, Optional)          | Number/type of passengers                                                                                                                        |
| code(String, Required)                                               | <p>Adult/Child/Infant Identifier<br>Includes: ADT - adult / CHD - child / INF - infant</p>                                                       |
| quantity (Integer, Required)                                         | Number of adults / children / infants                                                                                                            |
| childFare(PassengerFare, Optional)                                   | <p>Child fare information<br>Similar to adult fare information</p>                                                                               |
| infantFare (PassengerFare, Optional)                                 | <p>Infant fare information<br>Similar to adult fare information</p>                                                                              |
| itinTotalFare (PassengerFare, Required)                              | <p>Total fare information of the journey<br>Similar to adult fare information</p>                                                                |
| fareSourceCode(String, Required)                                     | <p>Journey identifier information<br>Used to get ticket condition information</p>                                                                |
| allowHold (Boolean, Required)                                        | Information to allow to hold a reservation or not                                                                                                |
| cabinClassName(String, Required)                                     | <p>Seat class information:<br>ECONOMY - universal seat<br>PREMIUM - special economy seat<br>BUSINESS - business chair</p>                        |
| fightNo(String, Optional)                                            | Displays aircraft number information                                                                                                             |
| originDestinationOptions (Array(OriginDestinationOptions), Required) | Cruise’s blocking/stopping information                                                                                                           |
| flightDirection(String, Required)                                    | <p>Show flight direction information of the journey<br>D - departure direction<br>R - return direction</p>                                       |
| journeyDuration (Integer, Required)                                  | Show flight time                                                                                                                                 |
| flightSegments (Array(FlightSegments), Required)                     | Show detailed information of departure / end points in the journey                                                                               |
| page (AirPage, Required)                                             | <p>Object that describes information about pagination.<br>Sequence number of each page returned, element of each page, total number of pages</p> |
| duration(Integer, Optional),                                         |                                                                                                                                                  |
| errors (Array\[Error], Optional)                                     |                                                                                                                                                  |
| infos(Array\[Info], Optional)                                        |                                                                                                                                                  |
| success(Boolean, Optional)                                           |                                                                                                                                                  |
| textMessage(String, Optional)                                        |                                                                                                                                                  |

**Example**

```json
{
    "duration" : 1025,
    "errors" : null,
    "groupPricedItinerary" : {
        "airSupplier" : "VJ",
        "aircraft" : "Airbus A321",
        "vnaArea" : null,
        "airline" : "VJ",
        "airlineName" : "VietJet Air",
        "arrivalDateTime" : "2021-07-23T07:20:00.000Z",
        "departureDateTime" : "2021-07-23T05:10:00.000Z",
        "destinationCity" : "Hồ Chí Minh",
        "destinationCountry" : "Vietnam",
        "destinationCountryCode" : "VN",
        "destinationLocationCode" : "SGN",
        "destinationLocationName" : "Sân bay Tân Sơn Nhất",
        "fightNo" : "135",
        "flightType" : "DOMESTIC",
        "groupId" : "052a9f35-12eb-430b-baa0-7ea85a98e8b3",
        "originCity" : "Hà Nội",
        "originCountry" : "Vietnam",
        "originCountryCode" : "VN",
        "originLocationCode" : "HAN",
        "originLocationName" : "Sân bay Nội Bài",
        "pricedItineraries" : [ {
        "airItineraryPricingInfo" : {
            "adultFare" : {
            "fareBasisCodes" : null,
            "passengerFare" : {
                "baseFare" : {
                "amount" : 1319000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "comboMarkup" : null,
                "equivFare" : null,
                "serviceTax" : {
                "amount" : 350900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "surcharges" : [ {
                "amount" : 0.0,
                "indicator" : "Ticket fee per segment",
                "type" : "Ticket fee per segment"
                } ],
                "taxes" : null,
                "totalFare" : {
                "amount" : 1669900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "totalPaxFee" : null
            },
            "passengerTypeQuantities" : {
                "code" : "ADT",
                "quantity" : 1
            }
            },
            "childFare" : null,
            "divideInPartyIndicator" : false,
            "fareInfoReferences" : null,
            "fareSourceCode" : "dom95053f40-3fd0-4f62-a96c-d4afa489c283",
            "fareType" : "PUBLIC",
            "infantFare" : null,
            "itinTotalFare" : {
            "baseFare" : {
                "amount" : 1319000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "comboMarkup" : null,
            "equivFare" : null,
            "serviceTax" : {
                "amount" : 350900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "totalFare" : {
                "amount" : 1669900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "totalPaxFee" : null,
            "totalTax" : {
                "amount" : 0.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            }
            }
        },
        "allowHold" : true,
        "baggageItems" : [ {
            "amount" : 0.0,
            "code" : "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
            "direction" : null,
            "fareCode" : null,
            "id" : "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
            "name" : "7kg xách tay",
            "serviceType" : "BAGGAGE"
        } ],
        "cabinClassName" : "ECONOMY",
        "directionInd" : "DEPARTURE",
        "fightNo" : "135",
        "mealItems" : null,
        "onlyPayLater" : false,
        "originDestinationOptions" : [ {
            "cabinClassName" : "ECONOMY",
            "destinationCity" : "Hồ Chí Minh",
            "destinationDateTime" : "2021-07-23T07:20:00.000Z",
            "destinationLocationCode" : "SGN",
            "destinationLocationName" : "Sân bay Tân Sơn Nhất",
            "flightDirection" : "D",
            "flightSegments" : [ {
            "adultBaggage" : null,
            "aircraft" : "Airbus A321",
            "arrivalAirportLocationCode" : "SGN",
            "arrivalAirportLocationName" : "Sân bay Tân Sơn Nhất",
            "arrivalCity" : "Hồ Chí Minh",
            "arrivalDateTime" : "2021-07-23T07:20:00.000Z",
            "cabinClassCode" : "L1_ECO",
            "cabinClassName" : "ECONOMY",
            "cabinClassText" : "Economy",
            "childBaggage" : null,
            "departureAirportLocationCode" : "HAN",
            "departureAirportLocationName" : "Sân bay Nội Bài",
            "departureCity" : "Hà Nội",
            "departureDateTime" : "2021-07-23T05:10:00.000Z",
            "eticket" : true,
            "fareBasicCode" : null,
            "fareCode" : null,
            "flightDirection" : "D",
            "flightNumber" : "135",
            "infantBaggage" : null,
            "journeyDuration" : 130,
            "marketingAirlineCode" : "VJ",
            "marriageGroup" : null,
            "mealCode" : null,
            "operatingAirline" : {
                "code" : "VJ",
                "equipment" : null,
                "flightNumber" : "135",
                "name" : "VietJet Air"
            },
            "resBookDesignCode" : "L1_ECO",
            "seatsRemaining" : null,
            "stopQuantity" : 0,
            "stopQuantityInfo" : null,
            "supplierFareKey" : null,
            "supplierJourneyKey" : "FE1G3mI6J96guNcAzJB8yTeBzLZRAYEOnwn9YGOFJJztƒS7kLTBSBi25njFnV5B0HNFbXtvvIQiUDfNE¥Pqx3WSriPxr9IlTddLHufsqIM0oNnapPeNa1YAcBL4BUZyzjPyb¥0vzaCP¥5Bk9LpFxJTyFThaƒJiL7Tkƒhz4a¥FVSƒXfpqmsCaQWijrGgcOExEM7¥YXajB5L1W9SjqIYUUSewƒSb7BuyBX9sYii0QbSnQ8BdSvR4f2sq3pzUPx3AdCb2hZzEbIfpSEF8q5JAvRjuANKRqQhVei1eyTI72ZPbI0lKƒvrLemkP6OyE88rTƒuvxxHDe¥6K9dKwVV4GtkXj3J3lQOMsH2HKNOmpwG5TR4L1RiOI75PJ4YkC62AHux5vvTƒ¥R8vac6V9lKlMeMFra27Bv3qYhfwSWCgGNOcFsrs2yO1W¥WWXNMvWA2jNKUJl1H65iX18UHyzANy9Vrcthtjjr6PXKZHhQPnLP¥flZA="
            } ],
            "journeyDuration" : 130,
            "originCity" : "Hà Nội",
            "originDateTime" : "2021-07-23T05:10:00.000Z",
            "originLocationCode" : "HAN",
            "originLocationName" : "Sân bay Nội Bài"
        } ],
        "passportMandatory" : true,
        "refundable" : false,
        "sequenceNumber" : "ibe3640395997485504",
        "ticketType" : "ETICKET",
        "validReturnCabinClasses" : null,
        "validatingAirlineCode" : "VJ",
        "validatingAirlineName" : "VietJet Air"
        }, {
        "airItineraryPricingInfo" : {
            "adultFare" : {
            "fareBasisCodes" : null,
            "passengerFare" : {
                "baseFare" : {
                "amount" : 1499000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "comboMarkup" : null,
                "equivFare" : null,
                "serviceTax" : {
                "amount" : 368900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "surcharges" : [ {
                "amount" : 0.0,
                "indicator" : "Ticket fee per segment",
                "type" : "Ticket fee per segment"
                } ],
                "taxes" : null,
                "totalFare" : {
                "amount" : 1867900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "totalPaxFee" : null
            },
            "passengerTypeQuantities" : {
                "code" : "ADT",
                "quantity" : 1
            }
            },
            "childFare" : null,
            "divideInPartyIndicator" : false,
            "fareInfoReferences" : null,
            "fareSourceCode" : "domb8304899-04b8-4ff4-9262-9ad713608507",
            "fareType" : "PUBLIC",
            "infantFare" : null,
            "itinTotalFare" : {
            "baseFare" : {
                "amount" : 1499000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "comboMarkup" : null,
            "equivFare" : null,
            "serviceTax" : {
                "amount" : 368900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "totalFare" : {
                "amount" : 1867900.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "totalPaxFee" : null,
            "totalTax" : {
                "amount" : 0.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            }
            }
        },
        "allowHold" : true,
        "baggageItems" : [ {
            "amount" : 0.0,
            "code" : "air-tickets.baggage-items.vietnam.vj.premium.baggage.adult.free",
            "direction" : null,
            "fareCode" : null,
            "id" : "air-tickets.baggage-items.vietnam.vj.premium.baggage.adult.free",
            "name" : "7kg xách tay + 20kg ký gửi",
            "serviceType" : "BAGGAGE"
        } ],
        "cabinClassName" : "PREMIUM",
        "directionInd" : "DEPARTURE",
        "fightNo" : "135",
        "mealItems" : null,
        "onlyPayLater" : false,
        "originDestinationOptions" : [ {
            "cabinClassName" : "PREMIUM",
            "destinationCity" : "Hồ Chí Minh",
            "destinationDateTime" : "2021-07-23T07:20:00.000Z",
            "destinationLocationCode" : "SGN",
            "destinationLocationName" : "Sân bay Tân Sơn Nhất",
            "flightDirection" : "D",
            "flightSegments" : [ {
            "adultBaggage" : null,
            "aircraft" : "Airbus A321",
            "arrivalAirportLocationCode" : "SGN",
            "arrivalAirportLocationName" : "Sân bay Tân Sơn Nhất",
            "arrivalCity" : "Hồ Chí Minh",
            "arrivalDateTime" : "2021-07-23T07:20:00.000Z",
            "cabinClassCode" : "B1_DLX",
            "cabinClassName" : "PREMIUM",
            "cabinClassText" : "Premium",
            "childBaggage" : null,
            "departureAirportLocationCode" : "HAN",
            "departureAirportLocationName" : "Sân bay Nội Bài",
            "departureCity" : "Hà Nội",
            "departureDateTime" : "2021-07-23T05:10:00.000Z",
            "eticket" : true,
            "fareBasicCode" : null,
            "fareCode" : null,
            "flightDirection" : "D",
            "flightNumber" : "135",
            "infantBaggage" : null,
            "journeyDuration" : 130,
            "marketingAirlineCode" : "VJ",
            "marriageGroup" : null,
            "mealCode" : null,
            "operatingAirline" : {
                "code" : "VJ",
                "equipment" : null,
                "flightNumber" : "135",
                "name" : "VietJet Air"
            },
            "resBookDesignCode" : "B1_DLX",
            "seatsRemaining" : null,
            "stopQuantity" : 0,
            "stopQuantityInfo" : null,
            "supplierFareKey" : null,
            "supplierJourneyKey" : "FE1G3mI6J96guNcAzJB8ySG7yJpj7V0vJxur9hB00jyNcwƒ20DdiB6fj9ƒvf9GgUPS3rI8a¥ƒYn83OMqVXPoZwCp649T3OB0aQ7ItYXABxYRfM6ZiDbfC62m¥¥yAZf5jf7NBG6IJSBVQnsJZWUMvrv6CtZ9j1N5OQ5sUtFN37WkEjJEfSORxmB2ZQdKamFtKHi¥dgP¥7EYIHXmy1f6hdavIhehIqx9Kl¥0gPaxg2ycItGrM0ZkRcUFypKbAlYoUw8DaNiLc3Q3XcNkHy0LJlg4QzLcoWk6uwDkBMr3KUnCxyBR1beBxMhopJovzMvnRZWaWuTMfz¥7dhh32SnQ9OzYwz0uZ¥FreZDsZLp1kzrXPZDcmzsxpvfVaclBhMlJPxz¥ByUpAMUKCQyhfbDINrCiqXDKG5aFEXYs5AFl2SyTl12¥ghZJ8nfkZve9QoEA0EEfsSomUdKcaNƒrCH1H1Esj8jVUthM3fCppoSJPGjOjI="
            } ],
            "journeyDuration" : 130,
            "originCity" : "Hà Nội",
            "originDateTime" : "2021-07-23T05:10:00.000Z",
            "originLocationCode" : "HAN",
            "originLocationName" : "Sân bay Nội Bài"
        } ],
        "passportMandatory" : true,
        "refundable" : false,
        "sequenceNumber" : "ibe3640395997554532",
        "ticketType" : "ETICKET",
        "validReturnCabinClasses" : null,
        "validatingAirlineCode" : "VJ",
        "validatingAirlineName" : "VietJet Air"
        }, {
        "airItineraryPricingInfo" : {
            "adultFare" : {
            "fareBasisCodes" : null,
            "passengerFare" : {
                "baseFare" : {
                "amount" : 3200000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "comboMarkup" : null,
                "equivFare" : null,
                "serviceTax" : {
                "amount" : 539000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "surcharges" : [ {
                "amount" : 0.0,
                "indicator" : "Ticket fee per segment",
                "type" : "Ticket fee per segment"
                } ],
                "taxes" : null,
                "totalFare" : {
                "amount" : 3739000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
                },
                "totalPaxFee" : null
            },
            "passengerTypeQuantities" : {
                "code" : "ADT",
                "quantity" : 1
            }
            },
            "childFare" : null,
            "divideInPartyIndicator" : false,
            "fareInfoReferences" : null,
            "fareSourceCode" : "dom1c7a82fb-83f9-4fe0-9451-bb023179deaa",
            "fareType" : "PUBLIC",
            "infantFare" : null,
            "itinTotalFare" : {
            "baseFare" : {
                "amount" : 3200000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "comboMarkup" : null,
            "equivFare" : null,
            "serviceTax" : {
                "amount" : 539000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "totalFare" : {
                "amount" : 3739000.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            },
            "totalPaxFee" : null,
            "totalTax" : {
                "amount" : 0.0,
                "currencyCode" : null,
                "decimalPlaces" : 2
            }
            }
        },
        "allowHold" : true,
        "baggageItems" : [ {
            "amount" : 0.0,
            "code" : "air-tickets.baggage-items.vietnam.vj.business.baggage.adult.free",
            "direction" : null,
            "fareCode" : null,
            "id" : "air-tickets.baggage-items.vietnam.vj.business.baggage.adult.free",
            "name" : "10kg xách tay + 30kg ký gửi",
            "serviceType" : "BAGGAGE"
        } ],
        "cabinClassName" : "BUSINESS",
        "directionInd" : "DEPARTURE",
        "fightNo" : "135",
        "mealItems" : null,
        "onlyPayLater" : false,
        "originDestinationOptions" : [ {
            "cabinClassName" : "BUSINESS",
            "destinationCity" : "Hồ Chí Minh",
            "destinationDateTime" : "2021-07-23T07:20:00.000Z",
            "destinationLocationCode" : "SGN",
            "destinationLocationName" : "Sân bay Tân Sơn Nhất",
            "flightDirection" : "D",
            "flightSegments" : [ {
            "adultBaggage" : null,
            "aircraft" : "Airbus A321",
            "arrivalAirportLocationCode" : "SGN",
            "arrivalAirportLocationName" : "Sân bay Tân Sơn Nhất",
            "arrivalCity" : "Hồ Chí Minh",
            "arrivalDateTime" : "2021-07-23T07:20:00.000Z",
            "cabinClassCode" : "V_SBoss",
            "cabinClassName" : "BUSINESS",
            "cabinClassText" : "SkyBoss",
            "childBaggage" : null,
            "departureAirportLocationCode" : "HAN",
            "departureAirportLocationName" : "Sân bay Nội Bài",
            "departureCity" : "Hà Nội",
            "departureDateTime" : "2021-07-23T05:10:00.000Z",
            "eticket" : true,
            "fareBasicCode" : null,
            "fareCode" : null,
            "flightDirection" : "D",
            "flightNumber" : "135",
            "infantBaggage" : null,
            "journeyDuration" : 130,
            "marketingAirlineCode" : "VJ",
            "marriageGroup" : null,
            "mealCode" : null,
            "operatingAirline" : {
                "code" : "VJ",
                "equipment" : null,
                "flightNumber" : "135",
                "name" : "VietJet Air"
            },
            "resBookDesignCode" : "V_SBoss",
            "seatsRemaining" : null,
            "stopQuantity" : 0,
            "stopQuantityInfo" : null,
            "supplierFareKey" : null,
            "supplierJourneyKey" : "FE1G3mI6J96guNcAzJB8yZ¥FGw7p5Weqh1jFldOtANHbBsM1ZM4xm9eJCMdqbmYTODQA1GPi0yHK6bYrz1U6SPAnrzCjhNqS6fuU9vMGIlpY3BwX937d9zbpx5aotYD2Hkad7SVACsbXLfkhQm2Bu0X¥k9ƒAQbtCjpXj6rFƒKBXVZSRY4hOF8GQQZ2IFqdegJGFHN6kEeNGHYeJt39SUgpDDRMq0OtLvm0iic¥1YGj1AJVIaj6FUƒxPo4OkVIUB83axadxG7pbDxZCn28¥85bUM50I2Bcp4yxrKnHC7YkXWAKN5JhIQzRHTrt1HbQzF9MP3FP7PWoNvG0BHUndiYelƒ653zOv0dSzƒSX2Tzomz11Rf2fHWHPXwigUvBA74Zsy5vKwDNZxYYv9aJC3c33pEƒ6LsD5NDmdiSRtXzrl8tzStLzyjYapGU0fDSh9bThcZCxpeejWyEVyjHdgqV4e77ncQTeUWUKNa1ggƒrerpRc="
            } ],
            "journeyDuration" : 130,
            "originCity" : "Hà Nội",
            "originDateTime" : "2021-07-23T05:10:00.000Z",
            "originLocationCode" : "HAN",
            "originLocationName" : "Sân bay Nội Bài"
        } ],
        "passportMandatory" : true,
        "refundable" : false,
        "sequenceNumber" : "ibe3640395997606506",
        "ticketType" : "ETICKET",
        "validReturnCabinClasses" : null,
        "validatingAirlineCode" : "VJ",
        "validatingAirlineName" : "VietJet Air"
        } ],
        "requiredFields" : null,
        "returnDateTime" : null,
        "roundType" : "ROUNDTRIP",
        "totalPricedItinerary" : 3
    },
    "infos" : null,
    "searchId" : "ATD::210707::66c84a6f-fa81-4526-a2d9-2f7b7975214b",
    "success" : true,
    "textMessage" : null
}
```

***

### Get flight ticket condition API <a href="#get-flight-ticket-condition-api" id="get-flight-ticket-condition-api"></a>

POST: /api/air-tickets/farerules

Get the ticket conditions of the flight

#### Paramaters <a href="#paramaters_2" id="paramaters_2"></a>

| Parameter                   | Description                  |
| --------------------------- | ---------------------------- |
| language (String, Optional) | The language you want to get |

Example

`?language=vi`

#### Request Body <a href="#request-body_3" id="request-body_3"></a>

| Parameter                        | Description                                                                                                        |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| searchId(String, Required)       | <p>Data used to refer to search results<br>This data is taken from the return results of airline ticket search</p> |
| groupId(String, Required)        | Journey identifier in the list of journeys returned by search results                                              |
| fareSourceCode(String, Required) | Journey identifier information                                                                                     |

Example

```
    {
        "fareSourceCode": "dom07b2da7b-3232-4294-9278-b35fb6307714",
        "groupId": "27b091a7-62b8-4ce2-b45b-eda3340d7673",
        "searchId": "ATD::210720::dc96e1a9-c39e-4f48-974e-e0be6abb45c7"
    }
```

#### Response <a href="#response_5" id="response_5"></a>

| Parameter                                       | Description                                                                                |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------ |
| fareRules(Array\[FareRules], Required)          | Return ticket conditions list                                                              |
| arrivalAirportLocationCode (String, Required)   | Destination location code                                                                  |
| departureAirportLocationCode (String, Required) | Departure location code                                                                    |
| departureDateTime(String, Required)             | <p>Departure time<br>Identified by yyyy-MM-dd’T’Z’</p>                                     |
| arrivalDateTime(String, Required)               | <p>Arrival time<br>Format in yyyy-MM-dd’T’HHon’</p>                                        |
| fareRuleItems (Array\[FareRuleItem], Required)  | Detailed list of ticket conditions                                                         |
| detail(String, Required)                        | <p>Detailed information about ticket conditions<br>HTML format</p>                         |
| title(String, Required)                         | Information about the conditions of the return ticket / the condition of the return ticket |
| duration(Integer, Optional),                    |                                                                                            |
| errors (Array\[Error], Optional),               |                                                                                            |
| infos(Array\[Info], Optional),                  |                                                                                            |
| success(Boolean, Optional),                     |                                                                                            |
| textMessage(String, Optional)                   |                                                                                            |

Example

```json
{
    "duration": 1444,
    "errors": null,
    "fareRules": [
        {
        "arrivalAirportLocationCode": "SGN",
        "arrivalAirportLocationName": null,
        "arrivalCity": null,
        "arrivalDateTime": "2021-08-16T07:55:00.000Z",
        "departureAirportLocationCode": "HAN",
        "departureAirportLocationName": null,
        "departureCity": null,
        "departureDateTime": "2021-08-16T05:45:00.000Z",
        "fareRuleItems": [
            {
            "detail": "\n            \n            <br /><strong>- Hạng đặt chỗ:</strong> Economy Saver\n            <br /><strong>- Thay đổi:</strong>  Trước 3h tính từ giờ khởi hành từng chặng bay : 270.000 VND . Trong/sau 3h tính từ giờ khởi hành từng chặng bay: Không áp dụng\n            <br /><strong>- Hoàn/hủy vé:</strong> Không áp dụng\n            <br /><strong>- Đổi tên:</strong> Chỉ áp dụng đối với vé chưa sử dụng. Thay đổi trước giờ khởi hành 3h của chuyến bay đầu tiên và phải đổi tên cho cả hành trình, thu phí thay đổi tên 350.000 VND\n            <br /><strong>- Hành lý:</strong> Xách tay 7kg + Ký gửi 20kg\n            <br /><strong>- Suất ăn:</strong> Đã bao gồm\n            <br /><strong>- Hệ số cộng điểm Bamboo Club:</strong> 0.25\n\t        <br /><strong>- Ghi chú:</strong> Mọi thay đổi trên vé phải thực hiện trước 3h so với giờ khởi hành hoặc theo quy định của từng loại vé. Tất cả phí áp dụng chưa bao gồm VAT và được tính cho từng khách/chặng + chênh lệch vé (nếu có). Tết Nguyên Đán 2022: 17/01/2022 – 16/02/2022\n\t\t    <br /><strong>- Ghi chú Covid-19:</strong> HÀNH KHÁCH KHI ĐẶT CHỖ MUA VÉ CẦN THỰC HIỆN KHAI BÁO Y TẾ ĐIỆN TỬ BẮT BUỘC TRƯỚC KHI TỚI SÂN BAY\n            <br /><br/><strong> Tham khảo thêm <a href='https://www.bambooairways.com/vn-vi/thong-tin-dat-ve/dat-chuyen-bay/cac-hang-ve-gia-ve/' target='_blank'>Điều kiện giá vé áp dụng cho các vé xuất và khởi hành từ ngày 01/03/2021</a>\n\t\t\t\n        ",
            "title": "Điều kiện chiều đi"
            }
        ],
        "operatingAirline": {
            "code": "VN",
            "equipment": null,
            "flightNumber": null,
            "name": null
        }
        }
    ],
    "fareSourceCode": null,
    "groupId": null,
    "infos": null,
    "searchId": null,
    "success": true,
    "textMessage": null
}
```


# Booking API

### Ticket Status Check API <a href="#ticket-status-check-api" id="ticket-status-check-api"></a>

POST: /api/air-tickets/revalidate

Check ticket availability before booking

#### Request Body <a href="#request-body" id="request-body"></a>

| Parameter                        | Description                                                                                                        |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| searchId(String, Required)       | <p>Data used to refer to search results<br>This data is taken from the return results of airline ticket search</p> |
| groupId(String, Required)        | Journey identifier in the list of journeys returned by search results                                              |
| fareSourceCode(String, Required) | Journey identifier information                                                                                     |

**Example**

```json
    {
        "fareSourceCode": "dom07b2da7b-3232-4294-9278-b35fb6307714",
        "groupId": "27b091a7-62b8-4ce2-b45b-eda3340d7673",
        "searchId": "ATD::210720::dc96e1a9-c39e-4f48-974e-e0be6abb45c7"
    }
```

#### Response <a href="#response" id="response"></a>

| Parameter                        | Description                             |
| -------------------------------- | --------------------------------------- |
| valid(Boolean, Required)         | Is the ticket information still useful? |
| duration(Integer, Optional)      |                                         |
| errors (Array\[Error], Optional) |                                         |
| infos(Array\[Info], Optional)    |                                         |
| success(Boolean, Optional)       |                                         |
| textMessage(String, Optional)    |                                         |

**Example**

```json
{
    "duration" : 858,
    "errors" : null,
    "infos" : null,
    "itinerary" : null,
    "success" : true,
    "textMessage" : null,
    "valid" : true
}
```

***

### Create draft booking API <a href="#create-draft-booking-api" id="create-draft-booking-api"></a>

POST: /api/air-tickets/draft-booking

Create draft booking with ticket info

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

| Parameter                                        | Description                                                                                                        |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| itineraryInfos (Array\[ItineraryInfo], Required) | Outbound + return journey information (if any)                                                                     |
| searchId(String, Required)                       | <p>Data used to refer to search results<br>This data is taken from the return results of airline ticket search</p> |
| groupId(String, Required)                        | Journey identifier in the list of journeys returned by search results                                              |
| fareSourceCode(String, Required)                 | Journey identifier information                                                                                     |

**Example**

```json
    {
        "itineraryInfos": [
            {
                "fareSourceCode": "dom07b2da7b-3232-4294-9278-b35fb6307714",
                "groupId": "27b091a7-62b8-4ce2-b45b-eda3340d7673",
                "searchId": "ATD::210720::dc96e1a9-c39e-4f48-974e-e0be6abb45c7"
            },
            {
                "fareSourceCode": "domb771ff7f-57b5-4bd5-9443-e43b79f61aaa",
                "groupId": "8ceaa3c5-bbcf-451a-95ae-cd0a81e60993",
                "searchId": "ATD::210720::dc96e1a9-c39e-4f48-974e-e0be6abb45c7-R"
            }
        ]
    }
```

#### Response <a href="#response_1" id="response_1"></a>

| Parameter                                               | Description                                                                                                                                                  |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| bookingCode (BookingCode, Required)                     | Booking identifier information                                                                                                                               |
| bookingCode(String, Required)                           | Booking Identifier                                                                                                                                           |
| bookingNumber(String, Required)                         | Code used to refer to booking. This code is unique.                                                                                                          |
| bookingType(String, Required)                           | <p>Information showing the type of booking: Domestic or international<br>- DOME: Domestic<br>- INTE: International</p>                                       |
| departDraftItineraryInfo (DraftItineraryInfo, Required) | Outbound itinerary information                                                                                                                               |
| bookingDirection(String, Required)                      | <p>Direction information<br>- DEPARTURE: Departure direction<br>- RETURN: Return direction<br>- TRIP: Used for international tickets (outbound + return)</p> |
| fareSourceCode(String, Required)                        | Journey identifier information                                                                                                                               |
| groupId(String, Required)                               | Journey identifier in the list of journeys returned by search results                                                                                        |
| itinTotalFare (ItinTotalFare, Required)                 | Information about the prices of the journey                                                                                                                  |
| baseFare(FareInfo, required)                            | Basic fare information                                                                                                                                       |
| amount (Double, Required)                               | Amount of money                                                                                                                                              |
| decimalPlaces(Integer, Optional)                        | Decimal places rounded to                                                                                                                                    |
| equivFare (FareInfo, Optional)                          | Similar to baseFare                                                                                                                                          |
| Ticketing fee information                               |                                                                                                                                                              |
| serviceTax (FareInfo, Required)                         | Similar to baseFare                                                                                                                                          |
| Service fee information                                 |                                                                                                                                                              |
| totalTax (FareInfo, Required)                           | Similar to baseFare                                                                                                                                          |
| Information about total service fee                     |                                                                                                                                                              |
| totalFare (FareInfo, Required)                          | Similar to baseFare                                                                                                                                          |
| Total ticket price information                          |                                                                                                                                                              |
| returnDraftItineraryInfo (DraftItineraryInfo, Optional) | Similar to the detailed information of the outbound journey                                                                                                  |
| Return journey information                              |                                                                                                                                                              |
| duration(Integer, Optional)                             |                                                                                                                                                              |
| errors (Array\[Error], Optional)                        |                                                                                                                                                              |
| infos(Array\[Info], Optional)                           |                                                                                                                                                              |
| success(Boolean, Optional)                              |                                                                                                                                                              |
| textMessage(String, Optional)                           |                                                                                                                                                              |

**Example**

```json
    {
        "bookingCode": {
            "bookingCode": "BOD::210720::b87fd70e-4a9b-4532-9cb6-7d8142822ac3",
            "bookingNumber": "ADCO2107201223803"
        },
        "bookingType": "DOME",
        "departDraftItineraryInfo": {
            "bookingDirection": "DEPARTURE",
            "fareSourceCode": "dom07b2da7b-3232-4294-9278-b35fb6307714",
            "groupId": "27b091a7-62b8-4ce2-b45b-eda3340d7673",
            "itinTotalFare": {
            "baseFare": {
                "amount": 399000,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "comboMarkup": null,
            "equivFare": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "serviceTax": {
                "amount": 512000,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "totalFare": {
                "amount": 911000,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "totalPaxFee": null,
            "totalTax": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
            }
            },
            "searchId": "ATD::210720::dc96e1a9-c39e-4f48-974e-e0be6abb45c7"
        },
        "duration": 3498,
        "errors": null,
        "infos": null,
        "isPerBookingType": true,
        "isRoundTripType": true,
        "isSuccess": true,
        "markupType": "PER_BOOKING",
        "returnDraftItineraryInfo": {
            "bookingDirection": "RETURN",
            "fareSourceCode": "domb771ff7f-57b5-4bd5-9443-e43b79f61aaa",
            "groupId": "8ceaa3c5-bbcf-451a-95ae-cd0a81e60993",
            "itinTotalFare": {
            "baseFare": {
                "amount": 1319000,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "comboMarkup": null,
            "equivFare": null,
            "serviceTax": {
                "amount": 350900,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "totalFare": {
                "amount": 1669900,
                "currencyCode": null,
                "decimalPlaces": 2
            },
            "totalPaxFee": null,
            "totalTax": {
                "amount": 0,
                "currencyCode": null,
                "decimalPlaces": 2
            }
            },
            "searchId": "ATD::210720::dc96e1a9-c39e-4f48-974e-e0be6abb45c7-R"
        },
        "roundType": "RoundTrip",
        "success": true,
        "textMessage": null
    }
```

***

### Get booking detail API <a href="#get-booking-detail-api" id="get-booking-detail-api"></a>

GET: /api/products/booking-detail

Get details of booking

#### Parameter <a href="#parameter" id="parameter"></a>

| Parameter                          | Description               |
| ---------------------------------- | ------------------------- |
| booking\_number (String, Required) | Reference code to booking |

**Example**

?booking\_number=`ADCO2107201223969`

#### Response <a href="#response_2" id="response_2"></a>

| Parameter                                                                                                                                                                  | Description                                                                     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| id (String, Optional)                                                                                                                                                      | Booking identifier code                                                         |
| agencyCode (String, Optional)                                                                                                                                              | Agent code. Code used to refer to the author of the booking                     |
| agentCode (String, Optional)                                                                                                                                               | Agent employee code. Code used to refer to the author of the booking            |
| bookingCode(String, Required)                                                                                                                                              | Code used to describe basic information of booking                              |
| bookingDate (String, Optional)                                                                                                                                             | Create booking date                                                             |
| bookingDirection(String, Required)                                                                                                                                         | Direction information                                                           |
| DEPARTURE: Departure direction                                                                                                                                             |                                                                                 |
| RETURN: Return direction                                                                                                                                                   |                                                                                 |
| TRIP: Used for international tickets (outbound + return)                                                                                                                   |                                                                                 |
| bookingInfo (BookingInfo, Optional)                                                                                                                                        | Booking information                                                             |
| additionalFee (Number, Optional)                                                                                                                                           | Other fees                                                                      |
| agencyCode(String, Optional)                                                                                                                                               | Dealer code. Code used to refer to the author of the booking                    |
| agentCode(String, Optional)                                                                                                                                                | Agent employee code. Code used to refer to the author of the booking            |
| agentId(Integer, Optional)                                                                                                                                                 | Agent employee id                                                               |
| agentName(String, Optional)                                                                                                                                                | Agent staff name                                                                |
| allowHold(Boolean, Optional)                                                                                                                                               | Is it allowed to keep the plane ticket?                                         |
| true: allow to keep tickets                                                                                                                                                |                                                                                 |
| false: Not allowed to keep tickets                                                                                                                                         |                                                                                 |
| itinTotalFare (ItinTotalFare, Required)                                                                                                                                    | Information about the prices of the journey                                     |
| baseFare(Number, Optional)                                                                                                                                                 | Basic fare information                                                          |
| bookBy(String, Optional)                                                                                                                                                   | The person who booked the booking                                               |
| bookByCode(String, Optional)                                                                                                                                               | Orderer code                                                                    |
| bookingCode(String, Optional)                                                                                                                                              | Code used to describe basic information of booking                              |
| bookingDate(String, Optional)                                                                                                                                              | Booking creation date                                                           |
| bookingNote(String, Optional)                                                                                                                                              | Notes of booking                                                                |
| bookingNumber(String, Optional)                                                                                                                                            | Code used to refer to booking. This code is unique.                             |
| bookingType(String, Optional) = \[‘DOME’, ‘INTE’]                                                                                                                          | Determine whether the destination is domestic or international                  |
| DOME: Domestic                                                                                                                                                             |                                                                                 |
| INTE: International                                                                                                                                                        |                                                                                 |
| branchCode(String, Optional)                                                                                                                                               | Branch code                                                                     |
| cancellationBy(String, Optional)                                                                                                                                           | Ticket cancellation by…                                                         |
| cancellationDate(String, Optional)                                                                                                                                         | Cancellation date                                                               |
| cancellationFee(Number, Optional)                                                                                                                                          | Cancellation fee                                                                |
| cancellationNotes(String, Optional)                                                                                                                                        | Cancellation Notes                                                              |
| channelType(String, Optional) = \[‘ONLINE’, ‘OFFLINE’]                                                                                                                     | Booking channel type                                                            |
| contactInfos(Array\[BookingContactInfo], Optional)                                                                                                                         | Array of objects with contact information                                       |
| bookingNumber(String, Optional)                                                                                                                                            | Reference code to booking                                                       |
| contactLevel(String, Optional) = \[‘PRIMARY’, ‘SECONDARY’, ‘OTHER’],                                                                                                       | Level of contact                                                                |
| contactType(String, Optional) = \[‘CUSTOMER’, ‘AGENCY’]                                                                                                                    | Type of contact person                                                          |
| email(String, Optional)                                                                                                                                                    | Email address                                                                   |
| firstName(String, Optional)                                                                                                                                                | Night name and contact name                                                     |
| phoneCode1(String, Optional)                                                                                                                                               | Country code                                                                    |
| phoneNumber1(String, Optional)                                                                                                                                             | Phone number 1                                                                  |
| surName(String, Optional)                                                                                                                                                  | Contact person’s last name                                                      |
| customerCode(String, Optional)                                                                                                                                             | Customer’s code                                                                 |
| customerEmail(String, Optional)                                                                                                                                            | Customer’s email                                                                |
| customerFirstName(String, Optional)                                                                                                                                        | Client’s last name                                                              |
| customerId(Integer, Optional)                                                                                                                                              | Customer id                                                                     |
| customerLastName(String, Optional)                                                                                                                                         | Customer’s name                                                                 |
| customerPhoneNumber1(String, Optional)                                                                                                                                     | Customer’s phone number 1                                                       |
| customerPhoneNumber2(String, Optional)                                                                                                                                     | Customer’s phone number 2                                                       |
| departureDate(String, Optional)                                                                                                                                            | Departure day                                                                   |
| discountAmount (Number, Optional)                                                                                                                                          | Amount to be reduced                                                            |
| discountDate(String, Optional)                                                                                                                                             | Date to use discount code                                                       |
| discountRedeemCode(String, Optional)                                                                                                                                       | Redemption Link Code                                                            |
| discountRedeemId(String, Optional)                                                                                                                                         | Normal link identifier id                                                       |
| discountVoucherCode(String, Optional)                                                                                                                                      | Voucher code                                                                    |
| discountVoucherName(String, Optional)                                                                                                                                      | Name of the voucher                                                             |
| equivFare (FareInfo, Optional)                                                                                                                                             | Similar to baseFare                                                             |
| Ticketing fee information                                                                                                                                                  |                                                                                 |
| etickets(String, Optional)                                                                                                                                                 | Supplier link code, used to receive air tickets                                 |
| fromCity(String, Optional)                                                                                                                                                 | Departure city name                                                             |
| fromLocationCode(String, Optional),                                                                                                                                        | Departure Airport Identifier                                                    |
| fromLocationName(String, Optional),                                                                                                                                        | Departure airport name                                                          |
| id(integer, Optional),                                                                                                                                                     | Id of booking                                                                   |
| issuedByCode(String, Optional),                                                                                                                                            | Tickets issued by…                                                              |
| issuedDate(String, Optional)                                                                                                                                               | Check-out date                                                                  |
| issuedStatus(String, Optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],                                                                               | Ticketing Status                                                                |
| PENDING: Waiting to issue tickets                                                                                                                                          |                                                                                 |
| TICKET\_ON\_PROCESS: Ticket issue is being processed                                                                                                                       |                                                                                 |
| SUCCEEDED: Successfully issued tickets                                                                                                                                     |                                                                                 |
| FAILED: Ticket issue failed                                                                                                                                                |                                                                                 |
| orgCode (String, Optional)                                                                                                                                                 | Organization code                                                               |
| passengerNameRecords(String, Optional)                                                                                                                                     | Supplier link code, used to receive air tickets                                 |
| paymentBy(String, Optional)                                                                                                                                                | Paid by…                                                                        |
| paymentByCode(String, Optional)                                                                                                                                            | Payer code                                                                      |
| paymentDate(String, Optional)                                                                                                                                              | Payment time                                                                    |
| paymentFee (Number, Optional)                                                                                                                                              | Payment Fees                                                                    |
| paymentRefNumber(String, Optional)                                                                                                                                         | Payment reference code                                                          |
| paymentStatus(String, Optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],                                                                                         | Payment Status                                                                  |
| PENDING: Waiting for payment                                                                                                                                               |                                                                                 |
| SUCCEEDED: Successful payment                                                                                                                                              |                                                                                 |
| FAILED: Payment failed                                                                                                                                                     |                                                                                 |
| REFUNDED: Refunds                                                                                                                                                          |                                                                                 |
| paymentTotalAmount(Number, Optional)                                                                                                                                       | Total payment amount                                                            |
| paymentType(String, Optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘AIRPAY’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘PAYOO’, ‘CASH’, ‘TRANSFER ‘, ‘PARTNER’, ‘OTHER’], | Payment method                                                                  |
| refundBy(String, Optional)                                                                                                                                                 | Refunder                                                                        |
| refundByCode(String, Optional),                                                                                                                                            | Code of the person making the refund                                            |
| refundable (Boolean, Optional)                                                                                                                                             | Refund date                                                                     |
| returnDate(String, Optional)                                                                                                                                               | Check-out date                                                                  |
| roundType(String, Optional) = \[‘RoundTrip]                                                                                                                                |                                                                                 |
| saleChannel(String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’]                                                                       | Distribution channel                                                            |
| serviceTax(Number, Optional)                                                                                                                                               | Taxes and fees                                                                  |
| status (String, Optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],                                                              | Status of booking                                                               |
| PENDING: Waiting for booking confirmation                                                                                                                                  |                                                                                 |
| BOOKING\_ON\_PROCESS: Booking is being processed                                                                                                                           |                                                                                 |
| BOOKED: Booking confirmed                                                                                                                                                  |                                                                                 |
| FAILED: Booking failed                                                                                                                                                     |                                                                                 |
| EXPIRED: Expired Booking                                                                                                                                                   |                                                                                 |
| CANCELLED: Booking has been canceled                                                                                                                                       |                                                                                 |
| supplierType(String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],                                                                                     | Supplier Type                                                                   |
| taxAddress1(String, Optional)                                                                                                                                              | Invoicing address line 1                                                        |
| taxAddress2(String, Optional)                                                                                                                                              | Invoicing address line 2                                                        |
| taxCompanyName(String, Optional)                                                                                                                                           | Invoice company name                                                            |
| taxNumber (String, Optional)                                                                                                                                               | Tax code to be invoiced                                                         |
| taxPersonalInfoContact(String, Optional)                                                                                                                                   | Invoice recipients                                                              |
| taxReceiptRequest(Boolean, Optional)                                                                                                                                       | Request an invoice or not?                                                      |
| timeToLive(String, Optional)                                                                                                                                               | Waiting time for payment, after this time booking status will change to EXPIRED |
| toCity(String, Optional)                                                                                                                                                   | Name of destination province, city                                              |
| toLocationCode(String, Optional)                                                                                                                                           | Destination Identifier                                                          |
| toLocationName(String, Optional)                                                                                                                                           | Destination airport name                                                        |
| totalFare(Number, Optional)                                                                                                                                                | Total room rate                                                                 |
| totalSsrValue(Number, Optional)                                                                                                                                            | Total price of luggage/extra service                                            |
| totalTax(Number, Optional)                                                                                                                                                 | Total amount of taxes and fees                                                  |
| transactionInfos(Array\[BookingTransactionInfo], Optional)                                                                                                                 | Array of objects containing transaction information                             |
| id(integer, Optional)                                                                                                                                                      | Transaction identifier id                                                       |
| allowHold(Boolean, Optional)                                                                                                                                               | Is it allowed to keep tickets?                                                  |
| bookingCode(String, Optional)                                                                                                                                              | Code used to describe basic information of booking                              |
| bookingDate(String, Optional)                                                                                                                                              | Booking creation date                                                           |
| bookingDirection(String, Optional) = \[‘DEPARTURE’, ‘RETURN’]                                                                                                              |                                                                                 |
| bookingNumber(String, Optional)                                                                                                                                            | Code used to refer to booking.                                                  |
| bookingRefNo(String, Optional)                                                                                                                                             | Supplier link code                                                              |
| channelType(String, Optional) = \[‘ONLINE’, ‘OFFLINE’]                                                                                                                     | Type of sales channel                                                           |
| checkIn(String, Optional)                                                                                                                                                  | Flight date and time                                                            |
| checkOut(String, Optional)                                                                                                                                                 | Time and date come                                                              |
| destinationLocationCode(String, Optional)                                                                                                                                  | Stadium Identifier                                                              |
| detail(String, Optional)                                                                                                                                                   | Location name                                                                   |
| etickets(String, Optional)                                                                                                                                                 | Vendor affiliate code, used to receive tickets                                  |
| issuedDate(String, Optional)                                                                                                                                               | Ticket issue date                                                               |
| issuedStatus(String, Optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’]                                                                                | Ticketing Status                                                                |
| PENDING: Waiting to issue tickets                                                                                                                                          |                                                                                 |
| TICKET\_ON\_PROCESS: Ticket issue is being processed                                                                                                                       |                                                                                 |
| SUCCEEDED: Successfully issued tickets                                                                                                                                     |                                                                                 |
| FAILED: Ticket issue failed                                                                                                                                                |                                                                                 |
| noAdult(integer, Optional)                                                                                                                                                 | Number of adults                                                                |
| noChild(integer, Optional)                                                                                                                                                 | Number of children                                                              |
| onlyPayLater(Boolean, Optional)                                                                                                                                            | Postpaid or not allowed?                                                        |
| passengerNameRecord(String, Optional),                                                                                                                                     | Vendor affiliate code, used to receive tickets                                  |
| paymentAmount(Number, Optional)                                                                                                                                            | Payment amount                                                                  |
| productSeqNumber(String, Optional)                                                                                                                                         | Product code                                                                    |
| refundable (Boolean, Optional)                                                                                                                                             | Is there a refund for ticket cancellation?                                      |
| saleChannel(String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’]                                                                       | Distribution channel                                                            |
| serviceTax(Number, Optional)                                                                                                                                               | Taxes and fees                                                                  |
| status (String, Optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],                                                              | Status of booking                                                               |
| PENDING: Waiting for booking confirmation                                                                                                                                  |                                                                                 |
| BOOKING\_ON\_PROCESS: Booking is being processed                                                                                                                           |                                                                                 |
| BOOKED: Booking confirmed                                                                                                                                                  |                                                                                 |
| FAILED: Booking failed                                                                                                                                                     |                                                                                 |
| EXPIRED: Expired Booking                                                                                                                                                   |                                                                                 |
| CANCELLED: Booking has been canceled                                                                                                                                       |                                                                                 |
| supplierCode(String, Optional)                                                                                                                                             | Supplier code                                                                   |
| supplierName(String, Optional)                                                                                                                                             | Supplier Name                                                                   |
| supplierType(String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’]                                                                                      | Product Type                                                                    |
| totalFare(Number, Optional)                                                                                                                                                | Total fare                                                                      |
| totalTax(Number, Optional)                                                                                                                                                 | Total taxes and fees                                                            |
| baseFare(Number, Optional)                                                                                                                                                 | Ticket price does not include taxes                                             |
| travelerInfos(Array\[BookingTravelerInfo], Optional)                                                                                                                       | Array of objects containing passenger information.                              |
| bookingNumber(String)                                                                                                                                                      | Reference code to booking                                                       |
| firstName(String)                                                                                                                                                          | Night name and passenger name                                                   |
| surName(String)                                                                                                                                                            | Passenger’s surname                                                             |
| bookingNumber(String, Optional)                                                                                                                                            | Code used to refer to booking. This code is unique.                             |
| bookingType(String, Optional)                                                                                                                                              | Determine whether the destination is domestic or international                  |
| DOME: Domestic                                                                                                                                                             |                                                                                 |
| INTE: International                                                                                                                                                        |                                                                                 |
| branchCode(String, Optional)                                                                                                                                               | Branch code                                                                     |
| groupPricedItineraries (Array\[GroupPricedItinerary], Optional),                                                                                                           | Information about the list of journeys returned by search results               |
| Similar to getting flight ticket search information                                                                                                                        |                                                                                 |
| OrgCode(String, Optional)                                                                                                                                                  | Organization code                                                               |
| saleChannel(String, Optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],                                                                      | Distribution channel                                                            |
| supplierType(String, Optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],                                                                                     | Supplier Type                                                                   |

**Example**

```json
    {
        "id": "BOD::210720::157f1341-5a66-4b0e-a6fb-a2d39b99dfdf",
        "updatedDate": "2021-07-20T07:11:49.524Z",
        "cacheType": "COMBO",
        "orgCode": "A::1",
        "agencyCode": "A::1",
        "branchCode": null,
        "saleChannel": "B2C_WEB",
        "channelType": "ONLINE",
        "supplierType": "AIR",
        "bookingCode": "BOD::210720::157f1341-5a66-4b0e-a6fb-a2d39b99dfdf",
        "bookingType": "DOME",
        "agentCode": null,
        "customerCode": "C::A::1|-1",
        "bookingNumber": "ADCO2107201223969",
        "bookingDate": "2021-07-20T07:11:49.52Z",
        "markupType": "PER_BOOKING",
        "bookingInfo": {
            "id": 1223969,
            "orgCode": "A::1",
            "agencyCode": "A::1",
            "saleChannel": "B2C_WEB",
            "channelType": "ONLINE",
            "supplierType": "AIR",
            "bookingCode": "BOD::210720::157f1341-5a66-4b0e-a6fb-a2d39b99dfdf",
            "bookingType": "DOME",
            "agentCode": null,
            "agentId": null,
            "agentName": null,
            "branchCode": null,
            "customerCode": "C::A::1|-1",
            "customerId": -1,
            "bookingNumber": "ADCO2107201223969",
            "roundType": "RoundTrip",
            "fromLocationCode": "HAN",
            "fromLocationName": "Sân bay Nội Bài",
            "fromCity": "Hà Nội",
            "toLocationCode": "SGN",
            "toLocationName": "Sân bay Tân Sơn Nhất",
            "toCity": "Hồ Chí Minh",
            "status": "PENDING",
            "bookingDate": "2021-07-20T07:11:49.52Z",
            "departureDate": "2021-08-16T05:10:00Z",
            "returnDate": "2021-08-24T05:25:00Z",
            "baseFare": 2638000,
            "equivFare": 0,
            "serviceTax": 701800,
            "vat": null,
            "totalFare": 3339800,
            "totalTax": 701800,
            "agencyMarkupValue": 0,
            "markupValue": 0,
            "totalSsrValue": 0,
            "totalCombo": null,
            "paymentTotalAmount": 0,
            "paymentFee": 0,
            "paymentType": "OTHER",
            "paymentStatus": "PENDING",
            "paymentDate": null,
            "paymentRefNumber": null,
            "issuedStatus": "PENDING",
            "issuedDate": null,
            "customerFirstName": null,
            "customerLastName": null,
            "customerPhoneNumber1": null,
            "customerPhoneNumber2": null,
            "customerEmail": null,
            "taxReceiptRequest": null,
            "taxCompanyName": null,
            "taxAddress1": null,
            "taxAddress2": null,
            "taxNumber": null,
            "paymentBy": null,
            "paymentByCode": null,
            "issuedByCode": null,
            "refundBy": null,
            "refundByCode": null,
            "bookBy": "GUEST",
            "bookByCode": "C::A::1|-1",
            "displayPriceInfo": {
            "bookingNumber": "ADCO2107201223969",
            "baseFare": 2638000,
            "equivFare": 0,
            "serviceTax": 701800,
            "totalFare": 3339800,
            "totalTax": 701800,
            "agencyMarkupValue": 0,
            "markupValue": 0,
            "totalSsrValue": 0,
            "cancellationFee": 0,
            "paymentFee": 0,
            "discountAmount": 0,
            "additionalFee": 0,
            "additionalTaxPerTraveler": 0,
            "vat": null
            },
            "transactionInfos": [
            {
                "id": 1224043,
                "saleChannel": "B2C_WEB",
                "channelType": "ONLINE",
                "supplierType": "AIR",
                "bookingCode": "ADCO2107201223969::HAN-SGN::domd879a3f6-f3cb-40d6-8e95-52dd0a7d47a5",
                "bookingNumber": "ADCO2107201223969",
                "status": "PENDING",
                "bookingDate": "2021-07-20T07:11:49.52Z",
                "supplierCode": "VJ",
                "supplierName": "Vietjet Air",
                "bookingRefNo": null,
                "passengerNameRecord": null,
                "timeToLive": null,
                "signature": null,
                "detail": "HAN-SGN :: VJ 135",
                "originLocationCode": "HAN",
                "destinationLocationCode": "SGN",
                "carrierNo": "135",
                "checkIn": "2021-08-16T07:20:00Z",
                "checkOut": "2021-08-16T05:10:00Z",
                "baseFare": 1319000,
                "equivFare": 0,
                "serviceTax": 350900,
                "totalFare": 1669900,
                "totalTax": 350900,
                "agencyMarkupValue": 0,
                "markupValue": null,
                "totalSsrValue": 0,
                "markupKey": "F2C|A::1|A|DOME|BAS|VIETJET|ECONOMY|-1",
                "markupCode": null,
                "markupFormula": null,
                "paymentAmount": null,
                "issuedStatus": "PENDING",
                "issuedDate": null,
                "etickets": null,
                "listETickets": null,
                "productSeqNumber": "ibe4754299335928434",
                "productClass": "ECONOMY",
                "bookingDirection": "DEPARTURE",
                "noAdult": 1,
                "noChild": 0,
                "noInfant": 0,
                "b2cBasePrice": 0,
                "b2cTaxAndFees": 0,
                "adjustNet": 0,
                "adjustContract": 0,
                "b2cTotalPrice": 0,
                "supplierBookingStatus": "PENDING",
                "supplierPaymentStatus": null,
                "onlyPayLater": false,
                "allowHold": true,
                "refundable": false
            },
            {
                "id": 1224044,
                "saleChannel": "B2C_WEB",
                "channelType": "ONLINE",
                "supplierType": "AIR",
                "bookingCode": "ADCO2107201223969::SGN-HAN::dom389dca01-c0fd-466b-8a98-daaa4d5a06d4",
                "bookingNumber": "ADCO2107201223969",
                "status": "PENDING",
                "bookingDate": "2021-07-20T07:11:49.52Z",
                "supplierCode": "VJ",
                "supplierName": "Vietjet Air",
                "bookingRefNo": null,
                "passengerNameRecord": null,
                "timeToLive": null,
                "signature": null,
                "detail": "SGN-HAN :: VJ 176",
                "originLocationCode": "SGN",
                "destinationLocationCode": "HAN",
                "carrierNo": "176",
                "checkIn": "2021-08-24T07:35:00Z",
                "checkOut": "2021-08-24T05:25:00Z",
                "baseFare": 1319000,
                "equivFare": 0,
                "serviceTax": 350900,
                "totalFare": 1669900,
                "totalTax": 350900,
                "agencyMarkupValue": 0,
                "markupValue": null,
                "totalSsrValue": 0,
                "markupKey": "F2C|A::1|A|DOME|BAS|VIETJET|ECONOMY|-1",
                "markupCode": null,
                "markupFormula": null,
                "paymentAmount": null,
                "issuedStatus": "PENDING",
                "issuedDate": null,
                "etickets": null,
                "listETickets": null,
                "productSeqNumber": "ibe4754299329767108",
                "productClass": "ECONOMY",
                "bookingDirection": "RETURN",
                "noAdult": 1,
                "noChild": 0,
                "noInfant": 0,
                "b2cBasePrice": 0,
                "b2cTaxAndFees": 0,
                "adjustNet": 0,
                "adjustContract": 0,
                "b2cTotalPrice": 0,
                "supplierBookingStatus": "PENDING",
                "supplierPaymentStatus": null,
                "onlyPayLater": false,
                "allowHold": true,
                "refundable": false
            }
            ],
            "agencyMarkupInfos": [
            {
                "agencyCode": "A::1",
                "baseFare": 2638000,
                "equivFare": 0,
                "serviceTax": 701800,
                "totalFare": 3339800,
                "totalTax": 701800,
                "markupValue": 0,
                "agencyMarkupValue": 0
            }
            ],
            "contactInfos": [],
            "travelerInfos": [],
            "timeToLive": null,
            "supplierBookingStatus": "PENDING",
            "passengerNameRecords": "",
            "etickets": "",
            "cancellationFee": 0,
            "cancellationNotes": null,
            "cancellationBy": null,
            "cancellationDate": null,
            "discountAmount": 0,
            "discountVoucherCode": null,
            "discountVoucherName": null,
            "discountRedeemId": null,
            "discountRedeemCode": null,
            "discountDate": null,
            "additionalFee": null,
            "taxPersonalInfoContact": null,
            "bookingNote": null,
            "internalBookingNote": null,
            "promotionID": null,
            "reasonCodePaymentFailed": null,
            "bookingFinalStatus": null,
            "bookingIssuedType": null,
            "deleted": null,
            "onlyPayLater": false,
            "allowHold": true,
            "refundable": false,
            "ownerBooking": false,
            "showPayLaterOption": true,
            "showPayNowOption": true
        },
        "groupPricedItineraries": [
            {
            "groupId": "061f0408-ddb8-4462-ada0-d7aacac4154f",
            "airline": "VJ",
            "airlineName": "VietJet Air",
            "airSupplier": "VJ",
            "fightNo": "135",
            "flightType": "DOMESTIC",
            "roundType": "ROUNDTRIP",
            "originLocationCode": "HAN",
            "originLocationName": "Sân bay Nội Bài",
            "originCity": "Hà Nội",
            "originCountryCode": null,
            "originCountry": null,
            "destinationLocationCode": "SGN",
            "destinationLocationName": "Sân bay Tân Sơn Nhất",
            "destinationCity": "Hồ Chí Minh",
            "destinationCountryCode": null,
            "destinationCountry": null,
            "requiredFields": null,
            "aircraft": "Airbus A321",
            "vnaArea": null,
            "arrivalDateTime": "2021-08-16T07:20:00Z",
            "returnDateTime": null,
            "departureDateTime": "2021-08-16T05:10:00Z",
            "totalPricedItinerary": 1,
            "pricedItineraries": [
                {
                "sequenceNumber": "ibe4754299335928434",
                "directionInd": "DEPARTURE",
                "ticketType": "ETICKET",
                "validatingAirlineCode": "VJ",
                "validatingAirlineName": "VietJet Air",
                "fightNo": "135",
                "airItineraryPricingInfo": {
                    "fareSourceCode": "domd879a3f6-f3cb-40d6-8e95-52dd0a7d47a5",
                    "fareType": "PUBLIC",
                    "divideInPartyIndicator": false,
                    "fareInfoReferences": null,
                    "itinTotalFare": {
                    "baseFare": {
                        "amount": 1319000,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "comboMarkup": null,
                    "equivFare": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "serviceTax": {
                        "amount": 350900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "totalFare": {
                        "amount": 1669900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "totalTax": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "totalPaxFee": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    }
                    },
                    "adultFare": {
                    "passengerTypeQuantities": {
                        "code": "ADT",
                        "quantity": 1
                    },
                    "fareBasisCodes": null,
                    "passengerFare": {
                        "baseFare": {
                        "amount": 1319000,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "comboMarkup": null,
                        "equivFare": null,
                        "serviceTax": {
                        "amount": 350900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "taxes": null,
                        "totalFare": {
                        "amount": 1669900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "totalPaxFee": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "surcharges": [
                        {
                            "amount": 0,
                            "indicator": "Ticket fee per segment",
                            "type": "Ticket fee per segment"
                        }
                        ]
                    }
                    },
                    "childFare": null,
                    "infantFare": null
                },
                "originDestinationOptions": [
                    {
                    "originLocationCode": "HAN",
                    "originLocationName": "Sân bay Nội Bài",
                    "originCity": "Hà Nội",
                    "originDateTime": "2021-08-16T05:10:00Z",
                    "destinationLocationCode": "SGN",
                    "destinationLocationName": "Sân bay Tân Sơn Nhất",
                    "destinationCity": "Hồ Chí Minh",
                    "destinationDateTime": "2021-08-16T07:20:00Z",
                    "flightDirection": "D",
                    "journeyDuration": 130,
                    "flightSegments": [
                        {
                        "departureAirportLocationCode": "HAN",
                        "departureAirportLocationName": "Sân bay Nội Bài",
                        "departureCity": "Hà Nội",
                        "departureDateTime": "2021-08-16T05:10:00Z",
                        "arrivalAirportLocationCode": "SGN",
                        "arrivalAirportLocationName": "Sân bay Tân Sơn Nhất",
                        "arrivalCity": "Hồ Chí Minh",
                        "arrivalDateTime": "2021-08-16T07:20:00Z",
                        "cabinClassCode": "L1_ECO",
                        "cabinClassName": "ECONOMY",
                        "cabinClassText": "Economy",
                        "eticket": true,
                        "flightNumber": "135",
                        "journeyDuration": 130,
                        "marketingAirlineCode": "VJ",
                        "marriageGroup": null,
                        "mealCode": null,
                        "adultBaggage": null,
                        "childBaggage": null,
                        "infantBaggage": null,
                        "operatingAirline": {
                            "code": "VJ",
                            "name": "VietJet Air",
                            "equipment": null,
                            "flightNumber": "135"
                        },
                        "resBookDesignCode": "L1_ECO",
                        "seatsRemaining": null,
                        "stopQuantity": 0,
                        "stopQuantityInfo": null,
                        "flightDirection": "D",
                        "fareCode": null,
                        "fareBasicCode": null,
                        "supplierJourneyKey": "FE1G3mI6J96guNcAzJB8ySOHAwhKeuKrPN1RLIvlkec0JkXEWMPy6ItOC426vmwQR43zYvZ9J8VI6zaG7lw0LKmEHsO80BsCMC3Wd8iolbƒTmtG8M6L7bPi0uz2tkYAvXDMXc9HUGkG8lApWnPe3xpTBrE0U39yauxXCYdc1n9FtG7gDƒ01dSwfrBCjwi0vgtFCse3gS3k17xSKp05Uw44REYTvb82JA3bgQdkƒBFAmNfeceBsSG9xMBDMdYNrMIO¥oiODBDxq5ƒz06gIaktCwk0PN8BM5mGwƒ2LgRBYV0JrBwBdrM6oOcgDgC4OYyLgrDH9Knfns1ƒgDj27Ac0HAXbdbZ7XqkrzKbM4r9Q8cg8X47a9lNO4KƒqIvTnUvEY8M0c1wwuOOHYJTsJABLzVPo3kahvuxmO3QlZuBy4fOB8MXrƒzbqks9wZ46RcMmvj8rz2U¥hysKqksRuCInqmdWYetrTHeziXe1Hj2i44979g=",
                        "supplierFareKey": null,
                        "aircraft": "Airbus A321"
                        }
                    ],
                    "cabinClassName": "ECONOMY"
                    }
                ],
                "cabinClassName": "ECONOMY",
                "validReturnCabinClasses": null,
                "baggageItems": [
                    {
                    "id": "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
                    "name": "7kg xách tay",
                    "code": "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
                    "amount": 0,
                    "serviceType": "BAGGAGE",
                    "fareCode": null,
                    "direction": null,
                    "note": ""
                    }
                ],
                "mealItems": null,
                "passportMandatory": true,
                "onlyPayLater": false,
                "allowHold": true,
                "refundable": false
                }
            ],
            "tourCode": null,
            "osiCode": null
            },
            {
            "groupId": "59136e62-a451-491c-bf57-1495a5eb8053",
            "airline": "VJ",
            "airlineName": "VietJet Air",
            "airSupplier": "VJ",
            "fightNo": "176",
            "flightType": "DOMESTIC",
            "roundType": "ROUNDTRIP",
            "originLocationCode": "SGN",
            "originLocationName": "Sân bay Tân Sơn Nhất",
            "originCity": "Hồ Chí Minh",
            "originCountryCode": null,
            "originCountry": null,
            "destinationLocationCode": "HAN",
            "destinationLocationName": "Sân bay Nội Bài",
            "destinationCity": "Hà Nội",
            "destinationCountryCode": null,
            "destinationCountry": null,
            "requiredFields": null,
            "aircraft": "Airbus A321",
            "vnaArea": null,
            "arrivalDateTime": "2021-08-24T07:35:00Z",
            "returnDateTime": null,
            "departureDateTime": "2021-08-24T05:25:00Z",
            "totalPricedItinerary": 1,
            "pricedItineraries": [
                {
                "sequenceNumber": "ibe4754299329767108",
                "directionInd": "DEPARTURE",
                "ticketType": "ETICKET",
                "validatingAirlineCode": "VJ",
                "validatingAirlineName": "VietJet Air",
                "fightNo": "176",
                "airItineraryPricingInfo": {
                    "fareSourceCode": "dom389dca01-c0fd-466b-8a98-daaa4d5a06d4",
                    "fareType": "PUBLIC",
                    "divideInPartyIndicator": false,
                    "fareInfoReferences": null,
                    "itinTotalFare": {
                    "baseFare": {
                        "amount": 1319000,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "comboMarkup": null,
                    "equivFare": null,
                    "serviceTax": {
                        "amount": 350900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "totalFare": {
                        "amount": 1669900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "totalTax": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    },
                    "totalPaxFee": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                    }
                    },
                    "adultFare": {
                    "passengerTypeQuantities": {
                        "code": "ADT",
                        "quantity": 1
                    },
                    "fareBasisCodes": null,
                    "passengerFare": {
                        "baseFare": {
                        "amount": 1319000,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "comboMarkup": null,
                        "equivFare": null,
                        "serviceTax": {
                        "amount": 350900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "taxes": null,
                        "totalFare": {
                        "amount": 1669900,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "totalPaxFee": {
                        "amount": 0,
                        "currencyCode": null,
                        "decimalPlaces": 2
                        },
                        "surcharges": [
                        {
                            "amount": 0,
                            "indicator": "Ticket fee per segment",
                            "type": "Ticket fee per segment"
                        }
                        ]
                    }
                    },
                    "childFare": null,
                    "infantFare": null
                },
                "originDestinationOptions": [
                    {
                    "originLocationCode": "HAN",
                    "originLocationName": "Sân bay Nội Bài",
                    "originCity": "Hà Nội",
                    "originDateTime": "2021-08-24T05:25:00Z",
                    "destinationLocationCode": "SGN",
                    "destinationLocationName": "Sân bay Tân Sơn Nhất",
                    "destinationCity": "Hồ Chí Minh",
                    "destinationDateTime": "2021-08-24T07:35:00Z",
                    "flightDirection": "R",
                    "journeyDuration": 130,
                    "flightSegments": [
                        {
                        "departureAirportLocationCode": "SGN",
                        "departureAirportLocationName": "Sân bay Tân Sơn Nhất",
                        "departureCity": "Hồ Chí Minh",
                        "departureDateTime": "2021-08-24T05:25:00Z",
                        "arrivalAirportLocationCode": "HAN",
                        "arrivalAirportLocationName": "Sân bay Nội Bài",
                        "arrivalCity": "Hà Nội",
                        "arrivalDateTime": "2021-08-24T07:35:00Z",
                        "cabinClassCode": "L1_ECO",
                        "cabinClassName": "ECONOMY",
                        "cabinClassText": "Economy",
                        "eticket": true,
                        "flightNumber": "176",
                        "journeyDuration": 130,
                        "marketingAirlineCode": "VJ",
                        "marriageGroup": null,
                        "mealCode": null,
                        "adultBaggage": null,
                        "childBaggage": null,
                        "infantBaggage": null,
                        "operatingAirline": {
                            "code": "VJ",
                            "name": "VietJet Air",
                            "equipment": null,
                            "flightNumber": "176"
                        },
                        "resBookDesignCode": "L1_ECO",
                        "seatsRemaining": null,
                        "stopQuantity": 0,
                        "stopQuantityInfo": null,
                        "flightDirection": "R",
                        "fareCode": null,
                        "fareBasicCode": null,
                        "supplierJourneyKey": "qPHglSL8tSGƒ3tYhxs32uoafExuaR6¥D8DPJRmgypKWbSPECY06rnAXXpKJGOuZb7NEUz4HasidS6Kcff52bObVg9sDEUOLmHkeV1TaDv58k1CDTNƒyCESrKIDxxmqYUmuLSƒffYjj90rjE3zanJvDlCWjzbJ0DBYAszIKjG¥o7RMqlwoq6wrrJdOd4WNgPiooIUl4X14bZwOJmwqCDLLQDkqSQEcF1¥9rRzwbHQskz1QbtcUSpjbSrCyzB¥dsN4QEz0q6cFXltqF¥kr1pa¥HPƒqJkPVl35AkZjpH5n9KIQrPeVQbFskIp3Qi¥Mgc3S¥gfRBdNwWHAGFWU00HmhtmMI5uEEJCxEvhs28wq2yƒQi9U0HMXqWHfKhaRG788ƒLgXn3nIiM¥T514T9ƒWW0uv1wckVgDkdYKN4X9Dzi1oF0lhKTUlinhfxz3NPh2VdhI¥Hg2f6ƒb3Zz1Ggt8Kl2bKz15PdYBNJvd3j4h314KYP9g=",
                        "supplierFareKey": null,
                        "aircraft": "Airbus A321"
                        }
                    ],
                    "cabinClassName": "ECONOMY"
                    }
                ],
                "cabinClassName": "ECONOMY",
                "validReturnCabinClasses": null,
                "baggageItems": [
                    {
                    "id": "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
                    "name": "7kg xách tay",
                    "code": "air-tickets.baggage-items.vietnam.vj.economy.baggage.adult.free",
                    "amount": 0,
                    "serviceType": "BAGGAGE",
                    "fareCode": null,
                    "direction": null,
                    "note": ""
                    }
                ],
                "mealItems": null,
                "passportMandatory": true,
                "onlyPayLater": false,
                "allowHold": true,
                "refundable": false
                }
            ],
            "tourCode": null,
            "osiCode": null
            }
        ],
        "hotelAvailability": null,
        "hotelProductPayload": null,
        "hotelProduct": null,
        "offlineBooking": null,
        "travelerInfo": null,
        "isPerBookingType": true
    }
```

***

### Get list of special service request that can be purchased API <a href="#get-list-of-special-service-request-that-can-be-purchased-api" id="get-list-of-special-service-request-that-can-be-purchased-api"></a>

GET: /api/air-tickets/ssr-offer/{bookingNumber}

Get list of special service request that can be purchased

#### Parameter <a href="#parameter_1" id="parameter_1"></a>

| Parameter                        | Description               |
| -------------------------------- | ------------------------- |
| bookingNumber (String, Required) | Reference code to booking |

**Example**

?bookingNumber=`ADCO2107201223969`

#### Response <a href="#response_3" id="response_3"></a>

| Parameter                                      | Description                                                                       |
| ---------------------------------------------- | --------------------------------------------------------------------------------- |
| bookingNumber(String, Optional)                | Code used to refer to booking. This code is unique.                               |
| departSsrOfferItems (SSROfferItem, Optional)   | Utilities for departure direction tickets                                         |
| departureAirportLocationCode(String, Optional) | Identifier code for the departure airport                                         |
| arrivalAirportLocationCode(String, Optional)   | Identifier code for the arrival airport                                           |
| departureDateTime(String, Optional)            | Departure date and time                                                           |
| arrivalDateTime(String, Optional)              | Arrival time and date                                                             |
| ssrItems (Array\[SSRItem], Optional)           | List of utilities                                                                 |
| amount (Number, Optional)                      | Price                                                                             |
| code(String, Optional)                         | Vendor add-on extension identifier                                                |
| id(String, Optional)                           | Utility identifier. Each code is unique and does not coincide in the same journey |
| name(String, Optional)                         | Name of add-on service to buy more                                                |
| serviceType(String, Optional)                  | Type of add-on service to buy                                                     |
| BAGGAGE: extra baggage                         |                                                                                   |
| MEAL: side meal                                |                                                                                   |
| returnSsrOfferItems (SSROfferItem, Optional)   | Utilities for return tickets                                                      |
| Similar utility for one-way tickets            |                                                                                   |
| duration(Integer, Optional)                    |                                                                                   |
| errors (Array\[Error], Optional)               |                                                                                   |
| infos(Array\[Info], Optional)                  |                                                                                   |
| success(Boolean, Optional)                     |                                                                                   |
| textMessage(String, Optional)                  |                                                                                   |

**Example**

```json
{
    "bookingNumber" : "ADCO2107201223969",
    "departSsrOfferItems" : [ {
        "arrivalAirportLocationCode" : "SGN",
        "arrivalAirportLocationName" : null,
        "arrivalCity" : null,
        "arrivalDateTime" : "2021-08-16T07:20:00.000Z",
        "departureAirportLocationCode" : "HAN",
        "departureAirportLocationName" : null,
        "departureCity" : null,
        "departureDateTime" : "2021-08-16T05:10:00.000Z",
        "ssrItems" : [ {
        "amount" : 170500.0,
        "code" : "Bag 15kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_2ae7cd77-cab3-497a-ac75-c7fcc8d9e9ed",
        "name" : "Bags 15kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 192500.0,
        "code" : "Bag 20kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_9f675ebc-bfbb-45c9-8c10-c8d07f45581f",
        "name" : "Bag 20kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 258500.0,
        "code" : "Bag 25kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_6a599353-8494-4286-91fa-a6941c5a945b",
        "name" : "Bag 25kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 368500.0,
        "code" : "Bag 30kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_f8ebf8bb-65d6-463c-942a-bed90f74b1fa",
        "name" : "Bag 30kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 423500.0,
        "code" : "Bag 35kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_25435c21-500c-45c5-92e8-b70227fad826",
        "name" : "Bag 35kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 478500.0,
        "code" : "Bag 40kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_a28ed2a2-df6e-4493-aa27-d46290424a32",
        "name" : "Bag 40kg",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 412500.0,
        "code" : "Oversize 20kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_3d767edf-7441-43e1-b4b0-80f0d6770f6e",
        "name" : "Oversize 20kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 588500.0,
        "code" : "Oversize 30kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_6071aea5-06fd-4669-968c-769c8813d8b9",
        "name" : "Oversize 30kgs",
        "serviceType" : "BAGGAGE"
        } ]
    } ],
    "duration" : 3686,
    "errors" : null,
    "infos" : null,
    "returnSsrOfferItems" : [ {
        "arrivalAirportLocationCode" : "HAN",
        "arrivalAirportLocationName" : null,
        "arrivalCity" : null,
        "arrivalDateTime" : "2021-08-24T07:35:00.000Z",
        "departureAirportLocationCode" : "SGN",
        "departureAirportLocationName" : null,
        "departureCity" : null,
        "departureDateTime" : "2021-08-24T05:25:00.000Z",
        "ssrItems" : [ {
        "amount" : 170500.0,
        "code" : "Bag 15kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_53563c43-daf8-44d6-ab75-d1e8056addf9",
        "name" : "15kg ký gửi",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 192500.0,
        "code" : "Bag 20kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_18395f19-1eae-4741-9974-bc4154340351",
        "name" : "20kg ký gửi",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 258500.0,
        "code" : "Bag 25kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_5beb92dd-f178-4b8c-b77f-777527540a36",
        "name" : "Bag 25kg",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 368500.0,
        "code" : "Bag 30kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_543dcfb6-a75c-4c5b-bfb3-ab425b20dbc7",
        "name" : "Bag 30kg",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 423500.0,
        "code" : "Bag 35kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_f5d90a7c-a1dd-4eaa-8a85-478195a5e8e2",
        "name" : "Bag 35kg",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 478500.0,
        "code" : "Bag 40kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_89bd8235-e51d-47bb-a712-3cf0e24c68da",
        "name" : "Bag 40kg",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 412500.0,
        "code" : "Oversize 20kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_ed1d0701-08e8-4e05-94f1-19d0e71d89fb",
        "name" : "Oversize 20kgs",
        "serviceType" : "BAGGAGE"
        }, {
        "amount" : 588500.0,
        "code" : "Oversize 30kgs",
        "direction" : null,
        "fareCode" : null,
        "id" : "SSRCode_aeb6be0b-3ff0-498a-8093-d1bfaa3d4f9f",
        "name" : "Oversize 30kgs",
        "serviceType" : "BAGGAGE"
        } ]
    } ],
    "success" : true,
    "textMessage" : null
}
```

***

### Update booking and reservation information API <a href="#update-booking-and-reservation-information-api" id="update-booking-and-reservation-information-api"></a>

POST: /api/air-tickets/add-booking-traveller

Update information: Passengers, contact person, invoice information, … and reservation request

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

| Parameter                                                                                                                                                                                                      | Description                                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| bookingNumber(String, Optional)                                                                                                                                                                                | Code used to refer to booking. This code is unique.                               |
| bookingContacts (Array\[BookingContact], Required)                                                                                                                                                             | List of contact information                                                       |
| email (String, Required)                                                                                                                                                                                       | Email of the contact                                                              |
| firstName(String, Required                                                                                                                                                                                     | Contact’s first and middle name                                                   |
| surName(String, Required)                                                                                                                                                                                      | Contact person’s last name                                                        |
| phoneNumber1 (String, Required)                                                                                                                                                                                | Phone number of the contact person                                                |
| bookingTravelerInfos (Array(BookingTravelerInfoDTO), Required)                                                                                                                                                 | List of customer information, accompanying services                               |
| serviceRequests(Array\[BookingServiceRequestDTO], Optional)                                                                                                                                                    | Information about accompanying services                                           |
| Note: If SSR is flight delay insurance for 2-way flights, it is mandatory to buy both, but cannot buy one-way and cancel one-way. Late flight insurance price does not include infants, only adults + children |                                                                                   |
| bookingDirection(String, Required)                                                                                                                                                                             | Departure direction                                                               |
| Package                                                                                                                                                                                                        |                                                                                   |
| • DEPARTURE : afternoon go                                                                                                                                                                                     |                                                                                   |
| • RETURN: return afternoon                                                                                                                                                                                     |                                                                                   |
| Insurance                                                                                                                                                                                                      |                                                                                   |
| • ONEWAY: for 1 way                                                                                                                                                                                            |                                                                                   |
| • ROUNDTRIP: for both directions                                                                                                                                                                               |                                                                                   |
|                                                                                                                                                                                                                |                                                                                   |
| ssrAmount (Number, Required)                                                                                                                                                                                   | Price                                                                             |
| ssrCode(String, Required)                                                                                                                                                                                      | Vendor add-on extension identifier                                                |
| ssrId(String, Required)                                                                                                                                                                                        | Utility identifier. Each code is unique and does not coincide in the same journey |
| ssrName(String, Required)                                                                                                                                                                                      | Name of add-on service to buy more                                                |
| serviceType(String, Required)                                                                                                                                                                                  | Type of add-on service to buy                                                     |
| •BAGGAGE: extra baggage                                                                                                                                                                                        |                                                                                   |
| •MEAL: side meal                                                                                                                                                                                               |                                                                                   |
| •INSURANCE: flight delay insurance                                                                                                                                                                             |                                                                                   |
| fareCode(String, Required)                                                                                                                                                                                     | Journey identifier information                                                    |
| bookingNumber(String, Required)                                                                                                                                                                                | Code used to refer to booking. This code is unique.                               |
| traveler (BookingTravelerDTO, Required)                                                                                                                                                                        | Passenger information                                                             |
| adultType(String, Required)                                                                                                                                                                                    | Show passenger type                                                               |
| ADT: adult                                                                                                                                                                                                     |                                                                                   |
| CHD: children                                                                                                                                                                                                  |                                                                                   |
| INF: baby                                                                                                                                                                                                      |                                                                                   |
| firstName(String, Required)                                                                                                                                                                                    | First and middle name                                                             |
| gender(String, Required)                                                                                                                                                                                       | Sex                                                                               |
| MALE: male                                                                                                                                                                                                     |                                                                                   |
| FEMALE: female                                                                                                                                                                                                 |                                                                                   |
| BOY: boy                                                                                                                                                                                                       |                                                                                   |
| GIRL: baby girl                                                                                                                                                                                                |                                                                                   |
| INF: infant                                                                                                                                                                                                    |                                                                                   |
| memberCard (Boolean, Optional)                                                                                                                                                                                 | Do you have a membership card?                                                    |
| memberCardType(String, Optional)                                                                                                                                                                               | Membership card type                                                              |
| memberCardNumber(String, Optional)                                                                                                                                                                             | Membership card number                                                            |
| surName(String, Required)                                                                                                                                                                                      | Last name - bookingNumber(String, Required)                                       |
| dob(String, Optional)                                                                                                                                                                                          | Date of birth                                                                     |
| taxReceiptRequest(TaxReceiptRequest, Required)                                                                                                                                                                 | Journey identifier information                                                    |
| bookingNumber(String, Required)                                                                                                                                                                                | Code used to refer to booking. This code is unique.                               |
| taxReceiptRequest(Boolean, Required)                                                                                                                                                                           | Information on whether to issue an invoice?                                       |
| taxAddress1(String, Optional)                                                                                                                                                                                  | Invoice delivery address                                                          |
| taxCompanyName(String, Optional)                                                                                                                                                                               | Invoice company name                                                              |
| taxNumber(String, Optional)                                                                                                                                                                                    | Tax code                                                                          |
| taxPersonalInfoContact(String, Optional)                                                                                                                                                                       | Contact person name                                                               |

**Example**

```json
    {
        "bookingNumber": "ADCO2107211224000",
        "bookingContacts": [
            {
                "email": "dang.nguyenhai@gotadi.com",
                "firstName": "HAI DANG",
                "phoneCode1": "84",
                "phoneNumber1": "0932909474",
                "surName": "NGUYEN",
                "bookingNumber": "ADCO2107211224000"
            }
        ],
        "bookingTravelerInfos": [
            {
            "traveler": {
                "adultType": "ADT",
                "documentNumber": "SLKDF234C",
                "documentExpiredDate": "2025-06-12T00:00:00.000Z",
                "documentIssuingCountry": "vn",
                "documentType": "PP",
                "firstName": "HAI DANG",
                "gender": "MALE",
                "country": "vn",
                "memberCard": false,
                "memberCardType": null,
                "memberCardNumber": null,
                "surName": "NGUYEN",
                "bookingNumber": "ADCO2107211224000",
                "dob": null
            },
            "serviceRequests": [
                {
                "bookingDirection": "DEPARTURE",
                "bookingNumber": "ADCO2107211224000",
                "fareCode": "domdb93cf84-d023-4222-9b56-f096d9e5df35",
                "serviceType": "BAGGAGE",
                "ssrAmount": 258500,
                "ssrCode": "Bag 25kgs",
                "ssrId": "SSRCode_941c225f-0cb5-4e46-a669-5a75d7d3afde",
                "ssrName": "25kg ký gửi"
                },
                {
                "bookingNumber": "ADCO2107211224000",
                "bookingDirection": "ONEWAY",
                "fareCode": "domdb93cf84-d023-4222-9b56-f096d9e5df35",
                "serviceType": "INSURANCE",
                "ssrCode": "INS1_VNBVGTDTD_TD",
                "ssrId": "BV-GTD-TRAVEL DELAY-WD-1W",
                "ssrAmount": 35000,
                "ssrName": "B%E1%BA%A3o%20hi%E1%BB%83m%20tr%E1%BB%85%20chuy%E1%BA%BFn%20bay"
                }
            ]
            }
        ],
        "osiCodes": [],
        "taxReceiptRequest": {
            "bookingNumber": "ADCO2107211224000",
            "taxReceiptRequest": false
        }
    }
```

#### Response <a href="#response_4" id="response_4"></a>

| Parameter                           | Description                                         |
| ----------------------------------- | --------------------------------------------------- |
| bookingCode (BookingCode, Optional) | Update information and reserve seats                |
| bookingCode(String, Optional)       | Code used to describe basic information of booking  |
| bookingNumber(String, Optional)     | Code used to refer to booking. This code is unique. |
| duration(Integer, Optional)         |                                                     |
| errors (Array\[Error], Optional)    |                                                     |
| infos(Array\[Info], Optional)       |                                                     |
| success(Boolean, Optional)          |                                                     |
| textMessage(String, Optional)       |                                                     |

**Example**

```json
{
    "bookingCode" : {
        "bookingCode" : "BOD::210721::86088c0e-d84e-46e1-913c-5d450418a951",
        "bookingNumber" : "ADCO2107211224000"
    },
    "duration" : 15948,
    "errors" : null,
    "infos" : null,
    "isSuccess" : null,
    "otpServiceRes" : {
        "duration" : null,
        "errors" : null,
        "expDate" : null,
        "expired" : null,
        "fullQuota" : null,
        "infos" : null,
        "isSuccess" : null,
        "lifeTimeInMin" : null,
        "matched" : null,
        "notFound" : false,
        "outOfSlot" : null,
        "phoneNumber" : null,
        "serviceID" : null,
        "smsServiceAvailable" : null,
        "success" : true,
        "tag" : null,
        "textMessage" : null,
        "used" : null,
        "verificationCode" : null
    },
    "success" : true,
    "textMessage" : null
}
```


# Hotel

##


# Search API

## 1. API Search places, hotels by keyword&#x20;

`GET: api/v3/hotel/search-keyword`&#x20;

Search for places and hotels by keyword.

<details>

<summary>Parameters</summary>

* keyword query (String, optional) Search keyword&#x20;
* language query (String, Required)&#x20;

  Language&#x20;

  * `vi` : Vietnamese&#x20;
  * `en`: English&#x20;
* pageNumber `query` (String, Optional)&#x20;

  Page No&#x20;
* pageSize `quer`y (String, Optional)&#x20;

  Number of elements on the page

</details>

## Response

**Code 200**

<details>

<summary>Model</summary>

* result(SearchKeywordResult, optional) Information returned results&#x20;
  * contents (Array\[Content], optional), List of areas, hotels&#x20;
  * searchCode(String, optional), Search Identifier&#x20;
  * searchType(string, optional) = \[CONTINENT, COUNTRY, PROVINCE\_STATE, HIGH\_LEVEL\_REGION, MULTI\_CITY\_VICINITY, CITY, NEIGHBORHOOD, AIRPORT, POINT\_OF\_INTEREST, TRAIN\_STATION, METRO\_STATION, HOTEL],&#x20;

    Search Type&#x20;
  * name(String, optional), Name of area, hotel&#x20;
  * supplier(String, optional) = \[EXPEDIA, AXISROOM, BEDLINKER, VINPEARL], Supplier&#x20;
  * address(Address, optional) Hotel address information&#x20;
  * city(string, optional), City&#x20;
  * countryCode(string, optional), Country code&#x20;
  * countryName(string, optional), Country name&#x20;
  * lineOne(string, optional), Address line 1&#x20;
  * lineTwo(string, optional), Address line 2&#x20;
  * postalCode(string, optional), ZIP code&#x20;
  * stateProvinceCode(string, optional), City code&#x20;
  * stateProvinceName(string, optional) Name of province&#x20;
  * tags (Array\[String], optional), Tags&#x20;
  * duration (integer, optional),&#x20;
  * errors (Array\[Error], optional),&#x20;
  * infos(Array\[Info], optional),&#x20;
  * success(boolean, optional),&#x20;
  * textMessage(string, optional)

</details>

## 2. Hotel Search API with best price selection (search-best-rate)

`GET: /api/v3/hotel/search-best-rates`&#x20;

Returns hotel search results with the best price selection.&#x20;

The data will be cached for a period of time with the key as searchId. Caching time is about 15 minutes, this time is subject to change.&#x20;

Allows filtering and sorting of returned results.&#x20;

[Filtering by coordinates, distance requires 3 parameters:](#user-content-fn-1)[^1]

* filterGeoDistanceLat
* filterGeoDistanceLon
* filterGeoDistanceMeters

<details>

<summary>Parameters</summary>

* rateOption query(String, optional)&#x20;

  Price options. There are 2 pricing options: `OTA, TA`. Default is `OTA`.&#x20;

  Attention&#x20;

  * Only TA contracting partners can use the TA pricing option.&#x20;
  * If you want to get both price options, then `?rateOption=TA,OTA&...`&#x20;
* searchCode `query` (String, Required)&#x20;

  Area code or hotel code.&#x20;

  * In case you want to search by hotel list, you must first get the hotel list containing the id to search.&#x20;
  * Syntax to find multiple hotels `...&searchCode=id1,id2,id3&searchType=HOTEL&supplier=GOTADI&...`&#x20;
* searchType `query` (String, Required)&#x20;

  Area code type. Ex: CITY, HOTEL, …&#x20;
* language `query` (String, Required)&#x20;

  Language. (vi, en)&#x20;
* currency `query` (String, Required)

  Currency. (VND, USD)&#x20;
* checkIn `query` (String, Required)&#x20;

  Check-in date. Format: yyyy-MM-dd&#x20;
* checkOut `query` (String, Required)&#x20;

  Check-out date. Format: yyyy-MM-dd&#x20;
* paxInfos `query` (String\[], Required)&#x20;

  Room and guest information&#x20;

  Format: `SoNguoiLon-TuoiTreEm1,TuoiTreEm2`&#x20;

  For example:&#x20;

  * 2 adults and 2 children, 1 4-year-old, 1 6-year-old: `...&paxInfos=2-4,6&...`
  * 2 rooms, room 1 includes 2 adults, room 2 includes 2 adults and 2 children, 1 child 4 years old and 1 child 6 years old: `...&paxInfos=2&paxInfos=2-4,6&...`&#x20;
* supplier `query` (String, Required)&#x20;

  Supplier, Get information from the results returned item 4.2&#x20;
* filterHotelName `query` (String, Optional)&#x20;

  Filter by names that start with
* filterHotelCategories `query` (String, Optional)&#x20;

  Filter by hotel category&#x20;
* filterFromPrice `query` (Double, Optional)

  Filter by price starting from&#x20;
* filterToPrice `query` (Double, Optional)&#x20;

  Filter by price ending to&#x20;
* filterFromStarRating `query` (Double, Optional)&#x20;

  Filter by star rating starting from&#x20;
* filterToStarRating `query` (Double, Optional)&#x20;

  Filter by star rating ending to&#x20;
* filterFromGuestRating `query` (Double, Optional)&#x20;

  Filter by guest reviews starting at&#x20;
* filterToGuestRating `query` (Double, Optional)&#x20;

  Filter by guest reviews ending in&#x20;
* filterAmenities `query` (String\[], Optional)&#x20;

  Filter by hotel amenities&#x20;
* filterRoomAmenities `query` (String\[], Optional)&#x20;

  Filter by room amenities&#x20;
* filterRoomViews `query` (String\[], Optional)&#x20;

  Filter by room view&#x20;
* filterThemes `query` (String\[], Optional)&#x20;

  Filter by hotel theme&#x20;
* filterMealPlans `query` (String\[], Optional)&#x20;

  Filter by meal&#x20;
* filterGeoDistanceLat `query` (Double, Optional)&#x20;

  Filter by lat . coordinates&#x20;
* filterGeoDistanceLon `query` (Double, Optional)&#x20;

  Filter by coordinates lon&#x20;
* filterGeoDistanceMeters `query` (Integer, Optional)&#x20;

  Filter by coordinates and distance. Units of meters&#x20;
* sortField `query`(String, Optional)&#x20;

  Sort by: price, starRating, guestRating&#x20;
* sortOrder `query`(String, Optional)&#x20;

  Sort by: ASC, DESC&#x20;
* pageNumber `query` (String, Optional)&#x20;

  Page No&#x20;
* pageSize `query` (String, Optional)&#x20;

  Number of elements on the page

</details>

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* result (Object, Optional)

  Thông tin kết quả trả về

  * searchId (String, Optional)
    * Mã tham chiếu đến kết quả tìm kiếm
    * searchId được tạo ra dựa trên các tham số bắt buộc, nếu các tham số không thay đổi thì searchId sẽ không thay đổi
    * Được dùng làm tham số khi search-all-rates
  * propertyAvailable (Array\[PropertyAvailable], Optional)

    Mảng chứa đối tượng thông tin khách sạn

    * address (Address, optional),

      Thông tin địa chỉ khách sạn

      * city (string, optional),

        Thành phố
      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * amenities (Array\[Amenity], optional),

      Thông tin danh sách tện nghi kèm theo của tùy chọn giá

      * id (string, optional),

        Id của tiện nghi
      * name (string, optional)

        Tên của tiện nghi
      * ~~value (string, optional)~~
      * ~~group (string, optional)~~
    * basePrice (number, optional),

      Giá cơ bản
    * basePriceBeforePromo (number, optional),

      Giá cơ bản trước khuyến mãi. Nếu không có khuyến mãi thì giá trị là 0
    * breakfastIncluded (boolean, optional),

      Có bao gồm bữa ăn sáng hay không
    * cancelFree (boolean, optional),

      Cho phép hủy phòng miễn phí hay không
    * currency (string, optional) = \[‘VND’, ‘USD’],

      Tiền tệ
    * images (Array\[HotelImage], optional),

      Thông tin hình ảnh của khách sạn

      * caption (string, optional),

        Tiêu đề hình ảnh
      * link (string, optional),

        Liên kết hình ảnh, là đường dẫn tuyệt đối
      * position (integer, optional)

        Vị trí sắp xếp của hình ảnh
    * language (string, optional) = \[‘vi’, ‘en’],

      Ngôn ngữ
    * latitude (number, optional),

      Vĩ độ
    * longitude (number, optional),

      Kinh độ
    * promo (boolean, optional),

      Có khuyến mãi hay không
    * propertyCategory (PropertyCategory, optional),

      Danh mục khách sạn

      * id (string, optional),

        Id danh mục khách sạn
      * name (string, optional)

        Tên danh mục khách sạn
    * propertyId (string, optional),

      Id định danh khách sạn
    * propertyName (string, optional),

      Tên khách sạn
    * refundable (boolean, optional),

      Có được trả tiền khi hủy phòng hay không
    * reviewCount (string, optional),

      Số lượng đánh giá của khách
    * ~~reviewRecommendPercent (string, optional),~~
    * reviewScore (string, optional),

      Điểm đánh giá trung bình của khách. Lớn nhất là 5
    * stars (string, optional),

      Hạng sao khách sạn
    * supplier (string, optional) = \[‘EXPEDIA’, ‘AXISROOM’, ‘BEDLINKER’],

      Nguồn cung cấp khách sạn
    * tags (Array\[string], optional),

      Thẻ cuả khách sạn
    * taxAndServiceFree (number, optional),

      Thuế và phí kèm theo
    * totalPrice (number, optional),

      Tổng giá tiền tạm tính
    * totalRooms (integer, optional),

      Số lượng phòng còn trống có thể book
    * ~~tripAdvisor (TripAdvisor, optional)~~
    * rateOption (String, optional)

      Tuỳ chọn giá. Có 2 tuỳ chọn giá là `OTA, TA`. Mặc định là `OTA`.
    * masterPropertyId (Long, optional)

      Mã định danh khách sạn chính.
  * pageResult (Object, Optional)

    Thông tin trang trả về

    * pageSize (Integer, Optional)

      Kích thước trang
    * pageNumber (Integer, Optional)

      Thứ tự trang
    * totalPage (Integer, Optional)

      Tổng số trang
    * totalItems (Integer, Optional)

      Tổng số phần tử
* duration (Integer, Optional)
* success (Integer, Bool)
* infos (Array\[InfosDTO], Optional)
* errors (Array\[ErrorsDTO], Optional)
* textMessage (String, Optional)

</details>

### 3. API Filter option <a href="#id-3-api-tuy-chon-bo-loc" id="id-3-api-tuy-chon-bo-loc"></a>

GET: /api/v3/hotel/filter-options

Lấy danh sách các giá trị có thể áp dụng trên bộ lọc trên kết quả tìm kiếm. Có thể áp dụng cùng lúc nhiều bộ lọc với nhau.

#### Parameters <a href="#parameters_2" id="parameters_2"></a>

<details>

<summary>Parameters</summary>

* language `query` (String, Required)

  Ngôn ngữ

  * `vi` : Tiếng Việt
  * `en`: Tiếng Anh

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

<details>

<summary>Model</summary>

* result (FilterOptionsResult, optional)

  Thông tin kết quả trả về

  * guestRatings (Array\[FilterItemDouble], optional),

    Thông tin đánh giá khách sạn của khách. Cao nhất là 5

    * name (string, optional),

      Tên bộ lọc đánh giá của khách
    * value (number, optional)

      Giá trị bộ lọc đánh gía của khách
  * language (string, optional) = \[‘vi’, ‘en’],

    Ngôn ngữ trả về
  * mealPlans (Array\[FilterItemString], optional),

    Thông tin tùy chọn bộ lọc theo bữa ăn

    * name (string, optional),

      Mô tả bữa ăn
    * value (string, optional)

      Id của bộ lọc bữa ăn
  * prices (Array\[FilterPrice], optional),

    Thông tin tùy chọn theo bộ lọc giá

    * operator (string, optional),

      Phương thức so sánh

      * `less_than`: Giá nhỏ hơn
      * `range`: Giá trong khoảng
      * `greater_than`: Giá lớn hơn
    * from (number, optional),

      Giá từ
    * to (number, optional)

      Giá đến
  * propertyAmenities (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo tiện nghi khách sạn

    * name (string, optional),

      Mô tả tiện nghi
    * value (string, optional)

      Id của bộ lọc tiện nghi
  * propertyCategories (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo danh mục khách sạn

    * name (string, optional),

      Mô tả danh mục khách sạn
    * value (string, optional)

      Id của bộ lọc theo danh mục khách sạn
  * propertyRatings (Array\[FilterItemDouble], optional),

    Thông tin bộ lọc theo hạng sao

    * name (string, optional),

      Mô tả hạng sao
    * value (number, optional)

      Giá trị hạng sao
  * roomAmenities (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo tiện nghi trong phòng

    * name (string, optional),

      Mô tả tiện nghi trong phòng
    * value (string, optional)

      Id của bộ lọc theo tiện nghi trong phòng
  * roomViews (Array\[FilterItemString], optional),

    Thông tin bộ lọc theo hướng nhìn phòng

    * name (string, optional),

      Mô tả hướng nhìn phòng
    * value (string, optional)

      Id của bộ lọc theo hướng nhìn phòng
  * themes (Array\[FilterItemString], optional)

    Thông tin bộ lọc theo chủ đề của khách sạn

    * name (string, optional),

      Mô tả chủ đề của khách sạn
    * value (string, optional)

      Id của bộ lọc theo chủ đề
  * bedTypes (Array\[FilterItemString], optional)

    Thông tin bộ lọc theo loại giường của khách sạn

    * name (string, optional),

      Mô tả loại giường của khách sạn
    * value (string, optional)

      Id của bộ lọc theo loại giường
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 4. Hotel Searching API with all prices rates (search-all-rates) <a href="#id-4-api-tim-kiem-khach-san-voi-tat-ca-tuy-chon-gia-search-all-rates" id="id-4-api-tim-kiem-khach-san-voi-tat-ca-tuy-chon-gia-search-all-rates"></a>

GET: /api/v3/hotel/search-all-rates

Kết quả trả về thông tin chi tiết của một khách sạn, thông tin phòng và thông tin của tất cả tùy chọn giá.

Mỗi một khách sạn có thể có 1 hoặc nhiều phòng, mỗi phòng sẽ có một hoặc nhiều tùy chọn giá khác nhau tùy theo bữa ăn và dịch vụ kèm theo.

#### Parameters <a href="#parameters_3" id="parameters_3"></a>

<details>

<summary>Parameters</summary>

* searchId `query` (string, required)

  Mã tìm kiếm, được lấy từ mục search-all-rate
* propertyId `query` (string, required)

  Mã định danh khách sạn theo supplier. Được lấy từ kết quả trả về của search-best-rate
* supplier `query` (String, required)

  Nhà cung cấp. Được lấy từ kết quả trả về của search-best-rate
* checkIn `query` (String, required)

  Ngày nhận phòng.

  Định dạng: `yyyy-MM-dd`
* checkOut `query` (String, required)

  Ngày trả phòng.

  Định dạng: `yyyy-MM-dd`
* paxInfos `query` (String\[], required)

  Thông tin phòng và khách ở

  Định dạng: `SoNguoiLon-TuoiTreEm1,TuoiTreEm2`

  Ví dụ:

  * 2 người lớn và 2 trẻ em, 1 trẻ 4 tuổi, 1 trẻ 6 tuổi: \`…\&paxInfos=2-4,6&…
  * 2 phòng, phòng 1 gồm 2 người lớn, phòng 2 gồm 2 người lớn và 2 trẻ em, 1 trẻ em 4 tuổi và 1 trẻ em 6 tuổi: \`…\&paxInfos=2\&paxInfos=2-4,6&…

</details>

#### Response <a href="#response_3" id="response_3"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (SearchAllRatesResult, optional),
  * tripId (string, optional),

    Mã định danh kết quả search-all-rate, mỗi lần gọi search-all-rate sẽ tạo ra tripId mới, nó được sử dụng khi đi thao tác đặt phòng
  * searchId (string, optional),

    Mã tham chiếu đến search-best-rate, được lấy từ kết quả search-best-rate
  * propertyAllRate (PropertyAllRate, optional)

    Thông tin trả về chi tiết của một khách sạn, thông tin phòng và thông tin của tất cả tùy chọn giá

    * address (Address, optional)

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * airportCode (string, optional),

      Mã sân bay
    * amenities (Array\[Amenity], optional),

      Mảng đối tượng chứa thông tin tiện nghi của khách sạn

      * id (string, optional),

        Mã tiện nghi khách sạn
      * name (string, optional),

        Tên của tiện nghi khách sạn
      * symbol (string, optional),

        Biểu tượng hiển thị của tiện nghi khách sạn
      * ~~value (string, optional)~~
      * group (string, optional)

        Thông tin tiện nghi của khách sạn được gom nhóm, với các nhóm sau

        * `OTHER`: Tiện nghi khác
        * `POPULAR_FACILITIES`: Tiện nghi phổ biến
        * `SERVICE`: Dịch vụ
        * `BUSINESS_SERVICE`: Dịch vụ doanh nghiệp
        * `RECREATION`: Cơ sở giải trí
        * `ENTERTAINMENT`: Giải trí đa phương tiện
        * `FITNESS_AND_SPA`: fitness và spa
        * `FOOD_AND_DRINK`: Khu vực ăn uống
        * `CONVENIENCES`: Tiện ích
        * `INTERNET`: Mạng intenet
        * `PARKING_AND_TRANSPORT`: Khu vực để xe và đưa đón
        * `PET`: Thú cưng
    * ~~attributes (Array\[Attribute], optional),~~
    * checkin (Checkin, optional),

      Khoảng thời gian nhận phòng, theo giờ địa phương của khách sạn

      * beginTime (string, optional),

        Thời gian bắt đầu được nhận phòng. Mặc định: 14:00
      * endTime (string, optional)

        Thời gian kết thúc được nhận phòng. Mặc định: 24:00
    * checkout (Checkout, optional),

      Thông tin thời gian trả phòng. Mặc định trước 12:00

      * endTime (string, optional)

        Thời gian trả phòng tối đa. Mặc định trước 12:00
    * currency (string, optional) = \[‘VND’, ‘USD’],

      Thông tin tiền tệ trả về
    * descriptions (Array\[Attribute], optional),

      Thông tin mô tả về khách sạn

      * id (string, optional),

        Mã định danh thuộc tính mô tả
      * name (string, optional),

        Tên thuộc tính

        * `description`: mô tả chung
        * `amenities`: mô tả chung về tiện nghi của khách sạn
        * `dining`: Mô tả về chỗ ăn uống của khách sạn
        * `renovations`: Mô tả về quá trình cải tạo phòng hoặc khách sạn mới đây
        * `national_ratings`: Nêu rõ nguồn xếp hạng sao của khách sạn
        * `business_amenities`: Mô tả về tiện nghi dành cho doanh nghiệp tại chỗ nghỉ, Ví dụ: phòng hội nghị
        * `rooms`: Mô tả về phòng
        * `attractions`: Mô tả về điểm tham quan gần khách sạn
        * `location`: Mô tả về vị trí của khách sạn
        * `headline`: Mô tả tóm tắt
      * value (string, optional)

        Thông tin mô tả
    * fees (Array\[Attribute], optional),

      Thông tin mô tả về một số khoản phụ phí kèm theo

      * id (string, optional),

        Mã định danh thuộc tính phí
      * name (string, optional),

        Tên thuộc tính phí

        * `mandatory`: Phí bắt buộc
        * `optional`: Phí không bắt buộc
      * value (string, optional)

        Mô tả về khoản phí
    * images (Array\[HotelImage], optional),

      Hình ảnh của khách sạn

      * caption (string, optional),

        Tiêu đề của hình ảnh
      * link (string, optional),

        Liên kết tới hình ảnh. Liên kết tuyệt đối
      * position (integer, optional)

        Vị trí sắp xếp hình ảnh
    * inclusions (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin mô tả về thuộc tính của khách sạn

      * id (string, optional),

        Mã định danh thuộc tính
      * name (string, optional),

        Mô tả thuộc tính
      * ~~value (string, optional)~~
    * language (string, optional) = \[‘vi’, ‘en’],

      Ngôn ngữ trả về
    * latitude (number, optional),

      Vĩ độ của khách sạn
    * longitude (number, optional),

      Kinh độ của khách sạn
    * policies (Array\[Attribute], optional),

      Thông tin về chính sách khách sạn mà khách cần lưu ý.

      * id (string, optional),

        Mã định danh chính sách
      * name (string, optional),

        Tên thuộc chính sách

        * `know_before_you_go`: Mô tả thông tin có thể hữu ích khi lập kế hoạch cho chuyến đi đến nơi này
      * value (string, optional)

        Mô tả về chính sách
    * propertyCategory (PropertyCategory, optional),

      Danh mục của khách sạn

      * id (string, optional),

        Mã định danh danh mục khách sạn
      * name (string, optional)

        Tên danh mục khách sạn
    * propertyId (string, optional),

      Mã định danh khách sạn
    * propertyName (string, optional),

      Tên khách sạn
    * ~~rank (integer, optional),~~
    * rating (Rating, optional),

      Đánh giá về khách sạn

      * ratingGuest (RatingGuest, optional)

        Đánh giá của khách

        * amenities (string, optional),

          Xếp hạng cho các tiện nghi do khách sạn cung cấp, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * cleanliness (string, optional),

          Đánh giá mức độ sạch sẽ cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * comfort (string, optional),

          Đánh giá mức độ thoải mái của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * condition (string, optional),

          Xếp hạng cho tình trạng của chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * count (integer, optional),

          Tất cả xếp hạng đánh giá của khách giành cho khách sạn
        * location (string, optional),

          Xếp hạng về mức độ hấp dẫn của vị trí của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * neighborhood (string, optional),

          Xếp hạng về mức độ hài lòng của khu vực lân cận của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * overall (string, optional),

          Đánh giá chung cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * quality (string, optional),

          Xếp hạng chất lượng của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * recommendationPercent (string, optional),

          Phần trăm khách giới thiệu ở tại chỗ nghỉ này.
        * ~~score (string, optional),~~
        * service (string, optional),

          Đánh giá về dịch vụ của nhân viên đối với chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * value (string, optional)

          Xếp hạng cho giá trị của bất động sản cung cấp cho chi phí lưu trú, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
      * ratingProperty (RatingProperty, optional)

        Đánh giá hạng sao khách sạn

        * rating (string, optional),

          Giá trị sếp hạng. Trả về giá trị từ 0,0 đến 5,0. Giá trị 0,0 hoặc giá trị trống cho biết không có xếp hạng nào.
        * type (string, optional)

          Loại đánh giá

          * `Star`: Xếp hạng sao của khách sạn
    * rooms (Array\[PropertyRoom], optional),

      Mảng đối tượng chứa thông tin phòng

      * descriptions (Array\[Attribute], optional),

        Thông tin mô tả

        * id (string, optional),

          Mã định danh
        * name (string, optional),

          Tên mô tả

          * `overview`: Thông tin mô tả tổng quan về căn phòng
        * value (string, optional)

          Thông tin mô tả
      * id (string, optional),

        Mã định danh cho loại phòng
      * images (Array\[RoomImage], optional),

        Mảng đối tượng chứa thông tin hình ảnh của loại phòng

        * caption (string, optional),

          Tiêu đề của hình ảnh
        * link (string, optional),

          Liên kết tới hình ảnh, là liên kết tuyệt đối
        * position (integer, optional)

          Vị trí sắp xếp của hình ảnh
      * name (string, optional),

        Tên của loại phòng
      * ratePlans (Array\[RatePlan], optional),

        Mảng đối tượng chứa thông tin về tùy chọn giá

        * amenities (Array\[Amenity], optional),

          Mảng đối tượng chứa thông tin tiện nghi của tùy chọn giá

          * id (string, optional),

            Mã định danh tiện nghi
          * name (string, optional),

            Tên tiện nghi
          * ~~value (string, optional)~~
          * ~~group (sting, optional)~~
        * basePrice (number, optional),

          Giá cơ bản
        * basePriceBeforePromo (number, optional),

          Giá cơ bản trước khuyến mãi
        * bedGroups (Array\[BedGroup], optional),

          Mảng đối tượng nhóm giường trong phòng

          * configurations (Array\[ConfigurationBedGroup], optional),

            Thông tin cấu hình giường cho phòng

            * quantity (integer, optional),

              Số lượng giường
            * size (string, optional),

              Kích thước của giường
            * type (string, optional)

              Loại giường
          * description (string, optional),

            Mô tả hiển thị giường cho phòng này
          * id (string, optional)

            Mã định danh nhóm giường
        * breakfastIncluded (boolean, optional),

          Tùy chọn giá có bao gồm bữa sáng hay không
        * cancelFree (boolean, optional),

          Mô tả thông tin được phép hủy đặt phòng với tùy chọn giá này có tốn phí phạt hay không

          * `true`: Hủy đặt phòng miễn phí
          * `false`: Không đặt hủy đặt phòng miễn phí
        * cancelFreeBeforeDate (string, optional),

          Ngày giới hạn cho phép hủy đặt phòng với tùy chọn giá này một cách miễn phí
        * cancelPenalties (Array\[CancelPenalty], optional),

          Mô tả các hình thức phạt khi hủy đặt phòng với tùy chọn giá này. [Xem mô tả thêm ở đây](https://developer.gotadi.com/dev-guide/api-hotel/api-cancellation/#cac-hinh-thuc-phat)

          * type (string, optional)

            Loại hình phạt

            * `NIGHTS`: Số đêm bị phạt
            * `AMOUNT`: Số tiền bị phạt
            * `PERCENT`: Số phần trăm bị phạt
          * currency (string, optional) = \[‘VND’, ‘USD’],

            Đơn vị tiền tệ đối với `type = AMOUNT`
          * amount (string, optional),

            Số tiền của hình phạt
          * description (string, optional),

            Mô tả về hình phạt
          * nights (string, optional),

            Số đêm bị tính phí phạt
          * percent (string, optional),

            Số phần trăm bị phạt
          * startDate (string, optional),

            Ngày bắt đầu có hiệu lực của hình phạt
          * endDate (string, optional),

            Ngày kết thúc của hình phạt
        * fees (Map, optional),

          Thông tin các loại phí được phu bởi khách sạn Giá trị mối loại phí là tổng của loại đó. Phạm vi ảnh hưởng của mô tả này chỉ là thông tin thông báo cho khách hàng biết.

          * `mandatory_fee`: Một khoản phí bắt buộc do khách sạn thu khi nhận phòng hoặc trả phòng.
          * `resort_fee`: Một khoản phí cho các tiện nghi và dịch vụ bổ sung và được khách sạn thu khi nhận phòng hoặc trả phòng.
          * `mandatory_tax`: Khoản thuế bắt buộc do chỗ nghỉ thu khi nhận phòng hoặc trả phòng.
        * paxPrice (Array\[PaxPrice], optional),

          Mảng đối tượng chứa thông tin giá theo số lượng người ở trong một phòng

          * nightPrices (Array\[NightPrice], optional),

            Mảng đối tượng chứa thông tin giá theo từng đêm

            * nightKey (string, optional),

              Khóa định danh của từng đêm
            * nightPriceDetails (Array\[NightPriceDetail], optional)

              Mảng đối tượng chứ thông tin giá chi tiết theo từng đêm

              * name (string, optional),

                Tên loại giá

                * `base_rate`: Giá cơ bản không bao gồm thuế phí
                * `tax_and_service_fee`: Thuế và phí
              * value (number, optional),

                Số tiền
              * ~~valueByHotelCurrency (string, optional)~~
          * paxInfo (PaxInfo, optional)

            Mô tả thông tin người ở

            * adultQuantity (integer, optional),

              Số lượng người lớn
            * childAges (Array\[integer], optional),

              Mảng chứa thông tin tuổi của trẻ em, số lượng phần từ mảng bằng với số lượng trẻ em
            * childQuantity (integer, optional),

              Số lượng trẻ em
            * ~~infantQuantity (integer, optional)~~
        * promo (boolean, optional),

          Thông tin xác định có khuyến mãi hay không

          * `true`: Có khuyến mãi
          * `false`: Không có khuyến mãi
        * promoDescription (string, optional),

          Mô tả thông tin khuyến mãi
        * ratePlanId (string, optional),

          Mã định danh tùy chọn giá
        * ratePlanName (string, optional),

          Tên của tùy chọn giá
        * refundable (boolean, optional),

          Thông tin xác định khi hủy phòng có được hoàn tiền hay không

          * `true`: Được hoàn tiền khi hủy
          * `false`: Không được hoàn tiền khi hủy
        * taxAndFees (number, optional),

          Thuế và phí của tùy chọn giá
        * totalPrice (number, optional),

          Giá tổng cộng đã bao gồm thuế phí
        * ~~totalPriceByHotelCurrency (number, optional),~~
        * totalRooms (integer, optional)

          Số lượng phòng còn trống
      * roomArea (RoomArea, optional)

        Thông tin về diện tích căn phòng

        * `squareFeet`: Diện tích của phòng được tính bằng feet vuông
        * `squareMeters`: Diện tích của phòng được tính bằng mét vuông
      * bedGroupStatics (Array\[BedGroupStatic], optional)

        Mảng các đối tượng nhóm giường trong phòng

        * id (String, optional)

          mã định danh nhóm giường
        * name (String, optional)

          Tên nhóm giường
        * ~~value (String, optional)~~
      * views (Array\[View], optional)

        Thông tin mô tả hướng nhìn của phòng

        * id (String, optional)

          mã định danh hướng nhìn
        * name (String, optional)

          Mô tả hướng nhìn
        * ~~value (String, optional)~~
      * occupancyAllowed (OccupancyAllowed, optional)

        Thông tin về số người ở được phép

        * roomMaxAllowed (RoomMaxAllowed, optional)

          Sức chứa tối đa

          * adult (integer, optional)

            Số người lớn
          * children (integer, optional)

            Số trẻ em
          * total (integer, optional)

            Tổng số người
        * ~~roomAgeCategories (Array\[Attribute], optional)~~
      * amenities (Array\[Amenity], optional)

        Mảng chứa đối tương thông tin tiện nghi của phòng

        * id (string, optional),

          Mã định danh tiện nghi phòng
        * name (string, optional),

          Tên tiện nghi phòng
        * symbol (string, optional),

          Biểu tượng hiện thị của nghi phòng
        * ~~value (string, optional)~~
        * group (string, optional)

          Thông tin tiện nghi của phòng được gom nhóm, với các nhóm sau

          * `OTHER`: Tiện nghi khác
          * `BEDROOM`: Tiện nghi phòng ngủ
          * `BATHROOM`: Tiện nghi phòng tắm
          * `ENTERTAINMENT`: Giải trí đa phương tiện trong phòng
          * `FOOD_AND_DRINK`: Tiện nghi về đồ ăn thức uống trong phòng
          * `ROOM_VIEW`: Hướng nhìn
          * `INTERNET`: Mạng intenet
          * `SMOKING`: Hút thuốc
    * spokenLanguage (Array\[Attribute], optional),

      Các ngôn ngữ giao tiếp với nhân viên khách sạn.

      * id (string, optional),

        Mã định danh ngôn ngữ
      * name (string, optional),

        Tên ngôn ngữ
      * ~~value (string, optional)~~
    * statistics (Array\[Attribute], optional),

      Thống kê về tài sản, chẳng hạn như số tầng

      * id (string, optional),

        Mã định danh thống kê
      * name (string, optional),

        Mô tả thống kê bao gồm tên và giá trị thống kê

        ```
        {
            "id": "52",
            "name": "Tổng số phòng: - 335",
            "value": "335"
        }
        ```
      * value (string, optional)

        Giá trị của thống kê
    * supplier (string, optional) = \[EXPEDIA, AXISROOM, BEDLINKER],

      Nguồn khách sạn
    * tags (Array\[string], optional),

      Thẻ được gắn cho khách sạn, để xác định một số yêu cầu đặc biệt
    * themes (Array\[Attribute], optional)

      Mảng đối tượng chứa thông tin về chủ đề của khách sạn

      * id (string, optional),

        Mã định chủ đề
      * name (string, optional),

        Tên chủ đề
      * ~~value (string, optional)~~
    * masterPropertyId (Long, optional)

      Mã định danh khách sạn chính.
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 5. API Get all hotel list <a href="#id-5-api-lay-danh-sach-khach-san" id="id-5-api-lay-danh-sach-khach-san"></a>

GET: /api/v3/hotel/get-master-properties

Get list of all basic hotel information

<details>

<summary>Parameter</summary>

* id `query` (String, optional)

  Hotel identifier
* language `query` (String, Required)    &#x20;

  Language

</details>

<details>

<summary>Example</summary>

* Find by update time

```
?language=vi&lastModifiedDate=2021-09-10&pageNumber=0&pageSize=50
```

* Find by Id

```
?id=123&language=vi
```

</details>

#### Parameters <a href="#parameters_4" id="parameters_4"></a>

#### Response <a href="#response_4" id="response_4"></a>

**Code 200**

Model

<details>

<summary>Model</summary>

* result (FilterOptionsResult, optional)

  Thông tin kết quả trả về

  * masterProperties (Array\[MasterProperty], optional),

    Danh sách thông tin khách sạn

    * id (Long, optional),

      Mã định danh
    * propertyName (string, optional),

      Tên khách sạn
    * address (Address, optional)

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * propertyLocation (PropertyLocation, optional) = \[‘vi’, ‘en’],

      Vị trí toạ độ

      * longitude (string, optional),

        Kinh độ
      * latitude (string, optional),

        Vĩ độ
    * activated (boolean, required),

      Trạng thái `true`: hoạt động / `false`: không hoạt động
    * legacyIds (Array\[Long], optional),

      Danh sách mã định danh cũ
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

[^1]:


# Booking API

### 1. API Kiểm tra tình trạng phòng (checkout) <a href="#id-1-api-kiem-tra-tinh-trang-phong-checkout" id="id-1-api-kiem-tra-tinh-trang-phong-checkout"></a>

POST: /api/v3/hotel/checkout

Trả về kết quả tình trạng của phòng

#### Request Body <a href="#request-body" id="request-body"></a>

<details>

<summary>Request Body</summary>

* tripId (String, Required)

  Mã định danh kết quả search-all-rate, lấy từ kết quả trả về search-all-rates
* roomId (String, Required)

  Mã định danh phòng, lấy từ kết quả trả về search-all-rates
* ratePlanId (String, Required)

  Mã định danh tùy chọn giá, lấy từ kết quả trả về search-all-rates
* metadata (String, Required)

  Thông tin mở rộng

  * customer-ip (String, Required)

    Địa chỉ IP của người dùng cuối

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* result (CheckoutResult, Optional)

  Thông tin kết quả trả về

  * status (string, optional) = \[‘AVAILABLE’, ‘PRICE\_CHANGED’, ‘SOLD\_OUT’, ‘UNKNOWN’]

    Thông tin xác định trạng thái của phòng

    * `AVAILABLE`: Phòng đang tồn tại sẳn sàng để book
    * `PRICE_CHANGED`: Giá phòng đã bị thay đổi, thông tin giá thay đổi được cập nhật trong HotelProduct
    * `SOLD_OUT`: Phòng đã hết
    * `UNKNOWN`: Không xác định trạng thái phòng
  * hotelProduct (HotelProduct, optional),

    Thông tin phòng trả về

    * address (Address, optional),

      Thông tin địa chỉ khách sạn

      * city (string, optional),

      Thành phố

      * countryCode (string, optional),

        Mã quốc gia
      * countryName (string, optional),

        Tên quốc gia
      * lineOne (string, optional),

        Địa chỉ dòng 1
      * lineTow (string, optional),

        Địa chỉ dòng 2
      * postalCode (string, optional),

        Mã bưu điện
      * stateProvinceCode (string, optional),

        Mã tỉnh thành
      * stateProvinceName (string, optional)

        Tên tỉnh thành
    * amenities (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin tiện nghi của khách sạn

      * id (string, optional),

      Mã tiện nghi khách sạn

      * name (string, optional),

        Tên của tiện nghi khách sạn
      * ~~value (string, optional)~~
    * ~~attributes (Array\[Attribute], optional),~~
    * checkin (Checkin, optional),

      Khoảng thời gian nhận phòng, theo giờ địa phương của khách sạn

      * beginTime (string, optional),

        Thời gian bắt đầu được nhận phòng. Mặc định: 14:00
      * endTime (string, optional)

        Thời gian kết thúc được nhận phòng. Mặc định: 24:00
    * checkout (Checkout, optional),

      Thông tin thời gian trả phòng. Mặc định trước 12:00

      * endTime (string, optional)

        Thời gian trả phòng tối đa. Mặc định trước 12:00
    * currency (string, optional) = \[‘VND’, ‘USD’],

      Thông tin tiền tệ trả về
    * customerIp (string, optional),

      Thông tin địa chỉ ip của người dùng cuối
    * descriptions (Array\[Attribute], optional),

      Thông tin mô tả về khách sạn

      * id (string, optional),

        Mã định danh thuộc tính mô tả
      * name (string, optional),

        Tên thuộc tính

        * `description`: mô tả chung
        * `amenities`: mô tả chung về tiện nghi của khách sạn
        * `dining`: Mô tả về chỗ ăn uống của khách sạn
        * `renovations`: Mô tả về quá trình cải tạo phòng hoặc khách sạn mới đây
        * `national_ratings`: Nêu rõ nguồn xếp hạng sao của khách sạn
        * `business_amenities`: Mô tả về tiện nghi dành cho doanh nghiệp tại chỗ nghỉ, Ví dụ: phòng hội nghị
        * `rooms`: Mô tả về phòng
        * `attractions`: Mô tả về điểm tham quan gần khách sạn
        * `location`: Mô tả về vị trí của khách sạn
        * `headline`: Mô tả tóm tắt
      * value (string, optional)

        Thông tin mô tả
    * fees (Array\[Attribute], optional),

      Thông tin mô tả về một số khoản phụ phí kèm theo

      * id (string, optional),

        Mã định danh thuộc tính phí
      * name (string, optional),

        Tên thuộc tính phí

        * `mandatory`: Phí bắt buộc
        * `optional`: Phí không bắt buộc
      * value (string, optional)

        Mô tả về khoản phí
    * images (Array\[HotelImage], optional),

      Hình ảnh của khách sạn

      * caption (string, optional),

        Tiêu đề của hình ảnh
      * link (string, optional),

        Liên kết tới hình ảnh. Liên kết tuyệt đối
      * position (integer, optional)

        Vị trí sắp xếp hình ảnh
    * inclusions (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin mô tả về thuộc tính của khách sạn

      * id (string, optional),

        Mã định danh thuộc tính
      * name (string, optional),

        Mô tả thuộc tính
      * ~~value (string, optional)~~
    * language (string, optional) = \[‘vi’, ‘en’],

      Ngôn ngữ trả về
    * latitude (number, optional),

      Vĩ độ của khách sạn
    * longitude (number, optional),

      Kinh độ của khách sạn
    * policies (Array\[Attribute], optional),

      Thông tin về chính sách khách sạn mà khách cần lưu ý.

      * id (string, optional),

        Mã định danh chính sách
      * name (string, optional),

        Tên thuộc chính sách

        * `know_before_you_go`: Mô tả thông tin có thể hữu ích khi lập kế hoạch cho chuyến đi đến nơi này
      * value (string, optional)

        Mô tả về chính sách
    * productId (string, optional),

      Mã định danh sản phẩm
    * propertyCategory (PropertyCategory, optional),

      Danh mục của khách sạn

      * id (string, optional),

        Mã định danh danh mục khách sạn
      * name (string, optional)

        Tên danh mục khách sạn
    * propertyId (string, optional),

      Mã định danh khách sạn
    * propertyName (string, optional),

      Tên khách sạn
    * ~~rank (integer, optional),~~
    * rating (Rating, optional),

      Đánh giá về khách sạn

      * ratingGuest (RatingGuest, optional)

        Đánh giá của khách

        * amenities (string, optional),

          Xếp hạng cho các tiện nghi do khách sạn cung cấp, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * cleanliness (string, optional),

          Đánh giá mức độ sạch sẽ cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * comfort (string, optional),

          Đánh giá mức độ thoải mái của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * condition (string, optional),

          Xếp hạng cho tình trạng của chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * count (integer, optional),

          Tất cả xếp hạng đánh giá của khách giành cho khách sạn
        * location (string, optional),

          Xếp hạng về mức độ hấp dẫn của vị trí của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * neighborhood (string, optional),

          Xếp hạng về mức độ hài lòng của khu vực lân cận của khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * overall (string, optional),

          Đánh giá chung cho khách sạn, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * quality (string, optional),

          Xếp hạng chất lượng của các phòng, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * recommendationPercent (string, optional),

          Phần trăm khách giới thiệu ở tại chỗ nghỉ này.
        * ~~score (string, optional),~~
        * service (string, optional),

          Đánh giá về dịch vụ của nhân viên đối với chỗ nghỉ, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
        * value (string, optional)

          Xếp hạng cho giá trị của bất động sản cung cấp cho chi phí lưu trú, được tính trung bình từ tất cả các đánh giá của khách. Trả về giá trị từ 1,0 đến 5,0.
      * ratingProperty (RatingProperty, optional)

        Đánh giá hạng sao khách sạn

        * rating (string, optional),

          Giá trị sếp hạng. Trả về giá trị từ 0,0 đến 5,0. Giá trị 0,0 hoặc giá trị trống cho biết không có xếp hạng nào.
        * type (string, optional)

          Loại đánh giá

          * `Star`: Xếp hạng sao của khách sạn
    * rooms (Array\[PropertyRoom], optional),

      Mảng đối tượng chứa thông tin phòng

      * descriptions (Array\[Attribute], optional),

        Thông tin mô tả

        * id (string, optional),

          Mã định danh
        * name (string, optional),

          Tên mô tả

          * `overview`: Thông tin mô tả tổng quan về căn phòng
        * value (string, optional)

          Thông tin mô tả
      * id (string, optional),

        Mã định danh cho loại phòng
      * images (Array\[RoomImage], optional),

        Mảng đối tượng chứa thông tin hình ảnh của loại phòng

        * caption (string, optional),

          Tiêu đề của hình ảnh
        * link (string, optional),

          Liên kết tới hình ảnh, là liên kết tuyệt đối
        * position (integer, optional)

          Vị trí sắp xếp của hình ảnh
      * name (string, optional),

        Tên của loại phòng
      * ratePlans (Array\[RatePlan], optional),

        Mảng đối tượng chứa thông tin về tùy chọn giá

        * amenities (Array\[Amenity], optional),

          Mảng đối tượng chứa thông tin tiện nghi của tùy chọn giá

          * id (string, optional),

            Mã định danh tiện nghi
          * name (string, optional),

            Tên tiện nghi
          * ~~value (string, optional)~~
          * ~~group (sting, optional)~~
        * basePrice (number, optional),

          Giá cơ bản
        * basePriceBeforePromo (number, optional),

          Giá cơ bản trước khuyến mãi
        * bedGroups (Array\[BedGroup], optional),

          Mảng đối tượng nhóm giường trong phòng

          * configurations (Array\[ConfigurationBedGroup], optional),

            Thông tin cấu hình giường cho phòng

            * quantity (integer, optional),

              Số lượng giường
            * size (string, optional),

              Kích thước của giường
            * type (string, optional)

              Loại giường
          * description (string, optional),

            Mô tả hiển thị giường cho phòng này
          * id (string, optional)

            Mã định danh nhóm giường
        * breakfastIncluded (boolean, optional),

          Tùy chọn giá có bao gồm bữa sáng hay không
        * cancelFree (boolean, optional),

          Mô tả thông tin được phép hủy đặt phòng với tùy chọn giá này có tốn phí phạt hay không

          * `true`: Hủy đặt phòng miễn phí
          * `false`: Không đặt hủy đặt phòng miễn phí
        * cancelFreeBeforeDate (string, optional),

          Ngày giới hạn cho phép hủy đặt phòng với tùy chọn giá này một cách miễn phí
        * cancelPenalties (Array\[CancelPenalty], optional),

          Mô tả các hình thức phạt khi hủy đặt phòng với tùy chọn giá này. Xem thêm chi tiết ở tài liệu api search-all-rates.

          * type (string, optional)

            Loại hình phạt

            * `NIGHTS`: Số đêm bị phạt
            * `AMOUNT`: Số tiền bị phạt
            * `PERCENT`: Số phần trăm bị phạt
          * currency (string, optional) = \[‘VND’, ‘USD’],

            Đơn vị tiền tệ đối với `type = AMOUNT`
          * amount (string, optional),

            Số tiền của hình phạt
          * description (string, optional),

            Mô tả về hình phạt
          * nights (string, optional),

            Số đêm bị tính phí phạt
          * percent (string, optional),

            Số phần trăm bị phạt
          * startDate (string, optional),

            Ngày bắt đầu có hiệu lực của hình phạt
          * endDate (string, optional),

            Ngày kết thúc của hình phạt
        * fees (Map, optional),

          Thông tin các loại phí được phu bởi khách sạn Giá trị mối loại phí là tổng của loại đó. Phạm vi ảnh hưởng của mô tả này chỉ là thông tin thông báo cho khách hàng biết.

          * `mandatory_fee`: Một khoản phí bắt buộc do khách sạn thu khi nhận phòng hoặc trả phòng.
          * `resort_fee`: Một khoản phí cho các tiện nghi và dịch vụ bổ sung và được khách sạn thu khi nhận phòng hoặc trả phòng.
          * `mandatory_tax`: Khoản thuế bắt buộc do chỗ nghỉ thu khi nhận phòng hoặc trả phòng.
        * paxPrice (Array\[PaxPrice], optional),

          Mảng đối tượng chứa thông tin giá theo số lượng người ở trong một phòng

          * nightPrices (Array\[NightPrice], optional),

            Mảng đối tượng chứa thông tin giá theo từng đêm

            * nightKey (string, optional),

              Khóa định danh của từng đêm
            * nightPriceDetails (Array\[NightPriceDetail], optional)

              Mảng đối tượng chứ thông tin giá chi tiết theo từng đêm

              * name (string, optional),

                Tên loại giá

                * `base_rate`: Giá cơ bản không bao gồm thuế phí
                * `tax_and_service_fee`: Thuế và phí
              * value (number, optional),

                Số tiền
              * ~~valueByHotelCurrency (string, optional)~~
          * paxInfo (PaxInfo, optional)

            Mô tả thông tin người ở

            * adultQuantity (integer, optional),

              Số lượng người lớn
            * childAges (Array\[integer], optional),

              Mảng chứa thông tin tuổi của trẻ em, số lượng phần từ mảng bằng với số lượng trẻ em
            * childQuantity (integer, optional),

              Số lượng trẻ em
            * ~~infantQuantity (integer, optional)~~
        * promo (boolean, optional),

          Thông tin xác định có khuyến mãi hay không

          * `true`: Có khuyến mãi
          * `false`: Không có khuyến mãi
        * promoDescription (string, optional),

          Mô tả thông tin khuyến mãi
        * ratePlanId (string, optional),

          Mã định danh tùy chọn giá
        * ratePlanName (string, optional),

          Tên của tùy chọn giá
        * refundable (boolean, optional),

          Thông tin xác định khi hủy phòng có được hoàn tiền hay không

          * `true`: Được hoàn tiền khi hủy
          * `false`: Không được hoàn tiền khi hủy
        * taxAndFees (number, optional),

          Thuế và phí của tùy chọn giá
        * totalPrice (number, optional),

          Giá tổng cộng đã bao gồm thuế phí
        * ~~totalPriceByHotelCurrency (number, optional),~~
        * totalRooms (integer, optional)

          Số lượng phòng còn trống
      * roomArea (RoomArea, optional)

        Thông tin về diện tích căn phòng

        * `squareFeet`: Diện tích của phòng được tính bằng feet vuông
        * `squareMeters`: Diện tích của phòng được tính bằng mét vuông
    * searchId (string, optional),
      * Mã tham chiếu đến kết quả tìm kiếm (search-best-rate)
    * statistics (Array\[Attribute], optional),

      Thống kê về tài sản, chẳng hạn như số tầng

      * id (string, optional),

        Mã định danh thống kê
      * name (string, optional),

        Mô tả thống kê bao gồm tên và giá trị thống kê

        ```
        {
            "id": "52",
            "name": "Tổng số phòng: - 335",
            "value": "335"
        }
        ```
      * value (string, optional)

        Giá trị của thống kê
    * supplier (string, optional) = \[‘EXPEDIA’, ‘AXISROOM’, ‘BEDLINKER’],

      Nguồn khách sạn
    * themes (Array\[Attribute], optional),

      Mảng đối tượng chứa thông tin về chủ đề của khách sạn

      * id (string, optional),

        Mã định chủ đề
      * name (string, optional),

        Tên chủ đề
      * ~~value (string, optional)~~
    * tripId (string, optional),

      Mã liên kết đến kết quả search-all-rates
    * hotelContact (HotelContact, optional),

      Thông tin liên hệ trực tiếp của khách sạn

      * phone (string, optional),

        Số điện thoại khách sạn
      * email (string, optional),

        Email khách sạn
      * fax (integer, optional)

        Số fax khách sạn
    * mealPlans (Array\[Attribute], optional),

      Mảng chứa thông tin bữa ăn của ratePlan

      * id (string, optional),

        Mã định danh bữa ăn
      * name (string, optional),

        Tên gói bữa ăn
      * ~~value (string, optional)~~
* duration (Integer, Optional)
* success (Integer, Bool)
* infos (Array\[InfosDTO], Optional)
* errors (Array\[ErrorsDTO], Optional)
* textMessage (String, Optional)

</details>

***

### 2. API Khởi tạo booking <a href="#id-2-api-khoi-tao-booking" id="id-2-api-khoi-tao-booking"></a>

POST: /api/v3/hotel/create-draft-booking

Khởi tạo booking

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

<details>

<summary>Request Body</summary>

* tripId (String, Required)

  Mã định danh kết quả search-all-rate, lấy từ kết quả trả về search-all-rates
* roomId (String, Required)

  Mã định danh phòng, lấy từ kết quả trả về search-all-rates
* ratePlanId (String, Required)

  Mã định danh tùy chọn giá, lấy từ kết quả trả về search-all-rates
* metadata (String, Required)

  Thông tin mở rộng

  * customer-ip (String, Required)

    Địa chỉ IP của người dùng cuối

</details>

Example

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

<details>

<summary>Model</summary>

* result (Booking, optional)

  Thông tin booking đã tạo

  * additionalFee (number, optional),

    Các khoản phí khác
  * agencyCode (string, optional),

    Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
  * ~~agencyMarkupValue (number, optional),~~
  * agentCode (string, optional),

    Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentId (integer, optional),

    Id nhân viên đại lý
  * agentName (string, optional),

    Tên nhân viên đại lý
  * baseFare (number, optional),

    Giá phòng chưa bao gồm thuế phí
  * bookBy (string, optional),

    Người đặt booking
  * bookByCode (string, optional),

    Mã người đặt
  * bookingCode (string, optional),

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingDate (string, optional),

    Ngày tạo booking
  * bookingNote (string, optional),

    Ghi chú của booking
  * bookingNumber (string, optional),

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * bookingType (string, optional) = \[‘DOME’, ‘INTE’],

    Xác định điểm đến là trong nước hay quốc tế

    * `DOME`: Trong nước
    * `INTE`: Quốc tế
  * branchCode (string, optional),

    Mã chi nhánh
  * cancellationBy (string, optional),

    Hủy đặt phòng bởi …
  * cancellationDate (string, optional),

    Ngày hủy đặt phòng
  * cancellationFee (number, optional),

    Phí hủy đặt phòng
  * cancellationNotes (string, optional),

    Ghi chú hủy
  * channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],

    Loại kênh đặt phòng
  * commissionValue (number, optional),

    Giá trị hoa hồng
  * createdBy (string, optional),

    Người tạo booking
  * createdDate (string, optional),

    Ngày tạo booking
  * customerCode (string, optional),

    Mã khách hàng
  * customerEmail (string, optional),

    Email của khách hàng
  * customerFirstName (string, optional),

    Họ của khách hàng
  * customerId (integer, optional),

    Id của khách hàng
  * customerLastName (string, optional),

    Tên của khách hàng
  * customerPhoneNumber1 (string, optional),

    Số điện thoại 1 của khách hàng
  * customerPhoneNumber2 (string, optional),

    Số điện thoại 2 của khách hàng
  * departureDate (string, optional),

    Ngày nhận phòng
  * discountAmount (number, optional),

    Số tiền được giảm
  * discountDate (string, optional),

    Ngày sử dụng mã giảm giá
  * discountRedeemCode (string, optional),

    Mã liên kết đổi thưởng
  * discountRedeemId (string, optional),

    Id định danh liên kết đổi thường
  * discountTrackingCode (string, optional),

    Mã theo dõi thông tin giảm giá
  * discountVoucherCode (string, optional),

    Mã voucher
  * discountVoucherName (string, optional),

    Tên voucher
  * ~~equivFare (number, optional),~~
  * ~~fromCity (string, optional),~~
  * ~~fromLocationCode (string, optional),~~
  * ~~fromLocationName (string, optional),~~
  * id (integer, optional),

    Id của booking
  * ~~internalBookingNote (string, optional),~~
  * ~~isDeleted (boolean, optional),~~
  * issuedBy (string, optional),

    Xuất phòng bởi …
  * issuedByCode (string, optional),

    Mã người xuất phòng
  * issuedDate (string, optional),

    Ngày xuất phòng
  * issuedStatus (string, optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

    Trạng thái xuất phòng

    * `PENDING`: Đợi xuất phòng
    * `TICKET_ON_PROCESS`: Xuất phòng đang được xử lý
    * `SUCCEEDED`: Xuất phòng thành công
    * `FAILED`: Xuất phòng thất bại
  * ~~markupValue (number, optional),~~
  * orgCode (string),

    Mã tổ chức
  * partnerOrderId (string, optional),

    Id định danh đặt hàng của đối tác
  * partnerRequestId (string, optional),

    Id định danh request của đối tác
  * paymentBy (string, optional),

    Thanh toán bởi …
  * paymentByCode (string, optional),

    Mã người thanh toán
  * paymentDate (string, optional),

    Thời gian thanh toán
  * paymentFee (number, optional),

    Phí thanh toán
  * paymentRefNumber (string, optional),

    Mã tham chiếu thanh toán
  * paymentStatus (string, optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],

    Trạng thái thanh toán

    * `PENDING`: Chờ thanh toán
    * `SUCCEEDED`: Thanh toán thành công
    * `FAILED`: Thanh toán thất bại
    * `REFUNDED`: Hoàn tiền
  * paymentTotalAmount (number, optional),

    Tổng số tiền thanh toán
  * paymentType (string, optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘AIRPAY’, ‘PAYOO’, ‘CASH’, ‘TRANSFER’, ‘PARTNER’, ‘OTHER’],

    Hình thức thanh toán
  * ~~promotionID (Array\[string], optional),~~
  * ~~reconciliationType (string, optional) = \[‘NEW’, ‘ALREADY\_RECONCILIATION’],~~
  * refundAmount (number, optional),

    Số tiền hoàn trả
  * refundBy (string, optional),

    Người hoàn trả
  * refundByCode (string, optional),

    Mã của người thực hiện hoàn trả
  * refundDate (string, optional),

    Ngày hoàn trả
  * ~~refundNextVoidDate (string, optional),~~
  * returnDate (string, optional),

    Ngày trả phòng
  * roundType (string, optional) = \[‘RoundTrip],
  * saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

    Kênh phân phối
  * serviceTax (number, optional),

    Thuế và phí
  * ~~sessionSearchId (string, optional),~~
  * status (string, optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

    Trạng thái của booking

    * `PENDING`: Chờ xác nhận booking
    * `BOOKING_ON_PROCESS`: Booking đang được xử lý
    * `BOOKED`: Booking đã được xác nhận
    * `FAILED`: Booking thất bại
    * `EXPIRED`: Booking hết hạn
    * `CANCELLED`: Booking đã bị hủy
  * supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

    Loại sản phẩm
  * ~~tags (string, optional),~~
  * taxAddress1 (string, optional),

    Địa chỉ xuất hóa đơn dòng 1
  * taxAddress2 (string, optional),

    Địa chỉ xuất hóa đơn dòng 2
  * taxCompanyName (string, optional),

    Tên công ty xuất hóa đơn
  * taxNumber (string, optional),

    Mã số thuế cần xuất hóa đơn
  * taxPersonalInfoContact (string, optional),

    Người nhận hóa đơn
  * taxReceiptRequest (boolean, optional),

    Yêu cầu xuất hóa đơn hay không
  * timeToLive (string, optional),

    Thời gian chờ thanh toán, sau thời gian này trạng thái của booking sẽ chuyển sang `EXPIRED`
  * ~~timeToLiveExpired (string, optional),~~
  * toCity (string, optional),

    Tên tỉnh, thành phố nơi đặt phòng khách sạn
  * toLocationCode (string, optional),

    Mã định danh khách sạn
  * toLocationName (string, optional),

    Tên khách sạn
  * totalFare (number, optional),

    Tổng giá phòng
  * ~~totalSsrValue (number, optional),~~
  * totalTax (number, optional),

    Tổng số tiền thuế phí
  * updatedBy (string, optional),

    Người cập nhật
  * updatedDate (string, optional),

    Ngày cập nhật
  * ~~vat (number, optional)~~
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### 3. API Lấy chi tiết booking <a href="#id-3-api-lay-chi-tiet-booking" id="id-3-api-lay-chi-tiet-booking"></a>

POST: /api/products/booking-detail

Lấy thông tin chi tiết của booking

#### Parameters <a href="#parameters" id="parameters"></a>

<details>

<summary>Parameters</summary>

* bookingNumber `query` (string, required),

  Mã tham chiếu đến booking

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

> OK

Model

<details>

<summary>Model</summary>

* id (string, optional),

  Mã định danh chi tiết booking
* agencyCode (string, optional),

  Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
* agentCode (string, optional),

  Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
* bookingCode (string, optional),

  Mã dùng mô tả các thông tin cơ bản của booking
* bookingDate (string, optional),

  Ngày tạo booking
* bookingInfo (BookingInfo, optional),

  Thông tin booking

  * additionalFee (number, optional),

    Các khoản phí khác
  * agencyCode (string, optional),

    Mã đại lý. Mã dùng tham chiếu đến tác giả của booking
  * ~~agencyMarkupInfos (Array\[BookingAgencyMarkupInfo], optional),~~
  * ~~agencyMarkupValue (number, optional),~~
  * agentCode (string, optional),

    Mã nhân viên đại lý. Mã dùng tham chiếu đến tác giả của booking
  * agentId (integer, optional),

    Id nhân viên đại lý
  * agentName (string, optional),

    Tên nhân viên đại lý
  * allowHold (boolean, optional),

    Cho phép giữ phòng hay không

    `true`: cho phép giữ phòng

    `false`: Không cho phép giữ phòng
  * baseFare (number, optional),

    Giá phòng chưa bao gồm thuế phí
  * bookBy (string, optional),

    Người đặt booking
  * bookByCode (string, optional),

    Mã người đặt
  * bookingCode (string, optional),

    Mã dùng mô tả các thông tin cơ bản của booking
  * bookingDate (string, optional),

    Ngày tạo booking
  * ~~bookingIssuedType (string, optional) = \[‘INSTANT\_BOOKING’, ‘CONFIRM\_OFFLINE’],~~
  * bookingNote (string, optional),

    Ghi chú của booking
  * bookingNumber (string, optional),

    Mã dùng tham chiếu đến booking. Mã này là duy nhất.
  * bookingType (string, optional) = \[‘DOME’, ‘INTE’],

    Xác định điểm đến là trong nước hay quốc tế

    * `DOME`: Trong nước
    * `INTE`: Quốc tế
  * branchCode (string, optional),

    Mã chi nhánh
  * cancellationBy (string, optional),

    Hủy đặt phòng bởi …
  * cancellationDate (string, optional),

    Ngày hủy đặt phòng
  * cancellationFee (number, optional),

    Phí hủy đặt phòng
  * cancellationNotes (string, optional),

    Ghi chú hủy
  * channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],

    Loại kênh đặt phòng
  * contactInfos (Array\[BookingContactInfo], optional),

    Mảng đối tượng chứ thông tin người liên hệ

    * bookingNumber (string, optional),

      Mã tham chiếu đến booking
    * contactLevel (string, optional) = \[‘PRIMARY’, ‘SECONDARY’, ‘OTHER’],

      Cấp của người liên hệ
    * contactType (string, optional) = \[‘CUSTOMER’, ‘AGENCY’],

      Loại của người liên hệ
    * email (string, optional),

      Địa chỉ email
    * firstName (string, optional),

      Tên đêm và tên người liên hệ
    * phoneCode1 (string, optional),

      Mã quốc gia
    * phoneNumber1 (string, optional),

      Số điện thoại 1
    * surName (string, optional)

      Họ người liên hệ
  * customerCode (string, optional),

    Mã khách hàng
  * customerEmail (string, optional),

    Email của khách hàng
  * customerFirstName (string, optional),

    Họ của khách hàng
  * customerId (integer, optional),

    Id của khách hàng
  * customerLastName (string, optional),

    Tên của khách hàng
  * customerPhoneNumber1 (string, optional),

    Số điện thoại 1 của khách hàng
  * customerPhoneNumber2 (string, optional),

    Số điện thoại 2 của khách hàng
  * ~~deleted (boolean, optional),~~
  * departureDate (string, optional),

    Ngày nhận phòng
  * discountAmount (number, optional),

    Số tiền được giảm
  * discountDate (string, optional),

    Ngày sử dụng mã giảm giá
  * discountRedeemCode (string, optional),

    Mã liên kết đổi thưởng
  * discountRedeemId (string, optional),

    Id định danh liên kết đổi thường
  * discountVoucherCode (string, optional),

    Mã voucher
  * discountVoucherName (string, optional),

    Tên voucher
  * ~~displayPriceInfo (BookingPriceInfo, optional),~~
  * ~~equivFare (number, optional),~~
  * etickets (string, optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
  * ~~fromCity (string, optional),~~
  * ~~fromLocationCode (string, optional),~~
  * ~~fromLocationName (string, optional),~~
  * id (integer, optional),

    Id của booking
  * ~~internalBookingNote (string, optional),~~
  * issuedByCode (string, optional),

    Xuất phòng bởi …
  * issuedDate (string, optional),

    Ngày xuất phòng
  * issuedStatus (string, optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

    Trạng thái xuất phòng

    * `PENDING`: Đợi xuất phòng
    * `TICKET_ON_PROCESS`: Xuất phòng đang được xử lý
    * `SUCCEEDED`: Xuất phòng thành công
    * `FAILED`: Xuất phòng thất bại
  * ~~markupValue (number, optional),~~
  * ~~onlyPayLater (boolean, optional),~~
  * orgCode (string, optional),

    Mã tổ chức
  * ownerBooking (boolean, optional),

    Chủ sở hữu đặt chỗ
  * passengerNameRecords (string, optional),

    Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
  * paymentBy (string, optional),

    Thanh toán bởi …
  * paymentByCode (string, optional),

    Mã người thanh toán
  * paymentDate (string, optional),

    Thời gian thanh toán
  * paymentFee (number, optional),

    Phí thanh toán
  * paymentRefNumber (string, optional),

    Mã tham chiếu thanh toán
  * paymentStatus (string, optional) = \[‘SUCCEEDED’, ‘FAILED’, ‘REFUNDED’, ‘PENDING’],

    Trạng thái thanh toán

    * `PENDING`: Chờ thanh toán
    * `SUCCEEDED`: Thanh toán thành công
    * `FAILED`: Thanh toán thất bại
    * `REFUNDED`: Hoàn tiền
  * paymentTotalAmount (number, optional),

    Tổng số tiền thanh toán
  * paymentType (string, optional) = \[‘BALANCE’, ‘CREDIT’, ‘ATM\_DEBIT’, ‘AIRPAY’, ‘VNPAYQR’, ‘VIETTELPAY’, ‘MOMO’, ‘ZALO’, ‘PAYOO’, ‘CASH’, ‘TRANSFER’, ‘PARTNER’, ‘OTHER’],

    Hình thức thanh toán
  * ~~promotionID (Array\[string], optional),~~
  * ~~reasonCodePaymentFailed (string, optional),~~
  * refundBy (string, optional),

    Người hoàn trả
  * refundByCode (string, optional),

    Mã của người thực hiện hoàn trả
  * refundable (boolean, optional),

    Ngày hoàn trả
  * returnDate (string, optional),

    Ngày trả phòng
  * roundType (string, optional) = \[‘RoundTrip],
  * saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

    Kênh phân phối
  * serviceTax (number, optional),

    Thuế và phí
  * ~~showPayLaterOption (boolean, optional),~~
  * ~~showPayNowOption (boolean, optional),~~
  * status (string, optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

    Trạng thái của booking

    * `PENDING`: Chờ xác nhận booking
    * `BOOKING_ON_PROCESS`: Booking đang được xử lý
    * `BOOKED`: Booking đã được xác nhận
    * `FAILED`: Booking thất bại
    * `EXPIRED`: Booking hết hạn
    * `CANCELLED`: Booking đã bị hủy
  * ~~supplierBookingStatus (string, optional),~~
  * supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

    Loại nhà cung cấp
  * taxAddress1 (string, optional),

    Địa chỉ xuất hóa đơn dòng 1
  * taxAddress2 (string, optional),

    Địa chỉ xuất hóa đơn dòng 2
  * taxCompanyName (string, optional),

    Tên công ty xuất hóa đơn
  * taxNumber (string, optional),

    Mã số thuế cần xuất hóa đơn
  * taxPersonalInfoContact (string, optional),

    Người nhận hóa đơn
  * taxReceiptRequest (boolean, optional),

    Yêu cầu xuất hóa đơn hay không
  * timeToLive (string, optional),

    Thời gian chờ thanh toán, sau thời gian này trạng thái của booking sẽ chuyển sang `EXPIRED`
  * toCity (string, optional),

    Tên tỉnh, thành phố nơi đặt phòng khách sạn
  * toLocationCode (string, optional),

    Mã định danh khách sạn
  * toLocationName (string, optional),

    Tên khách sạn
  * totalFare (number, optional),

    Tổng giá phòng
  * ~~totalSsrValue (number, optional),~~
  * totalTax (number, optional),

    Tổng số tiền thuế phí
  * transactionInfos (Array\[BookingTransactionInfo], optional),

    Mảng đối tượng chứa thông tin giao dịch

    * id (integer, optional),

      Id định danh giao dịch
    * ~~agencyMarkupValue (number, optional),~~
    * allowHold (boolean, optional),

      Cho phép giữ phòng hay không
    * bookingCode (string, optional),

      Mã dùng mô tả các thông tin cơ bản của booking
    * bookingDate (string, optional),

      Ngày tạo booking
    * bookingDirection (string, optional) = \[‘TRIP’],
    * bookingNumber (string, optional),

      Mã dùng tham chiếu đến booking.
    * bookingRefNo (string, optional),

      Mã liên kết với nhà cung cấp
    * channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],

      Loại kênh bán
    * checkIn (string, optional),

      Ngày nhận phòng
    * checkOut (string, optional),

      Ngày trả phòng
    * destinationLocationCode (string, optional),

      Mã định danh khách sạn
    * detail (string, optional),

      Tên khách sạn
    * etickets (string, optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
    * issuedDate (string, optional),

      Ngày xuất phòng
    * issuedStatus (string, optional) = \[‘PENDING’, ‘TICKET\_ON\_PROCESS’, ‘SUCCEEDED’, ‘FAILED’],

      Trạng thái xuất phòng

      * `PENDING`: Đợi xuất phòng
      * `TICKET_ON_PROCESS`: Xuất phòng đang được xử lý
      * `SUCCEEDED`: Xuất phòng thành công
      * `FAILED`: Xuất phòng thất bại
    * ~~markupCode (string, optional),~~
    * ~~markupFormula (string, optional),~~
    * ~~markupKey (string, optional),~~
    * ~~markupValue (number, optional),~~
    * noAdult (integer, optional),

      Số người lớn
    * noChild (integer, optional),

      Số trể em
    * onlyPayLater (boolean, optional),

      Cho phép trả sau hay không
    * passengerNameRecord (string, optional),

      Mã liên kết với nhà cung cấp, được sử dụng để nhận phòng
    * paymentAmount (number, optional),

      Số tiền thanh toán
    * productSeqNumber (string, optional),

      Mã sản phẩm
    * refundable (boolean, optional),

      Có hoàn tiền khi hủy phòng hay không
    * saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

      Kênh phân phối
    * serviceTax (number, optional),

      Thuế và phí
    * status (string, optional) = \[‘PENDING’, ‘BOOKING\_ON\_PROCESS’, ‘BOOKED’, ‘FAILED’, ‘CANCELLED’, ‘EXPIRED’],

      Trạng thái của booking

      * `PENDING`: Chờ xác nhận booking
      * `BOOKING_ON_PROCESS`: Booking đang được xử lý
      * `BOOKED`: Booking đã được xác nhận
      * `FAILED`: Booking thất bại
      * `EXPIRED`: Booking hết hạn
      * `CANCELLED`: Booking đã bị hủy
    * supplierCode (string, optional),

      Mã nhà cung cấp
    * supplierName (string, optional),

      Tên nhà cung cấp
    * supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’]

      Loại sản phẩm
    * totalFare (number, optional),

      Tổng giá phòng
    * totalTax (number, optional)

      Tổng thuế và phí
    * baseFare (number, optional),

      Giá phòng không bao gồm thuế phí
  * travelerInfos (Array\[BookingTravelerInfo], optional),

    Mảng đối tượng chứa thông tin người nhận phòng. Người nhận phòng phải là người lớn. Mỗi một phòng tương ứng với 1 phần tử của mảng.

    * bookingNumber (string),

      Mã tham chiếu đến booking
    * firstName (string),

      Tên đêm và tên người nhận phòng
    * surName (string)

      Họ của người nhận phòng
* bookingNumber (string, optional),

  Mã dùng tham chiếu đến booking. Mã này là duy nhất.
* bookingType (string, optional),

  Xác định điểm đến là trong nước hay quốc tế

  * `DOME`: Trong nước
  * `INTE`: Quốc tế
* branchCode (string, optional),

  Mã chi nhánh
* cacheType (string, optional) = \[‘HOTEL’],
* ~~channelType (string, optional) = \[‘ONLINE’, ‘OFFLINE’],~~

  Loại kênh đặt phòng
* ~~customerCode (string, optional),~~

  Mã khách hàng
* ~~groupPricedItineraries (Array\[GroupPricedItinerary], optional),~~
* ~~hotelAvailability (HotelAvailability, optional),~~
* hotelProduct (HotelProduct, optional),

  Đối tượng chứa thông tin phòng (Xem thêm ở response API checkout)
* hotelProductPayload (HotelProductPayload, optional),

  Đối tượng chứa thông tin định danh sản phẩm

  * tripId (String, optional)

    Mã định danh kết quả search-all-rate
  * roomId (String, optional)

    Mã định danh phòng
  * ratePlanId (String, optional)

    Mã định danh tùy chọn giá
* ~~isPerBookingType (boolean, optional),~~
* ~~markupType (string, optional),~~
* ~~offlineBooking (OfflineBooking, optional),~~
* orgCode (string, optional),

  Mã tổ chức
* saleChannel (string, optional) = \[‘B2B’, ‘B2C’, ‘B2B2C’, ‘B2C\_WEB’, ‘B2C\_WEB\_APP’, ‘B2C\_MOBILE’],

  Kênh phân phối
* supplierType (string, optional) = \[‘AIR’, ‘HOTEL’, ‘TOURS’, ‘TRAIN’, ‘SHIP’, ‘OTHER’],

  Loại nhà cung cấp
* ~~travelerInfo (TravelerInfo, optional),~~
* ~~updatedDate (string, optional)~~

</details>

***

### 4. API Cập nhật thông tin booking và giữ chỗ <a href="#id-4-api-cap-nhat-thong-tin-booking-va-giu-cho" id="id-4-api-cap-nhat-thong-tin-booking-va-giu-cho"></a>

POST: /api/v3/hotel/add-booking-traveller

Cập nhật các thông tin: Hành khách, người liên hệ, thông tin xuất hóa đơn, … và yêu cầu giữ chỗ

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (string, required),

  Mã tham chiếu đến booking
* bookingContacts (Array\[BookingContactDTO], required),

  Mảng đối tượng chứ thông tin người liên hệ

  * bookingNumber (string),

    Mã tham chiếu đến booking
  * phoneNumber1 (string, optional),

    Số điện thoại 1
  * email (string, optional),

    Địa chỉ email người liên hệ
  * surName (string)

    Họ người liên hệ
  * firstName (string),

    Tên đêm và tên người liên hệ
  * phoneCode1 (string, optional),

    Mã quốc gia
* bookingTravelerInfos (Array\[BookingTravelerInfoDTO], required),

  Mảng đối tượng chứa thông tin người nhận phòng. Người nhận phòng phải là người lớn. Mỗi một phòng tương ứng với 1 phần tử của mảng.

  * traveler (BookingTravelerDTO, optional)

    Thông tin người nhận phòng

    * bookingNumber (string),

      Mã tham chiếu đến booking
    * firstName (string),

      Tên đêm và tên người nhận phòng
    * surName (string)

      Họ của người nhận phòng
* taxReceiptRequest (BookingTaxReceiptRequestDTO, optional)

  Yêu cầu xuất hóa đơn. Nếu không yêu cầu xuất hóa đơn thì để trống

  * bookingNumber (string, optional),

    Mã tham chiếu đến booking
  * taxAddress1 (string, optional),

    Địa chỉ công ty
  * taxCompanyName (string, optional),

    Tên công ty
  * taxNumber (string, optional),

    Mã số thuế
  * taxPersonalInfoContact (string, optional),

    Thông tin liên hệ người yêu cầu xuất hóa đơn

    Là chuỗi json của đối tượng:

    * name (string, required)

      Họ người liên hệ
    * fname (string, required)

      Tên đệm và tên người liên hệ
    * phone (string, required)

      Số điện thoại người liên hệ
    * email (string, required)

      Email người liên hệ
    * phonecode3 (string, required)

      Mã điện thoại
  * taxReceiptRequest (boolean, optional)

    Yêu cầu xuất hóa đơn

    * `true`: Yêu cầu xuất hóa đơn

</details>

Example

#### Response <a href="#response_3" id="response_3"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* result (SearchAllRatesResult, optional),
  * bookingCode (BookingCode, optional),

    Mã định danh kết quả search-all-rate, mỗi lần gọi search-all-rate sẽ tạo ra tripId mới, nó được sử dụng khi đi thao tác đặt phòng

    * bookingCode (string, optional)

      Mã dùng mô tả các thông tin cơ bản của booking
    * bookingNumber (string, optional)

      Mã dùng tham chiếu đến booking
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

{% embed url="<https://gotadi.gitbook.io/technical-documentation/~/changes/jpnb0igjjbjF20px6gfz/vietnamese/doi-tac-b2b2c/phuong-thuc-api#7-ma-loi>" %}


# Cancellation API

Document Hotel API Cancellation

![Luồng huỷ phòng khách sạn](https://developer.gotadi.com/img/cancellation-process.png)

## Description of penalties for cancellation

If you do not check in, or if you cancel or modify this reservation after the check-in time, you may be subject to a penalty fee of up to 100% of the booking value.

### Penalties <a href="#cac-hinh-thuc-phat" id="cac-hinh-thuc-phat"></a>

#### **Example 1: Cancellation fee per night**

```json
[{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "NIGHTS",
    "currency": "VND",  
    "percent": "",  
    "nights": "1.0",
    "amount": "",
    "description": ""
}]
```

* Free cancellation before `2021-05-12T18:00:00.000+07:00`
* 1 night fee for cancellation from `2021-05-12T18:00:00.000+07:00` to `2021-05-13T18:00:00.000+07:00`

**Example 2: Cancellation fee by price**

```json
[{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "AMOUNT",
    "currency": "VND",
    "percent": "",
    "nights": "",
    "amount": "200000",
    "description": ""
}]
```

* Free cancellation before `2021-05-12T18:00:00.000+07:00`
* Cancellation fee of 200,000 VND from May 12, 2021, 18:00 (GMT+7) to May 13, 2021, 18:00 (GMT+7).

**Example 3: Cancellation fee by percentage**

```json
[{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "70%",
    "nights": "",
    "amount": "",
    "description": ""
}]
```

* Free cancellation before `2021-05-12T18:00:00.000+07:00`
* Cancellation fee 70% of room value from `2021-05-12T18:00:00.000+07:00` to `2021-05-13T18:00:00.000+07:00`

**Example 4: Various types of cancellation fees**

```json
[{
    "startDate": "2021-05-10T18:00:00.000+07:00",
    "endDate": "2021-05-12T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "50%",
    "nights": "",
    "amount": "",
    "description": ""
},
{
    "startDate": "2021-05-12T18:00:00.000+07:00",
    "endDate": "2021-05-13T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "70%",
    "nights": "",
    "amount": "",
    "description": ""
}]
```

* Free cancellation before `2021-05-10T18:00:00.000+07:00`
* Cancellation fee 50% of room value from `2021-05-10T18:00:00.000+07:00` to `2021-05-12T18:00:00.000+07:00`
* Cancellation fee 70% of room value from `2021-05-12T18:00:00.000+07:00` to `2021-05-13T18:00:00.000+07:00`

**Example 5: Cancellation fee with various fee**

```json
[{
    "startDate": "2021-05-10T18:00:00.000+07:00",
    "endDate": "2021-05-12T18:00:00.000+07:00",
    "type": "PERCENT",
    "currency": "VND",
    "percent": "50%",
    "nights": "",
    "amount": "25000",
    "description": ""
}]
```

* Free cancellation before `2021-05-10T18:00:00.000+07:00`
* Cancellation fee 50% of room value from `2021-05-10T18:00:00.000+07:00` to `2021-05-12T18:00:00.000+07:00` with various fee.
* Cancellation fee of 25,000 VND from `2021-05-10T18:00:00.000+07:00` to `2021-05-12T18:00:00.000+07:00`

**Example 6: Free cancellation**

```json
[{
    "startDate": "2021-05-01T18:00:00.000+07:00",
    "endDate": "2021-05-12T18:00:00.000+07:00",
    "type": "NIGHTS",
    "currency": "VND",
    "percent": "",
    "nights": "0",
    "amount": "",
    "description": ""
}]
```

* Free cancellation before `2021-05-12T18:00:00.000+07:00`

***

## 1. API to Check Cancellation Eligibility and Fees <a href="#id-1-api-kiem-tra-kha-nang-huy-phong-va-phi-phat" id="id-1-api-kiem-tra-kha-nang-huy-phong-va-phi-phat"></a>

POST: /api/v3/hotel/check-cancel-penalty

Returns room cancelability status information, and cancellation penalty information.

#### Request Body <a href="#request-body" id="request-body"></a>

Model

<details>

<summary>Request Body</summary>

* bookingNumber (String, Required)

  Reference code (Unique)

</details>

Example

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* result (CheckCancelPenaltyResult, Optional)

  Returned result information

  * status (string, optional) = \[‘ALLOW\_CANCELLATION’, ‘NOT\_ALLOW\_CANCELLATION’, ‘UNKNOWN’]

    Information to determine cancellation status

    * `ALLOW_CANCELLATION`: Chấp nhận huỷ phòng
    * `NOT_ALLOW_CANCELLATION`: Không chấp nhận huỷ phòng
    * `UNKNOWN`: Unable to determine status, needs to be rechecked.
  * cancelPenalties (Array\[CancelPenalty], optional),
  * cancelPenaltyTotal (number, optional),
* duration (Integer, Optional)
* success (Integer, Bool)
* infos (Array\[InfosDTO], Optional)
* errors (Array\[ErrorsDTO], Optional)
* textMessage (String, Optional)

</details>

***

## 2. API request to cancel hotel booking <a href="#id-2-api-yeu-cau-huy-booking-hotel" id="id-2-api-yeu-cau-huy-booking-hotel"></a>

POST: /api/partner/cancellation

**API sends a cancellation request for a hotel booking and waits for a response from the provider**

**Notice:**

* **Security Requirements:** Data must be encrypted and include a digital signature.
* **Request:** Encryption and digital signature are **not required**.
* **Response:** Certain parts of the response **must be encrypted** and include a digital signature.

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

<details>

<summary>Model</summary>

#### **Key (string, required)**

* Decryption key for the encrypted data.

**Data (string, required)**

* Encrypted data containing a digital signature.

**Signature Data Schema:**

```
<access_code>|<booking_number>|<cancel_penalty_amount>
```

#### **Original Data Schema:**

```
<access_code>|<booking_number>|<cancel_penalty_amount>|<signature>
```

* **access\_code (String, required)** – Access code provided by Gotadi to the Partner.
* **bookingNumber (String, required)** – Reference code for the booking.
* **cancel\_penalty\_amount (String, optional)** – Cancellation penalty fee, formatted to two decimal places (0.00).

</details>

#### Response <a href="#response_1" id="response_1"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* **key (String, required)** – Decryption key for the encrypted data.
* **data (String, required)** – Encrypted data containing a digital signature.

*Signature data schema:*

```
<access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>
```

*Original data schema:*

```
<access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>|<signature>
```

* **access\_code (String, required)** – Access code provided by Gotadi to the Partner.
* **booking\_number (String, required)** – Reference code for the booking.
* **error\_code (String, required)** – Error code.
* **product\_type (String, optional)** – Product type, with possible values: `AIR` (flight) or `HOTEL` (hotel), corresponding to the purchased product.
* **cancellation\_status (String, optional)** – Cancellation status information:
  * **CANCEL\_UNKNOWN** – Status is unknown and requires rechecking.
  * **CANCEL\_PENALTY\_MISMATCH** – The cancellation penalty fee does not match. The API for checking cancellation eligibility and penalty fees should be called again before resubmitting the cancellation request.
  * **CANCEL\_WAITING\_CONFIRM** – Cancellation request sent successfully, waiting for confirmation from the provider.
  * **CANCEL\_CONFIRMED** – Cancellation confirmed successfully.
  * **CANCEL\_EXPIRED** – Cancellation request has expired.

</details>

## 3. **API to Check Room Cancellation Status** <a href="#id-3-api-kiem-tra-trang-thai-huy-phong" id="id-3-api-kiem-tra-trang-thai-huy-phong"></a>

POST: /api/partner/cancellation-check

API to check room cancellation status

Note

**Security Requirements:** Encryption and Digital Signature Required

* **Request:** Encryption and digital signature are **not required**.
* **Response:** Certain parts of the response **must be encrypted** and include a digital signature.

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

<details>

<summary>Model</summary>

* key (string, required),
* data (string, required),

  *Signature data schema:*

  ```
  <access_code>|<booking_number>>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<signature>
  ```

  * access\_code (String, required)

    Gotadi provide
  * bookingNumber (String, required)

    Reference code

</details>

#### Response <a href="#response_2" id="response_2"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)
* data (String, required)

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>|<cancel_penalty_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<cancellation_status>|<cancellation_feee>|<signature>
  ```

  * **access\_code (String, required)** – Access code provided by Gotadi to the Partner.
  * **booking\_number (String, required)** – Reference code for the booking.
  * **error\_code (String, required)** – Error code.
  * **product\_type (String, optional)** – Product type, with possible values: `AIR` (flight) or `HOTEL` (hotel), corresponding to the purchased product.
  * **cancellation\_status (String, optional)** – Cancellation status information:
    * **CANCEL\_UNKNOWN** – Status is unknown and requires rechecking.
    * **CANCEL\_PENALTY\_MISMATCH** – The cancellation penalty fee does not match. Call the API for checking cancellation eligibility and penalty fees before resubmitting the cancellation request.
    * **CANCEL\_WAITING\_CONFIRM** – Cancellation request sent successfully, waiting for confirmation from the provider.
    * **CANCEL\_CONFIRMED** – Cancellation confirmed successfully.
    * **CANCEL\_EXPIRED** – Cancellation request has expired.
    * **product\_type (String, optional)** – Product type (`AIR` for flight, `HOTEL` for hotel).
    * **cancel\_penalty\_amount (String, optional)** – Cancellation fee amount, formatted to two decimal places (0.00).

</details>


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


# Payment API

### Voucher validation API <a href="#voucher-validation-api" id="voucher-validation-api"></a>

GET: /api/payments/voucher/validate

Validate voucher for specific booking

#### Request Body <a href="#request-body" id="request-body"></a>

| Parameter                        | Description        |
| -------------------------------- | ------------------ |
| bookingNumber (String, Required) | Booking Identifier |
| voucherCode (String, Required)   | Voucher code       |

Example

```json
{
    "bookingNumber": "ADCO2203011523483",
    "voucherCode": "AXOLXHLp"
}
```

#### Response <a href="#response" id="response"></a>

| Parameter                        | Description                         |
| -------------------------------- | ----------------------------------- |
| bookingNumber (String)           | Booking identifier                  |
| discountAmount (Double)          | Discount money amount               |
| trackingCode (String)            | Identifier for booking with voucher |
| voucherCode (String)             | Voucher code                        |
| voucherValid (Boolean)           | Is valid voucher code?              |
| duration (Integer, Optional)     |                                     |
| errors (Array\[Error], Optional) |                                     |
| infos (Array\[Info], Optional)   |                                     |
| success (Boolean, Optional)      |                                     |
| textMessage (String, Optional)   |                                     |

**Example**

```json
{
    "isSuccess": true,
    "duration": 3896,
    "textMessage": null,
    "errors": null,
    "infos": null,
    "bookingNumber": "ADCO2203011523483",
    "voucherCode": "AXOLXHLp",
    "voucherValid": true,
    "trackingCode": "track_xbhwiFai1HNQNCQLe2PmvdxJu/rd5zEG7NGuvjHI5CY=",
    "discountAmount": 1000,
    "percentOff": null,
    "type": "AMOUNT",
    "success": true
}
```

***

### Voucher usage confirmation API <a href="#voucher-usage-confirmation-api" id="voucher-usage-confirmation-api"></a>

GET: /api/payments/voucher/redeem

Redeem voucher for specific booking

#### Request Body <a href="#request-body_1" id="request-body_1"></a>

| Parameter                        | Description                        |
| -------------------------------- | ---------------------------------- |
| bookingNumber (String, Required) | Booking identifier                 |
| voucherCode (String, Required)   | Voucher code                       |
| trackingCode (String, Required)  | Tracking code used in api validate |

**Example**

```json
{
    "bookingNumber": "ADCO2203011523483",
    "trackingCode": "track_xbhwiFai1HNQNCQLe2PmvdxJu/rd5zEG7NGuvjHI5CY="
    "voucherCode": "AXOLXHLp"
}
```

#### Response <a href="#response_1" id="response_1"></a>

| Parameter                        | Description                           |
| -------------------------------- | ------------------------------------- |
| bookingNumber (String)           | Booking identifier                    |
| redeemValid (Boolean)            | Confirmation of success using Voucher |
| voucherCode (String)             | Voucher code                          |
| duration (Integer, Optional)     |                                       |
| errors (Array\[Error], Optional) |                                       |
| infos (Array\[Info], Optional)   |                                       |
| success (Boolean, Optional)      |                                       |
| textMessage (String, Optional)   |                                       |

**Example**

```json
    {
        "isSuccess": true,
        "duration": 6508,
        "textMessage": null,
        "errors": null,
        "infos": null,
        "voucherCode": "gtd_fpt_test",
        "bookingNumber": "ADCO2203101541927",
        "redeemValid": true,
        "success": true
    }
```

***

### Booking Payment Request API <a href="#booking-payment-request-api" id="booking-payment-request-api"></a>

GET: /api/partner/place-order

Request payment booking - initiate payment order

Note

* Security requirements: Encrypt data and include a digital signature
* Request: Does not require encryption and includes a digital signature
* Response: Part of the response data is required to be encrypted and accompanied by a digital signature

#### Request <a href="#request" id="request"></a>

| Parameter                               | Description               |
| --------------------------------------- | ------------------------- |
| bookingNumber query (string, required), | Reference code to booking |

```
- bookingNumber `query` (string, required),

    !!! quote ""

        Reference code to booking
```

#### Response <a href="#response_2" id="response_2"></a>

<details>

<summary>Model</summary>

* result (String, optional),

  Information returned in the format:

  ````json
  ```
  <payment_url>?key=<encrypted_key>?data=<encrypted_data>
  ```

  *Signature data schema:*

  ``` 
  <access_code>|<booking_number>|<product_type>|<total_amount>
  ```

  *Original data schema:*
  ```
  <access_code>|<booking_number>|<product_type>|<signature>|<total_amount>
  ```

  - access_code (String, required)

      !!! quote ""

          Access code provided by Gotadi to Partners.

  - bookingNumber (String, optional)

      !!! quote ""

          Code used to refer to booking

  - product_type (String, optional)

      !!! quote ""

          Type of product, whose value is AIR or HOTEL corresponding to the type of product purchased

  - total_amount (String, optional)

      !!! quote ""

          Total payment amount

  - payment_url (String, required)

      !!! quote ""

          URL navigate to payment page

  - encrypted_key (String, required)

      !!! quote ""

          Key decrypts (encrypted) data. How to decrypt refer to the section: Encryption of transmission data and digital signature authentication

  - encrypted_data (String, required)

      !!! quote ""

          Data with digital signature (encrypted). How to decrypt refer to the section: Encryption of transmission data and digital signature authentication
  ````
* duration (integer, optional),
* errors (Array\[Error], optional),
* infos (Array\[Info], optional),
* success (boolean, optional),
* textMessage (string, optional)

</details>

***

### Payment Recording and Booking Commit API <a href="#payment-recording-and-booking-commit-api" id="payment-recording-and-booking-commit-api"></a>

POST: /api/partner/commit

Yêu cầu commit booking được cập nhật đầy đủ thông tin và hoàn tất thanh toán

Chú ý

* Security requirements: Encrypt data and include a digital signature
* Request: Does not require encryption and includes a digital signature
* Response: Part of the response data is required to be encrypted and accompanied by a digital signature

#### Request Body <a href="#request-body_2" id="request-body_2"></a>

Model

<details>

<summary>Model</summary>

* key (string, required),

  Data decrypted key. How to decrypt refer to the section: Encryption of transmission data and digital signature authentication
* data (string, required),

  Data with digital signature (encrypted). How to decrypt refer to the section: Encryption of transmission data and digital signature authentication

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<partner_trans_id>|<product_type>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * bookingNumber (String, required)

    Code used to refer to booking
  * partner\_trans\_id (String, optional)

    Partner transaction identifier. If the partner does not pass a value to this field, the default value will be assigned using booking\_number
  * product\_type (String, required)

    Type of product, whose value is AIR or HOTEL corresponding to the type of product purchased

</details>

Example

#### Response <a href="#response_3" id="response_3"></a>

Model

<details>

<summary>Model</summary>

* key (String, required)

  Data decrypted key. How to decrypt refer to the section: Encryption of transmission data and digital signature authentication
* data (String, required)

  Data with digital signature (encrypted). How to decrypt refer to the section: Encryption of transmission data and digital signature authentication

  *Signature data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<total_amount>
  ```

  *Original data schema:*

  ```
  <access_code>|<booking_number>|<error_code>|<product_type>|<properties>|<return_url>|<signature>|<total_amount>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * booking\_number (String, required)

    Code used to refer to booking
  * error\_code (String, required)

    Error code
  * product\_type (String, optional)

    Type of product, whose value is AIR or HOTEL corresponding to the type of product purchased
  * properties (String, optional)

    …
  * return\_url (String, optional)

    …
  * total\_amount (Double, required)

    …

</details>

***

### API to retrieve Booking Details After Ticket Issuance

GET: /api/products/final-booking-detail

**Description:**

This API is optimized to retrieve the booking status for use in the payment process (its usage is similar to the **booking-detail API**). It also adds enhanced handling for both successful and failed cases.

* In the **happy case** (success), the API immediately returns the result.
* In the **failure case**, the API automatically retries to fetch the latest booking status and continues returning results until the configured timeout is reached.

Parameter

<details>

<summary>Parameter</summary>

* booking\_number (String, Required)\
  Booking Reference Code

</details>

**Response**

**Code 200**

> OK

**Model**

<details>

<summary>Model</summary>

* orgCode (String, Optional)\
  Organization code referencing the creator of the booking.
* branchCode (String, Optional)\
  Branch code referencing the creator of the booking.
* agencyCode (String, Optional)\
  Agency code referencing the creator of the booking.
* agentCode (String, Optional)\
  Agent (staff) code referencing the creator of the booking.
* customerCode (String, Optional)\
  Customer code referencing the creator of the booking.
* id (String, Optional)\
  Unique ID of the booking.
* bookingNumber (String, Optional)\
  Reference code of the booking.
* bookingCode (String, Optional)\
  Code describing the basic information of the booking.
* bookingType (String, Optional)\
  Booking type: `FLIGHT` or `HOTEL`, depending on the purchased product.
* bookingInfo (BookingInfoDTO, Optional)\
  Detailed booking information.
* groupPricedItineraries (GroupPricedItineraryDTO\[], Optional)\
  Group itinerary details (already specified in the **Search** section).
* travelerInfo (TravelerInfoDTO, Optional)\
  Passenger and contact information.
* channelType (String, Optional)\
  Distribution channel type: `B2B` or `B2C`.
* saleChannel (String, Optional)\
  Sales channel. Example: `B2B_WEB`, `B2B_APP`, etc.
* supplierType (String, Optional)\
  Supplier type. Example: `AIR`, `HOTEL`, etc.
* bookingDate (String, Optional)\
  Booking creation date (reservation date).

</details>


# Corporate Agent Partner (CA)

{% content-ref url="/pages/O0FYvCTygonPog0gpU0p" %}
[Integration Process](/english/corporate-agent-partner-ca/integration-process)
{% endcontent-ref %}

{% content-ref url="/pages/I6lgcaxcSS6VuUFjR9uh" %}
[Authentication API](/english/corporate-agent-partner-ca/authentication-api)
{% endcontent-ref %}


# Integration Process

Partners only need to integrate a single API for authentication and generating a link to access the Gotadi website.

All business processes, including but not limited to Search, Booking, and Payment, will be handled within the Gotadi Website.

This document provides detailed guidance on integrating the required API.

### 1. Before you start <a href="#id-1-truoc-khi-ban-bat-au" id="id-1-truoc-khi-ban-bat-au"></a>

Partner Account Registration for Sandbox Environment

**Company Information**

* Company Name
* Company Address
* Website URL
* Tax Identification Number

**Administrator Information**

* Full Name
* Email Address
* Phone Number

**Integration Information**

* URLs for partner’s system: Product links, payment gateway links, etc.
* **Partner’s Public Key** (RSA public key with a minimum length of 1024 bits) for digital signature authentication.

### 2. Integration environment setup <a href="#id-2-thiet-lap-moi-truong-tich-hop" id="id-2-thiet-lap-moi-truong-tich-hop"></a>

* Gotadi will create the **partner account** and **sandbox environment** based on the provided information and return the following details:
* **Agency Account**: Portal link, username, password
* **API Gateway**
* **API Key**
* **Technical Support Group** (e.g., Skype) to assist with integration-related issues
* **Gotadi’s Public Key** (RSA public key with a minimum length of 1024 bits) for digital signature authentication

### 3. Integration process <a href="#id-3-tien-hanh-tich-hop" id="id-3-tien-hanh-tich-hop"></a>

* The partner proceeds with the integration in the **Sandbox Environment** provided by Gotadi.

### 4. Testing and Go-live process <a href="#id-4-nghiem-thu-va-golive-dich-vu" id="id-4-nghiem-thu-va-golive-dich-vu"></a>

* **Step 1:** Perform product testing in the **Sandbox Environment**.
* **Step 2:** Gotadi provides **agency account details** and **integration information for the live environment**.
* **Step 3:** Set up **whitelisted IPs** for the API gateway in the **live environment**.
* **Step 4:** Conduct final testing in the **Live Environment** and launch the service.

  4o


# Authentication API

<details>

<summary>API Specification</summary>

* URL: \<API\_GATEWAY>/api/partnership/v1/login
* Method: POST
* Description: Authentication API for Booker and PreBooker
* Security requirement: [Encrypt data and include a digital signature.](/english/corporate-agent-partner-ca/security-requirements)

</details>

<details>

<summary>Request</summary>

Signature data schema

ACCESSCODE|agencyInfo.partnerRefCode|userInfo.partnerRefCode|userInfo.email|userInfo.phoneNumber

Example:

```json
{
    "agencyInfo": {
        "partnerRefCode": "CHI_NHANH_123",
        "fullName": "Chi nhanh Sai Gon",
        "shortName": "Cty X, Chi nhanh Sai Gon",
        "taxCode": "123456",
        "faxNumber": "123456",
        "phoneNumber": "0123456789",
        "address": "194 Nguyen Thi Minh Khai, Phuong 17, Quan Phu Nhuan",
        "email": "user_y@partner_x.com",
        "representativeName": "Nguyen Van A",
        "representativePhone": "0123456789",
        "representativeEmail": "user_y@partner_x.com",
        "extends": {
            "key": "value",
            "key1": "value1"
        }
    },
    "userInfo": {
        "partnerRefCode": "USER_123",
        "firstName": "Nguyen",
        "lastName": "Van A",
        "address": "194 Nguyen Thi Minh Khai, Phuong 17, Quan Phu Nhuan",
        "email": "user_y@partner_x.com",
        "phoneNumber": "0932909474",
        "roles": [
            "BOOKER", "PRE_BOOKER"
        ],
        "extends": {
            "key": "value",
            "key1": "value1"
        }
    },
    "signature": "..."
}
```

</details>

<details>

<summary>Response</summary>

#### Example

```json
{
    "url": "https://uat-v2-vendor.gotadi.com/?merchant_code=A::1_29001&access_token=...",
    "signature": "...",
    "errorCode": "00"
}
```

</details>

<details>

<summary>HTTP Code</summary>

* &#x20;400: Bad Request
* 401: Unauthorized
* 403: Forbidden
* 404: Not Found
* 500: Unknown Internal Error
* 503: Service Unavailable

</details>


# Security Requirements

### API Key <a href="#api-key" id="api-key"></a>

All requests from the partner to Gotadi's system must include the following headers to support security operations and data statistics for Gotadi:

* apikey: \<api\_key>
* x-ibe-req-name: \<access\_code>

Note

The \<api\_key> and \<access\_code> values ​​are provided by Gotadi to the Partner.

***

### Digital signature <a href="#chu-ky-ien-tu-signature" id="chu-ky-ien-tu-signature"></a>

Some important APIs require a digital signature to be attached to the request and response for authentication.

<details>

<summary>Generating a Digital Signature</summary>

<img src="https://developer.gotadi.com/img/3.png" alt="" data-size="original">

The sender applies the RSA-SHA256 algorithm combined with their own Private Key to sign the digital signature on the signature data.

**Note:**\
The schema for constructing the signature data will be specifically described in each API.

Java example code

```
public static String signRSA(String signatureData, String xmlPrivateKey) throws Exception {
    PrivateKey privateKey = getPrivateKeyFromXML(xmlPrivateKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initSign(privateKey);
    instance.update(signatureData.getBytes("UTF-8"));
    byte[] signature = instance.sign();
    return Base64.encodeBase64String(signature);
}
```

</details>

<details>

<summary>Digital signature verification</summary>

<img src="https://developer.gotadi.com/img/7.png" alt="" data-size="original">

The receiver uses the RSA-SHA256 algorithm and the sender's Public Key to verify the signature created by the sender.a.

Java example code

```
public static boolean verifyRSA(String signedData, String signature, String xmlPublicKey) throws Exception {
    PublicKey publicKey = getPublicKeyFromXML(xmlPublicKey);
    Signature instance = Signature.getInstance("SHA256withRSA");
    instance.initVerify(publicKey);
    instance.update(signedData.getBytes("UTF-8"));
    return instance.verify(Base64.decodeBase64(signature));
}
```

</details>

<br>


# Affiliate Partner

### Affiliate Tracking URL Parameter <a href="#id-1-affiliate-tracking-url-parameter" id="id-1-affiliate-tracking-url-parameter"></a>

```
URL: ?utm_source=[Source]&aff_sid=[ID]
```

Based on the source to determine which source/customer the booking comes from.

<details>

<summary>Parameters</summary>

* utm\_source `query` (String, Optional)

  Traffic source
* aff\_sid `query` (String, Optional)

  Customer ID exists in the system.

</details>

<details>

<summary>Example</summary>

```
https://www.gotadi.com/?utm_source=ZALO&aff_sid=Gotadi_User_2021
```

</details>


# FAQ section

<details>

<summary>What are the booking statuses in the Gotadi system?</summary>

The booking status in the Gotadi system is a combination of three statuses:

* **Booking status:** Reservation status
* **Payment status:** Payment status
* **Issued status:** Ticket issuance status, which refers to the service provider's confirmation status after successful payment.

For more details, please refer to the following document:

[Booking Statuses in Gotadi's Booking Flow](/english/faq-section/booking-statuses-in-gotadis-booking-flow)

</details>

<details>

<summary>What test cases are required to complete the B2B2C integration with Gotadi?</summary>

Please refer to the standard test case set for B2B2C partners here.

[Bộ Testcase dành cho đối tác B2B2C](/vietnamese/cau-hoi-thuong-gap/bo-testcase-danh-cho-doi-tac-b2b2c)

</details>

<details>

<summary>What are the rules for testing and refund/cancellation of booked tickets during testing?</summary>

Please refer to the testing regulations for flight and hotel bookings for both international and domestic itineraries as outlined below.

[Regulations for Testing](/english/faq-section/regulations-for-testing)

</details>

<details>

<summary>What are the steps in the integration process?</summary>

The integration process may vary depending on the type of partnership, but it always includes the following two final steps:

* **Acceptance Testing:** Passing the test case set and processing refunds/cancellations for booked tickets during testing.
* **Customer Support Channel Setup:** Establishing a connection with the customer support team.

For more details on the integration process, please refer to the official page.g quan giới thiệu các phương thức

[B2B2C Partner](/english/b2b2c-partner)

[Corporate Agent Partner (CA)](/english/corporate-agent-partner-ca)

[Affiliate Partner](/english/affiliate-partner)

</details>


# Booking Statuses in Gotadi's Booking Flow

## Statuses from Booking Management

The Gotadi system has three statuses that are combined into a final status displayed to the user: Booking Status, Payment Status, and Issued Status.

<details>

<summary>Booking statuses</summary>

* Pending
* Booking on Process
* Booked
* Failed
* Expired

</details>

<details>

<summary>Payment statuses</summary>

* Pending
* Success
* Failed
* Refund

</details>

<details>

<summary>Issued statuses</summary>

* Pending
* Ticket on Process
* Success
* Failed
* Cancel

</details>

The statuses will change differently depending on the user's booking flow. Details are as follows:

<figure><img src="/files/JvgdV3xEd0p9W42SkhIN" alt=""><figcaption></figcaption></figure>

*View high-quality images in the file below.*

[Flow chart.png](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/23924465-c7b8-4665-992d-15be86d4356d/Flow_chart.png)

## Detailed meanings of the statuses

| Notify the user                              | Booking Status     | Payment status | Issued status     | Final Status  | Meaning                                                                                                                                                                     | Applicable for             |   |
| -------------------------------------------- | ------------------ | -------------- | ----------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | - |
| Booking not yet made                         | Pending            | Pending        | Pending           | BOOK\_PENDING | Default status, occurs after search & detail viewing. Not displayed in MIS or to users.                                                                                     | Combo, Flight, Hotel, Tour |   |
| Transaction failed                           | Failed             | Pending        | Pending           | BOOK\_FAILED  | No available slots for booking                                                                                                                                              | Combo, Flight, Hotel, Tour |   |
| Reservation held, awaiting payment           | Booked             | Pending        | Pending           | <p><br></p>   | Booking successful, awaiting payment, ticket not issued                                                                                                                     | Combo, Flight, Hotel, Tour |   |
| Payment successful, awaiting ticket issuance | Booked             | Success        | Pending           | <p><br></p>   | Booking successful, payment successful, awaiting ticket issuance                                                                                                            | Combo, Flight, Hotel, Tour |   |
| Request submitted, awaiting processing       | Booking On Process | Pending        | Pending           | <p><br></p>   | Booking request submitted, awaiting confirmation. Request sent to the Operations team for review & direct customer contact                                                  | Tour                       |   |
| Payment failed                               | Booked             | Failed         | Pending           | <p><br></p>   | Booking successful, payment failed, ticket not issued                                                                                                                       | Combo, Flight, Hotel, Tour |   |
| Transaction expired                          | Expired            | Pending        | Pending           | <p><br></p>   | Booking successful, awaiting ticket issuance, payment deadline expired                                                                                                      | Combo, Flight, Hotel, Tour |   |
| Transaction successful                       | Booked             | Success        | Success           | <p><br></p>   | Booking successful, payment successful, ticket issued successfully                                                                                                          | Combo, Flight, Hotel, Tour |   |
| Payment successful, ticket issuance failed   | Booked             | Success        | Failed            | <p><br></p>   | Booking successful, payment successful, ticket issuance failed during manual processing                                                                                     | Combo, Flight              |   |
| Payment successful, room issuance failed     | Booked             | Success        | Failed            | <p><br></p>   | Booking successful, payment successful, ticket issuance failed during manual processing                                                                                     | Combo, Hotel               |   |
| Transaction expired                          | Booked             | Expired        | Failed            | <p><br></p>   | Booking successful, ticket issuance failed, payment deadline expired                                                                                                        | Combo, Flight, Hotel, Tour |   |
| Transaction processing                       | Booked             | Success        | Ticket on Process | <p><br></p>   | Booking successful, payment successful, but due to technical issues (network, infrastructure, etc.), information was not sent to the partner and requires manual processing | Combo, Flight, Hotel, Tour |   |
| Canceled faulty ticket                       | Cancel             | Success        | Ticket on Process | <p><br></p>   | Booking successful, payment successful, ticket issuance request is being processed, then booking canceled                                                                   | Combo, Flight, Hotel, Tour |   |
| Canceled successfully issued ticket          | Cancel             | Success        | Success           | <p><br></p>   | Booking successful, payment successful, ticket issuance request was successful, then booking canceled                                                                       | Combo, Flight, Hotel, Tour |   |
| Refunded faulty ticket                       | Cancel             | Refuned        | Ticket on Process | <p><br></p>   | Booking canceled due to ticket issue, refund issued to the customer                                                                                                         | Combo, Flight, Hotel, Tour |   |
| Refunded successfully issued ticket          | Cancel             | Refuned        | Success           | <p><br></p>   | Booking canceled after successful ticket issuance, refund issued to the customer                                                                                            | Combo, Flight, Hotel, Tour |   |


# Regulations for Testing


# Flight

## Introduction:&#x20;

Description of the steps and regulations for booking domestic flight tickets in Vietnam during the integration process between partners and Gotadi in both environments:

* Production Environment&#x20;
* UAT Environment&#x20;

## Domestic Itinerary:

{% hint style="warning" %}
Please notify in advance before performing ticket testing.
{% endhint %}

1. You can search and book tickets (without issuing tickets) for all airlines.
2. Only Vietnam Airlines (VNA) ticket issuance can be tested, with a maximum of **4 passengers per booking**.
3. Passenger name, phone number, and email must be **the tester's actual information**.
4. **Do not use dummy data** (e.g., NGUYEN VAN A, 0900000000, <test@email.com>, etc.).
5. Test-issued VNA tickets must be booked at least **30 days in advance** and **must not be on the same flight and travel date**.
6. For test ticket refund/cancellation requests on **UAT/PRODUCTION**, please send an email to **<system@gotadi.com>** before **4 PM** on the same day. The email should include the **cancellation request details and the refund amount (if applicable).**

<details>

<summary>Refund / Cancellation Request Template </summary>

**Subject:** \[\<Partner Name>-Testing] - Flight Refund/Cancellation Request \<PNR code>

**Email Content:**\
\<Optional>

Please find the booking details for the refund/cancellation request:

* **Booking Code:** \[Insert PNR Code]
* **Reference Code:** \[Insert Reference Code]
* **Itinerary:** \[Insert Itinerary]
* **Guest Names:** \[List of Guests]

</details>

## International Itinerary

{% hint style="warning" %}
Please notify in advance before performing ticket testing.
{% endhint %}

1. You can search and book tickets (without issuing tickets) for all airlines and notify Gotadi of the booked tickets.
2. Only **Vietnam Airlines (VNA) ticket issuance** can be tested, with a maximum of **4 passengers per booking**, and only **1 to 2 bookings per day** can be issued.
3. Passenger name, phone number, and email must be **the tester's actual information**.
4. **Do not use dummy data** (e.g., NGUYEN VAN A, 0900000000, <test@email.com>, etc.).
5. Test-issued VNA tickets must be booked **at least 30 days in advance** and **must not be on the same flight and travel date**.
6. For **test ticket refund/cancellation requests on UAT/PRODUCTION**, please send an email to **<system@gotadi.com>** before **4 PM** on the same day. The email should include the **cancellation request details and the refund amount (if applicable).**
7. If you need to test ticket issuance for airlines **other than VNA**, please contact Gotadi, and testing is only allowed on airlines designated by Gotadi.

{% hint style="danger" %}
Besides Vietnam Airlines, if you need to test other airlines, please only test on airlines provided by Gotadi.

Depending on the testing period, please contact Gotadi’s technical support team to obtain the list of international airlines available at the time of testing.
{% endhint %}

<details>

<summary>Refund / Cancellation Request Template</summary>

**Subject:** \[\<Partner Name>-Testing] - Flight Refund/Cancellation Request \<PNR code>

**Email Content:**\
\<Optional>

Please find the booking details for the refund/cancellation request:

* **Booking Code:** \[Insert PNR Code]
* **Reference Code:** \[Insert Reference Code]
* **Itinerary:** \[Insert Itinerary]
* **Guest Names:** \[List of Guests]

</details>


# Hotel

## Introduction:&#x20;

Description of the steps and regulations for booking domestic flight tickets in Vietnam during the integration process between partners and Gotadi in both environments:

* Production Environment&#x20;
* UAT Environment&#x20;

{% hint style="warning" %}
Please notify in advance before performing ticket testing.
{% endhint %}

{% hint style="danger" %}
Testing is only allowed on hotels provided by Gotadi. Depending on the testing period, please contact Gotadi’s technical support team to obtain the hotel list at the time of testing.
{% endhint %}

1. Select check-in/out dates at least **3 months** from the testing date.
2. Guest information, email, and phone number must be the **actual details** of the tester.
3. **Do not use dummy test data** (e.g., NGUYEN VAN A, 090000000, <Test@gmail.com>, etc.).
4. For test ticket refund/cancellation requests on **UAT/PRODUCTION**, please send an email to **<system@gotadi.com>** and CC **<ota@gotadi.com>** **before 4 PM** on the same day. The email should include the **cancellation request details and the refund amount (if applicable).**

<details>

<summary>Refund / Cancellation Request Template </summary>

**Subject:** \[\<Partner Name>-Testing] - Hotel Refund/Cancellation Request \<Booking code>

**Email Content:**\
\<Optional>

Please find the booking details for the refund/cancellation request:

* **Booking Code:** \[Insert Booking Code]
* **Reference Code:** \[Insert Reference Code]
* **Hotel Name:** \[Insert Hotel Name]
* **Guest Names:** \[List of Guests]
* **Paid Amount:** \[Insert Amount]
* **Check-in - Check-out Date:** \[DD/MM/YYYY - DD/MM/YYYY]

</details>


# CS Support Overall Flow

<figure><img src="/files/airkxZ9KCjoYj5ww3bla" alt="CS Support Flow EN"><figcaption></figcaption></figure>


# Airlines List

Below is the mapping information table and the list of airline codes provided by Gotadi.

{% hint style="info" %}
Please request access.
{% endhint %}

{% embed url="<https://drive.google.com/file/d/1A-tiSyL_IKmIIGSI3pR7LtAvcBlfVWQL/view?usp=drive_link>" %}


