> For the complete documentation index, see [llms.txt](https://e2payprod.gitbook.io/emoney-and-disbursement/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://e2payprod.gitbook.io/emoney-and-disbursement/api-specification/customer-resource/customer-registration.md).

# Customer Registration

This service are collection of api which will use customer accounts

## Customer Registration

This service is used to initiate customer registration process by client host. After this service has been performed, customer will receive authorization email and SMS token to confirm the registration process.

### 1. Registration Request

Customer input customer data from mobile apps and mobile backend will be forward the request to INVAS. System will generate token and send email containing complete registration and send SMS token to customer.

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

| Canonical Path | /b2b/customer/register        |
| -------------- | ----------------------------- |
| Method         | POST                          |
| Authorization  | Bearer \<host\_access\_token> |
| Query Param    | -                             |
| Content-Type   | application/json              |
| Content        |                               |

{% code overflow="wrap" %}

```json
{
    "phone": <String, not null>, 
    "name": <String, not null>, 
    "birthDate": <Date, not null>, 
    "birthPlace": <String, not null>, 
    "email": <String>,
    "gender": <Boolean, not null>, 
    "countryId": <String, not null>, 
    "sourceId": <String>,
    "accountGroupId": <String, not null>
}   
```

{% endcode %}

{% code overflow="wrap" %}

```json
// Sample Code:
{
    "phone": “081234567890”,
    "name": “Septian Cahyo”, 
    "birthDate": “1990-12-31”, 
    "birthPlace": “Jakarta”, 
    "email": “email@gmail.com”, 
    "gender": true, 
    "countryId":”ID”, 
    "sourceId": “01011”,
    "accountGroupId": “01”
}
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

| Content-Type | application/json |
| ------------ | ---------------- |
| Content      |                  |

{% code overflow="wrap" %}

```json
{
"expiryMinutes": 10,
"expiryTimestamp": "2020-01-15 16:03:56",
"requestTimestamp": "2020-01-15 15:53:56",
"phone": "08950944791",
"active": true, 
"tokenPrefix": "UWA",
"id": "1deb0955ba6448ecafecf2d8b457263b", 
"tokenType": "REGISTRATION",
"attempt": 1,
"username": "08950944791"
“accountGroupId:”01”
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Description

| Field            | Description                        |
| ---------------- | ---------------------------------- |
| expiryMinutes    | Expiry Time for Token (in minutes) |
| expiryTimestamp  | Expiry Time for Token              |
| requestTimestamp | Request Time                       |
| phone            | Phone number                       |
| active           | Token activation status            |
| tokenPrefix      | Token Prefix                       |
| id               | Registration Request Id            |
| tokenType        | Token Type                         |
| attempt          | Attempt                            |
| username         | Username                           |
| accountGroipId   | Account Group ID                   |

### 2. Complete Registration

This api used to complete the registration process

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

| Canonical Path | /b2b/customer/register/confirm |
| -------------- | ------------------------------ |
| Method         | POST                           |
| Authorization  | Bearer \<host\_access\_token>  |
| Query Param    | -                              |
| Content-Type   | application/json               |
| Content        |                                |

{% code overflow="wrap" %}

```json
{
    "username": <String, not null>, 
    "password": <String, not null>, 
    "token": <String>
}
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

| Content-Type  | - |
| ------------- | - |
| Content       | - |
| {% endtab %}  |   |
| {% endtabs %} |   |

## Description

| Field    | Description                                                 |
| -------- | ----------------------------------------------------------- |
| username | Customer Username : phone number                            |
| password | Customer Password *(must be hashed by using MD5 UPPERCASE)* |
| token    | Registration Token *(using prefix, example = UhY1234)*      |

## 3. Verify Username

This service is used to verify whether a username has already used or not

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

| Canonical Path | /b2b/customer/auth/verifyUsername |
| -------------- | --------------------------------- |
| Method         | GET                               |
| Authorization  | Bearer \<host\_access\_token>     |
| Query Param    | §  username                       |
| Content-Type   | -                                 |
| Content        | -                                 |
| {% endtab %}   |                                   |

{% tab title="Response" %}

| Content-Type | application/json |
| ------------ | ---------------- |
| Content      | -                |

<pre class="language-json" data-overflow="wrap"><code class="lang-json">{
<strong>    “exists”: &#x3C;Boolean, not null>
</strong>}
</code></pre>

{% endtab %}
{% endtabs %}

## Description

| Field    | Description                                                 |
| -------- | ----------------------------------------------------------- |
| username | Customer username : Phone Number                            |
| exists   | Will be true if username already exists and false otherwise |

## 4. Verify Email

This service is used to verify whether a username has already used or not

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

| Canonical Path | /b2b/customer/auth/verifyEmail |
| -------------- | ------------------------------ |
| Method         | GET                            |
| Authorization  | Bearer \<host\_access\_token>  |
| Query Param    | §  email                       |
| Content-Type   | -                              |
| Content        | -                              |
| {% endtab %}   |                                |

{% tab title="Response" %}

| Content-Type | application/json                                      |
| ------------ | ----------------------------------------------------- |
| Content      | <p>{</p><p>“exists”: \<Boolean, not null></p><p>}</p> |

| Canonical Path | /b2b/customer/auth/verifyEmail |
| -------------- | ------------------------------ |
| Method         | GET                            |
| Authorization  | Bearer \<host\_access\_token>  |
| Query Param    | §  email                       |
| Content-Type   | -                              |
| Content        | -                              |

| Canonical Path | /b2b/customer/auth/verifyEmail |
| -------------- | ------------------------------ |
| Method         | GET                            |
| Authorization  | Bearer \<host\_access\_token>  |
| Query Param    | §  email                       |
| Content-Type   | -                              |
| Content        | -                              |
| {% endtab %}   |                                |
| {% endtabs %}  |                                |

## Description

| Field    | Description                                                 |
| -------- | ----------------------------------------------------------- |
| username | Customer username : Phone Number                            |
| exists   | Will be true if username already exists and false otherwise |

## 5. Resend Registration SMS Token

This service used to resend customer registration SMS token.

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

| Canonical Path | /b2b/customer/resend/registration/sms |
| -------------- | ------------------------------------- |
| Method         | POST                                  |
| Authorization  | Bearer \<host\_access\_token>         |
| Query Param    | -                                     |
| Content-Type   | application/json                      |
| Content        |                                       |

{% code overflow="wrap" %}

```json
{
    "username": <String, not null>, 
    "phone": <String, not null>
}
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

| Content-Type  | - |
| ------------- | - |
| Content       | - |
| {% endtab %}  |   |
| {% endtabs %} |   |

## Description

| Field    | Description                     |
| -------- | ------------------------------- |
| username | Username merchant: phone number |
| phone    | Merchant phone number           |

## 6. Resend Registration Email

This service used to resend customer registration email.

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

| Canonical Path | /b2b/customer/resend/registration/email |
| -------------- | --------------------------------------- |
| Method         | POST                                    |
| Authorization  | Bearer \<host\_access\_token>           |
| Query Param    | -                                       |
| Content-Type   | application/json                        |
| Content        |                                         |

{% code overflow="wrap" %}

```json
{
    "username": <String, not null>, 
    "phone": <String, not null>
}
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

| Content-Type  | - |
| ------------- | - |
| Content       | - |
| {% endtab %}  |   |
| {% endtabs %} |   |

## Description

| Field    | Description                     |
| -------- | ------------------------------- |
| username | Username merchant: phone number |
| phone    | Merchant phone number           |
