API Endpoints - Data schrijven (POST)
POST-endpoints voor het importeren van kamers, boekingen en tarieven
API Endpoints - Data schrijven (POST)
POST /import_bookings
Nhập đặt phòng hàng loạt.
POST /sco_pms_be/sco_pms_be_api/import_bookings
Authorization: Bearer {api_key}
Content-Type: application/json
{
"bookings": [
{
"checkin_date": "2026-05-01",
"checkout_date": "2026-05-03",
"room_type_name": "Deluxe Double",
"guest_first_name": "John",
"guest_last_name": "Doe",
"guest_email": "[email protected]",
"total_amount": 2400000,
"currency_iso": "VND",
"booking_source": "API",
"booking_status": "Confirmed"
}
],
"duplicate_action": "skip"
}
POST /import_rooms
Nhập loại phòng hoặc phòng vật lý.
POST /sco_pms_be/sco_pms_be_api/import_rooms
Content-Type: application/json
{
"rooms": [
{
"name": "Superior Room",
"max_occupancy": 2,
"total_rooms": 10,
"base_price": 1500000,
"bed_type": "queen",
"room_area": "30 m²"
}
]
}
POST /import_rates
Nhập giá và tình trạng phòng theo khoảng ngày.
POST /sco_pms_be/sco_pms_be_api/import_rates
Content-Type: application/json
{
"rates": [
{
"room_type_name": "Superior Room",
"rate_plan_name": "Standard - RO",
"date_from": "2026-05-01",
"date_to": "2026-05-31",
"rate_amount": 1500000,
"availability": 10,
"min_nights": 1,
"stop_sell": 0
}
],
"duplicate_action": "update"
}
Xử lý trùng lặp
Tham số duplicate_action:
"skip"— Bỏ qua dữ liệu trùng (mặc định)"update"— Cập nhật dữ liệu cũ bằng dữ liệu mới
Response
{
"success": true,
"total": 5,
"imported": 4,
"skipped": 1,
"error_count": 0,
"errors": []
}