Account

Nearly every request you will execute is based on your account. At lemon.markets you will have an user profile which is all about you. You as an user have one or multiple accounts - for now, you will be only able to have one account which is the demo account. In the future, you will have at least two accounts - the demo account with paper money and the "real" account with real money.

get
LIST all Accounts

https://api.lemon.markets/rest/v1/accounts/
This should return all accounts - for now, you will be only able to have one account. The first account returned is your demo account. Use the UUID of the first account to execute further requests.
Request
Response
Request
Headers
Authorization
required
string
Token {TOKEN_KEY}
Response
200: OK
Take the uuid from account object in the results list
{
"count": 0,
"next": null,
"previous": null,
"results": [
{
"name": "Marcels Demo Account",
"type": "demo",
"currency": "EUR",
"uuid": "5fc95060-2fb9-4d0f-891a-8c4f35ce0f86"
}
]
}

get
RETRIEVE a single account

https://api.lemon.markets/rest/v1/accounts/{account_uuid}/
Get details about the account with UUID received in the previous step.
Request
Response
Request
Path Parameters
account_uuid
required
string
UUID from the previous step.
Headers
Authorization
required
string
Token {TOKEN_KEY}
Response
200: OK
{
"name": "Marcels Demo Account",
"type": "demo",
"currency": "EUR",
"uuid": "5fc95060-2fb9-4d0f-891a-8c4f35ce0f86"
}

get
RETRIEVE account state

https://api.lemon.markets/rest/v1/accounts/{account_uuid}/state/
Here you will get details about the cash to invest and total balance. The total balance is your cash at hand, the cash to invest is your cash minus the volume of open orders.
Request
Response
Request
Path Parameters
account_uuid
required
string
UUID from the previous step
Headers
Authorization
required
string
Token {TOKEN_KEY}
Response
200: OK
{
"cash_to_invest": 5000.9,
"total_balance": 10000.01
}