Skip to main content

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. See https://www.iab.com/guidelines/iab-abc-international-spiders-bots-list/.
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 = JSON object>>
           (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 = integerint32>
           (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 = JSON object>
           (optional) sku = <product SKU = string>
           (optional) merchantID = <product merchant id = string>
           (optional) price = <product price = numberdouble>
           (optional) oldPrice = <product old (crossed-out) price = numberdouble>
           (optional) tags = <JSON array of <product tag = string>>
           (optional) rating = <product rating = numberdouble>
           (optional) description = <product description = string>
           (optional) params = <JSON array of <product param = JSON object>>
           (optional) groupId = <product group Id = string>
           (optional) accessories = <JSON array of <product accessory = string>>
           (optional) seasonality = <JSON array of <month from 1 to 12 = integerint32>>
           (optional) priceMargin = <product price margin = integerint32>
           (optional) isNew = <true if product is new, else false = boolean>
           (optional) auto = <product auto data = JSON object>
           (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 = integerint32>
    only for eventType = "PRODUCTBUY":
           (required) quantity = <quantity of product bought = integerint32>

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

Responses

Request allowed, URL query processed successfully, request body will be processed

Loading...