Place order
curl --request POST \
--url https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"price": 123,
"quantity": 123
}
'import requests
url = "https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders"
payload = {
"symbol": "<string>",
"price": 123,
"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({symbol: '<string>', price: 123, quantity: 123})
};
fetch('https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/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://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/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>',
'price' => 123,
'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://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"price\": 123,\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://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/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 \"price\": 123,\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>",
"orderId": "<string>"
}API Reference
Place order
Place a normal stock order.
POST
/
akhlys
/
v1
/
accounts
/
{accountNo}
/
orders
Place order
curl --request POST \
--url https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"price": 123,
"quantity": 123
}
'import requests
url = "https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders"
payload = {
"symbol": "<string>",
"price": 123,
"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({symbol: '<string>', price: 123, quantity: 123})
};
fetch('https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/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://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/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>',
'price' => 123,
'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://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"price\": 123,\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://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"price\": 123,\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.tcbs.com.vn/akhlys/v1/accounts/{accountNo}/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 \"price\": 123,\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>",
"orderId": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Account number, e.g. 0001170730.
Body
application/json
Trading direction: NS = sell, NB = buy.
Available options:
NS, NB Stock symbol, e.g. VNM.
Price type: LO, ATO, ATC, PLO, MP, MTL, MOK, MAK.
Available options:
LO, ATO, ATC, PLO, MP, MTL, MOK, MAK Trading price.
Trading quantity.