Python client library for Cowrywise Embed Investments API
Embed Python Library
The Embed Python library provides an easy access to the Embed Investment API by Cowrywise. Embed is an investment-as-a-service API that allows you to integrate investment features in your products and offer financial services to your customers at scale. With Embed, developers can create investment accounts for their customers and expose them to a wide variety of investment products!
See the Embed API docs.
Install the package directly via git
pip install git+https://github.com/cowrywise/embedpy.git
You could also install the library via pypi using the pip package manager.
$ pip install -U embedpy
To get started, sign up for your developer credentials on the Embed Dashboard. Once you have signed up, you can retrieve your
client_secret keys from the developer dashboard. Set your credentials in the environment variables before creating an instance of the Embed Client.
# Set environment variables CLIENT_ID = CWRY-substitute-yours-here CLIENT_SECRET = CWRY-SECRET-substitute-yours-here # Create an instance of the Embed Client from embed.client import Client client = Client()
Alternatively, you can use your credentials to instantiate the Embed Client. During this instantiation, you can specify a base URL. This is an optional parameter that defaults to the sandbox base URL.
from embed.client import Client client = Client(client_id='****', client_secret='****', base_url="https://***.cowrywise.com")
Embed API REST Methods
|create_account(first_name=None, last_name=None, email=None)||
|update_next_of_kin(account_id=None, email=None, first_name=None,/last_name=None, phone_number=None, relationship=None, gender=None)||
|create_custom_index(account_id=None, name=None, description=None, allocations=None)||
|modify_custom_index(account_id=None, index_id=None, allocations=None)||
|get_price_history(asset_id=None, from_date=None, to_date=None)||
|create_savings(account_id=None, days=None, interest_enabled=None, currency_code=None)||
|buy_stock(account_id=None, symbol=None, amount=None, side=None, the_type=None, time_in_force=None)||
|sell_stock(account_id=None, symbol=None, amount=None, side=None, the_type=None, time_in_force=None)||
|list_transfers(account_id=None, email=None, from_date=None, to_date=None)||
|transfer(wallet_id=None, product_code=None, amount=None)||
Check the API reference document for all resources and their respective endpoints.
We welcome contributions from everyone. Before submitting a pull request, kindly ensure:
- Necessary tests for the code changes requested are added
- Code is formatted according to PEP8
- There is clear commit messages
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.