Skip to main content

Fetch customer alert requests

Use this endpoint to display alert requests in a logged-in customer's account area.

info

This endpoint supports logged-in customers only. Obtain a current-customer JWT with the Back in Stock Alerts client ID before calling it.

Request

GET https://backinstockalerts.hypaapps.com/api/stores/{store_hash}/customers/{jwt}/alert-requests
Accept: application/json
Path parameterDescription
store_hashBigCommerce store hash.
jwtToken returned by BigCommerce's Current Customer API.

Query parameters

ParameterDescription
channel_idFilter by storefront channel ID.
date_rangeInclude requests from this number of days ago through today. Minimum 1; maximum 365.
statusFilter by sent or pending.
unsubscribedFilter by unsubscribe state. Accepts true, false, 0, 1, yes or no.
pagePage number, starting at 1.
per_pageResults per page. Minimum 1; maximum 100.
sort_byid_desc (default), id_asc, product_asc or product_desc.
currency_codeCurrency code used to format product prices.

Response

The response contains a data array and pagination metadata.

Alert request fields

FieldTypeDescription
idintegerAlert-request ID.
channel_idintegerStorefront channel where the request was created.
productobjectRequested product details.
notificationobject or nullNotification created for the request, if any.
unsubscribedtimestamp or nullWhen the customer unsubscribed.
created_atstringWhen the request was created.

Product fields

FieldTypeDescription
product_idintegerBigCommerce product ID.
product_variant_idinteger or nullBigCommerce variant ID, or null for a simple product.
namestringProduct name.
image_urlstringProduct image URL.
pricestringFormatted product price.
skustringProduct or variant SKU.
urlstringProduct URL on the storefront.

Notification fields

FieldTypeDescription
idintegerNotification ID.
statusstringpending when ready for dispatch, or sent after dispatch.
created_atstringWhen the notification was created.

Pagination fields

FieldTypeDescription
totalintegerTotal matching requests.
countintegerRequests on the current page.
per_pageintegerMaximum requests per page.
current_pageintegerCurrent page number.
total_pagesintegerTotal number of pages.
{
"data": [
{
"id": 483,
"channel_id": 1,
"created_at": "2026-07-20 10:30:06",
"product": {
"product_id": 11135,
"product_variant_id": 23303,
"name": "Example product",
"sku": "SKU-123",
"url": "https://example-store.mybigcommerce.com/example-product",
"image_url": "https://backinstockalerts.hypaapps.com/img/ProductDefault.gif",
"price": "£8.95"
},
"notification": null,
"unsubscribed": null
}
],
"meta": {
"total": 1,
"count": 1,
"per_page": 25,
"current_page": 1,
"total_pages": 1
}
}

Example JavaScript

The client ID below is the public Back in Stock Alerts app client ID used with BigCommerce's Current Customer API.

const appClientId = '9s57chpu0tik4pw7wz9d2p022qnff6n';

async function fetchCustomerJwt() {
const response = await fetch(
`/customer/current.jwt?app_client_id=${appClientId}`,
);

if (response.status === 404) {
throw new Error('Customer is not logged in.');
}
if (!response.ok) {
throw new Error('Unable to identify the customer.');
}

return response.text();
}

async function fetchAlertRequests(storeHash, jwt, filters = {}) {
const query = new URLSearchParams(filters).toString();
const endpoint = `https://backinstockalerts.hypaapps.com/api/stores/${storeHash}/customers/${jwt}/alert-requests`;
const response = await fetch(`${endpoint}${query ? `?${query}` : ''}`, {
headers: {Accept: 'application/json'},
});

if (!response.ok) {
const body = await response.json().catch(() => ({}));
throw new Error(body.error || 'Unable to fetch alert requests.');
}

return response.json();
}

const jwt = await fetchCustomerJwt();
const alerts = await fetchAlertRequests('abc123', jwt, {
page: '1',
per_page: '20',
status: 'pending',
});

Use the returned id with Unsubscribe customer from an alert request.