Set Up Expense Records
Manage the taxes, expense categories, departments, and custom fields an expense can reference, and look up your team.
An expense can point at records your business keeps in Duplo Dashboard: a tax, an expense category, a department, and answers to your own custom fields. This guide covers managing those records through the API, so an integration can set them up and look up their ids before raising an expense.
Each is optional on an expense, but an id you send must belong to your business and be active. An id from another business returns 404, and a deactivated record returns 422.
Taxes, expense categories, and custom fields are stored per mode, like expenses. Departments and team members are shared: the same ones answer to test and live keys.
Taxes
A tax here is one your business defines for expenses, with a name of 3 to 50 characters and a rate from 0 to 100, in percentage points, so 7.5 means 7.5%. These are separate from the NRS tax categories an e-invoice uses, which stay under the e-invoicing reference data.
To add one, make a request to the Create a tax endpoint:
curl --request POST \
--url https://spend-api.tryduplo.com/api/v1/taxes \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Withholding Tax", "rate": 5 }'{
"statusCode": 201,
"message": "Tax created successfully",
"data": {
"id": "5f0c7a2e-3b1d-4c8e-9a6f-1d2e3c4b5a69",
"name": "Withholding Tax",
"rate": 5,
"isActive": true,
"businessId": "f3f3c6a1-45e3-44aa-b05a-1fbe98d52d09",
"createdAt": "2026-11-16T09:20:05.311Z",
"updatedAt": "2026-11-16T09:20:05.311Z"
}
}Tax names are unique within your business, so a second tax with the same name returns 409 with Tax name already exists, whether you create it or update it.
List taxes filters by name and isActive. Deactivate a tax when it no longer applies. A new expense, or a payment, that uses a deactivated tax returns 422 with Tax is deactivated. Reactivate a tax to bring it back.
Expense categories
Categories group expenses by what the money was spent on. Expense categories need expenses on your business's plan.
Create an expense category takes a name and a description, each 5 to 50 characters of letters, digits, spaces, and , . / ' " | & ( ) - +. You can also set a spend limit and its currency.
{
"name": "Travel and Transport",
"description": "Flights, taxis, and fuel for business trips",
"limit": 500000,
"currency": "NGN"
}Names are unique, so a second category with the same name returns 409 with Expense category name already exists.
There is no separate deactivate endpoint. Send status: "inactive" to Update an expense category to retire one, and status: "active" to restore it. A new expense in an inactive category returns 422 with Expense category is deactivated.
Departments and team members
A department groups members of your team. To find the people, call List team members. It is read-only, and each member comes back with their name, email, role, the departments they belong to, and a profileId, which is how the department endpoints refer to them.
Create a department takes a name of 3 to 50 characters. You can add members at the same time with profileIds, and name a head of department with headOfDepartment:
{
"name": "Field Operations",
"profileIds": [
"d2787861-f521-4346-b218-eb7d3627d109",
"f54209c9-193b-4c81-b7b2-20817cf21a61"
],
"headOfDepartment": "d2787861-f521-4346-b218-eb7d3627d109"
}Every profile id must be a member of your business, or the call returns 404. A name already in use returns 409 with Department already exists.
To change membership later, send profileIds to Add department members or Remove department members, and read the current list with List department members.
Deactivate a department removes all its members and its head as well. You cannot add members to an inactive department, and a new expense in one returns 422 with Department is deactivated. Reactivate a department brings it back, after which you add its members again.
Custom fields
Custom fields are the extra questions your business asks on its expense form or its local transfer form, such as a project code or a cost center. Writing custom fields needs the custom fields add-on on your plan, or the call returns 403.
Each field belongs to one form, set by paymentModule: expense_payment or local_transfer. A field has a fieldLabel, a fieldType, and an isRequired flag:
fieldType | Accepts |
|---|---|
text | Text. validationRules can set minLength and maxLength |
number | A number, or a string of digits. validationRules can set min and max |
date | An ISO 8601 date of today or later |
email | An email address |
phone | A phone number |
single_choice | One of the field's options |
multi_choice | An array of distinct values from the field's options |
Saving fields
Create or update custom fields saves several fields for one form in a single call. A field sent with an id is updated, and one sent without an id is created:
{
"paymentModule": "expense_payment",
"fields": [
{ "fieldLabel": "Project code", "fieldType": "text", "isRequired": true, "validationRules": { "maxLength": 12 } },
{ "fieldLabel": "Cost center", "fieldType": "single_choice", "isRequired": false, "options": ["Lagos", "Abuja", "Port Harcourt"] }
]
}Choice fields need options, and other types must not send them. Two fields cannot share a label, and a new field cannot reuse the label of an active one, both of which return 409. Creating a field with the label of one you deleted brings the deleted field back instead. There is a cap on active fields per form, and going over it returns 400 with the limit in the message.
Delete a custom field takes it off the form.
Answering fields
List custom fields takes the form as paymentModule and returns its active fields in display order. Each field carries a fieldName, the label in lowercase with each run of other characters replaced by _, so Project code becomes project_code. That is the key you answer the field under in an expense's customFields object, and renaming a field changes it:
{
"customFields": {
"project_code": "OPS-2026-14",
"cost_center": "Lagos"
}
}Send every required field. A missing required field, an answer of the wrong type, or a key that is not one of the form's fields returns 422, with one message for each problem, such as Field "Project code" is required.
Related guides
How is this guide?
Last updated on