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

# wallet/marketcancelorder | TRON

> TRON API method that creates a transaction to cancel an existing market order on the TRON DEX. wallet/marketcancelorder on TRON via Chainstack.

TRON API method that creates a transaction to cancel an existing market order on the TRON DEX. This allows users to withdraw their unfilled buy or sell orders from the order book.

## Parameters

* `owner_address` — hexadecimal address of the account that created the order
* `order_id` — unique identifier of the market order to cancel (as hexadecimal string)

## Response

* `visible` — boolean indicating whether addresses are in visible format
* `txID` — unique transaction ID for the order cancellation transaction
* `raw_data` — raw transaction data containing:
  * `contract` — array with market order cancellation contract details
  * `ref_block_bytes` — reference block bytes for transaction validation
  * `ref_block_hash` — hash of the reference block
  * `expiration` — transaction expiration timestamp
  * `timestamp` — transaction creation timestamp
* `raw_data_hex` — complete transaction data encoded in hexadecimal format

## Use case

The `wallet/marketcancelorder` method is used for:

* Canceling orders that are no longer needed or desired.
* Withdrawing funds locked in unfilled orders back to the account balance.
* Adjusting trading strategies by removing stale or mispriced orders.
* Managing order book exposure and market position.
* Implementing automated order management systems.

<Warning>
  You can only cancel orders that you created and that are still active. Once an order is fully filled or already canceled, it cannot be canceled again. The locked tokens will be returned to your account balance upon successful cancellation.
</Warning>


## OpenAPI

````yaml openapi/tron_node_api/marketcancelorder.json post /95e61622bf6a8af293978377718e3b77/wallet/marketcancelorder
openapi: 3.0.0
info:
  title: wallet/marketcancelorder TRON API
  version: 1.0.0
  description: Cancel a market order
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/marketcancelorder:
    post:
      tags:
        - Market and DEX
      summary: wallet/marketcancelorder
      operationId: marketCancelOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                owner_address:
                  type: string
                  description: Account address that created the order
                order_id:
                  type: string
                  description: >-
                    Unique identifier of the order to cancel (hex string, no 0x
                    prefix)
              required:
                - owner_address
                - order_id
              example:
                owner_address: 41b487cdb2d8dc7b2a8e5e7e7b4e3e8b8b8b8b8b
                order_id: 1234567890abcdef1234567890abcdef12345678
      responses:
        '200':
          description: Order cancellation transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  visible:
                    type: boolean
                    description: Whether addresses are in visible format
                  txID:
                    type: string
                    description: Transaction ID for order cancellation
                  raw_data:
                    type: object
                    properties:
                      contract:
                        type: array
                        description: Contract details for order cancellation
                      ref_block_bytes:
                        type: string
                        description: Reference block bytes
                      ref_block_hash:
                        type: string
                        description: Reference block hash
                      expiration:
                        type: number
                        description: Transaction expiration timestamp
                      timestamp:
                        type: number
                        description: Transaction creation timestamp
                  raw_data_hex:
                    type: string
                    description: Raw transaction data in hex format

````