> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payven.com.tr/llms.txt
> Use this file to discover all available pages before exploring further.

# Ödemeyi sorgula

> Bir ödemenin güncel durumunu, banka yanıt detayını ve işlem geçmişini döner. Webhook teslimi başarısız olduğunda sonucu doğrulamak için bu uç noktayı kullanın. Başarısız işlemler için yanıt `200 OK` döner ve `error_code` / `provider_error_code` alanları gövdede taşınır.



## OpenAPI

````yaml /api-reference/sanal-pos/openapi.json get /api/v1/payments/{transaction_id}
openapi: 3.0.4
info:
  title: Payven Sanal POS API
  description: >-
    Payven Sanal POS — çoklu banka kart ödemeleri, 3D Secure, akıllı
    yönlendirme, mutabakat ve webhook altyapısı.
  termsOfService: https://payven.com.tr/sozlesmeler
  contact:
    name: Payven Developer Support
    url: https://docs.payven.com.tr
    email: destek@payven.com.tr
  license:
    name: Payven API License
    url: https://payven.com.tr/sozlesmeler/api-lisansi
  version: '1.0'
servers:
  - url: https://vpos-sandbox.payven.com.tr
    description: Sandbox
  - url: https://vpos.payven.com.tr
    description: Production
security:
  - bearerAuth: []
tags:
  - name: ApiRequestLogs
    x-displayName: API İstek Kayıtları
  - name: CancellationRequests
    x-displayName: İptal Talepleri
  - name: Chargebacks
    x-displayName: Chargeback
  - name: CheckoutSessions
    x-displayName: Hosted Checkout
  - name: ConnectorConfigurations
    x-displayName: Konnektör Konfigürasyonları
  - name: ConnectorErrorCodes
    x-displayName: Konnektör Hata Kodları
  - name: Connectors
    x-displayName: Konnektörler
  - name: Dashboard
    x-displayName: Dashboard
  - name: Health
    x-displayName: Sağlık
  - name: MerchantBankProfiles
    x-displayName: Bayi Banka Profilleri
  - name: Payments
    x-displayName: Ödemeler
  - name: Reconciliations
    x-displayName: Mutabakat
  - name: Refunds
    x-displayName: İadeler
  - name: RoutingRules
    x-displayName: Yönlendirme Kuralları
  - name: Settings
    x-displayName: Ayarlar
  - name: Settlements
    x-displayName: Settlement
  - name: SimpleRoutingRules
    x-displayName: Basit Yönlendirme Kuralları
  - name: TestCards
    x-displayName: Test Kartları
  - name: Trace
    x-displayName: Trace
  - name: Transactions
    x-displayName: İşlemler
  - name: Webhooks
    x-displayName: Webhook'lar
paths:
  /api/v1/payments/{transaction_id}:
    get:
      tags:
        - Payments
      summary: Ödemeyi sorgula
      description: >-
        Bir ödemenin güncel durumunu, banka yanıt detayını ve işlem geçmişini
        döner. Webhook teslimi başarısız olduğunda sonucu doğrulamak için bu uç
        noktayı kullanın. Başarısız işlemler için yanıt `200 OK` döner ve
        `error_code` / `provider_error_code` alanları gövdede taşınır.
      operationId: getPayment
      parameters:
        - name: transaction_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentStatusDto'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X GET
            https://vpos-sandbox.payven.com.tr/api/v1/payments/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6
            \
              -H "Authorization: Bearer $PAYVEN_TOKEN"
        - lang: javascript
          label: Node.js
          source: |-
            const res = await fetch(
              "https://vpos-sandbox.payven.com.tr/api/v1/payments/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6",
              {
                method: "GET",
                headers: {
                  Authorization: `Bearer ${accessToken}`,
                  "Content-Type": "application/json",
                },
              },
            );
            const data = await res.json();
        - lang: python
          label: Python
          source: |-
            import httpx
            res = httpx.get(
                "https://vpos-sandbox.payven.com.tr/api/v1/payments/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6",
                headers={
                    "Authorization": f"Bearer {access_token}",
                },
            )
            data = res.json()
        - lang: csharp
          label: C#
          source: >-
            var req = new HttpRequestMessage(HttpMethod.Get,
            "https://vpos-sandbox.payven.com.tr/api/v1/payments/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6");

            req.Headers.Authorization = new AuthenticationHeaderValue("Bearer",
            accessToken);

            var resp = await http.SendAsync(req);
        - lang: go
          label: Go
          source: >-
            req, _ := http.NewRequest("GET",
            "https://vpos-sandbox.payven.com.tr/api/v1/payments/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6",
            nil)

            req.Header.Set("Authorization", "Bearer "+accessToken)

            resp, _ := http.DefaultClient.Do(req)
        - lang: php
          label: PHP
          source: >-
            $ch =
            curl_init("https://vpos-sandbox.payven.com.tr/api/v1/payments/8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6");

            curl_setopt_array($ch, [
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer $accessToken",
              ],
            ]);

            $data = json_decode(curl_exec($ch), true);
components:
  schemas:
    PaymentStatusDto:
      allOf:
        - $ref: '#/components/schemas/PaymentOperationResultDto'
        - type: object
          properties:
            amount:
              type: integer
              format: int64
            currency:
              type: string
              nullable: true
            is3_d_secure:
              type: boolean
            created:
              type: string
              format: date-time
            basket_id:
              type: string
              nullable: true
          additionalProperties: false
    PaymentOperationResultDto:
      type: object
      properties:
        transaction_id:
          type: string
          format: uuid
          description: >-
            Payven tarafından atanan benzersiz işlem kimliği. Sorgulama /
            aksiyon endpoint'lerinde URL parametresi olarak kullanılır.
          example: 8e3f5c12-9a7b-4c8d-bc4e-2c963f66afa6
        status:
          type: string
          nullable: true
          description: >-
            İşlemin mevcut durumu: `pending`, `pending_3ds`, `authorized`,
            `completed`, `failed`, `voided`, `refunded`, `partially_refunded`.
          example: completed
        is_success:
          type: boolean
          description: >-
            Operasyon başarılı mı? **Geçiş döneminde tutuluyor — yeni kodlarda
            HTTP status kodunu konuşturun** (2xx başarı, 4xx/5xx hata).
          example: true
        message:
          type: string
          nullable: true
          description: İnsan-okur durum mesajı.
          example: İşlem başarıyla tamamlandı
        error_code:
          type: string
          nullable: true
          description: Yalnızca başarısız işlemlerde dolar — Payven canonical hata kodu.
          example: bank_declined
        provider_error_code:
          type: string
          nullable: true
          description: Yalnızca başarısız işlemlerde dolar — bankanın orijinal yanıt kodu.
          example: '51'
        extra_properties:
          type: object
          additionalProperties:
            type: string
          nullable: true
          description: >-
            Banka-spesifik ek alanlar: `auth_code`, `host_reference`,
            `provider_transaction_id`, `processed_at` vb.
      additionalProperties: false
      description: >-
        Yazma operasyonlarından (`POST /payments`, `/refund`, `/void`,
        `/capture`) dönen sonuç.
      required:
        - transaction_id
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  responses:
    Unauthorized:
      description: '`Authorization` header eksik, geçersiz veya süresi dolmuş.'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
          example:
            type: https://docs.payven.com.tr/errors/invalid_token
            title: Geçersiz token
            status: 401
            code: invalid_token
            detail: Access token geçersiz veya süresi dolmuş — refresh edin.
    Forbidden:
      description: Yetki yok, lisans yok veya merchant pasif.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
          example:
            type: https://docs.payven.com.tr/errors/forbidden
            title: Yetki yok
            status: 403
            code: forbidden
            detail: Bu rol bu kaynağı göremez.
    NotFound:
      description: Kaynak bulunamadı.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
          example:
            type: https://docs.payven.com.tr/errors/resource_not_found
            title: Kaynak bulunamadı
            status: 404
            code: resource_not_found
    TooManyRequests:
      description: Rate limit aşıldı. `Retry-After` header'ına uyun.
      headers:
        Retry-After:
          description: Yeniden denemeden önce beklemeniz gereken saniye sayısı.
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
          example:
            type: https://docs.payven.com.tr/errors/rate_limit_exceeded
            title: İstek limiti aşıldı
            status: 429
            code: rate_limit_exceeded
    ServerError:
      description: >-
        Sunucu hatası. Exponential backoff ile tekrar deneyin (Idempotency-Key
        ile).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
          example:
            type: https://docs.payven.com.tr/errors/internal_server_error
            title: Sunucu hatası
            status: 500
            code: internal_server_error
    ServiceUnavailable:
      description: >-
        Hedef konnektör geçici olarak devre dışı (circuit breaker açık) veya
        bağımlılık servisi erişilemez.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
          example:
            type: https://docs.payven.com.tr/errors/connector_unavailable
            title: Konnektör erişilemez
            status: 503
            code: connector_unavailable
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Identity servisinden alinan Keycloak JWT. Format: `Authorization: Bearer
        <token>`. Token alma: POST /api/v1/auth/{slug}/token

````