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

# Verify email

> Confirm the one-time code and issue a session token for the shopper.

## Request

```http theme={null}
POST /auth/verify
Content-Type: application/json
x-shop-id: {shopId}
{
  "email": "jane@example.com",
  "otp": "773390"
}
```

## Headers

| Header         | Type   | Description                                            |
| -------------- | ------ | ------------------------------------------------------ |
| `Content-Type` | string | Always set to `application/json`.                      |
| `x-shop-id`    | string | Shop identifier to associate the user with your store. |

## Body parameters

| Field   | Type   | Required | Description                                            |
| ------- | ------ | -------- | ------------------------------------------------------ |
| `email` | string | Yes      | Email address that requested the verification code.    |
| `otp`   | string | Yes      | Six-digit one-time code the shopper received by email. |

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Email verified successfully",
    "data": {
        "_id": "68f976e92bb0b821425fdda6",
        "email": "jane@example.com",
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
    }
}
```

<Check>
  You receive shopper identifiers and a JWT token, confirming that the email
  verification succeeded.
</Check>

## Error responses

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "Invalid OTP",
    "data": {}
}
```

```json theme={null}
{
    "status": 404,
    "success": false,
    "message": "User not found",
    "data": {}
}
```


## OpenAPI

````yaml POST /auth/verify
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /auth/verify:
    post:
      summary: Verify email
      description: Confirm the one-time code and issue a session token for the shopper.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - otp
              properties:
                email:
                  type: string
                  format: email
                  description: Email address that requested the verification code.
                otp:
                  type: string
                  description: Six-digit one-time code the shopper received by email.
      responses:
        '200':
          description: Email verified and session token issued.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - success
                  - message
                  - data
                properties:
                  status:
                    type: integer
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    required:
                      - _id
                      - email
                      - token
                    properties:
                      _id:
                        type: string
                        description: Shopper identifier.
                      email:
                        type: string
                        format: email
                      token:
                        type: string
                        description: JWT token issued to the shopper.
        '400':
          description: Invalid or expired verification code.
        '404':
          description: Shopper account not found.
        '500':
          description: Failed to verify email.
      security: []
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````