/compute/position

Base URL
https://api.babylon.app/v1

POST /compute/position

Compute current security positions across a Babylon segment.
The analysis aggregates all buys, sells, (minus any exclusions) and reports quantities, cost basis, and per-share costs.

Query parameters

  • segmentLedger (Required) – The ID of the Babylon segment to analyze.
  • excludeType (optional) – One or more account types to exclude. Accepts a comma-separated list (e.g. ISA,SIPP,RA). Valid values are: ISA, SIPP, RA, TFSA, GIA.
  • settleDate (optional) – Only consider trades which settle on or before this date.
  • format (optional) – Use csv for CSV output, otherwise JSON.
  • columns (optional) – Comma-separated list to select and order fields in the response.

Example request

POST /compute/position
{
	segmentLedger: "MyGBLedger"
}

Example response

{
  "data": {
    "bourse": ["LSE", "LSE"],
    "symbol": ["VUSA", "PNL"],
    "quantity": [150, 75],
    "totalCost": [45000.00, 31500.00],
    "costPerShare": [300.00, 420.00],
    "currency": ["GBP", "GBP"]
  }
}

Example request (CSV)

POST /compute/position
{
	segmentLedger: "MyGBSegment"
	format: "csv"
}

Example response (CSV)

Bourse,Symbol,Quantity,TotalCost,CostPerShare,Currency
LSE,VUSA,150,45000.00,300.00,GBP
LSE,PNL,75,31500.00,420.00,GBP

← Back to API