Customer Login
Authenticate a customer account with email and password.
Push Notifications: The
deviceTokenfield is only applicable if the Bagisto Push Notification package is installed. Pass the FCM device token here to associate the device with the customer session for push notification delivery. If the package is not installed, this field can be omitted.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
email | String | ✅ Yes | Customer's email address |
password | String | ✅ Yes | Customer's password |
deviceToken | String | ❌ No | FCM device token for push notifications. Only required if the Bagisto Push Notification package is installed. |
Response
| Field | Type | Description |
|---|---|---|
createCustomerLogin | Customer | The authenticated customer login object |
token | String | JWT token for API authentication |
message | String | Success or error message |
success | Boolean | Login success status |
Token Usage
Once logged in, use the token in the Authorization header for authenticated requests:
Authorization: Bearer <token>e.g.
"Authorization": "Bearer 220|KZhQuUwUzb6Z7j....."Error Responses
json
{
"errors": {
"email": ["Invalid email or password."]
}
}
