Skip to content

Branch Servisi API Dökümantasyonu (v3)

Şubelerin yönetimi, listelenmesi ve detay bilgilerinin alınması bu servis üzerinden yapılır.

Base URL: /v3/clients/:client_id/branches


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_type)

individual, corporate

Address Type (address_type)

individual, invoice

Source Type (source_type)

insource, outsource, rented, contracted, individual

Company Type (company_type)

person, limited, anonymous

Movement Type (movement_type)

debt, collection, receive

Movement Action (movement_action)

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


1. List Branches (Şubeleri Listele)

  • URL: GET /
  • Query Params:
    • page[index]: Sayfa indexi (default: 0)
    • page[size]: Sayfa boyutu (default: 20)
    • search: Başlıkta arama metni
    • filter[city_id], filter[district_id], filter[quarter_id]: Lokasyon filtreleri
    • filter[interland]: Boolean, interland bazlı arama
  • Response:
    json
    {
      "success": true,
      "data": {
        "items": 100, // Toplam kayıt sayısı
        "page": 0,    // Mevcut sayfa
        "data": [
          { /* ClientBranch Interface */ }
        ]
      },
      "error": null
    }

2. Branch Details (Şube Detayı)

  • URL: GET /:client_branch_id
  • Response:
    json
    {
      "success": true,
      "data": { /* ClientBranch Interface */ },
      "error": null
    }

3. Create Branch (Şube Oluştur)

  • URL: POST /
  • Request Body:
    json
    {
      "title": "Şube Adı",
      "code": "SUBE001",
      "description": "...",
      "user": { /* User Interface */ },
      "address": { /* UserAddress Interface */ },
      "accept_cash": false,
      "commissions": [],
      "transfer_center_id": "uuid"
    }
  • Response:
    json
    {
      "success": true,
      "data": { /* ClientBranch Interface */ },
      "error": null
    }

4. Update Branch (Şube Güncelle)

  • URL: PUT /:client_branch_id
  • Request Body: (Tüm alanlar opsiyoneldir)
  • Response: data: null

5. Delete Branch (Şube Sil)

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

Branch Sub-Services

I. Interland (Hizmet Alanı)

Şubelerin hizmet verdiği şehir ve ilçelerin yönetimi.

Base URL: /v3/clients/:client_id/branches/:client_branch_id/interlands

  • List Interlands: GET /
  • Detailed List: GET /detailed (Şehir/İlçe isimleri ile birlikte)
  • Export Excel: GET /detailed-export
  • Create: POST /
    json
    {
      "title": "Hizmet Alanı 1",
      "values": [
        {
          "city_id": "34",
          "districts": ["123", "456"],
          "quarters": []
        }
      ]
    }
  • Update: PUT /:client_branch_interland_id
  • Delete: DELETE /:client_branch_interland_id

II. Statement (Ekstre / Hakediş)

Şubelerin belirli tarih aralıklarındaki hakedişlerinin hesaplanması ve takibi.

Base URL: /v3/clients/:client_id/branches/:client_branch_id/statements

  • List Statements: GET /
  • Details: GET /:client_branch_statement_id
  • Create (Calculate): POST /
    json
    {
      "min_date": "2024-01-01",
      "max_date": "2024-01-31"
    }
  • Update (Recalculate): PUT /:client_branch_statement_id
  • Delete: DELETE /:client_branch_statement_id

III. Movement (Cari Hareketler)

Şube kasa hareketleri, borç, alacak ve tahsilat kayıtları.

Base URL: /v3/clients/:client_id/branches/:client_branch_id/movements

  • List Movements: GET /
  • Export Excel: GET /export
  • Details: GET /:client_branch_movement_id
  • Create Manual Movement: POST /
    json
    {
      "movement_type": "debt", // debt, collection, receive
      "amount": 1500.50,
      "description": "Manuel borç kaydı",
      "movement_action": "collection_branch_debt",
      "cashbox_id": "uuid" // Opsiyonel kasa seçimi
    }
  • Update Status: PUT /:client_branch_movement_id (Örn: is_paid güncelleme)
  • Delete: DELETE /:client_branch_movement_id

berke@lojimod.com