USAPI
- Login USAPI
- Account Registration -Internal
- Account Registration (signup)
- Update basic profile
- Email verification
Login USAPI
Link:
| Environment | Link |
| Production | https://usapi.onindonesia.id |
| Demo | https://demousapi.onindonesia.id |
Endpoint
| Endpoint | Method |
| /auth | POST |
Body request
{
"username": "usernew1",
"password": "abc123",
"options": {
"nativeApp": false
}
}
| Properties |
Data type | Required | Description |
| username | string | yes | |
| password | string | yes | |
| options | object | ||
| nativeApp | boolean | yes | This value determines whether the payload is coming from Mobile Apps ONAPPS (nativeApp: true) or not. |
Result example
OK (200)
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vy"
}
Error example
Body request example
insert code here
Account Registration -Internal
Endpoint
| Endpoint | Method |
Authentication |
|
/internal/register
|
POST | Yes |
Authentication
| Type |
Token source |
Server |
| Basic | Internal | USAPI |
Header
| Parameter |
Value |
| authorization | Basic <auth key> |
Body request
{
"username": "test regis 3",
"password": "test regis 3",
"first_name": "second",
"last_name": "test account",
"phone_number": "621234567891",
"email": "test@abc.com"
}
| Properties |
Properties of | Data type | Required | Description |
| username | string | yes | Username must be unique | |
| password | string | yes |
|
|
| first_name | string | yes |
|
|
| last_name | string | yes |
|
|
| phone_number | string | yes |
|
|
| string | yes |
Email must be unique |
Result example
200 Ok
{
"status": true,
"message": "Account has been created"
}
Error example
400 Bad request
Phone number is invalid
{
"message": "Invalid phone number format"
}
400 Bad request
Duplicate phone number
{
"message": "Phone number already exist"
}
400 Bad request
Duplicate username
{
"message": "Username already exist"
}
400 Bad request
Duplicate email
{
"message": "Email already exist"
}
500 Internal server error
{
"message": "Internal error"
}
Account Registration (signup)
Endpoint
| Endpoint | Method |
Authentication |
|
/signup
|
POST | Yes |
Authentication
| Type |
Token source |
Server |
| Basic | Internal | USAPI |
Header
| Parameter |
Value |
| authorization | Basic <auth key> |
Body request
{
"username": "test20250219000",
"password": "test20250219000",
"email": "hendy.juliyanto@ondelivery.id",
"first_name": "test mail",
"last_name": "without phone",
"mode": "OTP",
"phone_number": "62123456789",
"platform": "ONAPPS"
}
| Properties |
Properties of | Data type | Required | Description |
| username | string | yes | Username must be unique | |
| password | string | yes |
|
|
| string | yes |
email must be unique |
||
| first_name | string | yes |
|
|
| last_name | string | yes |
|
|
| mode | string | no |
Possible values: "LINK" or "OTP" "LINK": Verification via email "OTP": Verification via SMS |
|
| phone_number | string | no |
|
|
| platform | string | no |
Possible values:
|
Result example
200 OK (LINK mode)
{
"status": true,
"message": "Please check your email to complete registration",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoidGVzdGFjY291bnQyMDI1MDIyNDAwMCIsInVzZXJuYW1lIjoidGVzdGFjY291bnQyMDI1MDIyNDAwMCIsInB3ZCI6IiQyYiQwOCRUT2djQS5oV1VhSUVlQ05ySnIxRVIuRERpaW8vbVFDSTNWVWZvWnFKcTQyVXBaZkFWNUpMdSIsImVtYWlsIjoiaGVuZHkuanVsaXlhbnRvQG9uZGVsaXZlcnkuaWQiLCJmaXJzdF9uYW1lIjoidGVzdCBhY2NvdW50IiwibGFzdF9uYW1lIjoid2l0aCBlbWFpbCIsInBob25lX251bWJlciI6bnVsbCwibW9kZSI6IkxJTksiLCJleHAiOjE3NDAzNjg5NjQsIm90cCI6IjgzNDkzMSIsImlhdCI6MTc0MDM2NzE2NH0.V0l-YGLJ08FvmmH3HF4phrEKBUzJmelAJnXZOkIHu4E",
"exp": 1740368964,
"exp_otp": 18000
}
Error example
400 Bad request
Phone number is invalid
{
"message": "The phone number format is invalid. Please use the format: 628XXXXXXXXX"
}
400 Bad request
Duplicate phone number
{
"message": "Phone number already exist"
}
400 Bad request
Duplicate username
{
"message": "Username already exist"
}
400 Bad request
Duplicate email
{
"message": "Email already exist"
}
500 Internal server error
{
"message": "Internal error"
}
Update basic profile
Endpoint
| Endpoint | Method |
Authentication |
| /update-basic-profile | POST | Yes |
Authorization
| Type |
Token source |
Server |
| Bearer | login USAPI | USAPI |
Header
| Parameter |
Value |
| Authorization | Bearer <auth> |
Body request
Content-Type: multipart/form-data
| Properties |
Properties of | Data type | Required | Description |
| basic_profile | ||||
| date_of_birth | basic_profile | string | yes | |
| gender | basic_profile | string | yes |
Accepted values:
|
| phone_number | basic_profile | string | yes | |
| profile_img | file | no |
Example:
| Properties |
Value |
| basic_profile |
{
"gender": "Laki-Laki",
"phone_number": "6287654321",
"date_of_birth": "1996-10-18"
}
|
| profile_img | image.jpg |
Result example
200 OK
{
"status": true,
"message": "Success update profile"
}
Error example
500 Internal server error
{
"message": "Error on update profile."
}
Email verification
Endpoint
| Endpoint | Method |
Authentication |
|
/check/email
|
POST | no |
Body request
{
"email": "value"
}
| Properties |
Properties of | Data type | Required | Description |
| string | yes |
Result example
200 Ok
{
"status": true,
"message": "Email is not registered"
}
Error example
409 Conflict
{
"status": false,
"message": "Email is already registered"
}
400 Bad Request
{
"message": "Must have required property 'email'"
}