GET /api/accounts
Get accounts list

Gets accounts list, both asset and expense accounts

Supported Formats

json

Examples

[
  {
    "id": 3,
    "code": "1900",
    "accountable_type": "AssetAccount",
    "name": "Another Asset Account",
    "url": "https://app.bezala.com/api/accounts/3",
    "assignee_ids": [2],
    "position": 1,
    "default_vat_id": null,
    "deactivated": false,
    "external_id": null
  },
  {
    "id": 66,
    "code": "7680",
    "accountable_type": "ExpenseAccount",
    "name": "[DEACTIVATED] Atk-laitteet (<3v. kalusto)",
    "url": "https://app.bezala.com/api/accounts/66",
    "assignee_ids": [3, 4, 5],
    "position": 25,
    "default_vat_id": 4,
    "deactivated": true,
    "show_on_receipt_form": true,
    "external_id": "768000"
  }
] 

POST /api/accounts
Create account

Create account

Examples

{
  "account": {
    "name": "Blaname",
    "code": "1234",
    "accountable_type": "AssetAccount",
    "assignee_ids": [1, 2, 55]
  }
}
    

Params

Param name Description
account
required

Validations:

  • Must be a Hash

account[name]
required

Account name.

Validations:

  • Must be a String

account[code]
required

Account code.

Validations:

  • Must be a String

account[deactivated]
optional , nil allowed

Whether account should be hidden from transaction form. Default: false. Possible values: either 1 or 0.

Validations:

  • Must be a Integer

account[accountable_type]
required

Accepts string with the type of account: either “AssetAccount” or “ExpenseAccount”.

Validations:

  • Must be one of: AssetAccount, ExpenseAccount.

account[default_vat_id]
optional , nil allowed

Validations:

  • Must be a Integer

account[assignee_ids]
optional , nil allowed

Ids of users assigned to this account. Passing nil here will remove all assignees.

Validations:

  • Must be an array of Integer

account[netsuite]
optional , nil allowed

NetSuite settings in free form hash

Validations:

  • Must be a Hash

account[limit]
optional , nil allowed

For Expense Account only. Combined receipts total amount limit in company currency per user for this Expense Account.

Validations:

  • Must be a Integer

account[limit_type]
optional , nil allowed

For Expense Account only.

Validations:

  • Must be one of: yearly, monthly, daily.

account[show_participants_field]
optional , nil allowed

For Expense Account only. Show participants field (with label Participants) on Receipt form when that Expense Account is selected. Defaults to false

Validations:

  • Must be one of: true, false, 1, 0.

account[show_on_receipt_form]
optional , nil allowed

For Expense Account only. Allow selecting the account as Purchase type on Receipt form. Default: true.

Validations:

  • Must be one of: true, false, 1, 0.


PUT /api/accounts/:id/toggle_deactivated
Activate or Deactivate account

Toggle deactivated field of account