Sales invoices
List all invoices
Returns a paginated list of all sales invoices in the administration.
The filter
argument allows you to filter the list of invoices. Filters are a combination of keys and values,
separated by a comma: period:this_year,state:all
. The available options for filtering are:
Filter | Type | Default | Description |
state | String |
all |
all , draft , open , scheduled , pending_payment , late , reminded , paid or uncollectible |
period | String |
this_year |
This can either be the description of a period (this_month , prev_month , next_month , this_quarter , prev_quarter , next_quarter , this_year , prev_year , next_year ) or a custom period (201301..201302 , 20130101..20130131 ) |
reference | String |
Select invoices with a certain reference | |
contact_id | Integer |
Select invoices belonging to a certain contact | |
recurring_sales_invoice_id | Integer |
Select invoices created by a certain recurring invoice | |
workflow_id | Integer |
Select invoices that use a certain workflow | |
created_after | String |
Select invoices created after the given time (exclusive). ISO 8601 formatted string. The time to compare with is in UTC timezone | |
updated_after | String |
Select invoices updated after the given time (exclusive). ISO 8601 formatted string. The time to compare with is in UTC timezone |
You can filter by multiple states at the same time as well. To do this, separate the state values by a pipe: state:draft|scheduled
. This also holds for the reference.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
Example: returns all invoices of an administration
Request
Response
Example: returns all invoices filtered on period
Request
Response
Example: returns all invoices filtered on state
Request
Response
Example: returns paginated sales invoices on page 1
Request
Response
Example: returns paginated sales invoices on page 2
Request
Response
Example: returns an error when too many sales invoices are requested
Request
Response
Example: returns an error message if filter contact_id is not found
Request
Response
Example: returns all sales invoices created after given datetime
Request
Response
Example: returns only sales invoices updated after given datetime
Request
Response
List all ids and versions
Returns all sales invoices in the administration. The list contains the invoice id and the version of the invoice.
Check if the version of the invoice is newer than the version you have stored locally, use the POST
variant for fetching invoices with the given ids.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
Example: retrieves the id's for synchronization
Request
Response
Example: retrieves the id's for synchronization with a filter
Request
Response
Fetch sales invoices with given ids
Given a list of sales invoice ids, returns the sales invoice information belonging to the invoices. Returns a maximum of 100 invoice, even if more ids are provided.
Parameters
Parameter | Type | Description |
---|---|---|
ids |
Array[integer] |
Required |
Example: retrieves recurring sales invoices given by IDs
Request
Response
Example: retrieves sales invoices given by ids
Request
Response
Get an invoice by id
Returns a sales invoices in the administration.
Note that the link in the url
attribute will only work if viewing invoices online has been enabled and the invoice is not a draft.
Example: returns invoice by given id
Request
Response
Example: returns 404 when invoice does not exist
Request
Response
Get an invoice by invoice_id
Example: returns invoice by given id
Request
Response
Example: returns 404 when the given invoice_id does not exist
Request
Response
Get an invoice by reference
Example: returns invoice by given reference
Request
Response
Example: returns 404 when the given reference does not exist
Request
Response
Download sales invoice PDF by id
Redirects to the download URL of the sales invoice as PDF. The link is valid for 30 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
media |
String |
In case you want to hide sender address and logo you can set this to ‘stationery’. |
Example: returns invoice by given id as PDF
Request
Response
Example: returns 404 when invoice does not exist
Request
Response
Download sales invoice UBL by id
Download the sales invoice as UBL.
Example: returns invoice by given id as UBL
Request
Response
Example: returns 404 when invoice does not exist
Request
Response
Download sales invoice packing slip PDF by id
Redirects to the download URL of the sales invoice as packing slip PDF. The link is valid for 30 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
media |
String |
In case you want to hide sender address and logo you can set this to ‘stationery’. |
Example: returns invoice by given id as packing slip PDF
Request
Response
Example: returns 404 when invoice does not exist
Request
Response
Create a sales invoice
Parameters
Parameter | Type | Description |
---|---|---|
sales_invoice[contact_id] |
Integer |
Should be a valid contact id. |
sales_invoice[contact_person_id] |
Integer |
Should be a valid contact person id. |
sales_invoice[original_estimate_id] |
Integer |
|
sales_invoice[document_style_id] |
Integer |
Default document style is used if value is not provided. Should be a valid document style id. |
sales_invoice[workflow_id] |
Integer |
If value is not provided, the workflow saved in the contact is used. If the contact doesn’t have a default workflow, the administration’s default workflow is used. Should be a valid workflow id. |
sales_invoice[reference] |
String |
|
sales_invoice[invoice_sequence_id] |
String |
|
sales_invoice[invoice_date] |
String |
|
sales_invoice[first_due_interval] |
Integer |
|
sales_invoice[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
sales_invoice[prices_are_incl_tax] |
Boolean |
|
sales_invoice[payment_conditions] |
String |
|
sales_invoice[discount] |
Decimal |
Discount percentage, e.g. 10,0%. |
sales_invoice[details_attributes][id] |
Integer |
|
sales_invoice[details_attributes][description] |
String |
|
sales_invoice[details_attributes][period] |
String |
String with a date range: |
sales_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
sales_invoice[details_attributes][amount] |
String |
|
sales_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
sales_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
sales_invoice[details_attributes][project_id] |
Integer |
Should be a valid project id. |
sales_invoice[details_attributes][product_id] |
Integer |
Should be a valid product id. |
sales_invoice[details_attributes][time_entry_ids] |
Array[integer] |
|
sales_invoice[details_attributes][trip_ids] |
Array[integer] |
|
sales_invoice[details_attributes][row_order] |
Integer |
|
sales_invoice[details_attributes][_destroy] |
Boolean |
|
sales_invoice[details_attributes][automated_tax_enabled] |
Boolean |
|
sales_invoice[custom_fields_attributes][id] |
Integer |
Required |
sales_invoice[custom_fields_attributes][value] |
String |
Required |
from_checkout |
Boolean |
Example: create a basic sales invoice
Request
Response
Example: create a sales invoice in a foreign currency
Request
Response
Example: exceeding the monthly sales invoice limit on a free plan results in an error
Request
Response
Example: creating an invoice with an unknown custom field ID results in an error
Request
Response
Update a sales invoice
When updating a sales invoice, provide only the attributes you want to update. The other attributes will not be changed.
Parameters
Parameter | Type | Description |
---|---|---|
sales_invoice[contact_id] |
Integer |
Should be a valid contact id. |
sales_invoice[contact_person_id] |
Integer |
Should be a valid contact person id. |
sales_invoice[update_contact] |
Boolean |
|
sales_invoice[original_estimate_id] |
Integer |
|
sales_invoice[document_style_id] |
Integer |
Default document style is used if value is not provided. Should be a valid document style id. |
sales_invoice[workflow_id] |
Integer |
If value is not provided, the workflow saved in the contact is used. If the contact doesn’t have a default workflow, the administration’s default workflow is used. Should be a valid workflow id. |
sales_invoice[reference] |
String |
|
sales_invoice[invoice_sequence_id] |
String |
|
sales_invoice[remove_invoice_sequence_id] |
Boolean |
|
sales_invoice[invoice_date] |
String |
|
sales_invoice[first_due_interval] |
Integer |
|
sales_invoice[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
sales_invoice[prices_are_incl_tax] |
Boolean |
|
sales_invoice[payment_conditions] |
String |
|
sales_invoice[discount] |
Decimal |
Discount percentage, e.g. 10,0%. |
sales_invoice[details_attributes][id] |
Integer |
|
sales_invoice[details_attributes][description] |
String |
|
sales_invoice[details_attributes][period] |
String |
String with a date range: |
sales_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
sales_invoice[details_attributes][amount] |
String |
|
sales_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
sales_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
sales_invoice[details_attributes][project_id] |
Integer |
Should be a valid project id. |
sales_invoice[details_attributes][product_id] |
Integer |
Should be a valid product id. |
sales_invoice[details_attributes][time_entry_ids] |
Array[integer] |
|
sales_invoice[details_attributes][trip_ids] |
Array[integer] |
|
sales_invoice[details_attributes][row_order] |
Integer |
|
sales_invoice[details_attributes][_destroy] |
Boolean |
|
sales_invoice[details_attributes][automated_tax_enabled] |
Boolean |
|
sales_invoice[custom_fields_attributes][id] |
Integer |
Required |
sales_invoice[custom_fields_attributes][value] |
String |
Required |
Example: updating the sales invoice reference
Request
Response
Example: adding and removing a sales invoice detail
Request
Response
Delete a sales invoice
Parameters
Parameter | Type | Description |
---|---|---|
explain_destroy |
Boolean |
Example: deletes given invoice
Request
Response
Adds note to entity
Parameters
Parameter | Type | Description |
---|---|---|
note[note] |
String |
Required. Text for the note or to-do. |
note[todo] |
Boolean |
If |
note[assignee_id] |
Integer |
Assign to-do to user. Should be a valid user id. If assignee_id is provided the note will be a to-do. |
Example: create a note
Request
Response
Destroys note from entity
Example: destroy a note
Request
Response
Create a payment
Parameters
Parameter | Type | Description |
---|---|---|
payment[payment_date] |
String |
Required |
payment[price] |
Decimal |
Required Both a decimal and a string ‘10,95’ are accepted. Should be a number -1,000,000,000 <= n <= 1,000,000,000. |
payment[price_base] |
Decimal |
Amount paid expressed in the base currency. Required for foreign currencies. Should be a number -1,000,000,000 <= n <= 1,000,000,000. |
payment[financial_account_id] |
Integer |
Should be a valid financial account id. |
payment[financial_mutation_id] |
Integer |
Should be a valid financial mutation id. |
payment[transaction_identifier] |
String |
|
payment[manual_payment_action] |
String |
Can be |
payment[ledger_account_id] |
Integer |
Should be a valid ledger account id. |
payment[invoice_id] |
Integer |
Example: create a payment
Request
Response
Delete a payment
Example: destroy a payment
Request
Response
Download attachment
Download the attachment. The response will be a redirect to a temporarily available URL
where the attachment can be downloaded. Use the Location
header in the response
to download the attachment.
Delete an attachment
Deletes an attachment of an attachable.
Sends an invoice
This endpoint provides two options: sending the invoice and scheduling sending in the future. When sending now, you can provide a send method, email address and message. If you don’t provide any arguments, the defaults from the contact and workflow will be used.
When scheduling sending, set the boolean sending_scheduled
to true and provide an invoice_date
.
Parameters
Parameter | Type | Description |
---|---|---|
sales_invoice_sending[delivery_method] |
String |
Can be |
sales_invoice_sending[sending_scheduled] |
Boolean |
|
sales_invoice_sending[deliver_ubl] |
Boolean |
|
sales_invoice_sending[mergeable] |
Boolean |
|
sales_invoice_sending[email_address] |
String |
|
sales_invoice_sending[email_message] |
String |
|
sales_invoice_sending[invoice_date] |
String |
Example: sends an invoice
Request
Response
Example: returns error when sending invalid invoice without details
Request
Response
Example: returns error when sending invoice from identity without email
Request
Response
Example: returns error when sending invoice to contact without email address
Request
Response
Example: sends an invoice with alternative information
Request
Response
Example: sends an invoice via mail with an UBL attachment
Request
Response
Example: schedule sending
Request
Response
DEPRECATED: Register a payment
This endpoint is deprecated and should no longer be used. It has been replaced by Create a payment.
Parameters
Parameter | Type | Description |
---|---|---|
payment[payment_date] |
String |
Required |
payment[price] |
Decimal |
Required Both a decimal and a string ‘10,95’ are accepted. Should be a number -1,000,000,000 <= n <= 1,000,000,000. |
payment[price_base] |
Decimal |
Amount paid expressed in the base currency. Required for foreign currencies. Should be a number -1,000,000,000 <= n <= 1,000,000,000. |
payment[financial_account_id] |
Integer |
Should be a valid financial account id. |
payment[financial_mutation_id] |
Integer |
Should be a valid financial mutation id. |
payment[transaction_identifier] |
String |
|
payment[manual_payment_action] |
String |
Can be |
payment[ledger_account_id] |
Integer |
Should be a valid ledger account id. |
payment[invoice_id] |
Integer |
Example: registers payments
Request
Response
Register a payment for a creditinvoice
Example: registers payments for a credit invoice
Request
Response
Sends a reminder
This endpoint sends a reminder to a contact. A reminder can contain multiple sales invoices. Reminders are grouped by workflow, identity and document style, so a contact with sales invoices with different workflows, will receive multiple reminders. Only by grouping reminders like this, we can assure the right content and layout of a reminder.
Parameters
Parameter | Type | Description |
---|---|---|
sales_invoice_reminders |
Array |
Required |
sales_invoice_reminders[contact_id] |
Integer |
Required |
sales_invoice_reminders[workflow_id] |
Integer |
Required |
sales_invoice_reminders[identity_id] |
Integer |
Required |
sales_invoice_reminders[document_style_id] |
Integer |
Required |
sales_invoice_reminders[sales_invoice_ids] |
Array |
Required |
sales_invoice_reminders[reminder_text] |
String |
|
sales_invoice_reminders[delivery_method] |
String |
|
sales_invoice_reminders[email_address] |
String |
Example: sends reminders for given invoices
Request
Response
Example: returns an error when invalid parameters are given
Request
Response
Example: returns an error if delivery_method Simplerinvoicing is given
Request
Response
Example: sends via Email if contact has delivery_method Simplerinvoicing
Request
Response
Pause sales invoice
This endpoint pauses a sales invoice. The automatic workflow steps will not be executed while the sales invoice is paused.
Resume sales invoice
This endpoint resumes the sales invoice. The automatic workflow steps will execute again after resuming.
Duplicate to credit invoice
Mark as dubious
This endpoint marks a sales invoice as dubious.
Parameters
Parameter | Type | Description |
---|---|---|
dubious_date |
Date |
Mark as uncollectible
This endpoint marks a sales invoice as uncollectible.
Parameters
Parameter | Type | Description |
---|---|---|
uncollectible_date |
Date |
|
book_method |
String |
Can be |