คู่มือและข้อมูลอ้างอิงสำหรับ ElefyMove Open API
ขณะนี้คู่มือเหล่านี้มีเฉพาะภาษาอังกฤษ
ElefyMove’s calendar is the single source of truth for anything bookable. Every date range carries a state — AVAILABLE, HELD, BOOKED, or BLOCKED — and conflicts resolve first-come-first-served across every channel.
| เมธอด | เอนด์พอยต์ | สโคป | ใช้ทำอะไร |
|---|---|---|---|
| GET | /api/public/v1/listings/{id}/availability | availability:read | อ่านปฏิทินรวมของประกาศตามช่วงวันที่ — ว่าง จองชั่วคราว จองแล้ว หรือถูกบล็อก |
| GET | /api/public/v1/availability | availability:read | อ่านห้องว่างของประกาศได้สูงสุด 50 รายการในคำขอเดียว รหัสที่คุณไม่ได้เป็นเจ้าของหรือไม่มีอยู่จริงจะถูกใส่ไว้ใน notFound แทนที่จะทำให้คำขอทั้งหมดล้มเหลว |
| GET | /api/public/v1/listings/{id}/blocks | availability:read | อ่านการบล็อกจากช่องทางภายนอกที่ยังใช้งานอยู่ของคุณเองสำหรับประกาศหนึ่งรายการ เลือกจำกัดช่วงวันที่ได้ |
/api/public/v1/listings/{id}/blocks | availability:write | สร้างหรือแก้ไขการบล็อกวันที่จากช่องทางภายนอก โดยระบุรหัสอ้างอิงของคุณเอง | |
/api/public/v1/listings/{id}/blocks/batch | availability:write | สร้างหรือแก้ไขการบล็อกจากช่องทางภายนอกได้สูงสุด 100 รายการในประกาศเดียวด้วยคำขอเดียว พร้อมผลลัพธ์สำเร็จ/ล้มเหลวแยกรายการ | |
| DELETE | /api/public/v1/listings/{id}/blocks/batch | availability:write | ลบการบล็อกจากช่องทางภายนอกได้สูงสุด 100 รายการในประกาศเดียวด้วยคำขอเดียว พร้อมผลลัพธ์สำเร็จ/ล้มเหลวแยกรายการ |
| DELETE | /api/public/v1/listings/{id}/blocks/{externalRef} | availability:write | ลบการบล็อกวันที่จากช่องทางภายนอกที่คุณเคยสร้างไว้ |
curl "https://elefymove.com/api/public/v1/listings/{listingId}/availability?from=2026-09-01&to=2026-09-30" \
-H "X-Api-Key: efy_live_xxxxxxxxxxxxxxxxxxxxxxxx"
# Response — 200 OK
[
{ "from": "2026-09-01", "to": "2026-09-14", "state": "AVAILABLE" },
{ "from": "2026-09-15", "to": "2026-09-20", "state": "BLOCKED", "source": "partner-site", "externalRef": "HMXYZ123" },
{ "from": "2026-09-21", "to": "2026-09-30", "state": "AVAILABLE" }
]Syncing a whole portfolio? GET /availability reads up to 50 listings in one call — pass their ids as a comma-separated listingIds. An id you don't own or that doesn't exist is folded into the response's notFound array rather than failing the whole request.
When a stay is booked on your own platform, write a block carrying your reference. Blocks are dates + a reference only — no guest personal data crosses the API. GET /listings/:id/blocks reads your own active blocks back, optionally narrowed by from/to.
The batch endpoints write or delete up to 100 blocks on one listing in a single call. Each block gets its own result — check every item in the response rather than assuming the whole batch landed; one bad date range never rolls back the others.
Place a short-lived hold (up to 10 minutes per call) while a guest completes checkout on your side, then either confirm it into a block or release it early. Not ready in time? POST /holds/:id/extend re-arms the expiry — but a hold's total lifetime, measured from when it was created (not from the extension), is capped at 30 minutes. An extension that would cross that cap is refused with a 409, so extending repeatedly cannot hold inventory indefinitely.
| เมธอด | เอนด์พอยต์ | สโคป | ใช้ทำอะไร |
|---|---|---|---|
| GET | /api/public/v1/holds | holds:write | แสดงรายการการจองชั่วคราวของคุณ เรียงจากล่าสุด ค่าเริ่มต้นแสดงเฉพาะที่ยัง active ขยายผลลัพธ์ได้ด้วย ?status=all |
| GET | /api/public/v1/holds/{id} | holds:write | อ่านการจองชั่วคราวหนึ่งรายการของคุณด้วยรหัส |
/api/public/v1/listings/{id}/holds | holds:write | จองวันที่ไว้ชั่วคราวระหว่างที่ผู้เข้าพักชำระเงินฝั่งคุณ คำขอที่ช้ากว่าจะได้รับ 409 พร้อมรหัส SLOT_TAKEN | |
/api/public/v1/holds/{id}/extend | holds:write | ขยายเวลาหมดอายุของการจองชั่วคราวออกไปจากตอนนี้ อายุรวมของการจองชั่วคราวถูกจำกัดไว้ที่ 30 นาทีนับจากสร้าง — คำขอขยายที่เกินขีดจำกัดนี้จะถูกปฏิเสธด้วยรหัส 409 | |
| DELETE | /api/public/v1/holds/{id} | holds:write | ปล่อยการจองชั่วคราวของคุณก่อนหมดเวลา |
curl -X POST "https://elefymove.com/api/public/v1/listings/{listingId}/holds" \
-H "X-Api-Key: efy_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"from": "2026-09-15", "to": "2026-09-20", "ttlSeconds": 300}'
# Response — 201 Created
{ "holdId": "hld_9f3a2c1b", "expiresAt": "2026-08-13T10:15:00Z" }If another channel takes the dates first, the losing request gets a machine-readable 409 — surface it to your guest and refresh availability:
# Same request, the dates were just taken by another channel
# Response — 409 Conflict
{
"code": "SLOT_TAKEN",
"conflictingState": "HELD",
"wonBy": "external"
}