Lydira API
TR

Guides

Quickstart

Key to first booking, in five calls. Pick your cell at the top of the page first and every sample below will address it.

  1. 1

    Get a key

    In Lydira, open Settings → API keys and create one. Pick the narrowest scope that does the job: import for a partner system pushing bookings, ticket_import for the desktop printer agent, full only when you genuinely need to read the rest of the account. The token starts with sek_ and is shown once.
    Settings → API keys
    
      Name    Partner sync
      Scope   full | ticket_import | import
      Token   sek_…  (shown once)
  2. 2

    Prove you can reach it

    Health takes no key, so a failure here is a URL problem and nothing else.
    curl https://YOUR-CELL.lydira.com/api/v1/health
    
    { "ok": true, "api": "v1" }
  3. 3

    Prove the key works

    /me is the only call that tells you what your key actually is. Keep the companies[].id and branches[].id it returns: the ingest endpoints take them, and they are discoverable nowhere else.
    curl https://YOUR-CELL.lydira.com/api/v1/me \
      -H 'Authorization: Bearer sek_YOUR_API_KEY'
  4. 4

    Dry-run a booking

    Every ingest endpoint has a twin that runs the identical path and writes nothing. Green here means green on the real thing, so there is no reason to skip it.
    curl -X POST https://YOUR-CELL.lydira.com/api/v1/imports/hotel_stays/validate \
      -H 'Authorization: Bearer sek_YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{
      "rows": [
        {
          "external_id": "HOTEL-STAY-1001",
          "check_in_on": "2026-03-14",
          "check_out_on": "2026-03-18",
          "currency": "EUR",
          "guest_count": 2,
          "customer_external_id": "CUSTOMER-1001",
          "supplier_external_id": "SUPPLIER-1001",
          "status": "draft",
          "notes": "Imported from the source system.",
          "rate_basis": "net",
          "margin_mode": "percent",
          "option_date": "2026-03-14",
          "transaction_date": "2026-03-14",
          "invoice_date": "2026-03-18",
          "cost_lines": [
            {
              "kind": "room_rate",
              "amount": "1250.00",
              "label": "Imported line",
              "currency": "EUR",
              "vat_rate": "20",
              "tax_inclusive": true,
              "quantity": 1
            }
          ],
          "sell_lines": [
            {
              "kind": "package_price",
              "amount": "1250.00",
              "label": "Imported line",
              "currency": "EUR",
              "vat_rate": "20",
              "tax_inclusive": true,
              "quantity": 1
            }
          ],
          "travelers": [
            {
              "first_name": "Ada",
              "last_name": "Lovelace",
              "nationality": "TR",
              "national_id": "10000000146",
              "passport_number": "U01234567",
              "passport_country": "TR",
              "passport_expiry": "2031-06-30",
              "date_of_birth": "1988-04-21",
              "gender": "female",
              "frequent_flyer_number": "TK123456789"
            }
          ],
          "rooms": [
            {
              "name": "Deluxe Sea View",
              "room_type": "double",
              "capacity": 2,
              "occupancy": 2,
              "nightly_rate": "180.00",
              "single_supplement_amount": "60.00",
              "single_supplement_currency": "EUR"
            }
          ]
        }
      ]
    }'
  5. 5

    Send it for real

    Same body, no /validate. A bad row fails on its own and names the field; the rest of the batch still lands.
    curl -X POST https://YOUR-CELL.lydira.com/api/v1/imports/hotel_stays \
      -H 'Authorization: Bearer sek_YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
      -d '{
      "rows": [
        {
          "external_id": "HOTEL-STAY-1001",
          "check_in_on": "2026-03-14",
          "check_out_on": "2026-03-18",
          "currency": "EUR",
          "guest_count": 2,
          "customer_external_id": "CUSTOMER-1001",
          "supplier_external_id": "SUPPLIER-1001",
          "status": "draft",
          "notes": "Imported from the source system.",
          "rate_basis": "net",
          "margin_mode": "percent",
          "option_date": "2026-03-14",
          "transaction_date": "2026-03-14",
          "invoice_date": "2026-03-18",
          "cost_lines": [
            {
              "kind": "room_rate",
              "amount": "1250.00",
              "label": "Imported line",
              "currency": "EUR",
              "vat_rate": "20",
              "tax_inclusive": true,
              "quantity": 1
            }
          ],
          "sell_lines": [
            {
              "kind": "package_price",
              "amount": "1250.00",
              "label": "Imported line",
              "currency": "EUR",
              "vat_rate": "20",
              "tax_inclusive": true,
              "quantity": 1
            }
          ],
          "travelers": [
            {
              "first_name": "Ada",
              "last_name": "Lovelace",
              "nationality": "TR",
              "national_id": "10000000146",
              "passport_number": "U01234567",
              "passport_country": "TR",
              "passport_expiry": "2031-06-30",
              "date_of_birth": "1988-04-21",
              "gender": "female",
              "frequent_flyer_number": "TK123456789"
            }
          ],
          "rooms": [
            {
              "name": "Deluxe Sea View",
              "room_type": "double",
              "capacity": 2,
              "occupancy": 2,
              "nightly_rate": "180.00",
              "single_supplement_amount": "60.00",
              "single_supplement_currency": "EUR"
            }
          ]
        }
      ]
    }'

Where to go next