Guides
Learn about expenses custom fields
When configuring Lucca Expenses, you may add custom fields to expense-temp-items
and expense-claim-items
.
Retrieving the list of customFields enabled for an expense nature
Custom fields activation depends on the expense nature. For example, custom field “Bill back client (bool)” may be activated for travel expenses, but not for team building expenses.
Each custom field is typed, as indicated by the customField.type.tag
discriminator:
Type.Tag | Expected value (code) - actual values are always strings | Example |
---|---|---|
String | Any text string as long as it conforms to MinLength and MaxLength . | "test" |
Bool | Stringified boolean. | "true" or "false" |
Int | Stringified integer | "48" |
Float | Stringified float. | "18.25" |
Digits | String of numbers, that must potentially conform to a minLength and maxLength . | "0495846" |
ListValues | String among a list (i.e. enum; refer to values dictionary property). | "foo" |
Retrieving the customFields values for an expense
In order to retrieve the list of customField values for an ExpenseTempItem
or an ExpenseClaimItem
, simply add “customFields” to the list of fields requested through the ?fields
query parameter:
The customFields
field you’ll retrieve is a JSON object whose keys are the IDs of the customField
.