Intervals API Resource: invoiceitem

The base URL for this resource is located at
https://api.myintervals.com/invoiceitem/

Invoice line items can either be created automatically upon invoice creation (in the case of prefilled invoices) or they can be user generated (in the case of freeform invoices, or line items added to prefilled invoices). You can tell the difference by reading the custom field value, which will be true in the case of user generated line items and false in the case of line items that were generated automatically.

For custom line items, you may edit any field value. For non-custom line items, however, the only editable field is the description field. Furthermore, non-custom line items are not deletable by any level of user. This is done to ensure that a project and its invoices always match up.

Collection

Allowed HTTP Methods
MethodGroup Access
GETAdministrator, Manager, Executive
Allowed Filters
Filter NameRequired?ExpectsDefaultDescription
invoiceid yes integer Limits the list to invoice items belonging to the invoice with the ID passed.
sortfield no string Sort the list by any of the following fields: id, invoiceid, name, description, quantity, rate, and amount.
sortdir no string Sets the sort direction of the returned list. Must be either "ASC" or "DESC".
offset no integer Return invoiceitems starting from the nth invoiceitem.
limit no integer 10 Sets a limit to the amount of invoiceitems 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 filter the list based on certain parameters:

GET /invoiceitem/?offset={value}

Note: You can string together multiple filters.

Member

Allowed HTTP Methods
MethodGroup Access
GETAdministrator, Manager, Executive
DELETEAdministrator, Manager
POSTAdministrator, Manager
PUTAdministrator, Manager
Settable Fields for PUT and POST Requests
Field NameRequired?ExpectsDefaultDescription
invoiceid yes integer The ID of the invoice to which this item applies. Not settable for existing non-custom items.
name yes string (255) The name for this line item.
description no string The line item description.
quantity no double Settable only for new/custom line items.
rate no double Settable only for new/custom line items.
amount yes double The value for the amount must be the product of the quantity and the rate, if they are both specified. Not settable for existing non-custom items.

string (xxx) indicates a string with a maximum length of xxx characters.

Examples

To retrieve one member resource:

GET /invoiceitem/{id}/

Assuming no errors, the server will respond with 200 OK and the object requested.

To delete a particular member resource:

DELETE /invoiceitem/{id}/

Assuming no errors, the server will respond with 200 OK.

To create a new member resource:

POST /invoiceitem/
{
    "invoiceid": value,
    "name": value,
    "amount": 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 /invoiceitem/{id}/
{
    "invoiceid": value,
    "amount": value
}

Assuming no errors, the server will respond with 202 Accepted and the entire element. This will allow you to verify the field values.

Don’t have an Intervals account? Start your own unlimited trial.

No credit card required. No software to install. Cancel any time.

Try it Free