Manage Triggers (RN SDK)

Subscribe to the "Back in Stock" trigger

Method Objective

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

Syntax and parameters

pcsdk.triggers("subscribe_for_product_available", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
itemnumber/stringrequiredThe product ID to notify of the product availability the user will be subscribed.
emailstringoptionallyThe current user's Email. If not set, the subscription will be on Web Push notification.
propertiesObjectoptionally

Additional product properties. The following are available:

  • fashion_size (number/string) - clothing size. The value of the parameter in the internal format of the store.

Examples of use


pcsdk.triggers("subscribe_for_product_available", {
    item: "100500", 
    email: "john.doe@examplestore.com"
});

pcsdk.triggers("subscribe_for_product_available", {
    item: "100500"
});


Unsubscribe from the "Back in Stock" trigger

Method Objective

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

Syntax and parameters

pcsdk.triggers("unsubscribe_from_product_available", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
item_idsarrayrequiredAn 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.
emailstringrequiredThe current user's Email.

Examples of use

pcsdk.triggers("unsubscribe_from_product_available", {
    item_ids: ["100500", "146", "12"], 
    email: "john.doe@examplestore.com"
});

pcsdk.triggers("unsubscribe_from_product_available", {
    item_ids: [], // unsubscribe from all products
    email: "john.doe@examplestore.com"
});


Subscribe to the "Price Drop" trigger

Method Objective

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

Syntax and parameters

pcsdk.triggers("subscribe_for_product_price", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
itemnumber/stringrequiredThe product ID to notify of the product price drop the user will be subscribed.
pricenumberrequiredThe current product price.
emailstringoptionallyThe current user's Email. If not set, the subscription will be on Web Push notification.

Examples of use


pcsdk.triggers("subscribe_for_product_price", {
    item: "100500", 
    price: 146.55, 
    email: "john.doe@examplestore.com"
});

pcsdk.triggers("subscribe_for_product_price", {
    item: "100500", 
    price: 146.55 
});


Unsubscribe from the "Price Drop" trigger

Method Objective

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

Syntax and parameters

pcsdk.triggers("unsubscribe_from_product_price", params);

NameTypeRequirementDescription
paramsObjectrequiredObject with request parameters.

Request parameters

NameTypeRequirementDescription
item_idsarrayrequiredAn array of product IDs for which the user would like to unsubscribe from the price drop notification. You can use an empty array to unsubscribe from all products.
emailstringrequiredThe current user's Email.

Examples of use

pcsdk.triggers("unsubscribe_from_product_price", {
    item_ids: ["100500", "146", "12"], 
    email: "john.doe@examplestore.com"
});

pcsdk.triggers("unsubscribe_from_product_price", {
    item_ids: [], // unsubscribe from all products
    email: "john.doe@examplestore.com"
});

Copyright 2018-2024 PersonaClick