GET /api/accounts
Get accounts list

Gets accounts list, both access and expense accounts

Supported Formats

json

Examples

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

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 String

account[code]
required

Account code.

Validations:

  • Must be 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 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 Hash