Customer Login
Authenticate a customer account with email and password.
The deviceToken field applies only when 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 | The authentication credential (format <id>|<secret>). Send as Authorization: Bearer <token> |
apiToken | String | Legacy field, kept for backward compatibility. Not an auth Bearer — sending it in the Authorization header returns Unauthenticated |
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."]
}
}
