証憑(Documents)
証憑(領収書・請求書等の原本)の登録・管理と、仕訳への紐付けを行います。
|
エンドポイント
| GET | /api/v1/accounting/documents | 証憑一覧を取得 |
| POST | /api/v1/accounting/documents | 証憑を登録 |
| GET | /api/v1/accounting/documents/{id} | 証憑を取得 |
| PATCH | /api/v1/accounting/documents/{id} | 証憑を更新 |
| POST | /api/v1/accounting/documents/{id}/link | 仕訳に紐付け |
GET
/api/v1/accounting/documents証憑一覧を取得
認証が必要です— セッション Cookie または Bearer トークンを含めてください
クエリパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
document_date | string | 任意 | 証憑日で絞り込み |
counterparty | string | 任意 | 取引先で絞り込み |
search | string | 任意 | ファイル名・取引先名で検索 |
limit | integer | 任意 | 取得件数(デフォルト: 20, 最大: 100) |
offset | integer | 任意 | 取得開始位置(デフォルト: 0) |
コード例
curl "https://api.blueai.jp/api/v1/accounting/documents" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/accounting/documents証憑を登録
認証が必要です— セッション Cookie または Bearer トークンを含めてください
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
file | file | 必須 | 証憑ファイル(PDF / 画像) |
document_date | string | 任意 | 証憑日(YYYY-MM-DD) |
counterparty | string | 任意 | 取引先名 |
amount | number | 任意 | 金額 |
description | string | 任意 | 説明 |
コード例
curl -X POST "https://api.blueai.jp/api/v1/accounting/documents" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/accounting/documents/{id}証憑を取得
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | 証憑 ID |
コード例
curl "https://api.blueai.jp/api/v1/accounting/documents/doc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"PATCH
/api/v1/accounting/documents/{id}証憑を更新
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | 証憑 ID |
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
document_date | string | 任意 | 証憑日(YYYY-MM-DD) |
counterparty | string | 任意 | 取引先名 |
amount | number | 任意 | 金額 |
description | string | 任意 | 説明 |
コード例
curl -X PATCH "https://api.blueai.jp/api/v1/accounting/documents/doc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/accounting/documents/{id}/link仕訳に紐付け
証憑を特定の仕訳に紐付けます。
認証が必要です— セッション Cookie または Bearer トークンを含めてください
パスパラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | 任意 | 証憑 ID |
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
journal_entry_id | string | 必須 | 紐付け先の仕訳 ID |
コード例
curl -X POST "https://api.blueai.jp/api/v1/accounting/documents/doc_123e4567e89b12d3a456426614174000/link" \
-H "Cookie: better-auth.session_token=<token>"