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

# Batch Replace Orders

> Replace up to 2 orders with independent cancel and replacement outcomes.



## OpenAPI

````yaml /openapi/v1.json post /v1/limitless/orders/replace/batch
openapi: 3.0.0
info:
  title: ParlayX API
  version: 1.0.0
  description: Aggregated prediction-market trading API
servers:
  - url: https://api.parlayx.com
security: []
tags:
  - name: Authentication
    description: Confirm your signing and read the server clock.
  - name: Discovery
    description: Browse sports, competitions, events, and markets.
  - name: Polymarket
    description: Submit and manage orders on Polymarket outcomes.
  - name: Kalshi
    description: Submit and manage orders on Kalshi markets.
  - name: ProphetX
    description: Submit and manage orders on ProphetX strikes.
  - name: Limitless
    description: Discover and trade Limitless markets.
paths:
  /v1/limitless/orders/replace/batch:
    post:
      tags:
        - Limitless
      summary: Batch Replace Orders
      description: Replace up to 2 orders with independent cancel and replacement outcomes.
      operationId: replaceLimitlessOrders
      parameters:
        - name: PX-Key-Id
          in: header
          required: true
          schema:
            type: string
          description: The key id issued for your signing keypair.
        - name: PX-Timestamp
          in: header
          required: true
          schema:
            type: string
          description: >-
            Unix seconds at signing, valid within 30 seconds of the server
            clock.
        - name: PX-Signature
          in: header
          required: true
          schema:
            type: string
          description: Ed25519 signature of the request
        - name: PX-Content-Sha256
          in: header
          required: true
          schema:
            type: string
          description: >-
            Hex SHA-256 of the request body, or the SHA-256 of the empty string
            when there is no body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceLimitlessOrdersRequest'
      responses:
        '200':
          description: Per-order outcomes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplaceLimitlessOrdersResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: The request was not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '403':
          description: The key is not permitted to perform this action
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '429':
          description: >-
            The organization has exceeded its request rate; retry after the
            Retry-After interval
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          description: Authentication is temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
components:
  schemas:
    ReplaceLimitlessOrdersRequest:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/ReplaceLimitlessOrderRequest'
          minItems: 1
          maxItems: 2
      required:
        - orders
      additionalProperties: false
    ReplaceLimitlessOrdersResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/ReplaceLimitlessOrderResponse'
      required:
        - results
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/ApiErrorCode'
            message:
              type: string
              description: Plain-text explanation of the error.
            orderId:
              type: string
              format: uuid
              description: >-
                The affected order, present only on
                ORDER_RECONCILIATION_REQUIRED; read it back to determine whether
                it reached the venue.
          required:
            - code
            - message
      required:
        - error
      title: API Error
    AuthError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              $ref: '#/components/schemas/AuthErrorCode'
            message:
              type: string
              description: Plain-text explanation of the error.
          required:
            - code
            - message
      required:
        - error
      title: Auth Error
    ReplaceLimitlessOrderRequest:
      type: object
      properties:
        orderId:
          type: string
          format: uuid
        replacement:
          $ref: '#/components/schemas/LimitlessOrderRequest'
      required:
        - orderId
        - replacement
      additionalProperties: false
    ReplaceLimitlessOrderResponse:
      type: object
      properties:
        orderId:
          type: string
          format: uuid
        cancelOutcome:
          type: string
          enum:
            - CANCELLED
            - COMPLETED
            - NOT_FOUND
            - UNKNOWN
        replacementOutcome:
          type: string
          enum:
            - ACCEPTED
            - REJECTED
            - SKIPPED
            - CONFLICT
            - UNKNOWN
        replacement:
          type: object
          nullable: true
          properties:
            orderId:
              type: string
              format: uuid
              description: Issued order id.
              example: 3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d
            status:
              $ref: '#/components/schemas/TradingOrderStatus'
          required:
            - orderId
            - status
        cancelError:
          type: object
          properties:
            code:
              type: string
              enum:
                - INVALID_REQUEST
                - AUTHENTICATION_FAILED
                - PROTOCOL_ERROR
                - SERVICE_UNAVAILABLE
                - ORDER_NOT_CANCELLABLE
                - INSUFFICIENT_BALANCE
                - VENUE_REJECTED
                - VENUE_NOT_ENABLED
                - INTERNAL_ERROR
          required:
            - code
        replacementError:
          type: object
          properties:
            code:
              type: string
              enum:
                - INVALID_REQUEST
                - AUTHENTICATION_FAILED
                - PROTOCOL_ERROR
                - SERVICE_UNAVAILABLE
                - ORDER_NOT_CANCELLABLE
                - INSUFFICIENT_BALANCE
                - VENUE_REJECTED
                - VENUE_NOT_ENABLED
                - INTERNAL_ERROR
          required:
            - code
      required:
        - orderId
        - cancelOutcome
        - replacementOutcome
        - replacement
    ApiErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - NOT_FOUND
        - INSUFFICIENT_BALANCE
        - IDEMPOTENCY_CONFLICT
        - ORDER_NOT_CANCELLABLE
        - ORDER_RECONCILIATION_REQUIRED
        - RATE_LIMITED
        - INTERNAL_ERROR
      description: Stable identifier for the error category.
    AuthErrorCode:
      type: string
      enum:
        - UNAUTHORIZED
        - BAD_CONTENT_HASH
        - FORBIDDEN
        - RATE_LIMITED
        - AUTH_UNAVAILABLE
      description: Stable identifier for the error category.
    LimitlessOrderRequest:
      type: object
      properties:
        marketSlug:
          type: string
          minLength: 1
          description: Limitless market slug, exactly as the venue's market API names it.
          example: doge-up-or-down-daily-1787500800
        tokenId:
          type: string
          description: Limitless outcome conditional-token id (raw integer string).
          example: >-
            10999813436902295279687793687143205491693625423224337570276428722503253471600
        side:
          $ref: '#/components/schemas/LimitlessSide'
        type:
          type: string
          enum:
            - MARKET
            - LIMIT
          description: Use "limit" for GTC and "market" for FAK or FOK.
        amount:
          type: string
          description: >-
            Order size in dollars for an immediate BUY unless amountUnit is
            shares, and in shares otherwise.
          example: '2'
        timeInForce:
          oneOf:
            - $ref: '#/components/schemas/LimitlessFakTimeInForce'
            - $ref: '#/components/schemas/LimitlessFokTimeInForce'
            - $ref: '#/components/schemas/LimitlessGtcTimeInForce'
          discriminator:
            propertyName: type
            mapping:
              FAK: '#/components/schemas/LimitlessFakTimeInForce'
              FOK: '#/components/schemas/LimitlessFokTimeInForce'
              GTC: '#/components/schemas/LimitlessGtcTimeInForce'
          default:
            type: FAK
          description: Execution policy; defaults to FAK.
        stpPolicy:
          $ref: '#/components/schemas/LimitlessSelfTradePolicy'
      required:
        - marketSlug
        - tokenId
        - side
        - type
        - amount
      title: Order Request
    TradingOrderStatus:
      type: string
      enum:
        - PENDING
        - SUBMITTED
        - OPEN
        - FILLED
        - CANCELLED
        - REJECTED
      description: >-
        Order lifecycle status.


        | Status | Meaning |

        | --- | --- |

        | `PENDING` | Accepted, not yet sent to the venue. |

        | `SUBMITTED` | At the venue, outcome not yet known. Either not yet
        acknowledged, or an immediate-or-cancel order acknowledged but not yet
        settled. |

        | `OPEN` | Resting on the venue, and cancellable. |

        | `FILLED` | Fully filled. |

        | `CANCELLED` / `REJECTED` | Terminal. |
      example: OPEN
    LimitlessSide:
      type: string
      enum:
        - BUY
        - SELL
      description: Order direction.
      example: BUY
    LimitlessFakTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - FAK
        amountUnit:
          type: string
          enum:
            - usd
            - shares
          description: Explicit sizing unit for a FAK BUY; defaults to usd.
        maxFillPrice:
          type: string
          description: Optional signed per-share BUY ceiling from 0.001 to 0.999 inclusive.
        minFillPrice:
          type: string
          description: Optional signed per-share SELL floor from 0.001 to 0.999 inclusive.
      required:
        - type
      additionalProperties: false
      description: Fill immediately within the signed price bound and cancel the remainder.
      title: FillAndKill
    LimitlessFokTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - FOK
        maxFillPrice:
          type: string
          description: >-
            Optional per-share ceiling this order may fill at, from 0.001 to
            0.999 inclusive, in steps of 0.001. Accepted on a buy only. Without
            it a FOK fills at the book's price, which is the venue's own
            behaviour; with it the order is refused rather than placed when the
            market already sits above the ceiling. Unlike a FAK's ceiling, this
            one is not sent to the venue as a price: a fill-or-kill takes none
            here, so the ceiling is checked against the book before the order is
            placed and again against what it filled at.
          example: '0.55'
        minFillPrice:
          type: string
          description: >-
            Optional per-share floor this order may fill at, from 0.001 to 0.999
            inclusive, in steps of 0.001. Accepted on a FOK SELL only. Without
            it a FOK sell fills at the book's price, which is the venue's own
            behaviour; with it the order is refused rather than placed when the
            market already sits below the floor.
          example: '0.45'
      required:
        - type
      additionalProperties: false
      description: >-
        Fill or kill: fill in full immediately or cancel. A buy is sized in
        dollars and may cap its price with maxFillPrice; a sell is sized in
        outcome shares as a fixed-point decimal (up to 6 places) and may floor
        its price with minFillPrice. Both bounds are optional.
      title: FillOrKill
    LimitlessGtcTimeInForce:
      type: object
      properties:
        type:
          type: string
          enum:
            - GTC
        price:
          type: string
          description: >-
            Per-share price this order rests at, from 0.001 to 0.999 inclusive,
            in steps of 0.001. Required for GTC.
          example: '0.55'
        postOnly:
          type: boolean
          description: >-
            Reject this order instead of placing it if it would match
            immediately, so that it only ever rests on the book as a maker
            order. Defaults to false. Accepted on a resting order only, since an
            order meant to fill immediately cannot also refuse to.
      required:
        - type
        - price
      additionalProperties: false
      description: >-
        Good till cancelled: rest at price until filled or cancelled. Sized in
        outcome shares on both sides.
      title: GoodTillCancelled
    LimitlessSelfTradePolicy:
      type: string
      enum:
        - CANCEL_MAKER
        - CANCEL_TAKER
        - CANCEL_BOTH
      description: Self-trade policy within the shared wallet; defaults to CANCEL_MAKER.
      example: CANCEL_MAKER

````

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