API ReferenceBookings
Tạo chuyến
POST
Tạo chuyến từ báo giá còn hiệu lực. Chuyến được phát cho tài xế ngay (sandbox thì không).
Gửi lại cùng Idempotency-Key trong 24 giờ sẽ nhận lại đúng chuyến đã tạo, không tạo thêm.
ApiKeyAuthheader
Authorization<token>Authorization: ApiKey <key>. Key sandbox bắt đầu bằng gc_test_, production bằng gc_live_.
Key chỉ hiện một lần lúc tạo. Không dùng key trong app di động hay trình duyệt.
Idempotency-Key?stringChuỗi ngẫu nhiên (khuyến nghị UUID) để chống tạo trùng khi gửi lại request.
Length
length <= 64application/json- body
quote_id*stringpartner_reference_id*stringMã đơn bên đối tác, duy nhất trong tài khoản đối tác.
Length
length <= 64customer*vehicle?Xe của khách (dịch vụ lái hộ)
flight_code?stringSố hiệu chuyến bay nếu đón ở sân bay
Length
length <= 20payment_method?stringcash: khách trả tài xế. partner_invoice: đối tác thanh toán theo kỳ (cần được mở trong hợp đồng).
Default
"cash"Value in
"cash""partner_invoice"note?stringGhi chú cho tài xế
Length
length <= 500Đã tạo chuyến
application/json- response
success*booleandata*curl -X POST 'https://api-stag.gocheap.vn/open-api/v1/bookings' \ -H 'Content-Type: application/json' \ -d '{ "quote_id": "qt_7Hc2kP9xLm", "partner_reference_id": "HTL-20261112-0042", "customer": { "name": "Nguyễn Văn An", "phone": "0912345678" }, "vehicle": { "model": "Toyota Vios", "license_plate": "30A-123.45" }, "note": "Khách đợi ở sảnh A"}'Example Response
{ "success": true, "data": { "booking_id": "string", "partner_reference_id": "string", "service": "thue-tai-xe", "status": "searching", "pick_up": { "place_id": "string", "name": "string", "address": "string", "lat": 0.1, "lng": 0.1 }, "destination": { "place_id": "string", "name": "string", "address": "string", "lat": 0.1, "lng": 0.1 }, "pick_up_time": "2019-08-24T14:15:22Z", "ways": "one_way", "distance_m": 0, "price": 0, "final_price": 0, "currency": "VND", "payment_method": "cash", "customer": { "name": "string", "phone": "string", "external_id": "string" }, "driver": { "name": "string", "phone": "string", "rating": 0, "eta_s": 0, "location": { "lat": 0.1, "lng": 0.1, "updated_at": "2019-08-24T14:15:22Z" } }, "cancellation": { "cancelled_by": "client", "reason": "string", "cancelled_at": "2019-08-24T14:15:22Z" }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }}