> This page is for Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://okx-demo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://okx-demo.ferndocs.com/_mcp/server.

# Transaction Timeouts

Orders may not be processed in time due to network delay or busy OKX servers. You can configure the expiry time of the request using `expTime` if you want the order request to be discarded after a specific time.

If `expTime` is specified in the requests for Place (multiple) orders or Amend (multiple) orders, the request will not be processed if the current system time of the server is after the `expTime`.

### REST API

Set the following parameters in the request header

| Parameter | Type   | Required | Description                                                                             |
| --------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| expTime   | String | No       | Request effective deadline. Unix timestamp format in milliseconds, e.g. `1597026383085` |

The following endpoints are supported:

* [Place order](https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order)
* [Place multiple orders](https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-multiple-orders)
* [Amend order](https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-amend-order)
* [Amend multiple orders](https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-amend-multiple-orders)
* [POST / Place sub order](https://www.okx.com/docs-v5/en/#order-book-trading-signal-bot-trading-post-place-sub-order) under signal bot trading

> Request Example

```plaintext
curl -X 'POST' \
  'https://openapi.okx.com/api/v5/trade/order' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'OK-ACCESS-KEY: *****' \
  -H 'OK-ACCESS-SIGN: *****'' \
  -H 'OK-ACCESS-TIMESTAMP: *****'' \
  -H 'OK-ACCESS-PASSPHRASE: *****'' \
  -H 'expTime: 1597026383085' \   // request effective deadline
  -d '{
  "instId": "BTC-USDT",
  "tdMode": "cash",
  "side": "buy",
  "ordType": "limit",
  "px": "1000",
  "sz": "0.01"
}'
```

### WebSocket

The following parameters are set in the request

| Parameter | Type   | Required | Description                                                                             |
| --------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| expTime   | String | No       | Request effective deadline. Unix timestamp format in milliseconds, e.g. `1597026383085` |

The following endpoints are supported:

* [Place order](https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-place-order)
* [Place multiple orders](https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-place-multiple-orders)
* [Amend order](https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-amend-order)
* [Amend multiple orders](https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-amend-multiple-orders)

> Request Example

```plaintext
{
    "id": "1512",
    "op": "order",
    "expTime":"1597026383085",  // request effective deadline
    "args": [{
        "side": "buy",
        "instId": "BTC-USDT",
        "tdMode": "isolated",
        "ordType": "market",
        "sz": "100"
    }]
}
```