Callback-function, where the API response will be passed to. Response type:object.
error
Function
optionally
Callback-function to be called when an error occurs (any HTTP status code other than 200).
Request parameters
Name
Type
Requirement
Description
item
array
required
An array of product IDs for which the user would like to unsubscribe from the product availability notification. You can use an empty array to unsubscribe from all products.
email
string
optionally
Email for subscription checking.
phone
string
optionally
Phone for subscription checking.
loyalty_id
string
optionally
Loyalty ID for subscription checking.
If no email, phone, or loyalty_id is specified, only the user's current device will be checked. It won't take into account subscriptions performed on the user's other devices.
API response properties
Name
Type
Description
status
boolean
Shows whether or not there is a trigger subscription for the product
Example of use
personaclick("check_trigger", "product_available", {item: "100500", email: "john.doe@examplestore.com"}, function(response) {
if (response.status) {
console.log("Subscribed!");
} else {
console.log("Not subscribed!");
}
}, function(error) {
// if the request failed.
});
personaclick("check_trigger", "product_available", {item: "100500"}, function(response) {
if (response.status) {
console.log("Subscribed!");
} else {
console.log("Not subscribed!");
}
}, function(error) {
// if the request failed
});
Checking the "Price Drop" trigger subscription
Method Objective
The method allows checking the subscription status of the "Price Drop" trigger.
Callback-function, where the API response will be passed to. Response type:object.
error
Function
optionally
Callback-function to be called when an error occurs (any HTTP status code other than 200).
Request parameters
Name
Type
Requirement
Description
item
array
required
An array of product IDs for which the user would like to unsubscribe from the product availability notification. You can use an empty array to unsubscribe from all products.
email
string
optionally
Email for subscription checking.
phone
string
optionally
Phone for subscription checking.
loyalty_id
string
optionally
Loyalty ID for subscription checking.
If no email, phone, or loyalty_id is specified, only the user's current device will be checked. It won't take into account subscriptions performed on the user's other devices.
API response properties
Name
Type
Description
status
boolean
Shows whether or not there is a trigger subscription for the product
Example of use
personaclick("check_trigger", "product_price_decrease", {item: "100500", email: "john.doe@examplestore.com"}, function(response) {
if (response.status) {
console.log("Subscribed!");
} else {
console.log("Not subscribed!");
}
}, function(error) {
// if the request failed.
});
personaclick("check_trigger", "product_price_decrease", {item: "100500"}, function(response) {
if (response.status) {
console.log("Subscribed!");
} else {
console.log("Not subscribed!");
}
}, function(error) {
// if the request failed
});