インポート
注文のインポート
商品レコメンデーションや分析の基盤となるトランザクション注文とその明細を Kameleoon にインポートまたは更新します。
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"
}このエンドポイントを使用すると、トランザクション注文のリストを Kameleoon アカウントにインポートできます。データベースにすでに存在する注文とそのプロパティを更新するためにもこのエンドポイントを使用できます。データは JSON 文字列としてリクエスト本文に含めて送信する必要があります。
クエリパラメーターのリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
shop_id | String | True | ストアキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
shop_secret | String | True | シークレットキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
orders | Array | True | 注文のリスト。orders に必要なパラメーターはこの表を参照してください。 |
orders オブジェクトのパラメーターリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
id | String | True | 注文 ID |
external_id | String | True | システムまたは CRM 内でユーザーに関連付けられた一意の識別子。(Kameleoon の VisitorCode との正確なマッチングを確保するには、ID を最初に Kameleoon カスタムデータとして保存する必要があります。このカスタムデータを設定する際は、Use this custom data as a unique identifier for cross-device history reconciliation オプションを必ず有効にして、ID が両システム間でユーザーアクティビティをリンクするために使用されるようにしてください。) |
status | String | True | 注文ステータス(例: Processing、Out for delivery、Delivered) |
channel | String | True | 注文に使用された媒体(例: Website、App、In-store) |
date | Integer | True | 注文が発注または更新された Unix タイムスタンプ(秒) |
offline | Boolean | False | 注文をオフラインとしてフラグします。デフォルトは false です |
location_id | String | True | ユーザーの所在地(都市)ID |
promocode | String | False | 注文で使用されたプロモコード |
delivery_type | String | False | 配送タイプ(例: Courier、Pickup in-store) |
delivery_address | String | False | CRM の配送先住所 |
delivery_date | Date | False | 配送予定日。形式: “YYYY-MM-DD” |
delivery_time | Time | False | 配送予定時間。形式: “HH:MM” |
payment_type | String | False | 支払い方法(例: Cash、Card、Wire) |
tax_free | Boolean | False | アイテムが免税かどうかを示します |
bank_issuer | String | False | 銀行発行者 |
bank_pos_processor | String | False | 支払い時に使用された POS システム/端末を示します |
bank_loyalty_program | String | False | 銀行ロイヤリティプログラム |
bank_total_installment | Integer | False | 銀行を通じて支払う必要のある合計分割回数 |
payment_card_provider | String | False | 決済カードのプロバイダー |
gift_package | Boolean | False | アイテムがギフトパッケージで提供されるかどうかを示します |
value | Object | True | 注文の総額。value に必要なパラメーターはこの表を参照してください。 |
payment_structure | Object | True | 支払いの内訳(例: 現金支払い、割引、配送料)。payment_structure に必要なパラメーターはこの表を参照してください。 |
items | Object | True | 注文に含まれるすべてのもの。items に必要なパラメーターはこの表を参照してください。 |
value オブジェクトのパラメーターリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
total | Numeric | True | 注文の合計 |
payment_structure オブジェクトのパラメーターリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
cash | Numeric | False | 注文合計のうち、現金で支払われた割合を示します |
bonuses | Numeric | False | 注文合計のうち、ボーナスで支払われた割合を示します |
delivery | Numeric | False | 注文の配送コストを示します |
discount | Numeric | False | 注文の値引き額を示します |
value.total == payment_structure.cash + payment_structure.bonuses + payment_structure.delivery - payment_structure.discount となるようにしてください。items オブジェクトのパラメーターリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
id | String | True | 購入された商品の ID |
price | Numeric | True | 商品 1 個あたりの価格 |
quantity | Integer | True | 選択された商品の合計数量 |
status | String | True | アイテムのステータス。次のいずれかのみ可: created、invoiced、shipped、delivered、cancelled、refunded |
original_price | Numeric | False | 商品の元の価格 |
discount_product | Numeric | False | 商品の値引き価格 |
discount_bonuses | Numeric | False | 商品の値引きボーナス |
delivery_company | String | False | アイテムを配送した郵便サービス |
barcode | String | False | 商品のバーコード |
line_id | String | False | ストアの注文システムにおけるこの商品の位置(ライン項目)の一意の ID。 |
cancel_reason | String | False | キャンセル理由 |
items オブジェクトは注文を作成する際に必須です。注文のステータスを更新する際には、空の配列として送信できます。JSON リクエスト例
{
"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"
}
]
}
]
}
注文のキャンセル
注文のインポートエンドポイントは注文の作成と更新の両方に使用されるため、キャンセルされた注文を登録するためにも使用できます。 キャンセルされた注文を登録するには、次を指定します。クエリパラメーター
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
shop_id | String | True | ストアキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
shop_secret | String | True | シークレットキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
orders | Array | True | 注文のリスト。キャンセル済みとして登録したい注文を指定します。 |
orders オブジェクトのパラメーター
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
id | String | True | 注文 ID |
status | String | True | 注文のステータス(cancelled に設定) |
キャンセル用 JSON リクエスト例
{
"shop_id": "DvLWN2ZTMZ",
"shop_secret": "EIxTuot8sj",
"orders": [
{
"id": "yKsvZbWpCL",
"status": "cancelled"
}
]
}
ボディ
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
レスポンス
Orders imported or updated. Verified against a live response on 2026-09-24.
Request outcome.
利用可能なオプション:
success このページは役に立ちましたか?
⌘I
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"
}