For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 に含めます

エンドポイント

Method
Path
用途
テーブル

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 専用で書き込み・副作用はありません。

エラー

エンドポイント固有:

Status
条件
レスポンス例

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?