Search Payables

Allowed Scopes: experimental:payable-search:read

Searches payables using filters with cursor-based pagination. With an organisation-level token, each search covers the company in X-Company-Id only, and results carry no company ID: send one search per company. Payables search data is cached for up to 24 hours, or up to 5 minutes when the filters include documentaryEvidenceStatus. Changes made through the API are returned by subsequent reads; changes made in Spendesk can take up to the same duration to appear.

Pass include: ["externalIds"] to embed the IDs each payable has in external systems (ERPs), such as the ERP document number, and externalIds (optionally with provider) to return only the payables carrying one of those IDs. Both are opt-in because they cost an additional lookup; external IDs are cached for up to 24 hours. Changes made through the API are returned by subsequent reads; changes made in Spendesk can take up to 24 hours to appear.

Accounting fields, such as the item lines' taxAccountId, vatRate and vatAmount, return the values saved on the payable. Values that Spendesk only suggests in Bookkeep > Prepare (from default accounts or automation rules) are not returned until an accountant prepares the payable. So a payable in state toPrepare can return vatAmount 0 while Spendesk displays a VAT amount for it. For final accounting data, filter on bookkeepingStatus toExport or exported.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Search body for querying payables. Combine leaf filters or compound (and/or) filter groups with cursor-based pagination.

string

Opaque pagination cursor returned in the previous response’s nextCursor field. Omit for the first page.

externalIds
array of strings
length between 1 and 50

Return only payables carrying one of these IDs in an external system (ERP), exact match. Resolved against the external-reference registry, so payables without an exported ID are excluded. Combined with filters using AND. From 1 to 50 per request; omit it rather than send an empty list. Send it again with every cursor, like filters. The placeholder values unknown and invoiceAlreadyPaid are rejected with a 400.

externalIds
searchPayableValueFilter | searchPayableCompoundFilter

A single value filter or a compound filter group. Omit to return all payables.

include
array of strings

Extra data to embed in the response. externalIds costs one additional lookup per request, so it is opt-in.

include
Allowed:
integer
1 to 1000

Maximum number of payables to return per page, from 1 to 1000. Defaults to 1000.

string
length ≥ 1

Restrict the externalIds filter to one external system (e.g. Netsuite, pennylane). Ignored without that filter, and it does not narrow the externalIds include, which returns the IDs from every system (read provider on each entry).

string
enum

Sort order by creation date. Defaults to ascending.

Allowed:
Headers
string

ID of the company the request acts on. Required with an organisation-level token; not needed with a company-level token.

Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json