Operator Locations — 拠点一覧
ピッキングアプリ(picking-ios)の店舗(location)選択 UI 用に、shop のアクティブな拠点(店舗 / POPUP / MFC / 倉庫)一覧を返す read 専用 API です。返る id は Operator Queues(GET /api/operator/shipments)の fromLocationId フィルタにそのまま渡せます。書き込みは行いません。
Base URL
https://api.lmile.io· 認証 operator JWT(Authorization: Bearer)(詳細) ·shopは query に含めます
エンドポイント
GET
/api/operator/locations
アクティブな拠点一覧(type で絞り込み)
locations
レスポンスは camelCase(operator 系と同じ)。
shopは query で受け取り、スタッフに束縛された shop に含まれることを確認します(含まれなければ403 shop_not_authorized)。/api/operator/*の認証系統は 認証 を参照してください。
GET /api/operator/locations
shop のアクティブな拠点を label(表示名)昇順で一覧します。type で拠点種別(location_type)を CSV 絞り込みできます(例: 店舗スタッフの選択肢は type=store,popup、倉庫スタッフは type=mfc,warehouse)。memberOnly=true を付けると、出荷が実際に流れる拠点(出荷元メンバー)だけに絞り込めます。
リクエスト
GET https://api.lmile.io/api/operator/locations?shop=demo-store.myshopify.com&type=store,popup&memberOnly=true
Authorization: Bearer {OPERATOR_JWT}shop
string
✓
店舗ドメイン(スタッフの束縛 shop 内)
type
string
指定時のみ拠点種別(location_type)でフィルタ(CSV で複数指定可・最大 200 文字)
memberOnly
boolean
true(または 1)で出荷元メンバー(lm_fulfillment_source_members の active な在庫ロケーション)に一致する拠点のみ返す。type 絞り込みとは AND。member が 0 件なら空配列(fallback なし)
limit
number
一覧の件数。正整数・既定 200・最大 500(超過分は 500 に丸め)
type に指定する値の代表例: store / popup / mfc / warehouse / online / display_only(固定 enum ではないため許可値の検証はせず、該当なしは 200 + count: 0 で返ります)
レスポンス
count / locations[]
一覧の件数(limit まで)/ 配列(label 昇順)
id
拠点 ID(uuid)。Operator Queues の fromLocationId に渡せます
label
拠点の表示名
locationType
拠点種別(未設定は null)
region
地域(未設定は null)
挙動
is_active = trueの拠点だけをlabel(表示名)昇順でlimit件返します。typeは CSV を lower(trim) 正規化して比較します。空要素は無視し、未指定は全種別を返します。memberOnly=true(またはmemberOnly=1)はsot.lm_fulfillment_source_membersのis_active=trueなinventory_location_idに一致する拠点だけに絞り込みます(typeフィルタとは AND)。fallback なし: member が 0 件なら200+count: 0の空配列を返します(全拠点には逃げません)。出荷元(MFC / 倉庫)自体も member 行(自己 member 登録を含む)が無ければ一覧に出ません。read 専用で書き込み・副作用はありません。
エラー
エンドポイント固有:
400
type が 200 文字超
{ "ok": false, "error": "type too long" }
400
limit が正整数でない
{ "ok": false, "error": "limit must be a positive integer" }
共通エラー(401 / 400 / 403 / 405 / 500 / 503)は Error Codes を参照。
データモデル
sot.locations— 拠点マスター(display_label/location_type/region/is_active)。本 API は active な拠点の読み取りのみを行います。sot.lm_fulfillment_source_members— 出荷元 → 在庫ロケーションの紐付け。memberOnly=trueのときis_active=trueなinventory_location_idでlocationsを絞り込みます。
Last updated
Was this helpful?