---
title: "Expense data model"
url: "https://docs.unified.to/legal/expense/model"
description: "The Expense data model object in Unified's Expense API: 18 fields, including created_at, updated_at and matter_id, with types and enum values."
---
# Expense data model

 View field support, webhooks, and list parameters for each integration on the [Supported Integrations](https://docs.unified.to/legal/integrations.md) page. 

| Field                    | Type                                                                              | Required | Description                                                                                                                       |
| ------------------------ | --------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| id                       | string                                                                            | No       |                                                                                                                                   |
| created\_at              | string (date-time)                                                                | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                          |
| updated\_at              | string (date-time)                                                                | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                          |
| matter\_id               | string                                                                            | No       | pointer to the Legal Matter this expense is recorded against                                                                      |
| user\_id                 | string                                                                            | No       | HR Employee who incurred or recorded the expense (reference to HrisEmployee)                                                      |
| description              | string                                                                            | No       |                                                                                                                                   |
| incurred\_at             | string (date-time)                                                                | No       | date the expense was incurred (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                            |
| quantity                 | number                                                                            | No       |                                                                                                                                   |
| price\_amount            | number                                                                            | No       | unit price                                                                                                                        |
| total\_amount            | number                                                                            | No       |                                                                                                                                   |
| currency                 | string                                                                            | No       |                                                                                                                                   |
| type                     | enum                                                                              | No       | Values: HARD\_COST, SOFT\_COST, OTHER                                                                                             |
| category                 | string                                                                            | No       | the vendor's expense category name                                                                                                |
| is\_billable             | boolean                                                                           | No       |                                                                                                                                   |
| is\_billed               | boolean                                                                           | No       |                                                                                                                                   |
| invoice\_id              | string                                                                            | No       | pointer to the Accounting Invoice this expense was billed on (reference to AccountingInvoice)                                     |
| expense\_code            | string                                                                            | No       | UTBMS/LEDES expense code                                                                                                          |
| metadata                 | [LegalMetadata](https://docs.unified.to/legal/expense/model.md#LegalMetadata)\[\] | No       | custom field values                                                                                                               |
| metadata\[\].id          | string                                                                            | No       |                                                                                                                                   |
| metadata\[\].slug        | string                                                                            | No       |                                                                                                                                   |
| metadata\[\].value       | object                                                                            | No       |                                                                                                                                   |
| metadata\[\].namespace   | string                                                                            | No       |                                                                                                                                   |
| metadata\[\].format      | enum                                                                              | No       | Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE\_SELECT, MULTIPLE\_SELECT, MEASUREMENT, PRICE, YES\_NO, CURRENCY, URL |
| metadata\[\].extra\_data | object                                                                            | No       |                                                                                                                                   |

## TypeScript

```typescript
export type LegalExpense = {
	id?: string;
	created_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	matter_id?: string; // pointer to the Legal Matter this expense is recorded against
	user_id?: string; // HR Employee who incurred or recorded the expense (reference to HrisEmployee)
	description?: string;
	incurred_at?: string-time; // date the expense was incurred (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	quantity?: number;
	price_amount?: number; // unit price
	total_amount?: number;
	currency?: string;
	type?: 'HARD_COST' | 'SOFT_COST' | 'OTHER';
	category?: string; // the vendor's expense category name
	is_billable?: boolean;
	is_billed?: boolean;
	invoice_id?: string; // pointer to the Accounting Invoice this expense was billed on (reference to AccountingInvoice)
	expense_code?: string; // UTBMS/LEDES expense code
	metadata?: []; // custom field values
	raw?: any;
} 
```

## Zod

```typescript
import { z } from 'zod';

export const ZodLegalExpense = z.object({
	id: z.string().optional(),
	created_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	matter_id: z.string().optional().describe("pointer to the Legal Matter this expense is recorded against"),
	user_id: z.string().optional().describe("HR Employee who incurred or recorded the expense (reference to HrisEmployee)"),
	description: z.string().optional(),
	incurred_at: z.string-time().optional().describe("date the expense was incurred (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	quantity: z.number().optional(),
	price_amount: z.number().optional().describe("unit price"),
	total_amount: z.number().optional(),
	currency: z.string().optional(),
	type: z.enum("HARD_COST", "SOFT_COST", "OTHER").optional(),
	category: z.string().optional().describe("the vendor's expense category name"),
	is_billable: z.boolean().optional(),
	is_billed: z.boolean().optional(),
	invoice_id: z.string().optional().describe("pointer to the Accounting Invoice this expense was billed on (reference to AccountingInvoice)"),
	expense_code: z.string().optional().describe("UTBMS/LEDES expense code"),
	metadata: z.array().optional().describe("custom field values"),

});
```

## Python

```python
import dataclasses

@dataclasses.dataclass
class LegalExpenseType(str, Enum):
	HARD_COST = 'HARD_COST'
	SOFT_COST = 'SOFT_COST'
	OTHER = 'OTHER'

@dataclasses.dataclass
class LegalExpense:
	id: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""pointer to the Legal Matter this expense is recorded against"""
	matter_id: Optional[str]
	"""HR Employee who incurred or recorded the expense (reference to HrisEmployee)"""
	user_id: Optional[str]
	description: Optional[str]
	"""date the expense was incurred (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	incurred_at: Optional[str]
	quantity: Optional[int]
	"""unit price"""
	price_amount: Optional[int]
	total_amount: Optional[int]
	currency: Optional[str]
	type: Optional[LegalExpenseType]
	"""the vendor's expense category name"""
	category: Optional[str]
	is_billable: Optional[bool]
	is_billed: Optional[bool]
	"""pointer to the Accounting Invoice this expense was billed on (reference to AccountingInvoice)"""
	invoice_id: Optional[str]
	"""UTBMS/LEDES expense code"""
	expense_code: Optional[str]
	"""custom field values"""
	metadata: Optional[PropertyLegalExpenseMetadata]

```
