curl --request POST \
--url https://services.entrade.com.vn/entrade-api/derivative/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bankMarginPortfolioId": 123,
"investorId": 123,
"symbol": "<string>",
"price": 123,
"orderType": "<string>",
"side": "<string>",
"quantity": 123
}
'import requests
url = "https://services.entrade.com.vn/entrade-api/derivative/orders"
payload = {
"bankMarginPortfolioId": 123,
"investorId": 123,
"symbol": "<string>",
"price": 123,
"orderType": "<string>",
"side": "<string>",
"quantity": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bankMarginPortfolioId: 123,
investorId: 123,
symbol: '<string>',
price: 123,
orderType: '<string>',
side: '<string>',
quantity: 123
})
};
fetch('https://services.entrade.com.vn/entrade-api/derivative/orders', 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://services.entrade.com.vn/entrade-api/derivative/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankMarginPortfolioId' => 123,
'investorId' => 123,
'symbol' => '<string>',
'price' => 123,
'orderType' => '<string>',
'side' => '<string>',
'quantity' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://services.entrade.com.vn/entrade-api/derivative/orders"
payload := strings.NewReader("{\n \"bankMarginPortfolioId\": 123,\n \"investorId\": 123,\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"orderType\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://services.entrade.com.vn/entrade-api/derivative/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bankMarginPortfolioId\": 123,\n \"investorId\": 123,\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"orderType\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.entrade.com.vn/entrade-api/derivative/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bankMarginPortfolioId\": 123,\n \"investorId\": 123,\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"orderType\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"side": "<string>",
"investorId": 123,
"investorAccountId": 123,
"bankId": 123,
"bankAccountId": 123,
"symbol": "<string>",
"price": 123,
"quantity": 123,
"orderType": "<string>",
"orderStatus": "<string>",
"fillQuantity": 123,
"lastQuantity": 123,
"lastPrice": 123,
"averagePrice": 123,
"createdDate": "<string>",
"modifiedDate": "<string>",
"bankMarginPortfolioId": 123,
"dealId": 123,
"tradingFee": 123,
"tradingTax": 123,
"orderSecure": 123,
"priceSecure": 123,
"marginRate": 123,
"quantitySecure": 123,
"leavesQuantity": 123,
"externalId": "<string>",
"error": "<string>",
"maker": "<string>",
"version": 123,
"type": "<string>",
"fillValue": 123
}{
"code": "<string>",
"message": "<string>",
"status": 123
}{
"code": "<string>",
"message": "<string>",
"status": 123
}Đặt lệnh Phái Sinh
Đặt lệnh Phái Sinh (Long/Short).
curl --request POST \
--url https://services.entrade.com.vn/entrade-api/derivative/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bankMarginPortfolioId": 123,
"investorId": 123,
"symbol": "<string>",
"price": 123,
"orderType": "<string>",
"side": "<string>",
"quantity": 123
}
'import requests
url = "https://services.entrade.com.vn/entrade-api/derivative/orders"
payload = {
"bankMarginPortfolioId": 123,
"investorId": 123,
"symbol": "<string>",
"price": 123,
"orderType": "<string>",
"side": "<string>",
"quantity": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bankMarginPortfolioId: 123,
investorId: 123,
symbol: '<string>',
price: 123,
orderType: '<string>',
side: '<string>',
quantity: 123
})
};
fetch('https://services.entrade.com.vn/entrade-api/derivative/orders', 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://services.entrade.com.vn/entrade-api/derivative/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankMarginPortfolioId' => 123,
'investorId' => 123,
'symbol' => '<string>',
'price' => 123,
'orderType' => '<string>',
'side' => '<string>',
'quantity' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://services.entrade.com.vn/entrade-api/derivative/orders"
payload := strings.NewReader("{\n \"bankMarginPortfolioId\": 123,\n \"investorId\": 123,\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"orderType\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://services.entrade.com.vn/entrade-api/derivative/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bankMarginPortfolioId\": 123,\n \"investorId\": 123,\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"orderType\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.entrade.com.vn/entrade-api/derivative/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bankMarginPortfolioId\": 123,\n \"investorId\": 123,\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"orderType\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"side": "<string>",
"investorId": 123,
"investorAccountId": 123,
"bankId": 123,
"bankAccountId": 123,
"symbol": "<string>",
"price": 123,
"quantity": 123,
"orderType": "<string>",
"orderStatus": "<string>",
"fillQuantity": 123,
"lastQuantity": 123,
"lastPrice": 123,
"averagePrice": 123,
"createdDate": "<string>",
"modifiedDate": "<string>",
"bankMarginPortfolioId": 123,
"dealId": 123,
"tradingFee": 123,
"tradingTax": 123,
"orderSecure": 123,
"priceSecure": 123,
"marginRate": 123,
"quantitySecure": 123,
"leavesQuantity": 123,
"externalId": "<string>",
"error": "<string>",
"maker": "<string>",
"version": 123,
"type": "<string>",
"fillValue": 123
}{
"code": "<string>",
"message": "<string>",
"status": 123
}{
"code": "<string>",
"message": "<string>",
"status": 123
}Ủy quyền
JWT token lấy từ API đăng nhập.
Nội dung
Phản hồi
Thành công
Số hiệu lệnh
Lệnh Mua/Bán thuộc các giá trị sau: NB: Mua; NS: Bán
Mã khách hàng
Số tiểu khoản
Mã
Giá đặt
Khối lượng đặt
Loại lệnh, thuộc các giá trị sau: LO: lệnh giới hạn; MTL: lệnh thị trường; ATC/ATO: lệnh khớp phiên định kỳ đóng cửa/mở cửa; PLO: lệnh khớp lệnh sau giờ
Trạng thái lệnh, thuộc các giá trị sau: pending: chờ gửi; pendingNew: chờ gửi; new: chờ khớp; partiallyFilled: khớp một phần; filled: khớp toàn bộ; rejected: bị từ chối; expired: bị hết hạn trong phiên; doneForDay: lệnh hết hiệu lực khi hết phiên
Khối lượng đã khớp
Khối lượng của lần khớp gần nhất của lệnh
Giá khớp của lần khớp gần nhất của lệnh
Giá khớp trung bình của lệnh
Thời điểm (ngày giờ) đặt lệnh, theo định dạng ISO UTC 8601 format datetime. Ví dụ: 2022-07-15T10:00:00.111+07:00
Thời điểm (ngày giờ) thay đổi cuối cùng của lệnh
Id gói vay