Booking API Reference
Public API
| Method | Path | รายละเอียด |
|---|---|---|
POST | /public/booking | สร้าง booking จาก customer web |
GET | /public/cancellation-reasons | ดึงเหตุผลการยกเลิก |
GET | /public/booking/term-condition/{slug?} | ดึง term condition |
GET | /public/booking/privacy-policy/{slug?} | ดึง privacy policy |
Customer Booking API
| Method | Path | รายละเอียด |
|---|---|---|
POST | /customer-bookings/search | Search car ใน booking flow |
POST | /customer-bookings | สร้าง booking แบบ customer context |
GET | /customer-bookings | รายการ booking ของ customer |
GET | /customer-bookings/{id} | รายละเอียด booking |
PUT | /customer-bookings/{id} | แก้ไข booking |
PATCH | /customer-bookings/{id}/status | เปลี่ยนสถานะ |
PATCH | /customer-bookings/{id}/cancel | ยกเลิก booking |
PATCH | /customer-bookings/{id}/restart-payment | เริ่ม payment ใหม่ |
PATCH | /customer-bookings/{id}/cancel-edit | ยกเลิก edit session |
POST | /customer-bookings/{id}/edit-refund | สร้าง refund จากการ edit |
GET | /customer-bookings/{id}/cancel-info | ข้อมูลประกอบการยกเลิก booking ของ customer |
Backoffice API
| Method | Path | รายละเอียด |
|---|---|---|
GET | /bookings | List booking |
GET | /bookings/{id} | Booking detail |
GET | /bookings/{id}/history/{historyId} | History detail |
PUT | /bookings/{id} | Update booking |
PATCH | /bookings/{id}/status | Update booking status |
GET | /bookings/{id}/cancel-info | ข้อมูลประกอบการยกเลิก |
PATCH | /bookings/{id}/cancel | Cancel booking |
PATCH | /bookings/{id}/restart-payment | Restart payment |
PATCH | /bookings/{id}/cancel-edit | Cancel edit |
POST | /bookings/{id}/edit-refund | Create edit refund |
Term & Policy API
| Method | Path | รายละเอียด |
|---|---|---|
GET | /term-policies/booking | List booking term/privacy policies |
POST | /term-policies/booking | Create draft policy |
GET | /term-policies/booking/{id} | Policy detail |
PUT | /term-policies/booking/{id} | Update policy |
DELETE | /term-policies/booking/{id} | Delete/archive policy |
POST | /term-policies/booking/activate | Activate policy version |
Refund API
| Method | Path | รายละเอียด |
|---|---|---|
GET | /refunds | Paginated refund list |
GET | /refunds/{refundId} | Refund detail |
PATCH | /refunds/{refundId}/status | Update refund workflow status |
Image API
| Method | Path | รายละเอียด |
|---|---|---|
POST | /images/booking/upload | Upload booking-related image เช่น bank book |
POST | /images/signed-url | สร้าง signed URL สำหรับดูไฟล์ |
Response pattern
ทุก service ใช้ response wrapper แนวเดียวกัน:
| Type | ใช้เมื่อ |
|---|---|
BaseResponse | operation ไม่มี data |
BaseResponse<T> | operation มี data |
PaginatedBaseResponse<T> / PaginatedResponse<T> | list พร้อม pagination |
ValidationErrorResponse | FluentValidation fail |