Expense Type Repository
API Contract
REST
/api/v1/expense-type-drafts
5 endpoints
GET
/api/v1/expense-type-drafts/api/v1/expense-type-drafts
List all expense type draft records
Public
Response Example
{
"data": [
{
"id": "draft-001",
"expense_id": "exp-8821",
"selected_types": [
"kilometers",
"tolls"
],
"status": "draft",
"created_at": "2026-03-26T09:00:00Z",
"updated_at": "2026-03-26T09:22:00Z",
"submitted_at": null
},
{
"id": "draft-002",
"expense_id": "exp-8820",
"selected_types": [
"publicTransit"
],
"status": "submitted",
"created_at": "2026-03-25T14:00:00Z",
"updated_at": "2026-03-25T14:10:00Z",
"submitted_at": "2026-03-25T14:10:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/expense-type-drafts/api/v1/expense-type-drafts/:id
Load the draft expense types for a specific expense
Public
Response Example
{
"id": "draft-001",
"expense_id": "exp-8821",
"selected_types": [
"kilometers",
"tolls"
],
"status": "draft",
"created_at": "2026-03-26T09:00:00Z",
"updated_at": "2026-03-26T09:22:00Z",
"submitted_at": null
}
POST
/api/v1/expense-type-drafts/api/v1/expense-type-drafts
Save a new expense type draft
Public
Request Example
{
"expense_id": "exp-8825",
"selected_types": [
"parking",
"tolls"
]
}
Response Example
{
"id": "draft-003",
"expense_id": "exp-8825",
"selected_types": [
"parking",
"tolls"
],
"status": "draft",
"created_at": "2026-03-26T15:00:00Z",
"updated_at": "2026-03-26T15:00:00Z",
"submitted_at": null
}
PUT
/api/v1/expense-type-drafts/api/v1/expense-type-drafts/:id
Update draft or submit expense types for an expense
Public
Request Example
{
"selected_types": [
"parking",
"tolls",
"kilometers"
],
"action": "submit"
}
Response Example
{
"id": "draft-003",
"expense_id": "exp-8825",
"selected_types": [
"parking",
"tolls",
"kilometers"
],
"status": "submitted",
"created_at": "2026-03-26T15:00:00Z",
"updated_at": "2026-03-26T15:05:00Z",
"submitted_at": "2026-03-26T15:05:00Z"
}
DELETE
/api/v1/expense-type-drafts/api/v1/expense-type-drafts/:id
Delete a draft expense type record
Public
Response Example
{
"success": true,
"deleted_id": "draft-003"
}