Skip to content

List invoice lines with their accounting

GET
/invoices/accounting-lines
Code sample: Shell / cURL
curl --request GET \
--url 'https://example.com/api/v1/invoices/accounting-lines?page=1&perPage=20&status=DRAFT&accounting=incomplete' \
--header 'Authorization: Bearer <token>'

Lists one row per invoice line with its revenue account, service period and class, ordered by issue date, invoice number and line position. By default (issuedOnly=true) it leaves out DRAFT and CANCELLED invoices, which an accountant does not book; with issuedOnly=false it covers the same invoices as the invoice list for the same filters (search, company, status, issue-date range and accounting=incomplete) and the caller’s invoice scope. A line of an invoice recorded as External does not exist, so none appears. The invoice-level discount (negative) and tax are not repeated on lines: each invoice’s adjustments are listed once, on the page that holds its first line, so summing amount by revenue account reconciles with the invoice lines and lines plus adjustments with the invoice total. A line is complete with a revenue account alone when the workspace does not require a class (accountingRequiresClass). The columns of the CSV and XLSX export are configured per workspace in the invoice settings (accountingExportColumns). Answered with 400 when the workspace has no active revenue account. Requires the invoices.manage permission.

page
integer
default: 1 >= 1 <= 9007199254740991
perPage
integer
default: 20 >= 1 <= 100
q

Free-text search, ignoring case, over the invoice number or external number, subject and bill-to name, the company’s name, legal name or order prefix, and the first and last name of the company’s users (every word must appear in one of them, in any order). A person’s name returns every invoice of each company they are a user of, plus any invoice addressed to them.

string
<= 200 characters

Free-text search, ignoring case, over the invoice number or external number, subject and bill-to name, the company’s name, legal name or order prefix, and the first and last name of the company’s users (every word must appear in one of them, in any order). A person’s name returns every invoice of each company they are a user of, plus any invoice addressed to them.

clientId
string
status

Filter by invoice status. UNPAID and ISSUED are filters, not statuses. UNPAID keeps SENT, VIEWED and OVERDUE, including invoices paid in part, and leaves out DRAFT, PAID and CANCELLED: the invoices the Outstanding figure counts, overdue ones included. ISSUED keeps SENT, VIEWED, PAID and OVERDUE, the invoices the Invoiced figure counts.

string
Allowed values: DRAFT SENT VIEWED OVERDUE PAID CANCELLED UNPAID ISSUED

Filter by invoice status. UNPAID and ISSUED are filters, not statuses. UNPAID keeps SENT, VIEWED and OVERDUE, including invoices paid in part, and leaves out DRAFT, PAID and CANCELLED: the invoices the Outstanding figure counts, overdue ones included. ISSUED keeps SENT, VIEWED, PAID and OVERDUE, the invoices the Invoiced figure counts.

accounting

incomplete returns invoices with a priced line (non-zero amount) that has no revenue account or no class. Staff only. The request is rejected when the workspace has no active revenue account.

string
Allowed values: incomplete

incomplete returns invoices with a priced line (non-zero amount) that has no revenue account or no class. Staff only. The request is rejected when the workspace has no active revenue account.

from

Inclusive start of an issue-date range (YYYY-MM-DD), resolved against the workspace’s own calendar day.

string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/

Inclusive start of an issue-date range (YYYY-MM-DD), resolved against the workspace’s own calendar day.

to

Inclusive end of an issue-date range (YYYY-MM-DD), resolved against the workspace’s own calendar day.

string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/

Inclusive end of an issue-date range (YYYY-MM-DD), resolved against the workspace’s own calendar day.

issuedOnly

Defaults to true: keeps invoices that were issued (SENT, VIEWED, PAID, OVERDUE) and leaves out DRAFT and CANCELLED. Pass false to cover the same invoices as the invoice list for the same filters.

string

Defaults to true: keeps invoices that were issued (SENT, VIEWED, PAID, OVERDUE) and leaves out DRAFT and CANCELLED. Pass false to cover the same invoices as the invoice list for the same filters.

Paginated list of invoice lines with their accounting, and the invoice-level adjustments of the invoices that open on the page.

Media typeapplication/json
object
adjustments
required
Array<object>

An invoice-level discount or tax that belongs to no line and no revenue account. Staff only.

object
amount
required

Signed as it adds to the invoice total: a discount is negative, tax is positive. Lines sum to the subtotal, so line amounts plus adjustments equal the invoice total.

number
companyId
required
string
companyName
required
string
currency
required
string
invoiceId
required
string
invoiceNumber
required
string
issueDate
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
kind
required

discount is the invoice-level discount, tax the invoice’s tax.

string
Allowed values: discount tax
status
required
string
data
required
Array<object>

A line of an invoice with its revenue account, service period and class. Summing amount by revenue account reconciles with the invoice lines. Staff only.

object
accountingComplete
required

False when the line has a non-zero amount and no revenue account, or no class in a workspace that requires one. A zero-amount line is always complete.

boolean
amount
required

The line’s amount, net of any line discount.

number
className
required

The class accounting reads: the team’s accounting class name, else the team name; null while unset.

string | null
companyId
required
string
companyName
required
string
currency
required
string
description
required
string
invoiceId
required
string
invoiceNumber
required
string
issueDate
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
lineId
required
string
periodEnd
required

Last day of the service period the line bills (YYYY-MM-DD); null when none.

Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
periodStart
required

First day of the service period the line bills (YYYY-MM-DD); null when none.

Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
quantity
required
number
rate
required
number
revenueAccount
required

The line’s revenue account; null while unset.

Any of:
object
code
required
string
id
required
string
name
required
string
serviceName
required

The service the line was built from; null for a Custom line.

string | null
status
required

Invoice status: DRAFT, SENT, VIEWED, OVERDUE, PAID or CANCELLED.

string
teamId
required

The team whose accounting class the line carries; null while unset.

string | null
meta
required

Pagination metadata for list responses.

object
page
required
integer
>= -9007199254740991 <= 9007199254740991
perPage
required
integer
>= -9007199254740991 <= 9007199254740991
total
required
integer
>= -9007199254740991 <= 9007199254740991
totalPages
required
integer
>= -9007199254740991 <= 9007199254740991

Example

{
"adjustments": [
{
"kind": "discount"
}
]
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.