External sales invoices
List all external invoices
Returns a paginated list of all sales invoices in the administration.
The filter
argument allows you to filter the list of external 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 , new , open , late , or paid |
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 ) |
contact_id | Integer |
Select invoices belonging to a certain contact |
You can filter by multiple states at the same time as well. To do this, separate the state values by a pipe: state:new|open
.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
Example: returns all external sales 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 external sales invoices on page 1
Request
Response
Example: returns paginated external sales invoices on page 2
Request
Response
Example: returns an error when too many external sales invoices are requested
Request
Response
Example: returns an error message if filter contact_id is not found
Request
Response
Get an external sales invoice by id
Returns an external sales invoices in the administration.
Example: returns invoice by given id
Request
Response
Example: returns 404 when invoice does not exist
Request
Response
Create an external sales invoice
Parameters
Parameter | Type | Description |
---|---|---|
external_sales_invoice[contact_id] |
Integer |
Should be a valid contact id. |
external_sales_invoice[reference] |
String |
|
external_sales_invoice[date] |
String |
|
external_sales_invoice[due_date] |
String |
|
external_sales_invoice[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
external_sales_invoice[prices_are_incl_tax] |
Boolean |
|
external_sales_invoice[source] |
String |
|
external_sales_invoice[source_url] |
String |
|
external_sales_invoice[details_attributes][id] |
Integer |
|
external_sales_invoice[details_attributes][description] |
String |
|
external_sales_invoice[details_attributes][period] |
String |
String with a date range: |
external_sales_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
external_sales_invoice[details_attributes][amount] |
String |
|
external_sales_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
external_sales_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
external_sales_invoice[details_attributes][project_id] |
Integer |
Should be a valid project id. |
external_sales_invoice[details_attributes][row_order] |
Integer |
|
external_sales_invoice[details_attributes][_destroy] |
Boolean |
Example: create a basic external sales invoice
Request
Response
Example: create an external sales invoice in a foreign currency
Request
Response
Create external sales invoice from attachment
Example: creates a new external sales invoice when uploading an attachment
Request
Response
Add attachment to external sales invoice
Example: adds an attachment to an existing external sales invoice
Request
Response
Update an external sales invoice
When updating an external sales invoice, provide only the attributes you want to update. The other attributes will not be changed.
Parameters
Parameter | Type | Description |
---|---|---|
external_sales_invoice[contact_id] |
Integer |
Should be a valid contact id. |
external_sales_invoice[reference] |
String |
|
external_sales_invoice[date] |
String |
|
external_sales_invoice[due_date] |
String |
|
external_sales_invoice[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
external_sales_invoice[prices_are_incl_tax] |
Boolean |
|
external_sales_invoice[source] |
String |
|
external_sales_invoice[source_url] |
String |
|
external_sales_invoice[details_attributes][id] |
Integer |
|
external_sales_invoice[details_attributes][description] |
String |
|
external_sales_invoice[details_attributes][period] |
String |
String with a date range: |
external_sales_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
external_sales_invoice[details_attributes][amount] |
String |
|
external_sales_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
external_sales_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
external_sales_invoice[details_attributes][project_id] |
Integer |
Should be a valid project id. |
external_sales_invoice[details_attributes][row_order] |
Integer |
|
external_sales_invoice[details_attributes][_destroy] |
Boolean |
Example: updating the invoice reference
Request
Response
Example: adding and removing an invoice detail
Request
Response
Delete an external sales invoice
Example: deletes given invoice
Request
Response
Mark as dubious
This endpoint marks an external sales invoice as dubious.
Parameters
Parameter | Type | Description |
---|---|---|
dubious_date |
Date |
Mark as uncollectible
This endpoint marks an external sales invoice as uncollectible.
Parameters
Parameter | Type | Description |
---|---|---|
uncollectible_date |
Date |
|
book_method |
String |
Can be |
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.