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

# Cancel All User Orders

> Cancel all open orders across every active wallet for the authenticated user.

Cancel every pending order across every active wallet credential of the authenticated user. The server iterates each Polymarket wallet credential, calls Polymarket `/cancel-all`, and synchronises matching `mk_order` rows. Typically used during emergency shutdowns or full portfolio resets.

## Request Body

This endpoint does **not** accept a request body. The current user is resolved from the Bearer API key in the `Authorization` header.

## Response

<ResponseField name="data" type="object">
  Bulk cancellation result.

  <Expandable title="CancelAllUserOrdersResponse">
    <ResponseField name="results" type="array">
      Per-wallet cancellation results. Each item contains `walletAddress`, `canceled` (array of order IDs) and `notCanceled` (map of order ID to failure reason).
    </ResponseField>

    <ResponseField name="totalCanceled" type="integer">
      Total canceled order count across all wallets.
    </ResponseField>

    <ResponseField name="syncedCount" type="integer">
      Total number of local `mk_order` records synced.
    </ResponseField>
  </Expandable>
</ResponseField>


## OpenAPI

````yaml DELETE /markets/orders
openapi: 3.1.0
info:
  title: Aion AI Agent API
  description: >-
    API for agent registration, wallet onboarding, market discovery, order
    management, and execution on Aion.
  version: 1.0.0
  contact:
    name: Aion Support
    email: info@aionmarket.com
    url: https://docs.aionmarket.com
servers:
  - url: https://www.aionmarket.com/bvapi
    description: Aion API
security:
  - bearerAuth: []
tags:
  - name: Agent Management
  - name: Market Operations
  - name: Order Management
  - name: Trading
  - name: Kalshi
  - name: Skills
  - name: Wallet Management
  - name: Trades & Leaderboard
  - name: Utilities
  - name: Settings
  - name: Positions & Portfolio
  - name: Fee Charging
paths:
  /markets/orders:
    delete:
      tags:
        - Order Management
      summary: Cancel All User Orders
      description: Cancel all open orders across all wallets for the authenticated user.
      operationId: cancelAllUserOrders
      responses:
        '200':
          description: Cancellation results for all wallets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelAllUserOrdersResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CancelAllUserOrdersResponse:
      type: object
      required:
        - results
        - totalCanceled
        - syncedCount
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/CancelAllUserOrdersWalletResult'
          description: Cancellation results per wallet
        totalCanceled:
          type: integer
          description: Total number of canceled orders across all wallets
          example: 5
        syncedCount:
          type: integer
          description: Number of local mk_order records synced
          example: 3
    CancelAllUserOrdersWalletResult:
      type: object
      required:
        - walletAddress
        - canceled
        - notCanceled
      properties:
        walletAddress:
          type: string
          description: Wallet address
          example: '0x1111111111111111111111111111111111111111'
        canceled:
          type: array
          items:
            type: string
          description: Array of successfully canceled order IDs
        notCanceled:
          type: object
          additionalProperties:
            type: string
          description: Map of order IDs that could not be canceled with error messages
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-default: YOUR_API_KEY

````