勘定科目(Accounts)
勘定科目の作成・更新・削除と、初期データの一括投入を行います。
|
エンドポイント
| GET | /api/v1/accounting/accounts | 勘定科目一覧を取得 |
| POST | /api/v1/accounting/accounts | 勘定科目を作成 |
| PATCH | /api/v1/accounting/accounts/{id} | 勘定科目を更新 |
| DELETE | /api/v1/accounting/accounts/{id} | 勘定科目を削除 |
| POST | /api/v1/accounting/accounts/seed | 勘定科目を一括投入 |
GET
/api/v1/accounting/accounts勘定科目一覧を取得
認証が必要です— セッション Cookie または Bearer トークンを含めてください
クエリパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
search | string | 任意 | 科目名・科目コードで検索 |
account_type | string | 任意 | 科目区分で絞り込み(asset / liability / equity / revenue / expense) |
limit | integer | 任意 | 取得件数(デフォルト: 100, 最大: 500) |
offset | integer | 任意 | 取得開始位置(デフォルト: 0) |
コード例
curl "https://api.blueai.jp/api/v1/accounting/accounts" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/accounting/accounts勘定科目を作成
認証が必要です— セッション Cookie または Bearer トークンを含めてください
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
code | string | 必須 | 科目コード |
name | string | 必須 | 科目名 |
account_type | string | 必須 | 科目区分(asset / liability / equity / revenue / expense) |
parent_id | string | 任意 | 親科目 ID |
description | string | 任意 | 説明 |
tax_category | string | 任意 | 税区分 |
コード例
curl -X POST "https://api.blueai.jp/api/v1/accounting/accounts" \
-H "Cookie: better-auth.session_token=<token>"PATCH
/api/v1/accounting/accounts/{id}勘定科目を更新
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | 勘定科目 ID |
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
code | string | 任意 | 科目コード |
name | string | 任意 | 科目名 |
account_type | string | 任意 | 科目区分(asset / liability / equity / revenue / expense) |
parent_id | string | 任意 | 親科目 ID |
description | string | 任意 | 説明 |
tax_category | string | 任意 | 税区分 |
コード例
curl -X PATCH "https://api.blueai.jp/api/v1/accounting/accounts/acc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"DELETE
/api/v1/accounting/accounts/{id}勘定科目を削除
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | 勘定科目 ID |
コード例
curl -X DELETE "https://api.blueai.jp/api/v1/accounting/accounts/acc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/accounting/accounts/seed勘定科目を一括投入
日本の標準的な勘定科目体系を一括で作成します。初回セットアップ時に使用します。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
コード例
curl -X POST "https://api.blueai.jp/api/v1/accounting/accounts/seed" \
-H "Cookie: better-auth.session_token=<token>"