Appearance
accounting
52 endpoints.
GET /api/v1/accounting/companies
List Companies
200 — Successful Response
json
{}GET /api/v1/accounting/item-price
Get Item Price
The rate a document line should use for item_id — resolved, not typed. Prefers a price-list row scoped to this exact customer over the price list's generic row, mirroring AccItemPrice.customer_id's "party-specific override" role; falls back to the customer's default_price_list_id's generic row when no override exists. Returns {"rate": null} rather than a 404 when nothing is priced — an unpriced item is a normal, fixable state (add a row in Item Prices), not an error.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
item_id | query | yes | string | |
customer_id | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/settings/letterhead
Get Letterhead
200 — Successful Response
json
{}PUT /api/v1/accounting/settings/letterhead
Update Letterhead
Request body
json
{
"properties": {
"enabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Enabled"
},
"logo_url": {
"anyOf": [
{
"type": "string",
"maxLength": 2000000
},
{
"type": "null"
}
],
"title": "Logo Url"
},
"company_name": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"title": "Company Name"
},
"address": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
],
"title": "Address"
},
"contact_line": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "null"
}
],
"title": "Contact Line"
},
"footer_text": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
],
"title": "Footer Text"
}
},
"type": "object",
"title": "LetterheadIn",
"description": "Partial update for the site's invoice letterhead. A field omitted\n(``None``) is left untouched."
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/settings/vat
Get Vat Settings
200 — Successful Response
json
{}PUT /api/v1/accounting/settings/vat
Update Vat Settings
Request body
json
{
"properties": {
"enabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Enabled"
},
"rate": {
"anyOf": [
{
"type": "number",
"maximum": 100,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Rate"
},
"account_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"inclusive": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Inclusive"
}
},
"type": "object",
"title": "VatSettingsIn",
"description": "Partial update for the site's VAT settings. A field omitted (``None``)\nis left untouched."
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/settings/prorata
Get Prorata Settings
200 — Successful Response
json
{}PUT /api/v1/accounting/settings/prorata
Update Prorata Settings
Request body
json
{
"properties": {
"enabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Enabled"
}
},
"type": "object",
"title": "ProrataSettingsIn",
"description": "Partial update for the site's Prorated First-Bill setting. Omitted\n(``None``) is left untouched."
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/settings/company-defaults
Get Company Defaults
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}PUT /api/v1/accounting/settings/company-defaults
Update Company Defaults
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no |
Request body
json
{
"properties": {
"income_account_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Income Account Id"
},
"expense_account_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Expense Account Id"
}
},
"type": "object",
"title": "CompanyDefaultsIn"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/bank-accounts
List Bank Accounts
All bank accounts with their is_default flag, default-first.
200 — Successful Response
json
{}GET /api/v1/accounting/settings/default-bank
Get Default Bank
The default bank account (or the sole account on a one-account site).
200 — Successful Response
json
{}PUT /api/v1/accounting/settings/default-bank
Set Default Bank
Request body
json
{
"properties": {
"bank_account_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Bank Account Id"
}
},
"type": "object",
"title": "DefaultBankIn",
"description": "Which account is the site default. ``null`` clears the default."
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/documents/{doctype}
Create Document
Create a draft document (header + child rows) from the entry form. With ?submit=true it is posted to the GL immediately after creation.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
doctype | path | yes | string | |
submit | query | no | boolean |
Request body
json
{
"type": "object",
"additionalProperties": true,
"title": "Payload"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reseller-users/{reseller_user_id}/party
Resolve Reseller User Party
Resolve a ResellerUser — picked directly by name from the combined Customer/Lead/Reseller-User picker on the Quotation form (see features/accounting/party-options.ts) — to the AccCustomer a document actually posts against. A document's customer_id is strictly an AccCustomer FK (unlike Activation/Subscription's soft uuid ref), so a reseller's own end-user always resolves to the parent reseller account, carrying reseller_user_id alongside so the saved document still records which end-user it's actually for (mirrors the Leads grid's create_quotation resolve-at-save pattern, one step later since the party here already exists rather than needing to be created).
Returns both customer_id (the integer FK Quotation/Sales Order forms save) and customer_uuid (what Bank Reconciliation's Create Payment Entry needs instead — AccPaymentEntry.party_id is a polymorphic GUID soft-ref, not the integer id, since it has to point at either an AccCustomer or an AccSupplier).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
reseller_user_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/documents/acc_purchase_invoice/ocr-upload
Ocr Upload Purchase Invoice
Upload & Scan Invoice: OCR an uploaded supplier bill and create a draft Purchase Invoice from it. When the supplier can't be confidently matched by name the draft is still created without a party (never auto-picking/guessing a supplier on a financial document); the response's supplier_matched is null and supplier_scanned carries the name the OCR read, so the user can pick the supplier on the edit form — where it stays required before saving.
Password-protected PDFs raise 423 with a machine-readable detail.code (password_required / wrong_password) so the frontend can pop a small window to collect the password and retry, rather than surfacing a dead-end error.
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/documents/{doctype}/{doc_id}
View Document
Read one document (header + child rows, FK names resolved) for the grid's view modal — opened by double-clicking a transactional grid row.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
doctype | path | yes | string | |
doc_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}PUT /api/v1/accounting/documents/{doctype}/{doc_id}
Update Document
Update a draft document's header + child rows in place. With ?submit=true it is posted to the GL immediately after saving.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
doctype | path | yes | string | |
doc_id | path | yes | string | |
submit | query | no | boolean |
Request body
json
{
"type": "object",
"additionalProperties": true,
"title": "Payload"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/documents/{doctype}/{doc_id}/edit
Edit Document
Read one DRAFT document back in raw, editable form (ids, not resolved display names) — feeds the edit form opened by double-clicking a draft row on the Sales Invoices grid.
Deliberately NOT crossed to the books site the way the read-only view above is: the PUT that saves the form doesn't cross either (a write carries GL posting and docstatus-trigger side effects that shouldn't silently land in another site's books), so crossing only the GET would open an edit form that 404s on save. Editing a draft happens on the books site that owns it.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
doctype | path | yes | string | |
doc_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/{doctype}/{doc_id}/submit
Submit
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
doctype | path | yes | string | |
doc_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/{doctype}/{doc_id}/cancel
Cancel
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
doctype | path | yes | string | |
doc_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/trial-balance
R Trial Balance
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/general-ledger
R General Ledger
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
account_id | query | no | ||
party_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/profit-loss
R Profit Loss
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/balance-sheet
R Balance Sheet
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
as_on | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/cash-flow
R Cash Flow
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/sales-register
R Sales Register
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/purchase-register
R Purchase Register
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/ar-summary
R Ar Summary
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
as_on | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/ap-summary
R Ap Summary
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
as_on | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/ar-ageing
R Ar Ageing
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
as_on | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/ap-ageing
R Ap Ageing
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
as_on | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/vat201
R Vat201
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
company_id | query | no | ||
from | query | no | ||
to | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/bank-reconciliation
R Bank Reconciliation
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
bank_account_id | query | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/reports/{report}/pdf
R Report Pdf
The Accounting Reports page's "View PDF" button — same branded table renderer every grid's auto-attached View PDF button uses (:mod:app.services.grid_pdf), since this bespoke tabbed page isn't a GridConfig-backed grid and so never picked that up automatically. Reuses whichever report function the JSON endpoint above calls, then shapes it via :mod:app.services.accounting_reports_pdf.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
report | path | yes | string | |
company_id | query | no | ||
from | query | no | ||
to | query | no | ||
as_on | query | no | ||
bank_account_id | query | no |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/customers/{customer_id}/email-attachments
Upload Customer Email Attachment
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
customer_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}DELETE /api/v1/accounting/customers/{customer_id}/email-attachments/{attachment_id}
Discard Customer Email Attachment
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
customer_id | path | yes | string | |
attachment_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/suppliers/{supplier_id}/documents
List Supplier Documents
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
supplier_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/suppliers/{supplier_id}/documents
Upload Supplier Document
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
supplier_id | path | yes | string |
201 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}PATCH /api/v1/accounting/suppliers/{supplier_id}/documents/{document_id}
Rename Supplier Document
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
supplier_id | path | yes | string | |
document_id | path | yes | string |
Request body
json
{
"properties": {
"filename": {
"type": "string",
"title": "Filename"
}
},
"type": "object",
"required": [
"filename"
],
"title": "Body_rename_supplier_document_api_v1_accounting_suppliers__supplier_id__documents__document_id__patch"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}DELETE /api/v1/accounting/suppliers/{supplier_id}/documents/{document_id}
Delete Supplier Document
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
supplier_id | path | yes | string | |
document_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/suppliers/{supplier_id}/documents/{document_id}/content
Get Supplier Document Content
Serve the raw file (inline) for preview/download in the drawer — the frontend fetches this with its auth header and shows images inline.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
supplier_id | path | yes | string | |
document_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/bank/import-statement/{bank_account_id}
Import Statement
Parse an uploaded OFX statement and import its lines (deduped). For FNB CSV imports, use the FNB Bank Sync app instead.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
bank_account_id | path | yes | string |
Request body
json
{
"properties": {
"text": {
"type": "string",
"title": "Text"
},
"fmt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Fmt"
}
},
"type": "object",
"required": [
"text"
],
"title": "Body_import_statement_api_v1_accounting_bank_import_statement__bank_account_id__post"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/bank/auto-match/{bank_account_id}
Bank Auto Match
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
bank_account_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/bank/match-candidates/{txn_id}
Bank Match Candidates
Vouchers that could clear this statement line (the 'Match Against Voucher' picker).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string | |
day_window | query | no | integer |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/bank/payment-form-options/{txn_id}
Bank Payment Form Options
The statement line plus the party / mode-of-payment picklists that back the Create Payment form (ERPNext's 'Create Voucher → Payment Entry' dialog).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/bank/create-payment/{txn_id}
Bank Create Payment
Create + submit a Payment Entry from a statement line and reconcile it (ERPNext's 'Create Voucher → Payment Entry').
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string |
Request body
json
{
"properties": {
"company_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Company Id"
},
"party_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Party Type"
},
"party_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Party Id"
},
"mode_of_payment_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Mode Of Payment Id"
}
},
"type": "object",
"title": "Body_bank_create_payment_api_v1_accounting_bank_create_payment__txn_id__post"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}GET /api/v1/accounting/bank/journal-form-options/{txn_id}
Bank Journal Form Options
The statement line plus the postable ledger accounts that back the Create Journal form (book a line to income/expense/asset accounts).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/bank/create-journal/{txn_id}
Bank Create Journal
Create + submit a Journal Entry from a statement line (bank vs the chosen ledger account, optionally tagged to a Customer/Supplier) and reconcile it.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string |
Request body
json
{
"properties": {
"account_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Account Id"
},
"company_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Company Id"
},
"remark": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Remark"
},
"party_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Party Type"
},
"party_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Party Id"
}
},
"type": "object",
"title": "Body_bank_create_journal_api_v1_accounting_bank_create_journal__txn_id__post"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/bank/reconcile/{txn_id}
Bank Reconcile
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string |
Request body
json
{
"properties": {
"voucher_type": {
"type": "string",
"title": "Voucher Type"
},
"voucher_id": {
"type": "string",
"title": "Voucher Id"
}
},
"type": "object",
"required": [
"voucher_type",
"voucher_id"
],
"title": "Body_bank_reconcile_api_v1_accounting_bank_reconcile__txn_id__post"
}200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/bank/unreconcile/{txn_id}
Bank Unreconcile
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
txn_id | path | yes | string |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}POST /api/v1/accounting/migrate/{site_id}
Migrate
Pull masters + GL + stock from the named ERP site (tc|mm|vehicledb) into the local accounting tables, then (documents=true, the default) the transactional document headers (sales/purchase invoices, payments, journals, quotations, sales orders, delivery notes, supplier quotations, purchase orders/receipts, stock reconciliations) plus their child lines (items, JE accounts, payment references/deductions, tax breakdown, payment schedule) so the document grids/detail views populate fully. Idempotent (keyed on source_id; child lines are keyed on their parent having zero rows).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
site_id | path | yes | string | |
documents | query | no | boolean |
200 — Successful Response
json
{}422 — Validation Error
json
{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}