curl --request POST \
--url https://gateway.amana.io/trading/positions/limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"amount": 1,
"price": 1,
"sl": 1,
"tp": 1,
"comment": "<string>"
}
'import requests
url = "https://gateway.amana.io/trading/positions/limit"
payload = {
"symbol": "<string>",
"amount": 1,
"price": 1,
"sl": 1,
"tp": 1,
"comment": "<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>', amount: 1, price: 1, sl: 1, tp: 1, comment: '<string>'})
};
fetch('https://gateway.amana.io/trading/positions/limit', 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://gateway.amana.io/trading/positions/limit",
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>',
'amount' => 1,
'price' => 1,
'sl' => 1,
'tp' => 1,
'comment' => '<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://gateway.amana.io/trading/positions/limit"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"amount\": 1,\n \"price\": 1,\n \"sl\": 1,\n \"tp\": 1,\n \"comment\": \"<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://gateway.amana.io/trading/positions/limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"amount\": 1,\n \"price\": 1,\n \"sl\": 1,\n \"tp\": 1,\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.amana.io/trading/positions/limit")
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 \"amount\": 1,\n \"price\": 1,\n \"sl\": 1,\n \"tp\": 1,\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"orderId": "<string>",
"err": "<string>",
"message": "<string>"
}{
"success": true,
"orderId": "<string>",
"err": "<string>",
"message": "<string>"
}{}Place a pending limit order that triggers at a specified price
Creates a pending order that only executes when the market reaches the specified price. Use this when the user wants to enter at a specific price rather than immediately. Amount is always in USD. The order stays pending until triggered or cancelled with cancelOrder.
curl --request POST \
--url https://gateway.amana.io/trading/positions/limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"amount": 1,
"price": 1,
"sl": 1,
"tp": 1,
"comment": "<string>"
}
'import requests
url = "https://gateway.amana.io/trading/positions/limit"
payload = {
"symbol": "<string>",
"amount": 1,
"price": 1,
"sl": 1,
"tp": 1,
"comment": "<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>', amount: 1, price: 1, sl: 1, tp: 1, comment: '<string>'})
};
fetch('https://gateway.amana.io/trading/positions/limit', 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://gateway.amana.io/trading/positions/limit",
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>',
'amount' => 1,
'price' => 1,
'sl' => 1,
'tp' => 1,
'comment' => '<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://gateway.amana.io/trading/positions/limit"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"amount\": 1,\n \"price\": 1,\n \"sl\": 1,\n \"tp\": 1,\n \"comment\": \"<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://gateway.amana.io/trading/positions/limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"amount\": 1,\n \"price\": 1,\n \"sl\": 1,\n \"tp\": 1,\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.amana.io/trading/positions/limit")
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 \"amount\": 1,\n \"price\": 1,\n \"sl\": 1,\n \"tp\": 1,\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"orderId": "<string>",
"err": "<string>",
"message": "<string>"
}{
"success": true,
"orderId": "<string>",
"err": "<string>",
"message": "<string>"
}{}Authorizations
JWT token obtained from authentication endpoints
Body
Trading symbol, for example XAUUSD, EURUSD, or AAPL.
Trade direction. Use 'buy' to go long, 'sell' to go short.
buy, sell Trade size in account currency (USD). For example, 1000 means $1,000 worth of the instrument.
x >= 0Price at which the order should trigger. The order stays pending until the market reaches this level.
x >= 0Optional stop loss price level. The position closes automatically if the market hits this price.
x >= 0Optional take profit price level. The position closes automatically in profit if the market hits this price.
x >= 0Optional comment or note for the order.
