Geliştirici Dokümanı
Travapi Acente API — Entegrasyon
Kendi sisteminizden otel, tur ve cruise araması + rezervasyonu. Aşağıda kimlik, istek/yanıt biçimleri ve örnekler.
Temel bilgiler
- Base URL
https://api.entatil.com- İçerik tipi
application/json- Kimlik
- /v1/auth/token hariç tüm istekler Bearer JWT ister
- Etkileşimli keşif (Swagger)
- api.entatil.com → "Acente API v1"
Hızlı başlangıç
- 1Panele kaydolun ve sandbox anahtarı + secret'ı kendiniz üretin (test). Canlı anahtar Woxx onayıyla açılır.
- 2POST /v1/auth/token ile anahtarınızı 1 saatlik bir token'a çevirin.
- 3Token'ı Authorization: Bearer başlığında gönderip arama/booking yapın.
# 1) Token
curl -X POST https://api.entatil.com/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"apiKey":"pk_sb_...","secret":"sk_sb_..."}'
# 2) Search hotels
curl -X POST https://api.entatil.com/v1/hotels/search \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"checkIn":"2026-08-08","checkOut":"2026-08-12","adults":2,"destinationId":1176,"currency":"EUR"}'Kimlik doğrulama
API anahtarı + secret → kısa ömürlü JWT (1 saat). Token'ı yeniden kullanın, süre dolmadan yenileyin.
{
"token": "eyJhbGciOiJ...",
"token_type": "Bearer",
"expires_in": 3599,
"environment": "sandbox",
"scopes": "hotel,tour,cruise"
}Token ömrü 1 saattir; expires_in (saniye) değerine göre yenileyin.
Endpoint'ler
| Metot | Yol | Açıklama |
|---|---|---|
| POST | /v1/auth/token | API anahtarı → JWT |
| GET | /v1/me | Token kimliği (whoami) |
| GET | /v1/destinations | Destinasyon lookup |
| POST | /v1/hotels/search | Otel araması |
| GET | /v1/hotels/{id} | Otel statik içeriği |
| POST | /v1/tours/search | Tur araması |
| POST | /v1/cruises/search | Cruise araması |
| POST | /v1/bookings | Rezervasyon oluştur |
| GET | /v1/bookings/{reference} | Rezervasyon durumu |
| POST | /v1/bookings/{reference}/cancel | İptal talebi |
Yanıt zarfı
Okuma endpoint'lerinin başarılı yanıtı tek biçimdedir — her zaman response.data okuyun.
{ "data": <content>, "meta": { "requestId": "...", "environment": "sandbox" } }Örnek — otel araması
İstek
POST /v1/hotels/search
{
"checkIn": "2026-08-08", "checkOut": "2026-08-12",
"adults": 2, "destinationId": 1176,
"currency": "EUR", "sourceCountryCode": "TR"
}Yanıt (kısaltıldı)
{
"data": {
"count": 1,
"hotelData": [{
"hotelId": 2007482, "name": "Rixos Beldibi", "stars": 5,
"rooms": [{ "name": "CLASSIC ROOM", "rates": [{
"rateKey": "2007482|866|...|1786147200|1786406400",
"net": "24036.77", "boardName": "ALL INCLUSIVE", "currencyCode": "TRY"
}] }]
}]
},
"meta": { "requestId": "...", "environment": "sandbox" }
}rateKey rezervasyonun çapasıdır — seçilen oda/pansiyon/tarih kombinasyonunu taşır ve booking isteğinde kullanılır.
Sandbox ve Live
- Sandbox — Sandbox: test — booking mock (gerçek kayıt oluşmaz, SBX- referans döner).
- Live — Live: gerçek satış — şimdilik kapalı; pilot onayı sonrası açılır (ödeme acente cari/kredi hesabı ile).
Hata kodları
| HTTP | code | Anlam |
|---|---|---|
| 400 | invalid_request · unsupported_type · idempotency_key_required | Hatalı / eksik istek |
| 401 | invalid_key · invalid_secret · key_revoked · invalid_token | Kimlik |
| 403 | forbidden_scope · live_booking_unavailable · quota_exceeded · ip_not_allowed | Yetki / kota / IP |
| 404 | not_found · sandbox_ephemeral | Bulunamadı / kapsam dışı |
| 409 | in_progress · cancellation_already_requested | Idempotency / eşzamanlılık |
| 429 | rate_limited | Rate limit / brute-force |
| 502 | gateway_error · booking_error | Üst sistem erişilemedi |
Tam dokümantasyon
Tüm endpoint'lerin gerçek istek/yanıt örnekleri, webhook imza doğrulama ve hata yönetimi için Woxx ekibinden ayrıntılı geliştirici kılavuzunu isteyin.
[email protected]