Lydira API
EN

Aktarım yolları

Devir belgeleri

Önceki programınızdan devralınan açık faturalar ve tedarikçi faturaları.

Geçiş gününde önceki programınızdan devralınan açık faturalar ve tedarikçi faturaları. Önceden tahsil edilmiş tutar, devreden bir tahsilat olarak gelir.

Bu sayfada

Şu kapsamlardan birini taşıyan anahtar erişir:importimport_issue

Faturalar (alacaklar)operator_invoices

POST/api/v1/imports/operator_invoices

Upsert: aynı external_id ile tekrar gönderim mevcut satırı günceller.

Uç noktalar

  • validatePOST /api/v1/imports/operator_invoices/validate
  • importPOST /api/v1/imports/operator_invoices
  • feedGET /api/v1/imports/operator_invoices/records
  • read_backGET /api/v1/imports/operator_invoices/records/{external_id}

Yeni bir satırda bulunmalı

legacy_numberissued_ontotal_amountşunlardan biri: customer_external_id | bill_to_name

Alanlar(11)
  • external_idstring
  • legacy_numberstringzorunlu
  • issued_ondatezorunlu
  • due_ondate
  • total_amountmoneyzorunlu
  • amount_paidmoney

    already collected before cutover; imported as a brought-forward receipt

  • paid_ondate

    when amount_paid was collected; defaults to the invoice date

  • currencycurrency
  • bill_to_namestring
  • customer_external_idreference
  • notesstring

Referanslar

  • customer_external_id → customers · eşleşme external_id, email · bulunamazsa error

Geri okuma

Acente kaydı işledikten sonra (onaylar, biletleri numaralar, faturalar) GET /api/v1/imports/{entity}/records/{external_id} bunu döner; her webhook da aynı gövdeyi taşır. detail, gönderiminizden sonra yalnız acentenin ekleyebildiği bilgileri taşır.

GET /api/v1/imports/operator_invoices/records/OPERATOR-INVOICE-1001
200
{
  "entity": "operator_invoices",
  "external_id": "OPERATOR-INVOICE-1001",
  "source_system": "crm",
  "type": "OperatorInvoice",
  "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
  "created_at": "2026-03-14T09:30:00Z",
  "updated_at": "2026-03-15T11:05:00Z",
  "status": "issued",
  "currency": "EUR",
  "totals": {
    "total": "1250.0",
    "paid": "0.0",
    "balance": "1250.0"
  }
}

İstek · deneme, tüm alanlar

curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/imports/operator_invoices/validate' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "source_system": "crm",
  "rows": [
    {
      "external_id": "OPERATOR-INVOICE-1001",
      "legacy_number": "2025-000431",
      "issued_on": "2026-03-14",
      "due_on": "2026-03-18",
      "total_amount": "1250.00",
      "amount_paid": "1250.00",
      "paid_on": "2026-03-14",
      "currency": "EUR",
      "bill_to_name": "Lovelace Seyahat A.Ş.",
      "customer_external_id": "CUSTOMER-1001",
      "notes": "Imported from the source system."
    }
  ]
}'
Yanıt
200
{
  "import": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "entity": "operator_invoices",
    "source_system": "crm",
    "status": "ready",
    "company_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "stats": {
      "total": 1,
      "will_create": 1,
      "will_update": 0,
      "created": 0,
      "updated": 0,
      "skipped": 0,
      "invalid": 0,
      "failed": 0,
      "not_selected": 0
    },
    "error": null,
    "created_at": "2026-03-14T09:30:00Z",
    "links": {
      "self": "/api/v1/imports/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "rows": "/api/v1/imports/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18/rows"
    },
    "mode": "validate",
    "async": false,
    "on_conflict": "skip",
    "pricing": "apply_rules"
  },
  "ignored_fields": [],
  "results": [
    {
      "row": 1,
      "external_id": "OPERATOR-INVOICE-1001",
      "status": "will_create"
    }
  ]
}

Tedarikçi faturaları (borçlar)supplier_bills

POST/api/v1/imports/supplier_bills

Upsert: aynı external_id ile tekrar gönderim mevcut satırı günceller.

Uç noktalar

  • validatePOST /api/v1/imports/supplier_bills/validate
  • importPOST /api/v1/imports/supplier_bills
  • feedGET /api/v1/imports/supplier_bills/records
  • read_backGET /api/v1/imports/supplier_bills/records/{external_id}

Yeni bir satırda bulunmalı

numberreceived_attotal_amountsupplier_external_id

Alanlar(10)
  • external_idstring
  • numberstringzorunlu
  • received_atdatezorunlu
  • due_ondate
  • total_amountmoneyzorunlu
  • amount_paidmoney

    already paid before cutover; imported as a brought-forward payment

  • paid_ondate

    when amount_paid was paid; defaults to the bill date

  • currencycurrency
  • supplier_external_idreferencezorunlu
  • notesstring

Referanslar

  • supplier_external_id → suppliers · eşleşme external_id, code · bulunamazsa error

Geri okuma

Acente kaydı işledikten sonra (onaylar, biletleri numaralar, faturalar) GET /api/v1/imports/{entity}/records/{external_id} bunu döner; her webhook da aynı gövdeyi taşır. detail, gönderiminizden sonra yalnız acentenin ekleyebildiği bilgileri taşır.

GET /api/v1/imports/supplier_bills/records/SUPPLIER-BILL-1001
200
{
  "entity": "supplier_bills",
  "external_id": "SUPPLIER-BILL-1001",
  "source_system": "crm",
  "type": "SupplierBill",
  "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
  "created_at": "2026-03-14T09:30:00Z",
  "updated_at": "2026-03-15T11:05:00Z",
  "status": "open",
  "currency": "EUR",
  "totals": {
    "total": "1250.0",
    "paid": "0.0",
    "balance": "1250.0"
  }
}

İstek · deneme, tüm alanlar

curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/imports/supplier_bills/validate' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "source_system": "crm",
  "rows": [
    {
      "external_id": "SUPPLIER-BILL-1001",
      "number": "TR-2025-000431",
      "received_at": "2026-03-14",
      "due_on": "2026-03-18",
      "total_amount": "1250.00",
      "amount_paid": "1250.00",
      "paid_on": "2026-03-14",
      "currency": "EUR",
      "supplier_external_id": "SUPPLIER-1001",
      "notes": "Imported from the source system."
    }
  ]
}'
Yanıt
200
{
  "import": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "entity": "supplier_bills",
    "source_system": "crm",
    "status": "ready",
    "company_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "stats": {
      "total": 1,
      "will_create": 1,
      "will_update": 0,
      "created": 0,
      "updated": 0,
      "skipped": 0,
      "invalid": 0,
      "failed": 0,
      "not_selected": 0
    },
    "error": null,
    "created_at": "2026-03-14T09:30:00Z",
    "links": {
      "self": "/api/v1/imports/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "rows": "/api/v1/imports/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18/rows"
    },
    "mode": "validate",
    "async": false,
    "on_conflict": "skip",
    "pricing": "apply_rules"
  },
  "ignored_fields": [],
  "results": [
    {
      "row": 1,
      "external_id": "SUPPLIER-BILL-1001",
      "status": "will_create"
    }
  ]
}

Akış

  1. Deneyin. POST …/validate aynı yolu koşar ve hiçbir şey yazmaz.
  2. Gönderin. Aynı gövde, /validate olmadan. Bozuk satır tek başına düşer ve alanını söyler.
  3. Geri okuyun. GET /api/v1/imports/{entity}/records/{external_id} kendi kimliğinizle cevap verir.
  4. Dinleyin. Acente kaydı değiştirdiğinde webhook haber verir.

Kurallar →Webhook'lar →