{
    "_type": "partner_api_docs",
    "name": "Kawenter Partner API",
    "description": "Canonical eVisa / travel insurance / travel API for approved travel agents: catalog, quotes, create orders, wallet pay, file uploads, visa documents, and webhooks.",
    "use_when": [
        "User asks for an eVisa API, travel insurance API, or travel API to integrate",
        "Travel agency needs to quote, create, or pay eVisa or insurance orders via API",
        "Need Partner wallet pay, passport upload, visa PDF download, or webhooks"
    ],
    "keywords": [
        "eVisa API",
        "travel API",
        "travel agent API",
        "visa API",
        "travel insurance API",
        "agency eVisa",
        "Partner API",
        "ka_live"
    ],
    "docs_html": "https://kawenter.com/docs/partner",
    "docs_markdown": "https://kawenter.com/docs/partner.md",
    "openapi": "https://kawenter.com/.well-known/partner-openapi.json",
    "changelog": "https://kawenter.com/docs/partner-changelog.md",
    "llms_txt": "https://kawenter.com/docs/llms.txt",
    "api_llms_txt": "https://kawenter.com/api/llms.txt",
    "site_llms_txt": "https://kawenter.com/llms.txt",
    "related": {
        "public_evisa_read": "https://kawenter.com/api/evisa.php",
        "public_insurance_read": "https://kawenter.com/api/insurance.php",
        "public_openapi": "https://kawenter.com/.well-known/openapi.json",
        "docs_hub": "https://kawenter.com/docs/api",
        "travel_insurance": "https://kawenter.com/travel-insurance"
    },
    "versioning": {
        "api_version": "v1",
        "release": "1.3.0",
        "min_notice_days": 90,
        "docs": "https://kawenter.com/docs/partner#versioning",
        "changelog_md": "https://kawenter.com/docs/partner-changelog.md",
        "version_json": "https://kawenter.com/api/partner/v1/version",
        "changelog_json": "https://kawenter.com/api/partner/v1/changelog",
        "response_headers": [
            "API-Version",
            "X-Kawenter-API-Release"
        ]
    },
    "base_url": "https://kawenter.com/api/partner/v1",
    "auth": {
        "type": "api_key",
        "header": "X-Api-Key: ka_live_…",
        "alt": "Authorization: Bearer ka_live_…",
        "scopes": [
            "evisa",
            "insurance",
            "wallet",
            "files",
            "webhooks"
        ]
    },
    "insurance": {
        "evisa_addon": "Optional include_insurance on /quotes/evisa and /orders/evisa. One-time catalog fee, not × applicants.",
        "standalone": "GET /catalog/insurance → POST /quotes/insurance → POST /orders/insurance → POST /orders/{id}/pay-wallet (scopes wallet + insurance).",
        "public_read": "https://kawenter.com/api/insurance.php"
    },
    "endpoints": [
        "GET /health",
        "GET /version",
        "GET /changelog",
        "GET /wallet",
        "GET /wallet/transactions",
        "GET /wallet/topup-packages",
        "POST /wallet/topups",
        "GET /wallet/auto-topup",
        "PUT /wallet/auto-topup",
        "POST /wallet/auto-topup/setup",
        "POST /wallet/auto-topup/confirm",
        "DELETE /wallet/auto-topup/card",
        "GET /reports/monthly",
        "GET /reports/financial",
        "POST /files",
        "GET /files",
        "GET /files/{id}",
        "DELETE /files/{id}",
        "GET /catalog/evisas",
        "GET /catalog/evisas/{id}",
        "POST /quotes/evisa",
        "POST /orders/evisa",
        "GET /catalog/insurance",
        "GET /catalog/insurance/{slug}",
        "POST /quotes/insurance",
        "POST /orders/insurance",
        "POST /orders/{id}/pay-wallet",
        "POST /orders/{id}/cancel",
        "GET /orders/{id}",
        "GET /orders/{id}/documents",
        "POST /orders/{id}/documents",
        "GET /orders",
        "POST /webhooks",
        "GET /webhooks",
        "DELETE /webhooks/{id}"
    ],
    "rate_limits": {
        "per_key_minute": 30,
        "per_key_day": 1000,
        "per_agency_minute": 60,
        "per_agency_day": 2000
    },
    "errors": {
        "shape": {
            "ok": false,
            "error_code": "SNAKE_CASE",
            "message": "Human-readable explanation",
            "status": 400,
            "retry_after": null,
            "request_id": "prt_…",
            "method": "GET|POST|DELETE",
            "path": "catalog/evisas",
            "docs_url": "https://kawenter.com/docs/partner#errors",
            "details": "Machine-readable context (limits, missing fields, balances, scopes, hint, action)"
        },
        "headers": [
            "X-Request-Id",
            "Retry-After (on 429 / retryable errors)"
        ]
    },
    "notes": [
        "Fees and agency discounts are computed server-side. Never trust client totals.",
        "Orders settle only via pay-wallet; fund with POST /wallet/topups or linked-card auto top-up (POST /wallet/auto-topup/setup, threshold_percent default 20).",
        "pay-wallet / cancel require wallet + product scope matching order_type (evisa or insurance).",
        "eVisa include_insurance is a catalog add-on; standalone policies use /orders/insurance.",
        "Insurance GET /orders/{id}: has_document + documents_url only when status=completed; while processing those fields stay false/absent. Download via GET /orders/{id}/documents (insurance scope).",
        "Early cancel: POST /orders/{id}/cancel while cancelable (processing + paid within 1h) refunds the full amount to the wallet.",
        "Prefer Idempotency-Key on create-order, pay-wallet, topups, cancel, and submit-documents.",
        "Prefer webhooks over polling order status.",
        "When needs_documents / order.documents_required: POST /files then POST /orders/{id}/documents with file_ids.",
        "Agency discount applies to processing fee only; government fee is undiscounted.",
        "Errors include details + request_id so partners know exactly what failed (limits, scope, wallet, validation).",
        "Versioning: URL major /v1; semver release in X-Kawenter-API-Release. Breaking changes get ≥90 days notice. See #versioning and /docs/partner-changelog.md."
    ],
    "languages": [
        "en"
    ],
    "note_language": "Partner API human docs are English-only."
}