> For the complete documentation index, see [llms.txt](https://momopy.rewriteapi.cm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://momopy.rewriteapi.cm/reference/api-reference.md).

# API Reference

The following section outlines the API of mobilemoney.py.

## Version Info

### `mobilemoney.__version__`

A string representation of the version

## Client

### *`class mobilemoney.`*`Client()`

| Methods                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------- |
| *def* [`collection()`](/reference/api-reference/client.md#collection_client)                                         |
| *def* [`disbursements()`](/reference/api-reference/client.md#disbursements-subscription_key)                         |
| *async* [`create_api_user()`](/reference/api-reference/client.md#create_api_user-uuid-subscription_key-url_callback) |
| *async* [`get_api_user()`](/reference/api-reference/client.md#get_api_user-uuid-subsciption_key)                     |
| *async* [`create_api_key()`](/reference/api-reference/client.md#create_api_key-uuid-subscription_key)                |
| *def* [`get_reference_id()`](/reference/api-reference/client.md#get_reference_id)                                    |
| *def* [`is_sandbox()`](/reference/api-reference/client.md#is_sandbox)                                                |
| *def* [`basic_token()`](/reference/api-reference/client.md#basic_token-apiuser-apikey)                               |
| *def* [`bearer_token()`](/reference/api-reference/client.md#bearer_token-token)                                      |

{% content-ref url="/pages/UEqn31rFao7CeS0Ki9Bb" %}
[Client](/reference/api-reference/client.md)
{% endcontent-ref %}

## Exception

The following exceptions are thrown by the library.

{% hint style="info" %}
Please note that every request are susceptible to throw all these exception. Make sure to handle it well.
{% endhint %}

### *`exception mobilemoney.`*`MomoException`

&#x20; The base Exception for mobilemoney.py

### *`exception mobilemoney`*`.HTTPException (response, message )`

&#x20; Exception that’s raised when an HTTP request operation fails.

### *`exception mobilemoney`*`.Unauthorized ( response, message )`

&#x20; Exception that’s raised for when status code 401 occurs.

&#x20; subclass of `HTTPException`

### *`exception mobilemoney`*`.MomoServerError ( response, message )`

&#x20; Exception that’s raised for when status code 500 occurs.

&#x20; subclass of `HTTPException`

### *`exception mobilemoney`*`.InvalidData ( response, message )`

&#x20; Exception that’s raised for when status code 400 occurs.

&#x20; subclass of `HTTPException`

### *`exception mobilemoney`*`.NotFound ( response, message )`

&#x20;  Exception that’s raised for when status code 404 occurs.

&#x20; subclass of `HTTPException`

### *`exception mobilemoney`*`.Conflict ( response, message )`

&#x20; Exception that’s raised for when status code 409 occurs.

&#x20; subclass of `HTTPException`

### *`exception mobilemoney`*`.InvalidUniqueIDVersion`

&#x20; Exception that's raised for when UUID is not a valid version 4.

&#x20; subclass of `Exception`

### *`exception mobilemoney`*`.InvalidBasicToken`

&#x20; Exception that's raised for a invalid Basic token type.

&#x20; subclass of `Exception`

### *`exception mobilemoney`*`.InvalidBearerToken`

&#x20; Exception that's raised for a invalid Bearer token type.

&#x20; subclass of `Exception`
