curl --request DELETE \
--url https://api.ssi.com.vn/api/v3/trading/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-Signature: <x-signature>' \
--data '
{
"accountNo": "<string>",
"deviceId": "<string>",
"clientCancelId": "<string>",
"clientRequestId": "<string>",
"orderId": "<string>",
"userAgent": "<string>",
"ipAddress": "<string>"
}
'import requests
url = "https://api.ssi.com.vn/api/v3/trading/order"
payload = {
"accountNo": "<string>",
"deviceId": "<string>",
"clientCancelId": "<string>",
"clientRequestId": "<string>",
"orderId": "<string>",
"userAgent": "<string>",
"ipAddress": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"X-Signature": "<x-signature>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'Content-Type': '<content-type>',
'X-Signature': '<x-signature>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({
accountNo: '<string>',
deviceId: '<string>',
clientCancelId: '<string>',
clientRequestId: '<string>',
orderId: '<string>',
userAgent: '<string>',
ipAddress: '<string>'
})
};
fetch('https://api.ssi.com.vn/api/v3/trading/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ssi.com.vn/api/v3/trading/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'accountNo' => '<string>',
'deviceId' => '<string>',
'clientCancelId' => '<string>',
'clientRequestId' => '<string>',
'orderId' => '<string>',
'userAgent' => '<string>',
'ipAddress' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-Signature: <x-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ssi.com.vn/api/v3/trading/order"
payload := strings.NewReader("{\n \"accountNo\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"clientCancelId\": \"<string>\",\n \"clientRequestId\": \"<string>\",\n \"orderId\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"ipAddress\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.ssi.com.vn/api/v3/trading/order")
.header("Content-Type", "<content-type>")
.header("X-Signature", "<x-signature>")
.header("Authorization", "Bearer <token>")
.body("{\n \"accountNo\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"clientCancelId\": \"<string>\",\n \"clientRequestId\": \"<string>\",\n \"orderId\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"ipAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ssi.com.vn/api/v3/trading/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = '<content-type>'
request["X-Signature"] = '<x-signature>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"accountNo\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"clientCancelId\": \"<string>\",\n \"clientRequestId\": \"<string>\",\n \"orderId\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"ipAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"clientRequestId": "<string>",
"orderId": "<string>",
"orderStatus": "<string>",
"clientModifyId": "<string>",
"clientCancelId": "<string>"
}{
"code": "<string>",
"msg": "<string>"
}{
"code": "<string>",
"msg": "<string>"
}{
"code": "<string>",
"msg": "<string>"
}Hủy lệnh
Hủy lệnh hiện có.
curl --request DELETE \
--url https://api.ssi.com.vn/api/v3/trading/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-Signature: <x-signature>' \
--data '
{
"accountNo": "<string>",
"deviceId": "<string>",
"clientCancelId": "<string>",
"clientRequestId": "<string>",
"orderId": "<string>",
"userAgent": "<string>",
"ipAddress": "<string>"
}
'import requests
url = "https://api.ssi.com.vn/api/v3/trading/order"
payload = {
"accountNo": "<string>",
"deviceId": "<string>",
"clientCancelId": "<string>",
"clientRequestId": "<string>",
"orderId": "<string>",
"userAgent": "<string>",
"ipAddress": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"X-Signature": "<x-signature>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
'Content-Type': '<content-type>',
'X-Signature': '<x-signature>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({
accountNo: '<string>',
deviceId: '<string>',
clientCancelId: '<string>',
clientRequestId: '<string>',
orderId: '<string>',
userAgent: '<string>',
ipAddress: '<string>'
})
};
fetch('https://api.ssi.com.vn/api/v3/trading/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ssi.com.vn/api/v3/trading/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'accountNo' => '<string>',
'deviceId' => '<string>',
'clientCancelId' => '<string>',
'clientRequestId' => '<string>',
'orderId' => '<string>',
'userAgent' => '<string>',
'ipAddress' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-Signature: <x-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ssi.com.vn/api/v3/trading/order"
payload := strings.NewReader("{\n \"accountNo\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"clientCancelId\": \"<string>\",\n \"clientRequestId\": \"<string>\",\n \"orderId\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"ipAddress\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-Signature", "<x-signature>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.ssi.com.vn/api/v3/trading/order")
.header("Content-Type", "<content-type>")
.header("X-Signature", "<x-signature>")
.header("Authorization", "Bearer <token>")
.body("{\n \"accountNo\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"clientCancelId\": \"<string>\",\n \"clientRequestId\": \"<string>\",\n \"orderId\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"ipAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ssi.com.vn/api/v3/trading/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = '<content-type>'
request["X-Signature"] = '<x-signature>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"accountNo\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"clientCancelId\": \"<string>\",\n \"clientRequestId\": \"<string>\",\n \"orderId\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"ipAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"clientRequestId": "<string>",
"orderId": "<string>",
"orderStatus": "<string>",
"clientModifyId": "<string>",
"clientCancelId": "<string>"
}{
"code": "<string>",
"msg": "<string>"
}{
"code": "<string>",
"msg": "<string>"
}{
"code": "<string>",
"msg": "<string>"
}Ủy quyền
Access token lấy từ endpoint /api/v3/auth/token hoặc /api/v3/auth/refresh.
Tiêu đề
Định dạng nội dung request body. Chủ yếu là application/json.
Thông tin client gửi request.
Ngôn ngữ phản hồi mong muốn. Nếu không có header này, hệ thống sẽ mặc định là en
Chữ ký RSA + SHA256 để xác thực tính toàn vẹn của request. Input bao gồm SecretKey + JSON body.
"sha256=abc123..."
Nội dung
Số tài khoản giao dịch.
Định danh thiết bị thực hiện gửi yêu cầu hủy lệnh. Thông thường dùng MAC address hoặc IMEI của thiết bị.
Định danh hủy lệnh do client tạo ra, dùng để đối chiếu trong các phản hồi sau này. Trường này không bắt buộc nhưng nếu có thì nên đảm bảo tính duy nhất để tránh nhầm lẫn khi xử lý phản hồi. Khi để trống thì hệ thống sẽ tự sinh định danh hủy lệnh cho khách hàng và trả về response & streaming.
Định danh lệnh gốc do client tạo ra khi đặt lệnh. Khi để trống thì hệ thống sẽ không đối chiếu dựa trên định danh lệnh gốc mà sẽ dựa vào orderId để xác định lệnh cần hủy.
Định danh lệnh gốc sinh ra bởi hệ thống SSI. Đây là một trong hai trường (cùng với clientRequestId) được sử dụng để xác định lệnh cần hủy. Nếu cả hai trường đều có giá trị, hệ thống sẽ ưu tiên đối chiếu dựa trên clientRequestId. Nếu chỉ có orderId có giá trị thì hệ thống sẽ đối chiếu dựa trên orderId. Nếu cả hai trường đều không có giá trị thì yêu cầu hủy lệnh sẽ bị từ chối do thiếu thông tin xác định lệnh cần hủy.
Thông tin về trình duyệt hoặc ứng dụng gửi yêu cầu hủy lệnh.
Địa chỉ IP của thiết bị gửi yêu cầu hủy lệnh.