# API Commit

### Đặ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="https://3127657987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fka3LMTlXv2Ay7BbFZMOc%2Fuploads%2FGms61qCFoGoSRBNSNC4E%2Fimage.png?alt=media&#x26;token=6d87f0d8-12b1-46db-98b9-906f215500c8" alt=""><figcaption></figcaption></figure>
