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

# Prepare or record taker redeem

> Prepares the unsigned taker redeem transaction when a signature is omitted.
Records the final redeem step when a signature is supplied.




## OpenAPI

````yaml /openapi.yaml post /v1/trades/{trade_id}/taker-redeem
openapi: 3.1.0
info:
  title: Firmament Backend API
  version: 0.1.3
  summary: Public backend routes for Firmament swaps and runtime proof.
  description: >
    Firmament is a Solana RFQ maker backend for managed liquidity demos.

    This specification documents the public routes used by the swap app and
    runtime view.
servers:
  - url: https://api.firmament.shaikazeem.com
    description: Deployed Firmament API.
  - url: http://127.0.0.1:5050
    description: Local backend started with `cargo run`.
security: []
tags:
  - name: Health
    description: Runtime liveness.
  - name: Assets
    description: Supported Solana assets.
  - name: Pairs
    description: Configured directional pairs and constraints.
  - name: RFQ
    description: Firm quote requests.
  - name: Settlement
    description: Browser-wallet HTLC settlement.
  - name: Trades
    description: Trade status lookup.
  - name: Runtime
    description: Read-only runtime state, events, ledger, and trades.
paths:
  /v1/trades/{trade_id}/taker-redeem:
    post:
      tags:
        - Settlement
      summary: Prepare or record taker redeem
      description: >
        Prepares the unsigned taker redeem transaction when a signature is
        omitted.

        Records the final redeem step when a signature is supplied.
      operationId: postTakerRedeem
      parameters:
        - $ref: '#/components/parameters/TradeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TakerRedeemRequest'
            examples:
              prepareRedeem:
                value:
                  preimage: >-
                    1111111111111111111111111111111111111111111111111111111111111111
              recordRedeem:
                value:
                  preimage: >-
                    1111111111111111111111111111111111111111111111111111111111111111
                  signature: 4Ew2Kq8nV7mC6bX5zP4rT3yU2iO1pL9sA8dF7gH6jK5lM4nB3vC2xZ
      responses:
        '200':
          description: Unsigned taker redeem transaction prepared.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TakerRedeemResponse'
        '202':
          description: Taker redeem recorded and settlement advanced.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TakerRedeemResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    TradeId:
      name: trade_id
      in: path
      required: true
      description: Trade identifier.
      schema:
        type: string
        format: uuid
  schemas:
    TakerRedeemRequest:
      type: object
      required:
        - preimage
      properties:
        preimage:
          type: string
          pattern: ^[0-9a-fA-F]{64}$
          description: >-
            Hex-encoded preimage revealed at redeem time. The server uses it to
            redeem HTLC legs and does not persist it.
        signature:
          $ref: '#/components/schemas/TxSignature'
    TakerRedeemResponse:
      type: object
      required:
        - trade_id
        - settlement_status
        - taker_redeem_transaction
        - maker_redeem_signature
        - tx_signatures
        - ledger_summary
        - integration_status
      properties:
        trade_id:
          type: string
          format: uuid
        settlement_status:
          $ref: '#/components/schemas/SettlementStatus'
        taker_redeem_transaction:
          anyOf:
            - $ref: '#/components/schemas/UnsignedWalletTransaction'
            - type: 'null'
        maker_redeem_signature:
          anyOf:
            - $ref: '#/components/schemas/TxSignature'
            - type: 'null'
        tx_signatures:
          type: array
          items:
            $ref: '#/components/schemas/TxSignature'
        ledger_summary:
          $ref: '#/components/schemas/LedgerSummary'
        integration_status:
          $ref: '#/components/schemas/IntegrationStatus'
        next_action:
          description: Present until the trade is fully redeemed.
          anyOf:
            - $ref: '#/components/schemas/NextAction'
            - type: 'null'
    TxSignature:
      type: string
      description: Solana transaction signature.
    SettlementStatus:
      type: string
      enum:
        - pending
        - initiated
        - redeemed
        - refunded
        - failed
    UnsignedWalletTransaction:
      type: object
      required:
        - transaction_base64
        - recent_blockhash
      properties:
        transaction_base64:
          type: string
          description: Base64-encoded Solana transaction bytes.
        recent_blockhash:
          type: string
    LedgerSummary:
      type: object
      required:
        - balanced
        - entry_count
        - net_usdc_estimate
      properties:
        balanced:
          type: boolean
        entry_count:
          type: integer
          minimum: 0
        net_usdc_estimate:
          $ref: '#/components/schemas/DecimalString'
    IntegrationStatus:
      type: string
      enum:
        - runtime_orchestrated
    NextAction:
      type: object
      required:
        - type
        - method
        - path
      properties:
        type:
          type: string
          example: start_wallet_settlement
        method:
          type: string
          example: POST
        path:
          type: string
          example: /v1/quotes/018f5a45-822c-7f42-9d18-9df9f88c5c7a/wallet-settlement
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              example: invalid_json
            message:
              type: string
            details:
              type: array
              items:
                type: string
    DecimalString:
      type: string
      description: Decimal value serialized by the runtime.
      examples:
        - '0'
  responses:
    BadRequest:
      description: Request shape, path, or validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Requested quote or trade was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````