Skip to content

Client Servisi API Dökümantasyonu (v3)

Sistemdeki client'ların (müşteri firmaların) yönetimi bu servis üzerinden yapılır. Bu uç noktalar genellikle SuperAdmin yetkisi gerektirir.

Base URL: /v3/clients


Enum Referansları

User Type (user_type)

DeğerAçıklama
super-adminSüper Yönetici
adminYönetici
subadminAlt Yönetici
driverSürücü
shipperGönderi Sahibi
branchŞube
customerMüşteri
franchiseFranchise
partnerPartner
fleetFilo
operationOperasyon
accountingMuhasebe
transfer-centerTransfer Merkezi
region-officerBölge Sorumlusu
branch-userŞube Kullanıcısı
centers-officerMerkezler Sorumlusu

User Status (user_status)

passive, active, pending, removed

Role (role)

individual, corporate

Client Module (module)

delivery, logistic, cargo

Company Type (company_type)

person, limited, anonymous

Address Type (address_type)

individual, invoice

Source Type (source_type)

insource, outsource, rented, contracted, individual

Vehicle Type (vehicle_type)

bicycle, walker, scooter, motorbike, car, centipede, truck, ten-wheeler, van, six-wheel, other

Vehicle Body (vehicle_body)

open, awning-roof, awning-curation, frigo, awning-stabil, steel

Vehicle Source (vehicle_source)

insource, outsource, rented, contracted, individual

Vehicle Status (vehicle_status)

active, idle, sold

Supplier Type (supplier_type)

warehouse, driver, truck-owner

Service Type (service_type)

insurance, duty, porterage, storage, forklift, big-box, medium-box, small-box, handling

Region (region)

marmara, aegean, black-sea, mediterranean, central-anatolia, eastern-anatolia, southeastern-anatolia

Currency (currency)

TRY

Payment Method (payment_method)

online, wallet, cash, card, transfer

Collection Type (collection_type)

transfer, card, cash

Dispatch Status (dispatch_status)

created, completed

Leg Status (leg_status)

created, started, completed

Leg Action (leg_action)

load-vehicle, unload-vehicle, start-leg, stop-leg

Line Type (line_type)

main, center, intermediate

Density Type (density_type)

per, per-variable, variable, pallet, pallet-variable

Form Status (form_status)

created, active, cancelled, completed

Form Action (form_action)

add-load, deliver-load, not-delivered-load

Movement Type (movement_type)

debt, collection, receive

Movement Action (movement_action)

create-order, deliver-order, cancel-order, allowance-payment, collection-branch-debt, center-payment

Permission Setting (permission_setting)

create, read, update, delete

Allowance Type (allowance_type)

picking, barcode, delivery

Apply Status (apply_status)

created, rejected, resent, pre-approved, approved, cancelled, valid

Apply Doc Type (apply_doc_type)

carrying-bag, vehicle, criminal-record, id-front, id-back, bank, tax, driver-licence, vehicle-licence, residence


1. List Clients (Client'ları Listele)

  • URL: GET /
  • Query Params:
    • page[index]: Sayfa indexi
    • page[size]: Sayfa boyutu
    • search: Arama metni
    • filter[custom_link]: Özel link filtresi
  • Response:
    json
    {
      "success": true,
      "data": {
        "items": 10,
        "page": 0,
        "data": [
          { /* Client Interface */ }
        ]
      },
      "error": null
    }

2. Client Details (Client Detayı)

Client bilgilerini ve bağlı olduğu şirket (company) bilgilerini döner.

  • URL: GET /:client_id
  • Response:
    json
    {
      "success": true,
      "data": {
        /* Client Interface alanları + company bilgisi */
      },
      "error": null
    }

3. Create Client (Yeni Client Oluştur)

Yeni bir client ve bu client için bir Admin kullanıcı oluşturur. Sadece SuperAdmin yetkisi ile erişilebilir.

  • URL: POST /
  • Request Body:
    json
    {
      "firstname": "Admin Adı",
      "lastname": "Admin Soyadı",
      "email": "admin@firma.com",
      "password": "...",
      "phone": "...",
      "company": {
        "title_legal": "Firma Resmi Adı",
        "title_brand": "Marka Adı",
        "tax_no": "...",
        "tax_office": "...",
        "address": "..."
      },
      "conditions": {
        "order": {
          "module_type": "delivery"
        }
      }
    }
  • Response: success: true

4. Update Client (Client Güncelle)

Client ayarlarını ve koşullarını günceller. Sadece SuperAdmin yetkisi ile erişilebilir.

  • URL: PUT /:client_id
  • Request Body: (Opsiyonel alanlar, company güncellemesi bu uç noktadan yapılamaz)
  • Response: success: true

5. Delete Client (Client Sil)

Client'ı sistemden siler. Sadece SuperAdmin yetkisi ile erişilebilir.

  • URL: DELETE /:client_id
  • Response: success: true

Alt Servisler (Sub-Services)

Bu uç noktalar belirli bir client (:client_id) bağlamında çalışır.

6. Transfer Centers (Transfer Merkezleri)

Client'a ait transfer merkezlerinin yönetimi.

  • Base URL: /v3/clients/:client_id/transfer-centers

6.1 Create Transfer Center

  • URL: POST /
  • Request Body:
    json
    {
      "title": "Merkez Adı",
      "code": "TR-001",
      "description": "Açıklama",
      "user": {
        "firstname": "Ad",
        "lastname": "Soyad",
        "fullname": "Ad Soyad",
        "email": "email@example.com",
        "phone": "5554443322",
        "country_code": "+90",
        "password": "...",
        "user_type": "branch",
        "role_type": "individual",
        "company": {
          "title_legal": "...",
          "title_brand": "..."
        }
      },
      "address": {
        "latitude": 41.0082,
        "longitude": 28.9784,
        "country_id": 1,
        "city_id": 34,
        "district_id": 1,
        "full_address": "...",
        "address_type": "branch"
      },
      "amount_per_load": 1500.50
    }
  • Response:
    json
    {
      "success": true,
      "data": {
        "client_transfer_center_id": "uuid",
        "client_id": "uuid",
        "title": "Merkez Adı",
        "code": "TR-001",
        "user_id": "uuid",
        "created_at": "...",
        "updated_at": "..."
      },
      "error": null
    }

6.2 List Transfer Centers

  • URL: GET /
  • Query Params:
    • page[index]: 0
    • page[size]: 20
    • search: "Merkez"
  • Response:
    json
    {
      "success": true,
      "data": {
        "items": 1,
        "page": 0,
        "data": [
          {
            "client_transfer_center_id": "uuid",
            "title": "...",
            "user": { "fullname": "...", "phone": "..." },
            "address": { "city_name": "İstanbul", "full_address": "..." }
          }
        ]
      },
      "error": null
    }

6.3 Transfer Center Details

  • URL: GET /:transfer_center_id
  • Response: Aynı Create Response yapısı + detaylı user ve address objeleri.

7. Client Applies (Başvurular)

Sisteme yapılan (araçlı/araçsız) başvuruların yönetimi.

  • Base URL: /v3/clients/:client_id/applies

7.1 Create Apply

  • URL: POST /
  • Request Body:
    json
    {
      "firstname": "Ad",
      "lastname": "Soyad",
      "fullname": "Ad Soyad",
      "phone": "5551112233",
      "country_code": "+90",
      "email": "test@test.com",
      "vehicle_type": "motorcycle",
      "has_vehicle": true,
      "company": {
        "title_brand": "Marka",
        "tax_no": "1234567890"
      },
      "address": {
        "city_id": 34,
        "district_id": 1612,
        "full_address": "...",
        "address_type": "home"
      },
      "bank_account": {
        "iban": "TR00...",
        "bank_id": "uuid"
      },
      "docs": [
        { "doc_type": "id_card_front", "doc": "base64/url" }
      ]
    }
  • Response:
    json
    {
      "success": true,
      "data": { "client_apply_id": "uuid" },
      "error": null
    }

7.2 List Applies

  • URL: GET /
  • Response: items, page, data (başvuru listesi) içeren standart başarılı liste yapısı.

7.3 Approve Apply (Onayla)

Başvuruyu onaylar ve sistemde user, vehicle (varsa) ve supplier (varsa) kayıtlarını otomatik oluşturur.

  • URL: PUT /:client_apply_id/approve
  • Response: success: true

7.4 Reject Apply (Reddet)

  • URL: PUT /:client_apply_id/reject
  • Request Body: { "note": "Belgeler eksik" }
  • Response: success: true

8. Vehicles (Araçlar)

Client'a ait araç filosunun yönetimi.

  • Base URL: /v3/clients/:client_id/vehicles

8.1 Create Vehicle (Araç Ekle)

  • URL: POST /
  • Request Body:
    json
    {
      "plate": "34ABC123",
      "vehicle_type": "truck",
      "vehicle_status": "idle",
      "vehicle_body": "closed_box",
      "licence_no": "123456",
      "trailer_plate": "34DEF456",
      "density": "2500",
      "source_type": "individual",
      "supplier_id": "uuid",
      "users": ["user_id_1", "user_id_2"],
      "branch_id": "uuid",
      "transfer_center_id": "uuid"
    }
  • Response:
    json
    {
      "success": true,
      "data": {
        "client_vehicle_id": "uuid",
        "plate": "34ABC123",
        "vehicle_type": "truck",
        /* ...diğer alanlar */
      },
      "error": null
    }

8.2 List Vehicles

  • URL: GET /
  • Response: items, page, data (araç listesi) içeren standart başarılı liste yapısı.

8.3 Vehicle Details

  • URL: GET /:client_vehicle_id
  • Response: Detaylı araç bilgisi ve ilişkili supplier, branch bilgileri.

9. Suppliers (Tedarikçiler)

Client'ın çalıştığı tedarikçi firmaların yönetimi.

  • Base URL: /v3/clients/:client_id/suppliers

9.1 Create Supplier

  • URL: POST /
  • Request Body:
    json
    {
      "fullname": "Tedarikçi Adı",
      "phone": "5552221100",
      "email": "supplier@test.com",
      "supplier_type": "fleet",
      "company": {
        "title_legal": "Tedarikçi Lojistik A.Ş.",
        "tax_no": "...",
        "tax_office": "...",
        "address": "..."
      }
    }
  • Response:
    json
    {
      "success": true,
      "data": {
        "client_supplier_id": "uuid",
        "fullname": "...",
        "company": { ... }
      },
      "error": null
    }

9.2 List Suppliers

  • URL: GET /
  • Response: items, page, data (tedarikçi listesi) içeren standart başarılı liste yapısı.

10. Bank Accounts (Banka Hesapları)

Client'a ait banka hesapları ve bu hesaplar üzerindeki işlemler.

  • Base URL: /v3/clients/:client_id/bank-accounts

10.1 Create Bank Account

  • URL: POST /
  • Request Body:
    json
    {
      "number": "TR00...",
      "tag": "Ana Hesap",
      "description": "Şirket ana banka hesabı",
      "bank_id": "uuid",
      "holder": "Lojimod A.Ş.",
      "amount": 0,
      "bank_account_type": "current"
    }
  • Response:
    json
    {
      "success": true,
      "data": {
        "client_bank_account_id": "uuid",
        "number": "...",
        "amount": 0
      },
      "error": null
    }

10.2 List/Details

  • Standart başarılı liste ve detay yapıları.

10.3 Bank Account Transactions (Hesap Hareketleri)

  • URL: POST /:client_bank_account_id/transactions
  • Request Body:
    json
    {
      "amount": 1500,
      "transaction_type": "deposit",
      "description": "Havale/EFT",
      "dateTime": "2024-01-01 10:00:00"
    }
  • Response: success: true

11. Cashboxes (Kasalar)

Client'a ait nakit kasa yönetimi.

  • Base URL: /v3/clients/:client_id/cashboxes

11.1 Create Cashbox

  • URL: POST /
  • Request Body:
    json
    {
      "title": "Merkez Kasa",
      "description": "Nakit tahsilat kasası",
      "amount": 0,
      "currency": "TRY"
    }
  • Response:
    json
    {
      "success": true,
      "data": {
        "client_cashbox_id": "uuid",
        "title": "...",
        "amount": 0
      },
      "error": null
    }

11.2 Cashbox Transactions (Kasa Hareketleri)

  • URL: POST /:client_cashbox_id/transactions
  • Request Body: (Bank Account Transaction ile aynı yapı)
  • Response: success: true

12. Blacklist (Kara Liste)

Yasaklı güzergahların yönetimi.

  • Base URL: /v3/clients/:client_id/blacklist/routes

12.1 Create Blacklist Route

  • URL: POST /
  • Request Body:
    json
    {
      "title": "Marmara Yasaklı",
      "description": "...",
      "source_country_id": 1,
      "source_city_id": 34,
      "destination_country_id": 1,
      "destination_city_id": 41
    }

12.2 List/Details/Update/Delete

  • List: GET /
  • Details: GET /:client_blacklist_route_id
  • Update: PUT /:client_blacklist_route_id
  • Delete: DELETE /:client_blacklist_route_id

13. Services (Hizmetler)

Siparişlere eklenebilecek ek hizmetlerin (Hamaliye, Bekleme vs.) yönetimi.

  • Base URL: /v3/clients/:client_id/services

13.1 Create Service

  • URL: POST /
  • Request Body:
    json
    {
      "service_type": "porterage",
      "amount": 150.00
    }
  • Response: Standard success data object with client_service_id.

13.2 List/Details/Update/Delete

  • List/Details/Update/Delete: Standart CRUD uç noktalarını destekler.

14. Allowances (Ödenekler / Primler)

Sürücü veya şubelere verilen ödeneklerin yönetimi.

  • Base URL: /v3/clients/:client_id/allowances

14.1 Create Allowance

  • URL: POST /
  • Request Body:
    json
    {
      "allowance_type": "fuel",
      "base_amount": 1000.00,
      "alowance_amount": 200.00,
      "user_type": "driver",
      "branch_id": "uuid",
      "transfer_center_id": "uuid",
      "depends_on": {
        "order_id": "uuid"
      }
    }
  • Response: Standard success data object with client_allowance_id.

14.2 List/Details/Update/Delete

  • List/Details/Update/Delete: Standart CRUD uç noktalarını destekler.

15. Distances (Mesafe Tanımları)

Fiyatlandırma için kullanılan km bazlı mesafe aralıkları.

  • Base URL: /v3/clients/:client_id/distances

15.1 Create Distance

  • URL: POST /
  • Request Body:
    json
    {
      "title": "Kısa Mesafe",
      "description": "0-50 km arası",
      "min_km": 0,
      "max_km": 50
    }
  • Response: Standard success data object with client_distance_id.

15.2 List/Details/Update/Delete

  • List/Details/Update/Delete: Standart CRUD uç noktalarını destekler.

16. Pricing (Fiyatlandırma Modelleri)

Sistemdeki farklı fiyatlandırma katmanlarının yönetimi.

16.1 Vehicle Pricing (Araç Bazlı Fiyatlandırma)

Araç tiplerine göre taban ve km bazlı fiyat tanımları.

  • URL: POST /v3/clients/:client_id/pricing/vehicles
  • Request Body:
    json
    {
      "vehicle_type": "truck",
      "start_amount": 500,
      "km_amount": 15,
      "min_km": 0,
      "max_km": 1000,
      "max_weight": 5000,
      "is_active": true
    }

16.2 Factor Pricing (Katsayı Fiyatlandırması)

Desi aralıklarına göre çarpan katsayıları.

  • URL: POST /v3/clients/:client_id/pricing/factors
  • Request Body:
    json
    {
      "min_density": 0,
      "max_density": 100,
      "factor": 1.2
    }

16.3 Multiplier Pricing (Mesafe Çarpanları)

KM aralıklarına göre birim fiyat çarpanları.

  • URL: POST /v3/clients/:client_id/pricing/multipliers
  • Request Body:
    json
    {
      "min_km": 0,
      "max_km": 500,
      "amount": 2.5
    }

16.4 Region Pricing (Bölge Bazlı Fiyatlandırma)

Tanımlı bölgelere göre desi bazlı fiyat tarifeleri.

  • URL: POST /v3/clients/:client_id/pricing/regions
  • Request Body:
    json
    {
      "region": "Marmara",
      "min_density": 0,
      "max_density": 50,
      "density_amount": 75
    }

16.5 Province Pricing (İl/İlçe Bazlı Fiyatlandırma)

Şehir ve ilçe bazlı özel desi fiyatlandırmaları.

  • URL: POST /v3/clients/:client_id/pricing/provinces
  • Request Body:
    json
    {
      "country_id": 1,
      "city_id": 34,
      "district_id": 1612,
      "min_density": 0,
      "max_density": 20,
      "density_amount": 45
    }

16.6 Density Pricing (Genel Desi Fiyatlandırması)

Standart desi/hacim bazlı fiyat tarifeleri.

  • URL: POST /v3/clients/:client_id/pricing/densities
  • Request Body:
    json
    {
      "density_type": "weight",
      "min_density": 0,
      "max_density": 500,
      "amount": 5,
      "starting_amount": 50,
      "client_distance_id": "uuid"
    }

17. Client Groups (Müşteri Grupları)

Müşterileri gruplandırarak özel fiyatlandırma ve vade tanımları yapmayı sağlar.

  • Base URL: /v3/clients/:client_id/groups

17.1 Group CRUD

  • Create: POST / (Body: title, description, due_period, customers[])
  • List: GET /
  • Details: GET /:client_group_id
  • Update: PUT /:client_group_id
  • Delete: DELETE /:client_group_id

17.2 Group Customers

  • Add Customer: POST /:client_group_id/customers
    • Body: { "customer_id": "uuid" }
  • List Customers: GET /:client_group_id/customers
  • Delete Customer: DELETE /:client_group_id/customers/:customer_id

17.3 Group Pricing Densities

  • URL: /v3/clients/:client_id/groups/:client_group_id/pricing/densities
  • Standart CRUD uç noktalarını (GET, POST, PUT, DELETE) destekler.

18. Lines (Hatlar / Güzergahlar)

Transfer merkezleri ve şubeler arasındaki taşıma hatlarının tanımlanması.

  • Base URL: /v3/clients/:client_id/lines

18.1 Create Line

  • URL: POST /
  • Request Body:
    json
    {
      "title": "İstanbul - Ankara Hattı",
      "line_type": "intercity",
      "values": [
        { "index": 0, "transfer_center_id": "uuid_ist" },
        { "index": 1, "transfer_center_id": "uuid_ank" }
      ]
    }

18.2 List/Details/Update/Delete

  • List: GET / (Filtre: filter[line_type], Search: title)
  • Details: GET /:client_line_id
  • Update: PUT /:client_line_id
  • Delete: DELETE /:client_line_id

19. Forms (Kurye Teslim Formları)

Kuryelere atanan teslim formlarının yönetimi. Form oluşturulduğunda otomatik form numarası (KTF No) atanır.

  • Base URL: /v3/clients/:client_id/forms

19.1 Create Form

Yeni bir kurye teslim formu oluşturur.

  • URL: POST /
  • Request Body:
    json
    {
      "title": "Form Başlığı",
      "user_id": "uuid (opsiyonel, default: oturum açan kullanıcı)",
      "vehicle_id": "uuid (opsiyonel)",
      "start_time": "2024-01-01 08:00:00",
      "end_time": "2024-01-01 18:00:00",
      "allow_out_time_delivery": false
    }
  • Response:
    json
    {
      "success": true,
      "data": {
        "client_form_id": "uuid",
        "client_id": "uuid",
        "user_id": "uuid",
        "vehicle_id": "uuid",
        "title": "...",
        "start_time": "...",
        "end_time": "...",
        "allow_out_time_delivery": false,
        "status": "created",
        "created_by": "uuid",
        "created_at": "...",
        "updated_at": "..."
      },
      "error": null
    }

19.2 List Forms

  • URL: GET /
  • Query Params:
    • page[index]: Sayfa indexi (default: 0)
    • page[size]: Sayfa boyutu (default: 20)
    • search: Arama metni
    • filter[status]: Form durumu filtresi (created, active, cancelled, completed)
    • filter[user_id]: Kullanıcı filtresi
    • filter[transfer_center_id]: Transfer merkezi filtresi
    • filter[branch_id]: Şube filtresi
    • sort[id]: Sıralama alanı (ör: created_at)
    • sort[type]: Sıralama yönü (asc / desc)
  • Response:
    json
    {
      "success": true,
      "data": {
        "items": 10,
        "page": 0,
        "data": [
          {
            "client_form_id": "uuid",
            "title": "...",
            "status": "created",
            "relationships": {
              "user": { "user_id": "...", "firstname": "...", "lastname": "...", "fullname": "..." },
              "vehicle": { "client_vehicle_id": "...", "plate": "...", "vehicle_type": "..." }
            }
          }
        ]
      },
      "error": null
    }

19.3 Form Details

Form detayını, ilişkili kullanıcı/araç bilgileri ve sipariş istatistikleri ile döner.

  • URL: GET /:client_form_id
  • Response: Form alanları + relationships objesi içerir:
    • user: Kurye bilgileri (şube/transfer merkezi dahil)
    • vehicle: Araç bilgileri
    • delivered_order_count: Teslim edilen sipariş sayısı
    • total_order_count: Toplam sipariş sayısı
    • total_load_count: Toplam yük sayısı
    • total_order_amount: Toplam sipariş tutarı
    • total_order_amount_for_receive_payment: Alıcı ödemeli toplam tutar

19.4 Update Form

  • URL: PUT /:client_form_id
  • Request Body: (tüm alanlar opsiyonel)
    json
    {
      "title": "Yeni Başlık",
      "vehicle_id": "uuid",
      "status": "active",
      "start_time": "...",
      "end_time": "...",
      "allow_out_time_delivery": true
    }
  • Status Değerleri: created, active, cancelled, completed
  • Response: success: true

19.5 Delete Form

Sadece Admin yetkisi ile erişilebilir.

  • URL: DELETE /:client_form_id
  • Response: success: true

19.6 Print Form (Yazdır)

Forma ait siparişlerin yazdırılabilir HTML çıktısını döner. Yetki gerektirmez.

  • URL: GET /:client_form_id/print-form
  • Response: HTML formatında KTF (Kurye Teslim Formu) dokümanı. İçerir:
    • Kurye adı, KTF numarası, tarih
    • Sipariş listesi (takip no, gönderici/alıcı bilgileri, adres, parça sayısı, ödeme tipi, tutar)

19.7 Form Actions (Form Aksiyonları)

Forma yük ekleme, teslim etme ve sipariş yönetimi aksiyonları.

  • Base URL: /v3/clients/:client_id/forms/:client_form_id

19.7.1 Add Load (Yük Ekle)

Forma barkod/load_no ile yük ekler.

  • URL: POST /add-load
  • Request Body:
    json
    {
      "load_no": "LOAD-001"
    }
  • Response: success: true

19.7.2 Deliver Load (Tek Yük Teslim Et)

Formdaki bir yükü teslim edildi olarak işaretler.

  • URL: POST /deliver-load
  • Request Body:
    json
    {
      "load_no": "LOAD-001"
    }
  • Response: success: true

19.7.3 Deliver Loads (Toplu Yük Teslim Et)

Birden fazla yükü aynı anda teslim edildi olarak işaretler.

  • URL: POST /deliver-loads
  • Request Body:
    json
    {
      "loads": ["LOAD-001", "LOAD-002", "LOAD-003"]
    }
  • Response: success: true

19.7.4 List Loads (Yükleri Listele)

Forma ait yük kayıtlarını listeler.

  • URL: GET /loads
  • Query Params:
    • page[index], page[size]: Sayfalama
    • filter[action_type]: Aksiyon tipi filtresi (add-load, deliver-load, not-delivered-load)
    • sort[id], sort[type]: Sıralama
  • Response: items, page, data içeren standart liste yapısı.

19.7.5 List Orders (Siparişleri Listele)

Forma ait siparişleri (yükler üzerinden ilişkili) listeler.

  • URL: GET /orders
  • Query Params: Loads ile aynı query parametrelerini destekler.
  • Response: items, page, data içeren standart liste yapısı.

19.7.6 Delete Load (Yük Sil)

Formdan belirli bir yükü kaldırır.

  • URL: DELETE /loads/:order_load_id
  • Response: success: true

19.7.7 Add Orders (Siparişleri Ekle)

Sipariş ID'leri ile toplu olarak siparişlerin tüm yüklerini forma ekler.

  • URL: POST /add-orders
  • Request Body:
    json
    {
      "order_ids": ["uuid-1", "uuid-2"]
    }
  • Response: success: true

19.7.8 Remove Orders (Siparişleri Kaldır)

Sipariş ID'leri ile toplu olarak siparişleri formdan kaldırır.

  • URL: POST /remove-orders
  • Request Body:
    json
    {
      "order_ids": ["uuid-1", "uuid-2"]
    }
  • Response: success: true

20. Permissions (Yetki Şablonları)

Kullanıcı tiplerine göre modül bazlı yetki tanımları.

  • Base URL: /v3/clients/:client_id/permissions

19.1 Create Permission

  • URL: POST /
  • Request Body:
    json
    {
      "user_type": "branch",
      "permissions": {
        "orders": { "list": true, "create": true, "update": false },
        "customers": { "list": true, "details": true },
        "finance": { "view": false }
      }
    }

19.2 List Permissions

  • URL: GET /
  • Filter: filter[user_type]=branch

19.3 Update/Delete/Details

  • Details: GET /:client_permission_id
  • Update: PUT /:client_permission_id
  • Delete: DELETE /:client_permission_id
  • Standart CRUD parametrelerini kullanır.

21. Integrations (Entegrasyonlar)

Üçüncü taraf platformlar ile bağlantılar.

  • Base URL: /v3/clients/:client_id/integrations

21.1 Create Integration

  • URL: POST /
  • Request Body:
    json
    {
      "platform_type": "ikas",
      "api_key": "...",
      "secret_key": "...",
      "username": "...",
      "password": "...",
      "platform_client_id": "..."
    }

21.2 List/Details/Update/Delete

  • List: GET / (Filtre: filter[platform_type])
  • Details: GET /:integration_id
  • Update: PUT /:integration_id
  • Delete: DELETE /:integration_id

Bağımsız Servisler (Independent Services)

Bu servisler Client servisi tarafından yönetilse de kendi ana rotalarına sahiptirler.

22. Coupons (Kuponlar / İndirim Kodları)

  • Base URL: /v3/coupons

22.1 Create Coupon

  • URL: POST /
  • Request Body:
    json
    {
      "coupon_code": "LOJI2024",
      "expire_date": "2024-12-31",
      "discount_type": "percentage",
      "discount_amount": 15,
      "quantity": 100,
      "limit_per_user": 1,
      "conditions": {
        "min_order_amount": 500,
        "min_km": 10,
        "vehicle_types": ["motorcycle", "van"]
      }
    }
  • Response: Standard success data object with coupon_id.

22.2 List/Details/Update/Delete

  • List/Details/Update/Delete: Standart CRUD uç noktalarını destekler.

23. Campaigns (Kampanyalar)

Sistemdeki duyuru ve promosyon içerikli kampanyaların yönetimi.

  • Base URL: /v3/campaigns

23.1 Create Campaign

  • URL: POST /
  • Request Body:
    json
    {
      "start_date": "2024-01-01",
      "end_date": "2024-01-31",
      "title": "Yeni Yıl Fırsatı",
      "content": "Ocak ayı boyunca tüm gönderilerde %10 indirim!",
      "campaign_type": "promotion",
      "href": "https://..."
    }
  • Response: Standard success data object with campaign_id.

23.2 List/Details/Update/Delete

  • List/Details/Update/Delete: Standart CRUD uç noktalarını destekler.

berke@lojimod.com