> ## Documentation Index
> Fetch the complete documentation index at: https://dev.puppetvendors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vendor Portal Login

> Authenticate a vendor user with email and password; returns a JWT

<Note>
  **V2 Preview** — This endpoint is part of the V2 API preview. Breaking changes may occur.
</Note>

## Overview

Authenticate a vendor user with email and password. Returns a JWT token that works with all protected V2 endpoints under the vendor scope. Rate limited to **5 requests per 15 minutes per IP**.

### Use Cases

* **Vendor portal login screen** — Exchange credentials for a session token
* **Mobile vendor app** — Bootstrap the app after vendor enters credentials

## Request Body

<ParamField body="email" type="string" required>
  Vendor's email address.
</ParamField>

<ParamField body="password" type="string" required>
  Vendor's password.
</ParamField>

<ParamField body="shopDomain" type="string">
  Target shop domain — required when a single email is registered across multiple shops.
</ParamField>

## Response

```json 200 theme={null}
{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresIn": 86400,
    "scope": "vendor",
    "shopDomain": "my-store.myshopify.com",
    "user": {
      "id": "507f1f77bcf86cd799439011",
      "email": "vendor@example.com",
      "vendorId": "507f1f77bcf86cd799439012",
      "vendor": "Acme Co"
    }
  }
}
```

### Error Responses

```json 401 theme={null}
{ "success": false, "error": { "message": "Invalid credentials", "code": "INVALID_CREDENTIALS" } }
```

```json 403 theme={null}
{ "success": false, "error": { "message": "Account not approved", "code": "NOT_APPROVED" } }
```

```json 429 theme={null}
{ "success": false, "error": { "message": "Too many login attempts", "code": "RATE_LIMITED" } }
```

## Example

```bash theme={null}
curl -X POST "https://staging-api.puppetvendors.com/portal/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "vendor@example.com",
    "password": "secret123",
    "shopDomain": "my-store.myshopify.com"
  }'
```
