在庫
在庫検索
概要
基本情報
- リクエストパス:
GET /items
- JWTスコープ:
item:index
- 必須個別JWTパラメータ:
なし
- レートリミット:
5 rps
query
key |
説明 |
制約など |
ids |
在庫ID |
整数のみ、カンマ区切りで複数指定可能 |
codes |
在庫コード |
カンマ区切りで複数指定可能 |
alias_codes |
代替在庫コード |
カンマ区切りで複数指定可能 |
created_at_from |
作成日から |
2024-04-12 12:08:38 形式 |
created_at_to |
作成日まで |
同上 |
updated_at_from |
更新日から |
同上 |
updated_at_to |
更新日まで |
同上 |
page |
ページ |
整数のみ、デフォルト:1 |
limit |
1ページあたりの件数 |
整数のみ、デフォルト:50、最大: 250 |
cursor |
ページカーソル |
- |
例
GET /items?codes=ITBC0PV0VJPA
[
{
"id": 23,
"code": "ITBC0PV0VJPA",
"alias_code": null,
"store": {
"id": 1,
"name": "main"
},
"price": 33,
"grade": {
"id": 2,
"name": "中古A"
},
"condition_note": null,
"condition_tags": [
{
"id": 1,
"name": "喫煙あり"
}
],
"note": null,
"stocks": [
{
"location": {
"id": 1,
"type": "DEFAULT",
"name": "デフォルト"
},
"status": "PENDING",
"quantity": 1,
"cost_price": 20
}
],
"attribute": {
"size": "S"
},
"image_urls": [
"https://..."
],
"racks":[
{
"numbers":[
"棚1",
"棚2"
],
"location": {
"id": 1,
"type": "DEFAULT",
"name": "デフォルト"
}
}
],
"product_id": 7,
"created_at": 1673411650,
"updated_at": 1673411650
}
]
key |
type |
説明 |
* |
array<object> |
在庫 |
*.id |
int |
在庫ID |
*.code |
string |
在庫コード |
*.alias_code |
string | null |
代替在庫コード |
*.store |
object |
所属店舗 |
*.store.id |
int |
所属店舗ID |
*.store.name |
string |
所属店舗名 |
*.price |
int |
価格 |
*.grade |
object |
グレード |
*.grade.id |
int |
グレードID |
*.grade.name |
string |
グレード名 |
*.condition_note |
string | null |
コンディション詳細 |
*.condition_tags |
array<object> |
コンディションタグ |
*.condition_tags.*.id |
int |
コンディションタグID |
*.condition_tags.*.name |
string |
コンディションタグ名 |
*.note |
string | null |
商品メモ |
*.stocks |
array<object> |
在庫、location-statusでユニーク |
*.stocks.*.location |
object |
在庫ロケーション |
*.stocks.*.location.id |
int |
在庫ロケーションID |
*.stocks.*.location.type |
string |
在庫ロケーションタイプ |
*.stocks.*.location.name |
string |
在庫ロケーション名 |
*.stocks.*.status |
string |
在庫ステータス |
*.stocks.*.quantity |
int |
在庫数 |
*.stocks.*.cost_price |
int |
在庫原価 |
*.attribute |
object | null |
在庫属性 |
*.image_urls |
array<string> |
在庫画像URL |
*.racks |
array<object> |
棚情報 |
*.racks.*.location |
object |
ロケーション |
*.racks.*.numbers |
array<string> |
番号 |
*.product_id |
int |
商品ID |
*.created_at |
int | null |
作成日時 |
*.updated_at |
int | null |
更新日時 |
在庫取得
概要
基本情報
- リクエストパス:
GET /items/{item_id}
- JWTスコープ:
item:show
- 必須個別JWTパラメータ:
なし
- レートリミット:
5 rps
例
GET /items/23
在庫検索のresponse[0]と同様
在庫作成
概要
基本情報
- リクエストパス:
POST /items
- JWTスコープ:
item:store
- 必須個別JWTパラメータ:
store_id (またはX-Store-Idヘッダ)
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
product_id |
int |
商品ID |
- |
price |
int |
価格 |
- |
alias_code |
?string | null |
代替在庫コード |
50文字まで |
grade_id |
?int |
グレードID |
- |
condition_note |
?string | null |
コンディション詳細 |
- |
condition_tag_ids |
?array<int> |
コンディションタグID |
- |
note |
?string | null |
商品メモ |
- |
attribute |
?object |
在庫属性 |
- |
image_urls |
?array<string> |
商品画像URL |
(*1) |
racks |
?array<object> |
棚情報 |
- |
racks.*.location_id |
int |
ロケーションID |
- |
racks.*.numbers |
array<string> | null |
番号 |
- |
例
POST /items
{
"product_id": 2,
"price": 100,
"alias_code": null,
"condition_tag_ids": [1, 2, 3],
"image_urls": ["https://***", "https://***"],
"racks": [
{
"location_id": 1,
"numbers": ["棚1", "棚2"]
}
]
}
在庫取得と同様
在庫更新
概要
基本情報
- リクエストパス:
PUT /items/{item_id}
- JWTスコープ:
item:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
alias_code |
?string | null |
代替在庫コード |
50文字まで |
grade_id |
?int |
グレードID |
- |
condition_note |
?string | null |
コンディション詳細 |
- |
condition_tag_ids |
?array<int> |
コンディションタグID |
- |
note |
?string | null |
商品メモ |
- |
attribute |
?object |
在庫属性 |
(*1) |
image_urls |
?array<string> |
商品画像URL |
(*2) (*3) |
racks |
?array<object> |
棚情報 |
- |
racks.*.location_id |
int |
ロケーションID |
- |
racks.*.numbers |
array<string> | null |
番号 |
- |
- *1) 既存の項目とマージされる、キーを削除したい場合はnullを指定
- *2) ファイルアップロード(公開ファイル)で取得したファイルURLを使用
- *3) 既存の項目とマージされず完全上書きとなる、追記したい場合は予め取得API等で既存の値を取得しておく
例
PUT /items/23
{
"alias_code": null,
"condition_tag_ids": [1, 2, 3],
"image_urls": ["https://***", "https://***"]
}
在庫取得と同様
在庫一括作成
概要
基本情報
- リクエストパス:
POST /items/bulk
- JWTスコープ:
item:bulk:store
- 必須個別JWTパラメータ:
store_id (またはX-Store-Idヘッダ)
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
* |
array<object> |
- |
1件以上 1000件まで |
*.* |
- |
(以下在庫作成と同様) |
- |
例
POST /items/bulk
[
{
"product_id": 2,
"price": 100,
"alias_code": null,
"condition_tag_ids": [1, 2, 3]
}
]
在庫検索と同様
在庫一括更新
概要
基本情報
- リクエストパス:
PUT /items/bulk
- JWTスコープ:
item:bulk:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
* |
array<object> |
- |
1件以上 1000件まで |
*.id |
int |
在庫ID |
- |
*.* |
- |
(以下在庫更新と同様) |
- |
例
PUT /items/bulk
[
{
"id": 234,
"alias_code": null,
"condition_tag_ids": [1, 2, 3]
}
]
在庫検索と同様
在庫入庫
概要
基本情報
- リクエストパス:
PUT /items/inbounds
- JWTスコープ:
item:inbound:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
location_id |
int |
ロケーションID |
- |
status |
string |
入庫ステータス |
PENDING ACTIVE |
items |
array<object> |
入庫在庫 |
1件以上 1000件まで |
items.*.id |
int |
在庫ID |
- |
items.*.quantity |
int |
入庫数量 |
1以上 |
items.*.cost_price |
int |
税抜原価小計 |
- |
note |
?string | null |
内部メモ |
- |
例
PUT /items/inbounds
{
"location_id": 1,
"status": "ACTIVE",
"items": [
{
"id": 12,
"quantity": 3,
"cost_price": 100
}
]
}
在庫検索と一部同様、差分を下記に示す
key |
type |
説明 |
制約など |
*.attribute |
- |
(削除) |
- |
*.image_urls |
- |
(削除) |
- |
*.image_url |
string | null |
1枚目画像URL |
- |
在庫廃棄
概要
基本情報
- リクエストパス:
PUT /items/disposals
- JWTスコープ:
item:disposal:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
location_id |
int |
ロケーションID |
- |
status |
string |
廃棄ステータス |
PENDING ACTIVE |
items |
array<object> |
廃棄在庫 |
1件以上 1000件まで |
items.*.id |
int |
在庫ID |
- |
items.*.quantity |
int |
廃棄数量 |
1以上 |
note |
?string | null |
内部メモ |
- |
例
PUT /items/inbounds
{
"location_id": 1,
"status": "ACTIVE",
"items": [
{
"id": 12,
"quantity": 3
}
]
}
在庫入庫と同様
在庫ロケーション変更
概要
基本情報
- リクエストパス:
PUT /items/change_locations
- JWTスコープ:
item:change_location:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
location_id |
int |
移動元ロケーションID |
- |
dist_location_id |
int |
移動先ロケーションID |
- |
status |
string |
移動ステータス |
PENDING ACTIVE |
items |
array<object> |
移動在庫 |
1件以上 1000件まで |
items.*.id |
int |
在庫ID |
- |
items.*.quantity |
int |
移動数量 |
1以上 |
note |
?string | null |
内部メモ |
- |
例
PUT /items/change_locations
{
"location_id": 1,
"dist_location_id": 2,
"status": "ACTIVE",
"items": [
{
"id": 12,
"quantity": 3
}
]
}
在庫入庫と同様
在庫価格変更
概要
基本情報
- リクエストパス:
PUT /items/change_prices
- JWTスコープ:
item:change_price:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
items |
array<object> |
移動在庫 |
1件以上 1000件まで |
items.*.id |
int |
在庫ID |
- |
items.*.price |
int |
変更後価格 |
0以上 |
note |
?string | null |
内部メモ |
- |
例
PUT /items/change_prices
{
"items": [
{
"id": 12,
"price": 200
}
]
}
在庫入庫と同様
在庫品出し
概要
基本情報
- リクエストパス:
PUT /items/activations
- JWTスコープ:
item:activation:update
- 必須個別JWTパラメータ:
なし
- レートリミット:
2 rps
body
key |
type |
説明 |
制約など |
location_id |
int |
ロケーションID |
- |
items |
array<object> |
品出し在庫 |
1件以上 1000件まで |
items.*.id |
int |
在庫ID |
- |
items.*.quantity |
int |
数量 |
1以上 |
note |
?string | null |
内部メモ |
- |
例
PUT /items/activations
{
"location_id": 1,
"items": [
{
"id": 12,
"quantity": 3
}
]
}
在庫入庫と同様
在庫属性検索
概要
基本情報
- リクエストパス:
GET /items/attributes
- JWTスコープ:
item:attribute:index
- 必須個別JWTパラメータ:
なし
- レートリミット:
5 rps
query
key |
説明 |
制約など |
ids |
在庫ID |
整数のみ、カンマ区切りで複数指定可能 |
category_id |
カテゴリID |
- |
page |
ページ |
整数のみ、デフォルト:1 |
limit |
1ページあたりの件数 |
整数のみ、デフォルト:50、最大: 250 |
例
GET /items/attributes?ids=1,2
[
{
"id": 1,
"key": "custom_huga",
"label": "フガ",
"type": "TEXT",
"sort": 0,
"is_required": true
}
]
key |
type |
説明 |
* |
array<object> |
在庫属性 |
*.key |
string |
在庫属性キー |
*.label |
string |
在庫属性名 |
*.type |
string |
属性タイプ |
*.sort |
int |
表示順 |
*.is_required |
boolean |
必須項目かどうか |