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

# Claim a settled position without paying gas

> Queues a gasless redemption that the platform broadcasts on the user’s behalf. The user identifies the position by `(marketId, outcomeIndex)`; the server reads the position, verifies it is redeemable, builds the on-chain payload (binary conditionId+indexSets or neg-risk marketId+questionIndex+amount), and queues the job. Returns `{ jobId, status }`; poll `GET /api/me/positions/redeem/:jobId` until the job confirms.
Failures: 400 `not_redeemable` / `neg_risk_not_ready` / `no_quantity` / `no_condition_id`; 403 `no_vault`; 404 `position_not_found`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/me/positions/redeem
openapi: 3.1.0
info:
  title: PredictStreet API
  description: >-
    Client-facing HTTP API for the PredictStreet prediction-market platform.
    **Partner kinds.** Every authenticated endpoint resolves a request's
    *effective wallet* from the partner row. `single_wallet` partners bind to
    one `associatedWallet` set at creation. `multi_wallet` partners declare the
    actor on every request via an `X-User-Wallet: 0x<40-hex>` header. See the
    [Partner kinds](/auth/api-keys#partner-kinds) doc for the full contract.
  version: '2026-06-16'
  contact:
    name: PredictStreet partners
    email: partners@predictstreet.com
servers:
  - url: https://core.api.dev.predictstreet.sde.adifoundation.ai
    description: Testnet (partner integrator API — final domain TBD)
security: []
tags:
  - name: Deposits
    description: >-
      Gasless USDC deposit relay - submit a signed EIP-2612 permit and the
      platform broadcasts the on-chain deposit for you (no gas).
  - name: Events
    description: >-
      Polymarket-style event grouping with football metadata (group, stage,
      teams, tags).
  - name: Tags
    description: Curated tag taxonomy used to filter events.
  - name: Markets
    description: 'Public market data: list, detail, orderbook, trades, OHLC.'
  - name: Crypto
    description: >-
      Crypto price markets: the underlying-asset price curve and Up/Down series
      navigation. The markets themselves are ordinary binary markets — list them
      through /api/markets and /api/events.
  - name: Orders
    description: >-
      Signed-order place / cancel / read. Requires `X-Api-Key` with
      `orders:read` / `orders:write` scope; every write additionally requires an
      EIP-712 signature over the order.
  - name: Portfolio
    description: >-
      Balances, positions, trades, fees, vault info for the key's
      `associatedWallet`. Requires `X-Api-Key` with `portfolio:read` scope.
  - name: Matches
    description: >-
      A match groups several events into one fixture/card (1X2 + first-scorer +
      over-under under one matchup).
  - name: Vault
    description: >-
      Backend co-signatures for ERC-1155 split / merge, and recovery for
      off-chain locks when the corresponding chain tx never confirmed. Requires
      `X-Api-Key` with `vault:write` scope plus an EIP-712 signature over the
      operation.
  - name: Leaderboard
    description: Public ranked leaderboard across PnL / volume buckets.
  - name: Search
    description: Global search across users, events, and matches.
  - name: Withdrawal Security
    description: >-
      Self-service withdrawal 2FA (TOTP) and withdrawal-address whitelist. Same
      endpoints serve the web app (user sessions) and API-key integrators.
      Mutations need `vault:write`, reads `portfolio:read`. Both are opt-in per
      wallet and only gate withdrawals once the platform enables
      withdrawal-security enforcement.
  - name: Platform
    description: >-
      Public platform state: the contract registry, the platform fee
      configuration, the platform freeze flag and active notices. No
      authentication.
paths:
  /api/me/positions/redeem:
    post:
      tags:
        - User
      summary: Claim a settled position without paying gas
      description: >-
        Queues a gasless redemption that the platform broadcasts on the user’s
        behalf. The user identifies the position by `(marketId, outcomeIndex)`;
        the server reads the position, verifies it is redeemable, builds the
        on-chain payload (binary conditionId+indexSets or neg-risk
        marketId+questionIndex+amount), and queues the job. Returns `{ jobId,
        status }`; poll `GET /api/me/positions/redeem/:jobId` until the job
        confirms.

        Failures: 400 `not_redeemable` / `neg_risk_not_ready` / `no_quantity` /
        `no_condition_id`; 403 `no_vault`; 404 `position_not_found`.
      operationId: RedeemController_create
      parameters:
        - $ref: '#/components/parameters/UserWalletHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedeemRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedeemRespDto'
      security:
        - ApiKey:
            - vault:write
components:
  parameters:
    UserWalletHeader:
      name: X-User-Wallet
      in: header
      required: false
      description: >-
        **Required for `multi_wallet` partners on every authenticated request;
        ignored for `single_wallet`.** Declares the acting end-user wallet for
        this request — drives KYC checks, balances/positions/orders attribution,
        rate-limit buckets, and audit. Lower-cased server-side. Missing on a
        multi_wallet key → 401 `api_key_user_wallet_required`; malformed → 401
        `api_key_user_wallet_invalid`. The on-chain `CTFExchange`/`Vault`
        contracts still verify EIP-712 signer ↔ vault binding, so loosening
        API-layer attribution is safe by construction.
      schema:
        $ref: '#/components/schemas/EthereumAddress'
      example: '0x1234567890abcdef1234567890abcdef12345678'
  schemas:
    RedeemRequestDto:
      type: object
      properties:
        marketId:
          type: string
          minLength: 1
          maxLength: 128
          description: >-
            Market identifier of the position to redeem — the `marketId` field
            from the `Position` payload (`GET /api/me/positions`).
          example: PM-WC26-R16-USA-WC26-1910V2
        outcomeIndex:
          type: number
          minimum: 0
          maximum: 255
          description: >-
            Outcome index of the held position (0 = YES, 1 = NO). For binary
            markets this scopes the CTF `indexSets` bitmask to the single side
            the user holds; for neg-risk it only disambiguates which `Position`
            row to read (the adapter burns both sides in one call regardless).
          example: 0
        auth:
          description: >-
            Owner-signed RedeemAuthorization. REQUIRED for API-key (partner)
            callers; IGNORED for web-app session (retail) callers (the session
            binds the wallet already). See `RedeemAuthDto`.
          allOf:
            - $ref: '#/components/schemas/RedeemAuthDto'
      required:
        - marketId
        - outcomeIndex
    RedeemRespDto:
      type: object
      properties:
        jobId:
          type: string
          description: Submission job id (decimal string). Polling key.
          example: '4210'
        status:
          type: string
          description: >-
            Live job status: pending | building | submitted | confirmed |
            failed_permanent | expired.
          example: pending
      required:
        - jobId
        - status
    EthereumAddress:
      type: string
      pattern: ^0x[a-fA-F0-9]{40}$
      example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb3'
    RedeemAuthDto:
      type: object
      properties:
        deadline:
          type: number
          minimum: 0
          description: >-
            Unix-seconds deadline the owner signed into the RedeemAuthorization.
            The server rejects (`redeem_expired`) once it has elapsed.
          example: 1999999999
        v:
          type: number
          description: ECDSA recovery id (27/28 or 0/1).
          example: 27
        r:
          type: string
          minLength: 66
          maxLength: 66
          description: 32-byte r component, 0x-prefixed hex.
        s:
          type: string
          minLength: 66
          maxLength: 66
          description: 32-byte s component, 0x-prefixed hex.
      required:
        - deadline
        - v
        - r
        - s
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Partner / integrator key — format `ps_live_<keyId>_<secret>`. Partner
        keys are issued by PredictStreet; a user can also create keys bound to
        their own wallet from their account settings in the web app. Never ship
        to a browser. `multi_wallet` partners must additionally send
        `X-User-Wallet: 0x<40-hex>` on every authenticated request to declare
        the acting wallet. See the [API keys guide](/auth/api-keys) for scope
        taxonomy, partner kinds, rate limits, and rotation procedure.

````

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