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

# Uyum durum sorgusu (kayıt + sicil + doğrulama)

> idNo veya ad soyad ile tek çağrıda uyum durumu döner: müşteri kaydı varsa dar kayıt + recordLevel + sicil olayları; yoksa exists=false. Ayrıca son MASAK sorgusu ve müşteri tanı formu durumu (onaylı/bekleyen) bilgisi döner. Bilinmeyen parametre yoktur; idNo veya nameSurname'den en az biri zorunludur.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/customers/check
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/check:
    get:
      tags:
        - Customers
      summary: Uyum durum sorgusu (kayıt + sicil + doğrulama)
      description: >-
        idNo veya ad soyad ile tek çağrıda uyum durumu döner: müşteri kaydı
        varsa dar kayıt + recordLevel + sicil olayları; yoksa exists=false.
        Ayrıca son MASAK sorgusu ve müşteri tanı formu durumu (onaylı/bekleyen)
        bilgisi döner. Bilinmeyen parametre yoktur; idNo veya nameSurname'den en
        az biri zorunludur.
      operationId: getComplianceCheck
      parameters:
        - name: idNo
          in: query
          required: false
          description: >-
            TCKN/VKN/pasaport veya belge numarası (nameSurname ile birlikte en
            az biri zorunlu).
          schema:
            type: string
        - name: nameSurname
          in: query
          required: false
          description: Ad soyad / ünvan (büyük-küçük harf duyarsız arama).
          schema:
            type: string
      responses:
        '200':
          description: Uyum durumu.
          headers:
            x-request-id:
              schema:
                type: string
                format: uuid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComplianceCheckResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ComplianceCheckResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/ComplianceCheckResult'
        meta:
          $ref: '#/components/schemas/MetaBase'
      required:
        - success
        - data
        - meta
    ComplianceCheckResult:
      type: object
      properties:
        exists:
          type: boolean
          description: Müşteri kaydı var mı.
        customer:
          $ref: '#/components/schemas/ComplianceCheckCustomer'
        recordLevel:
          type: integer
          nullable: true
          description: Müşterinin sicil seviyesi (yoksa null).
        events:
          type: array
          items:
            $ref: '#/components/schemas/ComplianceCheckEvent'
          description: Sicil olayları (en yeni önce, en fazla 25).
        masak:
          $ref: '#/components/schemas/ComplianceCheckMasak'
        verification:
          $ref: '#/components/schemas/ComplianceCheckVerification'
      required:
        - exists
        - customer
        - recordLevel
        - events
        - masak
        - verification
    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
    ComplianceCheckCustomer:
      type: object
      nullable: true
      properties:
        id:
          type: string
        idNo:
          type: string
        idType:
          type: string
          nullable: true
        idCardType:
          type: string
          nullable: true
        nameSurname:
          type: string
        recordLevel:
          type: integer
          nullable: true
        isVerify:
          type: boolean
          nullable: true
        isValid:
          type: boolean
          nullable: true
        createdDate:
          type: string
          format: date-time
          nullable: true
        lastDate:
          type: string
          format: date-time
          nullable: true
    ComplianceCheckEvent:
      type: object
      properties:
        id:
          type: string
        eventDate:
          type: string
          format: date-time
        recordLevel:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
          description: 0 kayıt yok, 1 normal, 2 güvenli, 3 riskli, 4 yasaklı.
        comment:
          type: string
          nullable: true
    ComplianceCheckMasak:
      type: object
      nullable: true
      description: idNo bazlı son MASAK sorgusu (hiç yoksa null).
      properties:
        lastQueriedAt:
          type: string
          format: date-time
        types:
          type: array
          items:
            type: string
        isError:
          type: boolean
    ComplianceCheckVerification:
      type: object
      nullable: true
      description: Müşteri tanı formu durumu (idNo varsa her zaman döner).
      properties:
        latestId:
          type: string
          nullable: true
          description: Son form kaydı kimliği.
        isApproval:
          type: boolean
          description: Son form onaylı mı.
        isSigned:
          type: boolean
        lastFormAt:
          type: string
          format: date-time
          nullable: true
        hasPendingForm:
          type: boolean
          description: Onay bekleyen form var mı.
    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'
    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)

````