trade-order-batch-cancel
Cancel multiple orders in a single request (Batch Order).
The same general rules as batch order placement apply (up to 50 orders, all-or-nothing validation, 30-second replay window, idempotency by batchRequestId, signature over the entire body). Each order in orders follows the same rules as the single-order API trade-order-cancel (the order is identified by clientRequestId or orderId).
Required scope: trading:order:delete.
Authorization
Bearer Enter the JWT token in the format Bearer <token>.
In: header
Header Parameters
The format of the request body content. Primarily application/json.
Information about the client sending the request.
The desired response language. If this header is absent, the system will default to en
The HMAC-SHA256 signature used to verify the integrity of the request.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Batch identifier created by the client. Must be unique per API Key and per action (place/cancel) within a day. Used as the idempotency key.
The time the client created the batch, in epoch milliseconds (UTC). Must be within 30 seconds of server time.
List of orders to cancel, up to 50. Each element has the same structure as the single-order cancellation request.
An order-cancellation identifier created by the client, used for reconciliation in subsequent responses. This field is optional, but if provided it should be unique to avoid confusion when processing responses. When left empty, the system will automatically generate an order-cancellation identifier for the customer and return it in the response & streaming.
The original order identifier created by the client when placing the order. When left empty, the system will not reconcile based on the original order identifier but will instead use `orderId` to determine the order to cancel.
The original order identifier generated by the SSI system. This is one of two fields (together with `clientRequestId`) used to identify the order to cancel. If both fields have values, the system will prioritize reconciliation based on `clientRequestId`. If only `orderId` has a value, the system will reconcile based on `orderId`. If neither field has a value, the cancellation request will be rejected due to insufficient information to identify the order to cancel.
The trading account number.
The identifier of the device sending the order-cancellation request. Typically the device's MAC address or IMEI.
Information about the browser or application sending the order-cancellation request.
The IP address of the device sending the order-cancellation request.
Response Headers
The request limit within the cycle.
The number of requests remaining in the current cycle.
The time at which the request limit resets.
Response Body
application/json
application/json
curl -X DELETE "https://api.ssi.com.vn/api/v3/trading/order/batch" \ -H "Content-Type: application/json" \ -H "X-Signature: sha256=abc123..." \ -H "Content-Type: application/json" \ -d '{ "batchRequestId": "string", "batchRequestTime": 1760400000000, "orders": [ { "accountNo": "string", "deviceId": "string" } ] }'The request is valid and has been processed. The outcome of each order is in results.
{
"batchRequestId": "string",
"results": [
{
"clientRequestId": "string",
"clientCancelId": "string",
"orderId": "string",
"orderStatus": "string",
"success": true,
"errorCode": "string",
"errorMessage": "string"
}
]
}Invalid request.
{
"code": "400",
"msg": "Invalid request"
}trade-order-batch-placePOST
Place multiple new orders in a single request (Batch Order). **General rules** - Up to **50 orders** per request. Orders may belong to different accounts, but every account must be in the list of accounts granted to the API Key. - Validation is **all-or-nothing**: if any order in the batch is invalid, the entire request is rejected (HTTP 400) and no order is executed. - Once validation passes, each order is processed **independently**. An order rejected during processing (for example, insufficient buying power) does not affect the others; the outcome of each order is returned in `results` (`success`, `errorCode`, `errorMessage`). - **Replay protection**: `batchRequestTime` (epoch milliseconds, UTC) must be within **30 seconds** of server time. - **Idempotency**: `batchRequestId` must be unique per API Key and per action (place/cancel) within a day. Resending the same `batchRequestId` is rejected as a duplicate request. - The `X-Signature` is computed over the **entire request body** (including `batchRequestId`, `batchRequestTime` and `orders`). - Each order in `orders` follows the same rules as the single-order API `trade-order-place`. **Required scope:** `trading:order:post`.
trade-positionGET
Retrieve position information for an account.