---
title: "Register a new customer"
method: POST
path: "/customers"
tags: ["Customer"]
---

# Register a new customer

`POST /customers`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/customers`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/customers/post.ts> (a function with typed inputs; its response is checked against the schema)

Register a new customer account

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Request body

- object
  - `firstName` string, required
  - `lastName` string, required
  - `email` string, email, required
  - `password` string, password, required
  - `confirmPassword` string, password, required
  - `phone` string
  - `gender` 'Male' | 'Female' | 'Other'
  - `dateOfBirth` string, date
  - `status` integer: Customer status (1 = active, 0 = inactive)
  - `isVerified` integer: Whether the customer is verified (1 = verified, 0 = not verified)
  - `isSuspended` integer: Whether the customer is suspended (1 = suspended, 0 = active)
  - `subscribedToNewsLetter` boolean
  - `deviceToken` string

## Response `201`

Customer registered. `token` is the Bearer token for subsequent calls.

## Other responses

- `400`: Invalid input
- `422`: Validation failed (email already taken, passwords do not match, etc.).

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
