> 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/vietnamese/doi-tac-b2b2c/phuong-thuc-api/hotel/api/api-booking-create.md).

# API Booking Create

Endpoint: `bookings/create`

Tạo booking chờ thanh toán.

**Request**

| Field                                   | Kiểu        | Bắt buộc | Mô tả                                                                                        |
| --------------------------------------- | ----------- | -------- | -------------------------------------------------------------------------------------------- |
| `bookingToken`                          | string      | ✔        | Từ `price-check`                                                                             |
| `partnerReference`                      | string ≤ 64 | ✔        | Mã đơn của đối tác, duy nhất; gửi lại trả booking cũ                                         |
| `contact.firstName`, `contact.lastName` | string      | ✔        |                                                                                              |
| `contact.email`                         | email       | ✔        |                                                                                              |
| `contact.phone`                         | string      | ✔        | Số trong nước (`0901234567`) hoặc kèm mã nước (`+84901234567`)                               |
| `contact.phoneCode`                     | string      |          | Mã nước, có hoặc không dấu `+`; mặc định `84`. \*\*Bắt buộc khi `phone` là số nước ngoài\*\* |
| `rooms[].guests[]`                      | array       | ✔        | `{ firstName, lastName, type: ADULT\|CHILD, age }`                                           |
| `specialRequest`                        | string      |          |                                                                                              |

{% hint style="danger" %}
Khách theo **đúng thứ tự `rooms` lúc tìm**: mỗi phòng phải có đúng số khách `ADULT` và số khách `CHILD` (kèm `age`) đã tìm. Sai thì mã `07`.
{% endhint %}

```json
{
  "bookingToken": "bt_Qw9x...",
  "partnerReference": "ORDER-20261115-0001",
  "contact": {
    "firstName": "An", "lastName": "Nguyen",
    "email": "an.nguyen@example.com",
    "phone": "0901234567", "phoneCode": "84"
  },
  "rooms": [{
    "guests": [
      { "firstName": "An", "lastName": "Nguyen", "type": "ADULT" },
      { "firstName": "Binh", "lastName": "Tran", "type": "ADULT" },
      { "firstName": "Minh", "lastName": "Nguyen", "type": "CHILD", "age": 6 }
    ]
  }],
  "specialRequest": "Tầng cao"
}
```

**Response**

| Field                     | Kiểu      | Mô tả                           |
| ------------------------- | --------- | ------------------------------- |
| `bookingNumber`           | string    | Mã booking phía Gotadi          |
| `partnerReference`        | string    |                                 |
| `status`                  | enum      | `PENDING_PAYMENT`               |
| `totalAmount`, `currency` |           | Số tiền phải thu của khách      |
| `paymentDeadline`         | date-time | Hạn giữ phòng, thường \~10 phút |

```json
{
  "bookingNumber": "HTL2611150001",
  "partnerReference": "ORDER-20261115-0001",
  "status": "PENDING_PAYMENT",
  "totalAmount": 2400000,
  "currency": "VND",
  "paymentDeadline": "2026-11-15T15:20:00+07:00"
}
```

Đối tác thu tiền của khách rồi gọi `bookings/commit` **trước `paymentDeadline`**. Quá hạn, booking chuyển `EXPIRED`.
