Skip to content

Create Holding Endpoint

POST
/api/v1/investments/holdings
curl --request POST \
--url https://example.com/api/v1/investments/holdings \
--header 'Content-Type: application/json' \
--data '{ "ticker": "example", "name": "example", "quantity": 1, "cost_basis": 1, "fee": "0", "purchase_date": "2026-04-15", "account_id": 1, "current_price": 1, "currency": "example", "asset_class": "stock", "price_source": "example", "current_price_updated_at": "2026-04-15T12:00:00Z", "notes": "example" }'
Media typeapplication/json
HoldingCreate
object
ticker
required
Ticker
string
>= 1 characters <= 20 characters
name
Any of:
string
<= 200 characters
quantity
required
Any of:
number
cost_basis
required
Any of:
number
fee
Any of:
number
purchase_date
required
Purchase Date
string format: date
account_id
required
Account Id
integer
current_price
Any of:
number
currency
Any of:
string
/^[A-Z]{3}$/
asset_class
Any of:
string
Allowed values: stock etf bond crypto cash real_estate commodity other
price_source
Any of:
string
current_price_updated_at
Any of:
string format: date-time
notes
Any of:
string
<= 2000 characters

Successful Response

Media typeapplication/json
HoldingOut
object
id
required
Id
integer
user_id
required
User Id
integer
account_id
required
Any of:
integer
ticker
required
Ticker
string
name
required
Any of:
string
quantity
required
Quantity
string
cost_basis
required
Cost Basis
string
fee
required
Fee
string
total_cost
required
Total Cost
string
purchase_date
required
Purchase Date
string format: date
current_price
required
Any of:
string
currency
required
Any of:
string
asset_class
required
Any of:
string
price_source
required
Any of:
string
current_price_updated_at
required
Any of:
string format: date-time
notes
required
Any of:
string
value_base_currency
Any of:
string
price_gain_base_currency
Any of:
string
fx_gain_base_currency
Any of:
string
fx_rate
Any of:
string
cost_base_currency
Any of:
string
dividends_base_currency
Any of:
string
dividends
Dividends
Array<object>
default:
DividendOut
object
id
required
Id
integer
holding_id
required
Holding Id
integer
amount
required
Amount
string
ex_date
required
Ex Date
string format: date
pay_date
required
Any of:
string format: date
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time

Example

{
"dividends": []
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}