Guide
Analytics Tracking
Purchase Data
1min
Use this API endpoint to submit the purchase data per product.
The request should be made once for each line item purchased.
GET
Request
Query Parameters
klevu_apiKey
String
required
This is your Klevu JS API Key.
klevu_type
String
required
This is constant value. The value must be checkout.
klevu_productId
String
required
This is the Klevu ID of the clicked product. eg. 54321-12345.
klevu_productGroupId
String
required
This is the parent ID of the clicked product. eg. 54321. For compound products with a parent and multiple child/variant products, this is the common ID which ties the products together. For simple products, please specify the same as klevu_productId.
klevu_productVariantId
String
required
This is the child/variant ID of the clicked product. eg. 12345. For compound products with a parent and multiple child/variant products, this is the ID of the specific variant. For simple products, please specify the same as klevu_productId.
klevu_unit
Integer
required
This is the total quantity purchased. It must be an integer (e.g. 5).
klevu_salePrice
Number
required
Product's sale price for one unit. You can supply decimal values.
klevu_currency
String
required
Three digit currency code. e.g GBP, USD, EUR.
klevu_shopperIP
String
required
IP address of the shopper who bought the product(s).
*If calling from javascript, this is an optional parameter.
klevu_shopperIP_v4
String
optional
IPv4 address of the shopper who purchased a product.
klevu_shopperIP_v6
String
optional
IPv6 address of the shopper who purchased a product.
data_protection
Boolean
optional
If set to false, Klevu's backend do not obtain the shoppers' IP address. The default value is true.
klevu_uuid
String
optional
Universally unique identifier generated by Klevu, it can be also considered as session id. Please obtain UUID using end-point: https://docs.klevu.com/apis/uuid
klevu_country
String
optional
2-digit country code of the shopper who purchased a product. Valid codes can be found at https://developers.google.com/hotels/hotel-prices/dev-guide/country-codes
klevu_city
String
optional
City name of the shopper who purchased a product.
The end-point is used for reporting multiple orders in batch.
POST
Request
Body Parameters
event_version
String
required
The event version is used by Klevu's backend. The current version is 1.0.0
event
String
required
Define the type of event. For order, use a constant value order_purchase.
event_apikey
String
required
Your Klevu JS Api Key, eg. klevu-12345.
event_timestamp_ms
Number
optional
Event timestamp in milliseconds e.g. 1736256722349
user_profile
Object
optional
The optional json object that holds the user related information such as ip_address, email.
items
Array
required
Depending on the number of orders, the item array accepts single or more orders.
order_id
String
optional
The unique identifier for your orders.
order_line_id
String
optional
The unique identifier for reference to a line on an order within the database.
item_name
String
required
The name of the product.
item_id
String
required
The full ID of the product. eg. 12345-54321. This will match the unique value used in your data sync process with Klevu. For compound products consisting of a child/variant and a parent, this is usually parentId-childId.
item_group_id
String
required
The Parent ID of the product. eg. 12345. For compound products consisting of a child/variant and a parent, please specify the ID of the parent. For simple products, please re-use the same value as item_id
item_variant_id
String
required
The Child ID of the product.eg. 54321. Please specify the ID of the child/variant product. For simple products, please re-use the same value as item_id.
unit_price
Number
required
The final selling price of the product, for example 123.45
currency
String
required
The currency of the above price, eg. USD.
units
Integer
optional
The number of units sold for a product. In case if the parameter is mising, the default value will be 1
Updated 07 Jan 2025

Did this page help you?