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ıç

  1. 1Panele kaydolun ve sandbox anahtarı + secret'ı kendiniz üretin (test). Canlı anahtar Woxx onayıyla açılır.
  2. 2POST /v1/auth/token ile anahtarınızı 1 saatlik bir token'a çevirin.
  3. 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

MetotYolAçıklama
POST/v1/auth/tokenAPI anahtarı → JWT
GET/v1/meToken kimliği (whoami)
GET/v1/destinationsDestinasyon lookup
POST/v1/hotels/searchOtel araması
GET/v1/hotels/{id}Otel statik içeriği
POST/v1/tours/searchTur araması
POST/v1/cruises/searchCruise araması
POST/v1/bookingsRezervasyon 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

  • SandboxSandbox: test — booking mock (gerçek kayıt oluşmaz, SBX- referans döner).
  • LiveLive: gerçek satış — şimdilik kapalı; pilot onayı sonrası açılır (ödeme acente cari/kredi hesabı ile).

Hata kodları

HTTPcodeAnlam
400invalid_request · unsupported_type · idempotency_key_requiredHatalı / eksik istek
401invalid_key · invalid_secret · key_revoked · invalid_tokenKimlik
403forbidden_scope · live_booking_unavailable · quota_exceeded · ip_not_allowedYetki / kota / IP
404not_found · sandbox_ephemeralBulunamadı / kapsam dışı
409in_progress · cancellation_already_requestedIdempotency / eşzamanlılık
429rate_limitedRate limit / brute-force
502gateway_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]