> ## 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 sorgu geçmişi

> Şirketin masaüstü, mobil uygulama ve API üzerinden yaptığı KMTS güvenlikli etiket/işaret sorgularını en yeni kayıt önce olacak şekilde listeler. Sonuç, fiziksel ürünün orijinalliği için tek başına garanti değildir.



## OpenAPI

````yaml /api-reference/openapi.json get /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:
    get:
      tags:
        - KMTS
      summary: KMTS sorgu geçmişi
      description: >-
        Şirketin masaüstü, mobil uygulama ve API üzerinden yaptığı KMTS
        güvenlikli etiket/işaret sorgularını en yeni kayıt önce olacak şekilde
        listeler. Sonuç, fiziksel ürünün orijinalliği için tek başına garanti
        değildir.
      operationId: listKmtsVerifications
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
        - name: sort
          in: query
          required: false
          description: >-
            Sıralama: createdAt veya updatedAt alanı ve asc/desc yönü. Yön
            yazılmazsa asc; sort gönderilmezse createdAt:desc kullanılır.
          schema:
            type: string
            pattern: ^(createdAt|updatedAt)(:(asc|desc))?$
        - name: scannedCode
          in: query
          required: false
          description: Normalize edilmiş etiket/işaret numarasıyla tam eşleşme.
          schema:
            type: string
            maxLength: 64
        - name: outcome
          in: query
          required: false
          schema:
            type: string
            enum:
              - pending
              - verified
              - not_found
              - invalid
              - provider_error
        - name: source
          in: query
          required: false
          schema:
            type: string
            enum:
              - desktop
              - mobile
              - api
        - name: startDate
          in: query
          required: false
          description: ISO-8601 tarih; checkedAt >= startDate.
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          required: false
          description: ISO-8601 tarih; checkedAt <= endDate.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Başarılı liste yanıtı.
          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/KmtsVerificationListResponse'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    KmtsVerificationListResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: array
          items:
            $ref: '#/components/schemas/KmtsVerification'
        meta:
          $ref: '#/components/schemas/MetaList'
      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
    MetaList:
      allOf:
        - $ref: '#/components/schemas/MetaBase'
        - type: object
          properties:
            page:
              type: integer
            limit:
              type: integer
            total:
              type: integer
            pages:
              type: integer
          required:
            - page
            - limit
            - total
            - pages
    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
    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
            - 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'
    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)

````