Skip to main content

Expenses

Information pertaining to retrieving, creating, editing, and deleting expenses.

Link to documentation

List all expenses

Returns a list of your expenses. If accessing this endpoint as an Admin, all expenses in the account will be returned. The expenses are returned sorted by the spent_at date, with the most recent expenses appearing first.

The response contains an object with a expenses property that contains an array of up to per_page expenses. Each entry in the array is a separate expense object. If no more expenses are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your expenses.

Link to documentation

hrvst expenses list
OptionDescriptionRequired
--user_idOnly return expenses belonging to the user with the given ID.false
--client_idOnly return expenses belonging to the client with the given ID.false
--project_idOnly return expenses belonging to the project with the given ID.false
--is_billedPass true to only return expenses that have been invoiced and false to return expenses that have not been invoiced.false
--updated_sinceOnly return expenses that have been updated since the given date and time.false
--fromOnly return expenses with a spent_date on or after the given date.false
--toOnly return expenses with a spent_date on or before the given date.false
--pageThe page number to use in pagination. Use all to retrieve all pages.false
--per_pageThe number of records to return per page. Can range between 1 and 100.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Retrieve a specific expense

Retrieves the expense with the given ID. Returns an expense object and a 200 OK response code if a valid identifier was provided.

Link to documentation

hrvst expenses get
OptionDescriptionRequired
--expense_idThe ID of the expense you're retrieving.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Create an expense

Creates a new expense object. Returns an expense object and a 201 Created response code if the call succeeded.

Link to documentation

hrvst expenses create
OptionDescriptionRequired
--project_idThe ID of the project associated with this expense.true
--expense_category_idThe ID of the expense category this expense is being tracked against.true
--spent_dateDate the expense occurred.true
--user_idThe ID of the user associated with this expense. Defaults to the ID of the currently authenticated user.false
--unitsThe quantity of units to use in calculating the total_cost of the expense.false
--total_costThe total amount of the expense.false
--notesTextual notes used to describe the expense.false
--billableWhether this expense is billable or not. Defaults to true.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Update an expense

Updates the specific expense by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an expense object and a 200 OK response code if the call succeeded.

Link to documentation

hrvst expenses update
OptionDescriptionRequired
--expense_idThe ID of the expense you're updating.true
--project_idThe ID of the project associated with this expense.false
--expense_category_idThe ID of the expense category this expense is being tracked against.false
--spent_dateDate the expense occurred.false
--unitsThe quantity of units to use in calculating the total_cost of the expense.false
--total_costThe total amount of the expense.false
--notesTextual notes used to describe the expense.false
--billableWhether this expense is billable or not.false
--delete_receiptWhether an attached expense receipt should be deleted. Pass true to delete the expense receipt.false
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse

Delete an expense

Delete an expense. Returns a 200 OK response code if the call succeeded.

Link to documentation

hrvst expenses delete
OptionDescriptionRequired
--expense_idThe ID of the expense you're deleting.true
--fieldsComma separated list of fields to display in the output.false
--outputThe output format: json, tablefalse