Skip to main content

POST /product/events

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.

Request

Query Parameters

    siteCode stringrequired

    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

    Default value: false

Body

required

Events to save. Body size limited to 1 MB.

When the URL query parameter is missing the "json" key or its value is set to false, the body consists of one or more lines, with each line representing an event in a specific format. The format is as follows: <parameter 1 name>=<parameter 1 value>&<parameter 2 name>=<parameter 2 value> and so on. Make sure to escape values that may contain characters = or &, for example using the function encodeURIComponent in JavaScript.

If the URL contains the query parameter "json" with the value set to true, then the body will be a JSON array of events. Each event will be represented as a JSON object, formatted like this: {"<parameter 1 name>": <parameter 1 value>, "<parameter 2 name>": <parameter 2 value>, etc.}.

In all cases, the body will contain the following parameters:

NameTypeRequiredDescription
eanstringRequired if not provided in URL query parameters, else ignoredProduct code
Limited to 100 characters
eventTypestringRequiredOne of the following: PRODUCTPAGE, PRODUCTADDTOCART, PRODUCTBUY

List of parameters for the eventType PRODUCTPAGE:

NameTypeRequiredDescription
namestringOptionalProduct name
Limited to 250 characters
categoriesJSON arrayOptionalJSON array of product categories
Limited to 100 categories
See below for the product category type description
urlstringOptionalProduct URL
Limited to 2048 characters
imageURLstringOptionalURL of product picture
Limited to 2048 characters
availablebooleanOptionalIs product available?
availableQuantityint32OptionalAvailable quantities of product
brandstringOptionalProduct brand
Limited to 250 characters
isChildbooleanOptionalIs product is made for children?
isFashionbooleanOptionalDoes the product follow fashion?
fashionJSON objectOptionalSee below for the product fashion type description
skustringOptionalProduct SKU
Limited to 100 characters
merchantIDstringOptionalProduct merchant Id
Limited to 100 characters
pricefloat64OptionalProduct price
oldPricefloat64OptionalProduct old (crossed-out) price
tagsJSON arrayOptionalJSON array of product tags (string)
Limited to 100 tags
Every tag is limited to 100 characters
ratingfloat64OptionalProduct rating
descriptionstringOptionalProduct description
Limited to 4000 characters
paramsJSON arrayOptionalJSON array of product params
Limited to 100 params
See below for the product param type description
groupIdstringOptionalProduct group id
Limited to 100 characters
accessoriesJSON arrayOptionalJSON array of product accessories (string)
Limited to 100 accessories
Every accessory is limited to 100 characters
seasonalityJSON arrayOptionalJSON array of monthes, from 1 to 12
priceMarginint32OptionalProduct price margin
isNewbooleanOptionalIs product is new?
autoJSON objectOptionalSee below for the product auto type description
modelstringOptionalProduct model
Limited to 100 characters
leftoversstringOptionalProduct leftovers
Limited to 100 characters
typePrefixstringOptionalProduct type prefix
Limited to 100 characters

List of parameters for the eventType PRODUCTADDTOCART:

NameTypeRequiredDescription
quantityint32RequiredQuantity of product added to cart

List of parameters for the eventType PRODUCTBUY:

NameTypeRequiredDescription
quantityint32RequiredQuantity of product bought

The product category type is JSON object, with the following fields:

NameTypeRequiredDescription
idstringRequiredCategory Id
Limited to 100 characters
namestringOptionalCategory name
Limited to 100 characters
urlstringOptionalCategory URL
Limited to 2048 characters
parentstringOptionalParent category id
Limited to 100 characters

The product fashion type is JSON object, with the following fields:

NameTypeRequiredDescription
genderstringOptionalProduct gender
Limited to 100 characters
typestringOptionalProduct type
Limited to TODO characters
sizesJSON arrayOptionalJSON array of product sizes (string)
Limited to 100 sizes
Every size is limited to 100 characters
featurestringOptionalProduct feature
Limited to 100 characters
colorsJSON arrayOptionalJSON array of product colors
Limited to 100 colors
See below for the product color type description

The product color type is JSON object, with the following fields:

NameTypeRequiredDescription
colorstringRequiredColor
Limited to 100 characters
picturestringOptionalColor picture
Limited to 2048 characters

The product param type is JSON object, with the following fields:

NameTypeRequiredDescription
namestringOptionalParam name
Limited to 100 characters
valueJSON arrayOptionalJSON array of param values (string)
Limited to 40 values
Every value is limited to 250 characters
unitstringOptionalParam unit
Limited to 100 characters

The product auto type is JSON object, with the following fields:

NameTypeRequiredDescription
compatibilityJSON arrayOptionalJSON array of auto compatibilities (string)
Limited to 100 compatibilities
See below for the auto compatibility type description
vdsJSON arrayOptionalJSON array of auto VDS (string)
Limited to 100 VDS
Every VDS is limited to 100 characters

The auto compatibility type is JSON object, with the following fields:

NameTypeRequiredDescription
brandstringRequiredBrand
Limited to 100 characters
modelstringOptionalModel
Limited to 100 characters

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=2

Body 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}]

    string

Responses

URL query was processed successfully and no content is returned
Body will be processed asynchronously, no syntax check on body was done yet

Loading...