data-src=../../../../includes/saas-only.md
unsubscribeProductAlertStockAll mutation
The unsubscribeProductAlertStockAll mutation removes all stock availability alert subscriptions for the logged-in customer across the current website. After calling this mutation, the customer no longer receives any stock alert email notifications.
This mutation requires a valid customer authentication token.
Syntax
mutation {
unsubscribeProductAlertStockAll: ProductAlertSubscriptionResult
}
Reference
The unsubscribeProductAlertStockAll reference provides detailed information about the types and fields defined in this mutation.
Example usage
The following example removes all stock alert subscriptions for the logged-in customer.
Request:
mutation {
unsubscribeProductAlertStockAll {
success
message
}
}
Response:
{
"data": {
"unsubscribeProductAlertStockAll": {
"success": true,
"message": "You will no longer receive stock alerts."
}
}
}
Errors
Error
Description
Customer is not logged in.The request does not include a valid customer authentication token.
Unable to unsubscribe to all stock alertAn internal error occurred while removing the subscriptions.