Manage Triggers (Android SDK - Kotlin)

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

sdk.subscribeForBackInStock(id, properties, email, phone)

Request parameters

NameTypeRequirementDescription
idstringrequiredThe product ID to notify of the product availability the user will be subscribed.
propertiesJSONObject/nulloptionally

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)

Check the example below.

emailstring/nulloptionally

The current user's Email.

Must be "null" if using a phone number.

phonestring/nulloptionally

The current user's phone in full international format.

A phone number in full international format may begin with a plus sign (+) followed by the country code, city (area) code, and phone number.

Examples of use

sdk.subscribeForBackInStock("100500")

sdk.subscribeForBackInStock("100500", "john.doe@examplestore.com")

sdk.subscribeForBackInStock("100500", null, "+4400114527199")

val properties = JSONObject()
properties.put("fashion_size", "XL")
sdk.subscribeForBackInStock("100500", properties, "john.doe@examplestore.com", null, null)



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

sdk.unsubscribeForBackInStock(params)

Request parameters

NameTypeRequirementDescription
paramsarrayrequiredArray with product IDs. See the example.

Examples of use

sdk.unsubscribeForBackInStock(arrayOf("100500", "146", "12"))

sdk.unsubscribeForBackInStock(arrayOf<String>()) // unsubscribe from all products


Subscribe to the "Price Drop" trigger

Method Objective

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

Syntax and parameters

sdk.subscribeForPriceDrop(id, currentPrice, email, phone)

Request parameters

NameTypeRequirementDescription
idstringrequiredThe product ID to notify of the product price drop the user will be subscribed.
currentPricenumberrequiredThe current product price.
emailstringoptionally

The current user's Email.

Must be "null" if using a phone number.

phonestringoptionally

The current user's phone in full international format.

A phone number in full international format may begin with a plus sign (+) followed by the country code, city (area) code, and phone number.

Examples of use

sdk.subscribeForPriceDrop("100500", 146.99)

sdk.subscribeForPriceDrop("100500", 146.99, "john.doe@examplestore.com")

sdk.subscribeForPriceDrop("100500", 146.99, null, "+4400114527199")


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

sdk.unsubscribeForPriceDrop(params)

Request parameters

NameTypeRequirementDescription
paramsarrayrequiredArray with product IDs. See the example.

Examples of use

sdk.unsubscribeForPriceDrop(arrayOf("100500", "146", "12"))
sdk.unsubscribeForPriceDrop(arrayOf<String>()) // unsubscribe from all products

Copyright 2018-2024 PersonaClick