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

# API Booking Commit

Endpoint: `bookings/commit`

Declare payment collected; Gotadi debits the agency balance and confirms with the hotel.

**Request**

| Field            | Type   | Required | Description                                                  |
| ---------------- | ------ | -------- | ------------------------------------------------------------ |
| `bookingNumber`  | string | ✔        |                                                              |
| `partnerTransId` | string | ✔        | Partner-side payment transaction id, used for reconciliation |
| `amount`         | int    | ✔        | \*\*Must equal `totalAmount`\*\*                             |

```json
{ "bookingNumber": "HTL2611150001", "partnerTransId": "PAY-778899", "amount": 2400000 }
```

**Response**

| Field                   | Type   | Description                            |
| ----------------------- | ------ | -------------------------------------- |
| `bookingNumber`         | string |                                        |
| `status`                | enum   | `CONFIRMED` \| `PENDING` \| `FAILED`   |
| `hotelConfirmationCode` | string | Hotel confirmation code; may be absent |

```json
{ "bookingNumber": "HTL2611150001", "status": "CONFIRMED", "hotelConfirmationCode": "DN-55821" }
```

* `status: PENDING` (code `09`) — the hotel has not confirmed yet, or the outcome is unknown. **Do not refund the guest**; poll `bookings/get` every minute until `CONFIRMED` or `FAILED`.
* `CONFIRMED` may lack `hotelConfirmationCode` when Gotadi could not re-read the booking; fetch it later via `bookings/get`.
* `FAILED` — the booking did not go through; money already collected is handled per the reconciliation agreement between the two parties.

{% hint style="warning" %}
Only **one `commit`** runs per booking at a time, locked for up to **120 seconds**; overlapping calls receive code `01` and are **not charged twice**. Committing a booking no longer in `PENDING_PAYMENT` returns `08`; past `paymentDeadline` it returns `24`.
{% endhint %}
