# Sage Business Cloud Accounting — Accounting API: gotchas

> Canonical URL: https://developers.apideck.com/apis/accounting/sage-business-cloud-accounting/gotchas

## POST /accounting/invoices

Only `draft` and `submitted` can be set as the invoice `status` on create/update. `status: "draft"` saves a
non-posting draft (Sage `DRAFT`) that does not affect the accounts; `status: "submitted"` posts the invoice as
`UNPAID` (awaiting payment). `paid` and `partially_paid` cannot be set via the `status` field — Sage derives
those from recorded payments, so register a payment/allocation against the invoice instead.

Posted (non-draft) invoices require a `due_date` when the customer has no default credit days configured; draft
invoices have no such requirement.

## PATCH /accounting/invoices/{id}

To fetch service items, you must include filter[type]=service in your request parameters

## GET /accounting/invoice-items/{id}

To fetch service items, you must include filter[type]=service in your request parameters

## GET /accounting/credit-notes

The `allocations` field is not returned in responses. To retrieve allocation details, use the proxy API to call `/contact_allocations?contact_id={customer_id}`.

## POST /accounting/credit-notes

Pass allocations in the `allocations` array. The first allocation is supported on all plans; additional allocations (2+) require higher than "Start" plan.
The `allocations` field is not returned in responses. To retrieve allocation details, use the proxy API to call `/contact_allocations?contact_id={customer_id}`.

## GET /accounting/credit-notes/{id}

The `allocations` field is not returned in responses. To retrieve allocation details, use the proxy API to call `/contact_allocations?contact_id={customer_id}`.

## PATCH /accounting/credit-notes/{id}

Allocations cannot be modified after credit note creation.

## GET /accounting/bill-credit-notes

The `allocations` field is not returned in responses. To retrieve allocation details, use the proxy API to call `/contact_allocations?contact_id={supplier_id}`.

## POST /accounting/bill-credit-notes

The `allocations` array is not applied on create for this resource — a bill credit note is always created unallocated. To link it to a bill, use the proxy API to call `/contact_allocations`. The `allocations` field is not returned in responses either way; retrieve allocation details via the proxy API call `/contact_allocations?contact_id={supplier_id}`.

## GET /accounting/bill-credit-notes/{id}

The `allocations` field is not returned in responses. To retrieve allocation details, use the proxy API to call `/contact_allocations?contact_id={supplier_id}`.

## PATCH /accounting/bill-credit-notes/{id}

Allocations cannot be modified after credit note creation.

## GET /accounting/payments

Payments are retrieved using the `transaction_type_id` parameter which defaults to `CUSTOMER_RECEIPT`. Use the `type` filter to retrieve other payment transaction types.

## GET /accounting/trial-balance

Built from Sage's trial balance and the chart of accounts: balance sheet accounts (asset, liability, capital) are cumulative to `filter[end_date]` (today by default), and income and expense accounts are year-to-date from the start of the financial year that contains it, from the business's financial year end (assumed to fall on the same day every year). Sage does not move earlier years' income and expense into equity, so that result is returned as one line "Result of previous fiscal years (not yet appropriated)" with `line_type` `unappropriated_result` and null `account_id` and `code`. It is the cumulative income and expense balance minus the year-to-date movement, read from Sage's report rather than from the other lines, so a ledger whose debits and credits differ by half a cent or more returns a `502`. Every other line has `line_type` `account` and Sage's ledger account id as `account_id`. The report follows the business's own accounting scheme, which is used when `filter[accounting_method]` is left out; requesting the other method returns a `400`, as does an invalid `filter[end_date]`. Pass `x-apideck-company-id` to select the business, otherwise the connection's business is used. Each request makes at least four Sage calls: the business's financial settings, the cumulative trial balance, the year-to-date trial balance, and one call per 200 ledger accounts. A call that Sage answers with `429`, `401` or `403` returns that status; any other failure returns a `502`, never a partial report. Accounts with a zero balance are left out.
## GET /accounting/bill-payments

Bill payments are filtered using the `transaction_type_id` parameter, which defaults to `VENDOR_PAYMENT`. Use the `type` filter to retrieve other payment transaction types.


[API reference](https://developers.apideck.com/apis/accounting/reference.md) · [Coverage matrix](https://developers.apideck.com/apis/accounting/coverage)
