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.

Examples

[
  {
    "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
  }
] 

Params

Param name Description
user_id
required

Allowance User id

Validations:

  • Must be a Integer

time_zone
optional

Used Timezone

Validations:

  • Must be a Integer

year
required

Year in which allowance happens.

Validations:

  • Must be a Integer

is_reverse
required

If the allowance is a reverse of the other allowance

Validations:

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

free_meal_days
required

An array with the specific meals attributes. At least one item should be present

Validations:

  • Must be a String

date
required

Date in YYYY-MM-DD format.

Validations:

  • Must be a String

is_full
required

Whether the day corresponding to that “free meal day” is a “full day” or a “half day”.

Validations:

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

had_breakfast
optional

True if user had breakfast on that day. Only specific Allowance countries have breakfast free meals enabled.

Validations:

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

had_lunch
optional

True if user had lunch on that day.

Validations:

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

had_dinner
optional

True if user had dinner on that day.

Validations:

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

breakfast_is_taxable
optional

Defines if breakfast is taxable (Swedish calculator only).

Validations:

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

lunch_is_taxable
optional

Defines if lunch is taxable (Swedish calculator only).

Validations:

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

dinner_is_taxable
optional

Defines if dinner is taxable (Swedish calculator only).

Validations:

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

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:

  • Must be an Array of nested elements

entries[country_id]
required

ID of the Allowance country

Validations:

  • Must be a Integer

entries[start_time]
required

Start time in unix format: the seconds timestamp of the given date.

Validations:

  • Must be a Integer

entries[end_time]
required

End time in unix format: the seconds timestamp of the given date.

Validations:

  • Must be a Integer

Returns

Code: 200

Description:

Daily Allowance costs break down in cents

Param name Description
subtotal
required

Total cost of the Daily Allowance.

Validations:

  • Must be a Integer

deduction
required

Meal Deduction cost of the Daily Allowance.

Validations:

  • Must be a Integer

taxable
required

Total amount for taxalbe meals, including tax (Swedish calculator only).

Validations:

  • Must be a Integer

tax
required

Total tax (Swedish calculator only).

Validations:

  • Must be a Integer