Close an empty extra portfolio (never the Primary)
curl -X POST "https://api.staging.idealx.com/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/portfolios/ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1/close" \ -H "Authorization: Bearer $IDEALX_API_KEY"const res = await fetch("https://api.staging.idealx.com/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/portfolios/ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1/close", { method: "POST", headers: { Authorization: `Bearer ${process.env.IDEALX_API_KEY}` },});if (!res.ok) throw new Error((await res.json()).error.code);const data = await res.json();import osimport requests
res = requests.post( "https://api.staging.idealx.com/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/portfolios/ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1/close", headers={"Authorization": f"Bearer {os.environ['IDEALX_API_KEY']}"}, timeout=30,)res.raise_for_status()data = res.json()Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”OK
object
The account’s main currency, from its country
object
object
object
object
The value in disjoint parts, in the main currency; they add up to value exactly (D138). Cash is uninvested cash in every currency; strategies holds the positions of portfolios that follow a strategy and is listed only when one does.
object
Currencies (cash) or positions counted
What you may do here, from your account role or your firm’s role, kind and mandate. add_money, trade, transfer, withdraw, send_crypto, manage_payees, schedule, propose and decide_proposals move money or ask a client to; an approval policy may still apply when they run.
object
object
The value in disjoint parts, in the main currency; they add up to value exactly (D138). Cash is uninvested cash in every currency; strategies holds the positions of portfolios that follow a strategy and is listed only when one does.
object
Currencies (cash) or positions counted
What you may do here, from your account role or your firm’s role, kind and mandate. add_money, trade, transfer, withdraw, send_crypto, manage_payees, schedule, propose and decide_proposals move money or ask a client to; an approval policy may still apply when they run.
Example
{ "currency": "AUD", "status": "open", "portfolios": [ { "status": "open", "breakdown": [ { "bucket": "cash" } ], "actions": [ "add_money" ] } ], "breakdown": [ { "bucket": "cash" } ], "actions": [ "add_money" ]}Primary, or not empty
object
object
object
Example
{ "error": { "code": "validation_failed" }}