# API Commit

### 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="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>
