商品のインポートと更新
curl --request PUT \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
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 => "PUT",
]);
$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("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("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::Put.new(url)
response = http.request(request)
puts response.read_bodyインポート
商品のインポートと更新
50,000 点以上の商品を持つカタログに推奨されるエンドポイントを使用して、Kameleoon の商品カタログをインポートまたは更新します。
PUT
/
endpoint
商品のインポートと更新
curl --request PUT \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
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 => "PUT",
]);
$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("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("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::Put.new(url)
response = http.request(request)
puts response.read_bodyこのエンドポイントは、商品を Kameleoon アカウントにインポートします。50,000 点以上の商品がある場合は、これがカタログをインポートする推奨方法です。
毎日カタログを完全に再インポートするのではなく、商品リストとそのプロパティの更新にもこのエンドポイントを使用することを強くお勧めします。
データは、リクエスト本文に JSON 文字列として送信されます。
失敗したリクエストの例:
複数の場所がある場合に、場所に固有の価格、在庫、その他の情報を提供するために
params オブジェクトを使用すると、アイテムのカスタムパラメーター値を指定できます。商品
fashion オブジェクトを使用すると、ファッションアイテムに関する追加情報を指定できます。商品 items オブジェクトの中に fashion オブジェクトを渡します。
カタログのインポートに完全にこのエンドポイントを利用する場合は、カテゴリインポートエンドポイントを使用して、まずすべてのカテゴリがインポートされていることを確認してください。既知のカテゴリがない商品は、インポートプロセス中に無視されます。
レート制限
- API リクエスト制限(Rate Limit)は 1 分間に 40 リクエストで、最大で 1.5 秒に 1 リクエストです。
- API リクエスト重量制限(Weight Limit)は 1 リクエストあたり最大 35 メガバイトに制限されています。
HTTP リクエスト
PUT https://api.products.kameleoon.com/import/products
クエリパラメーターのリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
shop_id | String | Yes | ストアキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
shop_secret | String | Yes | シークレットキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
items | List | Yes | 商品アイテムのリスト。items に必要なパラメーターはこの表を参照してください。 |
webhook | String | No | Webhook URL。インポート完了時に POST リクエストが送信されます。 |
webhook の目的は、リクエストが完了したことを開発者に通知することです。API 呼び出しで指定されたすべての商品がインポートされ完全に利用可能になると、指定された Webhook に POST リクエストが送信されます。成功したリクエストの例:{
"status": "success"
}
{
"status": "error",
"message": "MESSAGE"
}
items オブジェクトのパラメーターリスト
特定の商品のみを更新したい場合は、リクエストで各商品のすべての必須パラメーター値を指定する必要があります。商品の必須プロパティのいずれかが省略された場合、インポート中にその商品は無視され、データベースには変更が加えられません。たとえば、商品の価格のみを更新したい場合でも、カテゴリ、名前、画像、タグなどのすべての必須パラメーターを含める必要があります。必須でないプロパティについて、省略された値はデータベースからプロパティが削除される結果となります。
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
id | String (最大長 64) | Yes | アイテムに割り当てられた一意の ID |
group_id | String (最大長 64) | Optional | アイテムグループに関連付けられた ID |
name | String (最大長 255) | Yes | アイテムの名前 |
price | Float (正の値である必要があります) | Yes | アイテムの価格。複数の場所で価格を提供するには、代わりに locations オブジェクトを使用してください。 |
oldprice | Float (正の値である必要があります) | Optional | アイテムの以前の価格 |
currency | String | Yes | price フィールドで指定された通貨 |
url | String | Yes | アイテムに関連付ける URL |
picture | String | Yes | アイテムの画像を含む URL |
available | Boolean | Yes | アイテムが購入可能かどうかを示します。後で更新するには、商品更新エンドポイントを使用してください |
categories | Array of strings | Yes | 各文字列は、この商品が属するカテゴリ ID を表します。 |
locations | Array | Optional | 異なる場所でのアイテムの価格の配列。locations に必要なパラメーターはこの表を参照してください。 |
accessories | Array of strings | Optional | アイテムに関連するアクセサリの商品 ID を含みます |
seasonality | Array of integers | Optional | このアイテムを宣伝したい年の月(1 月=1、12 月=12)を表します |
brand | String | Optional | アイテムのブランド名 |
barcode | Integer | Optional | アイテムのバーコード値 |
price_margin | Integer | Optional | アイテムの価格マージン |
tags | Array of strings | Optional | アイテムに関連付けたいキーワードのリスト |
is_child | Boolean | Optional | このアイテムが別のアイテムの子であるかどうかを示します |
is_fashion | Boolean | Optional | このアイテムがファッションアイテムかどうかを示します |
is_new | Boolean | Optional | このアイテムが新しいアイテムかどうかを示します |
fashion | Object | Optional | ファッションアイテム用のいくつかの追加パラメーターを定義します。fashion に必要なパラメーターはこの表を参照してください。 |
stock_quantity | Integer | Optional | 在庫数量 |
type_prefix | String | Optional | アイテムタイプを区別するためのプレフィックス |
model | String | Optional | アイテムのモデル名 |
params | Object | Optional | カスタムパラメーターを追加します。params に必要なパラメーターはこの表を参照してください。 |
merchant | String | Optional | アイテムに関連付けたいマーチャント |
rating | Integer | Optional | 1 から 5 の間の値。アイテムに割り当てたいユーザー評価 |
leftovers | String | Optional | 残在庫の説明。たとえば、“one” は単一ユニットとして利用可能な商品を表し、“few” は限定数量(最大 10 ユニット)で入手可能な商品を表し、“lot” は 10 ユニット以上の数量で入手可能な商品を表します |
creation_date | String | Optional | 形式 yyyy-mm-dd で指定する必要があります。これはアイテムが作成された日付です |
locations オブジェクトのパラメーターリスト
複数の場所がある場合に、場所に固有の価格、在庫、その他の情報を提供するために locations オブジェクトを使用します。商品アイテムオブジェクト内に locations オブジェクトを渡します。
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
location | String | Yes | 価格を指定する場所。locations フィールドが提供される場合、このフィールドは必須です。 |
price | Float (正の値である必要があります) | Optional | この場所での価格。 |
oldprice | Float (正の値である必要があります) | Optional | アイテムの以前の価格(たとえば、セール品の通常価格)。 |
stock_quantity | Int (正の値である必要があります) | Optional | 在庫の数量。 |
sizes | Array of Strings | Optional | アイテムのサイズオプションのリスト。 |
weight | Int (正の値である必要があります) | Optional | アイテムの重量。 |
delivery_types | Object | Optional | アイテムの利用可能性を示します。delivery_types に必要なパラメーターはこの表を参照してください。 |
delivery_types オブジェクトのパラメーターリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
store | Int (正の値である必要があります) | Yes | 店頭で利用可能な数量 |
delivery | Int (正の値である必要があります) | Yes | 配送で利用可能な数量 |
delivery | Int (正の値である必要があります) | Yes | 倉庫で利用可能な数量 |
Params オブジェクトのパラメーターリスト
params オブジェクトを使用すると、アイテムのカスタムパラメーター値を指定できます。商品 items オブジェクトの中に params オブジェクトを渡します。
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
name | String | Yes | パラメーターの名前 |
value | Array of Strings | Yes | パラメーターの値の配列 |
unit | String | Optional | 値の測定単位。 |
Fashion オブジェクトのパラメーターリスト
fashion オブジェクトを使用すると、ファッションアイテムに関する追加情報を指定できます。商品 items オブジェクトの中に fashion オブジェクトを渡します。
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
gender | String | Optional | アイテムに関連付ける性別。たとえば、“m”、“f”、または “female”。 |
sizes | Array of Strings | Optional | アイテムのサイズリスト。 |
type | String | Yes | ファッションアイテムのタイプ。たとえば、“jacket”。 |
JSON リクエスト例
{
"id": "myID", // String (max 64). Required
"group_id": "myGroup", // String (max 64). Optional
"name": "myItem", // String (max 255). Required
"price": "1", // Float (positive). Required
"oldprice": "2", // Float (positive). Optional
"currency": "USD", // Currency code: USD, EUR. Required.
"url": "https://example.com/product", // String (URL). Required
"picture": "https://example.com/product/image.png", // String (URL). Required
"available": true, // Boolean (true, false). Required
"categories": ["ID1", "ID2", ...], // Array of categories IDs. Required.
"locations": [
{
"location": "USA",
"delivery_types": {
"store": 10,
"stock": 50 }
},
{
"location": "CAN",
"price": 60
}
], // Array of prices in locations. See below. Optional
"accessories": ["ID", "ID", ...], // Array of product IDs. Optional
"seasonality": [1, 2, ...], // Array of integers (months: 1-12). Optional
"brand": "...", // String. Optional
"barcode": "...", // String. Optional
"price_margin": "...",// Integer. Optional
"tags": ["TAG1", "TAG2", ...], // Array of strings. Optional
"is_child": false, // Boolean (true, false). Optional
"is_fashion": true, // Boolean (true, false). Optional
"is_new": false, // Boolean (true, false). Optional
"fashion": {
"gender": "m",
"sizes": ["48", "50", "52"],
"type": "jacket"
}, // Object. See below. Optional
"stock_quantity": 60, // Int (positive). Optional
"type_prefix": "...", // String. Optional
"model": "Widget 3000", // String. Optional
"params": [
{
"name": "Param 1",
"value": ["bluetooth", "wi-fi"]
},
{
"name": "Param 2",
"value": [23]
}
], // Array of params data. See below. Optional
"merchant": "...", // String. Optional
"rating": 4, // Integer (1-5). Optional
"leftovers": "one", // String (one, few, lot). Optional
"creation_date": "...", // String. Optional. Format yyyy-mm-dd,
}
このページは役に立ちましたか?
⌘I