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

# Cancel one or more orders

> Cancel one or more orders



## OpenAPI

````yaml https://imx-openapiv3-mr-sandbox.s3.us-east-2.amazonaws.com/openapi.json post /v1/chains/{chain_name}/orders/cancel
openapi: 3.0.3
info:
  title: Immutable zkEVM API
  version: 1.0.0
  description: Immutable Multi Rollup API
  contact:
    name: Immutable API Support
    email: support@immutable.com
    url: https://support.immutable.com
servers:
  - url: https://api.sandbox.immutable.com
security: []
tags:
  - name: activities
    description: Activities Endpoints
    x-displayName: activities
  - name: chains
    description: Chains Endpoints
    x-displayName: chains
  - name: collections
    description: Collections Endpoints
    x-displayName: collections
  - name: nfts
    description: NFTs Endpoints
    x-displayName: nfts
  - name: nft owners
    description: NFT Owner Endpoints
    x-displayName: nft owners
  - name: metadata
    description: NFT Metadata Endpoints
    x-displayName: metadata
  - name: tokens
    description: ERC20 Token Endpoints
    x-displayName: tokens
  - name: demopage
    description: Temporary HTML endpoint for demo purposes
    x-displayName: demopage
  - name: verification
    x-displayName: verification
  - name: operatorallowlist
    x-displayName: operatorallowlist
  - name: crafting
    x-displayName: crafting
  - name: listings
    description: Listings Endpoints
    x-displayName: listings
  - name: orders
    x-displayName: orders
  - name: passport
    description: Passport operations
    x-displayName: passport
  - name: gamefi
    description: team gamefi
    x-displayName: gamefi
  - name: health
    x-displayName: health
  - name: passport profile
    description: Passport Profile endpoints
    x-displayName: passport profile
  - name: feed-items
    x-displayName: feed-items
  - name: assets
    x-displayName: assets
  - name: guardian
    description: Guardian endpoints
    x-displayName: guardian
  - name: pricing
    description: Pricing Endpoints
    x-displayName: pricing
  - name: metadata-search
    x-displayName: metadata-search
paths:
  /v1/chains/{chain_name}/orders/cancel:
    post:
      tags:
        - orders
      summary: Cancel one or more orders
      description: Cancel one or more orders
      operationId: CancelOrders
      parameters:
        - name: chain_name
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ChainName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelOrdersRequestBody'
      responses:
        '200':
          description: Orders cancellation response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrdersResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorisedRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '501':
          $ref: '#/components/responses/NotImplementedError'
components:
  schemas:
    ChainName:
      type: string
      description: The name of chain
      example: imtbl-zkevm-testnet
    CancelOrdersRequestBody:
      type: object
      properties:
        account_address:
          type: string
          description: Address of the user initiating the cancel request
          example: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
          pattern: ^0x[a-fA-F0-9]{40}$
        orders:
          type: array
          description: List of order ids proposed for cancellation
          items:
            type: string
            format: uuid
          uniqueItems: true
          minItems: 1
          maxItems: 20
        signature:
          type: string
          description: >-
            Signature generated by the user for the specific cancellation
            request
          example: '0x12345'
      required:
        - account_address
        - orders
        - signature
      example:
        account_address: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
        ids:
          - 018a8c71-d7e4-e303-a2ef-318871ef7756
          - 238a8c71-d7e4-e303-a2ef-318871ef7778
          - 458a8c71-d7e4-e303-a2ef-318871ef7790
        signature: 291
    CancelOrdersResult:
      type: object
      properties:
        result:
          $ref: '#/components/schemas/CancelOrdersResultData'
      required:
        - result
      example:
        result:
          successful_cancellations:
            - 018a8c71-d7e4-e303-a2ef-318871ef7756
            - 458a8c71-d7e4-e303-a2ef-318871ef7778
          pending_cancellations:
            - 238a8c71-d7e4-e303-a2ef-318871ef7778
            - 898a8c71-d7e4-e303-a2ef-318871ef7735
          failed_cancellations:
            - order: 458a8c71-d7e4-e303-a2ef-318871ef7790
              reason_code: FILLED
            - order: 338a8c71-d7e4-e303-a2ef-318871ef7342
              reason_code: FILLED
    CancelOrdersResultData:
      type: object
      properties:
        successful_cancellations:
          type: array
          description: Orders which were successfully cancelled
          items:
            type: string
          minItems: 0
          maxItems: 10
        pending_cancellations:
          type: array
          description: >-
            Orders which are marked for cancellation but the cancellation cannot
            be guaranteed
          items:
            type: string
          minItems: 0
          maxItems: 10
        failed_cancellations:
          type: array
          description: Orders which failed to be cancelled
          items:
            $ref: '#/components/schemas/FailedOrderCancellation'
          minItems: 0
          maxItems: 10
      required:
        - successful_cancellations
        - pending_cancellations
        - failed_cancellations
    APIError400:
      allOf:
        - $ref: '#/components/schemas/BasicAPIError'
        - type: object
          properties:
            code:
              type: string
              description: Error Code
              enum:
                - VALIDATION_ERROR
              example: VALIDATION_ERROR
            details:
              type: object
              nullable: true
              description: Additional details to help resolve the error
          required:
            - code
            - details
    APIError401:
      allOf:
        - $ref: '#/components/schemas/BasicAPIError'
        - type: object
          properties:
            code:
              type: string
              description: Error Code
              enum:
                - UNAUTHORISED_REQUEST
              example: UNAUTHORISED_REQUEST
            details:
              type: object
              nullable: true
              description: Additional details to help resolve the error
          required:
            - code
            - details
    APIError404:
      allOf:
        - $ref: '#/components/schemas/BasicAPIError'
        - type: object
          properties:
            code:
              type: string
              description: Error Code
              enum:
                - RESOURCE_NOT_FOUND
              example: RESOURCE_NOT_FOUND
            details:
              type: object
              nullable: true
              description: Additional details to help resolve the error
          required:
            - code
            - details
    APIError429:
      allOf:
        - $ref: '#/components/schemas/BasicAPIError'
        - type: object
          properties:
            code:
              type: string
              description: Error Code
              enum:
                - TOO_MANY_REQUESTS_ERROR
              example: TOO_MANY_REQUESTS_ERROR
            details:
              type: object
              nullable: true
              description: Additional details to help resolve the error
          required:
            - code
            - details
    APIError500:
      allOf:
        - $ref: '#/components/schemas/BasicAPIError'
        - type: object
          properties:
            code:
              type: string
              description: Error Code
              enum:
                - INTERNAL_SERVER_ERROR
              example: INTERNAL_SERVER_ERROR
            details:
              type: object
              nullable: true
              description: Additional details to help resolve the error
          required:
            - code
            - details
    APIError501:
      allOf:
        - $ref: '#/components/schemas/BasicAPIError'
        - type: object
          properties:
            code:
              type: string
              description: Error Code
              enum:
                - NOT_IMPLEMENTED_ERROR
              example: NOT_IMPLEMENTED_ERROR
            details:
              type: object
              nullable: true
              description: Additional details to help resolve the error
          required:
            - code
            - details
    FailedOrderCancellation:
      type: object
      properties:
        order:
          type: string
          description: ID of the order which failed to be cancelled
          example: 7df3e99e-f7b3-459c-bef6-ffb66a18bb59
        reason_code:
          type: string
          enum:
            - FILLED
          description: Reason code indicating why the order failed to be cancelled
          example: FILLED
      required:
        - order
        - reason_code
    BasicAPIError:
      type: object
      properties:
        message:
          type: string
          description: Error Message
          example: all fields must be provided
        link:
          type: string
          description: Link to IMX documentation that can help resolve this error
          example: https://docs.x.immutable.com/reference/#/
        trace_id:
          type: string
          description: Trace ID of the initial request
          example: e47634b79a5cd6894ddc9639ec4aad26
      required:
        - message
        - link
        - trace_id
  responses:
    BadRequest:
      description: Bad Request (400)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError400'
    UnauthorisedRequest:
      description: Unauthorised Request (401)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError401'
    NotFound:
      description: The specified resource was not found (404)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError404'
    TooManyRequests:
      description: Too Many Requests (429)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError429'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
    InternalServerError:
      description: Internal Server Error (500)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError500'
    NotImplementedError:
      description: Not Implemented Error (501)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError501'
  headers:
    RetryAfter:
      description: The number of seconds until the next request can be made.
      schema:
        type: string

````