Approves expense. If params of the expense are present, updates the expense before approval
Disapprove expense with a comment
| Param name | Description |
|---|---|
|
comment
optional |
The reason of expense disapproval; will be displayed to user Validations:
|
Get the list of all daily allowances accessible by the current user. Can be paginated and/or filtered by daily allowance state
| Param name | Description |
|---|---|
|
archived_after
optional |
Return only daily allowances accounted on and after the supplied date. Date format: YYYYMMDD (example: 20180702) Validations:
|
|
page
optional |
Return only one page of daily allowances. Default per-page is 10 Validations:
|
|
per_page
optional |
Number of daily allowances returned per page. Works only in combination with “page” param. Default value is 10 Validations:
|
|
state
optional |
Validations:
|
Creates a new daily allowance
| Param name | Description |
|---|---|
|
draft
optional |
If 1, the daily allowance is saved as a draft without validation. Validations:
|
|
daily_allowance
required |
Daily allowance hash Validations:
|
|
daily_allowance[description]
required |
Daily allowance description Validations:
|
|
daily_allowance[date]
optional , nil allowed |
Daily allowance date Validations:
|
|
daily_allowance[cost_center_ids]
optional , nil allowed |
Legacy/mobile only: cost center IDs applied to the first (or only) line. Ignored when “lines_attributes” is supplied Validations:
|
|
daily_allowance[lines_attributes]
optional , nil allowed |
Cost-center split lines. Each line carries its own cost centers and a percentage share of the cost; percentages must sum to exactly 1.0. Omit to keep legacy single cost-center behavior via “cost_center_ids”. Validations:
|
|
daily_allowance[lines_attributes][id]
optional , nil allowed |
Line ID (required for update) Validations:
|
|
daily_allowance[lines_attributes][percentage]
required |
Share of the cost as a fraction, e.g. “0.6” for 60% Validations:
|
|
daily_allowance[lines_attributes][cost_center_ids]
optional , nil allowed |
Cost center IDs for this line Validations:
|
|
daily_allowance[lines_attributes][_destroy]
optional , nil allowed |
Set to true to remove this line on update Validations:
|
|
daily_allowance[entries_attributes]
required |
Daily allowance entries (country + time range) Validations:
|
|
daily_allowance[entries_attributes][id]
optional , nil allowed |
Entry ID (required for update) Validations:
|
|
daily_allowance[entries_attributes][country_id]
required |
ID of the Allowance country Validations:
|
|
daily_allowance[entries_attributes][start_time]
required |
Entry start time Validations:
|
|
daily_allowance[entries_attributes][end_time]
required |
Entry end time Validations:
|
|
daily_allowance[free_meal_days_attributes]
optional , nil allowed |
Free meal days Validations:
|
|
daily_allowance[free_meal_days_attributes][id]
optional , nil allowed |
Free meal day ID (for updates) Validations:
|
|
daily_allowance[free_meal_days_attributes][date]
required |
Date in YYYY-MM-DD format Validations:
|
|
daily_allowance[free_meal_days_attributes][is_full]
optional , nil allowed |
Whether the day is a full day Validations:
|
|
daily_allowance[free_meal_days_attributes][had_breakfast]
optional , nil allowed |
Whether breakfast was provided Validations:
|
|
daily_allowance[free_meal_days_attributes][had_lunch]
optional , nil allowed |
Whether lunch was provided Validations:
|
|
daily_allowance[free_meal_days_attributes][had_dinner]
optional , nil allowed |
Whether dinner was provided Validations:
|
|
daily_allowance[free_meal_days_attributes][breakfast_is_taxable]
optional , nil allowed |
Whether breakfast is taxable (Swedish calculator only) Validations:
|
|
daily_allowance[free_meal_days_attributes][lunch_is_taxable]
optional , nil allowed |
Whether lunch is taxable (Swedish calculator only) Validations:
|
|
daily_allowance[free_meal_days_attributes][dinner_is_taxable]
optional , nil allowed |
Whether dinner is taxable (Swedish calculator only) Validations:
|
Updates a daily allowance
| Param name | Description |
|---|---|
|
draft
optional |
If 1, a draft daily allowance is left as a draft without validation. Validations:
|
|
daily_allowance
required |
Daily allowance hash Validations:
|
|
daily_allowance[description]
optional |
Daily allowance description Validations:
|
|
daily_allowance[date]
optional , nil allowed |
Daily allowance date Validations:
|
|
daily_allowance[cost_center_ids]
optional , nil allowed |
Legacy/mobile only: cost center IDs applied to the first (or only) line. Ignored when “lines_attributes” is supplied Validations:
|
|
daily_allowance[lines_attributes]
optional , nil allowed |
Cost-center split lines. Each line carries its own cost centers and a percentage share of the cost; percentages must sum to exactly 1.0. Omit to keep legacy single cost-center behavior via “cost_center_ids”. Validations:
|
|
daily_allowance[lines_attributes][id]
optional , nil allowed |
Line ID (required for update) Validations:
|
|
daily_allowance[lines_attributes][percentage]
optional |
Share of the cost as a fraction, e.g. “0.6” for 60% Validations:
|
|
daily_allowance[lines_attributes][cost_center_ids]
optional , nil allowed |
Cost center IDs for this line Validations:
|
|
daily_allowance[lines_attributes][_destroy]
optional , nil allowed |
Set to true to remove this line on update Validations:
|
|
daily_allowance[entries_attributes]
optional |
Daily allowance entries (country + time range) Validations:
|
|
daily_allowance[entries_attributes][id]
optional , nil allowed |
Entry ID (required for update) Validations:
|
|
daily_allowance[entries_attributes][country_id]
optional |
ID of the Allowance country Validations:
|
|
daily_allowance[entries_attributes][start_time]
optional |
Entry start time Validations:
|
|
daily_allowance[entries_attributes][end_time]
optional |
Entry end time Validations:
|
|
daily_allowance[free_meal_days_attributes]
optional , nil allowed |
Free meal days Validations:
|
|
daily_allowance[free_meal_days_attributes][id]
optional , nil allowed |
Free meal day ID (for updates) Validations:
|
|
daily_allowance[free_meal_days_attributes][date]
optional |
Date in YYYY-MM-DD format Validations:
|
|
daily_allowance[free_meal_days_attributes][is_full]
optional , nil allowed |
Whether the day is a full day Validations:
|
|
daily_allowance[free_meal_days_attributes][had_breakfast]
optional , nil allowed |
Whether breakfast was provided Validations:
|
|
daily_allowance[free_meal_days_attributes][had_lunch]
optional , nil allowed |
Whether lunch was provided Validations:
|
|
daily_allowance[free_meal_days_attributes][had_dinner]
optional , nil allowed |
Whether dinner was provided Validations:
|
|
daily_allowance[free_meal_days_attributes][breakfast_is_taxable]
optional , nil allowed |
Whether breakfast is taxable (Swedish calculator only) Validations:
|
|
daily_allowance[free_meal_days_attributes][lunch_is_taxable]
optional , nil allowed |
Whether lunch is taxable (Swedish calculator only) Validations:
|
|
daily_allowance[free_meal_days_attributes][dinner_is_taxable]
optional , nil allowed |
Whether dinner is taxable (Swedish calculator only) Validations:
|
Get the total cost, deduction cost, and taxalbe with tax (Swedish calculator only) of the daily allowance in cents, based on year values, entries, and free meals.
[
{
"entries": [
{
"country_id": 1,
"start_time": 1716890400,
"end_time": 1716976800
}
],
"year":2024,
"free_meal_days": [
{
"date": "2024-05-28",
"is_full": true,
"had_lunch": true,
"had_dinner": true
}
],
"user_id": 1,
"time_zone": "Europe/Helsinki",
"is_reverse": false
}
]
| Param name | Description |
|---|---|
|
user_id
required |
Allowance User id Validations:
|
|
time_zone
optional |
Used Timezone Validations:
|
|
year
required |
Year in which allowance happens. Validations:
|
|
is_reverse
required |
If the allowance is a reverse of the other allowance Validations:
|
|
free_meal_days
required |
An array with the specific meals attributes. At least one item should be present Validations:
|
|
date
required |
Date in YYYY-MM-DD format. Validations:
|
|
is_full
required |
Whether the day corresponding to that “free meal day” is a “full day” or a “half day”. Validations:
|
|
had_breakfast
optional |
True if user had breakfast on that day. Only specific Allowance countries have breakfast free meals enabled. Validations:
|
|
had_lunch
optional |
True if user had lunch on that day. Validations:
|
|
had_dinner
optional |
True if user had dinner on that day. Validations:
|
|
breakfast_is_taxable
optional |
Defines if breakfast is taxable (Swedish calculator only). Validations:
|
|
lunch_is_taxable
optional |
Defines if lunch is taxable (Swedish calculator only). Validations:
|
|
dinner_is_taxable
optional |
Defines if dinner is taxable (Swedish calculator only). Validations:
|
|
entries
required |
An array with the specific entry attributes (country, start/end time in UNIX format) to pass to calculator. At least one item should be present in array Validations:
|
|
entries[country_id]
required |
ID of the Allowance country Validations:
|
|
entries[start_time]
required |
Start time in unix format: the seconds timestamp of the given date. Validations:
|
|
entries[end_time]
required |
End time in unix format: the seconds timestamp of the given date. Validations:
|
Daily Allowance costs break down in cents
| Param name | Description |
|---|---|
|
subtotal
required |
Total cost of the Daily Allowance. Validations:
|
|
deduction
required |
Meal Deduction cost of the Daily Allowance. Validations:
|
|
taxable
required |
Total amount for taxalbe meals, including tax (Swedish calculator only). Validations:
|
|
tax
required |
Total tax (Swedish calculator only). Validations:
|