API Documentation

Time Tracking

Extended REST API
Clients
Projects
Tasks
People
Expenses
Expense Tracking
User Assignment
Task Assignment
Reports
Invoices
Invoice Messages
Invoice Payments
Invoice Categories


Questions?
Email support@getharvest.com

Expense Tracking API

The Expense tracking API allows you to access and manipulate expense entries in similar fashion to using the weekly expensesheet view. This allows developers to create lightweight clients or widgets to track expenses beyond directly interacting with Harvest through the web browser.


Create new expense

POST /expenses

HTTP Response: 201 Created
Location: /expenses

Post the following for a standard expense with a total cost:

<expense>
  <notes>Buy Valentine's Day chocolates for Harvest</notes>
  <total-cost>11.00</total-cost>
  <project_id>2</project_id>
  <expense_category_id>1</expense_category_id>
  <spent_at>Sun, 10 Feb 2008</spent_at>
</expense>

Post the following for an expense whose total cost is calculated via an expense categories unit price (e.g. mileage):

<expense>
  <notes>Drive to buy Valentine's chocolates</notes>
  <units>5</units>
  <project_id>2</project_id>
  <expense_category_id>3</expense_category_id>
  <spent_at>Sun, 10 Feb 2008</spent_at>
</expense>

Update an existing expense

PUT /expenses/#{expense_id}

HTTP Response: 200 OK
Location: /expenses/#{expense_id}

Put the following for a standard expense with a total cost:

<expense>
  <notes>Buy Valentine's Day _dark_ chocolates for Harvest</notes>
  <total_cost>20.00</total_cost>
</expense>

Put the following for an expense whose total cost is calculated via an expense categories unit price (e.g. mileage):

<expense>
  <notes>Drive _a long way_ to buy Valentine's chocolates</notes>
  <units>25</units>
</expense>

Delete existing expense

DELETE /expenses/#{expense_id}

HTTP Response: 200 OK