# User Registration

{% hint style="warning" %}
**Pezesha ID**

Make sure to persist **customer\_id** as you will need this during loan application (**pezesha\_id**)
{% endhint %}

## Register Merchant

<mark style="color:green;">`POST`</mark> `{{BASE_URL}}/mfi/v1/borrowers`

This endpoint allows you to register merchant on to PEZESHA

#### Headers

| Name                                             | Type   | Description                                                 |
| ------------------------------------------------ | ------ | ----------------------------------------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token generated from Authentication Endpoint |

#### Request Body

| Name                | Type      | Description                                                    |
| ------------------- | --------- | -------------------------------------------------------------- |
| terms               | boolean   | User has accepted Pezesha Ts\&Cs                               |
| location            | string    | Location of merchant business                                  |
| merchant\_reg\_date | string    | Date Merchant was first registered in Pezesha partner's system |
| merchant\_id        | string    | Merchant ID in partner's system                                |
| email               | string    | User's email ID                                                |
| dob                 | string    | Date of Birth (**Y-m-d format**)                               |
| phone               | string    | User's phone number                                            |
| full\_names         | string    | Full Names                                                     |
| national\_id        | string    | National ID Number                                             |
| other\_phone\_nos   | string\[] | Other phone numbers tied to merchant                           |
| geo\_location.long  | string    |                                                                |
| geo\_location.lat   | string    |                                                                |
| meta\_data          | array     | Additional data requested by Pezesha in Key Value Pairs        |
| channel             | string    | The Client Name shared by Pezesha                              |

{% tabs %}
{% tab title="200 Registration Successful." %}

```javascript
{
   "error":false,
   "status":200,
   "response_code":0,
   "data":{
      "customer_id":1,
      "customer_names":"John",
      "customer_identification":"292309489",
      "customer_phoneno":"0721234567"
   }
}

```

{% endtab %}

{% tab title="422 Validation error" %}

```javascript
{
  "error": true,
  "status": 422,
  "message": {
	"phone": [
  	"The phone field is required."
	]
  }
}
{
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "geo_location":{
      "long":"",
      "lat":""
   }
}{
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "geo_location":{
      "long":"",
      "lat":""
   }
}{
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "geo_location":{
      "long":"",
      "lat":""
   }
}{
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "geo_location":{
      "long":"",
      "lat":""
   }
}wddwe{
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "geo_location":{
      "long":"",
      "lat":""
   }
}{
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "geo_location":{
      "long":"",
      "lat":""
   }
}
```

{% endtab %}
{% endtabs %}

```json
{
   "channel": "Partner Name",
   "full_names":"John Doe",
   "phone":"254721XXXXXX",
   "other_phone_nos":[
      "25471XXXXXXX",
      "25472XXXXXXXX"
   ],
   "national_id":"12311313",
   "dob":"1999-01-01",
   "email":"example@gmail.com",
   "gender":"Female",
   "merchant_id":"",
   "merchant_reg_date":"",
   "location":"",
   "county":"",
   "sub_county":"",
   "alternative_customer_phoneno":"",
   "next_of_kin_name":"",
   "next_of_kin_phoneno":"",
   "geo_location":{
      "long":"",
      "lat":""
   },
   "meta_data":[
      {
         "key":"",
         "value":""
      }
   ]
}
```
