> For the complete documentation index, see [llms.txt](https://docs.advancly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.advancly.com/customer.md).

# Customer

Aggregated API endpoint for customer

## Onboard Individual Customer (Investor/Borrower)

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/api/v2/client/customers/onboard_individual`

#### Headers

| Name                                        | Type   | Description                     |
| ------------------------------------------- | ------ | ------------------------------- |
| client-id<mark style="color:red;">\*</mark> | String | Developer generated `client id` |
| api-key<mark style="color:red;">\*</mark>   | String | Developer generated `api key`   |

#### Request Body

| Name                                                           | Type    | Description                                                                                                                                                                               |
| -------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| first\_name<mark style="color:red;">\*</mark>                  | string  |                                                                                                                                                                                           |
| last\_name<mark style="color:red;">\*</mark>                   | string  |                                                                                                                                                                                           |
| gender<mark style="color:red;">\*</mark>                       | string  |                                                                                                                                                                                           |
| date\_of\_birth<mark style="color:red;">\*</mark>              | string  |                                                                                                                                                                                           |
| educational\_qualification                                     | string  |                                                                                                                                                                                           |
| customer\_unique\_identifier<mark style="color:red;">\*</mark> | string  |                                                                                                                                                                                           |
| next\_of\_kin\_first\_name                                     | string  |                                                                                                                                                                                           |
| next\_of\_kin\_last\_name                                      | string  |                                                                                                                                                                                           |
| next\_of\_kin\_email                                           | string  |                                                                                                                                                                                           |
| next\_of\_kin\_phone\_number                                   | string  |                                                                                                                                                                                           |
| next\_of\_kin\_gender                                          | string  |                                                                                                                                                                                           |
| relationship\_with\_next\_kin                                  | string  |                                                                                                                                                                                           |
| next\_of\_kin\_dial\_code                                      | string  |                                                                                                                                                                                           |
| next\_of\_kin\_street                                          | string  |                                                                                                                                                                                           |
| next\_of\_kin\_city                                            | string  |                                                                                                                                                                                           |
| next\_of\_kin\_state                                           | string  |                                                                                                                                                                                           |
| next\_of\_kin\_country                                         | string  |                                                                                                                                                                                           |
| phone\_number<mark style="color:red;">\*</mark>                | string  |                                                                                                                                                                                           |
| email<mark style="color:red;">\*</mark>                        | string  |                                                                                                                                                                                           |
| bank\_code                                                     | string  |                                                                                                                                                                                           |
| bank\_account\_number                                          | string  |                                                                                                                                                                                           |
| bank\_account\_name                                            | string  |                                                                                                                                                                                           |
| bank\_name                                                     | string  |                                                                                                                                                                                           |
| routing\_number                                                | string  |                                                                                                                                                                                           |
| swift\_code                                                    | string  |                                                                                                                                                                                           |
| address<mark style="color:red;">\*</mark>                      | string  |                                                                                                                                                                                           |
| postal\_code                                                   | string  |                                                                                                                                                                                           |
| city                                                           | string  |                                                                                                                                                                                           |
| state                                                          | string  |                                                                                                                                                                                           |
| country\_code<mark style="color:red;">\*</mark>                | string  |                                                                                                                                                                                           |
| customer\_category                                             | string  |                                                                                                                                                                                           |
| customer\_onboarding\_type<mark style="color:red;">\*</mark>   | integer |                                                                                                                                                                                           |
| partner\_date\_registered                                      | string  |                                                                                                                                                                                           |
| tax\_identification\_number                                    | string  |                                                                                                                                                                                           |
| create\_wallet<mark style="color:red;">\*</mark>               | boolean |                                                                                                                                                                                           |
| customer\_documents                                            | Array   | <p>Array of documents to be uploaded during signup eg \[{<br>   "document\_type\_code": "",<br>   "base64\_file\_string": "",</p><p>   "filename\_with\_extension": "alexa.png"<br>}]</p> |
| photo\_url                                                     | string  |                                                                                                                                                                                           |

{% tabs %}
{% tab title="201: Created Response for borrower" %}

```json
{
    "borrower_id": id,
    "first_name": "firstname",
    "last_name": "lastname",
    "company_name": "",
    "borrower_phone": "phonenumber",
    "sso_user_id": "userid",
    "bvn": "bvn",
    "message": "Onboarding successful",
    "status": true,
    "status_code": 201
}
```

{% endtab %}

{% tab title="201: Created Response for investor" %}

```json
{
    "funder_id": id,
    "first_name": "firstname",
    "company_name": "",
    "phone_number": "phonenumber",
    "email": "email",
    "last_name": "lastname",
    "funder_type": "fundertype",
    "sso_user_id": "userid",
    "message": "Onboarding successful",
    "status": true,
    "status_code": 201
}
```

{% endtab %}
{% endtabs %}

## Onboard Corporate Customer

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/api/v2/client/customers/onboard_corporate`

#### Headers

| Name                                        | Type   | Description                     |
| ------------------------------------------- | ------ | ------------------------------- |
| client-id<mark style="color:red;">\*</mark> | string | Developer generated `client id` |
| api-key<mark style="color:red;">\*</mark>   | string | Developer generated `api key`   |

#### Request Body

| Name                                                             | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| company\_name<mark style="color:red;">\*</mark>                  | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| business\_registration\_number<mark style="color:red;">\*</mark> | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| business\_registration\_date<mark style="color:red;">\*</mark>   | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| corporate\_customer\_people<mark style="color:red;">\*</mark>    | Array   | Array of people to be added e.g \[ { "first\_name": "antonio", "last\_name": "banderas", "middle\_name": "", "email": "<antband@yopmail.com>", "gender": "male", "date\_of\_birth": "1992-04-14", "address": "neisndf", "city": "neodnrtb", "state": "nasmddi", "phone\_number": "09182834494", "country\_code": "NG", "person\_type": 1, "identity\_number": "22397319289", "individual\_tax\_identification-number": "", "educational\_qualification": "Emeritus" } ] |
| phone\_number<mark style="color:red;">\*</mark>                  | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| email<mark style="color:red;">\*</mark>                          | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| bank\_code                                                       | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| bank\_account\_number                                            | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| bank\_account\_name                                              | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| bank\_name                                                       | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| routing\_number                                                  | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| swift\_code                                                      | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| address<mark style="color:red;">\*</mark>                        | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| postal\_code                                                     | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| city                                                             | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| state                                                            | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| country\_code<mark style="color:red;">\*</mark>                  | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| customer\_category                                               | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| customer\_onboarding\_type<mark style="color:red;">\*</mark>     | integer |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| partner\_date\_registered                                        | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| tax\_identification\_number                                      | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| create\_wallet<mark style="color:red;">\*</mark>                 | boolean |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| customer\_documents                                              | Array   | <p>Array of documents to be uploaded during signup eg \[{<br>   "document\_type\_code": "",<br>   "base64\_file\_string": "",</p><p>   "filename\_with\_extension": "alexa.png"<br>}]</p>                                                                                                                                                                                                                                                                               |
| photo\_url                                                       | string  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

{% tabs %}
{% tab title="201: Created Response for borrower" %}

```json
{
    "borrower_id": id,
    "first_name": "",
    "last_name": "",
    "company_name": "companyname",
    "borrower_phone": "phonenumber",
    "sso_user_id": "userid",
    "bvn": null,
    "message": "Onboarding successful",
    "status": true,
    "status_code": 201
}
```

{% endtab %}

{% tab title="201: Created Response for investor" %}

```json
{
    "funder_id": id,
    "first_name": "",
    "company_name": "companyname",
    "phone_number": "phonenumber",
    "email": "email",
    "last_name": "",
    "funder_type": "fundertype",
    "sso_user_id": "userid",
    "message": "Onboarding successful",
    "status": true,
    "status_code": 201
}
```

{% endtab %}
{% endtabs %}

## Get Customer

<mark style="color:blue;">`GET`</mark> `{{baseUrl}}/api/v2/client/customers`

#### Query Parameters

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| email          | string |             |
| phone\_number  | string |             |
| customer\_type | string |             |
| from\_date     | date   |             |
| to\_date       | date   |             |
| customer\_id   | number |             |

#### Headers

| Name                                        | Type   | Description                     |
| ------------------------------------------- | ------ | ------------------------------- |
| client-id<mark style="color:red;">\*</mark> | string | Developer generated `client id` |
| api-key<mark style="color:red;">\*</mark>   | string | Developer generated `api key`   |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Load Customer Stock Data

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/api/v2/client/customers/data/stock`

#### Query Parameters

| Name             | Type   | Description                                   |
| ---------------- | ------ | --------------------------------------------- |
| phone\_number    | string | customer's phone number                       |
| email            | string | customer's email                              |
| identity\_number | string | customer's identity number used in onboarding |

#### Headers

| Name                                        | Type   | Description                     |
| ------------------------------------------- | ------ | ------------------------------- |
| client-id<mark style="color:red;">\*</mark> | string | Developer generated `client id` |
| api-key<mark style="color:red;">\*</mark>   | string | Developer generated `api key`   |

#### Request Body

| Name                                   | Type  | Description                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data<mark style="color:red;">\*</mark> | Array | <mark style="color:blue;">`{ "data": [ { "product_id": "2023-04-09T23:05:13.458Z", "product_category": "string", "minimum_stock_quantity": 0, "total_quantity": 0, "available_quantity": 0, "reserved_quantity": 0, "unit_price": 0, "tax_amount": 0, "discount_amount": 0, "net_price": 0, "stock_level": "string", "date": "2023-12-12T18:00:50.026Z" } ] }`</mark> |

{% tabs %}
{% tab title="200: OK " %}

```json
{ 
  "message": "string",
  "status": true,
  "status_code": 0
}
```

{% endtab %}
{% endtabs %}

## Load Customer Orders Data

<mark style="color:green;">`POST`</mark> `{{baseUrl}}/api/v2/client/customers/data/orders`

#### Query Parameters

| Name             | Type   | Description                                   |
| ---------------- | ------ | --------------------------------------------- |
| phone\_number    | string | customer's phone number                       |
| email            | string | customer's email                              |
| identity\_number | string | customer's identity number used in onboarding |

#### Headers

| Name                                        | Type   | Description                     |
| ------------------------------------------- | ------ | ------------------------------- |
| client-id<mark style="color:red;">\*</mark> | string | Developer generated `client id` |
| api-key<mark style="color:red;">\*</mark>   | string | Developer generated `api key`   |

#### Request Body

| Name                                   | Type  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data<mark style="color:red;">\*</mark> | Array | <mark style="color:blue;">`{ "data": [ { "order_id": "string", "order_sub_amount": 0, "discount_amount": 0, "tax_amount": 0, "order_amount": 0, "order_date": "2023-04-09T23:58:04.110Z", "order_currency": "string", "payment_type": "string", "customer_rating": "string", "customer_category": "string", "store_name": "string", "address": "string", "city": "string", "state": "string", "country": "string", "gps_location": "string", "is_credit": true, "total_items": 0, "order_items": [ { "product_id": "string", "product_category": "string",  "product_rating": "string", "unit_price": 0, "quantity": 0, "amount": 0 } ] } ] }`</mark> |

{% tabs %}
{% tab title="200: OK " %}

```json
{ 
  "message": "string",
  "status": true,
  "status_code": 0
}
```

{% endtab %}
{% endtabs %}
