Skip to main content

Create alert request

Use this endpoint when the built-in Stencil widget does not fit your theme or when you are building a headless storefront. Your storefront is responsible for collecting the customer's details and consent before sending the request.

Request

POST https://backinstockalerts.hypaapps.com/api/stores/{store_hash}/alert-requests
Accept: application/json
Path parameterTypeDescription
store_hashstringBigCommerce store hash, such as abc123. It appears in BigCommerce admin URLs as store-abc123.

Body fields

FieldTypeRequiredDescription
first_namestringNoCustomer's first name.
last_namestringNoCustomer's last name.
emailstringYesCustomer's email address.
newsletterbooleanYesWhether the customer explicitly opted into newsletter marketing.
channel_idnumberYesBigCommerce storefront channel ID.
customer_idnumber or nullYesLogged-in BigCommerce customer ID, or null for a guest.
currency_idnumber or nullYesBigCommerce currency ID for the storefront.
product_idnumber or stringYesProduct the customer wants to follow.
product_variant_idnumber, string or nullYesSelected variant ID, or null for a simple product.

For example:

{
"first_name": "Sam",
"last_name": "Taylor",
"email": "sam@example.com",
"newsletter": true,
"channel_id": 1,
"customer_id": null,
"currency_id": 1,
"product_id": 103,
"product_variant_id": 204
}

Successful response

A successful request returns 200 OK with the created alert request.

FieldTypeDescription
data.idnumberAlert-request ID.
data.channel_idnumberChannel associated with the request.
data.created_atstringUTC creation timestamp.
data.customer.emailstringEmail address used for the alert.
data.order_totalstringCurrency-formatted order total recorded with the request.
{
"data": {
"id": 65,
"channel_id": 1,
"created_at": "2026-01-19 09:32:16",
"customer": {
"email": "sam@example.com"
},
"order_total": "£0"
}
}

Validation errors

A 4xx response contains a general message and may contain field-level arrays in errors.

{
"message": "You are already subscribed to alerts for this product.",
"errors": {
"email": [
"You are already subscribed to alerts for this product."
]
}
}

Validation errors can be returned for email, channel_id, customer_id, currency_id, product_id, product_variant_id, first_name, last_name and newsletter.

Troubleshoot redirects or CORS errors

Symptom: The browser reports a cross-origin error, or the request receives a 302 redirect to the store domain.

Likely cause: The request does not ask for a JSON response.

Resolution: Include this header exactly:

Accept: application/json