Customer Login
Authenticate a customer with email and password to get authentication token for subsequent requests.
Endpoint
POST /api/shop/customers/loginRequest Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Request Body
json
{
"email": "[email protected]",
"password": "Password123!"
}Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Customer email address |
password | string | Yes | Customer password |
Response Fields (200 OK)
| Field | Type | Description |
|---|---|---|
message | string | Success message |
data | object | Response data |
customer | object | Customer information |
token | string | Bearer token for authentication |
Customer Fields
| Field | Type | Description |
|---|---|---|
id | integer | Customer ID |
firstName | string | Customer first name |
lastName | string | Customer last name |
email | string | Customer email |
phone | string | Customer phone |
status | integer | Account status (1=active) |
Token Usage
After login, use the returned token in subsequent requests:
bash
Authorization: Bearer {token}Session Management
- Token is valid for specified duration (typically 7 days)
- Use Verify Token to check validity
- Use Customer Logout to end session
Use Cases
- Authenticate customer on storefront
- Get authentication token for API calls
- Enable customer account access
- Retrieve customer details on login
- Start customer session

