Invoices

Get all invoices across your projects

Request

  • GET /invoices.json

Optional Parameters

  • type (string, default=active) - Which types of invoices to return
    • all
    • completed
    • active
  • projectStatus (string, default=active) - Which projects to query for invoices
    • all
    • archived
    • active
  • page (integer, default=1) - The page of results to return
    • Inspect the response headers for x-page, x-pages, x-records

Response

{
  "invoices": [
    {
      "project-id": "1149",
      "exported-by-user-id": "",
      "created-by-user-firstname": "Daniel",
      "description": "New machinery as Clark dropped the last tractor",
      "fixed-cost": "",
      "status": "active",
      "date-created": "2015-06-17T12:00:47Z",
      "exported-by-user-lastname": "",
      "company-id": "51",
      "number": "INV00001",
      "exported-by-user-firstname": "",
      "po-number": "PO00002",
      "project-name": "API Private Items",
      "display-date": "20150617",
      "exported-date": "",
      "created-by-user-id": "414",
      "update-by-user-id": "414",
      "created-by-user-lastname": "Mackey",
      "company-name": "Kent Farms",
      "id": "49",
      "date-updated": "2015-06-17T12:00:47Z",
      "edited-by-user-lastname": "Mackey",
      "edited-by-user-firstname": "Daniel",
      "currency-code": "USD"
    }
    :
    :
  ]
}

Get all invoices on a single project

Request

  • GET /projects/:id/invoices.json

Optional Parameters

  • type (string, default=active) - Which types of invoices to return
    • all
    • completed
    • active
  • page (integer, default=1) - The page of results to return
    • Inspect the response headers for x-page, x-pages, x-records

Response

{
  "invoices": [
    {
      "project-id": "1149",
      "exported-by-user-id": "",
      "created-by-user-firstname": "Daniel",
      "description": "New machinery as Clark dropped the last tractor",
      "fixed-cost": "",
      "status": "active",
      "date-created": "2015-06-17T12:00:47Z",
      "exported-by-user-lastname": "",
      "company-id": "51",
      "number": "INV00001",
      "exported-by-user-firstname": "",
      "po-number": "PO00002",
      "project-name": "API Private Items",
      "display-date": "20150617",
      "exported-date": "",
      "created-by-user-id": "414",
      "update-by-user-id": "414",
      "created-by-user-lastname": "Mackey",
      "company-name": "Kent Farms",
      "id": "49",
      "date-updated": "2015-06-17T12:00:47Z",
      "edited-by-user-lastname": "Mackey",
      "edited-by-user-firstname": "Daniel",
      "currency-code": "USD"
    }
    :
    :
  ]
}

Get a single invoice

Request

  • GET /invoices/:id.json

Response

{
  "invoice": {
    "exported-by-user-id": "",
    "project-id": "1149",
    "created-by-user-firstname": "Daniel",
    "fixed-cost": "",
    "status": "active",
    "date-created": "2015-06-17T13:50:24Z",
    "exported-by-user-lastname": "",
    "line-items": [
      {
        "minutes": "140",
        "date-logged-utc": "2015-06-17T12:25:00Z",
        "rate": "50.00",
        "decimal-hours": "2.33",
        "description": "Painting decal on engine housing",
        "user-lastname": "Mackey",
        "id": "938",
        "user-firstname": "Daniel",
        "billable": "1",
        "task-name": "",
        "user-id": "414",
        "task-id": "",
        "cost": "116.67"
      },
      {
        "minutes": "20",
        "date-logged-utc": "2015-06-17T14:25:00Z",
        "rate": "50.00",
        "decimal-hours": "0.33",
        "description": "Work on putting new tyres on",
        "user-lastname": "Mackey",
        "id": "937",
        "user-firstname": "Daniel",
        "billable": "1",
        "task-name": "",
        "user-id": "414",
        "task-id": "",
        "cost": "16.67"
      }
    ],
    "number": "INV0001",
    "po-number": "PO0001",
    "exported-by-user-firstname": "",
    "expenses": [
      {
        "invoice-id": "50",
        "name": "4 New Tyres",
        "created-by-user-firstname": "Daniel",
        "created-by-user-id": "414",
        "description": "",
        "created-by-user-lastname": "Mackey",
        "date": "20150617",
        "id": "14",
        "cost": "200.00"
      },
      {
        "invoice-id": "50",
        "name": "Paint",
        "created-by-user-firstname": "Daniel",
        "created-by-user-id": "414",
        "description": "",
        "created-by-user-lastname": "Mackey",
        "date": "20150617",
        "id": "15",
        "cost": "25.00"
      }
    ],
    "update-by-user-id": "414",
    "created-by-user-id": "414",
    "id": "50",
    "company-name": "Apple",
    "edited-by-user-firstname": "Daniel",
    "total-time-decimal": "2.66",
    "total-cost": "358.34",
    "description": "Replace tractor",
    "company-id": "51",
    "exported-date": "",
    "display-date": "20150617",
    "project-name": "API Private Items",
    "total-time": "160",
    "created-by-user-lastname": "Mackey",
    "date-updated": "2015-06-17T13:50:24Z",
    "edited-by-user-lastname": "Mackey",
    "currency-code": "USD"
  }
}

Create a new invoice in a project

Requests:

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

{
  "invoice" : {
    "project-id": "1149",    
    "description": "New machinery as Clark dropped the last tractor",
    "fixed-cost": "",    
    "number": "INV00001",    
    "po-number": "PO00002",    
    "display-date": "20150617",    
    "currency-code": "USD"
  }
}

Response

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

Update a specific invoice

Request

  • PUT /invoices/:id.json

{
  "invoice" : {    
    "description": "New machinery as Clark dropped the last tractor",
    "fixed-cost": "",    
    "number": "INV00001",    
    "po-number": "PO00002",    
    "display-date": "20150617",    
    "currency-code": "USD"
  }
}

Response

{
  "STATUS" : "OK"
}

Delete a specific invoice

Request

  • DELETE /invoices/:id.json

Response

{
  "STATUS" : "OK"
}

Mark a specific invoice as complete

Request

  • PUT /invoices/:id/complete.json

Response

{
  "STATUS" : "OK"
}

Mark a specific invoice as not complete

Request

  • PUT /invoices/:id/uncomplete.json

Response

{
  "STATUS" : "OK"
}

Get a list of valid currency codes

Request

  • GET /currencycodes.json

Response

{
  "currency-codes": [
    {
      "name": "Afghani",
      "code": "AFN"
    },
    {
      "name": "Algerian dinar",
      "code": "DZD"
    }
    :
    :
  ]
}