注文のインポート
curl --request POST \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/endpoint', 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.example.com/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/endpoint"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/endpoint")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyインポート
注文のインポート
商品レコメンデーションや分析の基盤となるトランザクション注文とその明細を Kameleoon にインポートまたは更新します。
POST
/
endpoint
注文のインポート
curl --request POST \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/endpoint', 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.example.com/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/endpoint"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/endpoint")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyこのエンドポイントを使用すると、トランザクション注文のリストを Kameleoon アカウントにインポートできます。データベースにすでに存在する注文とそのプロパティを更新するためにもこのエンドポイントを使用できます。データは JSON 文字列としてリクエスト本文に含めて送信する必要があります。
HTTP リクエスト
POST https://api.products.kameleoon.com/sync/orders
クエリパラメーターのリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
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 matching オプションを必ず有効にして、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_id": "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"
},
...
]
}
このページは役に立ちましたか?
⌘I