Expenses

Expenses can be used to track the expenditures of your account, Clients or specific Projects. They can also be rebilled to recoup costs.

Get Expenses By Date

GET /api/v2/expenses

By 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-31

You can change the date range for expense retrieval via the from_date and to_date parameters.

GET /api/v2/clients/:client_id/expenses

You may also optionally query for expenses by Client.

GET /api/v2/projects/:project_id/expenses

Expenses are also considered a nested resource for Projects

Get An Expense

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!"
}

Create A New Expense

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.

Update An Expense

PUT /api/v2/expenses/:id

You may provide a partial list of fields to update

{
  "expense": {
    "amount": 600
  }
}

Delete An Expense

DELETE /api/v2/expenses/:id

Deletions are permanent and not reversible.