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

# API Reference

The following section outlines the API of mobilemoney.js.

## Client

### *`export`*` ``Client()`

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

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

## Error

The following error 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 %}

### *`export`*` ``MomoException`

&#x20; The base Exception for mobilemoney.py

### *`export`*` ``HTTPError`

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

### *`export`*` ``Unauthorized`

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

&#x20; subclass of `HTTPError`

### *`export`*` ``MomoServerError`

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

&#x20; subclass of `HTTPError`

### *`export`*` ``InvalidData`

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

&#x20; subclass of `HTTPError`

### *`export`*` ``NotFound`

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

&#x20; subclass of `HTTPError`

### *`export`*` ``Conflict`

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

&#x20; subclass of `HTTPError`

### *`export`*` ``InvalidUniqueIDVersion`

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

&#x20; subclass of `Error`

### *`export`*` ``InvalidBasicToken`

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

&#x20; subclass of `Error`

### *`export`*` ``InvalidBearerToken`

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

&#x20; subclass of `Error`
