Invoices
Create, send, approve, reconcile payments, and cancel invoices.
|
Endpoints
| GET | /api/v1/invoices | List invoices |
| POST | /api/v1/invoices | Create an invoice |
| GET | /api/v1/invoices/dashboard | Get dashboard |
| GET | /api/v1/invoices/{id} | Get an invoice |
| PATCH | /api/v1/invoices/{id} | Update an invoice |
| DELETE | /api/v1/invoices/{id} | Delete an invoice |
| POST | /api/v1/invoices/{id}/approve | Approve an invoice |
| POST | /api/v1/invoices/{id}/send | Mark as sent |
| POST | /api/v1/invoices/{id}/mark-paid | Mark as paid |
| POST | /api/v1/invoices/{id}/cancel | Cancel an invoice |
| GET | /api/v1/invoices/{id}/pdf | Get PDF |
| POST | /api/v1/invoices/{id}/send-email | Send by email |
GET
/api/v1/invoicesList invoices
Authentication required— Include session cookie or Bearer token
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Optional | Filter by status (draft / sent / paid / cancelled) |
company_id | string | Optional | Filter by company ID |
search | string | Optional | Search by invoice number or subject |
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/invoices" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/invoicesCreate an invoice
Authentication required— Include session cookie or Bearer token
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Required | Company ID |
invoice_number | string | Optional | Invoice number (auto-generated if omitted) |
issue_date | string | Required | Issue date (YYYY-MM-DD) |
due_date | string | Required | Due date (YYYY-MM-DD) |
subject | string | Optional | Subject |
issuer_name | string | Optional | Issuer name |
issuer_detail | string | Optional | Issuer detail |
memo | string | Optional | Memo |
tax_display_mode | string | Optional | Tax display mode (inclusive / exclusive) |
tax_rounding | string | Optional | Tax rounding (round / floor / ceil) |
withholding_tax_type | string | Optional | Withholding tax type (none / type_1 / type_2) |
bank_name | string | Optional | Bank name |
bank_branch | string | Optional | Bank branch |
bank_account_type | string | Optional | Bank account type (ordinary / current) |
bank_account_number | string | Optional | Bank account number |
bank_account_holder | string | Optional | Bank account holder |
| object[] | Required | Line items |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/invoices" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/invoices/dashboardGet dashboard
Returns unsent count, unpaid count, monthly revenue summary, etc.
Authentication required— Include session cookie or Bearer token
Code Examples
curl "https://api.blueai.jp/api/v1/invoices/dashboard" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/invoices/{id}Get an invoice
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"PATCH
/api/v1/invoices/{id}Update an invoice
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
company_id | string | Optional | Company ID |
invoice_number | string | Optional | Invoice number |
issue_date | string | Optional | Issue date (YYYY-MM-DD) |
due_date | string | Optional | Due date (YYYY-MM-DD) |
subject | string | Optional | Subject |
issuer_name | string | Optional | Issuer name |
issuer_detail | string | Optional | Issuer detail |
memo | string | Optional | Memo |
tax_display_mode | string | Optional | Tax display mode (inclusive / exclusive) |
tax_rounding | string | Optional | Tax rounding (round / floor / ceil) |
withholding_tax_type | string | Optional | Withholding tax type (none / type_1 / type_2) |
bank_name | string | Optional | Bank name |
bank_branch | string | Optional | Bank branch |
bank_account_type | string | Optional | Bank account type (ordinary / current) |
bank_account_number | string | Optional | Bank account number |
bank_account_holder | string | Optional | Bank account holder |
| object[] | Optional | Line items |
Code Examples
curl -X PATCH "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"DELETE
/api/v1/invoices/{id}Delete an invoice
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl -X DELETE "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/invoices/{id}/approveApprove an invoice
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000/approve" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/invoices/{id}/sendMark as sent
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000/send" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/invoices/{id}/mark-paidMark as paid
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000/mark-paid" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/invoices/{id}/cancelCancel an invoice
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000/cancel" \
-H "Cookie: better-auth.session_token=<token>"GET
/api/v1/invoices/{id}/pdfGet PDF
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000/pdf" \
-H "Cookie: better-auth.session_token=<token>"POST
/api/v1/invoices/{id}/send-emailSend by email
Authentication required— Include session cookie or Bearer token
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | Invoice ID |
Code Examples
curl -X POST "https://api.blueai.jp/api/v1/invoices/inv_123e4567e89b12d3a456426614174000/send-email" \
-H "Cookie: better-auth.session_token=<token>"