Onboarding
Overview
The first step to creating an investment for your users is to create an investment account for them. You do this by calling the /accounts
endpoint of the API. The account created will be referenced when creating wallets, savings, or investments.
Create a User Account
Investment account creation is the process of registering a user to be able to access investment products on your platform. To create an investment account on the Embed API, you need to provide minimum user details such as first name, last name, and email address. Once the account is created, you will need to update and verify the user by providing either the BVN, NIN, or voter’s card.
Note
In production, an unverified user will not be able to access the investment products or perform any investment activity. To verify a user, we currently support provision of the user’s BVN. Note that BVN verification is asynchronous so you’ll need to listen for the web hooks to know when a user’s account is verified or not.
Heads Up
Sensitive user data should not be used in the sandbox environment. To prevent this type of data from being saved in the sandbox environment, the API will only requirefirst_name
,last_name
,email_address
andphone_number
for investment account creation.
To register a user, you need to issue a POST request to /accounts
Embed Terms of Service
We require that all users accept our Terms and Conditions before creating investments. This ensures everyone is aware of our guidelines and can fully enjoy our platform. If you haven't accepted our T&C yet, don't worry! Your account will be temporarily restricted until you've accepted them. Once you agree to our terms, you'll be free to create investments and explore everything our platform has to offer.
You can accept our T&C on the account creation endpoint by including `terms_of_use_accepted=True` in the request payload.
If you do not include this in the request payload, the account will be created with temporary restrictions until you manually accept the T&C
To display the actual content of the terms to your users on your app, follow these steps:
- Fetch the Terms Link: Use our API endpoint to get the link to the terms page.
- Fetch the Terms Content: Once you have the link, make a request to the URL to retrieve the content of the terms.
- Display the Content: Display the retrieved content on your app or website. This can be done using an iframe, a modal, or by embedding the content directly into your page.
Here’s an example of how you can implement this in JavaScript:
fetch('BASE_URL/accounts/retrieve-terms')
.then(response => response.json())
.then(data => {
const termsLink = data.data.terms_link;
fetch(termsLink)
.then(response => response.text())
.then(content => {
document.getElementById('terms-content').innerHTML = content;
});
});
When a user registration request is successful, you should have a newly created investment account object with a status code 201. Below is a sample investment account object showing all details that are needed
"data": {
"identifications": [],
"address": {
"street": "",
"lga": "",
"area_code": "",
"city": "",
"state": ""
},
"email": "test@cowrywise.com",
"first_name": "TEST",
"account_type": "business",
"phone_number": null,
"account_id": "28943ca3c0f7aeb0763c465caaedc7f1",
"banks": [],
"name": "Test Account",
"account_status": "ACTIVE",
"is_verified": false,
"risk_appetite": 0,
"terms_of_use_accepted": true,
"account_number": 273961452,
"next_of_kin": {
"first_name": "",
"last_name": "",
"email": "",
"phone_number": "",
"relationship": "",
"gender": null
},
"date_of_birth": null,
"last_name": "TEST",
"is_proprietary": false,
"date_joined": "2023-03-06T13:31:53.673739+00:00",
"gender": null,
"verification_status": "UNVERIFIED"
}
Once an investment account is created, you can get its portfolio, invest in it, update the investment account profile, and so on. Detailed explanations have been included below.