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

# E-Pos ödeme durumunu sağlayıcıdan sorgula

> Başlatılmış mevcut ödeme denemesini sorgular ve doğrulanmış durumu günceller; yeni çekim veya iptal/iade göndermez.

## Ne yapar?

Başlatılmış mevcut ödeme denemesini sorgular ve doğrulanmış durumu günceller; yeni çekim veya iptal/iade göndermez. Henüz başlatılmamış talep 404, eşzamanlı sorgu 409 BANKPOS\_QUERY\_IN\_PROGRESS döndürebilir. HTTP 200 tek başına ödeme kanıtı değildir; status ve verification alanlarını birlikte inceleyin. Ayrıntı için ödeme kaydını yeniden okuyun.

## Ön koşullar ve izin

Gereken izin: **`muhasip:epos:write`**. Açık izin her durumda zorunludur; genel erişim veya yönetici yetkisi bunun yerine geçmez. `write` tek başına `read` sağlamaz. Firma kimlik bilgilerinden belirlenir; ilişkili kayıtlar aynı firmaya ait olmalıdır. Firma paketi ücretli ve süresi aktif olmalıdır.

[Kimlik ve izinler](https://docs.muhasip.pro/baslangic/kimlik-ve-izinler.md) · [E-Pos entegrasyonu](https://docs.muhasip.pro/rehberler/e-pos-entegrasyonu.md)

## İstek örnekleri

Örnekler temsilîdir. Kimlikleri, sürümleri ve işyeri bilgilerini kendi kayıtlarınızla değiştirin. Oranlar yüzde, `amountMinor` değerleri kuruştur. Gereken işlem anahtarını çağrıdan önce kalıcı saklayın; otomatik tekrar yapmayın. Gerçek işyeri anahtarını güvenli sunucu ortamından sağlayın. Node.js örneği Node.js 20 veya üzeri, PHP örneği cURL uzantısı gerektirir.

```bash cURL theme={null}
curl --request POST 'https://api.muhasip.pro/apps/bankpos/payments/600000000000000000000002/query' \
  --user "$MUHASIP_API_USER_ID:$MUHASIP_API_SECRET" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{}
JSON
```

```php PHP theme={null}
<?php
$apiUserId = getenv("MUHASIP_API_USER_ID");
$secret = getenv("MUHASIP_API_SECRET");
if (!$apiUserId || !$secret) {
    throw new RuntimeException("API kimlik bilgileri eksik.");
}
$headers = ["Accept: application/json"];
$headers[] = "Content-Type: application/json";
$body = <<<'JSON'
{}
JSON;
$curl = curl_init("https://api.muhasip.pro/apps/bankpos/payments/600000000000000000000002/query");
curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD => $apiUserId . ":" . $secret,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_TIMEOUT => 100,
    CURLOPT_FOLLOWLOCATION => false,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_POSTFIELDS => $body
]);
$response = curl_exec($curl);
$httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($response === false) {
    curl_close($curl);
    throw new RuntimeException("Sonuç belirsiz; yeniden göndermeden işlem ve ödeme durumunu okuyun.");
}
curl_close($curl);
$result = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
// Ödeme bağlantısını veya gizli alanları günlüklemeyin.
echo json_encode(["httpStatus" => $httpStatus, "status" => $result["status"] ?? null, "id" => $result["result"]["_id"] ?? null, "operationId" => $result["operation"]["operationId"] ?? null], JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR);
```

```javascript Node.js theme={null}
async function main() {
  const apiUserId = process.env.MUHASIP_API_USER_ID
  const secret = process.env.MUHASIP_API_SECRET
  if (!apiUserId || !secret) throw new Error("API kimlik bilgileri eksik.")
  const headers = {
    Authorization: `Basic ${Buffer.from(`${apiUserId}:${secret}`, "utf8").toString("base64")}`,
    Accept: "application/json"
  }
  headers["Content-Type"] = "application/json"
  const body = {}
  const response = await fetch("https://api.muhasip.pro/apps/bankpos/payments/600000000000000000000002/query", {
    method: "POST",
    headers,
    redirect: "error",
    signal: AbortSignal.timeout(100000),
    body: JSON.stringify(body)
  })
  const result = await response.json()
  // Ödeme bağlantısını veya gizli alanları günlüklemeyin.
  console.log({
    httpStatus: response.status,
    status: result.status,
    id: result.result?._id,
    operationId: result.operation?.operationId
  })
}
main().catch(() => {
  console.error("Sonuç alınamadı; işlem/ödeme durumunu kontrol etmeden yeniden göndermeyin.")
  process.exitCode = 1
})
```

## Cevabı değerlendirin

Aşağıdaki cevap temsilîdir; varsa `url` alanı örnekte yer tutucudur. Uygulamada dönen adresi doğrudan kullanın ve günlüklemeyin.

Bu çağrı genel `operation` makbuzu üretmez. Hesap/tercih yazmalarında güncel `revision` kullanın; yanıt kaybında kaydı okuyup son sürümü kontrol edin.

```json theme={null}
{
  "status": true,
  "result": {
    "paymentId": "600000000000000000000002",
    "status": "paid",
    "verification": "verified",
    "reconciliation": {
      "checks": 1,
      "lastCheckedAt": "2026-10-25T09:00:00.000Z",
      "lastResult": "paid",
      "reason": "provider_payment_verified",
      "nextCheckAt": null
    }
  }
}
```

## Hata durumunda

| HTTP / kod | Yapılacak işlem |
| - | - |
| `400 BANKPOS_INVALID_REQUEST` | İstek, kimlik, filtre veya oran biçimini düzeltin. |
| `401 UNAUTHORIZED` | API kimliği, erişim süresi ve firma durumunu kontrol edin. |
| `403 API_SCOPE_FORBIDDEN` | Açık E-Pos iznini, firma/IP ve paket koşullarını kontrol edin. |
| `429` | İstek sıklığını azaltın; mali çağrıyı körlemesine tekrarlamayın. |
| `500 INTERNAL_ERROR` | İstek tamamlanamadı; yazma sonucunu kayıttan kontrol edin. |
| `404 BANKPOS_PAYMENT_NOT_FOUND` | Aynı firmaya ait ödeme kimliğini kullanın; sorgu için başlatılmış deneme gerekir. |
| `409 BANKPOS_QUERY_IN_PROGRESS` | Süren sorgu tamamlandıktan sonra kayıt ayrıntısını okuyun. |

[Hata yönetimi](https://docs.muhasip.pro/rehberler/hata-yonetimi.md) · [İşlem takibi](https://docs.muhasip.pro/rehberler/islem-takibi.md)

## Sonraki adım

[E-Pos entegrasyon akışını izleyin](https://docs.muhasip.pro/rehberler/e-pos-entegrasyonu.md). Hesap değişikliğinde dönen `revision` değerini saklayın; ödemede bağlantı oluşturmayı, müşterinin 3D işlemini ve doğrulanmış mali sonucu ayrı değerlendirin.


## OpenAPI

````yaml openapi.json POST /apps/bankpos/payments/{paymentId}/query
openapi: 3.0.3
info:
  title: Muhasip API
  version: 2026-10-25.1
  description: >-
    Fatura, banka, POS ve tahsilat, GİB e-Arşiv, pazaryeri, online işlemler,
    görevler, ajanda ve takvim entegrasyonları. İşlem alanları, izinler, istek
    ve cevap örnekleri ile hata yönetimi.
servers:
  - url: https://api.muhasip.pro
    description: Muhasip API
security:
  - BasicAuth: []
tags:
  - name: Uygulamalar
  - name: Görev yönetimi
  - name: Ajanda ve takvim
  - name: Fatura
    description: Fatura bağlantısı, belge işlemleri ve muhasebeye aktarım.
  - name: Banka
    description: >-
      Banka hesapları, hareketler, mahsup ve mevcut çalışma alanı alt
      kaynakları.
  - name: POS ve tahsilat
    description: POS hesapları, komisyonlar ve tahsilat bağlantıları.
  - name: GİB e-Arşiv
    description: GİB hesabı, sorgu, taslak ve SMS imzalama.
  - name: Pazaryeri
    description: Trendyol bağlantısı ve sipariş aktarımı.
  - name: Online işlemler
    description: Online işlem ekranı yapılandırması.
  - name: İşlem takibi
    description: Mali işlem durumu ve tekrar çağrı makbuzları.
  - name: Cari hesaplar
    description: Cari hesaplar işlemleri.
  - name: Kasa ve transferler
    description: Kasa ve transferler işlemleri.
  - name: Alış-satış (e-belgesiz)
    description: Alış-satış (e-belgesiz) işlemleri.
  - name: Ödemeler ve mahsuplaşma
    description: Ödemeler ve mahsuplaşma işlemleri.
  - name: Muhasebe seçenekleri
    description: Muhasebe seçenekleri işlemleri.
  - name: E-Pos
    description: >-
      Firmanın kendi banka/ödeme kuruluşu sanal POS hesapları, tarifeler, ödeme
      talepleri ve tam iptal/iade.
paths:
  /apps/bankpos/payments/{paymentId}/query:
    post:
      tags:
        - E-Pos
      summary: E-Pos ödeme durumunu sağlayıcıdan sorgula
      description: >-
        Başlatılmış mevcut ödeme denemesini sorgular ve doğrulanmış durumu
        günceller; yeni çekim veya iptal/iade göndermez. Henüz başlatılmamış
        talep 404, eşzamanlı sorgu 409 BANKPOS_QUERY_IN_PROGRESS döndürebilir.
        HTTP 200 tek başına ödeme kanıtı değildir; status ve verification
        alanlarını birlikte inceleyin. Ayrıntı için ödeme kaydını yeniden
        okuyun.
      operationId: eposQueryPayment
      parameters:
        - name: paymentId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
            description: Aynı firmaya ait 24 haneli kayıt kimliği.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties: {}
              additionalProperties: false
            example: {}
      responses:
        '200':
          description: İşlem cevabı; örnek temsilîdir.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    enum:
                      - true
                  result:
                    $ref: '#/components/schemas/EposQueryResult'
                additionalProperties: false
                required:
                  - status
                  - result
              example:
                status: true
                result:
                  paymentId: '600000000000000000000002'
                  status: paid
                  verification: verified
                  reconciliation:
                    checks: 1
                    lastCheckedAt: '2026-10-25T09:00:00.000Z'
                    lastResult: paid
                    reason: provider_payment_verified
                    nextCheckAt: null
        '400':
          description: İşlem cevabı; örnek temsilîdir.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EposError'
              example:
                status: false
                code: BANKPOS_INVALID_REQUEST
                message: İstek alanları geçersiz.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            BANKPOS_QUERY_IN_PROGRESS. İlgili kaydı ve işlem durumunu kontrol
            edin.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EposError'
              example:
                status: false
                code: BANKPOS_QUERY_IN_PROGRESS
                message: Süren sorgu tamamlandıktan sonra kayıt ayrıntısını okuyun.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          description: İşlem cevabı; örnek temsilîdir.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EposError'
              example:
                status: false
                code: INTERNAL_ERROR
                message: İşlem gerçekleştirilemedi.
components:
  schemas:
    EposQueryResult:
      type: object
      properties:
        paymentId:
          type: string
          pattern: ^[a-fA-F0-9]{24}$
          description: Aynı firmaya ait 24 haneli kayıt kimliği.
        status:
          type: string
          enum:
            - open
            - processing
            - not_found
            - failed
            - paid
            - partially_refunded
            - refunded
            - voided
            - expired
            - cancelled
        verification:
          type: string
        reconciliation:
          $ref: '#/components/schemas/EposReconciliation'
      additionalProperties: false
      required:
        - paymentId
        - status
        - verification
    EposError:
      type: object
      properties:
        status:
          type: boolean
          enum:
            - false
        code:
          type: string
        message:
          type: string
        operation:
          $ref: '#/components/schemas/ApiOperation'
        operationId:
          type: string
        operationIds:
          type: array
          items:
            type: string
        retryable:
          type: boolean
        reviewRequired:
          type: boolean
      additionalProperties: true
      required:
        - status
        - code
        - message
    EposReconciliation:
      type: object
      properties:
        checks:
          type: integer
          minimum: 0
        lastCheckedAt:
          type: string
          format: date-time
          nullable: true
        lastResult:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
        nextCheckAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    ApiOperation:
      type: object
      properties:
        operationId:
          type: string
          pattern: ^[a-f0-9]{64}$
        type:
          type: string
        state:
          type: string
          enum:
            - claimed
            - dispatching
            - provider_accepted
            - succeeded
            - rejected
            - failed_before_dispatch
            - review_required
        reviewRequired:
          type: boolean
        retryable:
          type: boolean
        result:
          $ref: '#/components/schemas/ApiOperationReceipt'
        statusUrl:
          type: string
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 tarih-saat.
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 tarih-saat.
      required:
        - operationId
        - type
        - state
        - reviewRequired
        - retryable
        - result
        - statusUrl
        - createdAt
        - updatedAt
    Error:
      type: object
      properties:
        status:
          type: boolean
        code:
          type: string
        message:
          type: string
        description:
          type: string
        retryable:
          type: boolean
        reviewRequired:
          type: boolean
        operationId:
          type: string
      required:
        - status
      additionalProperties: true
    RateLimitError:
      type: object
      properties:
        status:
          type: integer
          enum:
            - 429
        error:
          type: string
        message:
          type: string
      required:
        - status
        - error
        - message
    ApiOperationReceipt:
      type: object
      properties:
        resultId:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        transactionId:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        uuid:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        id:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        providerId:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        documentId:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        paymentId:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        orderId:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9_.:-]+$
        uuids:
          type: array
          items:
            type: string
            maxLength: 200
            pattern: ^[A-Za-z0-9_.:-]+$
          maxItems: 100
        sourcePaymentId:
          type: string
          description: 24 karakterli kayıt kimliği.
          pattern: ^[a-f0-9A-F]{24}$
        destinationPaymentId:
          type: string
          description: 24 karakterli kayıt kimliği.
          pattern: ^[a-f0-9A-F]{24}$
      additionalProperties: false
  responses:
    Unauthorized:
      description: API kimliği/parolası, erişim süresi veya firma doğrulanamadı.
      headers:
        WWW-Authenticate:
          schema:
            type: string
          description: Basic realm="Muhasip API", charset="UTF-8"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: false
            code: UNAUTHORIZED
            message: API kimlik bilgileri doğrulanamadı.
    Forbidden:
      description: Ürün, IP, modül izni veya kaynak kapsamı uygun değil.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: false
            message: Ürün, IP, modül izni veya kaynak kapsamı uygun değil.
    NotFound:
      description: Kayıt bulunamadı veya bu erişim bağlamında kullanılamıyor.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: false
    RateLimited:
      description: Ortak istek sınırı aşıldı; sayısal status alanı kullanılır.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          example:
            status: 429
            error: Too Many Requests
            message: Rate limit exceeded. Please try again later.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Kullanıcı adı apiUserId, parola secretKey. Aktif ve süresi geçmemiş API
        kullanıcısı ve uygun firma gerekir.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.