> ## 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.

# Gider pusulası detayı

> Tek gider kaydının geniş halini döner: kalem satırları (lines), müşteri bilgisi (customerInfo) ve takas fatura numaraları (invoiceNo) dahil.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/expenses/{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/expenses/{id}:
    get:
      tags:
        - Expenses
      summary: Gider pusulası detayı
      description: >-
        Tek gider kaydının geniş halini döner: kalem satırları (lines), müşteri
        bilgisi (customerInfo) ve takas fatura numaraları (invoiceNo) dahil.
      operationId: getExpense
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
      responses:
        '200':
          description: Başarılı detay yanıtı.
          headers:
            x-request-id:
              schema:
                type: string
                format: uuid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseDetailResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ExpenseDetailResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/ExpenseDetail'
        meta:
          $ref: '#/components/schemas/MetaBase'
      required:
        - success
        - data
        - meta
    ExpenseDetail:
      allOf:
        - $ref: '#/components/schemas/ExpenseListItem'
        - type: object
          properties:
            description:
              type: string
              nullable: true
            address:
              type: string
              nullable: true
            customerInfo:
              type: object
              nullable: true
            variables:
              type: object
              nullable: true
            invoiceNo:
              type: array
              items:
                type: string
              description: Takas ise fatura numaraları.
            isSwap:
              type: boolean
            vSchema:
              type: string
              nullable: true
            currentCode:
              type: string
              nullable: true
            bankTransactionId:
              type: string
              nullable: true
              description: İlgili banka hareketi kimliği (GET /v1/bank-transactions/{id}).
            lines:
              type: array
              items:
                $ref: '#/components/schemas/ExpenseLine'
    MetaBase:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        timestamp:
          type: string
          format: date-time
      required:
        - requestId
        - timestamp
    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
    ExpenseListItem:
      type: object
      properties:
        id:
          type: string
          description: Kayıt kimliği (ObjectId).
        stamp:
          type: string
          nullable: true
          description: Benzersiz kayıt damgası.
        serial:
          type: string
          nullable: true
          description: Belge seri.
        number:
          type: string
          nullable: true
          description: Belge numarası.
        transactionDate:
          type: string
          format: date-time
        amount:
          type: number
          description: Toplam tutar.
        exchanges:
          type: number
          description: Hesaplanan kur.
        quantity:
          type: number
        unitName:
          type: string
          nullable: true
        attribute:
          type: string
          nullable: true
          description: Mahiyet adı.
        idNo:
          type: string
          nullable: true
          description: Müşteri TCKN/VKN.
        nameSurname:
          type: string
          nullable: true
        bankName:
          type: string
          nullable: true
        bankCode:
          type: string
          nullable: true
        isCheck:
          type: boolean
          description: Mahsup/pusula durumu.
        isExcel:
          type: boolean
        printStamp:
          type: string
          nullable: true
          description: Resmileşme damgası (varsa).
        printDate:
          type: string
          format: date-time
          nullable: true
        createdDate:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ExpenseLine:
      type: object
      properties:
        quantity:
          type: number
        attribute:
          type: string
          nullable: true
          description: Mahiyet/kalem adı.
        unitName:
          type: string
          nullable: true
        price:
          type: number
          description: Birim fiyat/kur.
        amount:
          type: number
          description: Toplam tutar.
        description:
          type: string
          nullable: true
        stockCode:
          type: string
          nullable: true
        stamp:
          type: string
          nullable: true
        bankCode:
          type: string
          nullable: true
    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
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
        rule:
          type: string
  responses:
    ValidationFailed:
      description: Doğrulama hatası (geçersiz parametre).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Kimlik doğrulama başarısız.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Kayıt bulunamadı.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Beklenmeyen sunucu hatası.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Kullanıcı adı apiUserId, parola secretKey. Authorization: Basic
        base64(apiUserId:secretKey)

````