Skip to main content
Create per diem (subsistence allowance) expenses with the dynamic Fields system: choose the trip type, build the travel route, record meals and accommodation, and save. This guide walks you through a per diem from an empty form to a saved expense, then through the checks that run when the user sends it in a report. It builds on Dynamic fields, which explains the field object, control types and the update cycle. Do the receipt and mileage guides first if you are new to Fields: per diem is the most complex expense type.

Overview

A per diem (SubsistenceAllowance) is a daily allowance an employee claims for a business trip. The user enters where and when they travelled, and which meals and nights were already paid for. Findity calculates the allowance from the country’s rules and the organization’s settings. Your client never computes an amount. A per diem has three parts:
  • A category, which decides whether the trip is domestic or international.
  • A travel route: a start stop, an end stop and, for an international trip, one or more stops in between, each with a destination and dates.
  • Deductions: for each day (or 24-hour period) of the trip, whether breakfast, lunch or dinner was provided and whether accommodation was provided. Provided meals reduce the allowance.
The form is server-driven: the route and the deduction days change shape as the user edits dates and stops, so most edits go back to Findity with a PUT before the user continues.

Prerequisites

  1. Complete Authentication and obtain a user-scoped access token. Per diems belong to the signed-in user.
  2. Get the organization id from Organizations. The examples use ff808181963979e20196397a2098004b.
  3. The organization must have per diem categories. If it has none, the fields call reports NOT_VALID_CATEGORY_FOUND_FOR_ALLOWANCE and no form can be opened. An administrator has to set them up.

Key concepts

ConceptDescription
Domestic and internationalSet by the category. A domestic trip has only a start and an end stop. An international trip has at least one stop in between and an addStop command. The category list doesn’t say which kind a category is: the fields response shows it.
StopOne point of the route, with a destination and dates. Stops are numbered from 1: the start stop is 1, the stops in between follow, and the end stop is last.
date1 and date2The dates of a stop: departure from the start stop is date1, arrival at the end stop is date2. The value is local time in the format yyyy-MM-dd HH:mm (control type LOCAL_DATE_TIME). Which dates a stop shows depends on the organization’s settings.
DestinationThe country of a stop, picked from the destinations list. The start and end stops hold the organization’s home country and don’t show it.
Deduction periodOne day or one 24-hour period of the trip, depending on the organization’s settings. Findity creates one deduction group per period from the trip’s start and end dates. Periods are numbered from 0.
Recent destinationsThe destinations list can return the user’s recently used destinations first, as suggestions. Findity keeps the last 10 per user and organization, from the stops between start and end.

API endpoints

All endpoints use the Expense API base URL. Examples use the stage environment; production uses the same paths on https://api.findity.com/api/v1/expense.

Required headers

Step 1 — Initialize the fields

Fetch an empty per diem form:
cURL
Without a category, Findity picks the organization’s first domestic per diem category. To open a saved per diem for editing, add expenseRecordId={expenseId}. The response holds these top-level fields: Custom dimensions such as project or cost center come last. Render only fields with visible: true, and keep the hidden ones in your state.

Step 2 — Choose the category

Let the user pick the category from the list in categoryId.url. Because categoryId has requiresUpdate: true, send the full fields array back with a PUT after the change. The response has the route of the new trip type.
Changing the category between a domestic and an international one clears the travel route and all deductions. Ask the user to pick the category before they fill in the route, or warn them before you send the change.

Step 3 — Build the travel route

The route group verification.specifications holds the stops. The start and end stops’ fields sit directly in the group; each stop in between is its own FIELD_GROUP, verification.specifications[n]. On a domestic trip the route is stop 1 (start, with date1) and stop 2 (end, with date2). An international trip from Sweden to Oslo and back looks like this: stop 1 departs Sweden, stop 2 is Norway, stop 3 returns to Sweden.
Treat a change to any field inside the route as a change that needs a PUT: the route group has requiresUpdate: true, and the server uses the dates to check their order and to create the deduction periods in Step 4.

Pick a destination

The destination field’s url points to the destinations list with includeSuggestions=5:
cURL
JSON
Show suggestions first, under the section text from meta.sections, then the full list in data. Names come in the user’s language, sorted by name. The list depends on the organization’s booking country, not on the trip. A destination becomes a recent one when the user saves a per diem with it on a stop between start and end.

Add and remove stops

On an international trip the route has a COMMAND field, verification.specifications.addStop, whose command is action=addStop&afterIndex={n}. Send the full fields array with the command in the query:
cURL
This adds an empty stop after stop 2. The stops after it move up by one, so stop 3 becomes stop 4. Re-read the indexes from the response; never keep them in your own state across a PUT. The last three have confirmationRequired: true: show the confirmation text and send the command only when the user confirms. A command without its afterIndex or atIndex returns 400 MISSING_PARAMETER.

Step 4 — Record meals and accommodation

Once the start and end dates are valid, verification.deductionAndAccommodation holds one group per deduction period, verification.deductionAndAccommodation[i], numbered from 0: The groups are regenerated from the dates on every PUT, and answers are matched back to their period by date. Shortening the trip drops the answers for the days that no longer exist. On a domestic trip where the user chose meal compensation, the groups are verification.mealCompensation[i] with two switches, meal1 and meal2, instead.

Step 5 — Save the expense

When the form is complete, create the per diem with the full fields array:
cURL
To change a saved per diem, send the full fields array to PUT /expenses/{expenseId}?format=fields. A save with validation errors returns 400 VALIDATION_FAILED_FOR_EXPENSE_RECORD and stores nothing. Add forceSave=true to save it anyway as a draft the user fixes later. A route without stops, a stop between start and end without a destination, or an enabled date without a value can’t be force-saved.

Using the JSON format

A backend integration that owns its data can send the per diem as JSON to POST /expenses instead. The stops go in verification.specifications in route order, and their role comes from their position: the first is the start, the last is the end. This is the Oslo trip from Step 3:
JSON
PAID_YOURSELF means the meal was not provided. The other meal values are FOOD_BENEFITS, BREAKFAST_IN_HOTEL, FOOD_IN_TICKET, FOOD_IN_REPRESENTATION and LUNCH_BENEFITS_SODEXO. The Create expense reference has the full schema.

Step 6 — Send it in a report

Add the per diem to a report with expenseReportId, or through Expense reports, and send the report. When the report is sent, Findity checks that per diems don’t overlap:
  • OVERLAPPING_SUBSISTENCE_ALLOWANCE_IN_CURRENT_REPORT: the per diem’s dates overlap another per diem in the same report. Only the later per diem of an overlapping pair gets the error.
  • OVERLAPPING_SUBSISTENCE_ALLOWANCE_IN_OTHER_REPORT: the dates overlap a per diem in another of the user’s submitted reports.
The code ends in _TWO when the per diem overlaps two others and in _MORE when it overlaps three or more. Both are BLOCKERs, so the report can’t be sent until the user changes the dates or removes a per diem. errorText names the per diems and the dates, for example:
JSON
A per diem without a description is named by its dates. An organization can turn the overlap check off.

Error handling

Validation errors come back in validationErrors, or on the field itself as error and errorText:

Next steps

Dynamic fields

The field object, control types and the update cycle.

Expense reports

Add per diems to a report and send it for approval.
Last modified on December 4, 2026