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"
}Importieren
Bestellungen importieren
Importieren oder aktualisieren Sie Transaktionsbestellungen und deren Positionen in Kameleoon, um Produktempfehlungen und Analysen zu unterstützen.
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"
}Mit diesem Endpoint können Sie eine Liste von Transaktionsbestellungen in Ihr Kameleoon-Konto importieren. Sie können diesen Endpoint auch verwenden, um Bestellungen und ihre Eigenschaften zu aktualisieren, wenn sie bereits in der Kameleoon-Datenbank vorhanden sind. Die Daten sollten als JSON-Zeichenfolge im Anfragetext gesendet werden.
Liste der Parameter für das
Liste der Parameter für das
Liste der Parameter für das
Liste der Parameter für das
Liste der Abfrageparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
shop_id | String | True | Store Key. Sie finden ihn in Recommendations > Settings > Store settings in der Kameleoon App. Kontaktieren Sie Ihren Customer Success Manager, falls erforderlich, um den Schlüssel zu erhalten. |
shop_secret | String | True | Secret Key. Sie finden ihn in Recommendations > Settings > Store settings in der Kameleoon App. Kontaktieren Sie Ihren Customer Success Manager, falls erforderlich, um den Schlüssel zu erhalten. |
orders | Array | True | Liste der Bestellungen. In dieser Tabelle finden Sie die für orders erforderlichen Parameter. |
Liste der Parameter für das orders-Objekt
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
id | String | True | Bestell-ID |
external_id | String | True | Dies ist ein eindeutiger Identifikator, der einem Benutzer in Ihrem System oder CRM zugeordnet ist. (Um eine genaue Übereinstimmung mit dem Kameleoon VisitorCode zu gewährleisten, muss die ID zunächst als Kameleoon Custom Data gespeichert werden. Stellen Sie beim Einrichten dieser Custom Data sicher, dass Sie die Option Use this custom data as a unique identifier for cross-device history reconciliation aktivieren, um sicherzustellen, dass die ID verwendet wird, um Benutzeraktivitäten in beiden Systemen zu verknüpfen.) |
status | String | True | Bestellstatus (zum Beispiel Processing, Out for delivery, Delivered) |
channel | String | True | Für die Bestellung verwendetes Medium (zum Beispiel Website, App, In-store) |
date | Integer | True | Unix-Zeitstempel in Sekunden, wann die Bestellung aufgegeben oder aktualisiert wurde |
offline | Boolean | False | Markiert Bestellungen als offline. Standardmäßig auf false gesetzt |
location_id | String | True | ID des Standorts (Stadt) des Benutzers |
promocode | String | False | In der Bestellung verwendeter Promo-Code |
delivery_type | String | False | Liefertyp (zum Beispiel Courier, Pickup in-store) |
delivery_address | String | False | Zieladresse für CRM |
delivery_date | Date | False | Voraussichtliches Lieferdatum. Format: “YYYY-MM-DD” |
delivery_time | Time | False | Voraussichtliche Lieferzeit. Format: “HH:MM” |
payment_type | String | False | Zahlungsart (zum Beispiel Cash, Card, Wire) |
tax_free | Boolean | False | Gibt an, ob der Artikel steuerfrei ist |
bank_issuer | String | False | Bankaussteller |
bank_pos_processor | String | False | Gibt an, welches Point-of-Sales-System/Terminal (POS) zum Zeitpunkt der Zahlung verwendet wurde |
bank_loyalty_program | String | False | Bank-Treueprogramm |
bank_total_installment | Integer | False | Gesamtanzahl der über die Bank zu zahlenden Raten |
payment_card_provider | String | False | Anbieter der Zahlungskarte |
gift_package | Boolean | False | Gibt an, ob der Artikel in einem Geschenkpaket sein wird |
value | Object | True | Gesamtsumme der Bestellung. Den erforderlichen Parameter für value finden Sie in dieser Tabelle. |
payment_structure | Object | True | Eine Aufschlüsselung der Zahlung (zum Beispiel Barzahlungen, Rabatte, Liefergebühren). Die für payment_structure erforderlichen Parameter finden Sie in dieser Tabelle. |
items | Object | True | Alles, was in der Bestellung enthalten ist. Die für items erforderlichen Parameter finden Sie in dieser Tabelle. |
Liste der Parameter für das value-Objekt
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
total | Numeric | True | Bestellsumme |
Liste der Parameter für das payment_structure-Objekt
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
cash | Numeric | False | Gibt an, welcher Anteil der Bestellsumme bar bezahlt wurde |
bonuses | Numeric | False | Gibt an, welcher Anteil der Bestellsumme mit Boni bezahlt wurde |
delivery | Numeric | False | Gibt die Lieferkosten der Bestellung an |
discount | Numeric | False | Gibt den rabattierten Wert der Bestellung an |
Stellen Sie sicher, dass
value.total == payment_structure.cash + payment_structure.bonuses + payment_structure.delivery - payment_structure.discountListe der Parameter für das items-Objekt
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
id | String | True | ID des gekauften Produkts |
price | Numeric | True | Preis einer Einzeleinheit des Produkts |
quantity | Integer | True | Gesamtmenge der ausgewählten Produkte |
status | String | True | Artikelstatus; kann nur sein: created, invoiced, shipped, delivered, cancelled, refunded |
original_price | Numeric | False | Originalpreis des Produkts |
discount_product | Numeric | False | Rabattierter Preis des Produkts |
discount_bonuses | Numeric | False | Rabattierte Boni des Produkts |
delivery_company | String | False | Postdienst, der den Artikel geliefert hat |
barcode | String | False | Barcode des Produkts |
line_id | String | False | Eindeutige ID für die Position dieses Produkts (Bestellposition) im Bestellsystem Ihres Geschäfts. |
cancel_reason | String | False | Stornierungsgrund |
Das
items-Objekt ist erforderlich, wenn Sie eine Bestellung erstellen. Sie können es als leeres Array senden, wenn Sie den Status einer Bestellung aktualisieren.Beispiel-JSON-Anfrage
{
"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"
}
]
}
]
}
Eine Bestellung stornieren
Da der Endpoint Import orders sowohl zum Erstellen als auch zum Aktualisieren von Bestellungen verwendet wird, können Sie ihn verwenden, um eine stornierte Bestellung zu registrieren. Um eine stornierte Bestellung zu registrieren, geben Sie Folgendes an:Abfrageparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
shop_id | String | True | Store Key. Sie finden ihn in Recommendations > Settings > Store settings in der Kameleoon App. Kontaktieren Sie Ihren Customer Success Manager, falls erforderlich, um den Schlüssel zu erhalten. |
shop_secret | String | True | Secret Key. Sie finden ihn in Recommendations > Settings > Store settings in der Kameleoon App. Kontaktieren Sie Ihren Customer Success Manager, falls erforderlich, um den Schlüssel zu erhalten. |
orders | Array | True | Liste der Bestellungen. Geben Sie die Bestellungen an, die Sie als storniert registrieren möchten. |
orders-Objektparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
id | String | True | Bestell-ID |
status | String | True | Status der Bestellung (auf cancelled gesetzt) |
Beispiel für eine Stornierungs-JSON-Anfrage
{
"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
Antwort
Orders imported or updated. Verified against a live response on 2026-09-24.
Request outcome.
Verfügbare Optionen:
success War diese Seite hilfreich?
⌘I