# Create Transaction

`lawmatics_create-transaction` · Lawmatics MCP tool · Transactions

Create a financial transaction (credit) in Lawmatics, associated with exactly one matter, contact, or company. Amount is in integer cents (e.g. 5000 = $50.00). Optionally link it to an invoice by invoice number. Debits cannot be created via the API — they are system-generated (e.g. refunds). The response echoes the created transaction, including a `relationships` envelope of {id,type} pointers to related records (billing account, matter, invoice, recording user, trust fund request).

## Input

- **transactionType** `string` (required, enum: "credit") — Direction of the transaction; only "credit" can be created via the API (debits are system-generated, e.g. refunds)
- **bankAccountType** `string` (required, enum: "operating", "trust") — Bank account the transaction applies to: "operating" or "trust"
- **paymentMethod** `string` (required, enum: "credit_card", "check", "cash", "paypal", "venmo", "trust_payment", "debit_card", "ach", "other") — Payment method used for the transaction. "trust_payment" (a payment made from trust funds) is only accepted with bankAccountType "operating"
- **amountCents** `integer` (required) — Transaction amount in integer cents, NOT dollars (e.g. 5000 = $50.00)
- **executedAt** `string` — When the transaction was executed, as a timestamp string (e.g. "2022-04-19 12:00:00.000")
- **invoiceNumber** `integer` — Invoice number to record the transaction against (the human-facing number, not the invoice ID)
- **note** `string` — Free-text note for the transaction
- **matterId** `string` — ID of the matter to associate this transaction with
- **contactId** `string` — ID of the contact to associate this transaction with
- **companyId** `string` — ID of the company to associate this transaction with

## Output

- **id** `string` (required) — Lawmatics transaction ID of the created transaction
- **transactionType** `string` (required) — Direction of the transaction: "debit" or "credit"
- **bankAccountType** `string | null` (required) — Bank account the transaction applies to ("operating" or "trust"); null if unset
- **paymentMethod** `string | null` (required) — Payment method as reported by Lawmatics (e.g. "credit_card", "check"; system-generated values like "invoice_refund" also appear); null if unset
- **amountCents** `integer` (required) — Transaction amount in integer cents (never divided to dollars)
- **amountCurrency** `string | null` (required) — ISO 4217 currency code of the amount (e.g. "USD"); null if not reported
- **accountType** `string | null` (required) — Entity class of the billing account the transaction is attributed to (e.g. "Contact", "Company"); null when none. The account record pointer is in relationships.account
- **accountId** `string | null` (required) — ID of the billing account (see accountType for its class, relationships.account for the typed pointer); null when none
- **externalId** `string | null` (required) — External identifier attached to the transaction; null when none
- **note** `string | null` (required) — Free-text note attached to the transaction; null if unset
- **createdAt** `string` (required) — When the transaction record was created, as an ISO 8601 timestamp
- **updatedAt** `string` (required) — When the transaction record was last updated, as an ISO 8601 timestamp
- **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 'contact' -> get-contact, type 'prospect' -> get-matter, type 'invoice' -> get-invoice, type 'user' -> get-user).
  - **account** `object | null` (required) — Billing account pointer (polymorphic — type 'contact' or 'company'); null when none
    - **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
  - **prospect** `object | null` (required) — Matter pointer (JSON:API type 'prospect'); null when unlinked
    - **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) — Invoice pointer; null when unlinked
    - **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 user who recorded the transaction; null if not reported
    - **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
  - **trustFundRequest** `object | null` (required) — Trust fund request pointer (set on system-generated trust transactions); null when none
    - **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
