Skip to content

Customer Servisi API Dökümantasyonu (v3)

Müşterilerin (client'a bağlı müşteri kayıtları) yönetimi bu servis üzerinden yapılır. Müşteri oluşturma, güncelleme, silme ve müşteriye bağlı alt kaynaklar (faturalar, cari hareketler, adresler, tahsilatlar) bu uç noktalar üzerinden yönetilir.

Base URL: /v3/clients/:client_id/customers


Enum Referansları

Role (role_type)

individual, corporate

Company Type (company_type)

person, limited, anonymous

Address Type (address_type)

individual, invoice

Movement Type (movement_type)

DeğerAçıklama
debtBorç
collectionTahsilat
receiveAlacak

Movement Action (movement_action)

DeğerAçıklama
create-orderSipariş oluşturma
deliver-orderSipariş teslim
cancel-orderSipariş iptal
allowance-paymentÖdenek ödemesi
collection-branch-debtŞube borç tahsilatı
center-paymentMerkez ödemesi

Collection Type (collection_type)

transfer, card, cash


1. Create Customer (Müşteri Oluştur)

  • URL: POST /
  • Auth: ClientSecret + User
  • Request Body:
    json
    {
      "firstname": "Ali",
      "lastname": "Yılmaz",
      "fullname": "Ali Yılmaz",
      "identity": "12345678901",
      "phone": "5551234567",
      "email": "ali@email.com",
      "role_type": "individual | corporate",
      "auto_invoice": false,
      "company": {
        "title_legal": "ABC Ltd. Şti.",
        "title_brand": "ABC (zorunlu)",
        "tax_no": "1234567890 (zorunlu)",
        "tax_office": "Beyoğlu VD",
        "company_type": "person | limited | anonymous",
        "address": {
          "latitude": 41.0082,
          "longitude": 28.9784,
          "tag": "Merkez",
          "description": "Açıklama",
          "note": "Not",
          "country_id": 1,
          "city_id": 34,
          "district_id": 100,
          "quarter_id": 500,
          "apartment": "A Blok",
          "floor": "3",
          "flat": "12",
          "zip_code": "34000",
          "full_address": "Tam adres",
          "address_type": "individual | invoice (zorunlu)"
        }
      },
      "sales_manager_id": "uuid (opsiyonel)",
      "has_term": false,
      "has_user": false
    }
  • Response: success: true, data: { client_customer_id: "uuid", ... }

2. List Customers (Müşterileri Listele)

  • URL: GET /
  • Auth: ClientSecret + User
  • Query Params:
    • page[index]: Sayfa indexi (default: 0)
    • page[size]: Sayfa boyutu (default: 20)
    • search: Arama metni
    • sort[id], sort[type]: Sıralama

3. Customer Details (Müşteri Detayı)

  • URL: GET /:client_customer_id
  • Auth: ClientSecret + User

4. Update Customer (Müşteri Güncelle)

  • URL: PUT /:client_customer_id
  • Auth: ClientSecret + User
  • Request Body: (tüm alanlar opsiyonel)
    json
    {
      "firstname": "Ali",
      "lastname": "Yılmaz",
      "fullname": "Ali Yılmaz",
      "identity": "12345678901",
      "phone": "5551234567",
      "email": "ali@email.com",
      "role_type": "individual | corporate",
      "auto_invoice": true,
      "company": {
        "title_legal": "ABC Ltd. Şti.",
        "title_brand": "ABC",
        "tax_no": "1234567890",
        "tax_office": "Beyoğlu VD",
        "address": "Şirket adresi",
        "company_type": "person | limited | anonymous"
      },
      "sales_manager_id": "uuid",
      "has_term": true
    }

5. Delete Customer (Müşteri Sil)

  • URL: DELETE /:client_customer_id
  • Auth: ClientSecret + User

6. Export Customers (Müşterileri Dışa Aktar)

Tüm müşterileri dışa aktarır.

  • URL: GET /all/export
  • Auth: ClientSecret + User
  • Query Params: List ile aynı sayfalama ve sıralama parametreleri.

7. Export Customer Summary (Müşteri Özet Raporu)

Belirli bir müşterinin özet raporunu dışa aktarır.

  • URL: GET /:client_customer_id/export-sum
  • Auth: ClientSecret + User
  • Query Params:
    • page[index], page[size]: Sayfalama
    • search: Arama
    • filter[min_date], filter[max_date]: Tarih aralığı
    • sort[id], sort[type]


Alt Kaynaklar (Sub-Resources)

Aşağıdaki tüm alt kaynaklar /v3/clients/:client_id/customers/:client_customer_id/ altında yer alır ve ClientSecret + User yetkisi gerektirir.


8. Invoices (Faturalar)

Müşteriye ait fatura kayıtlarının yönetimi.

Base URL: .../:client_customer_id/invoices

8.1 Create Invoice

  • URL: POST /
  • Request Body:
    json
    {
      "issue_date": "2024-01-15",
      "title": "Fatura başlığı",
      "description": "Açıklama",
      "note": "Not",
      "due_date": "2024-02-15",
      "invoice_series": "FTR",
      "invoice_sequence": "001",
      "orders": ["order-uuid-1", "order-uuid-2"],
      "outsource_invoice_id": "dış fatura ID (opsiyonel)"
    }

    orders alanı zorunludur — faturaya dahil edilecek sipariş UUID'leri.

8.2 List Invoices

  • URL: GET /
  • Query Params:
    • page[index], page[size], search
    • filter[customer_id], filter[branch_id]: UUID filtreleri
    • filter[collection_status]: Tahsilat durumu
    • filter[payment_type]: Ödeme tipi
    • filter[min_date], filter[max_date]: Tarih aralığı
    • filter[make_group]: Gruplama (boolean, default: false)
    • deep_search[platform_invoice_id]: Platform fatura ID arama
    • deep_search[customer]: Müşteri derin arama
    • sort[id], sort[type]

8.3 List Invoices Grouped

Faturaları müşteri bazında gruplanmış olarak döner.

  • URL: GET /grouped
  • Query Params:
    • page[index], page[size], search
    • filter[customer_id], filter[branch_id]
    • filter[collection_status]
    • filter[min_date], filter[max_date]
    • sort[id], sort[type]

8.4 Export Invoices

  • URL: GET /export

8.5 Invoice Details

  • URL: GET /:client_customer_invoice_id

8.6 Update Invoice

  • URL: PUT /:client_customer_invoice_id
  • Request Body: (tüm alanlar opsiyonel)
    • issue_date, title, description, note, due_date, invoice_series, invoice_sequence

8.7 Delete Invoice

  • URL: DELETE /:client_customer_invoice_id

8.8 Invoice Orders (Faturadaki Siparişler)

  • URL: GET /:client_customer_invoice_id/orders
  • Query Params: page[index], page[size], search, sort[id], sort[type]

8.9 Approve Invoice (Fatura Onayla)

  • URL: GET /:client_customer_invoice_id/approve

8.10 Print Invoice (Fatura Yazdır)

  • URL: GET /:client_customer_invoice_id/print

9. Movements (Cari Hareketler)

Müşteriye ait borç, alacak ve tahsilat kayıtlarının yönetimi.

Base URL: .../:client_customer_id/movements

9.1 Create Movement

  • URL: POST /
  • Idempotency: IdempotencyKey gerekli
  • Request Body:
    json
    {
      "movement_type": "debt | collection | receive (zorunlu)",
      "amount": 1500.50,
      "description": "Manuel borç kaydı",
      "order_id": "uuid (opsiyonel)",
      "movement_action": "create-order | deliver-order | cancel-order | allowance-payment | collection-branch-debt | center-payment",
      "is_paid": false,
      "cashbox_id": "uuid (opsiyonel)"
    }

9.2 List Movements

  • URL: GET /
  • Query Params:
    • page[index], page[size], search
    • filter[movement_type]: debt / collection / receive
    • filter[movement_action]: Hareket aksiyonu filtresi
    • filter[order_id]: Sipariş filtresi
    • filter[created_by]: Oluşturan kullanıcı filtresi
    • filter[min_date], filter[max_date]: Tarih aralığı
    • filter[merge_customers]: Müşterileri birleştir (boolean)
    • sort[id], sort[type]

9.3 Movement Details

  • URL: GET /:client_customer_movement_id

9.4 Update Movement

  • URL: PUT /:client_customer_movement_id
  • Request Body: (tüm alanlar opsiyonel)
    • movement_type, amount, description, order_id, movement_action, is_paid

9.5 Delete Movement

  • URL: DELETE /:client_customer_movement_id

9.6 Export Movements

  • URL: GET /all/export
  • Query Params: List ile aynı filtre parametreleri.

10. Addresses (Adresler)

Müşteriye ait adres kayıtlarının yönetimi.

Base URL: .../:client_customer_id/addresses

10.1 Create Address

  • URL: POST /
  • Request Body:
    json
    {
      "latitude": 41.0082,
      "longitude": 28.9784,
      "tag": "Ev",
      "description": "Açıklama",
      "note": "Not",
      "country_id": 1,
      "city_id": 34,
      "district_id": 100,
      "quarter_id": 500,
      "apartment": "A Blok",
      "floor": "3",
      "flat": "12",
      "zip_code": "34000",
      "full_address": "Tam adres metni",
      "address_type": "individual | invoice (zorunlu)"
    }

10.2 List Addresses

  • URL: GET /
  • Query Params:
    • page[index], page[size], search
    • filter[address_type]: individual / invoice (tekli veya dizi)
    • sort[id], sort[type]

10.3 Address Details

  • URL: GET /:client_customer_address_id

10.4 Update Address

  • URL: PUT /:client_customer_address_id
  • Request Body: (tüm alanlar opsiyonel — Create ile aynı yapı)

10.5 Delete Address

  • URL: DELETE /:client_customer_address_id

11. Collections (Tahsilatlar)

Müşteriden yapılan tahsilat kayıtlarının yönetimi.

Base URL: .../:client_customer_id/collections

11.1 Create Collection

  • URL: POST /
  • Request Body:
    json
    {
      "amount": 5000,
      "collection_type": "transfer | card | cash (zorunlu)",
      "bank_account_id": "uuid (opsiyonel)"
    }

11.2 List Collections

  • URL: GET /
  • Query Params:
    • page[index], page[size], search
    • filter[customer_id]: Müşteri filtresi
    • filter[branch_id]: Şube filtresi
    • filter[bank_account_id]: Banka hesabı filtresi
    • sort[id], sort[type]

11.3 Collection Details

  • URL: GET /:client_customer_collection_id

berke@lojimod.com