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

# Register Back-in-Stock Request

> Register a customer's back-in-stock notification request

Register a customer's request to be notified when a product is back in stock. When a later [product upsert](/api-reference/products/upsert) marks the product or variant in stock again, the `ecommerce.back_in_stock` event fires for waiting subscribers, which can trigger automations.

This is the Commerce API equivalent of the Shopify/WooCommerce storefront back-in-stock widgets. Call it from your own storefront or backend when a customer asks to be notified.

## Request Body

<ParamField body="productId" type="string" required>
  Your product identifier (the `productId` used when upserting products).
</ParamField>

<ParamField body="variantId" type="string">
  Your variant identifier. Defaults to `productId` for products without
  variants.
</ParamField>

<ParamField body="productTitle" type="string">
  Product title snapshot used in notifications. Defaults to the synced product
  title.
</ParamField>

<ParamField body="variantTitle" type="string">
  Variant title snapshot used in notifications. Defaults to the synced variant
  title.
</ParamField>

<ParamField body="customer" type="object" required>
  The customer requesting the notification. Requires `email`; also accepts
  `externalId`, `firstName`, `lastName`, and `attributes`. The subscriber is
  created if they don't exist.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/back-in-stock" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "SKU-PROTEIN-1KG",
    "variantId": "SKU-PROTEIN-1KG-VANILLA",
    "customer": { "email": "buyer@example.com" }
  }'
```

## What Happens Next

1. The subscriber is created (if needed) without triggering signup automations
2. The `ecommerce.back_in_stock_requested` event is recorded
3. When a product upsert marks the variant in stock again, the
   `ecommerce.back_in_stock` event fires and can start automations

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "subscriberId": "sub_abc123"
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "error": "Failed to create subscriber"
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized"
  }
  ```

  ```json 500 theme={null}
  {
    "success": false,
    "error": "Internal server error"
  }
  ```
</ResponseExample>
