Expenses can be used to track the expenditures of your account, Clients or specific Projects. They can also be rebilled to recoup costs.
GET /api/v2/expensesBy default, expenses are retrieved for the current fiscal year, as defined by the fiscal year start in Account Settings.
{
"total_count": 6
"from_date": "2011/01/01",
"to_date": "2011/12/31",
"expenses": [
{
"invoice_item_id": null
"incurred_on": "2011/03/02"
"project_id": null
"invoice_id": null
"amount": 500
"id": 3
"user_id": 1
"client_id": 4
"description": "Expense Description!"
},
...
]
}
GET /api/v2/expenses?from_date=2012-01-01&to_date=2012-12-31You can change the date range for expense retrieval via the from_date and to_date parameters.
GET /api/v2/clients/:client_id/expensesYou may also optionally query for expenses by Client.
GET /api/v2/projects/:project_id/expensesExpenses are also considered a nested resource for Projects
GET /api/v2/expenses/:id
{
"invoice_item_id": null
"incurred_on": "2011/03/02"
"project_id": null
"invoice_id": null
"amount": 500
"id": 3
"user_id": 1
"client_id": 4
"description": "Expense Description!"
}
POST /api/v2/expenses
{
"expense": {
"amount": 500
}
}
Required Fields: amount (HTTP 422 on failure)
If you want to assign this expense to a client or project, you can use the client_id and project_id attributes, respectively.
PUT /api/v2/expenses/:idYou may provide a partial list of fields to update
{
"expense": {
"amount": 600
}
}
DELETE /api/v2/expenses/:idDeletions are permanent and not reversible.