Documents: Purchase invoices
List ids and versions of purchase invoices
Returns all documents in the administration. The list contains the document id and the version of the document.
Check if the version of the document is newer than the version you have stored locally, use the POST
variant for fetching documents with the given ids.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
String terms, example: key1:value1,key2:value2. |
Example: retrieves all ids for synchronization
Request
Response
Example: retrieves all ids for synchronization using a filter
Request
Response
Fetch purchase invoices with given ids
Given a list of document ids, returns the document information belonging to the documents. Returns a maximum of 100 documents, even if more ids are provided.
Parameters
Parameter | Type | Description |
---|---|---|
ids |
Array[integer] |
Required |
Example: retrieves documents for given ids
Request
Response
Get purchase invoices
Returns a paginated list of documents of this type in the administration.
The filter
argument allows you to filter on the list of documents. Filters are a combination of keys and values,
separated by a comma: key:value,key2:value2
. The most common filter method will be period
: period:this_month
.
Filtering works the same as in the web application, for more advanced examples, change the filtering in the web
application and learn from the resulting URI.
Parameters
Parameter | Type | Description |
---|---|---|
filter |
String |
Required String terms, example: |
new_filter |
String |
String terms, example: |
page |
Integer |
|
per_page |
Integer |
|
exclude_new_general_journal_documents |
Boolean |
Example: returns a list of purchase_invoices
Request
Response
Example: returns paginated purchase invoices on page 1
Request
Response
Example: returns paginated purchase invoices on page 2
Request
Response
Example: returns an error when too many purchase invoices are requested
Request
Response
Get purchase invoices
Example: returns the wanted purchase_invoice
Request
Response
Example: only returns purchase_invoices
Request
Response
Create a new purchase invoices
Parameters
Parameter | Type | Description |
---|---|---|
purchase_invoice[contact_id] |
Integer |
Required. Should be a valid contact id. |
purchase_invoice[reference] |
String |
Required. |
purchase_invoice[date] |
String |
Required Required. |
purchase_invoice[due_date] |
String |
|
purchase_invoice[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
purchase_invoice[prices_are_incl_tax] |
Boolean |
|
purchase_invoice[revenue_invoice] |
Boolean |
|
purchase_invoice[details_attributes][id] |
Integer |
|
purchase_invoice[details_attributes][description] |
String |
|
purchase_invoice[details_attributes][period] |
String |
String with a date range: |
purchase_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
purchase_invoice[details_attributes][amount] |
String |
|
purchase_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
purchase_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
purchase_invoice[details_attributes][project_id] |
Integer |
Should be a valid project id. |
purchase_invoice[details_attributes][row_order] |
Integer |
|
purchase_invoice[details_attributes][_destroy] |
Boolean |
Example: creates the purchase_invoice
Request
Response
Example: requires all input
Request
Response
Delete a purchase invoices
Parameters
Parameter | Type | Description |
---|---|---|
refresh_journal_entries |
Boolean |
Example: deletes the purchase_invoice
Request
Response
Update a purchase invoices
Parameters
Parameter | Type | Description |
---|---|---|
purchase_invoice[contact_id] |
Integer |
Required. Should be a valid contact id. |
purchase_invoice[reference] |
String |
Required. |
purchase_invoice[date] |
String |
Required Required. |
purchase_invoice[due_date] |
String |
|
purchase_invoice[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
purchase_invoice[prices_are_incl_tax] |
Boolean |
|
purchase_invoice[revenue_invoice] |
Boolean |
|
purchase_invoice[details_attributes][id] |
Integer |
|
purchase_invoice[details_attributes][description] |
String |
|
purchase_invoice[details_attributes][period] |
String |
String with a date range: |
purchase_invoice[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
purchase_invoice[details_attributes][amount] |
String |
|
purchase_invoice[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
purchase_invoice[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
purchase_invoice[details_attributes][project_id] |
Integer |
Should be a valid project id. |
purchase_invoice[details_attributes][row_order] |
Integer |
|
purchase_invoice[details_attributes][_destroy] |
Boolean |
Example: updates the purchase_invoice
Request
Response
Example: updates invoice details
Request
Response
DEPRECATED: Register a payment for a purchase invoice
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 |
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 |
Delete a payment
Add attachment to purchase invoice
Example: uploads an attachment
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.
Example: destroys an attachment
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. |