Intervals API Resource: invoice
The base URL for this resource is located at
https://api.myintervals.com/invoice/
There are two types of invoices:
Freeform invoices are blank invoices, and contain no line items initially. To add line items, you must create them through the invoiceitem resource.
Prefilled invoices are based on work performed, and on creation include line items based on time entries from the project to which the invoice belongs.
You can specify the type of invoice you want by using the datebegin and dateend fields. If you leave these fields blank, the invoice will be created as freeform. However, if you enter values for either of these fields, time entries will be imported from the invoice's project according to the date range you specify.
Once an invoice has been created, you cannot change the type of invoice it is, though you can add and edit line items no matter what the type (see the invoiceitem resource for more information about invoice restrictions).
If you have a prefilled invoice, you can rebuild it by changing either the datebegin or dateend field (or both). This has the effect of re-importing all time entries for your date range, while preserving any custom line items that your invoice may contain.
Collection
Allowed HTTP Methods | |
---|---|
Method | Group Access |
GET | Administrator, Manager, Executive |
Allowed Filters | ||||
---|---|---|---|---|
Filter Name | Required? | Expects | Default | Description |
localid | no | integer1 | Restricts the list based on a invoice's "localid," which is the number that appears associated with the invoice in the Intervals application. | |
clientid | no | integer1 | Limits the list to invoices belonging to the client with the ID passed. | |
projectid | no | integer1 | Limits the list to invoices belonging to the project with the ID passed. | |
datebegin | no | date | Limits the list to expenses having a date on or after the date passed. | |
dateend | no | date | Limits the list to expenses having a date on or before the date passed. | |
status | no | string | Useful for specifying specific invoice statuses. Can be either "outstanding" or "paid". | |
search | no | string | Limits the list to invoices that match the search string.. Searches title, description, localid, purchase order and address fields. | |
sortfield | no | string | Sort the list by any of the following fields: id, projectid, date, title, description, localid, purchaseorder, project, client, datepaid, subtotal, total, payments, balance, datedue, daysoverdue, projectlabelid, projectlabel (sorted by project labels alphabeticaly), and projectabel_order (sorted by project label order in Settings & Defaults). | |
sortdir | no | string | Sets the sort direction of the returned list. Must be either "ASC" or "DESC". | |
offset | no | integer | Return invoices starting from the nth invoice. | |
limit | no | integer | 10 | Sets a limit to the amount of invoices returned in the response. |
1 Indicates that multiple values are allowed, in CSV format (e.g. "3,5,11,19").
2 This field accepts HTML, but certain HTML elements may be stripped out.
Examples
To retrieve the entire list of this resource:
GET /invoice/
To filter the list based on certain parameters:
GET /invoice/?clientid={value}
Note: You can string together multiple filters.
Member
Allowed HTTP Methods | |
---|---|
Method | Group Access |
GET | Administrator, Manager, Executive |
DELETE | Administrator, Manager |
POST | Administrator, Manager |
PUT | Administrator, Manager |
Settable Fields for PUT and POST Requests | ||||
---|---|---|---|---|
Field Name | Required? | Expects | Default | Description |
projectid | yes | integer | ||
date | yes | date | ||
termid | yes | integer | ||
termother | no | string (255) | If you specify the termid as "other" (6), you can assign a custom term name to this invoice. | |
termotherdatedue | no | date | If you specify the termid as "other" (6), you must specify the custom due date of this invoice. | |
title | yes | string (255) | The invoice title. | |
description | no | string | ||
addressfrom | no | string | ||
addressto | no | string | ||
purchaseorder | no | string (55) | ||
tax | no | double | ||
secondtax | no | double | For places with dual taxation levels, the value of the secondary tax level. | |
secondtaxcompound | no | boolean | f | For places with dual taxation levels, true if the second tax is compounded, false if the second tax is added. |
disclaimer | no | string | ||
datebegin | no | date | If you wish to create a pre-filled invoice based on work performed, set this to the start date of the time entries you wish to include. | |
dateend | no | date | If you wish to create a pre-filled invoice based on work performed, set this to the end date of the time entries you wish to include. |
string (xxx) indicates a string with a maximum length of xxx characters.
Examples
To retrieve one member resource:
GET /invoice/{id}/
Assuming no errors, the server will respond with 200 OK and the object requested.
To delete a particular member resource:
DELETE /invoice/{id}/
Assuming no errors, the server will respond with 200 OK.
To create a new member resource:
POST /invoice/
{ "projectid": value, "date": value, "termid": value, "title": value }
Assuming no errors, the server will respond with 201 Created and the newly-created element. This will allow you to get the id of the item you just created and verify the field values. Note: Only required fields were listed here. The entire list of possible fields is above.
To update a member resource:
PUT /invoice/{id}/
{ "termotherdatedue": value, "addressto": value }
Assuming no errors, the server will respond with 202 Accepted and the entire element. This will allow you to verify the field values.
Intervals API
This documentation is meant to serve as an introduction to getting started with the API.
Documentation
Resources
- client
- contactdescriptor
- contacttype
- document
- expense
- group
- invoice
- invoiceitem
- invoicenote
- invoiceterm
- me
- milestone
- milestonenote
- module
- payment
- paymenttype
- person
- personcontact
- project
- projectlabel
- projectmodule
- projectnote
- projectteam
- projectworktype
- quota
- request
- task
- tasklistfilter
- tasknote
- taskpriority
- taskstatus
- time
- timer
- worktype
API Support
Looking for help?
» Contact our support team.