Search Documentation

Search for a documentation page...

Availability Notifications API

REST API endpoint for registering back-in-stock alerts on product variants.

Availability notifications let customers subscribe to back-in-stock alerts for out-of-stock variants. When the variant is restocked, the customer receives an email notification.

Create Availability Notification

POST /api/v1/availability-notifications

Registers a back-in-stock alert for a product variant. Idempotent — if the same email is already subscribed for the same variant, the response indicates already_subscribed without creating a duplicate.

Request Body

FieldTypeRequiredDescription
emailstringYesCustomer email to notify on restock
namestringNoCustomer display name
productVariantIdstring (UUID)YesVariant to watch for back-in-stock
curl -X POST \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"email": "customer@example.com", "productVariantId": "0191abc0-1234-7def-8000-000000000001"}' \
https://your-store.yns.store/api/v1/availability-notifications

Response (201) — New Subscription

{
"status": "subscribed"
}

Response (200) — Already Subscribed

{
"status": "already_subscribed"
}

Error Responses

StatusDescription
400Invalid request data (missing email, invalid UUID, etc.)
404Variant not found or does not belong to this store