Invoices API
List Invoices
List all invoices for an account:
GET /invoices
Response
Status: 200 OK
[
{
"id": 351,
"sourceID": null,
"description": "HP ProLiant BL260c servers",
"invoice_nr": "36798292-A",
"invoice_date": "2017-11-19",
"amount": "7200.0",
"created_at": "2017-11-22T14:32:28-06:00",
"updated_at": "2017-11-22T14:33:06-06:00",
"project": {
"id": 7497,
"subject": "Digital Operations Center (DOC)"
}
},
{
"id": 396,
"sourceID": null,
"description": "APC NetShelter rack",
"invoice_nr": "170092403",
"invoice_date": "2017-11-20",
"amount": "1408.0",
"created_at": "2017-11-28T12:01:50-06:00",
"updated_at": "2017-11-28T12:01:50-06:00",
"project": {
"id": 7497,
"subject": "Digital Operations Center (DOC)"
}
},
"..."
]
The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of invoices.
Collection Fields
By default the following fields will appear in collections of invoices:
id
sourceID
description
invoice_nr
invoice_date
amount
created_at
updated_at
project
Obtain a different set of fields using the ?fields=parameter.
Sorting
By default a collection of invoices is sorted descending by invoice_date
.
The following fields are accepted by the ?sort=parameter:
id
sourceID
description
invoice_nr
invoice_date
created_at
updated_at
Get a Single Invoice
GET /invoices/:id
Response
Status: 200 OK
{
"amount": "7200.0",
"attachments": [
{
"name": "HP 36798292-A.pdf",
"uri": "https://itrp.s3-accelerate.dualstack.amazonaws.com/...",
"inline": false,
"size": 520410
}
],
"capital_expenditure": true,
"created_at": "2017-11-22T14:32:28-06:00",
"description": "HP ProLiant BL260c servers",
"id": 351,
"invoice_date": "2017-11-19",
"invoice_nr": "36798292-A",
"po_nr": "PO33729-01",
"quantity": 2,
"remarks": "These are the 2 servers for the DOC project.",
"service": {
"id": 24,
"name": "Service Management (ITRP)",
"localized_name": "Service Management (ITRP)",
"provider": {
"id": 45,
"name": "Widget Data Center, External IT",
"account": {
"id": "widget",
"name": "Widget International"
}
}
},
"source": "4me",
"sourceID": null,
"supplier": {
"id": 32,
"name": "HP"
},
"unit_price": "3600.0",
"updated_at": "2017-11-22T14:32:28-06:00",
"project": {
"id": 7497,
"subject": "Digital Operations Center (DOC)"
}
}
The response contains these fields.
Create a Invoice
POST /invoices
When creating a new invoice these fields are available.
Response
Status: 201 Created
{
"amount": "...",
"...": "..."
}
The response contains all fields of the created invoice and is similar to the response in Get a single invoice
Update a Invoice
PATCH /invoices/:id
When updating a invoice these fields are available.
Response
Status: 200 OK
{
"amount": "...",
"...": "..."
}
The response contains all fields of the updated invoice and is similar to the response in Get a single invoice
Fields
- amount
- Readonly decimal — The Amount field contains the product of the Unit price field value and the Quantity field value.
- attachments
- Readonly aggregated Attachments
- capital_expenditure
- Optional boolean, default:
false
— The Capital expenditure box is checked when the invoice amount is to be depreciated over time. - created_at
- Readonly datetime — The date and time at which the invoice was created.
- description
- Required string (max 220) — The Description field is used to enter a short description of what was acquired.
- id
- Readonly integer — The unique ID of the invoice.
- invoice_date
- Required date — The Invoice date field is used to specify the date on which the invoice was sent out by the supplier.
- invoice_nr
- Required string (max 128) — The Invoice number field is used to enter the invoice number that the supplier specified on the invoice.
- po_nr
- Optional string (max 128) — The PO number field is used to enter the number of the purchase order that was sent to supplier.
- project
- Required reference to Project — The Project field is set to the project for which the costs specified in the Amount field were incurred.
- quantity
- Required decimal, default:
1
— The Quantity field is used to enter the number of units that were acquired. - remarks
- Optional text (max 64KB) — The Remarks field is used to add any additional information about the contract that might prove useful.
- remarks_attachments
- Writeonly attachments The attachments used in the Remarks field.
- service
- Readonly reference to Service — The Service field is automatically set to the “service”:/help/service that is linked to the project.
- source
- Optional string (max 30) - See source
- sourceID
- Optional string (max 128) - See source
- supplier
- Optional reference to Organization — The Supplier field is used to select the organization from which the invoice was received.
- unit_price
- Optional decimal — The Unit price field is used to enter the amount that the supplier has charged per unit that was acquired.
- updated_at
- Readonly datetime — The date and time of the last update of the invoice. If the invoice has no updates it contains the
created_at
value.