USAPI


Login USAPI

Link:
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
  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
email
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

 

email
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
  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
platform
string no

Possible values:

  • ONMART
  • ONMARKET
  • OSAS

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:

  1. Laki-Laki
  2. Perempuan
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
email
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'"
}