curl --request POST \
--url https://api.salesbricks.com/api/v2/invoices/search \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"customer_id": "11111111-2222-3333-4444-555555555555",
"statuses": [
"PAST_DUE"
],
"ordering": "-due_at"
}
'{
"count": 123,
"results": [
{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billed_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"bill_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"fully_paid_at": "2023-11-07T05:31:56Z",
"grand_total": 123,
"remaining_amount": 123,
"currency": "<string>",
"is_renewal_estimate": true,
"payment_url": "<string>",
"accounts_payable_emails": [
"jsmith@example.com"
],
"customer_name": "<string>",
"time_zone": "<string>",
"payments": [
{
"payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paid_amount": 123,
"paid_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"error": "<string>"
}
],
"attachments": [
"<unknown>"
],
"line_items": [
{
"brick_name": "<string>",
"brick_id": "<string>",
"brick_code": "<string>",
"quantity": 123,
"tax": 123,
"grand_total": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
],
"metadata": "<unknown>",
"purchase_order": {
"code": "<string>"
}
}
],
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100"
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "<string>",
"error_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Search invoices
Search your invoices, both subscription and standalone. Filters combine
with AND, and at least one must be provided (ordering alone is not enough).
Empty arrays are treated as omitted.
To list a customer’s standalone invoices, send customer_id with an explicit
subscription_id: null.
Statuses are the raw invoice statuses the response’s status field
reports. Voided invoices are included in results by default; they are excluded
only when a statuses filter is provided that does not include VOIDED.
Dates. All *_date_min / *_date_max bounds are inclusive and interpreted
in your account’s timezone (_min expands to start of day, _max to end of
day).
issued_date filters on the invoice’s billing-run date and paid_date on when
it was fully paid. A due_date range filters on the due date only — it does
not implicitly exclude paid invoices; combine with statuses to narrow.
Days past due is the number of whole days between the due date and now.
Invoices with no outstanding balance (fully paid, or nothing due) have no
days-past-due value and never match a days_past_due filter. For AR-aging
queries combine with "statuses": ["PAST_DUE"].
Amounts are integer minor currency units (e.g. cents). amount_due is the
remaining unpaid amount; paid_amount is the total paid so far, including
partial payments.
search_term matches invoice numbers, customer names, invoice UUIDs, and
amounts.
Ordering takes a single field name with an optional - prefix for
descending: issued_at, due_at, or amount_due (remaining amount). Defaults
to newest first.
Pagination is handled via query params (limit, offset).
curl --request POST \
--url https://api.salesbricks.com/api/v2/invoices/search \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"customer_id": "11111111-2222-3333-4444-555555555555",
"statuses": [
"PAST_DUE"
],
"ordering": "-due_at"
}
'{
"count": 123,
"results": [
{
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"billed_company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"bill_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"status": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"fully_paid_at": "2023-11-07T05:31:56Z",
"grand_total": 123,
"remaining_amount": 123,
"currency": "<string>",
"is_renewal_estimate": true,
"payment_url": "<string>",
"accounts_payable_emails": [
"jsmith@example.com"
],
"customer_name": "<string>",
"time_zone": "<string>",
"payments": [
{
"payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"invoice_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paid_amount": 123,
"paid_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"error": "<string>"
}
],
"attachments": [
"<unknown>"
],
"line_items": [
{
"brick_name": "<string>",
"brick_id": "<string>",
"brick_code": "<string>",
"quantity": 123,
"tax": 123,
"grand_total": 123,
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
],
"metadata": "<unknown>",
"purchase_order": {
"code": "<string>"
}
}
],
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100"
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "<string>",
"error_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Query Parameters
Body
Filters for searching your invoices.
Filter invoices by status.
Current status of the invoice. One of:
MUTED— Invoice will not be sent. Muted invoices come from migration cut-overs or from muting invoices in the product settings.SCHEDULED— Scheduled to be issued on a future date.OUTSTANDING— Issued and awaiting payment.DUE— Payment is due.PAST_DUE— Payment is past its due date.PAID— Fully paid.PARTIALLY_PAID— Partially paid, with a remaining balance.ADJUSTED— Adjusted after issuance.CREDITED— Settled by applying credit.UNPAID— Unpaid.PAUSED— Collection is paused.VOIDED— Voided and no longer collectible.
MUTED- MutedSCHEDULED- ScheduledDRAFT- DraftOUTSTANDING- OutstandingDUE- DuePAST_DUE- Past duePAID- PaidPARTIALLY_PAID- Partially PaidADJUSTED- AdjustedCREDITED- CreditedUNPAID- UnpaidPAUSED- PausedVOIDED- Voided
MUTED, SCHEDULED, DRAFT, OUTSTANDING, DUE, PAST_DUE, PAID, PARTIALLY_PAID, ADJUSTED, CREDITED, UNPAID, PAUSED, VOIDED Order results by field, prefixed with '-' for descending. 'amount_due' is the remaining amount. Defaults to newest first.
issued_at- issued_at-issued_at- -issued_atdue_at- due_at-due_at- -due_atamount_due- amount_due-amount_due- -amount_due
issued_at, -issued_at, due_at, -due_at, amount_due, -amount_due