PATCH /v1/items/{id}
scope
write_items
リクエストパラメーター
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | パス | integer | 必須 | item_id |
Idempotency-Key | ヘッダー | string | 必須 | 冪等キー(必須・ADR-010)。UUID v4 推奨。同一キー再送は保存レスポンスを再生 |
kind | ボディ | object | 任意 | |
sku | ボディ | object | 任意 | |
inventory | ボディ | object | 任意 | |
name | ボディ | string | 任意 | |
category_id | ボディ | string | 任意 | |
description | ボディ | string | 任意 | |
detail_url | ボディ | string | 任意 | |
price | ボディ | object | 任意 | |
tax_rate | ボディ | object | 任意 | |
discount_rate | ボディ | integer | 任意 | |
discount_title | ボディ | string | 任意 | |
status | ボディ | enum(active | inactive) | 任意 |
main_image_orientation | ボディ | enum(landscape | square) | 任意 |
sell_from | ボディ | string | 任意 | |
sell_by | ボディ | string | 任意 | |
selling_limits | ボディ | integer | 任意 | |
shipping_date_estimate | ボディ | string | 任意 | |
is_shipping | ボディ | boolean | 任意 | |
shipping_cost | ボディ | object | 任意 | |
share_button_enabled | ボディ | boolean | 任意 | |
delivery_datetime_possibility | ボディ | enum(nullable | required | not_available) |
restock_notification | ボディ | boolean | 任意 | |
number_of_sets | ボディ | integer | 任意 | |
cancellation | ボディ | object | 任意 | |
ticket | ボディ | object | 任意 | |
bundle | ボディ | object | 任意 |
レスポンスの例
{
"data": {
"id": "1",
"sku": "string",
"name": "string",
"status": "active",
"kind": "normal",
"price": {
"amount": 3200,
"currency": "JPY"
},
"inventory": 0,
"category_id": "string",
"main_image": "string",
"created_at": "string",
"updated_at": "string",
"description": "string",
"shipping_cost": {
"amount": 3200,
"currency": "JPY"
},
"detail_url": "string",
"main_image_orientation": "landscape",
"restock_notification": true,
"cancellation": {
"enabled": true,
"cancel_by": "string"
},
"ticket": {
"event_group": "string",
"venue_name": "string",
"venue_address": "string",
"doors_open_at": "string",
"entry_start_at": "string",
"valid_from": "string",
"valid_by": "string",
"term_and_condition": "string",
"allow_continuous_use": true,
"default_seat_label": "string",
"background_color": "string",
"lottery": {
"date": "string",
"capacity": 0
}
},
"bundle": {
"components": [
{
"item_id": "string",
"quantity": 0,
"selection_type": "fixed"
}
]
},
"tax_rate": 10,
"discount_rate": 0,
"delivery_datetime_possibility": "nullable",
"sell_from": "string",
"sell_by": "string",
"shipping_date_estimate": "ご注文から3〜5営業日で発送",
"selling_limits": 10,
"discount_title": "夏の大感謝祭",
"is_shipping": true,
"share_button_enabled": true,
"number_of_sets": 1,
"category_name": "スキンケア",
"images": [
{
"id": "1",
"url": "https://cdn.example/img/abc.jpg",
"sort": 0
}
],
"variation_axes": [
{
"id": "string",
"name": "色",
"values": [
{
"id": "string",
"name": "M"
}
]
}
],
"variants": [
{
"id": "1",
"sku": "string",
"name": "白 / M",
"price": {
"amount": 3200,
"currency": "JPY"
},
"inventory": 0,
"discount_rate": 0,
"status": "active",
"axis_values": [
{
"axis": "string",
"value": "string"
}
]
}
],
"options": [
{
"id": "string",
"type": "choice",
"label": "ラッピング",
"description": "string",
"required": true,
"price": {
"amount": 3200,
"currency": "JPY"
},
"choices": [
{
"id": "string",
"text": "化粧箱",
"price": {
"amount": 3200,
"currency": "JPY"
}
}
]
}
]
}
}
解説
商品を編集します(部分更新)。送った項目だけが変わり、送らない項目は変わりません。値を消したい場合は明示的に null を送ります(例: discount_rate: null で割引解除)。kind と sku は変更できず 409、inventory は本 API では受け付けず 400(在庫更新 API へ)。未知の項目は黙って無視せず 400 を返します。画像が無い商品を active にしようとすると 422。変更差分はマーチャントの修正ログ(管理画面と同一書式)に記録され、対象商品を含むカートは既存管理画面と同様に破棄されます(価格変更後の旧価格購入の防止)。成功時は更新後の商品全項目を返すので再取得は不要です。Idempotency-Key 必須。
エラーレスポンスの例
{
"error": {
"code": "insufficient_scope",
"message": "requires scope 'read_orders'",
"request_id": "req_01H..."
}
}
返しうるエラー: 400 / 401 / 403 / 404 / 409 / 422 / 503