> ## Documentation Index
> Fetch the complete documentation index at: https://tahsil.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Provider alt hesaplarıyla banka bağlantılarını listele

> Firma header'ı verilmezse API credential'ın bağlı olduğu tek firma kapsamı kullanılır.



## OpenAPI

````yaml /openapi/openapi.yaml get /banks/accounts
openapi: 3.1.0
info:
  title: Tahsil API
  version: 1.0.0
  description: >-
    Tahsil banka bağlantıları, provider senkronizasyonu, değiştirilemez
    hareketler, zamanlamalar ve hareket otomasyonu için tenant-scoped public API
    sözleşmesi.
servers:
  - url: https://api.tahsil.dev
    description: Production
security:
  - apiKeyAuth: []
    apiSecretAuth: []
tags:
  - name: Sistem - Sağlık
    description: Servis canlılığı ve bağımlılık hazır olma kontrolleri.
  - name: Banka - Bağlantılar
    description: Banka bağlantısı, credential, setup, sync, health ve kullanım işlemleri.
  - name: Banka - Hareketler
    description: >-
      Provider senkronizasyonuyla oluşan değiştirilemez banka hareketleri ve CSV
      dışa aktarımı.
  - name: Banka - Otomasyon
    description: Hareket atamaları, kurallar, preview ve backfill çalışmaları.
  - name: Banka - Zamanlamalar
    description: Banka sorgularının zamanlama ve çalışma durumu yönetimi.
  - name: Banka - Analitik
    description: Tenant kapsamlı dashboard sorgu kataloğu ve analitik sonuçları.
  - name: Denetim - Connector Logları
    description: Maskelenmiş banka connector istek ve yanıt kayıtları.
paths:
  /banks/accounts:
    get:
      tags:
        - Banka - Bağlantılar
      summary: Provider alt hesaplarıyla banka bağlantılarını listele
      description: >-
        Firma header'ı verilmezse API credential'ın bağlı olduğu tek firma
        kapsamı kullanılır.
      operationId: getBanksAccounts
      parameters:
        - $ref: '#/components/parameters/XCompanyId'
        - $ref: '#/components/parameters/XCompanyIds'
        - name: page
          in: query
          description: Sayfa numarası.
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: pageSize
          in: query
          description: Sayfadaki kayıt sayısı; en fazla 250.
          schema:
            type: integer
            minimum: 1
            maximum: 250
      responses:
        '200':
          $ref: '#/components/responses/BankAccountListResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    XCompanyId:
      name: x-company-id
      in: header
      required: false
      schema:
        type: string
      description: >-
        Hedef firma kimliği. Müşteri banka endpointlerindeki yazma işlemleri
        için zorunludur.
    XCompanyIds:
      name: x-company-ids
      in: header
      required: false
      schema:
        type: string
      description: >-
        API credential tek firma kapsamlıdır; gönderilirse credential firmasıyla
        eşleşen tek kimlik içermelidir.
  responses:
    BankAccountListResponse:
      description: Sayfalanmış banka bağlantıları.
      content:
        application/json:
          schema:
            type: object
            required:
              - status
              - result
              - paginate
            properties:
              status:
                type: boolean
                const: true
              result:
                type: array
                items:
                  $ref: '#/components/schemas/BankAccount'
              paginate:
                $ref: '#/components/schemas/OffsetPagination'
            additionalProperties: false
    ErrorResponse:
      description: İstek başarısız oldu.
      content:
        application/json:
          schema:
            type: object
            required:
              - status
            properties:
              status:
                type: boolean
                const: false
              code:
                type: string
                description: >-
                  Kararlı hata kodu; kodlanmış domain ve güvenlik hatalarında
                  döner.
              message:
                type: string
                description: >-
                  İnsan tarafından okunabilir hata açıklaması; mevcutsa
                  entegrasyon kararı için kullanılmamalıdır.
              meta:
                type: object
                additionalProperties: true
              result:
                type: array
                deprecated: true
                description: Legacy Joi doğrulama hatalarında dönen alan listesi.
                items:
                  type: object
                  properties:
                    type:
                      type: string
                    joiType:
                      type: string
                    path:
                      type:
                        - string
                        - number
                    label:
                      type: string
                  additionalProperties: false
              description:
                type: string
            additionalProperties: false
          example:
            status: false
            code: TRANSACTION_AMOUNT_RANGE_INVALID
            message: minAmount, maxAmount değerinden büyük olamaz.
  schemas:
    BankAccount:
      type: object
      required:
        - id
        - companies
        - status
        - bankCode
        - environment
        - subAccounts
      properties:
        id:
          type: string
          description: MongoDB kaynak kimliği.
        companies:
          type: string
          description: Bağlantının ait olduğu firma kimliği.
        status:
          type: boolean
        bankCode:
          type: string
          example: akbank
        environment:
          type: string
          enum:
            - demo
            - production
        title:
          type:
            - string
            - 'null'
          example: Ana Akbank Bağlantısı
        lastProviderSetupAt:
          type:
            - string
            - 'null'
          format: date-time
        lastProviderSyncAt:
          type:
            - string
            - 'null'
          format: date-time
        syncHealth:
          $ref: '#/components/schemas/BankSyncHealth'
        subAccounts:
          type: array
          items:
            $ref: '#/components/schemas/BankSubAccount'
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
      additionalProperties: false
    OffsetPagination:
      type: object
      required:
        - total
        - size
        - page
        - totalPage
      properties:
        total:
          type: integer
          minimum: 0
        size:
          type: integer
          minimum: 1
          maximum: 250
        page:
          type: integer
          minimum: 1
        totalPage:
          type: integer
          minimum: 0
      additionalProperties: false
    BankSyncHealth:
      type: object
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - never
            - running
            - healthy
            - error
        lastAttemptAt:
          type:
            - string
            - 'null'
          format: date-time
        lastSuccessAt:
          type:
            - string
            - 'null'
          format: date-time
        lastErrorAt:
          type:
            - string
            - 'null'
          format: date-time
        lastErrorCode:
          type:
            - string
            - 'null'
        lastErrorMessage:
          type:
            - string
            - 'null'
        lastDurationMs:
          type:
            - integer
            - 'null'
          minimum: 0
        lastTriggerType:
          type:
            - string
            - 'null'
          enum:
            - manual
            - cron
            - retry
            - null
        lastResult:
          $ref: '#/components/schemas/BankSyncResultSummary'
      additionalProperties: false
    BankSubAccount:
      type: object
      required:
        - subAccountKey
        - bankCode
        - currency
        - balance
      properties:
        id:
          type: string
          description: MongoDB kaynak kimliği.
        subAccountKey:
          type: string
          readOnly: true
          description: Provider hesabından üretilen kararlı alt hesap kimliği.
        providerAccountId:
          type:
            - string
            - 'null'
        bankCode:
          type:
            - string
            - 'null'
        customerNo:
          type:
            - string
            - 'null'
        accountNo:
          type:
            - string
            - 'null'
        iban:
          type:
            - string
            - 'null'
        accountType:
          type:
            - string
            - 'null'
        accountName:
          type:
            - string
            - 'null'
        branchId: {}
        branchName:
          type:
            - string
            - 'null'
        currency:
          type: string
          example: TRY
        balance:
          type: number
        blockedBalance:
          type: number
        availableBalance:
          type: number
        openingDate:
          type:
            - string
            - 'null'
          format: date-time
        lastTransactionDate:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
      additionalProperties: false
    BankSyncResultSummary:
      type: object
      properties:
        fetched:
          type:
            - integer
            - 'null'
          minimum: 0
        inserted:
          type:
            - integer
            - 'null'
          minimum: 0
        duplicates:
          type:
            - integer
            - 'null'
          minimum: 0
      additionalProperties: false
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Tenant admin tarafından oluşturulan API anahtarının kimliği.
    apiSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret
      description: >-
        Yalnız oluşturma anında gösterilen API anahtarı secret değeri. x-api-key
        ile aynı istekte gönderilir.

````