# Account Registration (signup)

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td><div><div>/signup</div></div></td><td>POST</td><td>Yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Server**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Basic</td><td style="height: 29.8785px;">Internal</td><td style="height: 29.8785px;">USAPI</td></tr></tbody></table>

##### Header

<table border="1" id="bkmrk-parameter-value-%C2%A0" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 64.5241%;"></col><col style="width: 35.4759%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Parameter**  
</td><td style="height: 29.8785px;">**Value**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">authorization</td><td>Basic &lt;auth key&gt;</td></tr></tbody></table>

##### Body request

```json
{
    "username": "test20250219000",
    "password": "test20250219000",
    "email": "hendy.juliyanto@ondelivery.id",
    "first_name": "test mail",
    "last_name": "without phone",
    "mode": "OTP",
    "phone_number": "62123456789",
    "platform": "ONAPPS"
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%; height: 392.391px;"><colgroup><col style="width: 18.7886%;"></col><col style="width: 18.7886%;"></col><col style="width: 11.1248%;"></col><col style="width: 9.91942%;"></col><col style="width: 41.3785%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Properties**  
</td><td style="height: 29.7969px;">**Properties of**</td><td style="height: 29.7969px;">**Data type**</td><td style="height: 29.7969px;">**Required**</td><td style="height: 29.7969px;">**Description**</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">username</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;">Username must be unique</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">password</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;"></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">email</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;">email must be unique

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">first\_name</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;"></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">last\_name</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;"></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">mode</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">no</td><td style="height: 29.7969px;">Possible values: "LINK" or "OTP"

"LINK": Verification via email

"OTP": Verification via SMS

</td></tr><tr style="height: 154.016px;"><td style="height: 154.016px;">phone\_number</td><td style="height: 154.016px;">  
</td><td style="height: 154.016px;">string</td><td style="height: 154.016px;">no</td><td style="height: 154.016px;">1. Phone number must be unique
2. Phone number format starts from 62 (62xxxx)
3. Without 62: Minimum length is 7 and maximum length is 15
4. With 62: Minimum length is 9 and maximum length is 17

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">platform</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">no</td><td style="height: 29.7969px;">Possible values:

- ONMART
- ONMARKET
- OSAS

</td></tr></tbody></table>

<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 OK (LINK mode)</p>

```json
{
    "status": true,
    "message": "Please check your email to complete registration",  
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidGVzdGFjY291bnQyMDI1MDIyNDAwMCIsInVzZXJuYW1lIjoidGVzdGFjY291bnQyMDI1MDIyNDAwMCIsInB3ZCI6IiQyYiQwOCRUT2djQS5oV1VhSUVlQ05ySnIxRVIuRERpaW8vbVFDSTNWVWZvWnFKcTQyVXBaZkFWNUpMdSIsImVtYWlsIjoiaGVuZHkuanVsaXlhbnRvQG9uZGVsaXZlcnkuaWQiLCJmaXJzdF9uYW1lIjoidGVzdCBhY2NvdW50IiwibGFzdF9uYW1lIjoid2l0aCBlbWFpbCIsInBob25lX251bWJlciI6bnVsbCwibW9kZSI6IkxJTksiLCJleHAiOjE3NDAzNjg5NjQsIm90cCI6IjgzNDkzMSIsImlhdCI6MTc0MDM2NzE2NH0.V0l-YGLJ08FvmmH3HF4phrEKBUzJmelAJnXZOkIHu4E",
    "exp": 1740368964,
    "exp_otp": 18000
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">400 Bad request  
Phone number is invalid</p>

```json
{
    "message": "The phone number format is invalid. Please use the format: 628XXXXXXXXX"
}
```

<p class="callout danger">400 Bad request  
Duplicate phone number</p>

```json
{
    "message": "Phone number already exist"
}
```

<p class="callout danger">400 Bad request  
Duplicate username</p>

```json
{
    "message": "Username already exist"
}
```

<p class="callout danger">400 Bad request  
Duplicate email</p>

```json
{
    "message": "Email already exist"
}
```

<p class="callout danger">500 Internal server error</p>

```json
{
    "message": "Internal error"
}
```

</details>