Documents
Register and manage source documents (receipts, invoices, etc.) and link them to journal entries.
|
Endpoints
| GET | /api/v1/accounting/documents | List documents |
| POST | /api/v1/accounting/documents | Create a document |
| GET | /api/v1/accounting/documents/{id} | Get a document |
| PATCH | /api/v1/accounting/documents/{id} | Update a document |
| POST | /api/v1/accounting/documents/{id}/link | Link to journal entry |
GET
/api/v1/accounting/documentsList documents
Authentication required— Include session cookie or Bearer token
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
document_date | string | Optional | Filter by document date |
counterparty | string | Optional | Filter by counterparty |
search | string | Optional | Search by file name or counterparty |
limit | integer | Optional | Number of items to return (default: 20, max: 100) |
offset | integer | Optional | Offset for pagination (default: 0) |
Code Examples
curl "https://api.blueai.jp/api/v1/accounting/documents" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/accounting/documentsCreate a document
Authentication required— Include session cookie or Bearer token
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
file | file | Required | Document file (PDF / image) |
document_date | string | Optional | Document date (YYYY-MM-DD) |
counterparty | string | Optional | Counterparty name |
amount | number | Optional | Amount |
description | string | Optional | Description |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/accounting/documents" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/accounting/documents/{id}Get a document
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Document ID |
Code Examples
curl "https://api.blueai.jp/api/v1/accounting/documents/doc_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"PATCH
/api/v1/accounting/documents/{id}Update a document
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Document ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
document_date | string | Optional | Document date (YYYY-MM-DD) |
counterparty | string | Optional | Counterparty name |
amount | number | Optional | Amount |
description | string | Optional | Description |
Code Examples
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}/linkLink to journal entry
Link a document to a specific journal entry.
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Document ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
journal_entry_id | string | Required | Journal entry ID to link to |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/accounting/documents/doc_123e4567e89b12d3a456426614174000/link" \
-H "Cookie: better-auth.session_token=<token>"