Skip to content

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 ​

NameTypeRequiredDescription
firstNameString✅ YesCustomer's first name
lastNameString✅ YesCustomer's last name
emailString✅ YesCustomer's email address, unique within the channel being registered on
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.

status, isVerified and isSuspended are optional and the value sent for them is not used. The server decides the account's state the way the web storefront sign-up does: status is 1 and isSuspended is 0, and isVerified follows the store's email verification setting under Configuration → Customers → Settings → Email — 1 while it is switched off, 0 while it is switched on and the address has not been confirmed. An account with isVerified of 0 cannot sign in until the customer follows the link in the verification email.

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 ​

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, 0 inactive. An inactive account cannot sign in
isVerifiedStringEmail verification state — 1 verified, 0 awaiting confirmation. An unverified account cannot sign in
isSuspendedStringSuspension state — 0 not suspended, 1 suspended by an administrator
subscribedToNewsLetterBooleanNewsletter subscription status
genderStringCustomer's gender
dateOfBirthStringCustomer's date of birth
phoneStringCustomer's phone number
channelIdStringChannel the account is registered under. Assigned automatically from the request's storefront — not a client argument.
customerGroupIdStringCustomer group the account is placed in (the store's default group). Assigned automatically — not a client argument.
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 1535|cusalnrd79pvOpEDorYMISQOwQh3P22DrAzcMvE7835a8e31"

Validation Rules ​

  • Email must be in valid format and unique within the channel being registered on — the same address may hold a separate account on each channel a store runs
  • 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.