List open positions
curl --request GET \
--url https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions \
--header 'API-Key: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'API-Timestamp: <api-key>'import requests
url = "https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions"
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Timestamp": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'API-Key': '<api-key>', 'API-Sign': '<api-key>', 'API-Timestamp': '<api-key>'}
};
fetch('https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions', 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.sandbox.services.payward.com/v1/accounts/{account_id}/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Sign: <api-key>",
"API-Timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Timestamp", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Timestamp", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Timestamp"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"symbol": "PBTCUCZ0.BTNL",
"side": "long",
"quantity": "1",
"entry_price": "82870",
"current_price": "81670",
"unrealized_pnl": "-12.0000",
"realized_pnl": "0.0000",
"initial_margin": "62",
"maintenance_margin": "62",
"intraday_margin": "31",
"return_on_equity": "-0.193548387096774193"
}
]
}Portfolio
List open positions
List open derivatives positions for the selected account.
Prices and monetary amounts are in each instrument’s quote currency.
GET
/
v1
/
accounts
/
{account_id}
/
positions
List open positions
curl --request GET \
--url https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions \
--header 'API-Key: <api-key>' \
--header 'API-Sign: <api-key>' \
--header 'API-Timestamp: <api-key>'import requests
url = "https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions"
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Timestamp": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'API-Key': '<api-key>', 'API-Sign': '<api-key>', 'API-Timestamp': '<api-key>'}
};
fetch('https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions', 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.sandbox.services.payward.com/v1/accounts/{account_id}/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Sign: <api-key>",
"API-Timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Timestamp", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Timestamp", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.services.payward.com/v1/accounts/{account_id}/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Timestamp"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"symbol": "PBTCUCZ0.BTNL",
"side": "long",
"quantity": "1",
"entry_price": "82870",
"current_price": "81670",
"unrealized_pnl": "-12.0000",
"realized_pnl": "0.0000",
"initial_margin": "62",
"maintenance_margin": "62",
"intraday_margin": "31",
"return_on_equity": "-0.193548387096774193"
}
]
}