> For the complete documentation index, see [llms.txt](https://rwaperp-1.gitbook.io/rwaperp-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rwaperp-1.gitbook.io/rwaperp-docs/rwa-perp-b2b-api/rest-api-reference/trading-and-orders/post-v1-algo-order.md).

# post v1 algo order

`POST /v1/algo/order`

**Authentication:** RWA

**Rate limit:** 1 request per second

## Description

Place maker/taker order that requires an additional trigger for order execution such as stop orders.

`STOP` type order bahavior: an order to buy or sell at the market/limit price once the asset has traded at or through a specified price (the "stop price"). If the asset reaches the stop price, the order becomes a market order and is filled at the next available market price.

To place `Positional TP/SL` order, the input fields is 2 layer and includes an array of the objects named childOrder. The take-profit or stop-loss order should be the objects in the array. For the sub-order in childOrder, please input `CLOSE_POSITION` as type, and `TAKE_PROFIT` or `STOP_LOSS` in algoType field.

To place `Trailing Stop` order, please use `TRAILING_STOP` as algoType and `MARKET` as type. Please also input your trailing rate setting in callbackRate field.

Sample request can be found in the the algo order examples.

{% hint style="info" %}
This endpoint requires trading scope in API key.
{% endhint %}

## Parameters

| Name            | Location | Type   | Required | Description                                                                                 | Example |
| --------------- | -------- | ------ | -------- | ------------------------------------------------------------------------------------------- | ------- |
| `x-recv-window` | header   | number | No       | Use this parameter to control the timeout threshold for placing order, unit in milliseconds | `20`    |

## Request body

| Field                                              | Type                 | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------------------- | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `symbol`                                           | string               | Yes      | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `algo_type`                                        | string               | Yes      | `STOP`/`TP_SL`/`POSITIONAL_TP_SL`/`BRACKET`/`BRACKET + TP_SL`/`TRAILING_STOP`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `client_order_id`                                  | string               | No       | 36 length, accepts hyphen but cannot be the first character, default: null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `type`                                             | string               | Yes      | `LIMIT` / `MARKET`, required if `algo_type` = `STOP`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `price`                                            | number               | No       | Optional for `TP_SL` and `POSTIONAL_TP_SL`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `quantity`                                         | number               | Yes      | For `MARKET`/`ASK`/`BID` order, if order\_amount is given, it is not required. Not required if type is `POSITIONAL_TP_SL`.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `trigger_price_type`                               | string               | No       | Only `MARK_PRICE` is available for now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `trigger_price`                                    | number               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `reduce_only`                                      | boolean              | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `visible_quantity`                                 | boolean              | No       | Default false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `side`                                             | string               | Yes      | `SELL`/`BUY`, required if `STOP` type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `order_tag`                                        | string               | No       | Optional tag for the order. Supports two formats: - Referral code: plain string (e.g., `REFERRAL2026`) - overrides referral relationship - Custom trading fee: `enum:<owning_broker_id>:<enum_id>` (e.g., `enum:broker_b:GRID_PRO`) - adds the custom fee and preserves the existing referral relationship New custom-fee-tagged orders must use the current three-segment format. Legacy `enum:<enum_id>` tags are supported only on orders accepted before cutover. Maximum length: 128 characters. Cannot be modified after order placement. Example: `enum:broker_b:GRID_PRO` |
| `child_orders`                                     | array                | Yes      | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].symbol`                            | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].algo_type`                         | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders`                      | array                | No       | Array of `CreateAlgoOrderChildRequest`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `child_orders[].child_orders[].symbol`             | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].algo_type`          | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].side`               | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].type`               | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].trigger_price`      | number               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].price`              | number               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].reduce_only`        | boolean              | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `child_orders[].child_orders[].trigger_price_type` | string               | No       | —                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `activatedPrice`                                   | string               | No       | Activated price for algoType=`TRAILING_STOP`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `callbackRate`                                     | string               | No       | Callback rate, only for algoType=`TRAILING_STOP`, i.e. the value = 0.1 represent to 10%.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `callbackValue`                                    | string               | No       | Callback value, only for algoType=`TRAILING_STOP`, i.e. the value = 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `margin_mode`                                      | `CROSS` / `ISOLATED` | No       | Margin mode for the order. Default: the symbol's current default margin mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

## Responses

### HTTP 200

OK

| Field                  | Type    | Required | Description                                                   |
| ---------------------- | ------- | -------- | ------------------------------------------------------------- |
| `success`              | boolean | Yes      | Indicates whether the request was successful. Example: `True` |
| `timestamp`            | integer | No       | Server timestamp in milliseconds. Example: `1702989203989`    |
| `data`                 | object  | Yes      | —                                                             |
| `data.order_id`        | number  | Yes      | Example: `13`                                                 |
| `data.client_order_id` | string  | Yes      | Example: `testclientid`                                       |
| `data.algo_type`       | string  | Yes      | Example: `STOP`                                               |
| `data.quantity`        | number  | Yes      | Example: `100.12`                                             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rwaperp-1.gitbook.io/rwaperp-docs/rwa-perp-b2b-api/rest-api-reference/trading-and-orders/post-v1-algo-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
