REST API Expenses

Listing expenses

GET /expenses.xml

Returns a paginated list of expenses.

Parameters:

Parameter Type Description
project_id integer/string get expenses from the project with the given id
status_id integer get expenses by status with the given id
search string get expenses with the given search string

Examples:

GET /expenses.xml 
GET /expenses.xml?project_id=2 
GET /expenses.xml?search=crm 

Paging example: 
GET /expenses.xml?project_id=testproject&page=1
GET /expenses.xml?project_id=testproject&page=2

Response:

<expenses total_count="2" offset="0" limit="25" type="array">
  <expense>
    <id>2</id>
    <expense_date>2015-11-06</expense_date>
    <currency>EUR</currency>
    <price>200.0</price>
    <description>Windows 7 license</description>
    <project id="11" name="Redmine Invoices plugin demo"/>
    <status id="2" name="New"/>
    <contact id="11" name="Apple Inc."/>
    <author id="4" name="Smith Paul"/>
    <assigned_to id="11" name="Kutcher Ashtonddd"/>
    <is_billable>false</is_billable>
    <created_on>2015-11-05T00:00:00Z</created_on>
    <updated_on>2015-11-09T16:23:44Z</updated_on>
  </expense>
  <expense>
    <id>1</id>
    <expense_date>2015-10-31</expense_date>
    <currency>USD</currency>
    <price>6200.0</price>
    <description>Hosting for 2012 year</description>
    <project id="11" name="Redmine Invoices plugin demo"/>
    <status id="3" name="Billed"/>
    <contact id="11" name="Apple Inc."/>
    <author id="4" name="Smith Paul"/>
    <assigned_to id="9" name="Pong Steven"/>
    <is_billable>true</is_billable>
    <created_on>2015-10-29T00:00:00Z</created_on>
    <updated_on>2015-11-09T16:23:44Z</updated_on>
  </expense>
  ...
</expenses>

Showing an expense

GET /expenses/[id].xml

Examples:

GET /expenses/2.xml
GET /expenses/2.json

Response:

  <expense>
    <id>1</id>
    <expense_date>2015-10-31</expense_date>
    <currency>USD</currency>
    <price>6200.0</price>
    <description>Hosting for 2012 year</description>
    <project id="11" name="Redmine Invoices plugin demo"/>
    <status id="3" name="Billed"/>
    <contact id="11" name="Apple Inc."/>
    <author id="4" name="Smith Paul"/>
    <assigned_to id="9" name="Pong Steven"/>
    <is_billable>true</is_billable>
    <created_on>2015-10-29T00:00:00Z</created_on>
    <updated_on>2015-11-09T16:23:44Z</updated_on>
  </expense>

Creating an expense

POST /expenses.[format]

Parameters:

  • expense - A hash of the expense attributes:
    • expense_date
    • currency
    • price
    • description
    • project_id
    • status_id
    • contact_id
    • author_id
    • assigned_to_id
    • is_billable
Was this article helpful? Yes  No
96 from 119 found this helpful