# LMile Data Ingestion API

外部アプリが商品・在庫・受注データを LMile に push する API。

## エンドポイント一覧

| Endpoint                                  | Description                |
| ----------------------------------------- | -------------------------- |
| `POST /api/products/bulk-upsert`          | 商品マスター一括登録・更新              |
| `POST /api/inventory-levels/bulk-upsert`  | 在庫一括登録・更新 (絶対値 + delta 対応) |
| `POST /api/order-line-master/bulk-upsert` | 受注一括登録                     |

## Base URL

```
https://ai.lmile.io
```

## Quick Start

```bash
curl -X POST https://ai.lmile.io/api/products/bulk-upsert \
  -H "x-cron-secret: $SECRET" \
  -H "x-shop: demo-store.myshopify.com" \
  -H "Content-Type: application/json" \
  -d '{"products":[{"barcode":"1234567890123","product_name":"スマートフォンケース","current_price":9800}]}'
```

## ドキュメント構成

| セクション                                                      | 内容                |
| ---------------------------------------------------------- | ----------------- |
| [Getting Started](/lmile-docs/getting-started/overview.md) | 概要、認証、最初のリクエスト    |
| [Ingestion APIs](/lmile-docs/ingestion-apis/products.md)   | 各 API のリファレンス     |
| [Reference](/lmile-docs/reference/data-model.md)           | データモデル、エラーコード、冪等性 |
| [Examples](/lmile-docs/examples/curl.md)                   | curl サンプル         |
| [Changelog](/lmile-docs/resources/changelog.md)            | 変更履歴              |
| [Roadmap](/lmile-docs/resources/roadmap.md)                | 今後の計画             |

## サポート

* 問合せ: <admin@lmile.io>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lmile.gitbook.io/lmile-docs/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
