{"name":"ebay-active-get public API","description":"eBayセラー向け管理アプリの外部アプリ向け公開API。7アカウント分の在庫高(仕入価格×在庫数)を1時間ごとに記録。","base_url":"https://ebay-active-get.vercel.app","auth":{"type":"bearer","header":"Authorization","format":"Bearer <PUBLIC_API_KEY>","note":"PUBLIC_API_KEYはアプリ管理者から払い出してもらう"},"endpoints":[{"path":"/api/public/inventory-snapshot","method":"GET","description":"各eBayアカウントの直近の在庫高スナップショットを取得","auth_required":true,"response":{"status":200,"schema":{"snapshots":"Array<SnapshotRow> - アカウント別の最新スナップショット","total_value_jpy":"number - 全アカウント在庫高合計(円)","total_item_count":"number - 全アカウント出品件数合計","account_count":"number - スナップショット数","fetched_at":"string (ISO 8601) - レスポンス生成時刻"},"snapshot_row":{"account_name":"string - アカウント識別子(例: 'monoshare')","display_name":"string - UI表示名(例: 'Monoshare')","recorded_at":"string (ISO 8601) - 記録時刻","total_value_jpy":"number - このアカウントの在庫高(円)","item_count":"number - eBay Active出品件数","matched_count":"number - Kintone突合成功件数","unmatched_count":"number - 突合失敗件数","error":"string | null - 取得エラー('トークン未設定'等)"}},"errors":[{"status":401,"message":"Unauthorized - Bearerトークンが正しくない"},{"status":500,"message":"API未設定(PUBLIC_API_KEY) - サーバー側未設定"},{"status":500,"message":"Supabase未設定"},{"status":500,"message":"Supabase読取エラー"}],"example_request":{"method":"GET","url":"https://ebay-active-get.vercel.app/api/public/inventory-snapshot","headers":{"Authorization":"Bearer YOUR_API_KEY"}},"example_response":{"snapshots":[{"account_name":"monoshare","display_name":"Monoshare","recorded_at":"2026-04-22T08:03:39.936584+00","total_value_jpy":53927288,"item_count":8918,"matched_count":2518,"unmatched_count":6400,"error":null}],"total_value_jpy":53927288,"total_item_count":8918,"account_count":1,"fetched_at":"2026-04-22T09:15:23.456Z"}},{"path":"/api/public/returns","method":"POST","description":"ebay-returns-manager から返品レコードを受信し external_returns に upsert する。duplicate=true は同一SKU/itemIdの返品が既に登録済みであることを示す(重複出品チェック用)","auth_required":true,"request_body":{"return_id":"string (必須) - eBay returnId。upsert のキー","ebay_account":"string - eBayアカウント識別子","item_id":"string - eBay itemId","sku":"string - 自社SKU(商品番号)","transaction_id":"string","buyer_login":"string","status":"string - 返品の内部ステータス","item_title":"string","source":"string - 送信元(既定 'ebay-returns-manager')"},"response":{"status":200,"schema":{"ok":"boolean","return_id":"string","duplicate":"boolean - 同一SKU/itemIdの別返品が既存か","received_at":"string (ISO 8601)"}},"errors":[{"status":400,"message":"return_id は必須です / 不正なJSON"},{"status":401,"message":"Unauthorized"},{"status":500,"message":"Supabase未設定 / 書き込みエラー"}],"example_request":{"method":"POST","url":"https://ebay-active-get.vercel.app/api/public/returns","headers":{"Authorization":"Bearer YOUR_API_KEY","Content-Type":"application/json"},"body":{"return_id":"5000123456","ebay_account":"monoshare","item_id":"111222333","sku":"4480145","status":"IMPORTED","source":"ebay-returns-manager"}},"example_response":{"ok":true,"return_id":"5000123456","duplicate":false,"received_at":"2026-06-03T12:00:00.000Z"}},{"path":"/api/public/returns","method":"GET","description":"指定キーの返品が登録済みか確認する(重複チェック用)","auth_required":true,"query":{"sku":"string - SKUで検索","item_id":"string - itemIdで検索","return_id":"string - returnIdで検索"},"response":{"status":200,"schema":{"exists":"boolean","count":"number","returns":"Array - 該当返品レコード(最大50件)","fetched_at":"string (ISO 8601)"}},"errors":[{"status":400,"message":"sku / item_id / return_id のいずれか必須"},{"status":401,"message":"Unauthorized"}],"example_request":{"method":"GET","url":"https://ebay-active-get.vercel.app/api/public/returns?sku=4480145","headers":{"Authorization":"Bearer YOUR_API_KEY"}},"example_response":{"exists":true,"count":1,"returns":[{"return_id":"5000123456","sku":"4480145","status":"IMPORTED"}],"fetched_at":"2026-06-03T12:00:00.000Z"}}],"notes":["データは1時間ごとのCronで更新される(最大1時間の遅延あり)","直近24時間以内に記録のないアカウントはレスポンスに含まれない","Cron失敗時のエラーは error フィールドで判別可能"],"llms_txt":"https://ebay-active-get.vercel.app/llms.txt"}