Returns list of the budgets of the user in the specific company
[
{
"id": 1,
"user_id": 1,
"approver_id": 1,
"name": "Travel Budget",
"start_date": "28-11-2022",
"end_date": "28-12-2022",
"amount": "20.00",
"amount_currency": "EUR",
"used_amount": "15.00",
"state": "approved",
"lines": [
{
"id": 1,
"amount": "10.00",
"amount_currency": "EUR",
"expense_account_id": 1
},
{
"id": 2,
"amount": "10.00",
"amount_currency": "EUR",
"expense_account_id": 1
}
]
"cost_centers": [
{
"id": 1,
"dimension_name": "Project",
"name": "Some project 1",
"deactivated": false
}
],
"documents": [
{
"id": 1,
"name": "agenda.pdf",
"file": "https://example.com/agenda.pdf"
}
]
}
]
| Param name | Description |
|---|---|
|
page
optional |
Page number Validations:
|
|
per_page
optional |
Number of records per page. Default: 30 Validations:
|
|
q
optional |
Pass query to filter budgets by total amount or name. Validations:
|
|
user_id
optional |
Pass user_id to get budgets of that user. Validations:
|
|
state
optional |
Pass state to get budgets with that state. Validations:
|
|
date_range
optional |
Show all budgets that have either star_date or end_date within the date range. Date range format: “DD/MM/YYYY - DD/MM/YYYY” (example: 01/12/2023 - 12/12/2023) Validations:
|
|
sort_by
optional |
Return budgets sorted by following fields: user_name, state, start_date, end_date, approver_name. Default: approver_id. Validations:
|
|
order
optional |
Order budgets ascending or descending based on sort param. Default: asc Validations:
|
Create budget
| Param name | Description |
|---|---|
|
budget
required |
Budget parameters. Validations:
|
|
budget[name]
required |
Budget name. Validations:
|
|
budget[description]
optional |
Budget description. Maximum length: 1500 characters. Validations:
|
|
budget[start_date]
required |
Budget’s start date, e.g. 2024-12-01. Must be in the future. Cannot overlap with existing budgets with the same user & expense account combination. Validations:
|
|
budget[end_date]
required |
Budget’s end date, e.g. 2024-12-31. Must be in the future. Cannot overlap with existing budgets with the same user & expense account combination. Validations:
|
|
budget[cost_center_ids]
optional |
Cost center IDs. No more than one cost center ID per dimension. Validations:
|
|
budget[user_id]
optional |
User ID. Current user ID by default. Only managers can create budgets on behalf of other users. Validations:
|
|
budget[approver_id]
optional |
ID of user who is to approve the budget. By default, user’s first approver will be used. If there is no approval cycle behind the user, company’s default approver will be used. Validations:
|
|
budget[lines_attributes]
required |
Budget lines’ parameters. At least one line must be present. Validations:
|
|
budget[lines_attributes][amount]
required |
Line amount as a decimal number, e.g. “123.55”. Validations:
|
|
budget[lines_attributes][amount_currency]
optional |
Amount currency, e.g. “EUR”. Set to company currency by default. Validations:
|
|
budget[lines_attributes][expense_account_id]
required |
Expense account (aka purchase type) for the budget line. Validations:
|
Update budget. Approved budgets cannot be updated. Successful update of a disapproved budget returns it to pending state.
| Param name | Description |
|---|---|
|
id
required |
Budget ID Validations:
|
|
budget
required |
Budget parameters. Validations:
|
|
budget[name]
required |
Budget name. Validations:
|
|
budget[description]
optional |
Budget description. Maximum length: 1500 characters. Validations:
|
|
budget[start_date]
required |
Budget’s start date, e.g. 2024-12-01. Must be in the future. Cannot overlap with existing budgets with the same user & expense account combination. Validations:
|
|
budget[end_date]
required |
Budget’s end date, e.g. 2024-12-31. Must be in the future. Cannot overlap with existing budgets with the same user & expense account combination. Validations:
|
|
budget[cost_center_ids]
optional |
Cost center IDs. No more than one cost center ID per dimension. Validations:
|
|
budget[user_id]
optional |
User ID. Current user ID by default. Only managers can create budgets on behalf of other users. Validations:
|
|
budget[approver_id]
optional |
ID of user who is to approve the budget. By default, user’s first approver will be used. If there is no approval cycle behind the user, company’s default approver will be used. Validations:
|
|
budget[lines_attributes]
required |
Budget lines’ parameters. At least one line must be present. Validations:
|
|
budget[lines_attributes][amount]
required |
Line amount as a decimal number, e.g. “123.55”. Validations:
|
|
budget[lines_attributes][amount_currency]
optional |
Amount currency, e.g. “EUR”. Set to company currency by default. Validations:
|
|
budget[lines_attributes][expense_account_id]
required |
Expense account (aka purchase type) for the budget line. Validations:
|
| Param name | Description |
|---|---|
|
id
required |
Budget ID Validations:
|