Invoices
The invoice object
Attribute | Type | Description |
---|---|---|
id |
integer | Unique ID for the invoice. |
client |
object | An object containing invoice’s client id and name. |
line_items |
array | Array of invoice line items. |
estimate |
object | An object containing the associated estimate’s id. |
retainer |
object | An object containing the associated retainer’s id. |
creator |
object | An object containing the id and name of the person that created the invoice. |
client_key |
string | Used to build a URL to the public web invoice for your client by adding /client/invoices/{CLIENT_KEY} to your account URL https://{SUBDOMAIN}.harvestapp.com/ Note: you can also add .pdf to the end of this URL to access a PDF version of the invoice. |
number |
string | If no value is set, the number will be automatically generated. |
purchase_order |
string | The purchase order number. |
amount |
decimal | The total amount for the invoice, including any discounts and taxes. |
due_amount |
decimal | The total amount due at this time for this invoice. |
tax |
decimal | This percentage is applied to the subtotal, including line items and discounts. |
tax_amount |
decimal | The first amount of tax included, calculated from tax . If no tax is defined, this value will be null. |
tax2 |
decimal | This percentage is applied to the subtotal, including line items and discounts. |
tax2_amount |
decimal | The amount calculated from tax2 . |
discount |
decimal | This percentage is subtracted from the subtotal. |
discount_amount |
decimal | The amount calculated from discount . |
subject |
string | The invoice subject. |
notes |
string | Any additional notes included on the invoice. |
currency |
string | The currency code associated with this invoice. |
state |
string | The current state of the invoice: draft , open , paid , or closed . |
period_start |
date | Start of the period during which time entries were added to this invoice. |
period_end |
date | End of the period during which time entries were added to this invoice. |
issue_date |
date | Date the invoice was issued. |
due_date |
date | Date the invoice is due. |
payment_term |
string | The timeframe in which the invoice should be paid. Options: upon receipt , net 15 , net 30 , net 45 , net 60 , or custom . |
payment_options |
array | The list of payment options enabled for the invoice. Options: [ach , credit_card , paypal ] |
sent_at |
datetime | Date and time the invoice was sent. |
paid_at |
datetime | Date and time the invoice was paid. |
paid_date |
date | Date the invoice was paid. |
closed_at |
datetime | Date and time the invoice was closed. |
recurring_invoice_id |
integer | Unique ID of the associated recurring invoice. |
created_at |
datetime | Date and time the invoice was created. |
updated_at |
datetime | Date and time the invoice was last updated. |
The invoice line item object
Attribute | Type | Description |
---|---|---|
id |
integer | Unique ID for the line item. |
project |
object | An object containing the associated project’s id, name, and code. |
kind |
string | The name of an invoice item category. |
description |
string | Text description of the line item. |
quantity |
decimal | The unit quantity of the item. |
unit_price |
decimal | The individual price per unit. |
amount |
decimal | The line item subtotal (quantity * unit_price ). |
taxed |
boolean | Whether the invoice’s tax percentage applies to this line item. |
taxed2 |
boolean | Whether the invoice’s tax2 percentage applies to this line item. |
Required permissions
You must be an Administrator or Manager with permission to create and edit invoices in order to interact with the /v2/invoices
endpoint. Insufficient permissions will result in a 403 Forbidden
status code.
List all invoices
Returns a list of your invoices. The invoices are returned sorted by issue date, with the most recently issued invoices appearing first.
The response contains an object with a invoices
property that contains an array of up to per_page
invoices. Each entry in the array is a separate invoice object. If no more invoices are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your invoices.
GET /v2/invoices
Parameter | Type | Description |
---|---|---|
client_id |
integer | Only return invoices belonging to the client with the given ID. |
project_id |
integer | Only return invoices associated with the project with the given ID. |
updated_since |
datetime | Only return invoices that have been updated since the given date and time. |
from |
date | Only return invoices with an issue_date on or after the given date. |
to |
date | Only return invoices with an issue_date on or before the given date. |
state |
string | Only return invoices with a state matching the value provided. Options: draft , open , paid , or closed . |
page |
integer | The page number to use in pagination. For instance, if you make a list request and receive 2000 records, your subsequent call can include page=2 to retrieve the next page of the list. (Default: 1) |
per_page |
integer | The number of records to return per page. Can range between 1 and 2000. (Default: 2000) |
Example Request:
curl "https://api.harvestapp.com/v2/invoices" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
Retrieve an invoice
Retrieves the invoice with the given ID. Returns an invoice object and a 200 OK
response code if a valid identifier was provided.
GET /v2/invoices/{INVOICE_ID}
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150378" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
Create a free-form invoice
Creates a new invoice object. Returns an invoice object and a 201 Created
response code if the call succeeded.
POST /v2/invoices
Parameter | Type | Required | Description |
---|---|---|---|
client_id |
integer | required | The ID of the client this invoice belongs to. |
retainer_id |
integer | optional | The ID of the retainer you want to add funds to with this invoice. Note: retainers cannot be fully used (created, drawn against, closed, etc.) via the API at this time. The only available action is to add funds. |
estimate_id |
integer | optional | The ID of the estimate associated with this invoice. |
number |
string | optional | If no value is set, the number will be automatically generated. |
purchase_order |
string | optional | The purchase order number. |
tax |
decimal | optional | This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. |
tax2 |
decimal | optional | This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. |
discount |
decimal | optional | This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. |
subject |
string | optional | The invoice subject. |
notes |
string | optional | Any additional notes to include on the invoice. |
currency |
string | optional | The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies |
issue_date |
date | optional | Date the invoice was issued. Defaults to today’s date. |
due_date |
date | optional | Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom , otherwise the value supplied in the request for due_date will be ignored and the due_date will be calculated using the issue_date and the payment_term . |
payment_term |
string | optional | The timeframe in which the invoice should be paid. Defaults to custom . Options: upon receipt , net 15 , net 30 , net 45 , net 60 , or custom . |
payment_options |
array | The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach , credit_card , paypal ] |
|
line_items |
array | optional | Array of line item parameters |
Line Item Parameter | Type | Required | Description |
---|---|---|---|
project_id |
integer | optional | The ID of the project associated with this line item. |
kind |
string | required | The name of an invoice item category. |
description |
string | optional | Text description of the line item. |
quantity |
decimal | optional | The unit quantity of the item. Defaults to 1 . |
unit_price |
decimal | required | The individual price per unit. |
taxed |
boolean | optional | Whether the invoice’s tax percentage applies to this line item. Defaults to false . |
taxed2 |
boolean | optional | Whether the invoice’s tax2 percentage applies to this line item. Defaults to false . |
Example Request:
curl "https://api.harvestapp.com/v2/invoices" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X POST \
-H "Content-Type: application/json" \
-d '{"client_id":5735774,"subject":"ABC Project Quote","due_date":"2017-07-27","line_items":[{"kind":"Service","description":"ABC Project","unit_price":5000.0}]}'
Example Response:
Create an invoice based on tracked time and expenses
Creates a new invoice object. Returns an invoice object and a 201 Created
response code if the call succeeded.
POST /v2/invoices
Parameter | Type | Required | Description |
---|---|---|---|
client_id |
integer | required | The ID of the client this invoice belongs to. |
estimate_id |
integer | optional | The ID of the estimate associated with this invoice. |
number |
string | optional | If no value is set, the number will be automatically generated. |
purchase_order |
string | optional | The purchase order number. |
tax |
decimal | optional | This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. |
tax2 |
decimal | optional | This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. |
discount |
decimal | optional | This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. |
subject |
string | optional | The invoice subject. |
notes |
string | optional | Any additional notes to include on the invoice. |
currency |
string | optional | The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies |
issue_date |
date | optional | Date the invoice was issued. Defaults to today’s date. |
due_date |
date | optional | Date the invoice is due. Defaults to the issue_date if no payment_term is specified. To set a custom due_date the payment_term must also be set to custom , otherwise the value supplied in the request for due_date will be ignored and the due_date will be calculated using the issue_date and the payment_term . |
payment_term |
string | optional | The timeframe in which the invoice should be paid. Defaults to custom . Options: upon receipt , net 15 , net 30 , net 45 , net 60 , or custom . |
payment_options |
array | The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach , credit_card , paypal ] |
|
line_items_import |
object | optional | An line items import object |
Line Items Import Parameter | Type | Required | Description |
---|---|---|---|
project_ids |
array | required | An array of the client’s project IDs you’d like to include time/expenses from. |
time |
object | optional | A time import object. |
expenses |
object | optional | An expense import object. |
Time Import Parameter | Type | Required | Description |
---|---|---|---|
summary_type |
string | required | How to summarize the time entries per line item. Options: project , task , people , or detailed . |
from |
date | optional | Start date for included time entries. Must be provided if to is present. If neither from or to are provided, all unbilled time entries will be included. |
to |
date | optional | End date for included time entries. Must be provided if from is present. If neither from or to are provided, all unbilled time entries will be included. |
Expense Import Parameter | Type | Required | Description |
---|---|---|---|
summary_type |
string | required | How to summarize the expenses per line item. Options: project , category , people , or detailed . |
from |
date | optional | Start date for included expenses. Must be provided if to is present. If neither from or to are provided, all unbilled expenses will be included. |
to |
date | optional | End date for included expenses. Must be provided if from is present. If neither from or to are provided, all unbilled expenses will be included. |
attach_receipts |
boolean | optional | If set to true , a PDF containing an expense report with receipts will be attached to the invoice. Defaults to false . |
Example Request:
curl "https://api.harvestapp.com/v2/invoices" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X POST \
-H "Content-Type: application/json" \
-d '{"client_id":5735774,"subject":"ABC Project Quote","payment_term":"upon receipt","line_items_import":{"project_ids":[14307913],"time":{"summary_type":"task","from":"2017-03-01","to":"2017-03-31"},"expenses":{"summary_type":"category"}}}'
Example Response:
Update an invoice
Updates the specific invoice by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Returns an invoice object and a 200 OK
response code if the call succeeded.
PATCH /v2/invoices/{INVOICE_ID}
Parameter | Type | Description |
---|---|---|
client_id |
integer | The ID of the client this invoice belongs to. |
retainer_id |
integer | The ID of the retainer associated with this invoice. |
estimate_id |
integer | The ID of the estimate associated with this invoice. |
number |
string | If no value is set, the number will be automatically generated. |
purchase_order |
string | The purchase order number. |
tax |
decimal | This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. |
tax2 |
decimal | This percentage is applied to the subtotal, including line items and discounts. Example: use 10.0 for 10.0%. |
discount |
decimal | This percentage is subtracted from the subtotal. Example: use 10.0 for 10.0%. |
subject |
string | The invoice subject. |
notes |
string | Any additional notes to include on the invoice. |
currency |
string | The currency used by the invoice. If not provided, the client’s currency will be used. See a list of supported currencies |
issue_date |
date | Date the invoice was issued. |
due_date |
date | Date the invoice is due. |
payment_term |
string | The timeframe in which the invoice should be paid. Options: upon receipt , net 15 , net 30 , net 45 , or net 60 . |
payment_options |
array | The payment options available to pay the invoice. Your account must be configured with the appropriate options under Settings > Integrations > Online payment to assign them. Options: [ach , credit_card , paypal ] |
line_items |
array | Array of line item parameters |
Line Item Parameter | Type | Description |
---|---|---|
id |
integer | Unique ID for the line item. |
project_id |
integer | The ID of the project associated with this line item. |
kind |
string | The name of an invoice item category. |
description |
string | Text description of the line item. |
quantity |
decimal | The unit quantity of the item. Defaults to 1 . |
unit_price |
decimal | The individual price per unit. |
taxed |
boolean | Whether the invoice’s tax percentage applies to this line item. Defaults to false . |
taxed2 |
boolean | Whether the invoice’s tax2 percentage applies to this line item. Defaults to false . |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150453" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"purchase_order":"2345"}'
Example Response:
Create an invoice line item
Create a new line item on an invoice. Returns a 200 OK
response code if the call succeeded.
Example Request:
curl "https://api.harvestapp.com/api/v2/invoices/13150403" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-ID: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"line_items":[{"kind":"Service","description":"DEF Project","unit_price":1000.0}]}'
Example Response:
Update an invoice line item
Update an existing line item on an invoice. Returns a 200 OK
response code if the call succeeded.
Example Request:
curl "https://api.harvestapp.com/api/v2/invoices/13150403" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-ID: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"line_items":{[{"id":53341928,"description":"ABC Project Phase 2","unit_price":5000.0}]}'
Example Response:
Delete an invoice line item
Delete a line item from an invoice. Returns a 200 OK
response code if the call succeeded.
Example Request:
curl "https://api.harvestapp.com/api/v2/invoices/13150403" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-ID: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"line_items":[{"id":53341928,"_destroy":true}]}'
Example Response:
Delete an invoice
Delete an invoice. Returns a 200 OK
response code if the call succeeded.
DELETE /v2/invoices/{INVOICE_ID}
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150453" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X DELETE