---
title: "Get Message Status"
method: POST
path: "/api/orders/message-status"
tags: ["Orders"]
---

# Get Message Status

`POST /api/orders/message-status`

## Request

- Base URL: `https://api.soeru.biz` (the document declares no server; this is the origin it was published from)
- URL: `https://api.soeru.biz/api/orders/message-status`
- Auth: none declared

選択注文のメッセージ状況を軽量に返す (ライブ取得なし, 2026-06-23 B)。

AI が MCP の save_message でメッセージを書き戻したら、出荷キューが自動で表示
更新するためのポーリング用。message_history だけを引くので速い。
Returns: {"messages": {order_id: {message_status, message_id?, message_text?,
          message_confirmed_at?, pdf_generated?}}}

2026-07-01: 認証を optional 化。出荷キューは本 endpoint を 6 秒間隔で
ポーリングするため、セッション切れのタブが Authorization ヘッダ無しで叩き
続けると、required 認証依存だと FastAPI が 422 を無限に量産してログを汚す
(実害はないが本番ログが埋まる)。未認証/無効トークンは 422 を出さず空
{"messages": {}} を返して黙らせる。データは一切返さないので情報漏れは無い。

2026-07-02 hardening:
- `request: Request` を明示: get_current_user の A17 stack-walk IP throttle
  (middleware/auth.py) がフレームから Request を見つけて不正トークン連打を
  レート制限できるようにする (無いと throttle が silent skip になる)。
- 空を返すのは「想定内の認証失敗 (400/401/403/429)」のみに限定。DB 障害など
  それ以外の例外は silent fallback にせず logger.warning + re-raise で表面化
  させる ([[feedback_silent_fallback_visibility]])。

## Headers

- `authorization` string, nullable
- `x-shop-id` string, nullable

## Request body

- MessageStatusRequest
  - `order_ids` string[], required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/soeru/apis/soeru-api.md) · [All operations](https://skmtc.dev/soeru/apis/soeru-api/llms.txt) · [OpenAPI document](https://skmtc.dev/soeru/apis/soeru-api/revisions/63f8d371abed?raw)
