Implementing virtual cash
This chapter describes step by step how you can implement virtual cash management with the Investment API. We show you the necessary API calls with sample code for a virtual cash increase or decrease.
If you want to learn more about the concept, go to 'Introduction', and in the chapter 'Use Cases' you can find out more about some example processes related to virtual cash.
Prerequisites
Details
The settlement of trades must be executed via Upvest's post-trade settlement and treasury procedure.
In this process, payments do not have to be made for the deposits, but only for the corresponding orders.
Increasing virtual cash
To submit a virtual cash increase, make the following request:
POST virtual_cash_balances/increases
Example request
{
"account_group_id": "2596db3b-0d03-4651-9eda-970910479dfb",
"amount": "200.00",
"currency": "EUR"
}
Example response
{
"id": "6ffa6b16-2380-4e7a-88b2-ae625c8eef99",
"created_at": "2020-08-24T14:15:22Z",
"updated_at": "2020-08-24T14:15:22Z",
"account_group_id": "ac1c39e9-2101-46b8-a624-d10a9e351b6c",
"amount": "200.00",
"currency": "EUR",
"status": "ISSUED"
}
Webhooks
For the increase you will receive the following events:
- The request for the increase was created.
- The increase request was confirmed.
Decreasing virtual cash
In some cases, if the increase you made was more than was needed for the order, it is best to reduce the remaining balance. This way we can keep the balance free of rounding dust and misleading cash balances.
To submit a virtual cash decrease, make the following request:
POST virtual_cash_balances/decreases
Example request
{
"account_group_id": "2596db3b-0d03-4651-9eda-970910479dfb",
"amount": "200.00",
"currency": "EUR"
}
Example response
{
"id": "6ffa6b16-2380-4e7a-88b2-ae625c8eef99",
"created_at": "2020-08-24T14:15:22Z",
"updated_at": "2020-08-24T14:15:22Z",
"account_group_id": "ac1c39e9-2101-46b8-a624-d10a9e351b6c",
"amount": "200.00",
"currency": "EUR",
"status": "ISSUED"
}
Webhooks
For the increase you will receive the following events:
- The request for the decrease was created.
- The decrease request was confirmed.
- The decrease went into the backlog.
Cancelling a virtual cash decrease
It is possible to cancel a virtual cash decrease.
It is only possible to cancel a virtual cash decrease if it has the ISSUED
or QUEUED
status.
To cancel a virtual cash decrease, make the following request:
DELETE /virtual_cash_balances/decreases/{virtual_cash_decrease_id}
Webhook
For the increase you will receive the following event:
- The specified virtual cash decrease was cancelled.
Was this page helpful?