GET /api/transactions
Get the list of receipts

Get the list of all receipts accessible to user. Can be paginated and/or filtered by receipt state

Params

Param name Description
page
optional

Return only one page of receipts. Default per-page is 10

Validations:

  • Must be Integer

per_page
optional

Number of receipts returned per page. Works only in combination with “page” param. Default value is 10

Validations:

  • Must be Integer

state
optional

Validations:

  • Must be one of: draft, unapproved, accounting, reviewing.


POST /api/transactions
Create receipt

Creates new receipt. Also, auto-applies account rules

Params

Param name Description
draft
optional

Whether created receipt should be in draft state. If the value of this param is 1, receipt will be saved as draft and will not be validated; otherwise, it will be either in reviewing or queue state (depending on whether its user has approvers or not).

Validations:

  • Must be Integer

transaction
required

Receipt hash

Validations:

  • Must be a Hash

transaction[description]
required

Receipt description

Validations:

  • Must be String

transaction[date]
required

Receipt description

Validations:

  • Must be String

transaction[credit_account_id]
required

Validations:

  • Must be Integer

transaction[debit_account_id]
required

Validations:

  • Must be Integer

transaction[vat_code]
optional , nil allowed

Validations:

  • Must be one of: EVTO, EVPO, EVKV, EUOS, EUPO, EUUO, KOOS.

transaction[attachment_ids]
optional , nil allowed

Validations:

  • Must be an array of Integer

transaction[cost_center_ids]
optional , nil allowed

Validations:

  • Must be an array of Integer

transaction[vat_lines_attributes]
required

VAT lines

Validations:

  • Must be an Array of nested elements

transaction[vat_lines_attributes][taxable]
required

Taxable amount, e.g. 95.5

Validations:

  • Must be String

transaction[vat_lines_attributes][tax_percentage]
required

VAT percentage, e.g. “0.14” for 14%

Validations:

  • Must be String

transaction[vat_lines_attributes][currency]
required

VAT line currency code, e.g. “EUR”

Validations:

  • Must be String


PUT /api/transactions/:id/approve
Approve Receipt

Approves receipt. If “transaction” params are present, updates the receipt before approval

Params

Param name Description
transaction
required

Receipt hash

Validations:

  • Must be a Hash

transaction[description]
optional

Receipt description

Validations:

  • Must be String

transaction[date]
optional

Receipt description

Validations:

  • Must be String

transaction[credit_account_id]
optional

Validations:

  • Must be Integer

transaction[debit_account_id]
optional

Validations:

  • Must be Integer

transaction[vat_code]
optional , nil allowed

Validations:

  • Must be one of: EVTO, EVPO, EVKV, EUOS, EUPO, EUUO, KOOS.

transaction[attachment_ids]
optional , nil allowed

Validations:

  • Must be an array of Integer

transaction[cost_center_ids]
optional , nil allowed

Validations:

  • Must be an array of Integer

transaction[vat_lines_attributes]
optional

VAT lines

Validations:

  • Must be an Array of nested elements

transaction[vat_lines_attributes][taxable]
optional

Taxable amount, e.g. 95.5

Validations:

  • Must be String

transaction[vat_lines_attributes][tax_percentage]
optional

VAT percentage, e.g. “0.14” for 14%

Validations:

  • Must be String

transaction[vat_lines_attributes][currency]
optional

VAT line currency code, e.g. “EUR”

Validations:

  • Must be String


POST /api/transactions/:id/disapprove
Disapprove receipt

Disapprove receipt with comment

Params

Param name Description
comment
optional

Validations:

  • Must be a Hash

comment[comment]
optional

The reason of receipt disapproval; will be displayed to user

Validations:

  • Must be String