Preview portfolio buy
Get a preview of a portfolio buy transaction showing execution options, fees, and estimated orders
curl --request POST \
--url https://{host}/investments/portfolio/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"portfolioId": "64f0c51e7fb3fc001234abcd",
"orderAmount": 250.5,
"allocationMethod": "holdings"
}
'import requests
url = "https://{host}/investments/portfolio/preview"
payload = {
"portfolioId": "64f0c51e7fb3fc001234abcd",
"orderAmount": 250.5,
"allocationMethod": "holdings"
}
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-id': '<x-user-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
portfolioId: '64f0c51e7fb3fc001234abcd',
orderAmount: 250.5,
allocationMethod: 'holdings'
})
};
fetch('https://{host}/investments/portfolio/preview', 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://{host}/investments/portfolio/preview",
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([
'portfolioId' => '64f0c51e7fb3fc001234abcd',
'orderAmount' => 250.5,
'allocationMethod' => 'holdings'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$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://{host}/investments/portfolio/preview"
payload := strings.NewReader("{\n \"portfolioId\": \"64f0c51e7fb3fc001234abcd\",\n \"orderAmount\": 250.5,\n \"allocationMethod\": \"holdings\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
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://{host}/investments/portfolio/preview")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"portfolioId\": \"64f0c51e7fb3fc001234abcd\",\n \"orderAmount\": 250.5,\n \"allocationMethod\": \"holdings\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/investments/portfolio/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"portfolioId\": \"64f0c51e7fb3fc001234abcd\",\n \"orderAmount\": 250.5,\n \"allocationMethod\": \"holdings\"\n}"
response = http.request(request)
puts response.read_body{
"executionWindow": {
"express": {
"etfs": {
"executionType": "REALTIME",
"start": "2024-07-12T13:00:00.000Z",
"end": "2024-07-12T15:30:00.000Z"
},
"stocks": {
"executionType": "REALTIME",
"start": "2024-07-12T09:30:00.000Z",
"end": "2024-07-12T16:00:00.000Z"
}
},
"smart": {
"etfs": {
"executionType": "MARKET_HOURS",
"start": "2024-07-12T13:00:00.000Z",
"end": "2024-07-12T18:00:00.000Z"
},
"stocks": {
"executionType": "MARKET_HOURS",
"start": "2024-07-12T09:30:00.000Z",
"end": "2024-07-12T16:00:00.000Z"
}
}
},
"fees": {
"express": {
"fx": {
"currency": "EUR",
"amount": 0.22
},
"commission": {
"currency": "EUR",
"amount": 1
}
},
"smart": {
"fx": {
"currency": "EUR",
"amount": 0.22
},
"commission": {
"currency": "EUR",
"amount": 0.13
}
}
},
"partnerFees": {
"express": {
"fx": {
"currency": "EUR",
"amount": 0.03
},
"commission": {
"currency": "EUR",
"amount": 1
}
},
"smart": {
"fx": {
"currency": "EUR",
"amount": 0.03
},
"commission": {
"currency": "EUR",
"amount": 1
}
}
},
"orders": {
"express": [
{
"isin": "US0378331005",
"side": "Buy",
"quantity": 0.5,
"consideration": {
"currency": "EUR",
"amount": 50
}
}
],
"smart": [
{
"isin": "US0378331005",
"side": "Buy",
"quantity": 0.5,
"consideration": {
"currency": "EUR",
"amount": 50
}
}
]
},
"foreignCurrencyRates": {
"US0378331005": {
"rate": 1.1,
"currency": "USD"
}
}
}{
"status": 400,
"error": {
"message": "Target allocation is not set up for this portfolio",
"description": "Operation failed"
},
"responseId": "3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd"
}{
"status": 401,
"error": {
"message": "User not found"
},
"responseId": "145f2b0d-1d5b-4e91-8d0d-7af0ae9ad13a"
}{
"status": 403,
"error": {
"message": "Portfolio does not belong to user"
},
"responseId": "5e467f79-c62c-4d83-9810-7a0f8529fd76"
}{
"status": 404,
"error": {
"message": "Portfolio not found"
},
"responseId": "65c0b1f6-2a48-4c4f-a5aa-9b9c8c6f9b58"
}Authorizations
Auth0-issued access token that includes the scopes listed for the endpoint.
Headers
User identifier for the M2M client to specify which user's data to access.
^[a-f0-9]{24}$Body
Portfolio identifier (MongoDB ObjectId)
^[a-f0-9]{24}$Amount to invest in whole currency units (e.g., 100.0 for 100 EUR)
x >= 0.01Method for distributing the investment across assets
targetAllocation, holdings Response
Portfolio buy preview retrieved successfully
Preview of a transaction showing execution options, fees, and estimated orders
Execution window for both express and smart execution scenarios
Show child attributes
Show child attributes
Wealthyhood fee breakdown for express vs smart execution (commission and FX only on preview)
Show child attributes
Show child attributes
Partner (ETE/NBG) countervalue fees per execution mode; omitted for retail Wealthyhood users.
Show child attributes
Show child attributes
Orders preview for both express and smart execution scenarios
Show child attributes
Show child attributes
Foreign currency exchange rates keyed by ISIN
Show child attributes
Show child attributes
Whether orders will be skipped due to low amounts
Whether the transaction will result in a low quantity holding
Whether the transaction includes ETF orders
curl --request POST \
--url https://{host}/investments/portfolio/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"portfolioId": "64f0c51e7fb3fc001234abcd",
"orderAmount": 250.5,
"allocationMethod": "holdings"
}
'import requests
url = "https://{host}/investments/portfolio/preview"
payload = {
"portfolioId": "64f0c51e7fb3fc001234abcd",
"orderAmount": 250.5,
"allocationMethod": "holdings"
}
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-id': '<x-user-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
portfolioId: '64f0c51e7fb3fc001234abcd',
orderAmount: 250.5,
allocationMethod: 'holdings'
})
};
fetch('https://{host}/investments/portfolio/preview', 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://{host}/investments/portfolio/preview",
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([
'portfolioId' => '64f0c51e7fb3fc001234abcd',
'orderAmount' => 250.5,
'allocationMethod' => 'holdings'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$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://{host}/investments/portfolio/preview"
payload := strings.NewReader("{\n \"portfolioId\": \"64f0c51e7fb3fc001234abcd\",\n \"orderAmount\": 250.5,\n \"allocationMethod\": \"holdings\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
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://{host}/investments/portfolio/preview")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"portfolioId\": \"64f0c51e7fb3fc001234abcd\",\n \"orderAmount\": 250.5,\n \"allocationMethod\": \"holdings\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/investments/portfolio/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"portfolioId\": \"64f0c51e7fb3fc001234abcd\",\n \"orderAmount\": 250.5,\n \"allocationMethod\": \"holdings\"\n}"
response = http.request(request)
puts response.read_body{
"executionWindow": {
"express": {
"etfs": {
"executionType": "REALTIME",
"start": "2024-07-12T13:00:00.000Z",
"end": "2024-07-12T15:30:00.000Z"
},
"stocks": {
"executionType": "REALTIME",
"start": "2024-07-12T09:30:00.000Z",
"end": "2024-07-12T16:00:00.000Z"
}
},
"smart": {
"etfs": {
"executionType": "MARKET_HOURS",
"start": "2024-07-12T13:00:00.000Z",
"end": "2024-07-12T18:00:00.000Z"
},
"stocks": {
"executionType": "MARKET_HOURS",
"start": "2024-07-12T09:30:00.000Z",
"end": "2024-07-12T16:00:00.000Z"
}
}
},
"fees": {
"express": {
"fx": {
"currency": "EUR",
"amount": 0.22
},
"commission": {
"currency": "EUR",
"amount": 1
}
},
"smart": {
"fx": {
"currency": "EUR",
"amount": 0.22
},
"commission": {
"currency": "EUR",
"amount": 0.13
}
}
},
"partnerFees": {
"express": {
"fx": {
"currency": "EUR",
"amount": 0.03
},
"commission": {
"currency": "EUR",
"amount": 1
}
},
"smart": {
"fx": {
"currency": "EUR",
"amount": 0.03
},
"commission": {
"currency": "EUR",
"amount": 1
}
}
},
"orders": {
"express": [
{
"isin": "US0378331005",
"side": "Buy",
"quantity": 0.5,
"consideration": {
"currency": "EUR",
"amount": 50
}
}
],
"smart": [
{
"isin": "US0378331005",
"side": "Buy",
"quantity": 0.5,
"consideration": {
"currency": "EUR",
"amount": 50
}
}
]
},
"foreignCurrencyRates": {
"US0378331005": {
"rate": 1.1,
"currency": "USD"
}
}
}{
"status": 400,
"error": {
"message": "Target allocation is not set up for this portfolio",
"description": "Operation failed"
},
"responseId": "3f0fd3bf-a2ff-4c0e-9b1d-5d7055dbf6cd"
}{
"status": 401,
"error": {
"message": "User not found"
},
"responseId": "145f2b0d-1d5b-4e91-8d0d-7af0ae9ad13a"
}{
"status": 403,
"error": {
"message": "Portfolio does not belong to user"
},
"responseId": "5e467f79-c62c-4d83-9810-7a0f8529fd76"
}{
"status": 404,
"error": {
"message": "Portfolio not found"
},
"responseId": "65c0b1f6-2a48-4c4f-a5aa-9b9c8c6f9b58"
}