> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send product events

> Posts attributes and events for multiple products.

An incoming request is rejected if the source is identified as bot or spider, according to [user-agent filtering rules from IAB/ABC](https://www.iab.com/guidelines/iab-abc-international-spiders-bots-list/).
Kameleoon uses a single-pass method. This means no specific action is required when sending requests from a web browser using a standard library (XHR); however, in other cases, you should set a custom value for the User-Agent request header to overwrite the default value set by the library.



## OpenAPI

````yaml /data.api.json post /product/events
openapi: 3.0.1
info:
  title: Kameleoon Data API
  description: ''
  version: '1.0'
servers:
  - url: https://eu-data.kameleoon.io
  - url: https://na-data.kameleoon.io
  - url: https://eu-data.kameleoon.eu
  - url: https://na-data.kameleoon.eu
security: []
paths:
  /product/events:
    post:
      tags:
        - Product
      summary: Send product events
      description: >-
        Posts attributes and events for multiple products.


        An incoming request is rejected if the source is identified as bot or
        spider, according to [user-agent filtering rules from
        IAB/ABC](https://www.iab.com/guidelines/iab-abc-international-spiders-bots-list/).

        Kameleoon uses a single-pass method. This means no specific action is
        required when sending requests from a web browser using a standard
        library (XHR); however, in other cases, you should set a custom value
        for the User-Agent request header to overwrite the default value set by
        the library.
      operationId: POST /product/events
      parameters:
        - name: user-agent
          in: header
          required: true
          description: >-
            Not always required. Kameleoon rejects an incoming request if the
            source is a bot or spider, based on [IAB/ABC user-agent filtering
            rules](https://www.iab.com/guidelines/iab-abc-international-spiders-bots-list/).

            Kameleoon uses a single-pass method. You don't need to take specific
            action when sending requests from a web browser using a standard
            library (XHR). However, in other cases, set a custom value for the
            `User-Agent` request header to overwrite the default value the
            library sets.
          schema:
            type: string
            default: kameleoon-docs
        - name: siteCode
          in: query
          description: Id of the Kameleoon project
          required: true
          schema:
            type: string
        - name: ean
          in: query
          description: >-
            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
          schema:
            type: string
        - name: json
          in: query
          description: >-
            Set to true if you provide the body content in JSON format, else URL
            query format is assumed. See body schema
          schema:
            type: boolean
            default: false
      requestBody:
        description: >-
          Save events. The body size limit is 3 MB.<br/><br/>If the
          <code>json</code> query parameter is missing or set to
          <code>false</code>, the body consists of one or more lines. Each line
          represents an event in the following format: <code>&lt;parameter 1
          name&gt;=&lt;parameter 1 value&gt;&amp;&lt;parameter 2
          name&gt;=&lt;parameter 2 value&gt;</code> and so on. Escape values
          that may contain characters <code>=</code> or <code>&amp;</code>, for
          example, using the <code>encodeURIComponent</code> JavaScript
          function.<br/><br/>If the <code>json</code> query parameter is set to
          <code>true</code>, provide the body as a JSON array of events.
          Represent each event as a JSON object, formatted like this: <code>{
          "&lt;parameter 1 name&gt;": &lt;parameter 1 value&gt;, "&lt;parameter
          2 name&gt;": &lt;parameter 2 value&gt;, etc. }</code>.<br/><br/>In all
          cases, the body contains the following
          parameters:<br/><table><tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr><tr><td>ean</td><td>string</td><td>Required</td><td>Product
          code<br/>Limit to 100
          characters</td></tr><tr><td>nonce</td><td>string</td><td>Required</td><td>A
          random string of 16 hexadecimal characters, <b>unique to each
          event</b>.</td></tr><tr><td>eventType</td><td>string</td><td>Required</td><td>One
          of the following: <code>PRODUCTPAGE</code>,
          <code>PRODUCTADDTOCART</code>,
          <code>PRODUCTBUY</code></td></tr></table><br/><br/><b>List of
          parameters for the eventType
          <code>PRODUCTPAGE</code>:</b><br/><table><tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr><tr><td>name</td><td>string</td><td>Optional</td><td>Product
          name<br/>Limit to 250
          characters</td></tr><tr><td>categories</td><td>JSON
          array</td><td>Optional</td><td>A JSON array of product categories.
          Limit to 100
          categories.</td></tr><tr><td>url</td><td>string</td><td>Optional</td><td>Product
          URL<br/>Limit to 2048
          characters</td></tr><tr><td>imageURL</td><td>string</td><td>Optional</td><td>URL
          of product picture<br/>Limit to 2048
          characters</td></tr><tr><td>available</td><td>boolean</td><td>Optional</td><td>Is
          the product
          available?</td></tr><tr><td>availableQuantity</td><td>int32</td><td>Optional</td><td>Product
          quantity
          available</td></tr><tr><td>brand</td><td>string</td><td>Optional</td><td>Product
          brand<br/>Limit to 250
          characters</td></tr><tr><td>isChild</td><td>boolean</td><td>Optional</td><td>Is
          the product for
          children?</td></tr><tr><td>isFashion</td><td>boolean</td><td>Optional</td><td>Does
          the product follow fashion
          trends?</td></tr><tr><td>fashion</td><td>JSON
          object</td><td>Optional</td><td>Fashion
          details.</td></tr><tr><td>sku</td><td>string</td><td>Optional</td><td>Product
          SKU<br/>Limit to 100
          characters</td></tr><tr><td>merchantID</td><td>string</td><td>Optional</td><td>Product
          merchant ID<br/>Limit to 100
          characters</td></tr><tr><td>price</td><td>float64</td><td>Optional</td><td>Product
          price</td></tr><tr><td>oldPrice</td><td>float64</td><td>Optional</td><td>Product
          old price</td></tr><tr><td>tags</td><td>JSON
          array</td><td>Optional</td><td>A JSON array of product
          tags.</td></tr><tr><td>rating</td><td>float64</td><td>Optional</td><td>Product
          rating</td></tr><tr><td>description</td><td>string</td><td>Optional</td><td>Product
          description<br/>Limit to 4000
          characters</td></tr><tr><td>params</td><td>JSON
          array</td><td>Optional</td><td>A JSON array of product
          params.</td></tr><tr><td>groupId</td><td>string</td><td>Optional</td><td>Product
          group ID<br/>Limit to 100
          characters</td></tr><tr><td>accessories</td><td>JSON
          array</td><td>Optional</td><td>A JSON array of product
          accessories.</td></tr><tr><td>seasonality</td><td>JSON
          array</td><td>Optional</td><td>A JSON array of months
          (1-12).</td></tr><tr><td>priceMargin</td><td>int32</td><td>Optional</td><td>Product
          price
          margin</td></tr><tr><td>isNew</td><td>boolean</td><td>Optional</td><td>Is
          the product new?</td></tr><tr><td>auto</td><td>JSON
          object</td><td>Optional</td><td>Auto
          details.</td></tr><tr><td>model</td><td>string</td><td>Optional</td><td>Product
          model<br/>Limit to 100
          characters</td></tr><tr><td>leftovers</td><td>string</td><td>Optional</td><td>Product
          leftovers<br/>Limit to 100
          characters</td></tr><tr><td>typePrefix</td><td>string</td><td>Optional</td><td>Product
          type prefix<br/>Limit to 100
          characters</td></tr></table><br/><br/><b>List of parameters for the
          eventType
          <code>PRODUCTADDTOCART</code>:</b><br/><table><tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr><tr><td>quantity</td><td>int32</td><td>Required</td><td>Quantity
          of product added to cart</td></tr></table><br/><br/><b>List of
          parameters for the eventType
          <code>PRODUCTBUY</code>:</b><br/><table><tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr><tr><td>quantity</td><td>int32</td><td>Required</td><td>Quantity
          of product bought</td></tr></table><br/><br/><b>Note: In these
          examples, Kameleoon assumes you provide the <code>ean</code> parameter
          in the URL query part.</b><br/><br/><b>Body example if the URL query
          parameter <code>json</code> is missing or its value is
          <code>false</code>:</b><br/><pre><code>eventType=PRODUCTPAGE&amp;name=Marvelous%20product&amp;available=true&amp;availableQuantity=50&amp;sizes=%5B%22S%22%2C%20%22M%22%2C%20%22L%22%5D

          eventType=PRODUCTADDTOCART&amp;quantity=2</code></pre><br/><b>Body
          example if the URL query parameter <code>json</code> is
          <code>true</code> (pretty representation):</b><br/><pre>


          ```[
            {
              "eventType": "PRODUCTPAGE",
              "name": "Marvelous product",
              "available": true,
              "availableQuantity": 50,
              "isFashion": true,
              "fashion": {
                "sizes": [
                  "S",
                  "M",
                  "L"
                ]
              }
            },
            {
              "eventType": "PRODUCTADDTOCART",
              "quantity": 2
            }
          ]


          ```

          </pre><br/><b>Body example if the URL query parameter
          <code>json</code> is <code>true</code> (compact
          representation):</b><br/><pre><code>[{"eventType":"PRODUCTPAGE","name":"Marvelous
          product","available":true,"availableQuantity":50,"isFashion":true,"fashion":{"sizes":["S","M","L"]}},{"eventType":"PRODUCTADDTOCART","quantity":2}]</code></pre>
        content:
          '*/*':
            schema:
              type: string
              format: UTF-8
        required: true
      responses:
        '202':
          description: >-
            Kameleoon processed the URL query and accepted the request. The
            response returns no content. <br/> <b>Kameleoon processes the body
            asynchronously and has not checked the body syntax yet.</b>
        '400':
          description: Malformed URL query syntax.
        '401':
          description: >-
            Authentication failed. Either the HTTP header value is malformed, or
            the token is missing or invalid (malformed, expired, or invalid
            signature).
        '403':
          description: Access denied. Forbidden user-agent or restricted resource.
        '413':
          description: The body is too large.
        '429':
          description: Kameleoon rate-limited the request.
        '500':
          description: An unexpected internal error occurred.

````