Documents: Receipts
List ids and versions of receipts
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 receipts 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 receipts
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 receipts
Request
Response
Example: returns paginated receipts on page 1
Request
Response
Example: returns paginated receipts on page 2
Request
Response
Example: returns an error when too many receipts are requested
Request
Response
Get receipts
Example: returns the wanted receipt
Request
Response
Example: only returns receipts
Request
Response
Create a new receipts
Parameters
Parameter | Type | Description |
---|---|---|
receipt[contact_id] |
Integer |
Required. Should be a valid contact id. |
receipt[reference] |
String |
Required. |
receipt[date] |
String |
Required Required. |
receipt[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
receipt[prices_are_incl_tax] |
Boolean |
|
receipt[origin] |
String |
Can be |
receipt[details_attributes][id] |
Integer |
|
receipt[details_attributes][description] |
String |
|
receipt[details_attributes][period] |
String |
String with a date range: |
receipt[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
receipt[details_attributes][amount] |
String |
|
receipt[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
receipt[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
receipt[details_attributes][project_id] |
Integer |
Should be a valid project id. |
receipt[details_attributes][row_order] |
Integer |
|
receipt[details_attributes][_destroy] |
Boolean |
|
payment[financial_account_id] |
Integer |
Should be a valid financial account id. |
Example: creates the receipt
Request
Response
Example: requires all input
Request
Response
Delete a receipts
Parameters
Parameter | Type | Description |
---|---|---|
refresh_journal_entries |
Boolean |
Example: deletes the receipt
Request
Response
Update a receipts
Parameters
Parameter | Type | Description |
---|---|---|
receipt[contact_id] |
Integer |
Required. Should be a valid contact id. |
receipt[reference] |
String |
Required. |
receipt[date] |
String |
Required Required. |
receipt[currency] |
String |
ISO three-character currency code, e.g. EUR or USD. |
receipt[prices_are_incl_tax] |
Boolean |
|
receipt[origin] |
String |
Can be |
receipt[details_attributes][id] |
Integer |
|
receipt[details_attributes][description] |
String |
|
receipt[details_attributes][period] |
String |
String with a date range: |
receipt[details_attributes][price] |
Decimal |
Both a decimal and a string ‘10,95’ are accepted. |
receipt[details_attributes][amount] |
String |
|
receipt[details_attributes][tax_rate_id] |
Integer |
Should be a valid tax rate id. |
receipt[details_attributes][ledger_account_id] |
Integer |
Should be a valid ledger account id. |
receipt[details_attributes][project_id] |
Integer |
Should be a valid project id. |
receipt[details_attributes][row_order] |
Integer |
|
receipt[details_attributes][_destroy] |
Boolean |
|
payment[financial_account_id] |
Integer |
Should be a valid financial account id. |
Example: updates the receipt
Request
Response
Example: updates the receipt details
Request
Response
DEPRECATED: Register a payment for a receipt
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
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 receipt
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. |