# 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":""
      }
   ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pezesha.com/user-registration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
