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

# Kimlik/pasaport belge görseli yükleme

> Müşteri tanı (accord) akışı için kimlik veya pasaport görseli yükler. Görsel base64 olarak gövdede gelir; belge servisine yüklenir ve kayıt oluşur. Cevapta görsel içerik veya görsel referansı dönmez. verificationId verilirse kayıt o müşteri tanı formuyla ilişkilendirilir.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/customers/identity-documents
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 ve uyum — listeleme, detay, müşteri tanı oluşturma,
      kayıt/sicil sorgusu, tanı formları, kimlik belgeleri, yaptırım sorguları
      ve sicil geçmişi
    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
paths:
  /v1/customers/identity-documents:
    post:
      tags:
        - Customers
      summary: Kimlik/pasaport belge görseli yükleme
      description: >-
        Müşteri tanı (accord) akışı için kimlik veya pasaport görseli yükler.
        Görsel base64 olarak gövdede gelir; belge servisine yüklenir ve kayıt
        oluşur. Cevapta görsel içerik veya görsel referansı dönmez.
        verificationId verilirse kayıt o müşteri tanı formuyla ilişkilendirilir.
      operationId: createIdentityDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdentityDocumentCreateRequest'
      responses:
        '201':
          description: Belge yüklendi ve kayıt oluşturuldu.
          headers:
            x-request-id:
              schema:
                type: string
                format: uuid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityDocumentCreateResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          description: Belge yükleme servisi hatası.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    IdentityDocumentCreateRequest:
      type: object
      description: 'Yazma uçlarında gövde zarfı: data zorunludur.'
      properties:
        data:
          type: object
          properties:
            idNo:
              type: string
              description: Belge sahibi TCKN/VKN/pasaport no (zorunlu).
            type:
              type: string
              enum:
                - front
                - rear
              description: Belge yüzü (zorunlu).
            fileName:
              type: string
              description: Dosya adı (zorunlu).
            mimeType:
              type: string
              enum:
                - image/jpeg
                - image/png
            content:
              type: string
              description: Görsel içeriği, base64 (en fazla 8 MiB).
            verificationId:
              type: string
              description: İlişkilendirilecek müşteri tanı formu kimliği (opsiyonel).
          required:
            - idNo
            - type
            - fileName
            - mimeType
            - content
      required:
        - data
    IdentityDocumentCreateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/IdentityDocumentCreateResult'
        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
    IdentityDocumentCreateResult:
      type: object
      properties:
        id:
          type: string
          description: Oluşan belge kaydı kimliği.
        idNo:
          type: string
        type:
          type: string
        channel:
          type: string
        fileName:
          type: string
        mimeType:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - idNo
        - type
        - channel
        - fileName
        - mimeType
    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
    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)

````