商品の更新#
一つの商品を同期的に更新します。shopId とともに、productId または sku で商品を指定します。識別子は必ずどちらか一方だけを指定してください。両方を含む場合も、どちらも含まない場合も、400 Bad Request が返されます。
PATCH https://sdkapi.ideal.house/product-import/products
識別子は product オブジェクトとは別に指定します。これにより、連携側は現在の SKU で商品を特定し、同じリクエスト内で SKU を変更できます。
SKU を変更する場合は、識別子に productId を使用してください。最初のリクエストで SKU を更新した後にレスポンスが失われても、再試行の対象を明確に保てます。
リクエスト本文#
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
shopId | string | はい | Ideal House が提供する Shop ID。 |
productId | string | 条件付き | 特定する商品の ID。sku を省略する場合は必須です。 |
sku | string | 条件付き | 特定する商品の現在の SKU。productId を省略する場合は必須です。 |
product | object | はい | 更新するフィールド。少なくとも一つ含めてください。 |
編集可能な商品フィールド#
product に含まれるフィールドだけを更新します。
| フィールド | 型 | 最大長 | 説明 |
|---|---|---|---|
sku | string | 120 | 新しい SKU。ショップ内で一意である必要があります。 |
externalProductId | string | 120 | 外部の商品識別子。 |
groupId | string | 120 | 商品グループの識別子。 |
collectionId | string | 120 | 商品コレクションの識別子。 |
name | string | 255 | 商品名。 |
title | string | 255 | 商品の表示タイトル。 |
brand | string | 120 | 商品のブランド。 |
productType | string | 120 | 自身の分類体系における商品タイプ。 |
normalizedProductType | string | 40 | 正規化された商品タイプ。対応する値は Ideal House と調整してください。 |
category | string | 120 | 商品のカテゴリ。 |
style | string | 120 | 商品のスタイル。 |
color | string | 120 | 商品の色。 |
availability | string | 40 | 商品の販売可否を表す値。 |
imageUrl | string | 1,000 | 公開アクセス可能な HTTP または HTTPS の元画像の URL。 |
previewImageUrl | string | 1,000 | HTTP または HTTPS のプレビュー画像の URL。 |
productUrl | string | 1,000 | HTTP または HTTPS の商品詳細の URL。 |
attributes | object | — | 商品の属性。指定すると、現在の属性オブジェクトをこのオブジェクトで置き換えます。 |
status | string | — | 商品のステータス。更新エンドポイントは active または inactive を受け付けます。 |
id、shopId、productCode、createdAt、updatedAt は読み取り専用です。商品を invalid に設定するには、削除エンドポイントを使用してください。
SKU による更新#
{
"shopId": "shop_123",
"sku": "SKU-10001",
"product": {
"name": "Large Gold Wall Mirror",
"color": "Antique Gold",
"status": "active"
}
}
curl --request PATCH \
'https://sdkapi.ideal.house/product-import/products' \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <YOUR_CLIENT_ID>' \
--header 'X-Client-Secret: <YOUR_CLIENT_SECRET>' \
--data-raw '{
"shopId": "shop_123",
"sku": "SKU-10001",
"product": {
"name": "Large Gold Wall Mirror",
"color": "Antique Gold",
"status": "active"
}
}'
商品 ID による更新と SKU の変更#
{
"shopId": "shop_123",
"productId": "product_123",
"product": {
"sku": "SKU-10001-NEW",
"name": "Large Gold Wall Mirror",
"status": "inactive"
}
}
更新に成功すると、200 OK と更新後の商品オブジェクト全体が返されます。inactive の商品も保持され、商品一覧エンドポイントから引き続き取得できます。