# Cancel order Begins the cancellation process of an existing active order from the exchange. N.B. it is still possible to receive trades on the order that is being canceled. Endpoint: DELETE /api/v1/orders/{ref_id} Version: v1.0.3 Security: HMAC ## Header parameters: - `x-truex-auth-userid` (string, required) Client identifier. - `x-truex-auth-timestamp` (string, required) Timestamp when request was made in seconds since epoch. - `x-truex-auth-token` (string, required) The UUID affiliated with the HMAC key. - `x-truex-auth-signature` (string, required) The computed HMAC signature. ## Path parameters: - `ref_id` (string, required) ID of order to cancel. ## Query parameters: - `id_type` (string) Type of ID the ref_id is, must be either 'client' or 'exchange'. If omitted will default to 'exchange' Enum: "client", "exchange" ## Response 200 fields (application/json): - `id` (string) Example: "799477895858487977" - `status` (string) The current status of the order. * Order has been created, but not sent yet. * Order has been sent, but not confirmed by the exchange or downstream process. * An order setting or market condition prevents the order from getting processed. * The order was accepted by the system and open to trading (order and market conditions permitting). * The entire order traded. * Indicates a cancel request was received and being processed. * The order was canceled from a cancel request, order conditions, or market conditions. * Indicates a modification request was received and being processed. Enum: "INITIALIZED", "NEW_PENDING", "REJECTED", "ACTIVE", "FILLED", "CANCEL_PENDING", "CANCELED", "MODIFY_PENDING" - `order_info` (object) - `order_info.msg_id` (string) ID of last message to act upon the order. Example: "799477895858487977" - `order_info.parent_id` (string) ID of the application creating the order, may be zero. Example: "432351810263056385" - `order_info.client_id` (string, required) The client ID the order will be entered on behalf of. Example: "78901949710204932" - `order_info.instrument_id` (string, required) The ID of the instrument the order will transact in. Example: "78901949723181070" - `order_info.qty` (string, required) The amount of base asset the order is requesting to tranasct. Example: "0.00145" - `order_info.price` (string, required) The highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders. Example: "111067" - `order_info.flags` (array) General order flags that can be combined and used together. * Applicable to market orders only. When enabled, the exchange calculates a price for the market order that is more aggressive than the current best bid or offer. This is useful when prioritizing liquidity capture over minimizing price slippage. Enum: "USE_AGGRESSIVE_PRICING" - `order_info.side` (string, required) Side of order, can be or * Provide trader's quote asset to acquire the base asset. * Provide trader's base asset to acquire the quote asset. Enum: "BUY", "SELL" - `order_info.type` (string, required) Type of order, can be , . * A specified limit price sets the maximum amount in quote currency units that the order will exchange to acquire the base currency. * The order uses the TrueX market price at time of order entry plus/minus (for buy/sell respectively) the max price allowed by the price band risk limits for the instrument. Enum: "LIMIT", "MARKET" - `order_info.tif` (string) The "Time In Force" (TIF) of an order indicates how long the order will remain active before being canceled, can be , . * (Good-Till-Cancel) Order remains active for up to 30 days from the time of entry. * (Immediate-Or-Cancel) Order will execute as much of the order as possible up to the requested price, provided there are existing orders that match or improve upon the price. An order will cancel any unfilled quantity back to the requestor. If no matching orders are found, the order will be canceled immediately. If the TIF is omitted, the order will default to . Enum: "GTC", "IOC" - `order_info.exec_inst_flags` (array) Execution specific instructions that can be combined and used together. Requests that the order either fully executes or cancel back to user with nothing done. All or none (AON) is only valid on market orders. Enum: "ALO", "AON" - `order_info.hold_fee_rate` (string) The amount of fee asset being held by the order. This is not necessarily the fee charge associated with the order. Example: "0.002" - `order_info.stp` (string) Order level self trade protection instruction. * Order level self trade protections are in an invalid state and may result in order rejection. * No self trade protections are enabled for this order. * This order will be canceled in the result of a self trade. * This order and the resting order will both be canceled in the result of a self trade. Enum: "INVALID", "NONE", "CANCEL_AGGRESSIVE", "CANCEL_BOTH" - `modify_info` (object) - `modify_info.client_id` (string, required) The client ID the modification will be entered on behalf of. Example: "0" - `modify_info.prev_modify` (string) ID of previous modify to act upon the order. Example: "0" - `modify_info.new_qty` (string, required) The new amount of base asset the order is requesting to tranasct. Example: "0" - `modify_info.new_price` (string, required) The new highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders. Example: "0" - `modify_info.new_type` (string) orders may be converted to orders. The new order will immediately execute against the resting side of the order book providing there is available liquidity on the contra side of the request. Enum: "MARKET" - `external_id` (string) A unique identifier created by the client. Must be in one the follower formats: * version 4 in its human readable form, with hypens, and in lowercase. * character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (\_), period (.), and tilde (~). Example: "EXT-ORDER-123" - `ref_external_id` (string) A unique identifier created by the client. Must be in one the follower formats: * version 4 in its human readable form, with hypens, and in lowercase. * character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (\_), period (.), and tilde (~). Example: "REF-EXT-ORDER-123" - `pending_qty` (string) Order quantity that has been acknowledge by the exchange but is not yet trading. Example: "0" - `leaves_qty` (string) Order quantity that is currently active in the market. Example: "0.00145" - `exeuted_qty` (string) Amount of quantity currently executed. Example: "0.00239" - `executed_vwap` (string) Volume weighted average price calculation for all executions on the order. Example: "111050.5" ## Response 400 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 401 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 403 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 404 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 408 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 415 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 500 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC). ## Response 503 fields (application/problem+json): - `type` (string, required) A URI reference that identifies the problem type. Example: "about:blank" - `title` (string, required) A short, human-readable summary of the problem type. Example: "An Error Occured" - `status` (integer, required) The HTTP status code generated by the origin server. Example: 400 - `detail` (string) A human-readable explanation specific to this occurrence of the problem. Example: "A more detailed sentence about the error" - `instance` (string) A URI reference that identifies the specific occurrence of the problem. Example: "/api/v1/endpoint" - `extensions` (object) A map for extension members (custom fields not defined by the RFC).