Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Basic Details

API endpoint and parameters used in all user activity tracking requests (exclude custom events) are described here.

Request

EndpointRequest TypeContent-Typehttps://api.personaclick.com

Basic Details

API endpoint and parameters used in all user activity tracking requests (exclude custom events) are described here.

Request

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

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequiredUnique Device ID. See "Initialization (REST API)" for information about getting and using Device ID.
seancestringrequiredUnique ID of the current user session. See "Initialization (REST API)" for information about getting and using User Session ID.
segmentstreamstringoptionallyCan requiredData stream code. Alphanumeric string (letters, numbers only). Max length: 16. The empty default value will mean "web". Can be "ios", "android" or any other string. Used to distinguish between mobile apps, websites, and other events sources.
segmentstringoptionallyCan take one of the values: "A" or "B" according to the segment to which the user is assigned. You can use your algorithm to divide users evenly between the segments.
refererstringoptionallyRequest source URL
sourceJSON stringrequired in some casesSee the description below.

Source Param

This parameter is a JSON string of the object with the following properties. The value for each property should be fetched from a specific source, depending on the campaign type.

Warning

Each time the source parameters come from any channel, they should be saved on the site or app side and used in all user activity tracking requests for 48 hours. If the source parameters are updated within 48 hours (the user has interacted with a new campaign), the new source parameter values should be saved on your side and their life should be set to 48 hours again. After the lifetime of these parameters has expired, they should no longer be used in requests.


NameTypeRequirementChannelCampaign TypeDescription
fromstringrequiredEmailAny typeThe value should be fetched from the "recommended_by" parameter of any link in an email/webpush at the moment when the user visits the site by clicking on the link.
Web Push
App Push

The value shoud be fetched from push's JSON payload. For Android it's located in "type" property. In iOS SDK it's "src.type".

codestringrequiredEmailBulk

The value should be fetched from the "bulk_code" parameter of any link in an email at the moment when the user visits the site by clicking on the link.

ChainThe value should be fetched from the "personaclick_mail_code" parameter of any link in an email at the moment when the user visits the site by clicking on the link.
Transactional
Web PushBulk

The value should be fetched from the "bulk_code" parameter of a link in a web-push at the moment when the user visits the site by clicking on the link.

ChainThe value should be fetched from the "personaclick_mail_code" parameter of a link in a web-push at the moment when the user visits the site by clicking on the link.
Transactional
App PushAny type

The value should be fetched from push's JSON payload. For Android it's located in "id" property. In iOS SDK it's "src.id"


Code Block
languagejs
themeFadeToGrey
{"from":"chain","code":"abcdef-0123-4567-9810-012345abcdef"}



Product View

Method Objective

Status
colourYellow
titlerequired
 The method gives the system an understanding of the product viewed by the user.

Parameters

Note

Only parameters related to the product view event are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "view".
itemsObject arrayrequired

For the "view" event, the array should contain only one object with a product ID. See the example below.

recommended_bystringrequired in some cases
  • This parameter should be set to "dynamic" if the currently viewed product was from the recommendation block.
  • The parameter should be set to "instant_search" for Instant Search and "full_search" for Full Search.
recommended_codestringrequired in some cases

This parameter can contain one of the values:

  • This parameter should have a unique code of the product recommendations block if the currently viewed product is from the recommendations block. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
  • This parameter should have a search query in the value if the product is viewed from the Instant or Full Search tool.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
  • there is no Product ID in the request (see the "item_id[0]items" property of the request above)
  • unknown recommender type (see the "recommended_by" property in the request and the status property of the response below)
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"view","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","segmentstream":"Aios","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}],"recommended_by":"dynamic","recommended_code":"3d045e1b39c321ff695604587597231c"}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"view","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}],"recommended_by":"dynamic","recommended_code":"3d045e1b39c321ff695604587597231c","source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Category View

Method Objective

Status
colourYellow
titlerequired
 The method gives the system an understanding of the category viewed by the user.

Warning

The API will respond with an error for categories unknown to the system. The system only knows the categories from the product feed (XML) or the HTTP import of the category list.

Parameters

Note

Only parameters related to the category view event are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "category".
category_idnumber/stringrequired

The ID of the current category.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
  • unknown category (category isn't available in the imported product catalog)
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"category","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/category/146","category_id":146}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"category","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/category/146","category_id":146,"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Adding a product to the cart

Method Objective

Status
colourYellow
titlerequired
 The method gives the system an understanding of the product added to the cart by the user.

Parameters

Note

Only parameters related to the adding product to the cart event are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "cart".
itemsObject arrayrequired

For the "cart" event, the array should contain only one object with a product ID, and an amount. See the example below.

recommended_bystringrequired in some casesThis parameter should be set to "dynamic" if the added to the cart product was from the recommendation block.
Tip

For example:

  1. A user has added the current product to the cart in the amount of 3 pieces. The request should have the "amount" value of 3.
  2. Then the user decides to add 2 more pieces of the current product (bringing the total to 5). The second request should have the "amount" value of 5.


recommended_bystringrequired in some cases
  • This parameter should be set to "dynamic" if the added to the cart product was from the recommendation block.
  • The parameter should be set to "instant_search" for Instant Search and "full_search" for Full Search.
recommended_codestringrequired in some cases

This parameter can contain one of the values:

  • This parameter should have a unique code of the product recommendations blockif the added to the cart product was from the recommendation block. The unique code is available in the PersonaClick account in the "data-recommender-code" attribute of each block.
  • This parameter should have a search query in the value if the product is added to the cart from the Instant or Full Search tool.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
  • there is no Product ID in the request (see the "item_id[0]" property of the request above)
  • unknown recommender type (see the "recommended_by" property in the request and the status property of the response below)
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"ios","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500","amount":2}],"recommended_by":"dynamic","recommended_code":"3d045e1b39c321ff695604587597231c"}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}],"recommendedamount":3}],"recommended_by":"dynamic","recommended_code":"3d045e1b39c321ff695604587597231c","source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Removing a product from the cart

Method Objective

Status
colourYellow
titlerequired
 The method gives the system an understanding of the product removed from the cart by the user.

Parameters

Note

Only parameters related to the removing product from the cart event are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "remove_from_cart".
itemsObject arrayrequired

For the "remove_from_cart" event, the array should contain only one object with a product ID. See the example below.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
  • there is no Product ID in the request (see the "item_id[0]" property of the request above)
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"remove_from_cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}]}'



Update the current cart

Method Objective

Status
colourYellow
titlerequired
 The method updates the whole cart on the system side.

Note

This method is required for use on the cart page when the user does certain actions there: when the user visits the page, changes the quantity of a product in the cart, removes a product from the cart, or clears the cart completely.


Tip

This method can be used on the product page as an alternative to the "Add to cart" and "Remove from cart" methods if you have access to the entire cart on the product page.

Parameters

Note

Only parameters related to the event of updating the cart are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "cart".
itemsObject arrayrequired

Object array with the properties of the products in the cart. Available properties for each object:

  • id - the ID of the product in the cart. Type: string/number. Required.
  • quantity - amount of the product in the cart. Type: number. Required.
Note

If the property is missing in the request, the system will clear the user's cart. Use this when the user's cart is cleared on the store side.

See the example below.

full_cartbooleanrequiredStatus of the cart synchronization. Should always be "true" in this case. See the example below.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Examples

Example of synchronization of products in the cart.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"ios","segment":"A","referer":"https://mystore.com/cart","items":[{"id":"100500","quantity":3},{"id":"100123","quantity":1}],"full_cart":true}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/cart","items":[{"id":"100500","quantity":3},{"id":"100123","quantity":1}],"full_cart":true,"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'

Example of the cart cleaning.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/cart","full_cart":true}'

# with "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"cart","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/cart","full_cart":true,"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Successful checkout

Method Objective

Status
colourYellow
titlerequired
 The method gives the system information about the successful checkout, its products, and other information related to the checkout.

Parameters

Note

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


ordernumber/string
NameTypeRequirementDescription
eventstringrequiredThe value must be "purchase".
itemsObject arrayrequired

Object array with the properties of the products in the cart. Available properties for each object:

  • id - the ID of the product in the cart. Type: string/number. Required.
  • amount - amount of the product in the cart. Type: number. Required.
  • price - The unit price of the purchased product. Type: number. Optionally. If not sent, the system will use the product price from the previously sent product catalog. No discounts will be taken into account in this case.

See the example below.

customObjectoptionallyInternal store Order ID. If not specified, the system will create its internal ID. Synchronization of order statuses, in this case, won't be available.
order_pricenumberoptionallyThe final order value, including all discounts. If not specified, the system will calculate the order value based on prices from the product feed.
order_cashnumberoptionallyThe amount of money the user spent to pay for the order.
order_bonusesnumberoptionallyThe number of bonuses the user spent to pay for the order.
order_deliverynumberoptionallyShipping cost.
order_discountnumberoptionallyDiscount amount (in moneyCustom properties of the order. The properties should be pre-created: Account > Settings > Order properties

The following data types are supported:
- string
- integer
- date (YYYY-MM-DD)

See example below.
order_idnumber/stringoptionally

Internal store Order ID. If not specified, the system will create its internal ID. Synchronization of order statuses, in this case, won't be available.

Note

Please note that order IDs in UUID format aren't displayed in the dashboard. Instead of UUDI, "---" will be displayed. To avoid this, add any prefix to this.


order_pricenumberoptionallyThe final order value, including all discounts. If not specified, the system will calculate the order value based on prices from the product feed.
order_cashnumberoptionallyThe amount of money the user spent to pay for the order.
order_bonusesnumberoptionallyThe number of bonuses the user spent to pay for the order.
order_deliverynumberoptionallyShipping cost.
order_discountnumberoptionallyDiscount amount (in money).
promocodestringoptionally

Promo code that was used.

Tip

If a promo code from the list uploaded to the account has been used, it'll be marked as used.


delivery_typeaddressstringoptionallyShipping method. Available values:
  • self_pickup
  • delivery
  • pickup_point
payment_Delivery address. Any text.
delivery_typestringoptionallyPayment method. Any string value. For example: "cashDelivery Type, e.g. "courier", "cardself_pickup", "delivery", "pickup_point", etc.
payment_typestringoptionallyPayment method. Any string value. For example: "cash", "card", "wire".
tax_freebooleanoptionallyIt sets whether the order was placed with Tax-Free or not.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"purchase","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"ios","segment":"A","referer":"https://mystore.com/order/success","order_id":"N100500","order_price":750,"order_cash":650,"order_bonuses":100,"order_discount":50,"promocode":"BIRTHDAY","delivery_type":"delivery","payment_type":"cart","items":[{"id":"100500","amount":3,"price":100},{"id":100123,"amount":1,"price":500}]},"custom":{"order_comment":"Delivery after 15:00, 2nd floor, apt. 222","boxes":2,"refund_date":"2021-09-21"}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"purchase","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/order/success","order_id":"N100500","order_price":750,"order_cash":650,"order_bonuses":100,"order_discount":50,"promocode":"BIRTHDAY","delivery_type":"delivery","payment_type":"cart","items":[{"id":"100500","amount":3,"price":100},{"id":100123,"amount":1,"price":500}],"custom":{"order_comment":"Delivery after 15:00, 2nd floor, apt. 222","boxes":2,"refund_date":"2021-09-21"},"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Search Request

Method Objective

The method gives the system an understanding of the user's search queries.

Parameters

Note

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


NameTypeRequirementDescription
eventstringrequiredThe value must be "search".
search_querystringrequiredSearch Query.
recommended_codestringrequired in some cases

This parameter should have a search query in the value if the search results were taken from the PersonaClick API (the Full Search tool was used). See the example below.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"search","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/search","search_query":"apple","recommended_code":"apple"}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"search","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"android","segment":"A","referer":"https://mystore.com/search","search_query":"apple","recommended_code":"apple","source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Adding a product to the wishlist

Method Objective

The method gives the system an understanding the user has added a product to the wishlist.

Parameters

Note

Only parameters related to the event of adding a product to the wishlist are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "wish".
itemsObject arrayrequired

For the "wish" event, the array should contain only one object with a product ID. See the example below.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"wish","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}]}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"wish","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"ios","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}],"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Removing a product from the wishlist

Method Objective

The method gives the system an understanding the user has removed a product from the wishlist.

Parameters

Note

Only parameters related to the event of removing a product from the wishlist are listed here. See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequiredThe value must be "remove_wish".
itemsObject arrayrequired

For the "remove_wish" event, the array should contain only one object with a product ID. See the example below.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

payloadObjectReserved for the JS SDK internal use

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"remove_wish","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","segmentstream":"Aandroid","referersegment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}]}'

# with the "source" param
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"remove_wish","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"ios","segment":"A","referer":"https://mystore.com/product/100500","items":[{"id":"100500"}],"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'
Custom Event


Update the current wishlist

Method Objective

The method gives updates the whole wishlist on the system an understanding that some user event has happened.

Request

EndpointRequest TypeContent-Typehttps://api.personaclick.com/push/customPOSTapplication/json

side.

Parameters

Note

Only parameters related to the custom event of updating the wishlist are listed here. See  See "Basic Details" above for more information on required parameters and the API endpoint.


NameTypeRequirementDescription
eventstringrequired
Unique custom event key. Must be pre-created in the PersonaClick account: Settings > Custom events.categorystringoptionally

A category is a name that you supply as a way to group some event's properties.

labelstringoptionally

With labels, you can provide additional information for events that you need.

valuenumberrequired in some casesThe value property can be any integer and can be used to send a specific value in an event
The value must be "wish".
itemsObject arrayrequired

Object array with the properties of the products in the wishlist. Available properties for each object:

  • id - the ID of the product in the wishlist. Type: string/number. Required.
Note

If the property is missing in the request, the system will clear the user's wishlist. Use this when the user's wishlist is cleared on the store side.

See the example below.

full_wishbooleanrequiredStatus of the wishlist synchronization. Should always be "true" in this case. See the example below.

API Response Code

HTTP status code

Description
204 No content200 OK

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The API doesn't return any response for this method.

Request Example

Code Block
languagejs
themeFadeToGrey

response is JSON type with the following properties:

NameTypeDescription
statusstring

Current status. Can have one of two values:

  • success - the request was successful
  • error - the request was unsuccessful
messagestring

The text of the error if it occurred

Request Examples

Example of synchronization of products in the wishlist.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push/custom' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"my_eventwish","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"ios","segment":"A","referer":"https://mystore.com/product/100500","category":"my_category","label":"my_label","value":100500}'

# with the "source" param
mystore.com/wish","items":[{"id":"100500"},{"id":"100123"}],"full_wish":true}'

Example of the wishlist cleaning.

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"wish","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/wish","full_wish":true}'


Custom Event

Method Objective

The method gives the system an understanding that some user event has happened.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/push/customPOSTapplication/json

Parameters

Note

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


NameTypeRequirementDescription
eventstringrequiredUnique custom event key. Must be pre-created in the PersonaClick account: Settings > Custom events.
categorystringoptionally

A category is a name that you supply as a way to group some event's properties.

labelstringoptionally

With labels, you can provide additional information for events that you need.

valuenumberrequired in some casesThe value property can be any integer and can be used to send a specific value in an event.

API Response Code

HTTP status code

Description
204 No content

The request was successful.

400 Bad Request

The reasons that can cause the error:

  • there is no "event" property in the request
  • there is no "did" property in the request
403 ForbiddenThe request was unsuccessful.

API Response Data

The API doesn't return any response for this method.

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/push/custom' \
  -X 'POST' \
  -H 'content-type: application/json' \
  -d '{"event":"my_event","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/product/100500","category":"my_category","label":"my_label","value":100500}'

# with the "source" param
curl 'https://api.personaclick.com/push/custom' \
  -X 'POST' \
  -H 'content-type: application/json \
  -d '{"event":"my_event","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","stream":"web","segment":"A","referer":"https://mystore.com/product/100500","category":"my_category","label":"my_label","value":100500,"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'


Receiving App Push

Method Objective

The method makes the system aware of App Push receiving from a specific campaign.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/track/receivedPOSTapplication/json

Parameters

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

Message identifier.

  • App Push: Value can be taken from push's JSON payload. For Android it's located in "id" property. In iOS SDK it's "src.id"
typestringrequired

Message type.

  • App Push: Value can be taken from push's JSON payload. For Android it's located in "type" property. In iOS SDK it's "src.type"
streamstringrequiredData stream code. Alphanumeric string (letters, numbers only). Max length: 16. The empty default value will mean "web". Can be "ios", "android" or any other string. Used to distinguish between mobile apps, websites, and other events sources.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.

API Response Data

The API doesn't return any response for this method.

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/track/received' \
    -X 'POST' \
    -H 'Content-Type: application/json' \
    -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","code":"731d5e0c-e3b1-11eb-ba80-0242ac130004","type":"chain","stream":"android"}'



Clicking on App Push / SMS

Method Objective

The method makes the system aware of App Push or SMS clicking from a specific campaign.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/track/clickedPOSTapplication/json

Parameters

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

Message identifier.

  • App Push: Value can be taken from push's JSON payload. For Android it's located in "id" property. In iOS SDK it's "src.id"

  • SMS: The value should be taken from the "mail_code" parameter of a link published in an SMS.

    Note

    The system automatically adds this parameter for each campaign. Only links with a hypertext protocol (http/https) can be recognized by the system to add the parameter.


typestringrequired

Message type.

  • App Push: Value can be taken from push's JSON payload. For Android it's located in "type" property. In iOS SDK it's "src.type"

  • SMS: The value should be taken from the "recommended_by" parameter of a link published in an SMS.

    Note

    The system automatically adds this parameter for each campaign. Only links with a hypertext protocol (http/https) can be recognized by the system to add the parameter.


streamstringrequiredData stream code. Alphanumeric string (letters, numbers only). Max length: 16. The empty default value will mean "web". Can be "ios", "android", "sms" or any other string. Used to distinguish between mobile apps, websites, and other events sources.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.

API Response Data

The API doesn't return any response for this method.

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/pushtrack/customclicked' \
    -X 'POST' \
  -H 'content-type: application/json \
  -d '{"event":"my_event","shop_id":"0d42fd8b713d0752776ca589cc0056","did":"7rjVGhMykT","seance":"R5eQXkrKCf","segment":"A","referer":"https://mystore.com/product/100500","category":"my_category","label":"my_label","value":100500,"source":"{\"from\":\"chain\",\"code\":\"abcdef-0123-4567-9810-012345abcdef\"}"}'
Clicking on
 -H 'Content-Type: application/json' \
    -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","code":"731d5e0c-e3b1-11eb-ba80-0242ac130004","type":"chain","stream":"android"}'



Closing App Push

Method Objective

The method makes the system aware of App Push clicking closing from a specific campaign.

Request

EndpointRequest TypeContent-Type
https://api.personaclick.com/web_push_subscriptions/clickedtrack/closedPOSTapplication/json

Parameters

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

Message identifier.

  • App Push: Value can be taken from push's JSON payload. For Android it's located in "id" property. In iOS SDK it's "src.id"
typestringrequired

Message type.

  • App Push: Value can be taken from push's JSON payload. For Android it's located in "type" property. In iOS SDK it's "src.type"
streamstringrequiredData stream code. Alphanumeric string (letters, numbers only). Max length: 16. The empty default value will mean "web". Can be "ios", "android" or any other string. Used to distinguish between mobile apps, websites, and other events sources.

API Response Code

HTTP status code

Description
200 OK

The request was successful.

403 ForbiddenThe request was unsuccessful.

API Response Data

The API doesn't return any response for this method.

Request Example

Code Block
languagejs
themeFadeToGrey
curl 'https://api.personaclick.com/web_push_subscriptions/clickedtrack/closed' \
    -X 'POST' \
    -H 'Content-Type: application/json' \
    -d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","code":"731d5e0c-e3b1-11eb-ba80-0242ac130004","type":"chain","stream":"android"}'



Column

Page Navigation

Table of Contents
maxLevel1
indent0px
stylenone




Related Pages

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