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

# Read a wallet payment by id

> Fetch the current state and debit breakdown of a wallet payment by its `payment_id`. Useful for reconciliation, receipt generation, or status polling after an async edge case. The payment is tenant-scoped to the calling integration, a payment belonging to another integration resolves to `NOT_FOUND` (no PII leak). Read-only; rate-limited.



## OpenAPI

````yaml /api-reference/openapi.yaml get /payments/{id}
openapi: 3.1.0
info:
  title: Feddi Partner API
  version: '2026-06-01'
  description: >-
    Operate a Feddi closed-loop wallet and loyalty program at the point of sale:
    identify customers, read balances, accept wallet payments, run top-ups, and
    reconcile transactions.


    All amounts are integer minor units with an explicit ISO-4217 currency.
    Balances are merchant-held and closed-loop.


    Every response uses a typed envelope (`ok` / `data` / `error` / `meta`) with
    string error codes (never a bare HTTP number) and an idempotency-replay
    flag. Authenticate with the `x-api-key` header; exchange it for a
    short-lived POS terminal JWT for hot-path calls.


    Self-validate against this document (`GET /openapi`) and read `GET
    /capabilities` for the credential types, currencies, and features enabled
    for your integration before assuming any enum.


    Operations are tagged `x-feddi-availability: ga` (stable) or `beta`
    (callable, contract may still change additively); confirm what is enabled
    for your credentials via `GET /capabilities`.


    Sandbox access is granted per partner agreement; request credentials from
    your Feddi contact.
servers:
  - url: https://api.feddi.io/v1/partner
    description: production
  - url: https://api.dev.feddi.io/v1/partner
    description: dev
security:
  - ApiKeyAuth: []
tags:
  - name: platform
    description: >-
      Platform cross-cutting: health, capabilities, openapi self-serve, merchant
      provisioning, settlement, reconciliation.
  - name: checkout_session
    description: >-
      Checkout sessions: every interaction opens a session, then identity and
      basket attach to it, and payment, top-up, and offers run against it.
  - name: auth
    description: >-
      Partner authentication + onboarding: API key lifecycle, POS terminal JWT
      exchange, terminal heartbeat.
  - name: customers
    description: >-
      Customer lookup + identification: resolve identity, cashier-panel
      summaries, preferences, GDPR export/erase.
  - name: enrollment
    description: >-
      Enrollment + signup: OTP enroll, cashback claims, identity/consent,
      customer correction + merge.
  - name: payments
    description: >-
      Payments + redemption: debit wallet (promo-first), balance-check, void,
      refund, QR mint.
  - name: topup
    description: >-
      Wallet top-up: 2-step prepare/confirm, reload-bonus grants, SKU top-up,
      settlement + reconciliation.
  - name: incentives
    description: >-
      Incentives + offers: offer feeds, apply/redeem/release locks, proposals,
      budget envelopes, points, grant clawback.
  - name: transactions
    description: >-
      Transactions + receipts: transaction detail, void, receipts, disputes,
      settlements, reconciliation, exports.
  - name: webhooks
    description: >-
      Webhooks + events: subscriptions, delivery history + retry, event catalog,
      polling fallback.
paths:
  /payments/{id}:
    get:
      tags:
        - payments
      summary: Read a wallet payment by id
      description: >-
        Fetch the current state and debit breakdown of a wallet payment by its
        `payment_id`. Useful for reconciliation, receipt generation, or status
        polling after an async edge case. The payment is tenant-scoped to the
        calling integration, a payment belonging to another integration resolves
        to `NOT_FOUND` (no PII leak). Read-only; rate-limited.
      operationId: paymentGet
      parameters:
        - name: id
          in: path
          required: true
          description: The `payment_id` returned by `POST /payments`.
          schema:
            type: string
      responses:
        '200':
          description: Payment record.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PaymentResult'
              example:
                ok: true
                data:
                  payment_id: pay_77c1
                  status: completed
                  wallet_id: wal_5512
                  amount_minor: 3500
                  debited_promo_minor: 500
                  debited_actual_minor: 3000
                  currency: QAR
                  order_ref: ord-88812
                  balance_after:
                    actual_minor: 9500
                    promo_available_minor: 0
                    promo_locked_minor: 200
                    pending_topups_minor: 0
                    currency: QAR
                    promo_grants: []
                  completed_at: '2026-06-05T10:00:01Z'
                error: null
                meta:
                  request_id: req_pg1
                  idempotency_replayed: false
                  api_version: '2026-06-01'
        '401':
          description: '`INVALID_API_KEY`, missing/invalid `x-api-key`.'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      error:
                        $ref: '#/components/schemas/Error'
        '403':
          description: '`FORBIDDEN`, valid key but not authorized for this merchant scope.'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      error:
                        $ref: '#/components/schemas/Error'
        '404':
          description: '`NOT_FOUND`, payment not found or belongs to another integration.'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      error:
                        $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ResponseEnvelope:
      type: object
      description: >-
        The standard response envelope that every enveloped endpoint serializes
        through. `ok` is a boolean discriminator: when `ok` is `true`, the typed
        result is carried in `data`; when `ok` is `false`, a typed error object
        is returned instead. The `meta` object is uniform across the entire API
        surface.
      required:
        - ok
        - meta
      properties:
        ok:
          type: boolean
        data:
          type:
            - object
            - 'null'
        error:
          oneOf:
            - $ref: '#/components/schemas/Error'
            - type: 'null'
        meta:
          $ref: '#/components/schemas/Meta'
    PaymentResult:
      type: object
      required:
        - payment_id
        - status
        - wallet_id
        - amount_minor
        - debited_promo_minor
        - debited_actual_minor
        - currency
        - balance_after
      properties:
        payment_id:
          type: string
          description: Feddi-assigned payment id.
          example: pay_77c1
        status:
          type: string
          enum:
            - completed
            - voided
            - pending
          description: >-
            `completed` = debit landed; `voided` = reversed; `pending` =
            RESERVED for v2 provider-async settlement legs, v1 NEVER returns it
            (v1 debits are atomic: you get `completed` or a typed error). Handle
            defensively as forward-compat by polling `GET
            /{integrationId}/transactions/{transactionId}`.
        wallet_id:
          type: string
          example: wal_5512
        amount_minor:
          type: integer
          description: Total amount debited (promo + actual).
          example: 3500
        debited_promo_minor:
          type: integer
          description: >-
            Portion of the debit drawn from released promo grants (FIFO by
            expiry). Zero if no promo was available.
          example: 500
        debited_actual_minor:
          type: integer
          description: Portion of the debit drawn from the actual (real-money) balance.
          example: 3000
        currency:
          type: string
          example: QAR
        order_ref:
          type: string
          example: ord-88812
        balance_after:
          $ref: '#/components/schemas/Balance'
        completed_at:
          type: string
          format: date-time
    Error:
      type: object
      description: >-
        The typed error object returned with every non-2xx response. `code` is a
        string enum (for example `WALLET_PROGRAM_AMBIGUOUS`,
        `CREDENTIAL_TYPE_UNSUPPORTED`, `INSUFFICIENT_FUNDS`,
        `IDEMPOTENCY_KEY_REUSED`, `CURRENCY_NOT_SUPPORTED`), **never a bare HTTP
        status number**. Inspect `code` for programmatic branching, not the HTTP
        status. Some codes echo the valid set in `details` so clients can
        present or reconcile the accepted values: for example
        `CREDENTIAL_TYPE_UNSUPPORTED` lists the supported credential types,
        `CURRENCY_NOT_SUPPORTED` lists the supported ISO-4217 currencies, and
        `WALLET_PROGRAM_AMBIGUOUS` lists the candidate `wallet_program_id`
        values that matched the request.
      required:
        - code
        - message
      properties:
        code:
          type: string
          enum:
            - INSUFFICIENT_FUNDS
            - INVALID_API_KEY
            - CREDENTIAL_TYPE_UNSUPPORTED
            - CURRENCY_NOT_SUPPORTED
            - IDEMPOTENCY_KEY_REUSED
            - WALLET_PROGRAM_AMBIGUOUS
            - REQUIRES_DYNAMIC_CREDENTIAL
            - NOT_FOUND
            - FORBIDDEN
            - VALIDATION_ERROR
            - RATE_LIMITED
            - CONFLICT
            - INTERNAL_SERVER_ERROR
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    Meta:
      type: object
      description: >-
        The uniform response metadata block returned on every response.
        `data_completeness_score` is computed per call and reports the
        completeness of the returned data. `decision_trace_id` is present on
        responses that carry decision or insight output and can be used to
        correlate the response with its reasoning. `capabilities` is an
        additive, response-level array of hints advertising features the caller
        may use, and may be extended over time without notice.
      required:
        - request_id
        - api_version
      properties:
        request_id:
          type: string
          description: Feddi-issued correlation id for this response.
        idempotency_replayed:
          type: boolean
          description: True when this response was replayed from the idempotency store.
        api_version:
          type: string
          description: The single API version field.
          example: '2026-06-01'
        data_completeness_score:
          type: integer
          minimum: 0
          maximum: 100
          description: >-
            0-100, computed per call (basket/identity/tax/category/consent
            presence).
        decision_trace_id:
          type:
            - string
            - 'null'
          description: Opaque trace id on intelligence-bearing responses; one per response.
        capabilities:
          type: object
          additionalProperties: true
          description: Additive response-level capability hints.
    Balance:
      type: object
      required:
        - actual_minor
        - promo_available_minor
        - promo_locked_minor
        - pending_topups_minor
        - currency
      description: >-
        Three-class wallet balance per the resolved money model. Actual = real
        money (deferred-revenue liability). Promo = separate contingent
        promotional class (expirable, locked until activation condition met,
        promo-first debit, clawback-able, NOT a real liability).
      properties:
        wallet_id:
          type: string
          description: Feddi wallet id (omitted when nested in PaymentResult).
          example: wal_5512
        wallet_program_id:
          type: string
          description: >-
            Which wallet program this balance is against. First-class to prevent
            multi-program ambiguity.
          example: wp_77
        actual_minor:
          type: integer
          description: >-
            Real-money balance, funded by customer top-ups. A real
            deferred-revenue liability the merchant tracks carefully. Spent on
            purchases after promo is exhausted.
          example: 12000
        promo_available_minor:
          type: integer
          description: >-
            Sum of the `remaining_minor` across all released, non-expired
            promotional grants: promotional credits the customer can spend
            immediately (promo-first). Not real money; a contingent promotional
            class.
          example: 500
        promo_locked_minor:
          type: integer
          description: >-
            Sum of the `remaining_minor` across all locked promotional grants:
            promotional credits gated on an activation condition (for example
            wallet signup or first top-up). The customer cannot spend these
            until they are released.
          example: 200
        pending_topups_minor:
          type: integer
          description: >-
            In-flight top-ups not yet confirmed (PENDING state). Informational
            only; not spendable.
          example: 0
        currency:
          type: string
          example: QAR
        customer_state:
          type: string
          enum:
            - verified
            - pending_proof
          description: >-
            Wallet identity state. `pending_proof` = customer not yet verified
            (actual balance is credited; cashback-class promo stays `LOCKED`;
            payments blocked).
        promo_grants:
          type: array
          description: >-
            Itemized promotional grant breakdown. Present when reading balance;
            may be an empty array on tight payment result objects.
          items:
            $ref: '#/components/schemas/PromoGrantSummary'
    PromoGrantSummary:
      type: object
      required:
        - source
        - state
        - remaining_minor
        - expires_at
      properties:
        promo_grant_id:
          type: string
          example: pg_aa01
        source:
          type: string
          enum:
            - CASHBACK
            - RELOAD_BONUS
            - SKU_TOPUP_BONUS
            - GATEWAY_BONUS
            - SIGNUP_BONUS
          description: >-
            Origin of the promo grant, maps to the promotional-grant source
            enum.
        state:
          type: string
          enum:
            - RELEASED
            - LOCKED
            - CLAWED_BACK
            - EXPIRED
          description: >-
            `RELEASED` = spendable; `LOCKED` = gated on activation condition;
            `CLAWED_BACK` = reversal clawed it back; `EXPIRED` = past TTL. Grant
            state is UPPERCASE everywhere grants appear; claim states are a
            separate (lowercase) machine.
        remaining_minor:
          type: integer
          example: 500
        expires_at:
          type: string
          format: date-time
          example: '2026-09-01T00:00:00Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Partner API key (platform- or merchant-scoped). Contract key-enforces
        context.merchant_id.

````