User Portfolio
After registering a user via the API, that is, successfully creating an account for a user, the next step is to get the portfolio for the user. A user’s portfolio shows the composition of the investments a user has as well as their total value and performance per time.
To get a portfolio for a user you must provide the user account ID ( see full guide here).
Here’s a sample object of a user’s portfolio showing their balance, returns, and current investments.
{
"data":{
"account_id":"cfc28289a70e407dbde486d1bf40c543",
"balance":[
{
"currency":"USD",
"value":50000000.0,
"portfolio_returns":0.0
},
{
"currency":"NGN",
"value":50000000.0,
"portfolio_returns":0.0
}
],
"assets":{
"wallets":[
{
"wallet_id":"86fed63bea1b4e95a02168dc87bd6f18",
"account_id":"cfc28289a70e407dbde486d1bf40c543",
"name":"NGN-Wallet",
"product_code":"PRCDE1620155567",
"currency":"NGN",
"principal":"50000000.0000",
"returns":"0.0000",
"lifetime_returns":0.0,
"balance":"50000000.000",
"account_number":"",
"account_name":"",
"bank_name":"",
"created_on":"2021-06-25T17:22:46.931867+00:00"
},
{
"wallet_id":"ce400832850c4e959c656613200c1592",
"account_id":"cfc28289a70e407dbde486d1bf40c543",
"name":"USD-Wallet",
"product_code":"PRCDE225777028",
"currency":"USD",
"principal":"50000000.0000",
"returns":"0.0000",
"lifetime_returns":0.0,
"balance":"50000000.000",
"account_number":"",
"account_name":"",
"bank_name":"",
"created_on":"2021-06-25T17:22:46.915117+00:00"
}
],
"savings":[
],
"indexes":[
],
"mutual_funds":[
],
"treasury_bills":[
],
"stocks":[
]
}
},
"errors":null,
"message":"Request successful",
"status":"success"
}
Portfolio Performance
You can choose to show the portfolio performance to the user. To do this, you will need to issue a GET request to /accounts/:id/portfolio
.
Viewing Investments
This details how you can allow your users to view all their investments as well as the state of each investment such as the performance and current value.
Performance
We expose endpoints that make it possible for you to show users how their investments have been performing over time. Performance here refers to how a user’s investment has grown or declined over time based on returns earned or losses made on their capital. This is determined differently for each product type and explained under the investment products section. The details on returns earned or changes to an investment are included as a part of the response object for each investment.
Current Value
This refers to a user’s balance for a particular investment. It is provided as part of the response object for each investment.
You can view all investments that a user has or filter a user's investments by type. Please refer to the API Reference for a complete guide.