> ## 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.

# Subscribe to newsletter

> Subscribe an email to the shop's newsletter.

## Request

```http theme={null}
POST /newsletter/subscribe
x-shop-id: {{shopId}}
Content-Type: application/json

{
  "email": "jane@example.com",
  "name": "Jane Smith",
  "source": "footer"
}
```

## Headers

| Header         | Type   | Description                       |
| -------------- | ------ | --------------------------------- |
| `x-shop-id`    | string | Identify the shop.                |
| `Content-Type` | string | Always set to `application/json`. |

## Body parameters

| Field    | Type   | Required | Description                                       |
| -------- | ------ | -------- | ------------------------------------------------- |
| `email`  | string | Yes      | Email address to subscribe.                       |
| `name`   | string | No       | Subscriber's name.                                |
| `source` | string | No       | Source of subscription (e.g., "footer", "popup"). |

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Successfully subscribed to newsletter",
    "data": {
        "_id": "6a27d7ca289b87893fcbde7c",
        "name": "Jane Smith",
        "email": "jane@example.com",
        "shop": "68b8f52575da81b332af29f1",
        "isSubscribed": true,
        "source": "footer",
        "createdAt": "2026-06-09T09:07:22.289Z",
        "updatedAt": "2026-06-09T09:07:22.289Z",
        "__v": 0
    }
}
```

## Error response

```json theme={null}
{
    "status": 400,
    "success": false,
    "message": "Email already subscribed",
    "data": {}
}
```


## OpenAPI

````yaml POST /newsletter/subscribe
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:
  /newsletter/subscribe:
    post:
      summary: Subscribe to newsletter
      description: Subscribe an email to the shop's newsletter.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                name:
                  type: string
                source:
                  type: string
                  description: Source of subscription
      responses:
        '201':
          description: Subscribed successfully
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.

````