Move cash, or units of an investment, between two portfolios of this account
POST
/v1/accounts/{id}/transfers
curl -X POST "https://api.staging.idealx.com/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/transfers" \ -H "Authorization: Bearer $IDEALX_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "fromPortfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1", "toPortfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa2"}'const res = await fetch("https://api.staging.idealx.com/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/transfers", { method: "POST", headers: { Authorization: `Bearer ${process.env.IDEALX_API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "fromPortfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1", "toPortfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa2" }),});if (!res.ok) throw new Error((await res.json()).error.code);const data = await res.json();import os, uuidimport requests
res = requests.post( "https://api.staging.idealx.com/v1/accounts/acc_01937c4e8a2b7d1f9e0c3b5a6d7e8f90/transfers", headers={"Authorization": f"Bearer {os.environ['IDEALX_API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}, json={ "fromPortfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa1", "toPortfolioId": "ptf_01937c4e8a2b7d1f9e0c3b5a6d7e8fa2" }, timeout=30,)res.raise_for_status()data = res.json()Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Header Parameters
Section titled “Header Parameters”idempotency-key
required
Idempotency-Key: 16-128 chars; repeat it to retry safely
string
Idempotency-Key: 16-128 chars; repeat it to retry safely
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
fromPortfolioId
required
string
toPortfolioId
required
string
amount
object
amount
required
string
Example
1250.00currency
required
string
Example
AUDposition
Move units of an investment (cost base kept) instead of cash
object
instrumentId
required
string
quantity
required
string
reference
string
note
Why, in your words; kept with the record, not sent with the payment
string
attachments
Array<object>
PDF, image, Word, Excel, CSV or text; up to 4 MB
object
name
required
string
contentType
required
string
dataBase64
required
string
Responses
Section titled “Responses”Settled, or waiting for approval
Media typeapplication/json
object
id
required
string
kind
required
string
state
required
string
fromPortfolioId
required
string
toPortfolioId
required
string | null
payeeId
required
string | null
amount
required
object
amount
required
string
currency
required
string
reference
required
string | null
note
required
The customer’s own words on why; kept with the record
string | null
attachments
required
Files kept with it; download at /v1/instructions/{id}/files/{fileId}
Array<object>
object
id
required
string
name
required
string
contentType
required
string
size
required
number
createdAt
required
string
approvalsRequired
required
number
approvals
required
number
approvedByMe
required
boolean
position
required
Set when units of an investment were moved instead of cash
object
instrumentId
required
string
quantity
required
string
createdAt
required
string
Example
{ "kind": "internal_transfer", "amount": { "amount": "1250.00", "currency": "AUD" }}Not enough balance, closed portfolio
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
requestId
required
string
details
object
key
additional properties
Example
{ "error": { "code": "validation_failed" }}Invalid amount
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
requestId
required
string
details
object
key
additional properties
Example
{ "error": { "code": "validation_failed" }}