Import orders
curl --request POST \
--url https://api.products.kameleoon.com/sync/orders \
--header 'Content-Type: application/json' \
--data '
{
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"external_id": "jhfakfkadak",
"status": "Processing",
"channel": "In-store",
"date": 1602338740,
"offline": false,
"location_id": "7701123",
"value": {
"total": 200.13
},
"payment_structure": {
"cash": 190,
"bonuses": 15,
"delivery": 20,
"discount": 24.87
},
"items": [
{
"id": "ITEM-ID-1",
"price": 205,
"quantity": 1,
"status": "created"
}
]
}
]
}
'import requests
url = "https://api.products.kameleoon.com/sync/orders"
payload = {
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"external_id": "jhfakfkadak",
"status": "Processing",
"channel": "In-store",
"date": 1602338740,
"offline": False,
"location_id": "7701123",
"value": { "total": 200.13 },
"payment_structure": {
"cash": 190,
"bonuses": 15,
"delivery": 20,
"discount": 24.87
},
"items": [
{
"id": "ITEM-ID-1",
"price": 205,
"quantity": 1,
"status": "created"
}
]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
shop_id: 'DvLWN2ZTMZ',
shop_secret: 'EIxTuot8sj',
orders: [
{
id: 'yKsvZbWpCL',
external_id: 'jhfakfkadak',
status: 'Processing',
channel: 'In-store',
date: 1602338740,
offline: false,
location_id: '7701123',
value: {total: 200.13},
payment_structure: {cash: 190, bonuses: 15, delivery: 20, discount: 24.87},
items: [{id: 'ITEM-ID-1', price: 205, quantity: 1, status: 'created'}]
}
]
})
};
fetch('https://api.products.kameleoon.com/sync/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.products.kameleoon.com/sync/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'shop_id' => 'DvLWN2ZTMZ',
'shop_secret' => 'EIxTuot8sj',
'orders' => [
[
'id' => 'yKsvZbWpCL',
'external_id' => 'jhfakfkadak',
'status' => 'Processing',
'channel' => 'In-store',
'date' => 1602338740,
'offline' => false,
'location_id' => '7701123',
'value' => [
'total' => 200.13
],
'payment_structure' => [
'cash' => 190,
'bonuses' => 15,
'delivery' => 20,
'discount' => 24.87
],
'items' => [
[
'id' => 'ITEM-ID-1',
'price' => 205,
'quantity' => 1,
'status' => 'created'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.products.kameleoon.com/sync/orders"
payload := strings.NewReader("{\n \"shop_id\": \"DvLWN2ZTMZ\",\n \"shop_secret\": \"EIxTuot8sj\",\n \"orders\": [\n {\n \"id\": \"yKsvZbWpCL\",\n \"external_id\": \"jhfakfkadak\",\n \"status\": \"Processing\",\n \"channel\": \"In-store\",\n \"date\": 1602338740,\n \"offline\": false,\n \"location_id\": \"7701123\",\n \"value\": {\n \"total\": 200.13\n },\n \"payment_structure\": {\n \"cash\": 190,\n \"bonuses\": 15,\n \"delivery\": 20,\n \"discount\": 24.87\n },\n \"items\": [\n {\n \"id\": \"ITEM-ID-1\",\n \"price\": 205,\n \"quantity\": 1,\n \"status\": \"created\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.products.kameleoon.com/sync/orders")
.header("Content-Type", "application/json")
.body("{\n \"shop_id\": \"DvLWN2ZTMZ\",\n \"shop_secret\": \"EIxTuot8sj\",\n \"orders\": [\n {\n \"id\": \"yKsvZbWpCL\",\n \"external_id\": \"jhfakfkadak\",\n \"status\": \"Processing\",\n \"channel\": \"In-store\",\n \"date\": 1602338740,\n \"offline\": false,\n \"location_id\": \"7701123\",\n \"value\": {\n \"total\": 200.13\n },\n \"payment_structure\": {\n \"cash\": 190,\n \"bonuses\": 15,\n \"delivery\": 20,\n \"discount\": 24.87\n },\n \"items\": [\n {\n \"id\": \"ITEM-ID-1\",\n \"price\": 205,\n \"quantity\": 1,\n \"status\": \"created\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.products.kameleoon.com/sync/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"shop_id\": \"DvLWN2ZTMZ\",\n \"shop_secret\": \"EIxTuot8sj\",\n \"orders\": [\n {\n \"id\": \"yKsvZbWpCL\",\n \"external_id\": \"jhfakfkadak\",\n \"status\": \"Processing\",\n \"channel\": \"In-store\",\n \"date\": 1602338740,\n \"offline\": false,\n \"location_id\": \"7701123\",\n \"value\": {\n \"total\": 200.13\n },\n \"payment_structure\": {\n \"cash\": 190,\n \"bonuses\": 15,\n \"delivery\": 20,\n \"discount\": 24.87\n },\n \"items\": [\n {\n \"id\": \"ITEM-ID-1\",\n \"price\": 205,\n \"quantity\": 1,\n \"status\": \"created\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success"
}{
"status": "error",
"message": "Incorrect shop credentials"
}Import
Import orders
Import or update transaction orders and their line items in Kameleoon to power product recommendations and analytics.
POST
/
sync
/
orders
Import orders
curl --request POST \
--url https://api.products.kameleoon.com/sync/orders \
--header 'Content-Type: application/json' \
--data '
{
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"external_id": "jhfakfkadak",
"status": "Processing",
"channel": "In-store",
"date": 1602338740,
"offline": false,
"location_id": "7701123",
"value": {
"total": 200.13
},
"payment_structure": {
"cash": 190,
"bonuses": 15,
"delivery": 20,
"discount": 24.87
},
"items": [
{
"id": "ITEM-ID-1",
"price": 205,
"quantity": 1,
"status": "created"
}
]
}
]
}
'import requests
url = "https://api.products.kameleoon.com/sync/orders"
payload = {
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"external_id": "jhfakfkadak",
"status": "Processing",
"channel": "In-store",
"date": 1602338740,
"offline": False,
"location_id": "7701123",
"value": { "total": 200.13 },
"payment_structure": {
"cash": 190,
"bonuses": 15,
"delivery": 20,
"discount": 24.87
},
"items": [
{
"id": "ITEM-ID-1",
"price": 205,
"quantity": 1,
"status": "created"
}
]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
shop_id: 'DvLWN2ZTMZ',
shop_secret: 'EIxTuot8sj',
orders: [
{
id: 'yKsvZbWpCL',
external_id: 'jhfakfkadak',
status: 'Processing',
channel: 'In-store',
date: 1602338740,
offline: false,
location_id: '7701123',
value: {total: 200.13},
payment_structure: {cash: 190, bonuses: 15, delivery: 20, discount: 24.87},
items: [{id: 'ITEM-ID-1', price: 205, quantity: 1, status: 'created'}]
}
]
})
};
fetch('https://api.products.kameleoon.com/sync/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.products.kameleoon.com/sync/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'shop_id' => 'DvLWN2ZTMZ',
'shop_secret' => 'EIxTuot8sj',
'orders' => [
[
'id' => 'yKsvZbWpCL',
'external_id' => 'jhfakfkadak',
'status' => 'Processing',
'channel' => 'In-store',
'date' => 1602338740,
'offline' => false,
'location_id' => '7701123',
'value' => [
'total' => 200.13
],
'payment_structure' => [
'cash' => 190,
'bonuses' => 15,
'delivery' => 20,
'discount' => 24.87
],
'items' => [
[
'id' => 'ITEM-ID-1',
'price' => 205,
'quantity' => 1,
'status' => 'created'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.products.kameleoon.com/sync/orders"
payload := strings.NewReader("{\n \"shop_id\": \"DvLWN2ZTMZ\",\n \"shop_secret\": \"EIxTuot8sj\",\n \"orders\": [\n {\n \"id\": \"yKsvZbWpCL\",\n \"external_id\": \"jhfakfkadak\",\n \"status\": \"Processing\",\n \"channel\": \"In-store\",\n \"date\": 1602338740,\n \"offline\": false,\n \"location_id\": \"7701123\",\n \"value\": {\n \"total\": 200.13\n },\n \"payment_structure\": {\n \"cash\": 190,\n \"bonuses\": 15,\n \"delivery\": 20,\n \"discount\": 24.87\n },\n \"items\": [\n {\n \"id\": \"ITEM-ID-1\",\n \"price\": 205,\n \"quantity\": 1,\n \"status\": \"created\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.products.kameleoon.com/sync/orders")
.header("Content-Type", "application/json")
.body("{\n \"shop_id\": \"DvLWN2ZTMZ\",\n \"shop_secret\": \"EIxTuot8sj\",\n \"orders\": [\n {\n \"id\": \"yKsvZbWpCL\",\n \"external_id\": \"jhfakfkadak\",\n \"status\": \"Processing\",\n \"channel\": \"In-store\",\n \"date\": 1602338740,\n \"offline\": false,\n \"location_id\": \"7701123\",\n \"value\": {\n \"total\": 200.13\n },\n \"payment_structure\": {\n \"cash\": 190,\n \"bonuses\": 15,\n \"delivery\": 20,\n \"discount\": 24.87\n },\n \"items\": [\n {\n \"id\": \"ITEM-ID-1\",\n \"price\": 205,\n \"quantity\": 1,\n \"status\": \"created\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.products.kameleoon.com/sync/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"shop_id\": \"DvLWN2ZTMZ\",\n \"shop_secret\": \"EIxTuot8sj\",\n \"orders\": [\n {\n \"id\": \"yKsvZbWpCL\",\n \"external_id\": \"jhfakfkadak\",\n \"status\": \"Processing\",\n \"channel\": \"In-store\",\n \"date\": 1602338740,\n \"offline\": false,\n \"location_id\": \"7701123\",\n \"value\": {\n \"total\": 200.13\n },\n \"payment_structure\": {\n \"cash\": 190,\n \"bonuses\": 15,\n \"delivery\": 20,\n \"discount\": 24.87\n },\n \"items\": [\n {\n \"id\": \"ITEM-ID-1\",\n \"price\": 205,\n \"quantity\": 1,\n \"status\": \"created\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success"
}{
"status": "error",
"message": "Incorrect shop credentials"
}This endpoint allows you to import a list of transaction orders into your Kameleoon account. You can also use this endpoint to update orders and their properties if they already exist in the Kameleoon database. You should send the data as a JSON string in the request’s body.
List of parameters for
List of parameters for
List of parameters for
List of parameters for
List of query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
shop_id | String | True | Store Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary. |
shop_secret | String | True | Secret Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary. |
orders | Array | True | List of orders. Find in this table the parameters required for orders. |
List of parameters for orders object
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | True | Order ID |
external_id | String | True | A unique identifier associated with a user in your system or CRM. (To ensure accurate matching with Kameleoon VisitorCode, you must first store the ID as Kameleoon Custom Data. When setting up this custom data, make sure to enable the option Use this custom data as a unique identifier for cross-device matching so Kameleoon uses the ID to link user activities across both systems.) |
status | String | True | Order status (for example, Processing, Out for delivery, Delivered) |
channel | String | True | Medium used for order (for example, Website, App, In-store) |
date | Integer | True | Unix timestamp in seconds of when you placed or updated the order |
offline | Boolean | False | Flags orders as offline. It defaults to false |
location_id | String | True | User’s location (city) ID |
promocode | String | False | Promo code used in the order |
delivery_type | String | False | Delivery type (for example, Courier, Pickup in-store) |
delivery_address | String | False | Destination address for CRM |
delivery_date | Date | False | Expected delivery date. Format: “YYYY-MM-DD” |
delivery_time | Time | False | Expected delivery time. Format: “HH:MM” |
payment_type | String | False | Payment type (for example, Cash, Card, Wire) |
tax_free | Boolean | False | Indicates whether the item is tax-free |
bank_issuer | String | False | Bank issuer |
bank_pos_processor | String | False | Indicates which point of sale (POS) system or terminal you used for the payment |
bank_loyalty_program | String | False | Bank loyalty program |
bank_total_installment | Integer | False | Total installments remaining to pay through the bank |
payment_card_provider | String | False | Payment card provider |
gift_package | Boolean | False | Indicates whether the item will be in a gift package |
value | Object | True | Order grand total. Find the required parameter for value in this table. |
payment_structure | Object | True | A breakdown of the payment (for example, cash payments, discounts, delivery fees). Find the parameters required for payment_structure in this table. |
items | Object | True | Everything the order includes. Find the parameters required for items in this table. |
List of parameters for value object
| Parameter | Type | Required | Description |
|---|---|---|---|
total | Numeric | True | Order total |
List of parameters for payment_structure object
| Parameter | Type | Required | Description |
|---|---|---|---|
cash | Numeric | False | Indicates what portion of the order total the customer paid in cash |
bonuses | Numeric | False | Indicates what portion of the order total the customer paid with bonuses |
delivery | Numeric | False | Indicates the cost of the order’s delivery |
discount | Numeric | False | Indicates the order’s discounted value |
Ensure that
value.total == payment_structure.cash + payment_structure.bonuses + payment_structure.delivery - payment_structure.discountList of parameters for items object
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | True | Purchased product’s ID |
price | Numeric | True | Price of a single unit of the product |
quantity | Integer | True | Total quantity of the chosen products |
status | String | True | Item status; can only be: created, invoiced, shipped, delivered, cancelled, refunded |
original_price | Numeric | False | Product’s original price |
discount_product | Numeric | False | Product’s discounted price |
discount_bonuses | Numeric | False | Product’s discounted bonuses |
delivery_company | String | False | Postal service that delivered the item |
barcode | String | False | Product’s barcode |
line_id | String | False | Unique ID for this product’s position (line item) in your store’s order system. |
cancel_reason | String | False | Cancellation reason |
You must include the
items object when you create an order. You can send it as an empty array when updating an order’s status.Example JSON request
{
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"external_id": "jhfakfkadak",
"status": "Processing",
"channel": "In-store",
"date": 1602338740,
"offline": false,
"location_id": "7701123",
"promocode": "vxawxSi9Uy",
"delivery_type": "courier",
"delivery_address": "111 Peter Street, Toronto, ON, M5V 2H1",
"delivery_date": "2021-12-21",
"delivery_time": "15:00",
"tax_free": false,
"bank_issuer": "Scotiabank",
"bank_pos_processor": "Clover",
"bank_loyalty_program": "PC Optimum",
"bank_total_installment": 0,
"payment_card_provider": "Visa",
"gift_package": true,
"value": {
"total": 200.13
},
"payment_structure": {
"cash": 190,
"bonuses": 15,
"delivery": 20,
"discount": 24.87
},
"items": [
{
"id": "ITEM-ID-1",
"price": 205,
"quantity": 1,
"status": "created",
"original_price": 230,
"discount_product": 30,
"discount_bonuses": 20,
"delivery_company": "Canada Post",
"barcode": "195204003541",
"line_id": "195204003541-22323443-123434",
"cancel_reason": "none"
}
]
}
]
}
Canceling an order
Because the Import orders endpoint handles both creating and updating orders, you can also use it to register a canceled order. To register a canceled order, provide the following:Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
shop_id | String | True | Store Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary. |
shop_secret | String | True | Secret Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary. |
orders | Array | True | List of orders. Provide the orders you’d like to register as canceled. |
orders object parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | True | Order ID |
status | String | True | Order’s status (set to cancelled) |
Example cancellation JSON request
{
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"status": "cancelled"
}
]
}
Body
application/json
Store Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.
Secret Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.
List of orders.
Show child attributes
Show child attributes
Response
Orders imported or updated. Verified against a live response on 2026-09-24.
Request outcome.
Available options:
success Was this page helpful?
⌘I