# Create Expense

`lawmatics_create-expense` · Lawmatics MCP tool · Expenses

Create an expense in Lawmatics and attach it to a matter or contact. Cost is in integer cents (e.g. 50000 = $500.00). Requires the associated and creating user ids (use get-current-user for the caller's own id). Optionally set the billing expense type, billable flag, and invoice. Note: for contact-attached creates Lawmatics may report a temporary error even though the expense WAS created — verify with list-expenses before retrying to avoid duplicates.

## Input

- **description** `string` (required) — Description of the expense
- **costCents** `integer` (required) — Expense cost in integer cents (e.g. 50000 = $500.00), NOT dollars
- **billable** `boolean` — Whether the expense is billable
- **activityTypeId** `string` — ID of the billing expense (activity) type to categorize this expense
- **expensedAt** `string` — When the expense occurred (ISO 8601 date or Unix timestamp)
- **userId** `string` (required) — ID of the firm user associated with the expense (required by Lawmatics; use get-current-user for the caller's own id)
- **createdById** `string` (required) — ID of the firm user recorded as the expense creator (required by Lawmatics; use get-current-user for the caller's own id)
- **invoiceId** `string` — ID of the invoice to bill this expense on
- **matterId** `string` — ID of the matter to attach this expense to
- **contactId** `string` — ID of the contact to attach this expense to

## Output

- **id** `string` (required) — Unique ID of the created expense
- **description** `string | null` (required) — Description of the expense; null if unset
- **costCents** `number | null` (required) — Expense cost in integer cents (e.g. 50000 = $500.00); null if not reported
- **billable** `boolean | null` (required) — Whether the expense is billable; null if not reported
- **rateFlatFee** `boolean | null` (required) — Whether the expense is billed as a flat fee; null if not reported
- **rateCents** `number | null` (required) — Billing rate in integer cents; null if not reported
- **rateCurrency** `string | null` (required) — ISO currency code of the billing rate (e.g. USD); null if not reported
- **duration** `number | null` (required) — Duration value as returned by the API (expenses share Lawmatics' time-entry storage model); null if not reported
- **durationRounded** `number | null` (required) — Duration rounded to the firm's billing increment; null if not reported
- **startedAt** `string | null` (required) — ISO 8601 timestamp the expense timer started; null if unset or omitted
- **completedAt** `string | null` (required) — ISO 8601 timestamp the expense timer completed; null if unset or omitted
- **createdAt** `string | null` (required) — When the expense was created, as an ISO 8601 timestamp; null if unknown
- **updatedAt** `string | null` (required) — When the expense was last updated, as an ISO 8601 timestamp; null if unknown
- **relationships** `object` (required) — JSON:API relationship pointers to related records as {id,type} stubs. Not materialized — follow a pointer by calling that resource's own get/find tool (e.g. type 'user' -> get-user, type 'prospect' -> get-matter, type 'contact' -> get-contact, type 'invoice' -> get-invoice).
  - **staff** `object | null` (required) — Pointer to the firm user the expense is attributed to; null when unattributed
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
  - **createdBy** `object | null` (required) — Pointer to the firm user who created the record; null when unattributed
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
  - **expenseType** `object | null` (required) — Pointer to the billing expense type categorizing this expense; null when uncategorized
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
  - **contactable** `object | null` (required) — Pointer to the record the expense is attached to; type is "prospect" for a matter or "contact" for a contact; null when unattached
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
  - **invoice** `object | null` (required) — Pointer to the invoice this expense is billed on; null when uninvoiced
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
