Skip to main content

Register Customer

Creates a new customer account with email and password.

Request Body

email
string
required
User’s email address. Must be unique and valid format.
password
string
required
User’s password. Should meet security requirements (minimum length, complexity).

Response

token
string
JWT authentication token for the newly created customer account

Response Codes

  • 200 OK - Registration successful, returns JWT token
  • 400 Bad Request - Invalid email format or password requirements not met
  • 409 Conflict - Email already registered
  • 500 Internal Server Error - Server error during registration

Examples

curl -X POST "https://your-server.com/api/account/customer/register" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123!"
  }'

Success Response Example

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

Error Response Examples

Email Already Registered (409 Conflict):
"Email already registered"
Invalid Email Format (400 Bad Request):
"Invalid email format"
Weak Password (400 Bad Request):
"Password must be at least 8 characters and contain uppercase, lowercase, and numbers"

Next Steps

After registration:
  1. Store the JWT token securely
  2. Use the token to authenticate API requests
  3. Complete customer profile information
  4. Start browsing products
The registration endpoint automatically creates a Customer role. To become a seller, use the Seller Application endpoint.

Build docs developers (and LLMs) love