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

# Banka hareketi detayı

> Tek banka hareketinin geniş kaydını döner. Cevabın masak bölümü, işlem göndericisinin idNo'suna ait en son MASAK/WANTED/PEP sorgu kaydını gömer; hiç sorgulanmadıysa status 0 ve lastQueriedAt null döner.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/bank-transactions/{id}
openapi: 3.0.3
info:
  title: Sarraf API v1
  version: 1.0.0
  description: >-
    Sarraf sürümlü dış API yüzeyi. Bu sürüm salt okunurdur; e-ticaret siteleri
    ve muhasebe programları için mevcut kayıtların okunmasını sağlar. Kimlik
    doğrulama mevcut dış API ile aynıdır: HTTP Basic,
    base64(apiUserId:secretKey). Tüm yanıtlar sabit zarf formatındadır: başarılı
    yanıtta success/data/meta, hatalı yanıtta
    success/error{code,message,details}/traceId. Her yanıtta x-request-id
    başlığı döner ve traceId ile aynıdır.
servers:
  - url: https://api.sarraf.pro
    description: Canlı ortam
security:
  - BasicAuth: []
tags:
  - name: Customers
    description: Cari hesaplar — listeleme, detay ve müşteri tanı formatında oluşturma
    x-group: Müşteriler
  - name: Bank accounts
    description: Banka hesapları, bakiyeler ve sorgu tetikleme
    x-group: Banka
  - name: Bank transactions
    description: Gelen/giden banka hareketleri — detayda gömülü MASAK özeti
    x-group: Banka
  - name: Invoices
    description: Sistem üzerinden kesilen faturalar ve kalem şablonları
    x-group: Faturalar
  - name: Expenses
    description: Gider pusulası kayıtları
    x-group: Giderler
  - name: Compliance
    description: >-
      Müşteri tanı formları, kimlik belgeleri, yaptırım sorguları, sicil,
      denetim ve IDV kayıtları
    x-group: Uyum (Compliance)
paths:
  /v1/bank-transactions/{id}:
    get:
      tags:
        - Bank transactions
      summary: Banka hareketi detayı
      description: >-
        Tek banka hareketinin geniş kaydını döner. Cevabın masak bölümü, işlem
        göndericisinin idNo'suna ait en son MASAK/WANTED/PEP sorgu kaydını
        gömer; hiç sorgulanmadıysa status 0 ve lastQueriedAt null döner.
      operationId: getBankTransaction
      parameters:
        - name: id
          in: path
          required: true
          description: Kayıt kimliği (ObjectId).
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
      responses:
        '200':
          description: Başarılı detay yanıtı.
          headers:
            x-request-id:
              description: İstek kimliği; yanıt gövdesindeki meta.requestId ile aynıdır.
              schema:
                type: string
                format: uuid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankTransactionDetailResponse'
        '400':
          description: Geçersiz id biçimi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Kimlik doğrulama başarısız.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Kayıt bulunamadı.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Beklenmeyen sunucu hatası.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BankTransactionDetailResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/BankTransactionDetail'
        meta:
          $ref: '#/components/schemas/MetaBase'
      required:
        - success
        - data
        - meta
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ErrorBody'
        traceId:
          type: string
          format: uuid
          description: x-request-id başlığı ile aynı değer.
      required:
        - success
        - error
        - traceId
    BankTransactionDetail:
      allOf:
        - $ref: '#/components/schemas/BankTransactionListItem'
        - type: object
          properties:
            comment:
              type: string
              nullable: true
              description: Sarraf notu.
            summaryInfo:
              type: object
              nullable: true
              description: Otomasyon için kısa özet bilgiler.
            expenseData:
              $ref: '#/components/schemas/ExpenseData'
            invoiceInfo:
              $ref: '#/components/schemas/InvoiceInfo'
            masak:
              $ref: '#/components/schemas/MasakInfo'
    MetaBase:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        timestamp:
          type: string
          format: date-time
      required:
        - requestId
        - timestamp
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          enum:
            - VALIDATION_FAILED
            - AUTH_INVALID_CREDENTIALS
            - AUTH_FORBIDDEN
            - RESOURCE_NOT_FOUND
            - CONFLICT
            - UPSTREAM_ERROR
            - INTERNAL_ERROR
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
      required:
        - code
        - message
        - details
    BankTransactionListItem:
      type: object
      properties:
        id:
          type: string
          description: Kayıt kimliği (ObjectId).
        stamp:
          type: string
          description: Benzersiz işlem damgası.
        incoming:
          type: boolean
          description: 'true: gelen hareket, false: giden hareket.'
        transactionDate:
          type: string
          format: date-time
        amount:
          type: number
          description: Hareket tutarı.
        currency:
          type: string
          example: TRY
        exchangeRate:
          type: number
          description: İşlem anındaki döviz kuru.
        balance:
          type: number
          description: İşlem sonrası bakiye.
        bankCode:
          type: string
          nullable: true
        code:
          type: string
          description: İşlem kodu (EFT vb.).
        idNo:
          type: string
          description: Gönderici TCKN/VKN.
        nameSurname:
          type: string
          description: Gönderici ad soyad / ünvan.
        iban:
          type: string
          nullable: true
          description: Karşı IBAN.
        description:
          type: string
          nullable: true
          description: Banka işlem açıklaması.
        status:
          type: integer
          enum:
            - 0
            - 1
            - 2
          description: 0 bekleyen, 1 işlem yapıldı, 2 yok sayıldı.
        masakStatus:
          type: integer
          enum:
            - 0
            - 1
            - 2
          description: 0 sorgulanmadı, 1 sorun yok, 2 sorunlu.
        fundsNature:
          type: string
          nullable: true
          description: İşlemin mahiyeti.
        isCheck:
          type: boolean
          description: Mahsuplaşma / gider pusulası durumu.
        invoiceNumber:
          type: string
          nullable: true
          description: Bağlı fatura numarası (varsa).
        createdDate:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ExpenseData:
      type: object
      properties:
        customerInfo:
          type: object
          nullable: true
        serial:
          type: string
          nullable: true
        attribute:
          type: string
          nullable: true
        taxId:
          type: string
          nullable: true
        number:
          type: string
          nullable: true
        quantity:
          type: number
          nullable: true
        price:
          type: number
          nullable: true
          description: Birim fiyatı / kur.
    InvoiceInfo:
      type: object
      properties:
        integrator:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        uuid:
          type: string
          nullable: true
        invoiceNumber:
          type: string
          nullable: true
        taxId:
          type: string
          nullable: true
        status:
          type: boolean
          nullable: true
    MasakInfo:
      type: object
      description: >-
        İşlem göndericisinin idNo'suna ait en son MASAK/WANTED/PEP sorgu
        kaydının özeti. Hiç sorgulanmadıysa status 0, lastQueriedAt null, types
        boş, data null döner.
      properties:
        status:
          type: integer
          enum:
            - 0
            - 1
            - 2
          description: 0 sorgulanmadı, 1 sorun yok, 2 sorunlu.
        lastQueriedAt:
          type: string
          format: date-time
          nullable: true
          description: En son sorgu zamanı.
        types:
          type: array
          items:
            type: string
          description: Sorgu türleri (masak, wanted, pep).
        isError:
          type: boolean
        data:
          type: object
          nullable: true
          description: Sorgu sonucu detayı (yaptırım listesi eşleşme içeriği).
      required:
        - status
        - lastQueriedAt
        - types
        - isError
        - data
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
        rule:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Kullanıcı adı apiUserId, parola secretKey. Authorization: Basic
        base64(apiUserId:secretKey)

````