---
title: "Customer login"
method: POST
path: "/customer/login"
tags: ["Customer"]
---

# Customer login

`POST /customer/login`

## Request

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

Authenticate a customer with email and password. Returns a Bearer token for subsequent API calls.

## Headers

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

## Request body

- object
  - `email` string, email, required
  - `password` string, password, required

## Response `201`

Authenticated. Use `token` as the Bearer token in the Authorization header for subsequent calls.

## Other responses

- `400`: Invalid input
- `401`: Invalid email or password.
- `422`: Validation Error

---

[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)
