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

# Pre-check POS JWT freshness without making a money call

> Pre-checks a POS terminal JWT's validity and remaining TTL without performing any business operation. A terminal calls this to decide whether to refresh before starting a checkout, avoiding a mid-transaction `401`. The JWT is presented via the `PosTerminalJWT` bearer scheme. For a valid token the endpoint returns `{ valid, expires_at, remaining_seconds, scope }`; for an expired, malformed, or wrong-audience token it returns `{ valid: false, reason }`. **A malformed or invalid token still returns HTTP `200` with `valid: false`**: this is a check, not an auth gate, so a bad token is a data answer, never a `401`. Read-only and rate-limited to deter token-probing. Does **not** extend the token.



## OpenAPI

````yaml /api-reference/openapi.yaml get /auth/token/validate
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:
  /auth/token/validate:
    get:
      tags:
        - auth
      summary: Pre-check POS JWT freshness without making a money call
      description: >-
        Pre-checks a POS terminal JWT's validity and remaining TTL without
        performing any business operation. A terminal calls this to decide
        whether to refresh before starting a checkout, avoiding a
        mid-transaction `401`. The JWT is presented via the `PosTerminalJWT`
        bearer scheme. For a valid token the endpoint returns `{ valid,
        expires_at, remaining_seconds, scope }`; for an expired, malformed, or
        wrong-audience token it returns `{ valid: false, reason }`. **A
        malformed or invalid token still returns HTTP `200` with `valid:
        false`**: this is a check, not an auth gate, so a bad token is a data
        answer, never a `401`. Read-only and rate-limited to deter
        token-probing. Does **not** extend the token.
      operationId: authTokenValidate
      parameters: []
      responses:
        '200':
          description: >-
            Validity verdict. A valid OR an invalid/expired token both return
            200 (this is a freshness check, not an auth gate).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/TokenValidation'
              example:
                ok: true
                data:
                  valid: true
                  expires_at: '2026-06-05T09:10:00Z'
                  remaining_seconds: 412
                  sandbox: false
                  scope:
                    integration_id: 33333333-3333-3333-3333-333333333333
                    enterprise_id: 11111111-1111-1111-1111-111111111111
                    brand_id: 44444444-4444-4444-4444-444444444444
                    branch_id: 22222222-2222-2222-2222-222222222222
                    cashier_id: cashier-42
                  reason: null
                error: null
                meta:
                  request_id: req_tv1
                  idempotency_replayed: false
                  api_version: '2026-06-01'
        '401':
          description: >-
            `INVALID_API_KEY` (HTTP 401), NO bearer token presented at all (an
            absent token is an auth failure; a PRESENT-but-expired/malformed
            token returns 200 with `valid:false`).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      error:
                        $ref: '#/components/schemas/Error'
        '429':
          description: >-
            `RATE_LIMITED` (HTTP 429), too many validation probes from this
            terminal.
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseEnvelope'
                  - type: object
                    properties:
                      error:
                        $ref: '#/components/schemas/Error'
      security:
        - PosTerminalJWT: []
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'
    TokenValidation:
      type: object
      description: >-
        Result of a non-mutating POS JWT freshness check. A valid AND an invalid
        token both return HTTP 200 with this body.
      required:
        - valid
      properties:
        valid:
          type: boolean
          description: >-
            True if the presented token is well-formed, correctly signed,
            correct audience, and not expired.
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Present when valid.
        remaining_seconds:
          type:
            - integer
            - 'null'
          description: Seconds of TTL left; present when valid.
        sandbox:
          type:
            - boolean
            - 'null'
          description: The token's sandbox flag; present when valid.
        scope:
          anyOf:
            - allOf:
                - $ref: '#/components/schemas/TokenScope'
              description: Present when valid.
            - type: 'null'
        reason:
          type:
            - string
            - 'null'
          enum:
            - expired
            - malformed
            - wrong_audience
            - bad_signature
            - null
          description: Why the token is invalid; present (non-null) only when valid=false.
    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.
    TokenScope:
      type: object
      description: >-
        The scope claims embedded in a POS terminal JWT, derived from the
        originating API key.
      required:
        - integration_id
        - enterprise_id
      properties:
        integration_id:
          type: string
          format: uuid
        enterprise_id:
          type: string
          format: uuid
        brand_id:
          type:
            - string
            - 'null'
          format: uuid
        branch_id:
          type:
            - string
            - 'null'
          format: uuid
        cashier_id:
          type:
            - string
            - 'null'
          description: The validated cashier id, present when supplied at exchange.
  headers:
    RetryAfter:
      description: >-
        Seconds to wait before retrying (RFC 9110 Retry-After). Present on `429`
        responses.
      schema:
        type: integer
    XRateLimitLimit:
      description: >-
        The per-minute request budget for this operation + integration (mirrors
        `Capabilities.rate_limits`).
      schema:
        type: integer
    XRateLimitRemaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
    XRateLimitReset:
      description: Unix epoch seconds at which the current rate-limit window resets.
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Partner API key (platform- or merchant-scoped). Contract key-enforces
        context.merchant_id.
    PosTerminalJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        POS terminal JWT minted by /auth/token; carries integrationId +
        terminal/cashier claims (server-trusted).

````