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
required
String
This is your Klevu JS API Key.
klevu_type
required
String
This is constant value. The value must be checkout.
klevu_productId
required
String
This is the Klevu ID of the clicked product. eg. 54321-12345.
klevu_productGroupId
required
String
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
required
String
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
required
Integer
This is the total quantity purchased. It must be an integer (e.g. 5).
klevu_salePrice
required
Number
Product's sale price for one unit. You can supply decimal values.
klevu_currency
required
String
Three digit currency code. e.g GBP, USD, EUR.
klevu_shopperIP
required
String
IP address of the shopper who bought the product(s).
*If calling from javascript, this is an optional parameter.
klevu_shopperIP_v4
optional
String
IPv4 address of the shopper who purchased a product.
klevu_shopperIP_v6
optional
String
IPv6 address of the shopper who purchased a product.
data_protection
optional
Boolean
If set to false, Klevu's backend do not obtain the shoppers' IP address. The default value is true.
klevu_uuid
optional
String
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
optional
String
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
optional
String
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
required
String
The event version is used by Klevu's backend. The current version is 1.0.0
event
required
String
Define the type of event. For order, use a constant value order_purchase.
event_apikey
required
String
Your Klevu JS Api Key, eg. klevu-12345.
user_profile
optional
Object
The optional json object that holds the user related information such as ip_address, email.
items
required
Array
Depending on the number of orders, the item array accepts single or more orders.
order_id
optional
String
The unique identifier for your orders.
order_line_id
optional
String
The unique identifier for reference to a line on an order within the database.
item_name
required
String
The name of the product.
item_id
required
String
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
required
String
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
required
String
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
required
Number
The final selling price of the product, for example 123.45
currency
required
String
The currency of the above price, eg. USD.
units
optional
Integer
The number of units sold for a product. In case if the parameter is mising, the default value will be 1
Updated 13 Aug 2024
Did this page help you?