AuthCustomer¶
Endpoint¶
POST /customer/auth/login
Description¶
Authenticates a customer and returns customer profile, linked accounts, and __token.
If OTP is enabled for the customer, otp_code is required.
Request¶
{
"email": "[email protected]",
"password": "strong-password",
"otp_code": "123456"
}
otp_code is required only when otp_enabled = 1.
Response¶
{
"customer_id": 1,
"email": "[email protected]",
"full_name": "John Smith",
"first_name": "John",
"last_name": "Smith",
"status": 0,
"phone": "+35700000000",
"preferred_language": "en",
"brand": "default",
"desk": "EU",
"manager_id": 10,
"last_login_time": 1777600000,
"otp_enabled": 1,
"accounts": [
{
"login": 100001,
"customer_id": 1,
"enable": 1,
"leverage": 100,
"group": "standard",
"name": "John Smith",
"email": "[email protected]"
}
],
"__token": "..."
}
Errors¶
| HTTP | Error | Description |
|---|---|---|
400 |
INVALID_DATA |
Invalid request body |
403 |
CUSTOMER_NOT_FOUND_OR_INCORRECT |
Email or password is incorrect |
403 |
CUSTOMER_DISABLED |
Customer is disabled |
403 |
OTP_REQUIRED |
OTP is enabled and otp_code was not provided |
403 |
INVALID_OTP_CODE |
OTP code is invalid |
403 |
OTP_NOT_CONFIGURED |
OTP is enabled but secret is missing |