> For the complete documentation index, see [llms.txt](https://docs.premsoft.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.premsoft.de/en/plugins/back-in-stock-notification/store-api.md).

# Store API

The Stock Reminder plugin provides two Store API endpoints that can be used for headless projects or custom storefront implementations.

## Create Subscription

Creates a new notification subscription for a product.

**Endpoint:** `POST /store-api/prems/stock-reminder/subscribe`

**Login required:** No

**Parameters:**

| Parameter | Type   | Required | Description                                                                                                                                                                  |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| productId | string | Yes      | The UUID of the product.                                                                                                                                                     |
| email     | string | Yes      | The subscriber's email address. Must be a valid email address.                                                                                                               |
| quantity  | int    | No       | The desired order quantity. Default: 1. Ignored when the quantity field is hidden in the configuration — in that case, the product's minimum order quantity is used instead. |

**Response:** `204 No Content` on success.

**Errors:**

* `403 Forbidden` – The plugin is not active for the sales channel or the subscription limit of the free version has been reached.
* `400 Bad Request` – Invalid input data (missing product ID, invalid email).

## Confirm Subscription

Confirms a subscription via the double opt-in hash.

**Endpoint:** `POST /store-api/prems/stock-reminder/confirm/{hash}`

**Login required:** No

**Parameters:**

| Parameter | Type   | Required | Description                                                               |
| --------- | ------ | -------- | ------------------------------------------------------------------------- |
| hash      | string | Yes      | The unique confirmation hash from the confirmation email (URL parameter). |

**Response:** `204 No Content` on success.

**Errors:**

* `404 Not Found` – Invalid or already confirmed hash.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.premsoft.de/en/plugins/back-in-stock-notification/store-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
