商品API

カタログ内の商品を作成、取得、更新、削除します。

エンドポイント
GET

/products

products:read

ページネーション付きの商品リストを取得します。ステータス、カテゴリ、検索によるフィルタリングをサポートしています。

GET

/products/:id

products:read

IDで単一の商品を取得します。

POST

/products

products:write

カタログに新しい商品を作成します。

PUT

/products/:id

products:write

既存の商品を更新します。部分更新がサポートされています。

DELETE

/products/:id

products:write

商品をソフト削除します。30日以内に復元できます。

フィールドリファレンス
フィールド必須説明

id

string

いいえ

一意の商品識別子(読み取り専用)

sku

string

はい

在庫管理単位

name

string

はい

商品名

description

string

いいえ

商品説明(HTML使用可)

barcode

string

いいえ

製品のメインバーコード(UPC/EAN)

brand

string

いいえ

商品ブランド名

categoryId

string

いいえ

カテゴリ識別子

unitPrice

integer

はい

セント単位の価格(例:1999 = $19.99)

normalPrice

integer

いいえ

通常価格/定価(セント単位、割引表示用)

purchasePrice

integer

いいえ

仕入れ価格/原価(セント単位)

weight

string

いいえ

重量(グラム)

isActive

boolean

いいえ

製品がアクティブ/公開されているか(デフォルト: true)

stockTotal

integer

いいえ

全倉庫の合計利用可能在庫(読み取り専用)

images

string[]

いいえ

商品画像URL

createdAt

datetime

いいえ

ISO 8601タイムスタンプ(読み取り専用)

updatedAt

datetime

いいえ

ISO 8601タイムスタンプ(読み取り専用)

クエリパラメータ(リスト)
フィールド必須説明

page

integer

いいえ

ページ番号(デフォルト:1)

limit

integer

いいえ

1ページあたりのアイテム数(デフォルト:20、最大:100)

使用例
ページネーション付きで商品を一覧表示
bash
curl "https://api.mercozy.com/api/v1/external/products?page=1&limit=10" \
  -H "X-API-Key: mk_live_your_key_here"
商品を作成
bash
curl -X POST "https://api.mercozy.com/api/v1/external/products" \
  -H "X-API-Key: mk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "sku": "WDG-001",
    "name": "Premium Widget",
    "unitPrice": 2999,
    "normalPrice": 3999,
    "brand": "Acme Corp",
    "isActive": true
  }'