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

# Yaptırım sorgusu tetikleme

> idNo ile MASAK yaptırım listesi sorgusu çalıştırır; nameSurname verilirse ek olarak wanted listesi (TR collation, ad bazlı) sorgulanır. Sonuç log kaydı olarak yazılır (GET /v1/compliance/sanction-checks ile geçmişte görünür) ve eşleşme içerikleriyle birlikte 201 döner.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/compliance/sanction-checks
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/compliance/sanction-checks:
    post:
      tags:
        - Compliance
      summary: Yaptırım sorgusu tetikleme
      description: >-
        idNo ile MASAK yaptırım listesi sorgusu çalıştırır; nameSurname
        verilirse ek olarak wanted listesi (TR collation, ad bazlı) sorgulanır.
        Sonuç log kaydı olarak yazılır (GET /v1/compliance/sanction-checks ile
        geçmişte görünür) ve eşleşme içerikleriyle birlikte 201 döner.
      operationId: createSanctionCheck
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SanctionCheckCreateRequest'
      responses:
        '201':
          description: Sorgu çalıştırıldı ve log kaydı oluşturuldu.
          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/SanctionCheckCreateResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    SanctionCheckCreateRequest:
      type: object
      description: >-
        Yazma uçlarında gövde zarfı: data zorunludur. idNo, fullName veya
        surname alanlarından en az biri zorunludur.
      properties:
        data:
          type: object
          properties:
            idNo:
              type: string
              description: Sorgulanacak TCKN/VKN/belge numarası.
            fullName:
              type: string
              description: Ad soyad (masak/wanted/pep ad bazlı sorgular).
            surname:
              type: string
              description: Soyad (wanted/pep daraltma).
            options:
              type: object
              properties:
                wantedQuery:
                  type: boolean
                  default: true
                  description: Wanted listesi sorgulansın mı.
                pepQuery:
                  type: boolean
                  default: true
                  description: PEP listesi sorgulansın mı.
      required:
        - data
    SanctionCheckCreateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/SanctionCheckCreateResult'
        meta:
          $ref: '#/components/schemas/MetaBase'
      required:
        - success
        - data
        - meta
    SanctionCheckCreateResult:
      type: object
      properties:
        id:
          type: string
          description: Oluşan sorgu kaydının kimliği.
        query:
          $ref: '#/components/schemas/SanctionCheckQuery'
        summary:
          $ref: '#/components/schemas/SanctionCheckSummary'
        matches:
          type: object
          properties:
            masak:
              type: array
              items:
                type: object
              description: MASAK listesi eşleşme içerikleri.
            wanted:
              type: array
              items:
                type: object
              description: Wanted listesi eşleşme içerikleri.
            pep:
              type: array
              items:
                type: object
              description: PEP listesi eşleşme içerikleri.
        checkedAt:
          type: string
          format: date-time
      required:
        - id
        - query
        - summary
        - matches
        - checkedAt
    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
    SanctionCheckQuery:
      type: object
      properties:
        idNo:
          type: string
          nullable: true
        fullName:
          type: string
          nullable: true
        surname:
          type: string
          nullable: true
        options:
          type: object
          properties:
            wantedQuery:
              type: boolean
            pepQuery:
              type: boolean
    SanctionCheckSummary:
      type: object
      properties:
        masakCount:
          type: integer
        wantedCount:
          type: integer
        pepCount:
          type: integer
        hasCustomer:
          type: boolean
        customerEventCount:
          type: integer
    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)

````