http://localhost:8000/api/customer
All routes below are prefixed with this base URL.
{
"email": "user@gmail.com"
OR
"phone": 9876543210
}
{
"success": true,
"message": "OTP sent successfully",
"user_id": "customerId",
"flag": 1
}
flag = 0 → register new user automatically // show edit-profile-pagecurl -X POST http://localhost:8000/api/customer/send-otp \
-H "Content-Type: application/json" \
-d '{"phone":9876543210}'
{
"fullname": "Saksham Garg",
"email": "saksham@gmail.com",
"phone": 9876543210,
"password": "123456",
"address": "Street 1",
"city": "Meerut",
"state": "UP",
"pinCode": 110001,
"country": "INDIA"
}
{
"success": true,
"message": "Customer registered successfully",
"data": createdCustomer
}
{
"email": "saksham@gmail.com" OR "phone": 9876543210,
"otp": 123456
}
{
"success": true,
"message": "Customer logged In Successfully",
"data": { customerData },
"accessToken": "jwt-token",
"refreshToken": "jwt-token"
}
curl -X POST http://localhost:8000/api/customer/login \
-H "Content-Type: application/json" \
-d '{"phone":9876543210,"otp":"123456"}'
{
"success": true,
"message": "Access token refreshed",
"accessToken": "newToken",
"refreshToken": "newToken"
}
Authorization: Bearer accessToken
{
"success": true,
"message": "Customer Logout Successfully"
}
Authorization: Bearer accessToken
{
"fullname": "Saksham Garg",
"email": "saksham@gmail.com",
"phone": "9876543210",
"address": "New Address",
"city": "Delhi",
"state": "Delhi",
"pinCode": "90001",
"country": "India"
}
{
"success": true,
"message": "Profile updated successfully",
"data": { updatedCustomer }
}
{
"success": true,
"customer": { customerData }
}
{
"oldPassword": "123456",
"newPassword": "newPassword123"
}
{
"success": true,
"message": "Password changed successfully"
}