POST /product/events
This endpoint can be used to post attributes (name, price etc.) and events (view, add to cart, purchase) for several products.
An incoming request is rejected if the source is identified as bot or spider, according to user-agent filtering rules from IAB/ABC. Kameleoon is using single-pass method. This means nothing specific is to be done in the case request is sent from a web browser using a standard library (XHR); but in other cases the user should set a custom value to the User-Agent request header, to overwrite the default value set by the library.
Query Parameters
- siteCode string required
Id of the Kameleoon project
- ean string
Product Id / EAN. Note: if EAN is provided here, then it is assumed as the common value for all events in the body (bulk posting of several events restricted to the same product EAN). On the contrary, if you would like to bulk post several events across several different products EAN, then you must provide the EAN with every event in the body
- json boolean
Set to true if you provide the body content in JSON format, else URL query format is assumed. See body schema
- */*
Request Body required
Events to save. Body size limited to 10 MB
- string UTF-8
In the case the URL query parameter "json" is missing or present with value false, then body is made of one or several lines, each line encoding an event in the form <parameter 1 name>=<parameter 1 value>&<parameter 2 name>=<parameter 2 value> etc. (escape values that can contain characters = or & – aka JavaScript method encodeURIComponent).
In the case the URL query parameter "json" is present with value true, then body is a JSON array of events, each event being a JSON object {"<parameter 1 name>": <parameter 1 value>, "<parameter 2 name>": <parameter 2 value>, etc.}.
In all cases, with following parameter list:
• (optional) ean = <product Id / EAN, required if not provided in URL query parameters, else ignored = string>
• (required) eventType = <any following event type, case-insensitive = string>
• only for eventType = "PRODUCTPAGE":
◦ (optional) name = <product name = string>
◦ (optional) categories = <JSON array of <product category>>, with <product category> = JSON object with following fields:
- (required) id = <category Id = string>
- (optional) name = <category name = string>
- (optional) url = <category URL = string>
- (optional) parent = <parent category Id = string>
◦ (optional) url = <product URL = string>
◦ (optional) imageURL = <URL of product picture = string>
◦ (optional) available = <true if product is available, else false = boolean>
◦ (optional) availableQuantity = <available quantities of product = integer⁄int32>
◦ (optional) brand = <product brand = string>
◦ (optional) isChild = <true if product is made for children, else false = boolean>
◦ (optional) isFashion = <true if product has fashion, else false = boolean>
◦ (optional) fashion = <product fashion data>, with <product fashion data> = JSON object with following fields:
- (optional) gender = <product gender = string>
- (optional) type = <product type = string>
- (optional) sizes = <JSON array of <product size = string>>
- (optional) feature = <product feature = string>
- (optional) colors = <JSON array of <product color>>, with <product color> = JSON object with following fields:
· (required) color = <color = string>
· (optional) picture = <color picture = string>
◦ (optional) sku = <product SKU = string>
◦ (optional) merchantID = <product merchant Id = string>
◦ (optional) price = <product price = number⁄double>
◦ (optional) oldPrice = <product old (crossed-out) price = number⁄double>
◦ (optional) tags = <JSON array of <product tag = string>>
◦ (optional) rating = <product rating = number⁄double>
◦ (optional) description = <product description = string>
◦ (optional) params = <JSON array of <product param>>, with <product param> = JSON object with following fields:
- (optional) name = <param name = string>
- (optional) value = <JSON array of <param value = string>>
- (optional) unit = <param unit = string>
◦ (optional) groupId = <product group Id = string>
◦ (optional) accessories = <JSON array of <product accessory = string>>
◦ (optional) seasonality = <JSON array of <month from 1 to 12 = integer⁄int32>>
◦ (optional) priceMargin = <product price margin = integer⁄int32>
◦ (optional) isNew = <true if product is new, else false = boolean>
◦ (optional) auto = <product auto data>, with <product auto data> = JSON object with following fields:
- (optional) compatibility = <compatibility data>, with <compatibility data> = JSON object with following fields:
· (required) brand = <brand = string>
· (optional) model = <model = string>
- (optional) vds = <JSON array of <VDS = string>>
◦ (optional) model = <product model = string>
◦ (optional) leftovers = <product leftovers = string>
◦ (optional) typePrefix = <product type prefix = string>
• only for eventType = "PRODUCTADDTOCART":
◦ (required) quantity = <quantity of product added to cart = integer⁄int32>
• only for eventType = "PRODUCTBUY":
◦ (required) quantity = <quantity of product bought = integer⁄int32>
Note: in the examples below, we assume the parameter "ean" is provided in the URL query part, so this is bulk posting of several events restricted to the same product, and then "ean" is not needed in body events.
Body example in the case the URL query parameter "json" is missing or present with value false (NB:
%5B%22S%22%2C%20%22M%22%2C%20%22L%22%5D
is the escaped value of["S", "M", "L"]
):eventType=PRODUCTPAGE&name=Marvelous%20product&available=true&availableQuantity=50&sizes=%5B%22S%22%2C%20%22M%22%2C%20%22L%22%5D
eventType=PRODUCTADDTOCART&quantity=2Body example in the case the URL query parameter "json" is present with value true, with a "pretty" representation (not recommended):
[
{
"eventType": "PRODUCTPAGE",
"name": "Marvelous product",
"available": true,
"availableQuantity": 50,
"isFashion": true,
"fashion": {
"sizes": [
"S",
"M",
"L"
]
}
},
{
"eventType": "PRODUCTADDTOCART",
"quantity": 2
}
]Body example in the case the URL query parameter "json" is present with value true, with a "compact" representation (recommended):
[{"eventType":"PRODUCTPAGE","name":"Marvelous product","available":true,"availableQuantity":50,"isFashion":true,"fashion":{"sizes":["S","M","L"]}},{"eventType":"PRODUCTADDTOCART","quantity":2}]
- 204
- 400
- 401
- 403
- 413
- 429
- 500
Request is allowed, URL query was processed successfully, request body will be processed asynchronously, no content is returned in this response
Malformed request syntax
Failed authentication (missing token when required, bad token - malformed, expired, invalid signature)
Forbidden user-agent or access denied to restricted resource
Body too large
Rate limited
Unexpected internal error