Customer Registration
Register a new customer account with Bagisto.
Push Notifications: The
deviceTokenfield is only applicable if the Bagisto Push Notification package is installed. Pass the FCM device token here during registration to immediately associate the device with the new customer account for push notification delivery. If the package is not installed, this field can be omitted.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
firstName | String | ✅ Yes | Customer's first name |
lastName | String | ✅ Yes | Customer's last name |
email | String | ✅ Yes | Customer's email address (must be unique) |
password | String | ✅ Yes | Password for the account (min. 8 characters) |
confirmPassword | String | ✅ Yes | Must match password |
phone | String | ❌ No | Customer's phone number |
gender | String | ❌ No | Customer's gender (e.g. Male, Female) |
dateOfBirth | String | ❌ No | Date of birth in MM/DD/YYYY format |
subscribedToNewsLetter | Boolean | ❌ No | Opt-in to marketing emails. Default: false |
deviceToken | String | ❌ No | FCM device token for push notifications. Only required if the Bagisto Push Notification package is installed. |
Response
| Field | Type | Description |
|---|---|---|
id | ID | IRI-style unique identifier (e.g. /api/shop/customers/1) |
_id | Int | Numeric database ID |
email | String | Registered email address |
firstName | String | Customer's first name |
lastName | String | Customer's last name |
name | String | Full name (first + last) |
token | String | Authentication token for use in subsequent requests |
status | String | Account status (1 = active) |
isVerified | String | Whether the account is verified |
isSuspended | String | Whether the account is suspended |
subscribedToNewsLetter | Boolean | Newsletter subscription status |
gender | String | Customer's gender |
dateOfBirth | String | Customer's date of birth |
phone | String | Customer's phone number |
deviceToken | String | Associated FCM device token (if Push Notification package is installed) |
Token Usage
After registration, use the token in the Authorization header for authenticated requests:
Authorization: Bearer <token>e.g.
"Authorization": "Bearer 7b65c50e0c15cdc684d36e5819eb7c19"Validation Rules
- Email must be in valid format and unique across all customers
- Password must be at least 8 characters
confirmPasswordmust matchpassword- First name and last name are required
Error Responses
json
{
"errors": {
"email": ["The email has already been taken."],
"password": ["The password must be at least 8 characters."]
}
}
