Download OpenAPI specification:
リクエストの Authorization ヘッダーに、APIトークンを Bearer スキームで指定してください。
Authorization: Bearer {APIトークン}
APIトークンは、zaico にログインしたご自身の「アカウント設定」画面で確認できます(画面右上のユーザー名 →「アカウント設定」)。
| APIトークン | 対象 | 表示される場所 |
|---|---|---|
| 組織向けAPIトークン | 新プラン | 「APIトークン」欄 |
| 拠点向けAPIトークン(従来) | 旧プラン | 「APIトークン」欄 |
| 拠点向けAPIトークン(従来) | 旧プランから新プランへ移行した拠点 | 「拠点権限を設定」を開き、該当拠点の「(旧) APIトークン」欄(組織権限が「管理」のユーザーのみ) |
APIトークンの代わりに、OAuth 2.0 で発行したアクセストークンを、同じ Authorization ヘッダーに Bearer スキームで指定することもできます。以下の「アプリ」は、zaico に登録した OAuth 2.0 のクライアントを指します。
Authorization: Bearer {アクセストークン}
| 用途 | メソッド | URL |
|---|---|---|
| 認可 | GET | https://web.zaico.co.jp/oauth/authorize |
| トークンの発行・リフレッシュ | POST | https://web.zaico.co.jp/oauth/token |
| トークンの失効 | POST | https://web.zaico.co.jp/oauth/revoke |
認可コードフロー(PKCE に対応)とリフレッシュトークンを使えます。
response_type=code・client_id・redirect_uri・scope・state)。PKCE を使う場合は code_challenge と code_challenge_method=S256 も付けます。redirect_uri に認可コード(code)と state が返ります。state が送った値と一致することを確かめてください。grant_type=authorization_code・code・redirect_uri・client_id を送り、アクセストークンとリフレッシュトークンを受け取ります。client_secret を持つアプリは client_secret も送ります(Basic 認証ヘッダーでも送れます)。PKCE を使った場合は code_verifier も送ります。client_secret を安全に保管できないアプリ(利用者の端末に配布するアプリなど)は、client_secret を持たない公開クライアントとして PKCE(S256)を使ってください。
expires_in に秒数で返ります。有効期限が切れた、または失効したアクセストークンで呼ぶと 401 Unauthorized が返ります。grant_type=refresh_token・refresh_token・client_id(client_secret を持つアプリは client_secret も。Basic 認証ヘッダーでも送れます)を送ると受け取れます(有効期限が切れる前でも受け取れます)。レスポンスには新しいリフレッシュトークンも含まれるため、以後はそちらを使ってください。token・client_id(client_secret を持つアプリは client_secret も。Basic 認証ヘッダーでも送れます)を送ると失効できます。client_id が無いと失効できません。スコープは {リソース}.{操作} の形式(profile を除く)で、認可リクエストの scope にスペース区切りで指定します。
| 操作 | 許可される操作 |
|---|---|
read |
一覧・詳細の取得 |
write |
作成・更新(確定・送信などの状態を変える操作を含む) |
destroy |
削除・キャンセル |
admin |
そのリソースに対するすべての操作 |
scope には、アプリに登録されているスコープの中から指定します(admin を登録していても、read などを個別に指定するにはそのスコープの登録が必要です)。scope を省略すると、アプリに登録されているスコープで認可されます。403 Forbidden が返ります。403 Forbidden が返ります。403 の理由はレスポンスの detail に入ります。bearer{- "data": {
- "id": 0,
- "name": "string",
- "locale": "string",
- "department": "string",
- "position": "string",
- "org": {
- "id": 0,
- "name": "string",
- "enabled_function": "string"
}, - "joined_companies": [
- {
- "user_id": 0,
- "company_id": 0,
- "company_name": "string",
- "authority": "string",
- "user_group": "string",
- "enabled_function": "string"
}
]
}
}拠点一覧取得
org配下の拠点一覧を取得します。 新プラン(orgあり)の場合、組織権限が「管理」のユーザーには組織配下の全拠点を、「編集」「閲覧」のユーザーには所属している拠点(拠点権限が「権限なし」でない拠点)だけを返します。 旧プラン(orgなし)の場合、自身の拠点1件のみを返します。
| keyword | string 検索キーワード(拠点名の部分一致) |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 20) |
| sort_by | string Enum: "id" "name" "updated_at" ソート対象カラム |
| sort_order | string Enum: "asc" "desc" ソート順序 |
| include_deleted | boolean 論理削除済み拠点も含めるか(一部のアプリケーションでのみ有効) |
{- "data": [
- {
- "id": 0,
- "name": "string",
- "zip_code": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "hp": "string",
- "industry": "string",
- "number_of_employees": "string",
- "month_of_settlement": "string",
- "active_status": "active",
- "note": "string",
- "deleted": true,
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "enabled_function": "string"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}物品マスタ一覧取得
組織の物品マスタ一覧を取得します。
| keyword | string キーワード検索(ID完全一致 or 物品名部分一致) |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 50、許可値: 10, 50, 100) |
{- "data": [
- {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}物品マスタ作成
新しい物品マスタを作成します。
物品マスタ作成リクエスト
| common_id | string 共通ID(省略時はUUID自動生成) |
| title required | string [ 1 .. 200 ] characters 物品名(最大200文字) |
| etc | string <= 2000 characters 備考(最大2000文字) |
| item_image_cache | string 画像キャッシュ |
| remove_item_image | boolean 画像を削除する |
{- "common_id": "string",
- "title": "string",
- "etc": "string",
- "item_image_cache": "string",
- "remove_item_image": true
}{- "data": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}
}物品マスタ詳細取得
指定した物品マスタの詳細を取得します。
| id required | integer <int32> 物品マスタID |
{- "data": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}
}物品マスタ更新
既存の物品マスタを更新します。
| id required | integer <int32> 物品マスタID |
物品マスタ更新リクエスト
| common_id | string 共通ID |
| title | string [ 1 .. 200 ] characters 物品名(最大200文字) |
| etc | string <= 2000 characters 備考(最大2000文字) |
| item_image_cache | string 画像キャッシュ |
| remove_item_image | boolean 画像を削除する |
{- "common_id": "string",
- "title": "string",
- "etc": "string",
- "item_image_cache": "string",
- "remove_item_image": true
}{- "data": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}
}物品マスタ削除
物品マスタを論理削除します。
| id required | integer <int32> 物品マスタID |
| delete_inventories_option required | string Value: "unlink" 在庫の取り扱い方法(unlink: 紐付け解除) |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}在庫一覧取得
指定した拠点の在庫一覧を取得します。 並び順は在庫IDの降順で固定です(並べ替えは指定できません)。
| company_id required | integer <int32> 拠点ID |
| title | string 物品名(部分一致) |
| category | string カテゴリ(完全一致) |
| place | string 保管場所(部分一致) |
| code | string コード(完全一致) |
| optional_attributes_name | string 追加項目名(追加項目値とセットで指定したときのみ完全一致絞り込み有効)。
|
| optional_attributes_value | string 追加項目値(追加項目名とセットで指定したときのみ完全一致絞り込み有効)。
|
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100、最大: 1000) |
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値、指定日時を含む) |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at < 指定値、指定日時は含まない)。 半開区間 [start_updated_at, end_updated_at) で範囲指定します。 差分同期の推奨: 次回リクエストの start_updated_at に前回の end_updated_at と同じ値を指定すれば、レコードが重複しません。 |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 差分同期用途では start_updated_at と併用することを推奨します。 受理される値:
|
{- "data": [
- {
- "id": 0,
- "title": "string",
- "quantity": "string",
- "logical_quantity": "string",
- "unit": "string",
- "category": "string",
- "categories": [
- "string"
], - "state": "string",
- "place": "string",
- "etc": "string",
- "code": "string",
- "group_tag": "string",
- "item_image": {
- "url": "string"
}, - "stocktake_attributes": {
- "checked_at": "2025-01-01T00:00:00.000+09:00",
- "stocktake_difference": "string"
}, - "quantity_management_attributes": {
- "order_point_quantity": "string"
}, - "optional_attributes": {
- "property1": "string",
- "property2": "string"
}, - "user_group": "string",
- "is_quantity_auto_conversion_by_unit": true,
- "quantity_auto_conversion_by_unit_name": "string",
- "quantity_auto_conversion_by_unit_factor": "string",
- "create_user_name": "string",
- "update_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "org_item_master": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}, - "variant_setting": {
- "enabled": true,
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "item_type": "string",
- "enabled_deadline_alert": true,
- "deadline_alert_day": 0
}
]
}, - "deleted": true
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}在庫作成
新しい在庫データを作成します。
| company_id required | integer <int32> 拠点ID |
在庫作成リクエスト
| title required | string 物品名(必須) |
| quantity | string 数量 |
| place | string 保管場所 |
| state | string 状態 |
| category | string カテゴリ |
| unit | string 単位 |
| code | string コード |
| item_image | string 画像(Data URI形式: data: |
| etc | string 備考 |
| group_tag | string グループタグ |
object 追加項目 | |
object 棚卸属性 | |
object 発注点属性 | |
| is_quantity_auto_conversion_by_unit | boolean 単位換算有効 |
| quantity_auto_conversion_by_unit_name | string 単位換算単位名 |
| quantity_auto_conversion_by_unit_factor | string 単位換算係数 |
| org_item_master_id | integer <int32> 物品マスタID |
| user_group | string ユーザーグループ(管理者のみ設定可) |
object バリエーション設定 |
{- "title": "string",
- "quantity": "string",
- "place": "string",
- "state": "string",
- "category": "string",
- "unit": "string",
- "code": "string",
- "item_image": "string",
- "etc": "string",
- "group_tag": "string",
- "optional_attributes": {
- "property1": "string",
- "property2": "string"
}, - "stocktake_attributes": {
- "checked_at": "2025-01-01T00:00:00.000+09:00",
- "stocktake_difference": "string"
}, - "quantity_management_attributes": {
- "order_point_quantity": "string"
}, - "is_quantity_auto_conversion_by_unit": true,
- "quantity_auto_conversion_by_unit_name": "string",
- "quantity_auto_conversion_by_unit_factor": "string",
- "org_item_master_id": 0,
- "user_group": "string",
- "variant_setting": {
- "enabled": true,
- "items": [
- {
- "label": "string",
- "item_type": "string",
- "enabled_deadline_alert": true,
- "deadline_alert_day": 0
}
]
}
}{- "data": {
- "attachments": [
- {
- "id": 0,
- "original_filename": "string",
- "url": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00"
}
], - "id": 0,
- "title": "string",
- "quantity": "string",
- "logical_quantity": "string",
- "unit": "string",
- "category": "string",
- "categories": [
- "string"
], - "state": "string",
- "place": "string",
- "etc": "string",
- "code": "string",
- "group_tag": "string",
- "item_image": {
- "url": "string"
}, - "stocktake_attributes": {
- "checked_at": "2025-01-01T00:00:00.000+09:00",
- "stocktake_difference": "string"
}, - "quantity_management_attributes": {
- "order_point_quantity": "string"
}, - "optional_attributes": {
- "property1": "string",
- "property2": "string"
}, - "user_group": "string",
- "is_quantity_auto_conversion_by_unit": true,
- "quantity_auto_conversion_by_unit_name": "string",
- "quantity_auto_conversion_by_unit_factor": "string",
- "create_user_name": "string",
- "update_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "org_item_master": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}, - "variant_setting": {
- "enabled": true,
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "item_type": "string",
- "enabled_deadline_alert": true,
- "deadline_alert_day": 0
}
]
}, - "deleted": true
}
}在庫詳細取得
指定した在庫データの詳細を取得します。
注意: 削除済み在庫データの詳細取得は本エンドポイントでは非対応です。
論理削除済みの在庫 ID を指定した場合、include_deleted パラメータの値にかかわらず 404 が返ります。
削除済み在庫の確認は GET /inventories に include_deleted=true を指定して一覧取得を利用してください。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> 在庫ID |
{- "data": {
- "attachments": [
- {
- "id": 0,
- "original_filename": "string",
- "url": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00"
}
], - "id": 0,
- "title": "string",
- "quantity": "string",
- "logical_quantity": "string",
- "unit": "string",
- "category": "string",
- "categories": [
- "string"
], - "state": "string",
- "place": "string",
- "etc": "string",
- "code": "string",
- "group_tag": "string",
- "item_image": {
- "url": "string"
}, - "stocktake_attributes": {
- "checked_at": "2025-01-01T00:00:00.000+09:00",
- "stocktake_difference": "string"
}, - "quantity_management_attributes": {
- "order_point_quantity": "string"
}, - "optional_attributes": {
- "property1": "string",
- "property2": "string"
}, - "user_group": "string",
- "is_quantity_auto_conversion_by_unit": true,
- "quantity_auto_conversion_by_unit_name": "string",
- "quantity_auto_conversion_by_unit_factor": "string",
- "create_user_name": "string",
- "update_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "org_item_master": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}, - "variant_setting": {
- "enabled": true,
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "item_type": "string",
- "enabled_deadline_alert": true,
- "deadline_alert_day": 0
}
]
}, - "deleted": true
}
}在庫更新
既存の在庫データを更新します。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> 在庫ID |
在庫更新リクエスト
| title | string 物品名 |
| quantity | string 数量 |
| place | string 保管場所 |
| state | string 状態 |
| category | string カテゴリ |
| unit | string 単位 |
| code | string コード |
| item_image | string 画像(Data URI形式: data: |
| etc | string 備考 |
| group_tag | string グループタグ |
object 追加項目 | |
object 棚卸属性 | |
object 発注点属性 | |
| is_quantity_auto_conversion_by_unit | boolean 単位換算有効 |
| quantity_auto_conversion_by_unit_name | string 単位換算単位名 |
| quantity_auto_conversion_by_unit_factor | string 単位換算係数 |
| org_item_master_id | integer or null <int32> 物品マスタID。整数IDで紐付け、nullで紐付け解除、省略時は既存の紐付けを維持します。 |
| user_group | string ユーザーグループ(管理者のみ設定可) |
{- "title": "string",
- "quantity": "string",
- "place": "string",
- "state": "string",
- "category": "string",
- "unit": "string",
- "code": "string",
- "item_image": "string",
- "etc": "string",
- "group_tag": "string",
- "optional_attributes": {
- "property1": "string",
- "property2": "string"
}, - "stocktake_attributes": {
- "checked_at": "2025-01-01T00:00:00.000+09:00",
- "stocktake_difference": "string"
}, - "quantity_management_attributes": {
- "order_point_quantity": "string"
}, - "is_quantity_auto_conversion_by_unit": true,
- "quantity_auto_conversion_by_unit_name": "string",
- "quantity_auto_conversion_by_unit_factor": "string",
- "org_item_master_id": 0,
- "user_group": "string"
}{- "data": {
- "attachments": [
- {
- "id": 0,
- "original_filename": "string",
- "url": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00"
}
], - "id": 0,
- "title": "string",
- "quantity": "string",
- "logical_quantity": "string",
- "unit": "string",
- "category": "string",
- "categories": [
- "string"
], - "state": "string",
- "place": "string",
- "etc": "string",
- "code": "string",
- "group_tag": "string",
- "item_image": {
- "url": "string"
}, - "stocktake_attributes": {
- "checked_at": "2025-01-01T00:00:00.000+09:00",
- "stocktake_difference": "string"
}, - "quantity_management_attributes": {
- "order_point_quantity": "string"
}, - "optional_attributes": {
- "property1": "string",
- "property2": "string"
}, - "user_group": "string",
- "is_quantity_auto_conversion_by_unit": true,
- "quantity_auto_conversion_by_unit_name": "string",
- "quantity_auto_conversion_by_unit_factor": "string",
- "create_user_name": "string",
- "update_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "org_item_master": {
- "id": 1,
- "common_id": "550e8400-e29b-41d4-a716-446655440000",
- "title": "テスト物品",
- "etc": "備考テキスト",
- "create_org_user_id": 1,
- "create_org_user_name": "テストユーザー",
- "update_org_user_id": 1,
- "update_org_user_name": "テストユーザー",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00"
}, - "variant_setting": {
- "enabled": true,
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "item_type": "string",
- "enabled_deadline_alert": true,
- "deadline_alert_day": 0
}
]
}, - "deleted": true
}
}セット品一覧取得
指定した拠点のセット品一覧を取得します。
| company_id required | integer <int32> 拠点ID |
| page | integer <int32> ページ番号 |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100, 最大: 100) |
{- "data": [
- {
- "id": 1,
- "title": "セット品A",
- "price": "1000.0",
- "code": "code1",
- "memo": "メモ",
- "available_delivery_quantity": "100",
- "update_user_id": 1,
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventories_set_items": [
- {
- "inventory_id": 1,
- "quantity": "10.0",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventory_title": "在庫A",
- "inventory_quantity": "1000.0",
- "inventory_del_flg": false
}
]
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}セット品作成
新しいセット品を作成します。
| company_id required | integer <int32> 拠点ID |
| title required | string セット品名(必須) |
| price | number <double> 価格 |
| code | string 管理コード(空欄の場合はランダム値が生成される) |
| memo | string メモ |
required | Array of objects (Models.InventoriesSet.InventoriesSetItemRequest) セット品明細 |
{- "title": "テストセット",
- "price": 1000,
- "code": "000",
- "memo": "メモ",
- "inventories_set_items_attributes": [
- {
- "inventory_id": 1,
- "quantity": 10
}
]
}{- "data": {
- "id": 1,
- "title": "セット品A",
- "price": "1000.0",
- "code": "code1",
- "memo": "メモ",
- "available_delivery_quantity": "100",
- "update_user_id": 1,
- "available_delivery_logical_quantity": "100",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventories_set_items": [
- {
- "inventory_id": 1,
- "quantity": "10.0",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventory_title": "在庫A",
- "inventory_quantity": "1000.0",
- "inventory_del_flg": false,
- "inventory_logical_quantity": "1005.0"
}
]
}
}セット品詳細取得
指定したセット品の詳細を取得します。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> セット品ID |
{- "data": {
- "id": 1,
- "title": "セット品A",
- "price": "1000.0",
- "code": "code1",
- "memo": "メモ",
- "available_delivery_quantity": "100",
- "update_user_id": 1,
- "available_delivery_logical_quantity": "100",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventories_set_items": [
- {
- "inventory_id": 1,
- "quantity": "10.0",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventory_title": "在庫A",
- "inventory_quantity": "1000.0",
- "inventory_del_flg": false,
- "inventory_logical_quantity": "1005.0"
}
]
}
}セット品更新
指定したセット品を更新します。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> セット品ID |
| title | string セット品名 |
| price | number <double> 価格 |
| code | string 管理コード |
| memo | string メモ |
Array of objects (Models.InventoriesSet.InventoriesSetItemRequest) セット品明細(指定した場合、既存の明細は全て削除され新しい明細に置き換わる。空配列を指定すると明細は0件になる。省略した場合、既存の明細は変更されない) |
{- "title": "テストセット",
- "price": 3000,
- "code": "003",
- "memo": "更新メモ",
- "inventories_set_items_attributes": [
- {
- "inventory_id": 1,
- "quantity": 10
}
]
}{- "data": {
- "id": 1,
- "title": "セット品A",
- "price": "1000.0",
- "code": "code1",
- "memo": "メモ",
- "available_delivery_quantity": "100",
- "update_user_id": 1,
- "available_delivery_logical_quantity": "100",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventories_set_items": [
- {
- "inventory_id": 1,
- "quantity": "10.0",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "inventory_title": "在庫A",
- "inventory_quantity": "1000.0",
- "inventory_del_flg": false,
- "inventory_logical_quantity": "1005.0"
}
]
}
}添付ファイル一覧取得
指定した在庫の添付ファイル一覧を取得します。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
{- "data": [
- {
- "id": 0,
- "original_filename": "string",
- "url": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00"
}
]
}添付ファイル作成
在庫に添付ファイルをアップロードします。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
添付ファイル作成リクエスト
| item_file required | string 添付ファイル(Data URI形式: data: |
| original_filename | string 元のファイル名。未指定の場合はサーバー側で自動生成。拡張子がファイルのMIMEタイプと異なる場合は正しい拡張子が自動付与される。 |
{- "item_file": "string",
- "original_filename": "string"
}{- "data": {
- "id": 0,
- "original_filename": "string",
- "url": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00"
}
}添付ファイル削除
添付ファイルを物理削除します。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
| id required | integer <int32> 添付ファイルID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}在庫属性一覧取得
指定した拠点の在庫属性データ(追加項目)一覧を取得します。
| company_id required | integer <int32> 拠点ID |
| page | integer <int32> ページ番号 |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100, 最大: 100) |
{- "data": [
- {
- "id": 1,
- "title": "仕入価格",
- "attr_type": "Text"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}バリアント一覧取得
指定した在庫のバリアント一覧を取得します。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100、最大: 1000) |
{- "data": [
- {
- "id": 0,
- "inventory_id": 0,
- "data_key": "string",
- "code": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
], - "quantity": "string",
- "logical_quantity": "string",
- "purchase_unit_price": "string",
- "packing_slip_unit_price": "string",
- "item_image": {
- "url": "string"
}, - "update_user_name": "string",
- "create_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "update_date": "2025-01-01T00:00:00.000+09:00"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}バリアント作成
指定した在庫に新しいバリアントを作成します。 variant_settingが有効な在庫のみ操作可能です。 同一data_keyの既存バリアントが存在する場合は新規作成せず、そのバリアントを更新します(論理削除済みなら復活します)。 quantityを指定した場合は既存の数量をその値で上書きし、差分を在庫データの数量に反映します。 quantityを省略した場合は数量を変更しません。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
リクエストボディ
required | Array of objects (CreateInventoryVariantItemInput) バリアント項目値 |
| quantity | string 数量。省略時は新規作成なら0、同一data_keyの既存バリアントがある場合はその数量を変更しない |
| code | string バリアントコード |
| purchase_unit_price | string 仕入単価 |
| packing_slip_unit_price | string 出庫単価 |
| item_image | string 画像(base64エンコード) |
{- "items": [
- {
- "id": 0,
- "value": "string"
}
], - "quantity": "string",
- "code": "string",
- "purchase_unit_price": "string",
- "packing_slip_unit_price": "string",
- "item_image": "string"
}{- "id": 0,
- "inventory_id": 0,
- "data_key": "string",
- "code": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
], - "quantity": "string",
- "logical_quantity": "string",
- "purchase_unit_price": "string",
- "packing_slip_unit_price": "string",
- "item_image": {
- "url": "string"
}, - "update_user_name": "string",
- "create_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "update_date": "2025-01-01T00:00:00.000+09:00"
}バリアント詳細取得
指定した在庫バリアントの詳細を取得します。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
| id required | integer <int32> バリアントID |
{- "id": 0,
- "inventory_id": 0,
- "data_key": "string",
- "code": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
], - "quantity": "string",
- "logical_quantity": "string",
- "purchase_unit_price": "string",
- "packing_slip_unit_price": "string",
- "item_image": {
- "url": "string"
}, - "update_user_name": "string",
- "create_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "update_date": "2025-01-01T00:00:00.000+09:00"
}バリアント更新
指定した在庫バリアントを更新します。 variant_settingが有効な在庫のみ操作可能です。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
| id required | integer <int32> バリアントID |
リクエストボディ
Array of objects (CreateInventoryVariantItemInput) バリアント項目値 | |
| quantity | string 数量 |
| code | string バリアントコード |
| purchase_unit_price | string 仕入単価 |
| packing_slip_unit_price | string 出庫単価 |
| item_image | string 画像(base64エンコード) |
{- "items": [
- {
- "id": 0,
- "value": "string"
}
], - "quantity": "string",
- "code": "string",
- "purchase_unit_price": "string",
- "packing_slip_unit_price": "string",
- "item_image": "string"
}{- "id": 0,
- "inventory_id": 0,
- "data_key": "string",
- "code": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
], - "quantity": "string",
- "logical_quantity": "string",
- "purchase_unit_price": "string",
- "packing_slip_unit_price": "string",
- "item_image": {
- "url": "string"
}, - "update_user_name": "string",
- "create_user_name": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "update_date": "2025-01-01T00:00:00.000+09:00"
}バリアント削除
指定した在庫バリアントを論理削除します。 variant_settingが有効な在庫のみ操作可能です。
予定(入庫予定・出庫予定、未入力のバリアントは生産計画も)が紐づくバリアントは、削除の直前に予定を数え直して422を返し、削除しません。
| company_id required | integer <int32> 拠点ID |
| inventory_id required | integer <int32> 在庫ID |
| id required | integer <int32> バリアントID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}カテゴリ一覧取得
指定した拠点のカテゴリ一覧を取得します。 デフォルトの並び順は position ASC, created_at ASC です。
| company_id required | integer <int32> 拠点ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100, 最大: 100) |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 受理される値:
|
{- "data": [
- {
- "id": 0,
- "name": "string",
- "position": 0,
- "deleted": true,
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}カテゴリ作成
新しいカテゴリを作成します。
同名の論理削除済カテゴリが存在する場合の挙動(復活ロジック):
deleted: true)が同一拠点に存在する場合、
そのレコードを復活させて deleted: false で返します。新しい id は採番されず、
既存の id が返却される点に注意してください。position は末尾(既存有効カテゴリの最大 position + 1)に再設定されます。
削除前の position には戻りません。| company_id required | integer <int32> 拠点ID |
カテゴリ作成リクエスト
| name required | string [ 1 .. 50 ] characters ^[^,\n]*$ カテゴリ名(必須、最大50文字、 同名の論理削除済カテゴリが既に存在する場合は復活させ、同IDで返却する。
|
{- "name": "string"
}{- "data": {
- "id": 0,
- "name": "string",
- "position": 0,
- "deleted": true,
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00"
}
}カテゴリ更新(部分更新)
カテゴリ名を更新します。
Web 画面での挙動との差異(重要):
Web 画面でのカテゴリ名変更とは異なり、過去の在庫データの category 文字列は
更新されません。古い名称の在庫データを新しいカテゴリ名に紐付け直す場合は、
別途在庫 API 経由で各レコードの category を更新してください。
冪等性:
リクエストボディが空 {} または name 未指定の場合、リソースは変更されず
HTTP 200 を返します(idempotent)。updated_at は更新されます。
論理削除済への更新:
deleted: true のカテゴリの id を指定すると HTTP 404 を返します。
論理削除済を復活させたい場合は、同名で POST してください(復活ロジック)。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> カテゴリID |
カテゴリ更新リクエスト
| name | string [ 1 .. 50 ] characters ^[^,\n]*$ カテゴリ名(指定時のみ更新。最大50文字、 注: API V2 ではカテゴリ名を変更しても、過去の在庫データの category 文字列は更新されない。 |
{- "name": "string"
}{- "data": {
- "id": 0,
- "name": "string",
- "position": 0,
- "deleted": true,
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00"
}
}カテゴリ削除(論理削除)
カテゴリを論理削除します(DBレコードは残ります)。
在庫データの category 文字列はそのまま残ります。
二重削除: 既に論理削除済の id を指定すると HTTP 404 を返します。 削除済カテゴリを再利用したい場合は、同名で POST して復活させてください。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> カテゴリID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}単位一覧取得
単位の一覧を取得する。論理削除済を含むかどうかを指定可能。
並び順は position ASC, created_at ASC です。 position が null の単位は先頭に並びます。
| company_id required | integer <int32> 拠点ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100, 最大: 100) |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 受理される値:
|
{- "data": [
- {
- "id": 0,
- "name": "string",
- "position": 0,
- "deleted": true,
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}出庫データ一覧取得
出庫データの一覧を取得します。 ページネーションに対応しており、デフォルトで1ページあたり100件を返します。 出庫物品(明細)をネストして返します。
| company_id required | integer <int32> 会社ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100、最大: 1000) |
| status | string (Models.PackingSlip.PackingSlipStatus) Enum: "before_delivery" "during_delivery" "completed_delivery" ステータスで絞り込み |
| num | string 出庫番号 |
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値、指定日時を含む)。 updated_at は発送情報の追跡番号の値が変わったときも進むため、追跡番号の変更も差分同期で取得できます。追跡番号以外の発送情報の項目だけを変えたとき、追跡番号の空欄と null を切り替えたときは進みません。 |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at < 指定値、指定日時は含まない)。 半開区間 [start_updated_at, end_updated_at) で範囲指定します。 差分同期の推奨: 次回リクエストの start_updated_at に前回の end_updated_at と同じ値を指定すれば、レコードが重複しません。 |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 差分同期用途では start_updated_at と併用することを推奨します。 include_deleted=true 時、ネストされた deliveries も削除済み明細を含めて返却します。 受理される値:
注意: サブスクリプションプランに応じた保持期間制限が適用されます (Free / Entry / Minimum: 2年、Lite: 5年、Full / Pro: 7年)。 保持期間を超えた古いデータは include_deleted=true でも取得できません。 |
{- "data": [
- {
- "id": 1,
- "num": "D-001",
- "customer_name": "テスト取引先",
- "status": "before_delivery",
- "total_amount": "10000.0",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "社内メモ",
- "note": "備考",
- "created_at": "2025-01-01T00:00:00+09:00",
- "updated_at": "2025-01-01T00:00:00+09:00",
- "deleted": true,
- "sales_order_id": 1234,
- "deliveries": [
- {
- "id": 10,
- "inventory_id": 100,
- "title": "商品A",
- "quantity": "5.0",
- "unit": "個",
- "unit_price": "2000.0",
- "subtotal_amount": "10000.0",
- "status": "before_delivery",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "etc": "備考テキスト",
- "deleted": true,
- "variants": [
- {
- "data_key": "12345",
- "quantity": "5.0",
- "unit_price": "2000.0",
- "amount": "10000.0",
- "unit_snapshot": {
- "factor": "10.0",
- "piece_name": "個",
- "box_name": "箱"
}, - "box_quantity": "1.0",
- "box_unit": "箱",
- "items": [
- {
- "variant_setting_item_id": 1,
- "label": "色",
- "value": "赤"
}
]
}
]
}
], - "shipping_instruction": {
- "to_name": "株式会社テスト",
- "to_name_postfix": "様",
- "to_zip": "100-0001",
- "to_address": "東京都千代田区千代田1-1",
- "building_name": "ビルB 2F",
- "to_phone_number": "03-1234-5678",
- "shipping_client": {
- "id": 1,
- "name": "配送先A",
- "zip": "1000001",
- "address": "東京都千代田区",
- "building_name": "ビルA 3F",
- "phone_number": "03-1234-5678"
}, - "invoice_type_name": "ヤマト 発払い",
- "product_name_on_invoice": "電気製品",
- "freight_handling": "ワレ物注意",
- "freight_handling2": "天地無用",
- "arrival_date": "2025-01-20",
- "arrival_hour": "午前中",
- "tracking_number": "1234-5678-9012"
}
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}出庫データ作成
出庫データを作成します。 出庫物品(明細)を含めて一括作成します。 ステータスがcompleted_deliveryの場合、在庫数量が減算されます。
| company_id required | integer <int32> 会社ID |
作成パラメータ
| association | string Value: "inventory_title" 在庫データ関連付け方法。 inventory_title 指定時は deliveries[].inventory_title で同名の有効在庫を検索し、 見つからない場合は在庫を自動作成します。 |
| num | string 出庫番号 |
| customer_name | string 取引先名 |
| status | string Enum: "before_delivery" "during_delivery" "completed_delivery" ステータス 明細( |
| delivery_date | string or null <date> 出庫日(YYYY-MM-DD形式)。status が completed_delivery のとき必須。 |
| date_of_issue | string or null <date> 発行日(YYYY-MM-DD形式) |
| memo | string 社内メモ(最大250文字) |
| note | string 備考(最大250文字) |
required | Array of objects (Models.PackingSlip.CreatePackingSlipItemRequest) 出庫物品の配列。 association未指定時は各明細に inventory_id を指定し、 association=inventory_title 時は各明細に inventory_title を指定します。 |
{- "association": "inventory_title",
- "num": "string",
- "customer_name": "string",
- "status": "before_delivery",
- "delivery_date": "2019-08-24",
- "date_of_issue": "2019-08-24",
- "memo": "string",
- "note": "string",
- "deliveries": [
- {
- "inventory_id": 0,
- "inventory_title": "string",
- "quantity": "string",
- "unit_price": "string",
- "status": "before_delivery",
- "delivery_date": "2019-08-24",
- "estimated_delivery_date": "2019-08-24",
- "etc": "string",
- "variants": [
- {
- "id": 0,
- "code": "string",
- "quantity": "string",
- "unit_price": "string",
- "items": [
- {
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}{- "data": {
- "id": 1,
- "num": "D-001",
- "customer_name": "テスト取引先",
- "status": "before_delivery",
- "total_amount": "10000.0",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "社内メモ",
- "note": "備考",
- "created_at": "2025-01-01T00:00:00+09:00",
- "updated_at": "2025-01-01T00:00:00+09:00",
- "deleted": true,
- "sales_order_id": 1234,
- "deliveries": [
- {
- "id": 10,
- "inventory_id": 100,
- "title": "商品A",
- "quantity": "5.0",
- "unit": "個",
- "unit_price": "2000.0",
- "subtotal_amount": "10000.0",
- "status": "before_delivery",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "etc": "備考テキスト",
- "deleted": true,
- "variants": [
- {
- "data_key": "12345",
- "quantity": "5.0",
- "unit_price": "2000.0",
- "amount": "10000.0",
- "unit_snapshot": {
- "factor": "10.0",
- "piece_name": "個",
- "box_name": "箱"
}, - "box_quantity": "1.0",
- "box_unit": "箱",
- "items": [
- {
- "variant_setting_item_id": 1,
- "label": "色",
- "value": "赤"
}
]
}
]
}
], - "shipping_instruction": {
- "to_name": "株式会社テスト",
- "to_name_postfix": "様",
- "to_zip": "100-0001",
- "to_address": "東京都千代田区千代田1-1",
- "building_name": "ビルB 2F",
- "to_phone_number": "03-1234-5678",
- "shipping_client": {
- "id": 1,
- "name": "配送先A",
- "zip": "1000001",
- "address": "東京都千代田区",
- "building_name": "ビルA 3F",
- "phone_number": "03-1234-5678"
}, - "invoice_type_name": "ヤマト 発払い",
- "product_name_on_invoice": "電気製品",
- "freight_handling": "ワレ物注意",
- "freight_handling2": "天地無用",
- "arrival_date": "2025-01-20",
- "arrival_hour": "午前中",
- "tracking_number": "1234-5678-9012"
}, - "date_of_issue": "2025-01-10"
}
}出庫データ詳細取得
指定されたIDの出庫データを取得します。 出庫物品(明細)をネストして返します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 出庫データID |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 include_deleted=true の場合、削除済みの親 PackingSlip と、ネストされた deliveries の削除済み明細も含めて返却します。 受理される値:
|
{- "data": {
- "id": 1,
- "num": "D-001",
- "customer_name": "テスト取引先",
- "status": "before_delivery",
- "total_amount": "10000.0",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "社内メモ",
- "note": "備考",
- "created_at": "2025-01-01T00:00:00+09:00",
- "updated_at": "2025-01-01T00:00:00+09:00",
- "deleted": true,
- "sales_order_id": 1234,
- "deliveries": [
- {
- "id": 10,
- "inventory_id": 100,
- "title": "商品A",
- "quantity": "5.0",
- "unit": "個",
- "unit_price": "2000.0",
- "subtotal_amount": "10000.0",
- "status": "before_delivery",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "etc": "備考テキスト",
- "deleted": true,
- "variants": [
- {
- "data_key": "12345",
- "quantity": "5.0",
- "unit_price": "2000.0",
- "amount": "10000.0",
- "unit_snapshot": {
- "factor": "10.0",
- "piece_name": "個",
- "box_name": "箱"
}, - "box_quantity": "1.0",
- "box_unit": "箱",
- "items": [
- {
- "variant_setting_item_id": 1,
- "label": "色",
- "value": "赤"
}
]
}
]
}
], - "shipping_instruction": {
- "to_name": "株式会社テスト",
- "to_name_postfix": "様",
- "to_zip": "100-0001",
- "to_address": "東京都千代田区千代田1-1",
- "building_name": "ビルB 2F",
- "to_phone_number": "03-1234-5678",
- "shipping_client": {
- "id": 1,
- "name": "配送先A",
- "zip": "1000001",
- "address": "東京都千代田区",
- "building_name": "ビルA 3F",
- "phone_number": "03-1234-5678"
}, - "invoice_type_name": "ヤマト 発払い",
- "product_name_on_invoice": "電気製品",
- "freight_handling": "ワレ物注意",
- "freight_handling2": "天地無用",
- "arrival_date": "2025-01-20",
- "arrival_hour": "午前中",
- "tracking_number": "1234-5678-9012"
}, - "date_of_issue": "2025-01-10"
}
}出庫データ更新
指定されたIDの出庫データを更新します。 出庫済みの物品は数量・ステータスの変更ができません。 明細は id(明細ID)か inventory_id で特定します。inventory_id だけを指定したときは、その在庫の明細のうち先頭の 1 件を更新します。 同じ在庫の明細が複数ある出庫で 2 件目以降を更新するときは、id を指定してください。 id がこの出庫に存在しない、または id と inventory_id が別の明細を指しているときは 400 を返し、どの明細も更新しません。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 出庫データID |
更新パラメータ
| num | string 出庫番号 |
| customer_name | string 取引先名 |
| memo | string 社内メモ(最大250文字) |
| note | string 備考(最大250文字) |
| date_of_issue | string or null <date> 発行日(YYYY-MM-DD形式) |
Array of objects (Models.PackingSlip.UpdatePackingSlipItemRequest) 出庫物品の配列 |
{- "num": "string",
- "customer_name": "string",
- "memo": "string",
- "note": "string",
- "date_of_issue": "2019-08-24",
- "deliveries": [
- {
- "id": 0,
- "inventory_id": 0,
- "quantity": "string",
- "unit_price": "string",
- "status": "before_delivery",
- "delivery_date": "2019-08-24",
- "estimated_delivery_date": "2019-08-24",
- "etc": "string",
- "variants": [
- {
- "id": 0,
- "code": "string",
- "quantity": "string",
- "unit_price": "string",
- "items": [
- {
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}{- "data": {
- "id": 1,
- "num": "D-001",
- "customer_name": "テスト取引先",
- "status": "before_delivery",
- "total_amount": "10000.0",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "社内メモ",
- "note": "備考",
- "created_at": "2025-01-01T00:00:00+09:00",
- "updated_at": "2025-01-01T00:00:00+09:00",
- "deleted": true,
- "sales_order_id": 1234,
- "deliveries": [
- {
- "id": 10,
- "inventory_id": 100,
- "title": "商品A",
- "quantity": "5.0",
- "unit": "個",
- "unit_price": "2000.0",
- "subtotal_amount": "10000.0",
- "status": "before_delivery",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "etc": "備考テキスト",
- "deleted": true,
- "variants": [
- {
- "data_key": "12345",
- "quantity": "5.0",
- "unit_price": "2000.0",
- "amount": "10000.0",
- "unit_snapshot": {
- "factor": "10.0",
- "piece_name": "個",
- "box_name": "箱"
}, - "box_quantity": "1.0",
- "box_unit": "箱",
- "items": [
- {
- "variant_setting_item_id": 1,
- "label": "色",
- "value": "赤"
}
]
}
]
}
], - "shipping_instruction": {
- "to_name": "株式会社テスト",
- "to_name_postfix": "様",
- "to_zip": "100-0001",
- "to_address": "東京都千代田区千代田1-1",
- "building_name": "ビルB 2F",
- "to_phone_number": "03-1234-5678",
- "shipping_client": {
- "id": 1,
- "name": "配送先A",
- "zip": "1000001",
- "address": "東京都千代田区",
- "building_name": "ビルA 3F",
- "phone_number": "03-1234-5678"
}, - "invoice_type_name": "ヤマト 発払い",
- "product_name_on_invoice": "電気製品",
- "freight_handling": "ワレ物注意",
- "freight_handling2": "天地無用",
- "arrival_date": "2025-01-20",
- "arrival_hour": "午前中",
- "tracking_number": "1234-5678-9012"
}, - "date_of_issue": "2025-01-10"
}
}出庫データ削除
指定されたIDの出庫データを取消します。 出庫済みの物品がある場合、在庫数量が戻されます。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 出庫データID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}出庫物品一覧取得
出庫物品(明細)の一覧を取得します。 ページネーションに対応しており、デフォルトで1ページあたり1000件を返します。 ステータス・日付による絞り込みが可能です。
| company_id required | integer <int32> 会社ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100, 最大: 100) |
| status | string ステータスで絞り込み(before_delivery / during_delivery / completed_delivery) |
| start_date | string <date> 開始日で絞り込み(YYYY-MM-DD形式、delivery_date >= start_date) |
| end_date | string <date> 終了日で絞り込み(YYYY-MM-DD形式、delivery_date <= end_date) |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 差分同期用途では start_updated_at と併用することを推奨します。 取得範囲(出庫は親 PackingSlip と明細 Delivery の2段階フィルタを持つ):
受理される値:
|
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値、指定日時を含む) |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at < 指定値、指定日時は含まない)。 半開区間 [start_updated_at, end_updated_at) で範囲指定します。 差分同期の推奨: 次回リクエストの start_updated_at に前回の end_updated_at と同じ値を指定すれば、レコードが重複しません。 |
{- "data": [
- {
- "id": 10,
- "packing_slip_id": 1,
- "inventory_id": 100,
- "title": "商品A",
- "quantity": "5.0",
- "unit": "個",
- "unit_price": "2000.0",
- "status": "before_delivery",
- "delivery_date": "2025-01-15",
- "estimated_delivery_date": "2025-01-20",
- "etc": "備考テキスト",
- "date_of_issue": "2025-01-10",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}出庫物品削除
指定されたIDの出庫物品(明細)を取消します。 出庫済みの物品の場合、在庫数量が戻されます。 全ての明細が削除された場合、親の出庫データも論理削除されます。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 出庫物品ID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}入庫一覧取得
入庫データの一覧を取得します。 論理削除済みのデータは除外されます。
| company_id required | integer <int32> 拠点ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100、最大: 1000) |
| status | string (PurchaseStatus) Enum: "none" "not_ordered" "ordered" "purchased" "quotation_requested" ステータスフィルタ |
| start_date | string <date> 入庫日の開始日(YYYY-MM-DD) |
| end_date | string <date> 入庫日の終了日(YYYY-MM-DD) |
| num | string 入庫番号 |
| inventory_id | integer <int32> 在庫ID |
| memo | string メモ(部分一致検索) |
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値、指定日時を含む) |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at < 指定値、指定日時は含まない)。 半開区間 [start_updated_at, end_updated_at) で範囲指定します。 差分同期の推奨: 次回リクエストの start_updated_at に前回の end_updated_at と同じ値を指定すれば、レコードが重複しません。 |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 差分同期用途では start_updated_at と併用することを推奨します。 include_deleted=true 時、ネストされた purchase_items も削除済み明細を含めて返却します。 受理される値:
注意: サブスクリプションプランに応じた保持期間制限が適用されます (Free / Entry / Minimum: 2年、Lite: 5年、Full / Pro: 7年)。 保持期間を超えた古いデータは include_deleted=true でも取得できません。 |
{- "data": [
- {
- "id": 0,
- "num": "string",
- "customer_name": "string",
- "status": "none",
- "total_amount": "string",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "string",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "purchase_items": [
- {
- "id": 0,
- "purchase_id": 0,
- "inventory_id": 0,
- "title": "string",
- "quantity": "string",
- "unit": "string",
- "unit_price": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "subtotal_amount": "string",
- "status": "none",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "variants": [
- {
- "data_key": "string",
- "quantity": "string",
- "unit_price": "string",
- "amount": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}入庫作成
新しい入庫データを作成します。 statusがpurchasedの場合、在庫数量が加算されます。
| company_id required | integer <int32> 拠点ID |
入庫データ
| association | string Value: "inventory_title" 在庫データ関連付け方法。 inventory_title 指定時は purchase_items[].inventory_title で同名の有効在庫を検索し、 見つからない場合は在庫を自動作成します。 |
| customer_name | string 取引先名 |
| status | string Enum: "none" "not_ordered" "ordered" "purchased" "quotation_requested" ステータス |
| purchase_date | string or null <date> 入庫日(YYYY-MM-DD)。status が purchased のとき必須。 |
| estimated_purchase_date | string or null <date> 入庫予定日(YYYY-MM-DD)。status に関係なく指定可能。 |
| memo | string メモ |
| etc | string 備考 |
required | Array of objects (CreatePurchaseItemRequest) 入庫明細(1件以上必須)。 association未指定時は各明細に inventory_id を指定し、 association=inventory_title 時は各明細に inventory_title を指定します。 |
{- "association": "inventory_title",
- "customer_name": "string",
- "status": "none",
- "purchase_date": "2019-08-24",
- "estimated_purchase_date": "2019-08-24",
- "memo": "string",
- "etc": "string",
- "purchase_items": [
- {
- "inventory_id": 0,
- "inventory_title": "string",
- "title": "string",
- "quantity": "string",
- "unit": "string",
- "unit_price": "string",
- "unit_type": "piece",
- "status": "none",
- "purchase_date": "2019-08-24",
- "estimated_purchase_date": "2019-08-24",
- "etc": "string",
- "variants": [
- {
- "id": 0,
- "code": "string",
- "quantity": "string",
- "unit_price": "string",
- "items": [
- {
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}{- "data": {
- "id": 0,
- "num": "string",
- "customer_name": "string",
- "status": "none",
- "total_amount": "string",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "string",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "purchase_items": [
- {
- "id": 0,
- "purchase_id": 0,
- "inventory_id": 0,
- "title": "string",
- "quantity": "string",
- "unit": "string",
- "unit_price": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "subtotal_amount": "string",
- "status": "none",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "variants": [
- {
- "data_key": "string",
- "quantity": "string",
- "unit_price": "string",
- "amount": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}
}入庫詳細取得
指定された入庫データの詳細を取得します。 論理削除済みの明細は除外されます。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> 入庫ID |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 include_deleted=true の場合、削除済みの親 Purchase と、ネストされた purchase_items の削除済み明細も含めて返却します。 受理される値:
|
{- "data": {
- "id": 0,
- "num": "string",
- "customer_name": "string",
- "status": "none",
- "total_amount": "string",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "string",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "purchase_items": [
- {
- "id": 0,
- "purchase_id": 0,
- "inventory_id": 0,
- "title": "string",
- "quantity": "string",
- "unit": "string",
- "unit_price": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "subtotal_amount": "string",
- "status": "none",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "variants": [
- {
- "data_key": "string",
- "quantity": "string",
- "unit_price": "string",
- "amount": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}
}入庫更新
既存の入庫データを更新します。 purchasedステータスの明細は数量・ステータスの変更が制限されます。 明細は id(明細ID)か inventory_id で特定します。inventory_id だけを指定したときは、その在庫の明細のうち先頭の 1 件を更新します。 同じ在庫の明細が複数ある入庫で 2 件目以降を更新するときは、id を指定してください。 id がこの入庫に存在しない、または id と inventory_id が別の明細を指しているときは 400 を返し、どの明細も更新しません。
| company_id required | integer <int32> 拠点ID |
| id required | integer <int32> 入庫ID |
更新データ
| customer_name | string 取引先名 |
| purchase_date | string or null <date> 入庫日(YYYY-MM-DD)。status が purchased のとき必須。 |
| estimated_purchase_date | string or null <date> 入庫予定日(YYYY-MM-DD)。status に関係なく指定可能。 |
| memo | string メモ |
| etc | string 備考 |
Array of objects (UpdatePurchaseItemRequest) 入庫明細 |
{- "customer_name": "string",
- "purchase_date": "2019-08-24",
- "estimated_purchase_date": "2019-08-24",
- "memo": "string",
- "etc": "string",
- "purchase_items": [
- {
- "id": 0,
- "inventory_id": 0,
- "quantity": "string",
- "unit_price": "string",
- "unit_type": "piece",
- "status": "none",
- "purchase_date": "2019-08-24",
- "estimated_purchase_date": "2019-08-24",
- "etc": "string",
- "variants": [
- {
- "id": 0,
- "code": "string",
- "quantity": "string",
- "unit_price": "string",
- "items": [
- {
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}{- "data": {
- "id": 0,
- "num": "string",
- "customer_name": "string",
- "status": "none",
- "total_amount": "string",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "create_user_name": "string",
- "memo": "string",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "purchase_items": [
- {
- "id": 0,
- "purchase_id": 0,
- "inventory_id": 0,
- "title": "string",
- "quantity": "string",
- "unit": "string",
- "unit_price": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "subtotal_amount": "string",
- "status": "none",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "variants": [
- {
- "data_key": "string",
- "quantity": "string",
- "unit_price": "string",
- "amount": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
]
}
]
}
]
}
}入庫物品一覧取得
入庫物品(明細)の一覧を取得します。 ページネーションに対応しており、デフォルトで1ページあたり1000件を返します。 ステータス・日付による絞り込みが可能です。
| company_id required | integer <int32> 会社ID |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100, 最大: 100) |
| status | string (PurchaseStatus) Enum: "none" "not_ordered" "ordered" "purchased" "quotation_requested" ステータスで絞り込み |
| start_date | string <date> 開始日で絞り込み(YYYY-MM-DD形式、purchase_date >= start_date) |
| end_date | string <date> 終了日で絞り込み(YYYY-MM-DD形式、purchase_date <= end_date) |
| include_deleted | boolean 削除済みデータも含める(デフォルト: false)。 差分同期用途では start_updated_at と併用することを推奨します。 取得範囲(入庫明細は親 Purchase と明細 PurchaseItem の2段階フィルタを持つ):
受理される値:
|
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値、指定日時を含む) |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at < 指定値、指定日時は含まない)。 半開区間 [start_updated_at, end_updated_at) で範囲指定します。 差分同期の推奨: 次回リクエストの start_updated_at に前回の end_updated_at と同じ値を指定すれば、レコードが重複しません。 |
{- "data": [
- {
- "id": 0,
- "purchase_id": 0,
- "inventory_id": 0,
- "title": "string",
- "quantity": "string",
- "unit": "string",
- "unit_price": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "subtotal_amount": "string",
- "status": "none",
- "purchase_date": "2025-01-15",
- "estimated_purchase_date": "2025-01-20",
- "etc": "string",
- "created_at": "2025-01-01T00:00:00.000+09:00",
- "updated_at": "2025-01-01T00:00:00.000+09:00",
- "deleted": true,
- "variants": [
- {
- "data_key": "string",
- "quantity": "string",
- "unit_price": "string",
- "amount": "string",
- "unit_snapshot": {
- "factor": "string",
- "piece_name": "string",
- "box_name": "string"
}, - "box_quantity": "string",
- "box_unit": "string",
- "items": [
- {
- "variant_setting_item_id": 0,
- "label": "string",
- "value": "string"
}
]
}
]
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}入庫物品削除
指定されたIDの入庫物品(明細)を取消します。 入庫済みの物品の場合、在庫数量が戻されます。 全ての明細が削除された場合、親の入庫データも論理削除されます。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 入庫物品ID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}発注一覧取得
指定した会社の発注一覧を取得します。
| company_id required | integer <int32> 会社ID |
| keyword | string キーワード検索 |
| statuses | Array of strings ステータスフィルター |
| start_date | string <date> 発注日の開始日(YYYY-MM-DD) |
| end_date | string <date> 発注日の終了日(YYYY-MM-DD) |
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値) |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at <= 指定値) |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 20、最大: 50) |
{- "data": [
- {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "supplier": {
- "name": "株式会社サプライヤー",
- "name_postfix": "御中"
}, - "items_count": 3
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}発注作成
新しい発注を作成します。
| company_id required | integer <int32> 会社ID |
発注作成リクエスト
| ordered_at | string <date-time> 発注日(省略時は現在日時) |
| order_number | string 発注番号(50 文字まで) |
| request_delivery_date | string <date> 希望納期 |
| estimated_delivery_date | string <date> 納品予定日 |
| note | string 備考 |
required | object 仕入先情報(必須) |
object 発注元情報 | |
object 配送指示情報 | |
required | Array of objects (PurchaseOrderItemRequest) non-empty 発注明細(1件以上必須) |
{- "ordered_at": "2019-08-24T14:15:22Z",
- "order_number": "string",
- "request_delivery_date": "2019-08-24",
- "estimated_delivery_date": "2019-08-24",
- "note": "string",
- "supplier": {
- "name": "string",
- "name_postfix": "string",
- "customer_id": 0,
- "zip": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "email": "string"
}, - "buyer": {
- "name": "string",
- "name_postfix": "string",
- "customer_id": 0,
- "contact_person": "string",
- "zip": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "email": "string"
}, - "shipping_instruction": {
- "to_name": "string",
- "to_name_postfix": "string",
- "to_zip": "string",
- "to_phone_number": "string",
- "to_address": "string",
- "to_building_name": "string",
- "comment": "string"
}, - "purchase_order_items": [
- {
- "inventory_id": 0,
- "item_title": "string",
- "quantity": 0.1,
- "unit_price": 0.1,
- "unit_name": "string",
- "quantity_per_package": 0.1,
- "request_delivery_date": "2019-08-24",
- "note": "string"
}
]
}{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}発注詳細取得
指定した発注の詳細を取得します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 発注ID |
{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}発注更新
既存の発注を更新します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 発注ID |
発注更新リクエスト
| ordered_at | string <date-time> 発注日 |
| order_number | string 発注番号(50 文字まで) |
| request_delivery_date | string <date> 希望納期 |
| estimated_delivery_date | string <date> 納品予定日 |
| note | string 備考 |
object 仕入先情報 | |
object 発注元情報 | |
object 配送指示情報(送らなければ配送先は変わらない。空のオブジェクト {} を送ると配送先が外れる) | |
Array of objects (PurchaseOrderItemRequest) 発注明細 |
{- "ordered_at": "2019-08-24T14:15:22Z",
- "order_number": "string",
- "request_delivery_date": "2019-08-24",
- "estimated_delivery_date": "2019-08-24",
- "note": "string",
- "supplier": {
- "name": "string",
- "name_postfix": "string",
- "customer_id": 0,
- "zip": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "email": "string"
}, - "buyer": {
- "name": "string",
- "name_postfix": "string",
- "customer_id": 0,
- "contact_person": "string",
- "zip": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "email": "string"
}, - "shipping_instruction": {
- "to_name": "string",
- "to_name_postfix": "string",
- "to_zip": "string",
- "to_phone_number": "string",
- "to_address": "string",
- "to_building_name": "string",
- "comment": "string"
}, - "purchase_order_items": [
- {
- "inventory_id": 0,
- "item_title": "string",
- "quantity": 0.1,
- "unit_price": 0.1,
- "unit_name": "string",
- "quantity_per_package": 0.1,
- "request_delivery_date": "2019-08-24",
- "note": "string"
}
]
}{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}発注受領
発注を受領します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 発注ID |
発注受領リクエスト
| estimated_delivery_date | string <date> 納品予定日 |
{- "estimated_delivery_date": "2019-08-24"
}{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}発注キャンセル
発注をキャンセルします。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 発注ID |
発注キャンセルリクエスト
| cancel_reason | string キャンセル理由 |
{- "cancel_reason": "string"
}{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}発注完了
発注を完了します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 発注ID |
{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}発注送信
発注を仕入先に送信します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 発注ID |
{- "data": {
- "id": 1,
- "order_number": "PO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "tax_rate": "10.0",
- "cancel_reason": "仕入先都合によるキャンセル",
- "memo": "社内用メモ",
- "submitted_at": "2026-03-11T09:00:00.000+09:00",
- "accepted_at": "2026-03-12T10:00:00.000+09:00",
- "completed_at": "2026-03-20T15:00:00.000+09:00",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "inventory_id": 10,
- "item_title": "部品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "note": "急ぎでお願いします"
}
], - "supplier": {
- "customer_id": 1,
- "name": "株式会社サプライヤー",
- "name_postfix": "御中",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "サプライヤービル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "supplier@example.com"
}, - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "zip": "150-0001",
- "address": "東京都渋谷区渋谷1-1",
- "building_name": "テストビル5F",
- "phone_number": "03-9876-5432",
- "fax_number": "03-9876-5433",
- "email": "buyer@example.com",
- "contact_person": "山田太郎"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}受注一覧取得
指定した会社の受注一覧を取得します。
| company_id required | integer <int32> 会社ID |
| keyword | string キーワード検索 |
| transaction_type | string 取引区分フィルター |
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、ISO8601形式、updated_at >= 指定値) |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、ISO8601形式、updated_at <= 指定値) |
| include_deleted | boolean 論理削除済みの受注も含める(デフォルト: false。未指定のときは削除済みを返さない) |
| statuses[] | Array of strings (SalesOrderStatus) Items Enum: "unconfirmed" "confirmed" "completed" "cancelled" ステータスで絞り込む(複数指定可、OR 条件。?statuses[]=confirmed&statuses[]=completed 形式)。 省略するとすべてのステータスを返す。列挙型に無い値・空の値を指定すると 400 を返す |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 20、最大: 50) |
{- "data": [
- {
- "id": 1,
- "order_number": "SO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "estimated_delivery_date": "2026-03-20",
- "request_delivery_date": "2026-03-25",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "deleted": false,
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "packing_slips": [
- {
- "id": 1,
- "num": "PS-2026-001",
- "status": "before_delivery",
- "deleted": false
}
], - "buyer": {
- "name": "株式会社テスト",
- "name_postfix": "御中"
}
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}受注作成
新しい受注を作成します。
| company_id required | integer <int32> 会社ID |
受注作成リクエスト
| order_number | string 受注番号(50 文字まで) |
| ordered_at | string <date-time> 受注日 |
| transaction_type | string Enum: "internal" "external" 取引区分 |
| estimated_delivery_date | string <date> 希望納期 |
| request_delivery_date | string <date> 依頼納期 |
| note | string 備考 |
| reject_duplicate_order_number | boolean true のとき、同じ拠点に同じ受注番号の有効な受注(削除済み・キャンセル済みを除く)があれば、受注を作らずに 409 を返します。 409 の本文の sales_order_id に、すでに登録されている受注の ID(複数あれば最小の ID)が入ります。 受注番号は送られた値のまま比べます(末尾の空白や大文字・小文字が違えば別の受注番号です)。 受注番号を省略して自動で採番するときは調べません。省略時は false です。 判定は入力の必須項目の検証の後、商品マスタの存在確認や受注の保存の前に行います。必須項目の誤りは 400 が優先し、それより後で見つかる誤り(存在しない商品マスタなど)は 409 が優先します。 |
required | object 発注元情報 |
object 出荷先情報 | |
required | Array of objects (SalesOrderItemRequest) non-empty 受注明細(1件以上必須) |
{- "order_number": "string",
- "ordered_at": "2019-08-24T14:15:22Z",
- "transaction_type": "internal",
- "estimated_delivery_date": "2019-08-24",
- "request_delivery_date": "2019-08-24",
- "note": "string",
- "reject_duplicate_order_number": true,
- "buyer": {
- "name": "string",
- "name_postfix": "string",
- "customer_id": 0,
- "contact_person": "string",
- "zip": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "email": "string"
}, - "shipping_instruction": {
- "to_name": "string",
- "to_name_postfix": "string",
- "to_zip": "string",
- "to_phone_number": "string",
- "to_address": "string",
- "to_building_name": "string",
- "comment": "string"
}, - "sales_order_items": [
- {
- "id": 0,
- "sales_item_master_id": 0,
- "item_title": "string",
- "quantity": 0.1,
- "unit_price": 0.1,
- "unit_name": "string",
- "quantity_per_package": 0.1,
- "request_delivery_date": "2019-08-24",
- "estimated_delivery_date": "2019-08-24",
- "note": "string"
}
]
}{- "data": {
- "id": 1,
- "order_number": "SO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "estimated_delivery_date": "2026-03-20",
- "request_delivery_date": "2026-03-25",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "deleted": false,
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "packing_slips": [
- {
- "id": 1,
- "num": "PS-2026-001",
- "status": "before_delivery",
- "deleted": false
}
], - "tax_rate": "10.0",
- "cancel_reason": "顧客都合によるキャンセル",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "sales_item_master_id": 10,
- "item_title": "商品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "note": "急ぎでお願いします"
}
], - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "contact_person": "山田太郎",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "テストビル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "buyer@example.com"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}受注詳細取得
指定した受注の詳細を取得します。 削除済み(論理削除)の受注は include_deleted=true のときだけ返し、それ以外は 404 を返します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 受注ID |
| include_deleted | boolean 削除済みの受注も返す(デフォルト: false)。 受理される値:
|
{- "data": {
- "id": 1,
- "order_number": "SO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "estimated_delivery_date": "2026-03-20",
- "request_delivery_date": "2026-03-25",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "deleted": false,
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "packing_slips": [
- {
- "id": 1,
- "num": "PS-2026-001",
- "status": "before_delivery",
- "deleted": false
}
], - "tax_rate": "10.0",
- "cancel_reason": "顧客都合によるキャンセル",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "sales_item_master_id": 10,
- "item_title": "商品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "note": "急ぎでお願いします"
}
], - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "contact_person": "山田太郎",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "テストビル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "buyer@example.com"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}受注更新
既存の受注を更新します。 削除済み(論理削除)の受注は 404 を返します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 受注ID |
受注更新リクエスト
| order_number | string 受注番号(50 文字まで) |
| ordered_at | string <date-time> 受注日 |
| transaction_type | string Enum: "internal" "external" 取引区分 |
| estimated_delivery_date | string <date> 希望納期 |
| request_delivery_date | string <date> 依頼納期 |
| note | string 備考 |
object 発注元情報 | |
object 出荷先情報 | |
Array of objects (SalesOrderItemRequest) 受注明細 |
{- "order_number": "string",
- "ordered_at": "2019-08-24T14:15:22Z",
- "transaction_type": "internal",
- "estimated_delivery_date": "2019-08-24",
- "request_delivery_date": "2019-08-24",
- "note": "string",
- "buyer": {
- "name": "string",
- "name_postfix": "string",
- "customer_id": 0,
- "contact_person": "string",
- "zip": "string",
- "address": "string",
- "building_name": "string",
- "phone_number": "string",
- "fax_number": "string",
- "email": "string"
}, - "shipping_instruction": {
- "to_name": "string",
- "to_name_postfix": "string",
- "to_zip": "string",
- "to_phone_number": "string",
- "to_address": "string",
- "to_building_name": "string",
- "comment": "string"
}, - "sales_order_items": [
- {
- "id": 0,
- "sales_item_master_id": 0,
- "item_title": "string",
- "quantity": 0.1,
- "unit_price": 0.1,
- "unit_name": "string",
- "quantity_per_package": 0.1,
- "request_delivery_date": "2019-08-24",
- "estimated_delivery_date": "2019-08-24",
- "note": "string"
}
]
}{- "data": {
- "id": 1,
- "order_number": "SO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "estimated_delivery_date": "2026-03-20",
- "request_delivery_date": "2026-03-25",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "deleted": false,
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "packing_slips": [
- {
- "id": 1,
- "num": "PS-2026-001",
- "status": "before_delivery",
- "deleted": false
}
], - "tax_rate": "10.0",
- "cancel_reason": "顧客都合によるキャンセル",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "sales_item_master_id": 10,
- "item_title": "商品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "note": "急ぎでお願いします"
}
], - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "contact_person": "山田太郎",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "テストビル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "buyer@example.com"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}受注キャンセル
受注をキャンセルします。 削除済み(論理削除)の受注は 404 を返します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 受注ID |
受注キャンセルリクエスト
| cancel_reason required | string <= 1000 characters キャンセル理由(必須) |
{- "cancel_reason": "string"
}{- "data": {
- "id": 1,
- "order_number": "SO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "estimated_delivery_date": "2026-03-20",
- "request_delivery_date": "2026-03-25",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "deleted": false,
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "packing_slips": [
- {
- "id": 1,
- "num": "PS-2026-001",
- "status": "before_delivery",
- "deleted": false
}
], - "tax_rate": "10.0",
- "cancel_reason": "顧客都合によるキャンセル",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "sales_item_master_id": 10,
- "item_title": "商品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "note": "急ぎでお願いします"
}
], - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "contact_person": "山田太郎",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "テストビル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "buyer@example.com"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}受注確定
受注を確定します。 削除済み(論理削除)の受注は 404 を返します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 受注ID |
受注確定リクエスト
| agree_warning | boolean 上限超過時の警告同意フラグ |
{- "agree_warning": true
}{- "data": {
- "id": 1,
- "order_number": "SO-2026-001",
- "status": "unconfirmed",
- "transaction_type": "external",
- "ordered_at": "2026-03-10T00:00:00.000+09:00",
- "estimated_delivery_date": "2026-03-20",
- "request_delivery_date": "2026-03-25",
- "subtotal": "10000.0",
- "tax": "1000.0",
- "total": "11000.0",
- "note": "納期厳守でお願いします",
- "deleted": false,
- "created_at": "2026-03-10T10:00:00.000+09:00",
- "updated_at": "2026-03-10T10:00:00.000+09:00",
- "packing_slips": [
- {
- "id": 1,
- "num": "PS-2026-001",
- "status": "before_delivery",
- "deleted": false
}
], - "tax_rate": "10.0",
- "cancel_reason": "顧客都合によるキャンセル",
- "cancelled_at": "2026-03-15T14:00:00.000+09:00",
- "items": [
- {
- "id": 1,
- "sales_item_master_id": 10,
- "item_title": "商品A",
- "quantity": "5",
- "unit_price": "2000",
- "subtotal": "10000",
- "unit_name": "個",
- "quantity_per_package": "1",
- "request_delivery_date": "2026-03-25",
- "estimated_delivery_date": "2026-03-20",
- "note": "急ぎでお願いします"
}
], - "buyer": {
- "customer_id": 1,
- "name": "株式会社テスト",
- "name_postfix": "御中",
- "contact_person": "山田太郎",
- "zip": "100-0001",
- "address": "東京都千代田区千代田1-1",
- "building_name": "テストビル3F",
- "phone_number": "03-1234-5678",
- "fax_number": "03-1234-5679",
- "email": "buyer@example.com"
}, - "shipping_instruction": {
- "to_name": "株式会社配送先",
- "to_name_postfix": "御中",
- "to_zip": "150-0001",
- "to_phone_number": "03-9876-5432",
- "to_address": "東京都渋谷区渋谷1-1",
- "to_building_name": "渋谷ビル5F",
- "comment": "午前中指定でお願いします"
}
}
}商品マスタ一覧取得
指定した会社の商品マスタ一覧を取得します。 商品コードの完全一致で複数の商品マスタを引くときは、商品マスタ検索(POST /sales_item_masters/search.json)を使ってください。
| company_id required | integer <int32> 会社ID |
| item_code | string 商品コード(部分一致検索) |
| title | string 商品名(部分一致検索) |
| sort_by | string ソート対象(id, item_code, title, created_at, updated_at) |
| sort_order | string ソート順序(asc, desc) |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 20、最大: 50) |
| start_updated_at | string <date-time> レコード更新日時の下限(差分同期用、オフセット付きの ISO8601 形式(例: 2026-12-01T00:00:00+09:00)、updated_at >= 指定値、指定日時を含む)。 オフセットの無い値は 400 になります。クエリ文字列では + を %2B にエンコードするか、UTC(Z)で指定してください。 updated_at が進むのは、商品マスタの作成と、商品マスタ自身の項目(商品コード・商品名・単位・入数・説明・金額・サムネイル・追加項目)の値が変わる更新です。 セット(在庫の割り当て)の作成・更新・削除、関連する在庫(inventory_id)だけの変更、関連する在庫そのもの(在庫名・数量・保管場所など)の変更、値の変わらない更新では進みません。 セットの変更は差分同期では取得できないため、この一覧とは別に、セット検索(POST /sales_item_sets/search.json。商品マスタ ID を 1 回に 100 件まで指定)で取得し、前回の結果と突き合わせてください。在庫の数量などは在庫の API で取得してください。 削除した商品マスタは返らないため、削除は全件との突き合わせで検知してください。 |
| end_updated_at | string <date-time> レコード更新日時の上限(差分同期用、オフセット付きの ISO8601 形式、updated_at < 指定値、指定日時は含まない)。 クエリ文字列では + を %2B にエンコードするか、UTC(Z)で指定してください。 半開区間 [start_updated_at, end_updated_at) で範囲指定します。 差分同期の推奨: 次回リクエストの start_updated_at に前回の end_updated_at と同じ値を指定すれば、レコードが重複しません。 |
{- "data": [
- {
- "id": 1,
- "item_code": "ITEM-001",
- "title": "商品A",
- "unit_id": 1,
- "quantity_per_package": "1",
- "price": "1000",
- "description": "商品Aの説明",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00",
- "inventory": {
- "id": 100,
- "title": "在庫A",
- "quantity": "1000",
- "logical_quantity": "900"
}
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}商品マスタ作成
新しい商品マスタを作成します。
| company_id required | integer <int32> 会社ID |
商品マスタ作成リクエスト
| item_code required | string 商品コード(会社内で一意) |
| title required | string 商品名 |
| unit_id required | integer <int32> 単位ID |
| quantity_per_package required | number <double> 入数 |
| inventory_id required | integer <int32> 在庫ID。 作成のときにセットを 1 つ(名前は商品名)作り、この在庫を必要数 1 で割り当てます。 |
| price | number <double> 金額 |
| description | string 商品説明 |
{- "item_code": "string",
- "title": "string",
- "unit_id": 0,
- "quantity_per_package": 0.1,
- "inventory_id": 0,
- "price": 0.1,
- "description": "string"
}{- "data": {
- "id": 1,
- "item_code": "ITEM-001",
- "title": "商品A",
- "unit_id": 1,
- "quantity_per_package": "1",
- "price": "1000",
- "description": "商品Aの説明",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00",
- "inventory": {
- "id": 100,
- "title": "在庫A",
- "quantity": "1000",
- "logical_quantity": "900"
}
}
}商品マスタ検索(商品コードの完全一致)
指定した商品コードのどれかと完全一致する、指定した会社の商品マスタを取得します。受注の商品番号などから商品マスタ(の ID)を引く用途です。 商品コードは本文で最大 100 件まで送れます。受け付ける条件は item_codes とページ送り(page・per_page)だけで、ほかの項目は無視します。 並び順は商品マスタ ID の昇順です。削除済みの商品マスタは返しません。該当が 1 ページの件数を超えると次のページに続くので、件数は pagination.total_count で確かめてください。
| company_id required | integer <int32> 会社ID |
検索条件
| item_codes required | Array of strings [ 1 .. 100 ] items 商品コード(完全一致。1〜100 件。どれかと一致する商品マスタを返す)。 大文字と小文字、末尾の空白も区別する(ABC を指定しても abc と「ABC 」(末尾に空白)は返さない)。 同じ商品コードを重ねて指定しても 1 つとして扱う(件数は重ねた分も数える)。該当する商品マスタが無い商品コードは無視し、どれも該当しなければ空の一覧を返す。 空文字の要素を含むときは 400 を返す。空白だけの要素は 400 にせず、該当なしとして扱う。 全角と半角、先頭の空白も区別する(ABC や「 ABC」(先頭に空白)を指定しても ABC は返さない)。 末尾の空白だけが違う商品コード(ABC と「ABC 」)は、商品マスタの作成・更新では重複として 400 になるが、この検索では返らない |
| page | integer <int32> ページ番号(デフォルト: 1) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 20) |
{- "item_codes": [
- "string"
], - "page": 0,
- "per_page": 0
}{- "data": [
- {
- "id": 1,
- "item_code": "ITEM-001",
- "title": "商品A",
- "unit_id": 1,
- "quantity_per_package": "1",
- "price": "1000",
- "description": "商品Aの説明",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00",
- "inventory": {
- "id": 100,
- "title": "在庫A",
- "quantity": "1000",
- "logical_quantity": "900"
}
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}商品マスタ詳細取得
指定した商品マスタの詳細を取得します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 商品マスタID |
{- "data": {
- "id": 1,
- "item_code": "ITEM-001",
- "title": "商品A",
- "unit_id": 1,
- "quantity_per_package": "1",
- "price": "1000",
- "description": "商品Aの説明",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00",
- "inventory": {
- "id": 100,
- "title": "在庫A",
- "quantity": "1000",
- "logical_quantity": "900"
}
}
}商品マスタ更新
既存の商品マスタを更新します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 商品マスタID |
商品マスタ更新リクエスト
| item_code | string 商品コード |
| title | string 商品名 |
| unit_id | integer <int32> 単位ID |
| quantity_per_package | number <double> 入数 |
| inventory_id | integer <int32> 在庫ID。 削除されていないセットを表示順(display_order)→ ID の昇順に並べた先頭のセット(受注の確定で出庫されるのと同じセット)の、 登録順が最初の構成の在庫をこの在庫に変えます(そのセットに構成が無ければ構成を足します)。ほかのセット・構成は変えません。 登録順が最初の構成は、在庫が削除済みでも対象です。その場合は、取得の inventory(削除されていない在庫の構成)とは別の構成が変わります。 削除されていないセットが無いときは、この在庫だけを必要数 1 で割り当てたセットを新しく作ります。 |
| price | number <double> 金額 |
| description | string 商品説明 |
| remove_thumbnail | boolean サムネイル削除フラグ |
{- "item_code": "string",
- "title": "string",
- "unit_id": 0,
- "quantity_per_package": 0.1,
- "inventory_id": 0,
- "price": 0.1,
- "description": "string",
- "remove_thumbnail": true
}{- "data": {
- "id": 1,
- "item_code": "ITEM-001",
- "title": "商品A",
- "unit_id": 1,
- "quantity_per_package": "1",
- "price": "1000",
- "description": "商品Aの説明",
- "created_at": "2026-01-01T00:00:00.000+09:00",
- "updated_at": "2026-01-01T00:00:00.000+09:00",
- "inventory": {
- "id": 100,
- "title": "在庫A",
- "quantity": "1000",
- "logical_quantity": "900"
}
}
}商品マスタ削除
商品マスタを論理削除します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> 商品マスタID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}商品マスタのセット追加
商品マスタにセット(在庫の割り当て)を追加します。 同じ組み合わせのセットや、同じ在庫で必要数が違うセットは、その商品マスタの既存のセットと合わせて検証します。
| company_id required | integer <int32> 会社ID |
セット追加リクエスト
| sales_item_master_id required | integer <int32> 商品マスタID |
| name | string セットの名前(255 文字まで。省略時・空文字のときは商品名) |
| display_order | integer <int32> 表示順(0 以上。省略時は、削除済みのセットを含めたその商品マスタの最大値 + 1) |
required | Array of objects (SalesItemSetInventoryRequest) [ 1 .. 100 ] items 割り当てる在庫(1〜100 件) |
{- "sales_item_master_id": 0,
- "name": "string",
- "display_order": 0,
- "inventories": [
- {
- "inventory_id": 0,
- "quantity": 0.1
}
]
}{- "data": {
- "id": 10,
- "sales_item_master_id": 1,
- "name": "商品A",
- "display_order": 0,
- "inventories": [
- {
- "inventory_id": 100,
- "title": "在庫A",
- "quantity": "1"
}
], - "stock_equivalent_quantity": "4"
}
}商品マスタのセット検索
指定した商品マスタのセット(在庫の割り当て)を取得します。並び順は商品マスタID → 表示順 → セットIDの昇順です。
| company_id required | integer <int32> 会社ID |
検索条件
| sales_item_master_ids required | Array of integers <int32> [ 1 .. 100 ] items [ items <int32 > ] 商品マスタID(1〜100 件)。存在しない・ほかの拠点・削除済みの商品マスタのIDは無視します。重複したIDは 1 つとして扱います |
| page | integer <int32> ページ番号(デフォルト: 1。範囲外の値は 1〜100 に丸めます) |
| per_page | integer <int32> 1ページあたりの件数(デフォルト: 100、最大: 100。範囲外の値は 1〜100 に丸めます) |
{- "sales_item_master_ids": [
- 0
], - "page": 0,
- "per_page": 0
}{- "data": [
- {
- "id": 10,
- "sales_item_master_id": 1,
- "name": "商品A",
- "display_order": 0,
- "inventories": [
- {
- "inventory_id": 100,
- "title": "在庫A",
- "quantity": "1"
}
], - "stock_equivalent_quantity": "4"
}
], - "pagination": {
- "current_page": 1,
- "per_page": 20,
- "total_count": 5,
- "total_pages": 1
}
}商品マスタのセット詳細取得
指定したセットを取得します。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> セットID |
{- "data": {
- "id": 10,
- "sales_item_master_id": 1,
- "name": "商品A",
- "display_order": 0,
- "inventories": [
- {
- "inventory_id": 100,
- "title": "在庫A",
- "quantity": "1"
}
], - "stock_equivalent_quantity": "4"
}
}商品マスタのセット更新
指定したセットを更新します。inventories を指定すると、このセットの在庫を置き換えます(ほかのセットは変更しません)。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> セットID |
セット更新リクエスト
| name | string セットの名前(255 文字まで。空文字は 400) |
| display_order | integer <int32> 表示順(0 以上) |
Array of objects (SalesItemSetInventoryRequest) [ 1 .. 100 ] items 割り当てる在庫(1〜100 件)。指定するとこのセットの在庫を置き換えます |
{- "name": "string",
- "display_order": 0,
- "inventories": [
- {
- "inventory_id": 0,
- "quantity": 0.1
}
]
}{- "data": {
- "id": 10,
- "sales_item_master_id": 1,
- "name": "商品A",
- "display_order": 0,
- "inventories": [
- {
- "inventory_id": 100,
- "title": "在庫A",
- "quantity": "1"
}
], - "stock_equivalent_quantity": "4"
}
}商品マスタのセット削除
指定したセットを削除します。商品マスタの最後のセットは削除できません。
| company_id required | integer <int32> 会社ID |
| id required | integer <int32> セットID |
{- "title": "Unauthorized",
- "status": 401,
- "detail": "トークンが無効または未指定です"
}zaico のデータが変わったときに、あらかじめ設定した通知先 URL へ HTTP リクエストで通知します。通知するイベントは次の 4 つです。通知する条件とペイロードは、このグループの各イベントを参照してください。
changed_quantity): 在庫データの数量が変わったときchanged_inventory): 在庫データの項目が変わったときchanged_purchase_status): 入庫データのステータスが変わったときchanged_packing_slip_status): 出庫データのステータスが変わったときWeb版 zaico の「設定」→「環境設定」→「利用機能設定」にある Webhook から設定画面を開き、イベントごとに通知の有効・無効と通知先 URL を設定します。設定は拠点ごとに行い、管理者だけが変更できます。手順は、ヘルプ記事「Webhook機能の使い方」を参照してください。
通知が zaico から送られたものかどうかは、リクエストヘッダー x-zaico-signature-256 で検証できます。値は、sha256= に続けて、リクエストボディをシークレットトークンで HMAC-SHA256 した結果を 16 進数で表したものです。シークレットトークンは Webhook の設定画面で確認できます。
受け取ったリクエストボディ(パースする前の文字列)から同じ方法で計算し、ヘッダーの値と一致することを確かめてください。Ruby の例:
def verify_signature(payload_body)
signature = 'sha256=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), ENV['SECRET_TOKEN'], payload_body)
return halt 500, "Invalid signature" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_ZAICO_SIGNATURE_256'])
end
zaico は送信元の IP アドレスを公開していません。送信元の検証にはこのヘッダーを使ってください。
シークレットトークンは Webhook の設定画面で再生成できます。再生成した後に発生したイベントの通知は、新しいシークレットトークンで署名されます。再生成の時点で送信中・再送中だった通知は、再生成する前のシークレットトークンで署名されたまま届きます。稼働中の受け口でシークレットトークンを再生成する場合は、しばらくの間、再生成する前のシークレットトークンでも検証することをおすすめします。
通知を受け取れたかどうかは、レスポンスのステータスコードで判断します。
| ステータスコード | 扱い |
|---|---|
| 2xx | 成功 |
| それ以外 | 失敗(再送します) |
処理する必要のない通知を受け取った場合も、2xx を返してください。2xx 以外を返すと再送されます。
リダイレクト(3xx)を返した場合は転送先へリクエストし直し、転送先のステータスコードで判断します。リダイレクトの種類によってはペイロードが転送先へ送られないため、通知先 URL にはリダイレクトを返さない URL を設定してください。
同じ通知が 2 回以上届くことがあります。通知を受け取ったときの処理は、同じ通知を繰り返し受け取っても結果が変わらないようにしてください。同じ通知は、リクエストヘッダー x-zaico-request-id の値が同じです。
通知は POST で送られ、次のヘッダーが付きます。
| ヘッダー | 値 |
|---|---|
user-agent |
ZaicoWebhook/1.0 |
content-type |
application/json |
x-zaico-company-id |
拠点 ID。公開API v2 のパスの company_id と同じ値です。例: 123456 |
x-zaico-event |
イベントの種別。例: changed_quantity |
x-zaico-request-id |
通知ごとの ID(UUID)。再送でも同じ値が送られます。例: 432dc9c5-7d14-49e7-8199-05c2a76fddd3 |
x-zaico-signature-256 |
sha256= に続けて、リクエストボディをシークレットトークンで HMAC-SHA256 した結果を 16 進数で表したもの。例: sha256=43bb5cf48442edfd14d6d97fa81cb563569e4992666bf75730334477f473e5ff |
ヘッダー名は、大文字と小文字を区別せずに読んでください。通信の方式によって、X-Zaico-Event のように先頭が大文字で届くことがあります。
http または https です。localhost、名前解決できないホスト、内部のアドレスに解決されるホストは指定できません。在庫データの数量が変わったときに通知します。x-zaico-event ヘッダーの値は changed_quantity です。
通知するのは、登録済みの在庫データの数量が変わったときです。在庫データを新しく作成したときは通知しません。
required | object 数量が変わった在庫データ |
{- "inventory": {
- "id": 49375,
- "code": "1413790e-fc3c-4fa7-aed4-6b6eed9a6e03",
- "title": "ボルト M8",
- "quantity": "150.0",
- "updated_at": "2021-10-02T22:44:15+09:00"
}
}在庫データの項目が変わったときに通知します。x-zaico-event ヘッダーの値は changed_inventory です。
通知するのは、登録済みの在庫データで、追加項目か下の表の項目のいずれかが変わったときです。次の場合は通知しません。
changed_attributes には、変わった項目に対応する下の表の値が入ります。追加項目が変わった場合は、changed_optional_attributes に追加項目の名前が入ります(changed_attributes には入りません)。
changed_attributes の値 |
項目 |
|---|---|
title |
物品名 |
quantity |
数量 |
category |
カテゴリ |
state |
状態 |
code |
コード(QRコード・バーコードの値) |
etc |
備考 |
group_tag |
グループタグ |
place |
保管場所 |
unit |
単位 |
is_quantity_auto_conversion_by_unit |
単位換算有効 |
quantity_auto_conversion_by_unit_name |
単位換算単位名 |
quantity_auto_conversion_by_unit_factor |
単位換算係数 |
user_group |
ユーザーグループ |
通知の対象になる項目は予告なく増えることがあります。この表に無い値が入っていても処理できるようにしてください。
| inventory_id required | integer <int32> 在庫ID |
| changed_attributes required | Array of strings 変更された標準の項目の名前。入りうる値はイベントの説明を参照 |
| changed_optional_attributes required | Array of strings 変更された追加項目の名前 |
| updated_at required | string <date-time> 更新日時(ISO 8601形式。マイクロ秒まで) |
{- "inventory_id": 123,
- "changed_attributes": [
- "title",
- "quantity"
], - "changed_optional_attributes": [
- "納品単価",
- "型式"
], - "updated_at": "2024-11-08T16:26:54.493728+09:00"
}入庫データのステータスが変わったときに通知します。入庫データを新しく作成したときも通知します。x-zaico-event ヘッダーの値は changed_purchase_status です。
GET /api/v2/orgs/companies/{company_id}/purchases/{id}.json)で取得してください。パスの company_id には x-zaico-company-id ヘッダーの値を、id にはペイロードの purchase.id を指定します。purchased になりません。このため、一部の明細だけが入庫済みになっても、通知されないことがあります。required | object ステータスが変わった入庫データ(明細は含まない) |
{- "purchase": {
- "id": 210948,
- "num": "119",
- "customer_name": "株式会社サンプル商事",
- "create_user_name": "山田 太郎",
- "issue_date": null,
- "purchase_date": null,
- "status": "ordered",
- "etc": "発注書の備考",
- "created_at": "2024-06-03T10:58:46+09:00",
- "updated_at": "2024-06-04T15:49:02+09:00",
- "earliest_estimated_purchase_date": "2024-06-08T00:00:00+09:00",
- "memo": "入庫メモ",
- "user_group": "基本グループ,管理者"
}
}出庫データのステータスが変わったときに通知します。出庫データを新しく作成したときも通知します。x-zaico-event ヘッダーの値は changed_packing_slip_status です。
GET /api/v2/orgs/companies/{company_id}/packing_slips/{id}.json)で取得してください。パスの company_id には x-zaico-company-id ヘッダーの値を、id にはペイロードの packing_slip.id を指定します。completed_delivery になりません。このため、一部の明細だけが出庫済みになっても、通知されないことがあります。required | object ステータスが変わった出庫データ(明細は含まない) |
{- "packing_slip": {
- "id": 210472,
- "created_at": "2024-05-28T15:07:38+09:00",
- "updated_at": "2024-06-04T15:50:26+09:00",
- "date_of_issue": null,
- "create_user_name": "山田 太郎",
- "customer_name": "株式会社サンプル商事",
- "customer_name_postfix": null,
- "num": "256",
- "delivery_date": "2024-06-04T00:00:00+09:00",
- "status": "completed_delivery",
- "earliest_estimated_delivery_date": null,
- "memo": "出庫メモ",
- "note": "納品書の備考",
- "user_group": "基本グループ,管理者",
- "sales_order_id": 1234
}
}