Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
maxLevel2classpersonaclick-fixed-position
Checking

Subscribe to the "Back in Stock" trigger

subscription

Method Objective

The method allows checking the subscription status of the "Back in Stock" trigger.

Syntax and parameters

Code Block
languagejs
themeFadeToGrey
personaclick("check_trigger", "product_available", params, success, error);

subscribes the user to the notifications that the product is available.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/subscriptions/subscribe_for_product_availablePOSTapplication/json

Parameters

NameTypeRequirementDescriptionitemarrayrequiredAn 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.paramsObject
NameTypeRequirementDescription
shop_idstringrequiredObject with request parameters.
successFunctionrequiredCallback-function, where the API response will be passed to. Response type: object.
errorFunctionoptionallyCallback-function to be called when an error occurs (any HTTP status code other than 200).

Request parameters

Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired

Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.

Tip

To get the "did" value inside Mobile SDK, use the following methods:


item_idstring/numberrequiredProduct ID
emailstringoptionally
Email for subscription checking.phone
User Email. Will be added (updated) to the user's profile is used in the request.
properties[fashion_size]stringoptionally
Phone for subscription checking.loyalty_idstringoptionallyLoyalty ID for subscription checking.
Note

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

Shows whether or not there is a trigger subscription for the product
NameTypeDescription
statusboolean

It allows specifying the size as an additional property of the product in the subscription. See the example below.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad RequestSee the "message" property of the API response for details.
403 ForbiddenSee the "message" property of the API response for details.

Example of use

Code Block
languagejs
themeFadeToGrey
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.
});curl 'https://api.personaclick.com/subscriptions/subscribe_for_product_available' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","did":"vxlwRZ7Cnk","item_id":"100500","email":"john.doe@examplemail.com","properties[fashion_size]":"XL"}'


Unsubscribe from the "Back in Stock" trigger

Method Objective

The method unsubscribes the user from the notification that the product is available.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/subscriptions/unsubscribe_from_product_availablePOSTapplication/json

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired

Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.

Tip

To get the "did" value inside Mobile SDK, use the following methods:


item_idsstringrequiredProduct IDs, separated by commas. Can have an empty value to remove subscriptions for all products.
emailstringrequiredUser Email

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad RequestSee the "message" property of the API response for details.
403 ForbiddenSee the "message" property of the API response for details.

Examples of use

Code Block
languagejs
themeFadeToGrey
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
# unsubscribe from notifications for selected products
curl 'https://api.personaclick.com/subscriptions/unsubscribe_from_product_available' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"item_ids":"PRODUCT_ID1,PRODUCT_ID2","email":"john.doe@examplemail.com","shop_id":"0d42fd8b713d0752776ca589cc0056&did=vxlwRZ7Cnk"}'

# cancel notifications for all products
curl 'https://api.personaclick.com/subscriptions/unsubscribe_from_product_available' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"item_ids":"","email":"john.doe@examplemail.com","shop_id":"0d42fd8b713d0752776ca589cc0056&did=vxlwRZ7Cnk"}'


Checking the "Back in Stock" trigger subscription

Method Objective

The method allows checking the subscription status of the "Price DropBack in Stock" trigger.

Syntax and parameters

Request

code
Endpoint
languagejs
themeFadeToGrey
personaclick("check_trigger", "product_price_decrease", params, success, error);
Request Type
https://api.personaclick.com/products/check_product_available_subscriptionGET

Parameters

Note

Only parameters related to the profile update request are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
params
shop_id
Object
stringrequired
Object with request parameters.successFunctionrequiredCallback-function, where the API response will be passed to. Response type: object.errorFunctionoptionallyCallback-function to be called when an error occurs (any HTTP status code other than 200).

Request parameters

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.
optionally...
NameTypeRequirementDescription
itemarrayrequiredAn 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.
emailstringUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
item_idstring/numberrequiredProduct ID
emailstringOne of the available ones is requiredEmail for subscription checking
phonestringoptionallyPhone for subscription checking
loyalty_idstringoptionallyLoyalty ID for subscription checking
Note

API response properties

NameTypeDescription
statusbooleanShows whether or not there is a trigger subscription for the product

Example of use

Code Block
languagejs
themeFadeToGrey
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.
});
Code Block
languagejs
themeFadeToGrey
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
});
Table of Contents
curl 'https://api.personaclick.com/products/check_product_available_subscription?email=john.doe%40examplemail.com&shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef&item_id=100500'


Subscribe to the "Price Drop" trigger

Method Objective

The method subscribes the user to the notifications of a product price decrease.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/subscriptions/subscribe_for_product_pricePOSTapplication/json

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired

Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.

Tip

To get the "did" value inside Mobile SDK, use the following methods:


item_idstring/numberrequiredProduct ID
pricenumberrequiredCurrent Price of Product
emailstringoptionallyUser Email. Will be added (updated) to the user's profile is used in the request.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad RequestSee the "message" property of the API response for details.
403 ForbiddenSee the "message" property of the API response for details.

Example of use

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/subscriptions/subscribe_for_product_price' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","did":"vxlwRZ7Cnk","item_id":"100500","email":"john.doe@examplemail.com","price":146}'


Unsubscribe from the "Price Drop" trigger

Method Objective

The method unsubscribes the user from an email notification of a product price decrease.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/subscriptions/unsubscribe_from_product_pricePOSTapplication/json

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired

Unique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.

Tip

To get the "did" value inside Mobile SDK, use the following methods:


item_idsstringrequiredProduct IDs, separated by commas. Can have an empty value to remove subscriptions for all products.
emailstringrequiredUser Email

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad RequestSee the "message" property of the API response for details.
403 ForbiddenSee the "message" property of the API response for details.

Examples of use

Code Block
languagejs
themeFadeToGrey
# unsubscribe from notifications for selected products
curl 'https://api.personaclick.com/subscriptions/unsubscribe_from_product_price' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"item_ids":"PRODUCT_ID1,PRODUCT_ID2","email":"john.doe@examplemail.com","shop_id":"0d42fd8b713d0752776ca589cc0056&did=vxlwRZ7Cnk"}'

# cancel notifications for all products
curl 'https://api.personaclick.com/subscriptions/unsubscribe_from_product_price' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"item_ids":"","email":"john.doe@examplemail.com","shop_id":"0d42fd8b713d0752776ca589cc0056&did=vxlwRZ7Cnk"}'


Checking the "Price Drop" trigger subscription

Method Objective

The method allows checking the subscription status of the "Price Drop" trigger.

Request

EndpointRequest Type
https://api.personaclick.com/products/check_price_drop_subscriptionGET

Parameters

Note

Only parameters related to the profile update request are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredStore Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
item_idstring/numberrequiredProduct ID
emailstringOne of the available ones is requiredEmail for subscription checking
phonestringPhone for subscription checking
loyalty_idstringLoyalty ID for subscription checking

API response properties

NameTypeDescription
statusbooleanShows whether or not there is a trigger subscription for the product

Example of use

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/products/check_price_drop_subscription?email=john.doe%40examplemail.com&shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef&item_id=100500'



Column

Page Navigation

Table of Contents
maxLevel1
indent0px
stylenone




Related Pages

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
sorttitle
cqllabel = "triggers"