Skip to main content

Summarise Invoices

GET/invoices/summary

Access​

RequirementValue
Scoperead:invoices
Company-scoped keysSupported
Agency-scoped keysSupported within agency access

Summary​

Returns grouped non-draft invoice counts, hours and financial totals, separated by currency. Requires read:invoices. Company and agency keys are supported, within their existing data access. Filtering or grouping by another agency does not expand an agency key's access.

Draft invoices and applications for payment are excluded. Agency keys see only their agency’s invoices and cannot retrieve MSP-to-client invoices. Currency is always part of each group: totals in different currencies are never combined or converted. When grouping by project, an invoice linked to several projects contributes its full values to each project group; those groups must not be summed as an apportioned programme total.

Query Parameters​

NameTypeRequiredDescription
companystringNoFilter by company id(s). Pass a single id or comma-separated ids. If omitted, data for all companies linked to the API key is returned.
agencystringNoFilter by agency id
projectstringNoFilter by project id
statusenum(pending, confirmed)NoFilter by invoice status
invoiceTypeenum(supplierToClient, supplierToMsp, mspToClient)NoFilter by invoice flow type. supplierToClient is direct client-billable supplier invoice value; mspToClient is client-billable MSP invoice value; supplierToMsp is supplier-to-MSP payable value.
mspInvoiceTypeenum(receivable, payable)NoFilter by MSP invoice subtype
querystringNoCase-insensitive text search across the resource’s supported reference and name fields
groupBystringNoComma-separated grouping dimensions: agency, company, project, status, invoiceType, month, week. Combine dimensions, for example company,month. Duplicate dimensions are ignored. Default: agency.
dateFieldenum(createdAt, issueDate, confirmedDate, due, weekEnding, we)NoDate used for range filtering and month/week groups. Choose a date populated on the source records. Default: createdAt.
fromstringNoDate range start (YYYY-MM-DD), applied to dateField
tostringNoDate range end (YYYY-MM-DD), applied to dateField
sortByenum(count, grossHours, netHours, subtotal, vat, total, cis, finalTotal, expenses, creditNotes, netValue)NoMetric used to sort groups Default: finalTotal.
sortOrderenum(asc, desc)NoGroup sort direction Default: desc.
limitintegerNoMaximum groups returned; capped at 500. No page parameter or continuation token is provided. Default: 500.

Aggregation rules​

  • Results contain at most 500 groups. There is no pagination or continuation token; narrow the filters or split date ranges when more groups are needed.
  • meta.total is the number of groups returned after limiting, not the total matching records or all possible groups.
  • Month groups use YYYY-MM; ISO week groups use YYYY-Www. Both use UTC and the selected dateField; a missing selected date produces a null date bucket when no date range excludes it.
  • Measures are reported from stored values without currency conversion. Invoice groups are always separated by currency.

Request Example​

curl --get 'https://api.requidex.com/api/open/v1/invoices/summary' \
--header "Authorization: Bearer ${REQUIDEX_API_KEY}" \
--header 'Accept: application/json' \
--data-urlencode 'groupBy=agency' \
--data-urlencode 'limit=50' \
--max-time 30

Response Fields​

FieldTypeDescription
successbooleanWhether the request succeeded
dataarray of objectsReturned groups
Show child attributes
  • group object — Selected grouping dimensions
    Show child attributes
    • agency object or null — Selected agency dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • company object or null — Selected company dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • project object or null — Selected project dimension; present only when included in groupBy
      Show child attributes
      • id string or null — Resource identifier
      • name string or null — Resource name
    • status string or null — Selected status dimension; present only when included in groupBy
    • invoiceType string or null — Selected invoiceType dimension; present only when included in groupBy
    • month string or null — Selected month dimension; present only when included in groupBy
    • week string or null — Selected week dimension; present only when included in groupBy
  • count integer — Number of matching records represented in the group
  • values object — Aggregated measures for the group
    Show child attributes
    • grossHours number — Gross hours
    • netHours number — Net hours
    • subtotal number — Subtotal before VAT
    • vat number — VAT amount
    • total number — Total amount
    • cis number — CIS deduction amount
    • finalTotal number — Final total
    • expenses number — Expense amount
    • creditNotes number — Credit-note amount
    • netValue number — Net value after the stored adjustments
  • currency string — Currency of this group; no conversion is performed
metaobjectApplied summary settings
Show child attributes
  • total integer — Groups returned after applying limit; not the total source records or all possible groups
  • groupBy array — Selected grouping dimensions
  • dateField string — Date field used for filtering and date buckets
  • sortBy string — Applied metric sort
  • sortOrder string — Applied sort direction
  • limit integer — Applied group limit

Response Example (200)​

{
"success": true,
"data": [
{
"group": {
"agency": {
"id": "507f1f77bcf86cd799439011",
"name": "Example agency"
}
},
"count": 2,
"values": {
"grossHours": 80,
"netHours": 75,
"subtotal": 1800,
"vat": 360,
"total": 2160,
"cis": 0,
"finalTotal": 2160,
"expenses": 0,
"creditNotes": 0,
"netValue": 2160
},
"currency": "GBP"
}
],
"meta": {
"total": 1,
"groupBy": ["agency"],
"dateField": "createdAt",
"sortBy": "finalTotal",
"sortOrder": "desc",
"limit": 50
}
}

The example is illustrative. An empty result has data: [] and meta.total: 0.

MCP Tool​

The corresponding MCP tool is summarize_invoices. It uses this server-side summary operation and retains the caller’s scopes and tenant restrictions.

Errors​

HTTP statusCodeMeaning
400BAD_REQUESTInvalid grouping dimension, date field, filter or date range
401UNAUTHORIZEDMissing, invalid, expired or revoked key
403FORBIDDENMissing scope or disallowed access
429RATE_LIMITED or DAILY_RATE_LIMITEDKey quota exceeded
500INTERNAL_ERRORUnable to return the summary

See Responses and Errors for shared handling, and List Invoices for record-level access and detail queries.