GET /api/transactions/:id
Show transaction details


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 a String

transaction[participants]
optional , nil allowed

Additional description (e.g. participants). Required based on ExpenseAccount settings

Validations:

  • Must be a String

transaction[date]
optional

Receipt date

Validations:

  • Must be a String

transaction[credit_account_id]
optional

Validations:

  • Must be a Integer

transaction[vendor_id]
optional , nil allowed

Vendor ID (optional)

Validations:

  • Must be a Integer

transaction[printed_id]
optional , nil allowed

Printed receipt ID (optional)

Validations:

  • Must be a String

transaction[attachment_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 a String

transaction[vat_lines_attributes][tax_percentage]
optional

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

Validations:

  • Must be a String

transaction[vat_lines_attributes][vat_id]
optional , nil allowed

VAT ID

Validations:

  • Must be a Integer

transaction[vat_lines_attributes][currency]
optional

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

Validations:

  • Must be a String

transaction[vat_lines_attributes][expense_account_id]
optional

Expense account ID per VAT line, required for the 1st line, optional for 2nd+

Validations:

  • Must be a Integer

transaction[vat_lines_attributes][cost_center_ids]
optional , nil allowed

If the values for the 2nd+ VAT line is not provided, they will be copied from the 1st line

Validations:

  • Must be an array of Integer

transaction[vat_lines_attributes][vat_code_id]
optional , nil allowed

VAT code ID (either global or company-specific).

If the value for the 2nd+ VAT line is not provided, it will be copied from the 1st line

Validations:

  • Must be a Integer


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

Disapprove expense with a comment

Params

Param name Description
comment
optional

The reason of expense disapproval; will be displayed to user

Validations:

  • Must be a String


GET /api/transactions/:id/conditional_values
Get values for the conditional fields of the transaction


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
archived_after
optional

Return only receipts accounted on and after the supplied date. Date format: YYYYMMDD (example: 20180702)

Validations:

  • Must be a String

page
optional

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

Validations:

  • Must be a Integer

per_page
optional

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

Validations:

  • Must be a Integer

state
optional

Validations:

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


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 a Integer

transaction
required

Receipt hash

Validations:

  • Must be a Hash

transaction[description]
required

Receipt description

Validations:

  • Must be a String

transaction[participants]
optional , nil allowed

Additional description (e.g. participants). Required based on ExpenseAccount settings

Validations:

  • Must be a String

transaction[date]
required

Receipt date

Validations:

  • Must be a String

transaction[credit_account_id]
required

Validations:

  • Must be a Integer

transaction[vendor_id]
optional , nil allowed

Vendor ID (optional)

Validations:

  • Must be a Integer

transaction[printed_id]
optional , nil allowed

Printed receipt ID (optional)

Validations:

  • Must be a String

transaction[attachment_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 a String

transaction[vat_lines_attributes][tax_percentage]
required

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

Validations:

  • Must be a String

transaction[vat_lines_attributes][vat_id]
optional , nil allowed

VAT ID

Validations:

  • Must be a Integer

transaction[vat_lines_attributes][currency]
required

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

Validations:

  • Must be a String

transaction[vat_lines_attributes][expense_account_id]
required

Expense account ID per VAT line, required for the 1st line, optional for 2nd+

Validations:

  • Must be a Integer

transaction[vat_lines_attributes][cost_center_ids]
optional , nil allowed

If the values for the 2nd+ VAT line is not provided, they will be copied from the 1st line

Validations:

  • Must be an array of Integer

transaction[vat_lines_attributes][vat_code_id]
optional , nil allowed

VAT code ID (either global or company-specific).

If the value for the 2nd+ VAT line is not provided, it will be copied from the 1st line

Validations:

  • Must be a Integer


POST /api/transactions/:id/approvers
Set transaction-specific approval cycle

Sets transaction-specific approval cycle. Resets transaction approved_by field, sends transaction back to “reviewing” state.

Examples

Params for adding new transaction-specific approval cycle, 3 approvers:
{"approvers":
  [
    {"operator": "then", "approver_id":2},
    {"operator": "then", "approver_id":266},
    {"operator": "or", "approver_id":19,}
  ]
}
    

Params

Param name Description
approvers
required

Validations:

  • Must be an Array of nested elements

approvers[operator]
required

Operator specifying approver process logic

Validations:

  • Must be one of: then, or.

approvers[approver_id]
required

Approver’s user id

Validations:

  • Must be a Integer

approvers[id]
optional

User approver id, required if user approver already exists. If it’s not supplied, new user approver will be added

Validations:

  • Must be a Integer


PUT /api/transactions/:id/set_paid_at
Mark receipt as paid or not paid

Can be used to mark the receipt as paid by setting a specific date & time of the payment, or mark the receipt as not paid by setting it to null.

Can only be used for accounted receipts or receipts in queue.

Supported Formats

json

Examples

{"paid_at":"2023-12-14 23:00 Z"}
{"paid_at":null}

Params

Param name Description
paid_at
optional

Timestamp in YYYY-MM-DD HH:MM Z format, e.g. "2023-12-18 11:21 Z". Always in UTC.

Validations:

  • Must be a String