# Client

Represent a Client agent that interact with all MTN MOMO API product

### `collection( subscriptionKey )` <a href="#collection_client" id="collection_client"></a>

Method to get collection client

#### Parameter :

&#x20;         **subscriptionKey** (string) - The subscription key of the collection product

#### Return :

The collection agent

#### Return Type :

[Collection](https://momojs.rewriteapi.cm/reference/api-reference/client/collection)

### `disbursements( subscriptionKey )`

Method to get disbursement client

#### Parameter:

&#x20;          **subscriptionKey** (string) - The subscription key of the disbursement product

#### Return :

The disbursement agent

#### Return Type:

[Disbursement](https://momojs.rewriteapi.cm/reference/api-reference/client/disbursements)

### *`await`*` ``createApiUser( uuid, subscriptionKey, urlCallback )`

Method in charge of creating API USER from wallet provider

#### Parameter :

* **uuid** (string) - a valid UUID version 4
* **subscriptionKey** (string) - the subscription key of any product&#x20;
* **urlCallback** (Optional\[string]) - the website receiving call back

#### Return :

\[boolean, data] boolean is true if the user was created successfully

#### Return Type:

array

### *`await`*` ``getApiUser( uuid, subsciptionKey )`

Method in charge of getting API USER from wallet provider

#### Parameter :

* **uuid** (string) - a valid UUID version 4
* **subscriptionKey** (string) - the subscription key of the product that user was       created for

#### Return :

\[True, data]

#### Return Type:

array.   &#x20;

### *`await`*` ``createApiKey( uuid, subscriptionKey )`

Method in charge of creating API KEY from wallet provider

#### Parameter :

* **uuid** (string) - a valid UUID version 4
* **subscriptionKey** (string) - the subscription key of the product that user was       created for

#### Return :

\[True, data]

{% tabs %}
{% tab title="data" %}

```json
{
  "apiKey": "string"
}
```

{% endtab %}
{% endtabs %}

#### Return Type:

array

### `getReferenceId()`

Method to create UUID version 4

#### Return :

UUID version 4

#### Return Type:

String

### `isSandbox()`

method to turn on sandbox environment

{% hint style="danger" %}
If you intend to run in sandbox environment, make sure to call this method before any type of request
{% endhint %}

### `basicToken( apiUser, apiKey )`

Method to create basic token from API USER & API KEY

#### Parameter :

* **apiUser** (string) - the API USER&#x20;
* **apiKey** (string) - the API KEY

#### Return :

Basic token

#### Return Type :

str

### `bearerToken( token )`

Method to convert access token to Bearer token

#### Parameter :

* token (string) - the authentification token

#### Return :

Bearer token

#### Return Type :

string
