Improved
Cost center, analytical splits and expense categories on invoices (experimental)
26 days ago by ReadMe API
List invoices and Get invoice now return the accounting coding of each invoice, in three new fields:
costCenter– the cost center the invoice is coded to (idandname), ornullwhen none is set;analyticalSplits– how the invoice total is allocated: for each split, apercentage(from 0 to 100, the splits of an invoice add up to 100), acostCenter(ornull) and theanalyticalPropertiesset on it. Empty when the invoice is not split;expenseCategories– the expense categories the invoice is coded to (idandname), sorted by name. Empty when none is set. These are the ids theexpenseCategoryIdfilter matches; a split invoice matches if any of its categories does.
costCenter and analyticalSplits are set independently: a split can name a different cost center than the invoice's own.
curl --request GET \
--url 'https://public-api.spendesk.com/v2/companies/7j6mvn11rqf7j5/invoices?expenseCategoryId=<expense category id>&limit=50' \
--header 'accept: application/json' \
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.masked'
Coding is on the invoice, not on its linesCoding is set on the whole invoice. In
lineItems[]of Get invoice,costCenterandexpenseCategoryare alwaysnullandanalyticalPropertiesis always empty, as they were before: readcostCenter,analyticalSplitsandexpenseCategorieson the invoice.
Invoice data is now cached for up to 20 minutes on the list, the summary and the single-invoice endpoints: a change can take that long to appear.
These endpoints remain experimental (scope experimental:invoice:read).