Stock alerts
The back-in-stock alerts shoppers have asked for, on a product or held by a customer, and stopping one.
A shopper can ask to be emailed when something that has sold out is back. These routes read those alerts and stop one. An alert is pending (a guest who has not confirmed yet), active, sent, cancelled or expired.
List who is waiting for a product
/api/v1/kahunacart/products/{id}/stock-alerts
List the back-in-stock alerts on one product, newest first: each with the variant it is for, the shopper's email, whether it is pending (a guest who has not confirmed yet), active, sent, cancelled or expired, and when it was confirmed and sent. Also answers how many confirmed alerts are waiting on each variant. Useful for deciding what to reorder. Read-only.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | The product. |
| status optional | string |
Only alerts in this status. Omit for every alert the product has.
One of:
pending, active, sent, cancelled, expired |
List what a customer is waiting for
/api/v1/kahunacart/customers/{id}/stock-alerts
List the back-in-stock alerts one customer holds, found by their account and by their email address, so an alert they left as a guest before signing up is included. Open alerts only unless all is true. Read-only.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | The customer. |
| all optional | boolean | Include alerts that are sent, cancelled or expired. |
Cancel a back-in-stock alert
/api/v1/kahunacart/stock-alerts/{id}/cancel
Stop one back-in-stock alert, pending or active, so no email is sent for it. For a shopper who asks the store to take them off. An alert that is already sent, cancelled or expired answers 409 with its status.
Parameters
| Name | Type | Description |
|---|---|---|
| id required | integer | The alert. |
The product read answers how many confirmed alerts are waiting on each variant, which is useful for deciding what to reorder. The customer read finds alerts by the customer's account and by their email address, so an alert left as a guest before signing up is included, and it lists open alerts only unless all is true. Cancelling needs kahunacart.customers.manage and stops a pending or active alert so no email is sent for it. An alert that is already sent, cancelled or expired answers 409 with its status.