Portfolio

The portfolio gives you an overview what you got in your securities account

The portfolio mainly shows either of those two things: 1. all buy-ins of instruments minus all sold positions of those instruments (/portfolio/endpoint) 2. all current positions of the instruments, aggregated on an instrument (/portfolio/aggregated/ endpoint) For instance, if you bought 10x Tesla three days, sold 5x yesterday and bought 15x again today, the /portfolio/ endpoint would return 5x Tesla and 15x Tesla. The /portfolio/aggregated/ endpoint would return 20x Tesla. Most of our customers use the /portfolio/aggregated/ endpoint.

get
LIST all portfolio positions (separately)

https://api.lemon.markets/rest/v1/accounts/{account_uuid}/portfolio/
Will give you up to 200 separately positions for all instruments as described above (Nr. 1).
Request
Response
Request
Path Parameters
account_uuid
required
string
UUID of your account (see accounts section)
Headers
Authorization
required
string
Token {TOKEN_KEY}
Query Parameters
offset
optional
integer
Needed for pagination.
limit
optional
integer
Needed for pagination. Default is 200
Response
200: OK
{
"count": 3,
"next": "null",
"previous": "null",
"results": [
{
"quantity": 5,
"average_price": 405.59,
"instrument": {
"title": "Tesla, Inc",
"isin": "US88160R1014",
"wkn": "A1CX3T"
},
"uuid": "3fa85f64-5717-4562-b3fc-2c964f66afa6"
},
{
"quantity": 2,
"average_price": 380.22,
"instrument": {
"title": "Tesla, Inc",
"isin": "US88160R1014",
"wkn": "A1CX3T"
},
"uuid": "42a85f64-5717-2345-b3fc-2c964f66afb9"
},
{
"quantity": 20,
"average_price": 44.09,
"instrument": {
"title": "Daimler AG",
"isin": "DE0007100000",
"wkn": "710000"
},
"uuid": "3fa85d14-5717-9999-b3fc-2c964f66afa6"
}
]
}

get
LIST all portfolio positions (aggregated on instruments)

https://api.lemon.markets/rest/v1/accounts/{account_uuid}/portfolio/aggregated
See the description (Nr. 2)
Request
Response
Request
Path Parameters
account_uuid
required
string
UUID of your account (see accounts section)
Headers
Authorization
required
string
Token {TOKEN_KEY}
Response
200: OK
Note: this endpoint delivers the pure list/ array (with result, count etc.) as this endpoint has the exception that is not able to be paginated.
[
{
"quantity": 0,
"average_price": 0,
"instrument": {
"title": "string",
"isin": "string",
"wkn": "string"
},
"uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]

get
RETRIEVE a portfolio position (based on instrument)

https://api.lemon.markets/rest/v1/accounts/{account_uuid}/portfolio/{instrument_isin}/aggregated/
Will deliver you a position of an instrument.
Request
Response
Request
Path Parameters
instrument_isin
required
string
ISIN of instrument
account_uuid
required
string
UUID of your account (see accounts section)
Headers
Authorization
required
string
Token {TOKEN_KEY}
Response
200: OK
{
"quantity": 10,
"average_price": 43.50,
"instrument": {
"title": "Daimler AG",
"isin": "DE0007100000",
"wkn": "710000"
},
"uuid": "3fa85d64-5717-4562-b3fc-2c963f66afc6"
}

‚Äč