Skip to main content

Access high-quality financial data and perform direct bank payments with mono.co

Project description

The Unofficial python wrapper around mono.co APIs

Mono helps businesses to access high-quality financial data and direct bank payments, with this package you can have a pythonic access to mono's APIs.

Getting Started

Installation

    pip install mono-client

Setup, Inialize the package using your mono test or live secret_key

    from mono_client import Client
    client = Client(secret_key='secret')

Usage

Now, lets create an account holder, then generate a bank account for our user and transfer funds.

  • Create an account holder on mono
    res = client.create_holder(
        bvn='12345',
        city='Abuja',
        state='Abuja',
        last_name='Doe',
        first_name='Jane',
        phone='+2347000000000',
        email='mail@abdull.dev',
        address='Abuja, Nigeria',
    )

    # example response

    {
        "status": "success",
        "message": "Account holder created successfully",
        "data": {
            "id": "61a73645c2d313658ce82d44"
        }
    }

We have holder, now lets generate a bank account for our user.

  • Create a bank account

pass the parameter virtual=True to make a virtual bank account.

    res = client.create_account(holder_id='61a73645c2d313658ce82d44', virtual=True)

    # example response
    {
        "status": "successful",
        "message": "Virtual account generation is processing",
        "data": {
            "id": "62decea1063a19fcba1234"
        }
    }

At this point you should be able to transfer money to this account (if you used live credentials in the setup).

Transfer funds from one user account to another (internal)

  • Internal Transfer
    res = client.transfer_internal(
        amount='1000',
        reference='reference',
        narration='funds transfer',
        to_account_id='62decea1063a19fcba1234',
        from_account_id='54decea1063a19fcba2434',
        meta={"my_reference": "12345"}, # optional dict. e.g {"my_reference": "12345"}
    )

    # example response
    {
        "status": "successful",
        "message": "Transfer is processing",
        "data": {
            "id": "62f0c405dcf59e51e408daf9"
        }
    }

Transfer funds from user account to an external bank account

  • Transfer
    res = client.transfer(
        amount='1000',
        narration='narration',
        reference='reference',
        from_account_id='62decea1063a19fcba1234',
        to_bank_code='211', # bank code, e.g Stanbic IBTC is 211
        to_account_number='0000000000', # Account number for the stated bank_code
        meta={"my_reference": "12345"}, # optional dict. e.g {"my_reference": "12345"}
    )

    # example response
    {
        "status": "successful",
        "message": "Transfer is processing",
        "data": {
            "id": "62f0c405dcf59e51e408daf9"
        }
    }

Retrieve a bank account

  • Get Account detail
    res = client.get_account(account_id=account_id, virtual=True)

Get list of banks

  • Retrieve banks
    res = client.get_banks()

    # example response
    {
        "status": "successful",
        "data": [
            {
                "name": "Access Bank",
                "code": "044"
            },
            {
                "name": "Citi Bank",
                "code": "023"
            }
            ...
            ...
        ]
    }

Docs

Learn how to use each function
    help(client.transfer)
View all available functions
    dir(client)

Authors

Abdulrasheed Ibrahim @CodePharaoh

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mono_client-0.3.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mono_client-0.3.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mono_client-0.3.1.tar.gz.

File metadata

  • Download URL: mono_client-0.3.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for mono_client-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4aed94ad888b72d520244b7faedfc26302066aa5eab6de7d73711c5eef301fa2
MD5 b3569ba8ca4e4bbc01a16132026c6a7f
BLAKE2b-256 0aed6e93e4e4d2c1eb662e84fb9bcecab198f3588c5c9b71df74716f84d3a41a

See more details on using hashes here.

File details

Details for the file mono_client-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: mono_client-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for mono_client-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bab3b276874141de10d3faabc1b1bb01bbc4f413d1475c78630124b46c4f377a
MD5 08162cd83631df58a9d210bc94dd14c0
BLAKE2b-256 c6869e450dc691c0a6d0e4657d975bc3ab9ad98992d55fbf77a9cd01f1af8584

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page