Skip to content

Customer Registration

Register a new customer account with Bagisto.

Push Notifications: The deviceToken field 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

NameTypeRequiredDescription
firstNameString✅ YesCustomer's first name
lastNameString✅ YesCustomer's last name
emailString✅ YesCustomer's email address (must be unique)
passwordString✅ YesPassword for the account (min. 8 characters)
confirmPasswordString✅ YesMust match password
phoneString❌ NoCustomer's phone number
genderString❌ NoCustomer's gender (e.g. Male, Female)
dateOfBirthString❌ NoDate of birth in MM/DD/YYYY format
subscribedToNewsLetterBoolean❌ NoOpt-in to marketing emails. Default: false
deviceTokenString❌ NoFCM device token for push notifications. Only required if the Bagisto Push Notification package is installed.

Response

FieldTypeDescription
idIDIRI-style unique identifier (e.g. /api/shop/customers/1)
_idIntNumeric database ID
emailStringRegistered email address
firstNameStringCustomer's first name
lastNameStringCustomer's last name
nameStringFull name (first + last)
tokenStringAuthentication token for use in subsequent requests
statusStringAccount status (1 = active)
isVerifiedStringWhether the account is verified
isSuspendedStringWhether the account is suspended
subscribedToNewsLetterBooleanNewsletter subscription status
genderStringCustomer's gender
dateOfBirthStringCustomer's date of birth
phoneStringCustomer's phone number
deviceTokenStringAssociated 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
  • confirmPassword must match password
  • 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."]
  }
}

Released under the MIT License.