Expenses

Get all expenses across your projects

Request

  • GET /expenses.json

Response

{
  "expenses": [
    {
      "invoice-id": "50",
      "project-id": "1149",
      "name": "4 New Tyres",
      "description": "",
      "created-by-user-firstname": "Daniel",
      "company-id": "51",
      "project-name": "API Private Items",
      "created-by-user-id": "414",
      "created-by-user-lastname": "Mackey",
      "id": "14",
      "date": "20150617",
      "company-name": "Apple",
      "cost": "200.00"
    }
    :
    :
  ]
}

Get all expenses on a single project

Request

  • GET /projects/:id/expenses.json

Response

{
  "expenses": [
    {
      "invoice-id": "50",
      "project-id": "1149",
      "name": "4 New Tyres",
      "description": "New run flats for tractor",
      "created-by-user-firstname": "Daniel",
      "company-id": "51",
      "project-name": "API Private Items",
      "created-by-user-id": "414",
      "created-by-user-lastname": "Mackey",
      "id": "14",
      "date": "20150617",
      "company-name": "Apple",
      "cost": "200.00"
    }
    :
    :
  ]
}

Get a single expense

Request

  • GET /expenses/:id.json

Response

{
  "expense": {
    "invoice-id": "50",
    "project-id": "1149",
    "name": "4 New Tyres",
    "description": "New run flats for tractor",
    "created-by-user-firstname": "Daniel",
    "company-id": "51",
    "project-name": "API Private Items",
    "created-by-user-id": "414",
    "created-by-user-lastname": "Mackey",
    "id": "14",
    "date": "20150617",
    "company-name": "Apple",
    "cost": "200.00"
  }
}

Create a new expense in a project

Requests

  • POST /expenses.json
  • POST /projects/:id/expenses.json

{
  "expense": {    
    "name": "4 New Tyres",
    "description": "New run flats for tractor",
    "date": "20150617",    
    "cost": "200.00"
  }
}

Response

{
  "STATUS":"OK",
  "id":999
}

Update a single expense

Request

  • PUT /expenses/:id.json

{
  "expense": {    
    "name": "4 New Tyres",
    "description": "New run flats for tractor",
    "date": "20150617",    
    "cost": "200.00"
  }
}

Notes:

  • You may also pass an optional invoiceId when you are updating an Expense, this will allow you to assign the Expense to an existing Invoice ID or move the Expense from one Invoice to another. 

Response

{
  "STATUS":"OK"
}

Delete a single expense

Request

  • DELETE /expenses/:id.json

Response

{
  "STATUS":"OK"
}

Add an unbilled expense to an Invoice

This allows you to add a pre existing expense to an invoice

Request

  • PUT to /invoices/:invoiceid/lineitems.json

{  
   "lineitems":{  
      "add":{  
         "expenses":"12345"
      }
   }
}

Response

{
  "STATUS":"OK"
}

Add a time entry to an Invoice

This allows you to add a pre existing time entry to an invoice

Request

  • PUT to /invoices/:invoiceid/lineitems.json

{  
   "lineitems":{  
      "add":{  
         "timelogs":"54321"
      }
   }
}

Response

{
  "STATUS":"OK"
}