Order Analytics API

Record a placed order and the source and channel of each ordered product.

Last updated

On this page

Overview

Use the Order Analytics API to record a placed order.

Endpoint

MethodPath
POST/api/v2/conversion/order

Request body parameters

Parameter nameRequirementTypeDescription
orderrequiredobjectPlaced order information.
userTokenoptionalstring | nullableUnique for every user session (cookie _athena). Send it if orders are placed by clicking on an Athena XAI rendered product.
tokenoptionalrequiredAthena XAI website token.
order.itemsrequiredarray of objectsInformation about the ordered products.
order.items.0.sourceoptionalstringThe source that led the user to the add to cart, click or order action. See the possible source values.
order.items.0.channeloptionalstringThe source’s channel, a more detailed explanation of the origin. See the possible channel values.

Example call

MethodPath
POST{{athena_url}}/api/v2/conversion/order

Body raw (JSON)

JSON
{
    "token": "website token",
    "source" : "search",
    "channel" : "search landing page",
    "ip_address" : "ip_address",
    "order" : {
        "quote_id" : 3,
        "increment_id" : "000000003",
        "store_id" : 1,
        "status" : "pending",
        "order_currency_code" : "RSD",
        "base_grand_total" : 8999.00,
        "subtotal_price" : 8999.00,
        "tax_price" : 0.0,
        "discount_price" : 0,
        "shipping_price" : 0,
        "items" : [
            {
                "name" : "Gazelle",
                "id" : 2541277,
                "sku" : "BB5476",
                "type" : "configurable",
                "qty" : 1,
                "price_incl_tax" : 8999.00,
                "price_with_qty_incl_tax" : 8999.00,
                "price" :  8999.00,
                "row_total" :  8999.00,
                “source” : “search”,
                “channel” : “search landing page”
            }
        ]
    }
}

Response

JSON
{
    "message":"Order Analytics was successfully stored.",
    "status":200
}