Gets a list of expenses
Changed onLists expenses, search and filters allow fine grained lists to be generated.
Query parameters can be added to performed more fine grained filtering of the expenses, these are handled by the ExpenseFilters class which defines the methods available
Request
- Base URLhttps://demo.invoiceninja.com
- Authnone declared. Required headers: X-API-TOKEN, X-Requested-With
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Includes child relationships in the response, format is comma separated. Check each model for the list of associated includes
Replaces the default response index from data to a user specific string
ie.
?index=new_index
response is wrapped
{
'new_index' : [
.....
]
}
The number of records to return for each request, default is 20
The page number to return for this request (when performing pagination), default is 1
Order the list by choosing a column and direction. Each value uses the form column|asc or column|desc.
Single sort — for example sort=date|desc.
Multiple sorts — for example
sort[]=amount|asc&sort[]=date|desc.
Expenses accept expense columns plus client, contact, and document-related sorts per ExpenseFilters. Unsupported keys are ignored.
[ "date|desc", "amount|asc" ]
Headers
The API token to be used for authentication
Used to send the XMLHttpRequest header
Response
A list of expenses
Example response
{
"data": [
{
"id": "Opnel5aKBz",
"user_id": "Opnel5aKBz",
"assigned_user_id": "Opnel5aKBz",
"project_id": "Opnel5aKBz",
"client_id": "Opnel5aKBz",
"invoice_id": "Opnel5aKBz",
"invoice_currency_id": "1",
"currency_id": "2",
"invoice_category_id": "Opnel5aKBz",
"recurring_expense_id": "Opnel5aKBz",
"tax_amount": 10,
"tax_name1": "GST",
"tax_name2": "VAT",
"tax_name3": "IVA",
"tax_rate1": 10,
"tax_rate2": 10,
"tax_rate3": 10,
"amount": 10,
"foreign_amount": 10,
"exchange_rate": 0.8,
"date": "2022-12-01",
"payment_date": "2022-12-01",
"should_be_invoiced": true,
"is_deleted": true,
"invoice_documents": true,
"updated_at": 1434342123,
"archived_at": 1434342123,
"calculate_tax_by_amount": true,
"category_id": "Opnel5aKBz",
"number": "EXP-0001",
"purchase_order_id": "Opnel5aKBz",
"tax_amount1": 10,
"tax_amount2": 5,
"tax_amount3": 2.5,
"transaction_id": "txn_1234567890",
"uses_inclusive_taxes": true,
"vendor_id": "Opnel5aKBz"
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 1,
"current_page": 1,
"total_pages": 1
}
}
}Changes
- info
added the new optional
queryrequest parametersort
- info
- info
added the new optional
queryrequest parameterpage - info
added the new optional
queryrequest parameterper_page - info
the response optional property
//became read-only for the status
- info