Đặt lệnh mới
curl --request POST \
--url https://api.fireant.vn/mxv/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"side": "<string>",
"quantity": 1073741824,
"orderType": "<string>",
"timeInForce": "<string>",
"price": 123,
"stopPrice": 123,
"expireDate": "<string>"
}
'import requests
url = "https://api.fireant.vn/mxv/orders"
payload = {
"symbol": "<string>",
"side": "<string>",
"quantity": 1073741824,
"orderType": "<string>",
"timeInForce": "<string>",
"price": 123,
"stopPrice": 123,
"expireDate": "<string>"
}
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({
symbol: '<string>',
side: '<string>',
quantity: 1073741824,
orderType: '<string>',
timeInForce: '<string>',
price: 123,
stopPrice: 123,
expireDate: '<string>'
})
};
fetch('https://api.fireant.vn/mxv/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://api.fireant.vn/mxv/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([
'symbol' => '<string>',
'side' => '<string>',
'quantity' => 1073741824,
'orderType' => '<string>',
'timeInForce' => '<string>',
'price' => 123,
'stopPrice' => 123,
'expireDate' => '<string>'
]),
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://api.fireant.vn/mxv/orders"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 1073741824,\n \"orderType\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"price\": 123,\n \"stopPrice\": 123,\n \"expireDate\": \"<string>\"\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://api.fireant.vn/mxv/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 1073741824,\n \"orderType\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"price\": 123,\n \"stopPrice\": 123,\n \"expireDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fireant.vn/mxv/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 \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 1073741824,\n \"orderType\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"price\": 123,\n \"stopPrice\": 123,\n \"expireDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"cl_ord_id": "<string>",
"order_id": "<string>",
"message": "<string>",
"error": "<string>"
}MXV
Đặt lệnh mới
POST
/
mxv
/
orders
Đặt lệnh mới
curl --request POST \
--url https://api.fireant.vn/mxv/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"side": "<string>",
"quantity": 1073741824,
"orderType": "<string>",
"timeInForce": "<string>",
"price": 123,
"stopPrice": 123,
"expireDate": "<string>"
}
'import requests
url = "https://api.fireant.vn/mxv/orders"
payload = {
"symbol": "<string>",
"side": "<string>",
"quantity": 1073741824,
"orderType": "<string>",
"timeInForce": "<string>",
"price": 123,
"stopPrice": 123,
"expireDate": "<string>"
}
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({
symbol: '<string>',
side: '<string>',
quantity: 1073741824,
orderType: '<string>',
timeInForce: '<string>',
price: 123,
stopPrice: 123,
expireDate: '<string>'
})
};
fetch('https://api.fireant.vn/mxv/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://api.fireant.vn/mxv/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([
'symbol' => '<string>',
'side' => '<string>',
'quantity' => 1073741824,
'orderType' => '<string>',
'timeInForce' => '<string>',
'price' => 123,
'stopPrice' => 123,
'expireDate' => '<string>'
]),
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://api.fireant.vn/mxv/orders"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 1073741824,\n \"orderType\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"price\": 123,\n \"stopPrice\": 123,\n \"expireDate\": \"<string>\"\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://api.fireant.vn/mxv/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 1073741824,\n \"orderType\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"price\": 123,\n \"stopPrice\": 123,\n \"expireDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fireant.vn/mxv/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 \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": 1073741824,\n \"orderType\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"price\": 123,\n \"stopPrice\": 123,\n \"expireDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"cl_ord_id": "<string>",
"order_id": "<string>",
"message": "<string>",
"error": "<string>"
}Ủy quyền
OAuth2 Implicit Grant
FlowNgầm định
- Authorization URL
- https://accounts.fireant.vn/connect/authorize
Scopes1
user-data-write
Cập nhật tất cả dữ liệu của người dùng hiện tại
Tham số truy vấn
(0 = FUTURE, 1 = NANO, 2 = MXV)
Tùy chọn có sẵn:
0, 1, 2 Nội dung
application/jsontext/json
Request model for placing new order
Mã hợp đồng (VD: CP2COH25)
Phía giao dịch: 1 = Mua, 2 = Bán
Pattern:
^[12]$Số lượng lệnh (phải > 0)
Phạm vi bắt buộc:
1 <= x <= 2147483647Loại lệnh: 1 = Thị trường, 2 = Giới hạn, 3 = Dừng, 4 = Dừng-Giới hạn. Mặc định: 2
Pattern:
^[1234]$Thời gian hiệu lực của lệnh đặt: 0 = Trong ngày, 1 = GTC (Cho đến khi hủy), 6 = GTD (Cho đến ngày). Mặc định: 0
Pattern:
^[016]$Giá (bắt buộc cho lệnh GIỚI HẠN và DỪNG-GIỚI HẠN)
Giá dừng (bắt buộc cho lệnh DỪNG và DỪNG-GIỚI HẠN)
Ngày hết hạn theo định dạng YYYYMMDD (bắt buộc cho lệnh GTD)