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

# KMTS etiketi veya işareti sorgulama

> Etiket/işaret numarasını KMTS servisinde sorgular ve sonucu şirket geçmişine kaydeder. Otomatik tekrar yapılmaz. Aktör başına dakikada 10, şirket toplamında dakikada 60 sorgu sınırı vardır.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/kmts-verifications
openapi: 3.0.3
info:
  title: SarrafPro API v1
  version: 1.0.0
  description: >-
    SarrafPro sürümlü dış API yüzeyi. Cari hesaplar, uyum kayıtları, banka
    hesapları ve hareketleri okunabilir; fatura ve gider pusulası oluşturulup
    gönderilebilir; KMTS etiket/işaret kodları sorgulanabilir. Kimlik doğrulama
    HTTP Basic'tir: 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: Fatura oluşturma ve gönderimi, kesilen faturalar ve kalem şablonları
    x-group: Faturalar
  - name: Expenses
    description: Gider pusulası oluşturma, kesinleştirme ve kayıtlar
    x-group: Giderler
  - name: KMTS
    description: KMTS güvenlikli etiket/işaret doğrulaması ve firma sorgu geçmişi
    x-group: KMTS
paths:
  /v1/kmts-verifications:
    post:
      tags:
        - KMTS
      summary: KMTS etiketi veya işareti sorgulama
      description: >-
        Etiket/işaret numarasını KMTS servisinde sorgular ve sonucu şirket
        geçmişine kaydeder. Otomatik tekrar yapılmaz. Aktör başına dakikada 10,
        şirket toplamında dakikada 60 sorgu sınırı vardır.
      operationId: createKmtsVerification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KmtsVerificationRequest'
      responses:
        '201':
          description: KMTS sorgusu tamamlandı ve geçmiş 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/KmtsVerificationResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/KmtsRateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/KmtsUpstreamError'
        '503':
          $ref: '#/components/responses/KmtsRateLimitUnavailable'
        '504':
          $ref: '#/components/responses/KmtsUpstreamTimeout'
components:
  schemas:
    KmtsVerificationRequest:
      type: object
      properties:
        data:
          type: object
          properties:
            scannedCode:
              type: string
              minLength: 1
              maxLength: 64
              description: >-
                KMTS güvenlikli etiket veya işaret numarası. Başındaki ve
                sonundaki boşluklar temizlenir, büyük harfe çevrilir.
          required:
            - scannedCode
          additionalProperties: false
      required:
        - data
    KmtsVerificationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/KmtsVerification'
        meta:
          $ref: '#/components/schemas/MetaBase'
      required:
        - success
        - data
        - meta
    KmtsVerification:
      type: object
      properties:
        id:
          type: string
          pattern: ^[a-fA-F0-9]{24}$
        scannedCode:
          type: string
        outcome:
          type: string
          enum:
            - pending
            - verified
            - not_found
            - invalid
            - provider_error
        isVerified:
          type: boolean
          nullable: true
        status:
          type: string
          nullable: true
        statusDescription:
          type: string
          nullable: true
        statusTitleDescription:
          type: string
          nullable: true
        activationDate:
          type: string
          format: date-time
          nullable: true
        scanVerificationId:
          type: string
          nullable: true
        refineryName:
          type: string
          nullable: true
        markingDate:
          type: string
          format: date-time
          nullable: true
        productName:
          type: string
          nullable: true
        millesimalFineness:
          type: string
          nullable: true
        weightUnit:
          type: string
          nullable: true
        metal:
          type: string
          nullable: true
        weight:
          type: number
          nullable: true
        packagePrefix:
          type: string
          nullable: true
        method:
          type: string
          nullable: true
        methodDescription:
          type: string
          nullable: true
        source:
          type: string
          enum:
            - desktop
            - mobile
            - api
        checkedAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
          nullable: true
        durationMs:
          type: integer
          nullable: true
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        retryable:
          type: boolean
      required:
        - id
        - scannedCode
        - outcome
        - source
        - checkedAt
        - retryable
    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
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          enum:
            - VALIDATION_FAILED
            - AUTH_INVALID_CREDENTIALS
            - AUTH_FORBIDDEN
            - RESOURCE_NOT_FOUND
            - BANK_ACCOUNT_INACTIVE
            - CONFLICT
            - UPSTREAM_ERROR
            - UPSTREAM_RESULT_UNCERTAIN
            - KMTS_RATE_LIMITED
            - KMTS_RATE_LIMIT_UNAVAILABLE
            - KMTS_PROVIDER_TIMEOUT
            - KMTS_PROVIDER_UNAVAILABLE
            - KMTS_PROVIDER_RATE_LIMITED
            - KMTS_PROVIDER_RESPONSE_INVALID
            - KMTS_HISTORY_WRITE_FAILED
            - 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
        state:
          type: string
          nullable: true
        attemptId:
          type: string
          format: uuid
          nullable: true
        verificationId:
          type: string
          nullable: true
        retryAfter:
          type: integer
          nullable: true
        retryable:
          type: boolean
        errorCode:
          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'
    Forbidden:
      description: Bu kaynak şirket için etkin değil veya işlem yetkisi bulunmuyor.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    KmtsRateLimited:
      description: >-
        KMTS sorgu limiti aşıldı. Retry-After başlığı yeniden denenebilecek
        süreyi saniye olarak verir.
      headers:
        Retry-After:
          description: Yeni sorgu yapılmadan önce beklenecek saniye.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Beklenmeyen sunucu hatası.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    KmtsUpstreamError:
      description: >-
        KMTS servisine ulaşılamadı veya servis geçerli yanıt vermedi. Hata
        ayrıntısındaki verificationId ile başarısız geçmiş kaydı okunabilir.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    KmtsRateLimitUnavailable:
      description: >-
        KMTS sorgu kotası doğrulanamadı veya geçmiş kaydı tamamlanamadı. Kota
        hatasında sağlayıcıya istek gönderilmez.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    KmtsUpstreamTimeout:
      description: >-
        KMTS servisi 10 saniye içinde yanıt vermedi. Başarısız geçmiş kaydı
        oluşturulur; otomatik tekrar yapılmaz.
      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)

````