Customer Registration
Register a new customer account with Bagisto.
The deviceToken field applies only when 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. |
The account's channel and customer group are not arguments. The server assigns them automatically — the channel from the request's storefront, and the store's default customer group — exactly as the web storefront sign-up does. Select channelId and customerGroupId to read them back.
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 |
channelId | String | Channel the account is registered under. Assigned automatically from the request's storefront — not a client argument. |
customerGroupId | String | Customer group the account is placed in (the store's default group). Assigned automatically — not a client argument. |
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."]
}
}
