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

# Cancel All Orders

> Cancels your resting Polymarket orders in one request, optionally narrowed to one outcome or one market.



## OpenAPI

````yaml /openapi/v1.json delete /v1/polymarket/orders
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/polymarket/orders:
    delete:
      tags:
        - Polymarket
      summary: Cancel All Orders
      description: >-
        Cancels your resting Polymarket orders in one request, optionally
        narrowed to one outcome or one market.
      operationId: cancelPolymarketOrders
      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.
        - schema:
            type: string
            minLength: 1
            description: Cancel only orders on this outcome token.
            example: >-
              71321045679252212594626385532706912750332728571942532289631379312455583992563
          required: false
          name: tokenId
          in: query
        - schema:
            type: string
            minLength: 1
            description: >-
              Cancel only orders on this market, both outcomes in one call. An
              order whose market cannot be resolved is reported
              MARKET_UNRESOLVED rather than assumed out of scope.
          required: false
          name: conditionId
          in: query
      responses:
        '200':
          description: Cancel request processed; read the response for per-order outcomes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelPolymarketOrdersResponse'
        '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:
    CancelPolymarketOrdersResponse:
      type: object
      properties:
        cancelled:
          type: array
          items:
            type: string
            format: uuid
            description: Issued order id.
            example: 3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d
          description: Orders Polymarket confirmed it removed. These are now terminal.
        notCancelled:
          type: array
          items:
            $ref: '#/components/schemas/PolymarketUncancelledOrder'
          description: >-
            Orders that were not cancelled, one entry each, with the reason.
            Most are still resting; ALREADY_COMPLETED means the order filled
            instead. An empty array alongside an empty `cancelled` means nothing
            was resting.
      required:
        - cancelled
        - notCancelled
    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
    PolymarketUncancelledOrder:
      type: object
      properties:
        orderId:
          type: string
          format: uuid
          description: Issued order id.
          example: 3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d
        code:
          $ref: '#/components/schemas/PolymarketCancelFailureCode'
        message:
          type: string
          nullable: true
          description: >-
            Polymarket's own words about this order, when it stated a reason.
            Null otherwise.
      required:
        - orderId
        - code
        - message
    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.
    PolymarketCancelFailureCode:
      type: string
      enum:
        - STILL_SUBMITTING
        - ALREADY_COMPLETED
        - VENUE_DECLINED
        - MARKET_UNRESOLVED
        - UNCONFIRMED
      description: >-
        Why an order was not cancelled. STILL_SUBMITTING: the order is being
        placed and has no venue handle yet, so retry shortly. ALREADY_COMPLETED:
        it filled instead of cancelling. VENUE_DECLINED: Polymarket refused,
        usually because the order matched first; see message. MARKET_UNRESOLVED:
        the order's market is not known here, so a market-scoped cancel could
        not decide whether it was in scope; cancel it by id or repeat without a
        market. UNCONFIRMED: the cancel could not be confirmed, so the order may
        or may not still rest; retry.

````

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