Invoice Messages
The invoice message object
Attribute | Type | Description |
---|---|---|
id |
integer | Unique ID for the message. |
sent_by |
string | Name of the user that created the message. |
sent_by_email |
string | Email of the user that created the message. |
sent_from |
string | Name of the user that the message was sent from. |
sent_from_email |
string | Email of the user that message was sent from. |
recipients |
array | Array of invoice message recipients. |
subject |
string | The message subject. |
body |
string | The message body. |
include_link_to_client_invoice |
boolean | DEPRECATED This will be true when payment_options are assigned to the invoice and false when there are no payment_options . |
attach_pdf |
boolean | Whether to attach the invoice PDF to the message email. |
send_me_a_copy |
boolean | Whether to email a copy of the message to the current user. |
thank_you |
boolean | Whether this is a thank you message. |
event_type |
string | The type of invoice event that occurred with the message: close, draft, re-open, or send (marked the invoice as sent). If event_type was omitted in the request, a null value is returned, meaning the invoice was sent. |
reminder |
boolean | Whether this is a reminder message. |
send_reminder_on |
date | The date the reminder email will be sent. |
created_at |
datetime | Date and time the message was created. |
updated_at |
datetime | Date and time the message was last updated. |
The invoice message recipient object
Attribute | Type | Description |
---|---|---|
name |
string | Name of the message recipient. |
email |
string | Email of the message recipient. |
Required permissions
You must be an Administrator or Manager with permission to create and edit invoices in order to interact with the /v2/invoices/{INVOICE_ID}/messages
endpoint. Insufficient permissions will result in a 403 Forbidden
status code.
List all messages for an invoice
Returns a list of messages associated with a given invoice. The invoice messages are returned sorted by creation date, with the most recently created messages appearing first.
The response contains an object with an invoice_messages
property that contains an array of up to per_page
messages. Each entry in the array is a separate message object. If no more messages are available, the resulting array will be empty. Several additional pagination properties are included in the response to simplify paginating your messages.
GET /v2/invoices/{INVOICE_ID}/messages
Parameter | Type | Description |
---|---|---|
updated_since |
datetime | Only return invoice messages that have been updated since the given date and time. |
page |
integer | DEPRECATED 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) |
page
parameter.
For more information, visit the pagination guide.
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
Create and send an invoice message
Creates a new invoice message object and sends it. Returns an invoice message object and a 201 Created
response code if the call succeeded.
A note about the optional event_type
parameter: If event_type
is omitted in a request, its default value of null
means the message will be sent. In such a request, if the recipients array is omitted or empty and send_me_a_copy
is also omitted or set to false
, the request will fail because the message has no recipients. When omitting event_type
to create and send a message, be sure to include a recipients
array as a parameter or ensure the send_me_a_copy
parameter is included and set to true.
POST /v2/invoices/{INVOICE_ID}/messages
Parameter | Type | Required | Description |
---|---|---|---|
recipients |
array | optional | Array of recipient parameters. See below for more details. |
subject |
string | optional | The message subject. |
body |
string | optional | The message body. |
include_link_to_client_invoice |
boolean | optional | DEPRECATED A link to the client invoice URL will be automatically included in the message email if payment_options have been assigned to the invoice. Setting to true will be ignored. Setting to false will clear all payment_options on the invoice. |
attach_pdf |
boolean | optional | If set to true , a PDF of the invoice will be attached to the message email. Defaults to false . |
send_me_a_copy |
boolean | optional | If set to true , a copy of the message email will be sent to the current user. Defaults to false . |
thank_you |
boolean | optional | If set to true , a thank you message email will be sent. Defaults to false . |
event_type |
string | optional | Omit when intending to create and send a message. If omitted, the default value is null and the message will be sent. See other sections below for including this parameter with the following options: close, draft, re-open, or send (which marks a draft invoice as sent, it does not send the message). |
Recipient Parameter | Type | Required | Description |
---|---|---|---|
name |
string | optional | Name of the message recipient. |
email |
string | required | Email of the message recipient. |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages" \
-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 '{"subject":"Invoice #1001","body":"The invoice is attached below.","attach_pdf":true,"send_me_a_copy":true,"recipients":[{"name":"Richard Roe","email":"[email protected]"}]}'
Example Response:
Retrieve invoice message subject and body for specific invoice
Returns the subject and body text as configured in Harvest of an invoice message for a specific invoice and a 200 OK
response code if the call succeeded. Does not create the invoice message. If no parameters are passed, will return the subject and body of a general invoice message for the specific invoice.
GET /v2/invoices/{INVOICE_ID}/messages/new
Parameter | Type | Required | Description |
---|---|---|---|
thank_you |
boolean | optional | Set to true to return the subject and body of a thank-you invoice message for the specific invoice. |
reminder |
boolean | optional | Set to true to return the subject and body of a reminder invoice message for the specific invoice. |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages/new?reminder=true" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])"
Example Response:
Delete an invoice message
Delete an invoice message. Returns a 200 OK
response code if the call succeeded.
DELETE /v2/invoices/{INVOICE_ID}/messages/{message_ID}
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages/27835324" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Harvest-Account-Id: $ACCOUNT_ID" \
-H "User-Agent: MyApp ([email protected])" \
-X DELETE
Mark a draft invoice as sent
Creates a new invoice message object and marks the invoice as sent. Returns an invoice message object and a 201 Created
response code if the call succeeded.
POST /v2/invoices/{INVOICE_ID}/messages
Parameter | Type | Required | Description |
---|---|---|---|
event_type |
string | required | Pass “send” to mark the invoice as sent. |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages" \
-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 '{"event_type":"send"}'
Example Response:
Mark an open invoice as closed
Creates a new invoice message object and marks the invoice as closed (written off). Returns an invoice message object and a 201 Created
response code if the call succeeded.
POST /v2/invoices/{INVOICE_ID}/messages
Parameter | Type | Required | Description |
---|---|---|---|
event_type |
string | required | Pass “close” to mark the invoice as closed. |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages" \
-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 '{"event_type":"close"}'
Example Response:
Re-open a closed invoice
Creates a new invoice message object and re-opens a written-off (closed) invoice. Returns an invoice message object and a 201 Created
response code if the call succeeded.
POST /v2/invoices/{INVOICE_ID}/messages
Parameter | Type | Required | Description |
---|---|---|---|
event_type |
string | required | Pass “re-open” to re-open the invoice. |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages" \
-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 '{"event_type":"re-open"}'
Example Response:
Mark an open invoice as a draft
Creates a new invoice message object and marks an open invoice as a draft. Returns an invoice message object and a 201 Created
response code if the call succeeded.
POST /v2/invoices/{INVOICE_ID}/messages
Parameter | Type | Required | Description |
---|---|---|---|
event_type |
string | required | Pass “draft” to mark the invoice as a draft. |
Example Request:
curl "https://api.harvestapp.com/v2/invoices/13150403/messages" \
-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 '{"event_type":"draft"}'
Example Response: