Stock notifications
When a product is out of stock, a stock notification can be created. The associated services are;
CreateStockNotification
CreateStockNotificationForCurrentUser
GetStockNotification
GetStockNotificationForCurrentUser
DeleteStockNotification
As you can see, we have two variants of these services, default or for specific users. The only difference between these variants is whether or not en e-mail address is required to be given.
Creating a stock notification
CreateStockNotification
example request:
{
"ProductID": 3,
"OrganizationUnitID": "13",
"EmailAddress": "example@mail.com"
}
This will return the ID for the newly created notification.
Getting stock notifications
We can check for existing stock notifications to prevent creating duplicates using GetStockNofification
. An email address is required for this one, so in anonymous contexts a check should take place when trying to create a new notification and specifying the email.
Example request:
{
"ProductID": 3,
"OrganizationUnitID": "13",
"EmailAddress": "example@mail.com"
}
For authenticated users, this check can be performed as soon as they enter the product detail page.
Deleting stock notifications
Stock notifications can be deleted using their ID. For this, an e-mail address is also required.
Example request:
{
"ID": 234,
"EmailAddress": "example@mail.com"
}