Conditional Orders

fco-order-place

Place a new conditional order. Supports conditional order types including stop, stop_limit, gtd, bullbear, oco, trailing_stop, trailing_stop_limit.

📄 See also: Conditional Order Reference

POST
/api/v3/trading/fco/order

Authorization

Bearer
AuthorizationBearer <token>

Enter the JWT token in the format Bearer <token>.

In: header

Header Parameters

Content-Typestringrequired

The content format of the request body. Mainly application/json.

User-Agentstringoptional

Information about the client sending the request.

Accept-Languagestringoptional

The desired response language. If this header is not provided, the system defaults to en.

X-Signaturestringrequired

An RSA + SHA256 signature used to verify the integrity of the request. The input consists of the SecretKey + JSON body.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

bodyobjectrequired
accountNostringrequired

The order-placing account (cash or derivatives account).

deviceIdstringrequired

Identifier of the device sending the request. Typically the device's MAC address or IMEI.

userAgentstring | nulloptional

Information about the browser or application sending the request.

clientRequestIdstring | nulloptional

An order identifier generated by the client, used to reconcile against subsequent responses. This field is not required, but if provided it should be unique to avoid confusion when processing responses. When left empty, the system will generate an order identifier for the customer and return it in the response and streaming.

ipAddressstringoptional

The IP address of the device sending the request.

fromstring | nulloptional

The start date of the conditional order's validity, in `YYYY/MM/DD hh:mm:ss` format. Defaults to the time the order is created.

tostring | nulloptional

The end date of the conditional order's validity, in `YYYY/MM/DD hh:mm:ss` format. Defaults to 24 hours from creation, up to a maximum of 31 days from the start date.

codestring | nulloptional

The OTP verification code or PIN used to authenticate the transaction (required if the token has not been verified together with an OTP).

symbolstring | nullrequired

The securities symbol or derivatives contract code for which to place the conditional order.

sidestring | nullrequired

The buy or sell side of the order. B (Buy) or S (Sell).

typestring | nullrequired

The conditional order type.

pricestring | nullrequired

The order price. Supports a numeric price or a special order type (MP, MOK, MTL).

quantityintegerrequired

The quantity to order.

priceSlipnumberoptional

The allowed price slippage range when executing the order.

stopPricenumberoptional

The stop-loss price. When the market price reaches this level, the order is triggered.

activePricenumberoptional

The initial activation price of the conditional order.

trailingAmountnumberoptional

The trailing price range. Used for the trailing_stop and trailing_stop_limit order types.

tpActivePricenumberoptional

The activation price for the take profit order (Take Profit). When the market price reaches this level, the take profit order is triggered.

slActivePricenumberoptional

The activation price for the stop loss order (Stop Loss). When the market price reaches this level, the stop loss order is triggered.

tpPricestring | nulloptional

The take profit price. Supports a numeric price or a special order type (MP, MOK, MTL).

slPricestring | nulloptional

The stop loss price. Supports a numeric price or a special order type (MP, MOK, MTL).

tpSlipnumberoptional

The take profit price slippage margin.

slSlipnumberoptional

The stop loss price slippage margin.

operatorstring | nulloptional

The price comparison operator used to trigger the conditional order.

Response Headers

X-RATELIMIT-LIMITstringoptional

The request limit within the period.

X-RATELIMIT-REMAININGstringoptional

The number of requests remaining in the current period.

X-RATELIMIT-RESETstringoptional

The time at which the request limit resets.

Response Body

application/json

application/json

curl -X POST "https://api.ssi.com.vn/api/v3/trading/fco/order" \  -H "Content-Type: application/json" \  -H "X-Signature: sha256=abc123..." \  -H "Content-Type: application/json" \  -d '{    "accountNo": "string",    "deviceId": "string",    "symbol": "string",    "side": "B",    "type": "stop_limit",    "price": "string",    "quantity": 0  }'

Success

{
  "fcoId": "string"
}

Invalid request.

{
  "code": "400",
  "msg": "Invalid request"
}