List invoices of a company (group level)
const url = 'https://app.commitly.com/api/companies/117/invoices/?type=receivable&status=OD&page_size=100';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://app.commitly.com/api/companies/117/invoices/?type=receivable&status=OD&page_size=100' \ --header 'Authorization: Bearer <token>'Group level, requires Enterprise Edition. Returns the invoices of the given company in the
group. Same filters and response shape as GET /invoices/: results is an
object containing the totals and the invoices array.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of a company in the group.
Example
117Query Parameters
Section titled “Query Parameters”Substring match on the invoice number (case-insensitive): RE-1 also matches
RE-10. For exact selection use ids or source_ids.
Comma-separated internal invoice IDs (exact match).
Comma-separated source_id values (exact match).
receivable (type RE) or payable (type PA).
true returns paid invoices only, false unpaid invoices only.
Filter on overdue invoices.
Filter on invoices matched to bank transactions.
| Code | Label |
|---|---|
OD | Overdue |
PL | Expected |
OR | Lead/Order |
PD | Paid |
PP | Partially Paid |
IN | Installments |
HD | On Hold |
PR | Promised |
DP | In Dispute |
CA | Cancelled |
IP | In Progress |
Invoice status code (see status in Invoice).
Status codes to include (see status in Invoice).
Status codes to exclude (see status in Invoice).
Sort order. Allowed fields: amount, date, due_date, status,
status_predefined, expected_date, name, reference. Prefix a field with
- for descending order; separate several fields with commas. Default:
status_predefined,-expected_date.
Page number, starting at 1. When paging through results, read this value
from the next link and send it to the documented base URL.
Number of records per page. Default 100, maximum 1000; larger values are reduced to 1000.
Responses
Section titled “Responses”Paginated invoice list with totals.
object
Total number of matching records.
URL of the next page, or null on the last page. The host name may differ
from the documented base URL; read page from it and call the documented
base URL.
URL of the previous page, or null on the first page.
Sum of the amounts of all matching invoices.
Totals and the invoices of the current page.
object
Total amount due of all matching invoices.
Total amount of all matching invoices.
object
Internal invoice ID. Used in /invoices/{id}/ and as id selector.
Bank transactions matched to the invoice.
A bank transaction matched to the invoice.
object
Bank account of the transaction.
Decimal with at most 10 digits and 2 decimal places.
RE receivable, PA payable. Optional on create: if omitted, a positive
amount sets RE, any other amount PA.
Invoice number.
Invoice date.
Expected payment date.
Origin of the invoice, e.g. direct_api or Manually Added.
ID of the invoice in its source.
| Code | Label |
|---|---|
OD | Overdue |
PL | Expected |
OR | Lead/Order |
PD | Paid |
PP | Partially Paid |
IN | Installments |
HD | On Hold |
PR | Promised |
DP | In Dispute |
CA | Cancelled |
IP | In Progress |
Label of status, e.g. Expected.
Category ID.
Present in list responses.
Examples
Invoice list
{ "count": 2, "sum": 8650, "next": null, "previous": null, "results": { "amount_due": 7650, "total": 8650, "invoices": [ { "id": 3101, "transactions": [], "paid_amount": 1000, "amount_due": 200, "date_created": "2022-04-16T09:36:37.718400Z", "date_updated": "2022-04-16T10:12:17.687693Z", "name": "First invoice", "notes": "", "amount": 1200, "type": "RE", "reference": "1", "date": "2022-04-16", "due_date": "2022-04-30", "source": "Manually Added", "source_id": "00000000-0000-4000-8000-000000000001", "status": "PP", "status_label": "Partially Paid", "is_archived": false, "category": 1002, "comment_count": 0 }, { "id": 3102, "transactions": [], "paid_amount": 0, "amount_due": 7450, "date_created": "2022-04-16T09:53:03.919398Z", "date_updated": "2022-04-16T09:53:03.919422Z", "name": "Equipment", "notes": "Special equipment", "amount": 7450, "type": "RE", "reference": "AR-007", "date": "2022-04-16", "due_date": "2022-04-28", "source": "direct_api", "source_id": "00000000-0000-4000-8000-000000000002", "status": "PL", "status_label": "Expected", "is_archived": false, "category": 1002, "comment_count": 0 } ] }}The access token is invalid or has expired. Request a new token. The message is
localized (see Accept-Language).
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "Invalid token."}Headers
Section titled “Headers”Authentication scheme, Bearer.
Example
BearerNo access token was sent, or the credentials are not allowed to call this
endpoint. If the company’s COMMITLY edition does not include the requested
function, the body additionally contains
"code": "billing_plan_permission_denied".
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Example
{ "detail": "User must be authenticated to access this resource."}The resource does not exist or is not accessible with these credentials.
object
Error message.
Present only if the company’s edition does not include the function; value billing_plan_permission_denied.
Examplegenerated
{ "detail": "example", "code": "example"}
