Records money paid on a bill or collected on an invoice, such as a check
or wire, and marks the invoice paid or partially paid. Send
payBalanceDue: true to pay it in full or allocations to pay named line
items; on a claim bill in a reserved category, erodeReserves decides
whether the payment reduces the claim’s reserve. An invoice that requires
approval (approvalRequired: true) must be approved first with Approve
Invoice (approveFinancialsInvoice) unless your key holds
invoice.approve, in which case this call approves it; one that does not
takes the payment without an approval. Remove Payment
(removeFinancialsInvoicePayment) undoes a payment.
Records a payment against the invoice — a gesture the server resolves into
per-line settlement MARKS, executing one invoice.payment_recorded action
per mark in one transaction and returning the CREATED MARK ROWS
(paymentIds + createdPayments), each mark the handle for
removing it.
Two modes, exactly one per request. Send either payBalanceDue: true
or an allocations array — both together, or neither, is a 400.
payBalanceDue: true settles the whole document: one mark per
OPEN line item at that line’s full remaining, in the document’s
line-item order, BOTH directions at once. The invoice comes back
paid with balanceDueCents: 0, and the gesture’s net cash equals
the balanceDueCents you asked to pay, by construction. Only the
literal true is accepted (payBalanceDue: false is a 400) — to
pay less, name the lines.
allocations marks exactly the line items you name, for exactly
the cents you name. Nothing is spread, split, or inferred: a line you
do not name is untouched, and a line you name for less than its
remaining stays open.
Allocation amounts are in the LINE’s frame.allocations[].amountCents
settles its own line’s remaining toward zero, so it carries the sign of
that remaining — this is NOT the oriented net-cash frame balanceDueCents
reads in. A payable-direction line with 8,000 remaining takes a mark of
+8000; a receivable-direction line with 3,000 remaining takes a mark of
+3000 too (money in, but the line’s own remaining is positive). Each
amount must be a nonzero integer, and a lineItemId may appear at most
once per request (both 400s).
Per-mark guards (422). Every mark must name a line item on the
document (422 UNKNOWN_ID), be nonzero and carry its line’s remaining’s
sign — a mark against a settled line, or one running opposite its line’s
remaining, is 422 INVALID_AMOUNT, as is a payBalanceDue against a
document with nothing open — and its magnitude may not exceed its line’s
remaining’s (422 AMOUNT_EXCEEDS_BALANCE_DUE). The bounds are per line;
there is no document-scalar bound. The payment date must not be in the
future (422 FUTURE_DATE).
Reserve erosion. On an invoice in a reserved category,
erodeReserves is REQUIRED (true = the marks consume the linked
event’s reserves; eroding requires an event link —
422 ERODE_REQUIRES_EVENT). On an operating-category invoice the field
must be omitted (422 ERODE_RESERVES_MISMATCH either way it is
misused). There is no headroom bound: the marks’ oriented reserve effect
applies to the remaining reserve unbounded — the remaining reserve is a
SIGNED balance, and eroding past the estimate takes it below zero (the
books’ statement that payments have outrun an estimate that still
stands), never a 422.
Approval gate (422 NOT_APPROVED). On an invoice that does not
require approval (approvalRequired: false, for example money coming
in), the payment posts for any key that may record payments, and nothing
approves the invoice. On one that does, this endpoint posts money only
against an APPROVED invoice (approved: true on the invoice row). On an
UNAPPROVED invoice that requires approval, the outcome depends on the
calling key’s permissions, mirroring the in-app behaviour where a
sufficiently authorized user’s payment auto-approves:
the key holds invoice.approve → the invoice is APPROVED
automatically as part of this request, in the same transaction and
before the payment marks, and the payment posts. The response’s
invoice row comes back approved: true; the auto-approval is
deliberately NOT listed in journalIds (that array is the payment
gesture’s marks, so an idempotent replay returns an identical body).
the key does NOT hold it → 422 NOT_APPROVED. Approve the invoice
first — via approve with a
key that holds the permission, or in the app.
A draft is rejected as 422 INVOICE_DRAFT regardless of approval: no
money may post against an unposted document.
Concurrency + idempotency. Requires If-Match (the invoice’s current
headJournalId) and a client-minted actionId. The actionId anchors
the FIRST mark’s journal action; sibling marks take server-minted ids in
the same transaction. An identical retry replays the original outcome —
the full paymentIds set included. Reusing an actionId with different
allocations is 409 ACTION_ID_REUSED.
API key authentication. Send your raw API key as the Authorization header value with NO scheme prefix — Authorization: YOUR-API-KEY. Do NOT prefix it with Bearer or ApiKey, and do not use an X-API-Key header; those are not accepted.
Headers
If-Match
string<uuid>
required
The invoice's current headJournalId — the optimistic-concurrency watermark every single-invoice write after creation must send. Read it off any invoice read or write response and echo it verbatim (a bare uuid; an entity-tag dressing of it — "uuid" or W/"uuid" — is also accepted). Missing or malformed is a 400 (IF_MATCH_REQUIRED / IF_MATCH_INVALID); a stale value is a 409 IF_MATCH_CONFLICT whose body carries the current invoice. An idempotent actionId replay short-circuits BEFORE the watermark is evaluated.
Path Parameters
companyId
string<uuid>
required
Company identifier
invoiceId
string<uuid>
required
Invoice identifier
Body
application/json
actionId
string<uuid>
required
Client-minted idempotency key — becomes the FIRST created mark's journal id (sibling marks mint their own). An identical retry replays the original outcome (the created paymentIds included); reuse with a different payload is 409 ACTION_ID_REUSED
paymentDate
string<date>
required
The payment date, stamped on every created mark (ISO YYYY-MM-DD); must not be in the future
author
string
Optional display label for the source system's author (e.g. the integrator-side user). Stamped as the journal record's display attribution; the acting principal stays the External API service user, so a label can never impersonate an in-app user. Ignored on idempotent replays
Required string length: 1 - 255
payBalanceDue
enum<boolean>
Settle the WHOLE document: one mark per open line item at that line's full remaining, both directions at once, so the gesture's net cash equals balanceDueCents. Only the literal true is accepted. Mutually exclusive with allocations — send exactly one of the two
Available options:
true
allocations
object[]
Explicit per-line marks — exactly the line items named, for exactly the cents named; nothing is spread onto an unnamed line. Mutually exclusive with payBalanceDue — send exactly one of the two. Each lineItemId may appear at most once
Minimum array length: 1
Show child attributes
memo
string
Free-text memo, stamped on every created mark
erodeReserves
boolean
REQUIRED on a reserved-category invoice — whether the created marks erode the linked event's reserves; must be OMITTED on an operating-category invoice. No headroom bound applies: the remaining reserve is a signed balance and may cross zero
Response
The refreshed invoice state plus the created MARK rows: paymentIds are the server-minted removal handles in mark order, and createdPayments the full mark rows they name (each also present in the refreshed payments)
The response of every single-invoice write — refreshed read state, not an ack: the emitted journal id(s), THE invoice row (identical shape to the reads — one invoice representation everywhere; its headJournalId is the next If-Match), and the invoice's live payments. An idempotent actionId replay returns this same shape rebuilt from the original outcome, server-minted values included.
journalIds
string<uuid>[]
required
Every journal id the write emitted — the anchor action's id (the actionId you supplied) first, then any engine-minted siblings (a multi-mark payment's additional marks) and any companion the horizon rule composed (e.g. the reserve unwind of a pre-horizon eroding payment's removal, or a delete's payment sweep)
Minimum array length: 1
invoice
object
required
THE invoice representation — the same shape everywhere an endpoint returns an invoice (listing rows, the detail read, and every write's refreshed-row response; the policy invoice batch's rows also carry approvedBy). headJournalId is the invoice's current journal head — the optimistic-concurrency token subsequent writes echo back as If-Match.
Show child attributes
payments
object[]
required
The invoice's live payment marks after the write, newest first
Show child attributes
paymentIds
string<uuid>[]
required
The created marks' server-minted ids, in mark order (the request's allocations order, or line-item order under payBalanceDue) — each the handle for DELETE …/payments/{paymentId}
createdPayments
object[]
required
The created mark rows, in mark order
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"AI Insurance","colors":{"primary":"#714CC5","light":"#D3BFFF","dark":"#A887F3"},"logo":{"light":"https://mintcdn.com/ai-insurance-fmv1/HtPQvD-FDA5nbM7L/logo/dark.jpg?fit=max\u0026auto=format\u0026n=HtPQvD-FDA5nbM7L\u0026q=85\u0026s=14ace86d6e87c6eab47960c514760266","dark":"https://mintcdn.com/ai-insurance-fmv1/HtPQvD-FDA5nbM7L/logo/dark.jpg?fit=max\u0026auto=format\u0026n=HtPQvD-FDA5nbM7L\u0026q=85\u0026s=14ace86d6e87c6eab47960c514760266","href":"https://go.aiinsurance.io"},"favicon":"https://mintcdn.com/ai-insurance-fmv1/HtPQvD-FDA5nbM7L/logo/dark.jpg?fit=max\u0026auto=format\u0026n=HtPQvD-FDA5nbM7L\u0026q=85\u0026s=14ace86d6e87c6eab47960c514760266","navbar":{"links":[{"href":"mailto:support@aiinsurance.io","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://go.aiinsurance.io"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/a-i-insurance-inc"}},"seo":{"metatags":{"canonical":"https://docs.go.aiinsurance.io"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ai-insurance-fmv1","hasAudioNarration":false,"actualSubdomain":"ai-insurance-fmv1","customDomains":["docs.go.aiinsurance.io"],"gitSource":{"type":"github","owner":"ai-insurance","repo":"docs-mirror","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6af4b096ee8edba08e00c669"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6af7498e75f3e5c02082a680","clientVersion":"0.0.4131","searchFilterCounts":[{"language":"default","tag":"API","count":244},{"language":"default","tag":"Financials","count":94},{"language":"default","tag":"App","count":35},{"language":"default","tag":"Policy Transactions","count":34},{"language":"default","tag":"Company Files","count":28},{"language":"default","tag":"Entities","count":25},{"language":"default","tag":"Record Emails","count":23},{"language":"default","tag":"Configuration","count":23},{"language":"default","tag":"Forms","count":18},{"language":"default","tag":"Guides","count":18}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/financials/record-payment","slug":"/api-reference/financials/record-payment","pageMetadata":{"title":"Record Payment","description":"Records money paid on a bill or collected on an invoice, such as a check\nor wire, and marks the invoice paid or partially paid. Send\n`payBalanceDue: true` to pay it in full or `allocations` to pay named line\nitems; on a claim bill in a reserved category, `erodeReserves` decides\nwhether the payment reduces the claim's reserve. An invoice that requires\napproval (`approvalRequired: true`) must be approved first with Approve\nInvoice (`approveFinancialsInvoice`) unless your key holds\n`invoice.approve`, in which case this call approves it; one that does not\ntakes the payment without an approval. Remove Payment\n(`removeFinancialsInvoicePayment`) undoes a payment.\n\nRecords a payment against the invoice — a gesture the server resolves into\nper-line settlement MARKS, executing one `invoice.payment_recorded` action\nper mark in one transaction and returning the CREATED MARK ROWS\n(`paymentIds` + `createdPayments`), each mark the handle for\n[removing it](/api-reference/financials/remove-payment).\n\n**Two modes, exactly one per request.** Send either `payBalanceDue: true`\nor an `allocations` array — both together, or neither, is a `400`.\n\n - **`payBalanceDue: true`** settles the whole document: one mark per\n OPEN line item at that line's full remaining, in the document's\n line-item order, BOTH directions at once. The invoice comes back\n `paid` with `balanceDueCents: 0`, and the gesture's net cash equals\n the `balanceDueCents` you asked to pay, by construction. Only the\n literal `true` is accepted (`payBalanceDue: false` is a `400`) — to\n pay less, name the lines.\n - **`allocations`** marks exactly the line items you name, for exactly\n the cents you name. Nothing is spread, split, or inferred: a line you\n do not name is untouched, and a line you name for less than its\n remaining stays open.\n\n**Allocation amounts are in the LINE's frame.** `allocations[].amountCents`\nsettles its own line's remaining **toward zero**, so it carries the sign of\nthat remaining — this is NOT the oriented net-cash frame `balanceDueCents`\nreads in. A payable-direction line with 8,000 remaining takes a mark of\n`+8000`; a receivable-direction line with 3,000 remaining takes a mark of\n`+3000` too (money in, but the line's own remaining is positive). Each\namount must be a nonzero integer, and a `lineItemId` may appear at most\nonce per request (both `400`s).\n\n**Per-mark guards (`422`).** Every mark must name a line item on the\ndocument (`422 UNKNOWN_ID`), be nonzero and carry its line's remaining's\nsign — a mark against a settled line, or one running opposite its line's\nremaining, is `422 INVALID_AMOUNT`, as is a `payBalanceDue` against a\ndocument with nothing open — and its magnitude may not exceed its line's\nremaining's (`422 AMOUNT_EXCEEDS_BALANCE_DUE`). The bounds are per line;\nthere is no document-scalar bound. The payment date must not be in the\nfuture (`422 FUTURE_DATE`).\n\n**Reserve erosion.** On an invoice in a reserved category,\n`erodeReserves` is REQUIRED (`true` = the marks consume the linked\nevent's reserves; eroding requires an event link —\n`422 ERODE_REQUIRES_EVENT`). On an operating-category invoice the field\nmust be omitted (`422 ERODE_RESERVES_MISMATCH` either way it is\nmisused). There is no headroom bound: the marks' oriented reserve effect\napplies to the remaining reserve unbounded — the remaining reserve is a\nSIGNED balance, and eroding past the estimate takes it below zero (the\nbooks' statement that payments have outrun an estimate that still\nstands), never a `422`.\n\n**Approval gate (`422 NOT_APPROVED`).** On an invoice that does not\nrequire approval (`approvalRequired: false`, for example money coming\nin), the payment posts for any key that may record payments, and nothing\napproves the invoice. On one that does, this endpoint posts money only\nagainst an APPROVED invoice (`approved: true` on the invoice row). On an\nUNAPPROVED invoice that requires approval, the outcome depends on the\ncalling key's permissions, mirroring the in-app behaviour where a\nsufficiently authorized user's payment auto-approves:\n\n - the key holds `invoice.approve` → the invoice is APPROVED\n automatically as part of this request, in the same transaction and\n before the payment marks, and the payment posts. The response's\n invoice row comes back `approved: true`; the auto-approval is\n deliberately NOT listed in `journalIds` (that array is the payment\n gesture's marks, so an idempotent replay returns an identical body).\n - the key does NOT hold it → `422 NOT_APPROVED`. Approve the invoice\n first — via [approve](/api-reference/financials/approve-invoice) with a\n key that holds the permission, or in the app.\n\nA draft is rejected as `422 INVOICE_DRAFT` regardless of approval: no\nmoney may post against an unposted document.\n\n**Concurrency + idempotency.** Requires `If-Match` (the invoice's current\n`headJournalId`) and a client-minted `actionId`. The `actionId` anchors\nthe FIRST mark's journal action; sibling marks take server-minted ids in\nthe same transaction. An identical retry replays the original outcome —\nthe full `paymentIds` set included. Reusing an `actionId` with different\n`allocations` is `409 ACTION_ID_REUSED`.\n\n**Required permission:** `payment.record`\n","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/payments","href":"/api-reference/financials/record-payment","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n li: \"li\",\n p: \"p\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Records money paid on a bill or collected on an invoice, such as a check\\nor wire, and marks the invoice paid or partially paid. Send\\n\", _jsx(_components.code, {\n children: \"payBalanceDue: true\"\n }), \" to pay it in full or \", _jsx(_components.code, {\n children: \"allocations\"\n }), \" to pay named line\\nitems; on a claim bill in a reserved category, \", _jsx(_components.code, {\n children: \"erodeReserves\"\n }), \" decides\\nwhether the payment reduces the claim’s reserve. An invoice that requires\\napproval (\", _jsx(_components.code, {\n children: \"approvalRequired: true\"\n }), \") must be approved first with Approve\\nInvoice (\", _jsx(_components.code, {\n children: \"approveFinancialsInvoice\"\n }), \") unless your key holds\\n\", _jsx(_components.code, {\n children: \"invoice.approve\"\n }), \", in which case this call approves it; one that does not\\ntakes the payment without an approval. Remove Payment\\n(\", _jsx(_components.code, {\n children: \"removeFinancialsInvoicePayment\"\n }), \") undoes a payment.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Records a payment against the invoice — a gesture the server resolves into\\nper-line settlement MARKS, executing one \", _jsx(_components.code, {\n children: \"invoice.payment_recorded\"\n }), \" action\\nper mark in one transaction and returning the CREATED MARK ROWS\\n(\", _jsx(_components.code, {\n children: \"paymentIds\"\n }), \" + \", _jsx(_components.code, {\n children: \"createdPayments\"\n }), \"), each mark the handle for\\n\", _jsx(_components.a, {\n href: \"/api-reference/financials/remove-payment\",\n children: \"removing it\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Two modes, exactly one per request.\"\n }), \" Send either \", _jsx(_components.code, {\n children: \"payBalanceDue: true\"\n }), \"\\nor an \", _jsx(_components.code, {\n children: \"allocations\"\n }), \" array — both together, or neither, is a \", _jsx(_components.code, {\n children: \"400\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: _jsx(_components.code, {\n children: \"payBalanceDue: true\"\n })\n }), \" settles the whole document: one mark per\\nOPEN line item at that line’s full remaining, in the document’s\\nline-item order, BOTH directions at once. The invoice comes back\\n\", _jsx(_components.code, {\n children: \"paid\"\n }), \" with \", _jsx(_components.code, {\n children: \"balanceDueCents: 0\"\n }), \", and the gesture’s net cash equals\\nthe \", _jsx(_components.code, {\n children: \"balanceDueCents\"\n }), \" you asked to pay, by construction. Only the\\nliteral \", _jsx(_components.code, {\n children: \"true\"\n }), \" is accepted (\", _jsx(_components.code, {\n children: \"payBalanceDue: false\"\n }), \" is a \", _jsx(_components.code, {\n children: \"400\"\n }), \") — to\\npay less, name the lines.\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: _jsx(_components.code, {\n children: \"allocations\"\n })\n }), \" marks exactly the line items you name, for exactly\\nthe cents you name. Nothing is spread, split, or inferred: a line you\\ndo not name is untouched, and a line you name for less than its\\nremaining stays open.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Allocation amounts are in the LINE’s frame.\"\n }), \" \", _jsx(_components.code, {\n children: \"allocations[].amountCents\"\n }), \"\\nsettles its own line’s remaining \", _jsx(_components.strong, {\n children: \"toward zero\"\n }), \", so it carries the sign of\\nthat remaining — this is NOT the oriented net-cash frame \", _jsx(_components.code, {\n children: \"balanceDueCents\"\n }), \"\\nreads in. A payable-direction line with 8,000 remaining takes a mark of\\n\", _jsx(_components.code, {\n children: \"+8000\"\n }), \"; a receivable-direction line with 3,000 remaining takes a mark of\\n\", _jsx(_components.code, {\n children: \"+3000\"\n }), \" too (money in, but the line’s own remaining is positive). Each\\namount must be a nonzero integer, and a \", _jsx(_components.code, {\n children: \"lineItemId\"\n }), \" may appear at most\\nonce per request (both \", _jsx(_components.code, {\n children: \"400\"\n }), \"s).\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsxs(_components.strong, {\n children: [\"Per-mark guards (\", _jsx(_components.code, {\n children: \"422\"\n }), \").\"]\n }), \" Every mark must name a line item on the\\ndocument (\", _jsx(_components.code, {\n children: \"422 UNKNOWN_ID\"\n }), \"), be nonzero and carry its line’s remaining’s\\nsign — a mark against a settled line, or one running opposite its line’s\\nremaining, is \", _jsx(_components.code, {\n children: \"422 INVALID_AMOUNT\"\n }), \", as is a \", _jsx(_components.code, {\n children: \"payBalanceDue\"\n }), \" against a\\ndocument with nothing open — and its magnitude may not exceed its line’s\\nremaining’s (\", _jsx(_components.code, {\n children: \"422 AMOUNT_EXCEEDS_BALANCE_DUE\"\n }), \"). The bounds are per line;\\nthere is no document-scalar bound. The payment date must not be in the\\nfuture (\", _jsx(_components.code, {\n children: \"422 FUTURE_DATE\"\n }), \").\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Reserve erosion.\"\n }), \" On an invoice in a reserved category,\\n\", _jsx(_components.code, {\n children: \"erodeReserves\"\n }), \" is REQUIRED (\", _jsx(_components.code, {\n children: \"true\"\n }), \" = the marks consume the linked\\nevent’s reserves; eroding requires an event link —\\n\", _jsx(_components.code, {\n children: \"422 ERODE_REQUIRES_EVENT\"\n }), \"). On an operating-category invoice the field\\nmust be omitted (\", _jsx(_components.code, {\n children: \"422 ERODE_RESERVES_MISMATCH\"\n }), \" either way it is\\nmisused). There is no headroom bound: the marks’ oriented reserve effect\\napplies to the remaining reserve unbounded — the remaining reserve is a\\nSIGNED balance, and eroding past the estimate takes it below zero (the\\nbooks’ statement that payments have outrun an estimate that still\\nstands), never a \", _jsx(_components.code, {\n children: \"422\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsxs(_components.strong, {\n children: [\"Approval gate (\", _jsx(_components.code, {\n children: \"422 NOT_APPROVED\"\n }), \").\"]\n }), \" On an invoice that does not\\nrequire approval (\", _jsx(_components.code, {\n children: \"approvalRequired: false\"\n }), \", for example money coming\\nin), the payment posts for any key that may record payments, and nothing\\napproves the invoice. On one that does, this endpoint posts money only\\nagainst an APPROVED invoice (\", _jsx(_components.code, {\n children: \"approved: true\"\n }), \" on the invoice row). On an\\nUNAPPROVED invoice that requires approval, the outcome depends on the\\ncalling key’s permissions, mirroring the in-app behaviour where a\\nsufficiently authorized user’s payment auto-approves:\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"the key holds \", _jsx(_components.code, {\n children: \"invoice.approve\"\n }), \" → the invoice is APPROVED\\nautomatically as part of this request, in the same transaction and\\nbefore the payment marks, and the payment posts. The response’s\\ninvoice row comes back \", _jsx(_components.code, {\n children: \"approved: true\"\n }), \"; the auto-approval is\\ndeliberately NOT listed in \", _jsx(_components.code, {\n children: \"journalIds\"\n }), \" (that array is the payment\\ngesture’s marks, so an idempotent replay returns an identical body).\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"the key does NOT hold it → \", _jsx(_components.code, {\n children: \"422 NOT_APPROVED\"\n }), \". Approve the invoice\\nfirst — via \", _jsx(_components.a, {\n href: \"/api-reference/financials/approve-invoice\",\n children: \"approve\"\n }), \" with a\\nkey that holds the permission, or in the app.\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"A draft is rejected as \", _jsx(_components.code, {\n children: \"422 INVOICE_DRAFT\"\n }), \" regardless of approval: no\\nmoney may post against an unposted document.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Concurrency + idempotency.\"\n }), \" Requires \", _jsx(_components.code, {\n children: \"If-Match\"\n }), \" (the invoice’s current\\n\", _jsx(_components.code, {\n children: \"headJournalId\"\n }), \") and a client-minted \", _jsx(_components.code, {\n children: \"actionId\"\n }), \". The \", _jsx(_components.code, {\n children: \"actionId\"\n }), \" anchors\\nthe FIRST mark’s journal action; sibling marks take server-minted ids in\\nthe same transaction. An identical retry replays the original outcome —\\nthe full \", _jsx(_components.code, {\n children: \"paymentIds\"\n }), \" set included. Reusing an \", _jsx(_components.code, {\n children: \"actionId\"\n }), \" with different\\n\", _jsx(_components.code, {\n children: \"allocations\"\n }), \" is \", _jsx(_components.code, {\n children: \"409 ACTION_ID_REUSED\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Required permission:\"\n }), \" \", _jsx(_components.code, {\n children: \"payment.record\"\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Record Payment","description":"Records money paid on a bill or collected on an invoice, such as a check\nor wire, and marks the invoice paid or partially paid. Send\n`payBalanceDue: true` to pay it in full or `allocations` to pay named line\nitems; on a claim bill in a reserved category, `erodeReserves` decides\nwhether the payment reduces the claim's reserve. An invoice that requires\napproval (`approvalRequired: true`) must be approved first with Approve\nInvoice (`approveFinancialsInvoice`) unless your key holds\n`invoice.approve`, in which case this call approves it; one that does not\ntakes the payment without an approval. Remove Payment\n(`removeFinancialsInvoicePayment`) undoes a payment.\n\nRecords a payment against the invoice — a gesture the server resolves into\nper-line settlement MARKS, executing one `invoice.payment_recorded` action\nper mark in one transaction and returning the CREATED MARK ROWS\n(`paymentIds` + `createdPayments`), each mark the handle for\n[removing it](/api-reference/financials/remove-payment).\n\n**Two modes, exactly one per request.** Send either `payBalanceDue: true`\nor an `allocations` array — both together, or neither, is a `400`.\n\n - **`payBalanceDue: true`** settles the whole document: one mark per\n OPEN line item at that line's full remaining, in the document's\n line-item order, BOTH directions at once. The invoice comes back\n `paid` with `balanceDueCents: 0`, and the gesture's net cash equals\n the `balanceDueCents` you asked to pay, by construction. Only the\n literal `true` is accepted (`payBalanceDue: false` is a `400`) — to\n pay less, name the lines.\n - **`allocations`** marks exactly the line items you name, for exactly\n the cents you name. Nothing is spread, split, or inferred: a line you\n do not name is untouched, and a line you name for less than its\n remaining stays open.\n\n**Allocation amounts are in the LINE's frame.** `allocations[].amountCents`\nsettles its own line's remaining **toward zero**, so it carries the sign of\nthat remaining — this is NOT the oriented net-cash frame `balanceDueCents`\nreads in. A payable-direction line with 8,000 remaining takes a mark of\n`+8000`; a receivable-direction line with 3,000 remaining takes a mark of\n`+3000` too (money in, but the line's own remaining is positive). Each\namount must be a nonzero integer, and a `lineItemId` may appear at most\nonce per request (both `400`s).\n\n**Per-mark guards (`422`).** Every mark must name a line item on the\ndocument (`422 UNKNOWN_ID`), be nonzero and carry its line's remaining's\nsign — a mark against a settled line, or one running opposite its line's\nremaining, is `422 INVALID_AMOUNT`, as is a `payBalanceDue` against a\ndocument with nothing open — and its magnitude may not exceed its line's\nremaining's (`422 AMOUNT_EXCEEDS_BALANCE_DUE`). The bounds are per line;\nthere is no document-scalar bound. The payment date must not be in the\nfuture (`422 FUTURE_DATE`).\n\n**Reserve erosion.** On an invoice in a reserved category,\n`erodeReserves` is REQUIRED (`true` = the marks consume the linked\nevent's reserves; eroding requires an event link —\n`422 ERODE_REQUIRES_EVENT`). On an operating-category invoice the field\nmust be omitted (`422 ERODE_RESERVES_MISMATCH` either way it is\nmisused). There is no headroom bound: the marks' oriented reserve effect\napplies to the remaining reserve unbounded — the remaining reserve is a\nSIGNED balance, and eroding past the estimate takes it below zero (the\nbooks' statement that payments have outrun an estimate that still\nstands), never a `422`.\n\n**Approval gate (`422 NOT_APPROVED`).** On an invoice that does not\nrequire approval (`approvalRequired: false`, for example money coming\nin), the payment posts for any key that may record payments, and nothing\napproves the invoice. On one that does, this endpoint posts money only\nagainst an APPROVED invoice (`approved: true` on the invoice row). On an\nUNAPPROVED invoice that requires approval, the outcome depends on the\ncalling key's permissions, mirroring the in-app behaviour where a\nsufficiently authorized user's payment auto-approves:\n\n - the key holds `invoice.approve` → the invoice is APPROVED\n automatically as part of this request, in the same transaction and\n before the payment marks, and the payment posts. The response's\n invoice row comes back `approved: true`; the auto-approval is\n deliberately NOT listed in `journalIds` (that array is the payment\n gesture's marks, so an idempotent replay returns an identical body).\n - the key does NOT hold it → `422 NOT_APPROVED`. Approve the invoice\n first — via [approve](/api-reference/financials/approve-invoice) with a\n key that holds the permission, or in the app.\n\nA draft is rejected as `422 INVOICE_DRAFT` regardless of approval: no\nmoney may post against an unposted document.\n\n**Concurrency + idempotency.** Requires `If-Match` (the invoice's current\n`headJournalId`) and a client-minted `actionId`. The `actionId` anchors\nthe FIRST mark's journal action; sibling marks take server-minted ids in\nthe same transaction. An identical retry replays the original outcome —\nthe full `paymentIds` set included. Reusing an `actionId` with different\n`allocations` is `409 ACTION_ID_REUSED`.\n\n**Required permission:** `payment.record`\n","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/payments","href":"/api-reference/financials/record-payment","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"recordFinancialsInvoicePayment","summary":"Record Payment","description":"Records money paid on a bill or collected on an invoice, such as a check\nor wire, and marks the invoice paid or partially paid. Send\n`payBalanceDue: true` to pay it in full or `allocations` to pay named line\nitems; on a claim bill in a reserved category, `erodeReserves` decides\nwhether the payment reduces the claim's reserve. An invoice that requires\napproval (`approvalRequired: true`) must be approved first with Approve\nInvoice (`approveFinancialsInvoice`) unless your key holds\n`invoice.approve`, in which case this call approves it; one that does not\ntakes the payment without an approval. Remove Payment\n(`removeFinancialsInvoicePayment`) undoes a payment.\n\nRecords a payment against the invoice — a gesture the server resolves into\nper-line settlement MARKS, executing one `invoice.payment_recorded` action\nper mark in one transaction and returning the CREATED MARK ROWS\n(`paymentIds` + `createdPayments`), each mark the handle for\n[removing it](/api-reference/financials/remove-payment).\n\n**Two modes, exactly one per request.** Send either `payBalanceDue: true`\nor an `allocations` array — both together, or neither, is a `400`.\n\n - **`payBalanceDue: true`** settles the whole document: one mark per\n OPEN line item at that line's full remaining, in the document's\n line-item order, BOTH directions at once. The invoice comes back\n `paid` with `balanceDueCents: 0`, and the gesture's net cash equals\n the `balanceDueCents` you asked to pay, by construction. Only the\n literal `true` is accepted (`payBalanceDue: false` is a `400`) — to\n pay less, name the lines.\n - **`allocations`** marks exactly the line items you name, for exactly\n the cents you name. Nothing is spread, split, or inferred: a line you\n do not name is untouched, and a line you name for less than its\n remaining stays open.\n\n**Allocation amounts are in the LINE's frame.** `allocations[].amountCents`\nsettles its own line's remaining **toward zero**, so it carries the sign of\nthat remaining — this is NOT the oriented net-cash frame `balanceDueCents`\nreads in. A payable-direction line with 8,000 remaining takes a mark of\n`+8000`; a receivable-direction line with 3,000 remaining takes a mark of\n`+3000` too (money in, but the line's own remaining is positive). Each\namount must be a nonzero integer, and a `lineItemId` may appear at most\nonce per request (both `400`s).\n\n**Per-mark guards (`422`).** Every mark must name a line item on the\ndocument (`422 UNKNOWN_ID`), be nonzero and carry its line's remaining's\nsign — a mark against a settled line, or one running opposite its line's\nremaining, is `422 INVALID_AMOUNT`, as is a `payBalanceDue` against a\ndocument with nothing open — and its magnitude may not exceed its line's\nremaining's (`422 AMOUNT_EXCEEDS_BALANCE_DUE`). The bounds are per line;\nthere is no document-scalar bound. The payment date must not be in the\nfuture (`422 FUTURE_DATE`).\n\n**Reserve erosion.** On an invoice in a reserved category,\n`erodeReserves` is REQUIRED (`true` = the marks consume the linked\nevent's reserves; eroding requires an event link —\n`422 ERODE_REQUIRES_EVENT`). On an operating-category invoice the field\nmust be omitted (`422 ERODE_RESERVES_MISMATCH` either way it is\nmisused). There is no headroom bound: the marks' oriented reserve effect\napplies to the remaining reserve unbounded — the remaining reserve is a\nSIGNED balance, and eroding past the estimate takes it below zero (the\nbooks' statement that payments have outrun an estimate that still\nstands), never a `422`.\n\n**Approval gate (`422 NOT_APPROVED`).** On an invoice that does not\nrequire approval (`approvalRequired: false`, for example money coming\nin), the payment posts for any key that may record payments, and nothing\napproves the invoice. On one that does, this endpoint posts money only\nagainst an APPROVED invoice (`approved: true` on the invoice row). On an\nUNAPPROVED invoice that requires approval, the outcome depends on the\ncalling key's permissions, mirroring the in-app behaviour where a\nsufficiently authorized user's payment auto-approves:\n\n - the key holds `invoice.approve` → the invoice is APPROVED\n automatically as part of this request, in the same transaction and\n before the payment marks, and the payment posts. The response's\n invoice row comes back `approved: true`; the auto-approval is\n deliberately NOT listed in `journalIds` (that array is the payment\n gesture's marks, so an idempotent replay returns an identical body).\n - the key does NOT hold it → `422 NOT_APPROVED`. Approve the invoice\n first — via [approve](/api-reference/financials/approve-invoice) with a\n key that holds the permission, or in the app.\n\nA draft is rejected as `422 INVOICE_DRAFT` regardless of approval: no\nmoney may post against an unposted document.\n\n**Concurrency + idempotency.** Requires `If-Match` (the invoice's current\n`headJournalId`) and a client-minted `actionId`. The `actionId` anchors\nthe FIRST mark's journal action; sibling marks take server-minted ids in\nthe same transaction. An identical retry replays the original outcome —\nthe full `paymentIds` set included. Reusing an `actionId` with different\n`allocations` is `409 ACTION_ID_REUSED`.\n\n**Required permission:** `payment.record`\n","tags":["Financials"],"parameters":["f450e9e6-37af-422f-a274-82bcf8865851","7e93140b-09e1-4689-9675-6b865e704b99","1a439aca-f87f-4bd3-b4bb-74243ec1cddd"],"requestBody":"101426a7-ca6b-42f2-9b8d-2e276c63a29c","responses":{"200":"8e94fd3a-ff9a-467d-81ec-b75fa604464f","400":"5132d4e8-c799-48e4-b9ae-41e068721296","401":"5944d3f7-6903-473c-a1ab-d60cf2f045e5","403":"70be07d9-85bd-4b15-9f29-ca894059da48","404":"d081c28e-b9b8-49fb-9e4c-725243ec1962","409":"8e2af7f1-92d5-4177-9ad8-8462b6616d88","422":"6494b1d1-a8dc-4a1a-914c-352bc86fb203","500":"7cce17b2-e31d-49f0-83a2-5ff7b6fe52c3"},"method":"post","type":"path","servers":["b4993f5b-e21e-4dbd-8ace-9c59b5197d8e"],"security":["35370c79-340a-4ed7-a68a-8c786f4a2235"],"path":"/api/v1/companies/{companyId}/financials/invoices/{invoiceId}/payments","baseUrlOptions":["https://go.aiinsurance.io"],"title":"Record Payment","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"f450e9e6-37af-422f-a274-82bcf8865851":{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid","isRequired":true,"description":"Company identifier","uniqueKey":"","typeLabel":"string\u003cuuid>"},"description":"Company identifier"},"7e93140b-09e1-4689-9675-6b865e704b99":{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string","format":"uuid","isRequired":true,"description":"Invoice identifier","uniqueKey":"","typeLabel":"string\u003cuuid>"},"description":"Invoice identifier"},"1a439aca-f87f-4bd3-b4bb-74243ec1cddd":{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","format":"uuid","isRequired":true,"description":"The invoice's current `headJournalId` — the optimistic-concurrency watermark every single-invoice write after creation must send. Read it off any invoice read or write response and echo it verbatim (a bare uuid; an entity-tag dressing of it — `\"uuid\"` or `W/\"uuid\"` — is also accepted). Missing or malformed is a `400` (`IF_MATCH_REQUIRED` / `IF_MATCH_INVALID`); a stale value is a `409 IF_MATCH_CONFLICT` whose body carries the current invoice. An idempotent `actionId` replay short-circuits BEFORE the watermark is evaluated.","uniqueKey":"","typeLabel":"string\u003cuuid>"},"description":"The invoice's current `headJournalId` — the optimistic-concurrency watermark every single-invoice write after creation must send. Read it off any invoice read or write response and echo it verbatim (a bare uuid; an entity-tag dressing of it — `\"uuid\"` or `W/\"uuid\"` — is also accepted). Missing or malformed is a `400` (`IF_MATCH_REQUIRED` / `IF_MATCH_INVALID`); a stale value is a `409 IF_MATCH_CONFLICT` whose body carries the current invoice. An idempotent `actionId` replay short-circuits BEFORE the watermark is evaluated."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["actionId","paymentDate"],"properties":{"actionId":{"type":"string","format":"uuid","description":"Client-minted idempotency key — becomes the FIRST created mark's journal id (sibling marks mint their own). An identical retry replays the original outcome (the created `paymentIds` included); reuse with a different payload is `409 ACTION_ID_REUSED`","isRequired":true,"uniqueKey":"actionId","typeLabel":"string\u003cuuid>"},"paymentDate":{"type":"string","format":"date","description":"The payment date, stamped on every created mark (ISO `YYYY-MM-DD`); must not be in the future","isRequired":true,"uniqueKey":"paymentDate","typeLabel":"string\u003cdate>"},"author":{"type":"string","minLength":1,"maxLength":255,"description":"Optional display label for the source system's author (e.g. the integrator-side user). Stamped as the journal record's display attribution; the acting principal stays the External API service user, so a label can never impersonate an in-app user. Ignored on idempotent replays","uniqueKey":"author","typeLabel":"string"},"payBalanceDue":{"type":"boolean","enum":[true],"description":"Settle the WHOLE document: one mark per open line item at that line's full remaining, both directions at once, so the gesture's net cash equals `balanceDueCents`. Only the literal `true` is accepted. Mutually exclusive with `allocations` — send exactly one of the two","uniqueKey":"payBalanceDue","typeLabel":"enum\u003cboolean>"},"allocations":{"type":"array","minItems":1,"description":"Explicit per-line marks — exactly the line items named, for exactly the cents named; nothing is spread onto an unnamed line. Mutually exclusive with `payBalanceDue` — send exactly one of the two. Each `lineItemId` may appear at most once","items":{"type":"object","additionalProperties":false,"required":["lineItemId","amountCents"],"properties":{"lineItemId":{"type":"string","format":"uuid","description":"A line item on this invoice (`422 UNKNOWN_ID` otherwise)","isRequired":true,"uniqueKey":"allocations.items.[INDEX].lineItemId","typeLabel":"string\u003cuuid>"},"amountCents":{"type":"integer","description":"Cents applied to that line, in the LINE's frame — it settles the line's remaining toward zero, so it carries that remaining's sign and may not exceed its magnitude. Must be nonzero","isRequired":true,"uniqueKey":"allocations.items.[INDEX].amountCents","typeLabel":"integer"}},"uniqueKey":"allocations.items.[INDEX]","typeLabel":"object"},"uniqueKey":"allocations","typeLabel":"object[]"},"memo":{"type":"string","description":"Free-text memo, stamped on every created mark","uniqueKey":"memo","typeLabel":"string"},"erodeReserves":{"type":"boolean","description":"REQUIRED on a reserved-category invoice — whether the created marks erode the linked event's reserves; must be OMITTED on an operating-category invoice. No headroom bound applies: the remaining reserve is a signed balance and may cross zero","uniqueKey":"erodeReserves","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"examples":{"payBalanceDue":{"title":"payBalanceDue","value":{"actionId":"5e7f9a1b-3c4d-4e6f-8a0b-9c1d2e3f4a5b","payBalanceDue":true,"paymentDate":"2026-06-10","memo":"check #100","erodeReserves":true}},"partialAllocation":{"title":"partialAllocation","value":{"actionId":"6f8a0b2c-4d5e-4f7a-9b1c-0d2e3f4a5b6c","allocations":[{"lineItemId":"550e8400-e29b-41d4-a716-446655440300","amountCents":200000}],"paymentDate":"2026-06-10","erodeReserves":true}},"splitAllocation":{"title":"splitAllocation","value":{"actionId":"7a9b1c3d-5e6f-4a8b-9c0d-1e2f3a4b5c6d","allocations":[{"lineItemId":"550e8400-e29b-41d4-a716-446655440300","amountCents":800000},{"lineItemId":"550e8400-e29b-41d4-a716-446655440301","amountCents":300000}],"paymentDate":"2026-06-10"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"8e94fd3a-ff9a-467d-81ec-b75fa604464f":{"description":"The refreshed invoice state plus the created MARK rows: `paymentIds` are the server-minted removal handles in mark order, and `createdPayments` the full mark rows they name (each also present in the refreshed `payments`)","content":{"application/json":{"schema":{"type":"object","description":"The response of every single-invoice write — refreshed read state, not an ack: the emitted journal id(s), THE invoice row (identical shape to the reads — one invoice representation everywhere; its `headJournalId` is the next `If-Match`), and the invoice's live payments. An idempotent `actionId` replay returns this same shape rebuilt from the original outcome, server-minted values included.","required":["paymentIds","createdPayments","journalIds","invoice","payments"],"properties":{"journalIds":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","uniqueKey":"journalIds.items.[INDEX]","typeLabel":"string\u003cuuid>"},"description":"Every journal id the write emitted — the anchor action's id (the `actionId` you supplied) first, then any engine-minted siblings (a multi-mark payment's additional marks) and any companion the horizon rule composed (e.g. the reserve unwind of a pre-horizon eroding payment's removal, or a delete's payment sweep)","isRequired":true,"uniqueKey":"journalIds","typeLabel":"string\u003cuuid>[]"},"invoice":{"type":"object","description":"THE invoice representation — the same shape everywhere an endpoint returns an invoice (listing rows, the detail read, and every write's refreshed-row response; the policy invoice batch's rows also carry `approvedBy`). `headJournalId` is the invoice's current journal head — the optimistic-concurrency token subsequent writes echo back as `If-Match`.","required":["id","transactionId","invoiceNumber","categoryId","status","linkedEvent","linkedPolicy","linkedPayee","incurredDate","dueDate","memo","fieldData","lineItems","totalAmountCents","amountPaidCents","balanceDueCents","draftAmountPaidCents","paidDate","lastPaymentDate","voidedAt","deletedAt","approved","approvedAt","approvalRequired","createdAt","updatedAt","headJournalId"],"properties":{"id":{"type":"string","format":"uuid","description":"The invoice's id","isRequired":true,"uniqueKey":"invoice.id","typeLabel":"string\u003cuuid>"},"transactionId":{"type":"string","description":"The invoice's Transaction ID, `INV-XXXXXX-XXX`, generated by the server when the invoice is created. Unique per company, never reused, and never changed; it is the value that names an invoice to a person","isRequired":true,"uniqueKey":"invoice.transactionId","typeLabel":"string"},"invoiceNumber":{"oneOf":[{"type":"string","description":"The sender's invoice number: the number printed on the invoice by whoever issued it, or `null` when none was given. Free text with no uniqueness, so several invoices may share one. Set on create, event import or a policy invoice batch, and changeable through Update Invoice before and after posting. A policy invoice the batch creates defaults to its own `transactionId` here unless the batch names another","isRequired":true,"uniqueKey":"invoice.invoiceNumber.oneOf.0","typeLabel":"string"},{"type":"null","description":"The sender's invoice number: the number printed on the invoice by whoever issued it, or `null` when none was given. Free text with no uniqueness, so several invoices may share one. Set on create, event import or a policy invoice batch, and changeable through Update Invoice before and after posting. A policy invoice the batch creates defaults to its own `transactionId` here unless the batch names another","isRequired":true,"uniqueKey":"invoice.invoiceNumber.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.invoiceNumber","typeLabel":"string | null"},"categoryId":{"type":"string","format":"uuid","description":"The transaction category the invoice belongs to","isRequired":true,"uniqueKey":"invoice.categoryId","typeLabel":"string\u003cuuid>"},"status":{"type":"string","enum":["draft","no_charges","owed","partially_paid","paid","voided","deleted"],"description":"Derived status, first match wins: `deleted` → `draft` → `voided` → `no_charges` (every line item's amount is zero) → `paid` (every line item is settled — its amount minus its live marks is exactly zero) → `owed` (no live payment marks) → `partially_paid`. Settlement is per line: no scalar makes a document paid, and a zero-due document with unsettled lines still reads `owed`","isRequired":true,"uniqueKey":"invoice.status","typeLabel":"enum\u003cstring>"},"linkedEvent":{"oneOf":[{"type":"object","description":"The linked event, display-ready (the server resolves the display name), or `null` when not linked to an event","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked event's id","isRequired":true,"uniqueKey":"invoice.linkedEvent.oneOf.0.id","typeLabel":"string\u003cuuid>"},"displayName":{"type":"string","description":"The linked event's display name","isRequired":true,"uniqueKey":"invoice.linkedEvent.oneOf.0.displayName","typeLabel":"string"}},"isRequired":true,"uniqueKey":"invoice.linkedEvent.oneOf.0","typeLabel":"object"},{"type":"null","description":"The linked event, display-ready (the server resolves the display name), or `null` when not linked to an event","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked event's id"},"displayName":{"type":"string","description":"The linked event's display name"}},"isRequired":true,"uniqueKey":"invoice.linkedEvent.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.linkedEvent","typeLabel":"object | null"},"linkedPolicy":{"oneOf":[{"type":"object","description":"The linked policy, display-ready, or `null`. An invoice links to an event or a policy, never both","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked policy's id","isRequired":true,"uniqueKey":"invoice.linkedPolicy.oneOf.0.id","typeLabel":"string\u003cuuid>"},"displayName":{"type":"string","description":"The linked policy's display name","isRequired":true,"uniqueKey":"invoice.linkedPolicy.oneOf.0.displayName","typeLabel":"string"}},"isRequired":true,"uniqueKey":"invoice.linkedPolicy.oneOf.0","typeLabel":"object"},{"type":"null","description":"The linked policy, display-ready, or `null`. An invoice links to an event or a policy, never both","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked policy's id"},"displayName":{"type":"string","description":"The linked policy's display name"}},"isRequired":true,"uniqueKey":"invoice.linkedPolicy.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.linkedPolicy","typeLabel":"object | null"},"linkedPayee":{"oneOf":[{"type":"object","description":"The invoice's payee, display-ready, or `null` when none is set. `entityType` is an open string (e.g. `Person`, `Organization`) — the payee vocabulary is the entity module's, not part of this contract","required":["id","entityType","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The payee entity's id","isRequired":true,"uniqueKey":"invoice.linkedPayee.oneOf.0.id","typeLabel":"string\u003cuuid>"},"entityType":{"type":"string","description":"The payee's entity type (e.g. Person, Organization)","isRequired":true,"uniqueKey":"invoice.linkedPayee.oneOf.0.entityType","typeLabel":"string"},"displayName":{"type":"string","description":"The payee's display name","isRequired":true,"uniqueKey":"invoice.linkedPayee.oneOf.0.displayName","typeLabel":"string"}},"isRequired":true,"uniqueKey":"invoice.linkedPayee.oneOf.0","typeLabel":"object"},{"type":"null","description":"The invoice's payee, display-ready, or `null` when none is set. `entityType` is an open string (e.g. `Person`, `Organization`) — the payee vocabulary is the entity module's, not part of this contract","required":["id","entityType","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The payee entity's id"},"entityType":{"type":"string","description":"The payee's entity type (e.g. Person, Organization)"},"displayName":{"type":"string","description":"The payee's display name"}},"isRequired":true,"uniqueKey":"invoice.linkedPayee.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.linkedPayee","typeLabel":"object | null"},"incurredDate":{"oneOf":[{"type":"string","format":"date","description":"The date the charges were incurred (ISO `YYYY-MM-DD`), or `null`","isRequired":true,"uniqueKey":"invoice.incurredDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"The date the charges were incurred (ISO `YYYY-MM-DD`), or `null`","isRequired":true,"uniqueKey":"invoice.incurredDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.incurredDate","typeLabel":"string\u003cdate> | null"},"dueDate":{"oneOf":[{"type":"string","format":"date","description":"When payment is owed (display metadata only), or `null`","isRequired":true,"uniqueKey":"invoice.dueDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"When payment is owed (display metadata only), or `null`","isRequired":true,"uniqueKey":"invoice.dueDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.dueDate","typeLabel":"string\u003cdate> | null"},"memo":{"oneOf":[{"type":"string","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"invoice.memo.oneOf.0","typeLabel":"string"},{"type":"null","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"invoice.memo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.memo","typeLabel":"string | null"},"fieldData":{"oneOf":[{"type":"object","additionalProperties":true,"description":"Values for the tenant-defined custom invoice fields, keyed by field referenceId — an opaque JSON object, or `null`","isRequired":true,"uniqueKey":"invoice.fieldData.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":true,"description":"Values for the tenant-defined custom invoice fields, keyed by field referenceId — an opaque JSON object, or `null`","isRequired":true,"uniqueKey":"invoice.fieldData.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.fieldData","typeLabel":"object | null"},"lineItems":{"type":"array","description":"The invoice's line items","items":{"type":"object","description":"A stored invoice line item as rendered on invoice reads.","required":["lineItemId","lineItemTypeId","memo","amountCents"],"properties":{"lineItemId":{"type":"string","format":"uuid","description":"The line item's id","isRequired":true,"uniqueKey":"invoice.lineItems.items.[INDEX].lineItemId","typeLabel":"string\u003cuuid>"},"lineItemTypeId":{"type":"string","format":"uuid","description":"The configured line item type this item cites — discover ids with `GET /api/v1/companies/{companyId}/financials/config/categories`","isRequired":true,"uniqueKey":"invoice.lineItems.items.[INDEX].lineItemTypeId","typeLabel":"string\u003cuuid>"},"memo":{"oneOf":[{"type":"string","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"invoice.lineItems.items.[INDEX].memo.oneOf.0","typeLabel":"string"},{"type":"null","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"invoice.lineItems.items.[INDEX].memo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.lineItems.items.[INDEX].memo","typeLabel":"string | null"},"amountCents":{"type":"integer","description":"The line item's signed amount in integer cents; a negative amount is a credit within the item's own frame — it posts opposite the line item type's expected direction (e.g. a reversal or refund); the posting rule always comes from the type, never the sign","isRequired":true,"uniqueKey":"invoice.lineItems.items.[INDEX].amountCents","typeLabel":"integer"}},"uniqueKey":"invoice.lineItems.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"invoice.lineItems","typeLabel":"object[]"},"totalAmountCents":{"type":"integer","description":"Sum of the ORIENTED line-item amounts (a payable-direction line counts +, a receivable-direction line counts −), in integer cents — the net cash the document commits to move","isRequired":true,"uniqueKey":"invoice.totalAmountCents","typeLabel":"integer"},"amountPaidCents":{"type":"integer","description":"Sum of the ORIENTED live payment marks, in integer cents — the net cash moved so far","isRequired":true,"uniqueKey":"invoice.amountPaidCents","typeLabel":"integer"},"balanceDueCents":{"type":"integer","description":"`totalAmountCents - amountPaidCents`, in integer cents — the net cash remaining to move: positive = out, negative = in. May move non-monotonically as opposite-direction lines settle. A voided invoice keeps its amounts here and in `totalAmountCents`, although it no longer owes anything, so leave voided invoices out when adding up what is owed","isRequired":true,"uniqueKey":"invoice.balanceDueCents","typeLabel":"integer"},"draftAmountPaidCents":{"oneOf":[{"type":"integer","description":"A DRAFT's annex-derived paid total: the oriented net-cash sum of the payment marks the draft was born carrying (the same frame as `amountPaidCents`, which counts LIVE posted marks only and reads 0 while drafting) — what a draft's underlying payment picture will read once finalized. `null` on non-draft invoices (the annex is spent at finalize). Display-only — never a posted ledger amount","isRequired":true,"uniqueKey":"invoice.draftAmountPaidCents.oneOf.0","typeLabel":"integer"},{"type":"null","description":"A DRAFT's annex-derived paid total: the oriented net-cash sum of the payment marks the draft was born carrying (the same frame as `amountPaidCents`, which counts LIVE posted marks only and reads 0 while drafting) — what a draft's underlying payment picture will read once finalized. `null` on non-draft invoices (the annex is spent at finalize). Display-only — never a posted ledger amount","isRequired":true,"uniqueKey":"invoice.draftAmountPaidCents.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.draftAmountPaidCents","typeLabel":"integer | null"},"paidDate":{"oneOf":[{"type":"string","format":"date","description":"Payment date of the mark that first made every line item settled; clears (`null`) whenever any line reopens","isRequired":true,"uniqueKey":"invoice.paidDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"Payment date of the mark that first made every line item settled; clears (`null`) whenever any line reopens","isRequired":true,"uniqueKey":"invoice.paidDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.paidDate","typeLabel":"string\u003cdate> | null"},"lastPaymentDate":{"oneOf":[{"type":"string","format":"date","description":"Date of the most recent live payment, or `null`","isRequired":true,"uniqueKey":"invoice.lastPaymentDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"Date of the most recent live payment, or `null`","isRequired":true,"uniqueKey":"invoice.lastPaymentDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.lastPaymentDate","typeLabel":"string\u003cdate> | null"},"voidedAt":{"oneOf":[{"type":"string","format":"date-time","description":"When the invoice was voided, or `null`","isRequired":true,"uniqueKey":"invoice.voidedAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the invoice was voided, or `null`","isRequired":true,"uniqueKey":"invoice.voidedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.voidedAt","typeLabel":"string\u003cdate-time> | null"},"deletedAt":{"oneOf":[{"type":"string","format":"date-time","description":"When the invoice was deleted, or `null`","isRequired":true,"uniqueKey":"invoice.deletedAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the invoice was deleted, or `null`","isRequired":true,"uniqueKey":"invoice.deletedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.deletedAt","typeLabel":"string\u003cdate-time> | null"},"approved":{"type":"boolean","description":"The approval projection: `true` after `invoice.approved`, cleared only by `invoice.unapproved` — an edit never resets approval (the approval-relevant facts, line items and category, are immutable once posted)","isRequired":true,"uniqueKey":"invoice.approved","typeLabel":"boolean"},"approvedAt":{"oneOf":[{"type":"string","format":"date-time","description":"When the approval landed (`invoice.approved`), or `null` while unapproved — `approved` is exactly `approvedAt != null`","isRequired":true,"uniqueKey":"invoice.approvedAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the approval landed (`invoice.approved`), or `null` while unapproved — `approved` is exactly `approvedAt != null`","isRequired":true,"uniqueKey":"invoice.approvedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"invoice.approvedAt","typeLabel":"string\u003cdate-time> | null"},"approvalRequired":{"type":"boolean","description":"Whether approval applies to this invoice. A money-out invoice (a positive `totalAmountCents`) requires approval when its type's \"Money-out invoices require approval\" setting is on; a money-in invoice (negative total) never does, and a zero total follows its type's expected direction. The value is recorded on the invoice when it is created, so a later change to the type's setting does not alter it. When `false`, Record Payment goes through without an approval, and any approval the invoice carries (`approved`) is kept but no longer matters.","isRequired":true,"uniqueKey":"invoice.approvalRequired","typeLabel":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"When the invoice was created","isRequired":true,"uniqueKey":"invoice.createdAt","typeLabel":"string\u003cdate-time>"},"updatedAt":{"type":"string","format":"date-time","description":"When the invoice last changed","isRequired":true,"uniqueKey":"invoice.updatedAt","typeLabel":"string\u003cdate-time>"},"headJournalId":{"type":"string","format":"uuid","description":"The invoice's current journal head — send it as `If-Match` on the next write to this invoice; a mismatch is a `409` carrying the current row","isRequired":true,"uniqueKey":"invoice.headJournalId","typeLabel":"string\u003cuuid>"}},"isRequired":true,"uniqueKey":"invoice","typeLabel":"object"},"payments":{"type":"array","description":"The invoice's live payment marks after the write, newest first","items":{"type":"object","description":"A recorded payment MARK on an invoice: one row = one per-line settlement mark against `lineItemId`. `amountCents` is signed in the LINE's frame — its sign matches the line's open remaining, and the mark settles that line toward zero. One journal action per mark (`journalId` is the record that created it), each independently removable by `id`; one gesture (e.g. paying a document's whole balance due) may create several marks. `erodeReserves` is the caller's choice at record time (`null` where the invoice's category has no reserves to erode).","required":["id","journalId","lineItemId","amountCents","paymentDate","erodeReserves","memo","createdAt"],"properties":{"id":{"type":"string","format":"uuid","description":"The payment mark's id — the handle for removing it","isRequired":true,"uniqueKey":"payments.items.[INDEX].id","typeLabel":"string\u003cuuid>"},"journalId":{"type":"string","format":"uuid","description":"The journal record that recorded the mark","isRequired":true,"uniqueKey":"payments.items.[INDEX].journalId","typeLabel":"string\u003cuuid>"},"lineItemId":{"type":"string","format":"uuid","description":"The invoice line item the mark settles","isRequired":true,"uniqueKey":"payments.items.[INDEX].lineItemId","typeLabel":"string\u003cuuid>"},"amountCents":{"type":"integer","description":"The mark's amount in signed integer cents, in its line item's frame — the sign matches the line's remaining and the mark settles it toward zero","isRequired":true,"uniqueKey":"payments.items.[INDEX].amountCents","typeLabel":"integer"},"paymentDate":{"type":"string","format":"date","description":"The payment date (ISO `YYYY-MM-DD`)","isRequired":true,"uniqueKey":"payments.items.[INDEX].paymentDate","typeLabel":"string\u003cdate>"},"erodeReserves":{"oneOf":[{"type":"boolean","description":"Whether the mark erodes the linked event's reserves; `null` where the invoice's category carries no reserves","isRequired":true,"uniqueKey":"payments.items.[INDEX].erodeReserves.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the mark erodes the linked event's reserves; `null` where the invoice's category carries no reserves","isRequired":true,"uniqueKey":"payments.items.[INDEX].erodeReserves.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"payments.items.[INDEX].erodeReserves","typeLabel":"boolean | null"},"memo":{"oneOf":[{"type":"string","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"payments.items.[INDEX].memo.oneOf.0","typeLabel":"string"},{"type":"null","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"payments.items.[INDEX].memo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"payments.items.[INDEX].memo","typeLabel":"string | null"},"createdAt":{"type":"string","format":"date-time","description":"When the mark was recorded","isRequired":true,"uniqueKey":"payments.items.[INDEX].createdAt","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"payments.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"payments","typeLabel":"object[]"},"paymentIds":{"type":"array","items":{"type":"string","format":"uuid","uniqueKey":"paymentIds.items.[INDEX]","typeLabel":"string\u003cuuid>"},"description":"The created marks' server-minted ids, in mark order (the request's `allocations` order, or line-item order under `payBalanceDue`) — each the handle for `DELETE …/payments/{paymentId}`","isRequired":true,"uniqueKey":"paymentIds","typeLabel":"string\u003cuuid>[]"},"createdPayments":{"type":"array","items":{"type":"object","description":"A recorded payment MARK on an invoice: one row = one per-line settlement mark against `lineItemId`. `amountCents` is signed in the LINE's frame — its sign matches the line's open remaining, and the mark settles that line toward zero. One journal action per mark (`journalId` is the record that created it), each independently removable by `id`; one gesture (e.g. paying a document's whole balance due) may create several marks. `erodeReserves` is the caller's choice at record time (`null` where the invoice's category has no reserves to erode).","required":["id","journalId","lineItemId","amountCents","paymentDate","erodeReserves","memo","createdAt"],"properties":{"id":{"type":"string","format":"uuid","description":"The payment mark's id — the handle for removing it","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].id","typeLabel":"string\u003cuuid>"},"journalId":{"type":"string","format":"uuid","description":"The journal record that recorded the mark","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].journalId","typeLabel":"string\u003cuuid>"},"lineItemId":{"type":"string","format":"uuid","description":"The invoice line item the mark settles","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].lineItemId","typeLabel":"string\u003cuuid>"},"amountCents":{"type":"integer","description":"The mark's amount in signed integer cents, in its line item's frame — the sign matches the line's remaining and the mark settles it toward zero","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].amountCents","typeLabel":"integer"},"paymentDate":{"type":"string","format":"date","description":"The payment date (ISO `YYYY-MM-DD`)","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].paymentDate","typeLabel":"string\u003cdate>"},"erodeReserves":{"oneOf":[{"type":"boolean","description":"Whether the mark erodes the linked event's reserves; `null` where the invoice's category carries no reserves","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].erodeReserves.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the mark erodes the linked event's reserves; `null` where the invoice's category carries no reserves","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].erodeReserves.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].erodeReserves","typeLabel":"boolean | null"},"memo":{"oneOf":[{"type":"string","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].memo.oneOf.0","typeLabel":"string"},{"type":"null","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].memo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].memo","typeLabel":"string | null"},"createdAt":{"type":"string","format":"date-time","description":"When the mark was recorded","isRequired":true,"uniqueKey":"createdPayments.items.[INDEX].createdAt","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"createdPayments.items.[INDEX]","typeLabel":"object"},"description":"The created mark rows, in mark order","isRequired":true,"uniqueKey":"createdPayments","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"recorded":{"title":"recorded","value":{"journalIds":["5e7f9a1b-3c4d-4e6f-8a0b-9c1d2e3f4a5b"],"paymentIds":["550e8400-e29b-41d4-a716-446655440800"],"createdPayments":[{"id":"550e8400-e29b-41d4-a716-446655440800","journalId":"5e7f9a1b-3c4d-4e6f-8a0b-9c1d2e3f4a5b","lineItemId":"550e8400-e29b-41d4-a716-446655440300","amountCents":200000,"paymentDate":"2026-06-10","erodeReserves":true,"memo":"check #100","createdAt":"2026-06-10T09:00:00.000Z"}],"invoice":{"id":"550e8400-e29b-41d4-a716-446655440700","transactionId":"INV-389538-455","invoiceNumber":"SL-2026-0412","categoryId":"550e8400-e29b-41d4-a716-446655440100","status":"partially_paid","linkedEvent":{"id":"550e8400-e29b-41d4-a716-446655440200","displayName":"Claim #1042"},"linkedPolicy":null,"linkedPayee":null,"incurredDate":"2026-06-01","dueDate":null,"memo":"Defense costs less subrogation recovery","fieldData":null,"lineItems":[{"lineItemId":"550e8400-e29b-41d4-a716-446655440300","lineItemTypeId":"550e8400-e29b-41d4-a716-446655440110","memo":"Fees (payable direction)","amountCents":800000},{"lineItemId":"550e8400-e29b-41d4-a716-446655440301","lineItemTypeId":"550e8400-e29b-41d4-a716-446655440111","memo":"Recovery (receivable direction)","amountCents":300000}],"totalAmountCents":500000,"amountPaidCents":200000,"balanceDueCents":300000,"draftAmountPaidCents":null,"paidDate":null,"lastPaymentDate":"2026-06-10","approved":true,"approvedAt":"2026-06-10T09:00:00.000Z","approvalRequired":true,"voidedAt":null,"deletedAt":null,"createdAt":"2026-06-01T10:30:00.000Z","updatedAt":"2026-06-10T09:00:00.000Z","headJournalId":"5e7f9a1b-3c4d-4e6f-8a0b-9c1d2e3f4a5b"},"payments":[{"id":"550e8400-e29b-41d4-a716-446655440800","journalId":"5e7f9a1b-3c4d-4e6f-8a0b-9c1d2e3f4a5b","lineItemId":"550e8400-e29b-41d4-a716-446655440300","amountCents":200000,"paymentDate":"2026-06-10","erodeReserves":true,"memo":"check #100","createdAt":"2026-06-10T09:00:00.000Z"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"5132d4e8-c799-48e4-b9ae-41e068721296":{"description":"Bad Request — a malformed payload (both `allocations` and `payBalanceDue`, neither of them, `payBalanceDue: false`, an empty `allocations` array, a zero allocation amount, a repeated `lineItemId`), or a missing/malformed `If-Match` header (`IF_MATCH_REQUIRED` / `IF_MATCH_INVALID`)","content":{"application/json":{"schema":{"type":"object","description":"Standard error response for all external API endpoints","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code","example":"VALIDATION_ERROR","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","example":"submissionId: Required field is missing","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages — one entry per failure, free of error-code tags, field paths, and internal noise. Suitable for showing to end users as-is.","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"example":["Exposures of type 'company' require an address"],"uniqueKey":"error.userMessages","typeLabel":"string[]"},"details":{"type":"array","description":"Additional details for validation errors (field-level errors)","items":{"type":"object","properties":{"field":{"type":"string","description":"The field that caused the error","example":"submissionId","uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","description":"Stable problem code for this individual validation failure","example":"BLANK_LIST_ELEMENT","uniqueKey":"error.details.items.[INDEX].code","typeLabel":"string"},"reason":{"type":"string","description":"Stable reason the value violates its canonical contract","example":"blank-list-element","uniqueKey":"error.details.items.[INDEX].reason","typeLabel":"string"},"expected":{"type":"string","description":"The expected canonical value contract","example":"nonblank trimmed string","uniqueKey":"error.details.items.[INDEX].expected","typeLabel":"string"},"message":{"type":"string","description":"Description of the field error","example":"Required field is missing","uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"bothModes":{"title":"bothModes","value":{"error":{"code":"VALIDATION_ERROR","message":"Exactly one of `allocations` or `payBalanceDue` is required — supply explicit per-line marks, or ask for the whole balance","userMessages":["Exactly one of `allocations` or `payBalanceDue` is required — supply explicit per-line marks, or ask for the whole balance"]}}},"duplicateLineItem":{"title":"duplicateLineItem","value":{"error":{"code":"VALIDATION_ERROR","message":"allocations may name each lineItemId at most once — combine a line’s marks into one entry","userMessages":["allocations may name each lineItemId at most once — combine a line’s marks into one entry"]}}}},"exampleType":"examples"}},"exampleType":"examples"},"5944d3f7-6903-473c-a1ab-d60cf2f045e5":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"type":"object","description":"Standard error response for all external API endpoints","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code","example":"VALIDATION_ERROR","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","example":"submissionId: Required field is missing","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages — one entry per failure, free of error-code tags, field paths, and internal noise. Suitable for showing to end users as-is.","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"example":["Exposures of type 'company' require an address"],"uniqueKey":"error.userMessages","typeLabel":"string[]"},"details":{"type":"array","description":"Additional details for validation errors (field-level errors)","items":{"type":"object","properties":{"field":{"type":"string","description":"The field that caused the error","example":"submissionId","uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","description":"Stable problem code for this individual validation failure","example":"BLANK_LIST_ELEMENT","uniqueKey":"error.details.items.[INDEX].code","typeLabel":"string"},"reason":{"type":"string","description":"Stable reason the value violates its canonical contract","example":"blank-list-element","uniqueKey":"error.details.items.[INDEX].reason","typeLabel":"string"},"expected":{"type":"string","description":"The expected canonical value contract","example":"nonblank trimmed string","uniqueKey":"error.details.items.[INDEX].expected","typeLabel":"string"},"message":{"type":"string","description":"Description of the field error","example":"Required field is missing","uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"missingApiKey":{"title":"missingApiKey","value":{"error":{"code":"AuthenticationError","message":"API key authentication required","userMessages":["API key authentication required"]}}},"invalidApiKey":{"title":"invalidApiKey","value":{"error":{"code":"AuthenticationError","message":"Invalid API key","userMessages":["Invalid API key"]}}}},"exampleType":"examples"}},"exampleType":"examples"},"70be07d9-85bd-4b15-9f29-ca894059da48":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","description":"Standard error response for all external API endpoints","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code","example":"VALIDATION_ERROR","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","example":"submissionId: Required field is missing","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages — one entry per failure, free of error-code tags, field paths, and internal noise. Suitable for showing to end users as-is.","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"example":["Exposures of type 'company' require an address"],"uniqueKey":"error.userMessages","typeLabel":"string[]"},"details":{"type":"array","description":"Additional details for validation errors (field-level errors)","items":{"type":"object","properties":{"field":{"type":"string","description":"The field that caused the error","example":"submissionId","uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","description":"Stable problem code for this individual validation failure","example":"BLANK_LIST_ELEMENT","uniqueKey":"error.details.items.[INDEX].code","typeLabel":"string"},"reason":{"type":"string","description":"Stable reason the value violates its canonical contract","example":"blank-list-element","uniqueKey":"error.details.items.[INDEX].reason","typeLabel":"string"},"expected":{"type":"string","description":"The expected canonical value contract","example":"nonblank trimmed string","uniqueKey":"error.details.items.[INDEX].expected","typeLabel":"string"},"message":{"type":"string","description":"Description of the field error","example":"Required field is missing","uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"insufficientPermissions":{"title":"insufficientPermissions","value":{"error":{"code":"AuthorizationError","message":"User is not authorized to perform the requested action","userMessages":["User is not authorized to perform the requested action"]}}},"companyMismatch":{"title":"companyMismatch","value":{"error":{"code":"AuthorizationError","message":"API key is not scoped to the requested company","userMessages":["API key is not scoped to the requested company"]}}}},"exampleType":"examples"}},"exampleType":"examples"},"d081c28e-b9b8-49fb-9e4c-725243ec1962":{"description":"Not Found — no invoice with this id","content":{"application/json":{"schema":{"type":"object","description":"Standard error response for all external API endpoints","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code","example":"VALIDATION_ERROR","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","example":"submissionId: Required field is missing","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages — one entry per failure, free of error-code tags, field paths, and internal noise. Suitable for showing to end users as-is.","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"example":["Exposures of type 'company' require an address"],"uniqueKey":"error.userMessages","typeLabel":"string[]"},"details":{"type":"array","description":"Additional details for validation errors (field-level errors)","items":{"type":"object","properties":{"field":{"type":"string","description":"The field that caused the error","example":"submissionId","uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","description":"Stable problem code for this individual validation failure","example":"BLANK_LIST_ELEMENT","uniqueKey":"error.details.items.[INDEX].code","typeLabel":"string"},"reason":{"type":"string","description":"Stable reason the value violates its canonical contract","example":"blank-list-element","uniqueKey":"error.details.items.[INDEX].reason","typeLabel":"string"},"expected":{"type":"string","description":"The expected canonical value contract","example":"nonblank trimmed string","uniqueKey":"error.details.items.[INDEX].expected","typeLabel":"string"},"message":{"type":"string","description":"Description of the field error","example":"Required field is missing","uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"invoiceNotFound":{"title":"invoiceNotFound","value":{"error":{"code":"NotFoundError","message":"Invoice not found","userMessages":["Invoice not found"]}}}},"exampleType":"examples"}},"exampleType":"examples"},"8e2af7f1-92d5-4177-9ad8-8462b6616d88":{"description":"Conflict — a stale `If-Match` watermark (`IF_MATCH_CONFLICT`: the body carries the invoice's CURRENT row; re-read, reconcile, retry with its `headJournalId`), or an `actionId` reused by a different action (`ACTION_ID_REUSED`: supply a fresh uuid — an identical retry replays instead).","content":{"application/json":{"schema":{"type":"object","description":"The conflict envelope of an `If-Match` invoice write. `IF_MATCH_CONFLICT`: the supplied watermark is stale — `error.currentInvoice` is the invoice's CURRENT row; re-read, reconcile, and retry with its `headJournalId`. `ACTION_ID_REUSED`: the `actionId` names a different recorded action (no `currentInvoice`).","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["IF_MATCH_CONFLICT","ACTION_ID_REUSED"],"description":"Which conflict occurred","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"uniqueKey":"error.userMessages","typeLabel":"string[]"},"currentInvoice":{"type":"object","description":"Present exactly when `code` is `IF_MATCH_CONFLICT` — the invoice's current row; its `headJournalId` is the fresh `If-Match` value for the retry","required":["id","transactionId","invoiceNumber","categoryId","status","linkedEvent","linkedPolicy","linkedPayee","incurredDate","dueDate","memo","fieldData","lineItems","totalAmountCents","amountPaidCents","balanceDueCents","draftAmountPaidCents","paidDate","lastPaymentDate","voidedAt","deletedAt","approved","approvedAt","approvalRequired","createdAt","updatedAt","headJournalId"],"properties":{"id":{"type":"string","format":"uuid","description":"The invoice's id","isRequired":true,"uniqueKey":"error.currentInvoice.id","typeLabel":"string\u003cuuid>"},"transactionId":{"type":"string","description":"The invoice's Transaction ID, `INV-XXXXXX-XXX`, generated by the server when the invoice is created. Unique per company, never reused, and never changed; it is the value that names an invoice to a person","isRequired":true,"uniqueKey":"error.currentInvoice.transactionId","typeLabel":"string"},"invoiceNumber":{"oneOf":[{"type":"string","description":"The sender's invoice number: the number printed on the invoice by whoever issued it, or `null` when none was given. Free text with no uniqueness, so several invoices may share one. Set on create, event import or a policy invoice batch, and changeable through Update Invoice before and after posting. A policy invoice the batch creates defaults to its own `transactionId` here unless the batch names another","isRequired":true,"uniqueKey":"error.currentInvoice.invoiceNumber.oneOf.0","typeLabel":"string"},{"type":"null","description":"The sender's invoice number: the number printed on the invoice by whoever issued it, or `null` when none was given. Free text with no uniqueness, so several invoices may share one. Set on create, event import or a policy invoice batch, and changeable through Update Invoice before and after posting. A policy invoice the batch creates defaults to its own `transactionId` here unless the batch names another","isRequired":true,"uniqueKey":"error.currentInvoice.invoiceNumber.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.invoiceNumber","typeLabel":"string | null"},"categoryId":{"type":"string","format":"uuid","description":"The transaction category the invoice belongs to","isRequired":true,"uniqueKey":"error.currentInvoice.categoryId","typeLabel":"string\u003cuuid>"},"status":{"type":"string","enum":["draft","no_charges","owed","partially_paid","paid","voided","deleted"],"description":"Derived status, first match wins: `deleted` → `draft` → `voided` → `no_charges` (every line item's amount is zero) → `paid` (every line item is settled — its amount minus its live marks is exactly zero) → `owed` (no live payment marks) → `partially_paid`. Settlement is per line: no scalar makes a document paid, and a zero-due document with unsettled lines still reads `owed`","isRequired":true,"uniqueKey":"error.currentInvoice.status","typeLabel":"enum\u003cstring>"},"linkedEvent":{"oneOf":[{"type":"object","description":"The linked event, display-ready (the server resolves the display name), or `null` when not linked to an event","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked event's id","isRequired":true,"uniqueKey":"error.currentInvoice.linkedEvent.oneOf.0.id","typeLabel":"string\u003cuuid>"},"displayName":{"type":"string","description":"The linked event's display name","isRequired":true,"uniqueKey":"error.currentInvoice.linkedEvent.oneOf.0.displayName","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error.currentInvoice.linkedEvent.oneOf.0","typeLabel":"object"},{"type":"null","description":"The linked event, display-ready (the server resolves the display name), or `null` when not linked to an event","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked event's id"},"displayName":{"type":"string","description":"The linked event's display name"}},"isRequired":true,"uniqueKey":"error.currentInvoice.linkedEvent.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.linkedEvent","typeLabel":"object | null"},"linkedPolicy":{"oneOf":[{"type":"object","description":"The linked policy, display-ready, or `null`. An invoice links to an event or a policy, never both","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked policy's id","isRequired":true,"uniqueKey":"error.currentInvoice.linkedPolicy.oneOf.0.id","typeLabel":"string\u003cuuid>"},"displayName":{"type":"string","description":"The linked policy's display name","isRequired":true,"uniqueKey":"error.currentInvoice.linkedPolicy.oneOf.0.displayName","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error.currentInvoice.linkedPolicy.oneOf.0","typeLabel":"object"},{"type":"null","description":"The linked policy, display-ready, or `null`. An invoice links to an event or a policy, never both","required":["id","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The linked policy's id"},"displayName":{"type":"string","description":"The linked policy's display name"}},"isRequired":true,"uniqueKey":"error.currentInvoice.linkedPolicy.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.linkedPolicy","typeLabel":"object | null"},"linkedPayee":{"oneOf":[{"type":"object","description":"The invoice's payee, display-ready, or `null` when none is set. `entityType` is an open string (e.g. `Person`, `Organization`) — the payee vocabulary is the entity module's, not part of this contract","required":["id","entityType","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The payee entity's id","isRequired":true,"uniqueKey":"error.currentInvoice.linkedPayee.oneOf.0.id","typeLabel":"string\u003cuuid>"},"entityType":{"type":"string","description":"The payee's entity type (e.g. Person, Organization)","isRequired":true,"uniqueKey":"error.currentInvoice.linkedPayee.oneOf.0.entityType","typeLabel":"string"},"displayName":{"type":"string","description":"The payee's display name","isRequired":true,"uniqueKey":"error.currentInvoice.linkedPayee.oneOf.0.displayName","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error.currentInvoice.linkedPayee.oneOf.0","typeLabel":"object"},{"type":"null","description":"The invoice's payee, display-ready, or `null` when none is set. `entityType` is an open string (e.g. `Person`, `Organization`) — the payee vocabulary is the entity module's, not part of this contract","required":["id","entityType","displayName"],"properties":{"id":{"type":"string","format":"uuid","description":"The payee entity's id"},"entityType":{"type":"string","description":"The payee's entity type (e.g. Person, Organization)"},"displayName":{"type":"string","description":"The payee's display name"}},"isRequired":true,"uniqueKey":"error.currentInvoice.linkedPayee.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.linkedPayee","typeLabel":"object | null"},"incurredDate":{"oneOf":[{"type":"string","format":"date","description":"The date the charges were incurred (ISO `YYYY-MM-DD`), or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.incurredDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"The date the charges were incurred (ISO `YYYY-MM-DD`), or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.incurredDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.incurredDate","typeLabel":"string\u003cdate> | null"},"dueDate":{"oneOf":[{"type":"string","format":"date","description":"When payment is owed (display metadata only), or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.dueDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"When payment is owed (display metadata only), or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.dueDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.dueDate","typeLabel":"string\u003cdate> | null"},"memo":{"oneOf":[{"type":"string","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.memo.oneOf.0","typeLabel":"string"},{"type":"null","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.memo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.memo","typeLabel":"string | null"},"fieldData":{"oneOf":[{"type":"object","additionalProperties":true,"description":"Values for the tenant-defined custom invoice fields, keyed by field referenceId — an opaque JSON object, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.fieldData.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":true,"description":"Values for the tenant-defined custom invoice fields, keyed by field referenceId — an opaque JSON object, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.fieldData.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.fieldData","typeLabel":"object | null"},"lineItems":{"type":"array","description":"The invoice's line items","items":{"type":"object","description":"A stored invoice line item as rendered on invoice reads.","required":["lineItemId","lineItemTypeId","memo","amountCents"],"properties":{"lineItemId":{"type":"string","format":"uuid","description":"The line item's id","isRequired":true,"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX].lineItemId","typeLabel":"string\u003cuuid>"},"lineItemTypeId":{"type":"string","format":"uuid","description":"The configured line item type this item cites — discover ids with `GET /api/v1/companies/{companyId}/financials/config/categories`","isRequired":true,"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX].lineItemTypeId","typeLabel":"string\u003cuuid>"},"memo":{"oneOf":[{"type":"string","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX].memo.oneOf.0","typeLabel":"string"},{"type":"null","description":"Free-text memo, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX].memo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX].memo","typeLabel":"string | null"},"amountCents":{"type":"integer","description":"The line item's signed amount in integer cents; a negative amount is a credit within the item's own frame — it posts opposite the line item type's expected direction (e.g. a reversal or refund); the posting rule always comes from the type, never the sign","isRequired":true,"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX].amountCents","typeLabel":"integer"}},"uniqueKey":"error.currentInvoice.lineItems.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"error.currentInvoice.lineItems","typeLabel":"object[]"},"totalAmountCents":{"type":"integer","description":"Sum of the ORIENTED line-item amounts (a payable-direction line counts +, a receivable-direction line counts −), in integer cents — the net cash the document commits to move","isRequired":true,"uniqueKey":"error.currentInvoice.totalAmountCents","typeLabel":"integer"},"amountPaidCents":{"type":"integer","description":"Sum of the ORIENTED live payment marks, in integer cents — the net cash moved so far","isRequired":true,"uniqueKey":"error.currentInvoice.amountPaidCents","typeLabel":"integer"},"balanceDueCents":{"type":"integer","description":"`totalAmountCents - amountPaidCents`, in integer cents — the net cash remaining to move: positive = out, negative = in. May move non-monotonically as opposite-direction lines settle. A voided invoice keeps its amounts here and in `totalAmountCents`, although it no longer owes anything, so leave voided invoices out when adding up what is owed","isRequired":true,"uniqueKey":"error.currentInvoice.balanceDueCents","typeLabel":"integer"},"draftAmountPaidCents":{"oneOf":[{"type":"integer","description":"A DRAFT's annex-derived paid total: the oriented net-cash sum of the payment marks the draft was born carrying (the same frame as `amountPaidCents`, which counts LIVE posted marks only and reads 0 while drafting) — what a draft's underlying payment picture will read once finalized. `null` on non-draft invoices (the annex is spent at finalize). Display-only — never a posted ledger amount","isRequired":true,"uniqueKey":"error.currentInvoice.draftAmountPaidCents.oneOf.0","typeLabel":"integer"},{"type":"null","description":"A DRAFT's annex-derived paid total: the oriented net-cash sum of the payment marks the draft was born carrying (the same frame as `amountPaidCents`, which counts LIVE posted marks only and reads 0 while drafting) — what a draft's underlying payment picture will read once finalized. `null` on non-draft invoices (the annex is spent at finalize). Display-only — never a posted ledger amount","isRequired":true,"uniqueKey":"error.currentInvoice.draftAmountPaidCents.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.draftAmountPaidCents","typeLabel":"integer | null"},"paidDate":{"oneOf":[{"type":"string","format":"date","description":"Payment date of the mark that first made every line item settled; clears (`null`) whenever any line reopens","isRequired":true,"uniqueKey":"error.currentInvoice.paidDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"Payment date of the mark that first made every line item settled; clears (`null`) whenever any line reopens","isRequired":true,"uniqueKey":"error.currentInvoice.paidDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.paidDate","typeLabel":"string\u003cdate> | null"},"lastPaymentDate":{"oneOf":[{"type":"string","format":"date","description":"Date of the most recent live payment, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.lastPaymentDate.oneOf.0","typeLabel":"string\u003cdate>"},{"type":"null","format":"date","description":"Date of the most recent live payment, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.lastPaymentDate.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.lastPaymentDate","typeLabel":"string\u003cdate> | null"},"voidedAt":{"oneOf":[{"type":"string","format":"date-time","description":"When the invoice was voided, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.voidedAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the invoice was voided, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.voidedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.voidedAt","typeLabel":"string\u003cdate-time> | null"},"deletedAt":{"oneOf":[{"type":"string","format":"date-time","description":"When the invoice was deleted, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.deletedAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the invoice was deleted, or `null`","isRequired":true,"uniqueKey":"error.currentInvoice.deletedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.deletedAt","typeLabel":"string\u003cdate-time> | null"},"approved":{"type":"boolean","description":"The approval projection: `true` after `invoice.approved`, cleared only by `invoice.unapproved` — an edit never resets approval (the approval-relevant facts, line items and category, are immutable once posted)","isRequired":true,"uniqueKey":"error.currentInvoice.approved","typeLabel":"boolean"},"approvedAt":{"oneOf":[{"type":"string","format":"date-time","description":"When the approval landed (`invoice.approved`), or `null` while unapproved — `approved` is exactly `approvedAt != null`","isRequired":true,"uniqueKey":"error.currentInvoice.approvedAt.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the approval landed (`invoice.approved`), or `null` while unapproved — `approved` is exactly `approvedAt != null`","isRequired":true,"uniqueKey":"error.currentInvoice.approvedAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.currentInvoice.approvedAt","typeLabel":"string\u003cdate-time> | null"},"approvalRequired":{"type":"boolean","description":"Whether approval applies to this invoice. A money-out invoice (a positive `totalAmountCents`) requires approval when its type's \"Money-out invoices require approval\" setting is on; a money-in invoice (negative total) never does, and a zero total follows its type's expected direction. The value is recorded on the invoice when it is created, so a later change to the type's setting does not alter it. When `false`, Record Payment goes through without an approval, and any approval the invoice carries (`approved`) is kept but no longer matters.","isRequired":true,"uniqueKey":"error.currentInvoice.approvalRequired","typeLabel":"boolean"},"createdAt":{"type":"string","format":"date-time","description":"When the invoice was created","isRequired":true,"uniqueKey":"error.currentInvoice.createdAt","typeLabel":"string\u003cdate-time>"},"updatedAt":{"type":"string","format":"date-time","description":"When the invoice last changed","isRequired":true,"uniqueKey":"error.currentInvoice.updatedAt","typeLabel":"string\u003cdate-time>"},"headJournalId":{"type":"string","format":"uuid","description":"The invoice's current journal head — send it as `If-Match` on the next write to this invoice; a mismatch is a `409` carrying the current row","isRequired":true,"uniqueKey":"error.currentInvoice.headJournalId","typeLabel":"string\u003cuuid>"}},"uniqueKey":"error.currentInvoice","typeLabel":"object"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"ifMatchConflict":{"title":"ifMatchConflict","value":{"error":{"code":"IF_MATCH_CONFLICT","message":"If-Match 550e8400-e29b-41d4-a716-446655440901 does not match the invoice's current head journal id","userMessages":["If-Match 550e8400-e29b-41d4-a716-446655440901 does not match the invoice's current head journal id"],"currentInvoice":{"id":"550e8400-e29b-41d4-a716-446655440700","transactionId":"INV-389538-455","invoiceNumber":"SL-2026-0412","categoryId":"550e8400-e29b-41d4-a716-446655440100","status":"partially_paid","linkedEvent":{"id":"550e8400-e29b-41d4-a716-446655440200","displayName":"Claim #1042"},"linkedPolicy":null,"linkedPayee":null,"incurredDate":"2026-06-01","dueDate":null,"memo":"Legal defense","fieldData":null,"lineItems":[{"lineItemId":"550e8400-e29b-41d4-a716-446655440300","lineItemTypeId":"550e8400-e29b-41d4-a716-446655440110","memo":null,"amountCents":10000}],"totalAmountCents":10000,"amountPaidCents":4000,"balanceDueCents":6000,"draftAmountPaidCents":null,"paidDate":null,"lastPaymentDate":"2026-06-10","approved":true,"approvedAt":"2026-06-10T09:00:00.000Z","approvalRequired":true,"voidedAt":null,"deletedAt":null,"createdAt":"2026-06-01T10:30:00.000Z","updatedAt":"2026-06-10T09:00:00.000Z","headJournalId":"550e8400-e29b-41d4-a716-446655440900"}}}},"actionIdReused":{"title":"actionIdReused","value":{"error":{"code":"ACTION_ID_REUSED","message":"actionId 550e8400-e29b-41d4-a716-446655440000 was already used by a different action; supply a fresh uuid (or retry with the identical action to replay it)","userMessages":["actionId 550e8400-e29b-41d4-a716-446655440000 was already used by a different action; supply a fresh uuid (or retry with the identical action to replay it)"]}}}},"exampleType":"examples"}},"exampleType":"examples"},"6494b1d1-a8dc-4a1a-914c-352bc86fb203":{"description":"Unprocessable — a write precondition failed. Fails closed: no journal record, no ledger change, no read-state change. `error.code` is one of the stable financials error codes; each operation's description names its signature codes.","content":{"application/json":{"schema":{"type":"object","description":"A failed write precondition (`422`): the request was well-formed but the books reject it. Preconditions fail closed — a rejected write leaves no journal record, no ledger change, and no read-state change. `error.code` is one of the STABLE financials error codes (single source: `FINANCIALS_V2_PRECONDITION_CODES` in the engine's error module, re-exported to this surface as `FINANCIALS_V2_API_ERROR_CODES`) — messages may be reworded, the codes will not.","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["LIVE_PAYMENTS","AMOUNT_EXCEEDS_BALANCE_DUE","INVALID_AMOUNT","LINE_ITEMS_IMMUTABLE","INVOICE_DELETED","INVOICE_VOIDED","INVOICE_DRAFT","INVOICE_NOT_DRAFT","PAYMENT_NOT_FOUND","ERODE_RESERVES_MISMATCH","ERODE_REQUIRES_EVENT","DEPRECATED_CONFIG","NOT_RESERVED_CATEGORY","FUTURE_DATE","UNKNOWN_ID","LINK_TARGET_MISSING","UNAPPROVE_PAID","NOT_APPROVED","POLICY_INVOICE_BATCH_ONLY"],"description":"The stable precondition code — one per guard. `LIVE_PAYMENTS` (the action — re-link, payee change, or void — needs the invoice's live payments removed first); `AMOUNT_EXCEEDS_BALANCE_DUE` (a payment mark's magnitude overshoots its line item's remaining — per line, never a document scalar); `INVALID_AMOUNT` (a zero mark, or a mark whose sign opposes its line item's open remaining — a `payBalanceDue` against a document with nothing open included); `LINE_ITEMS_IMMUTABLE` (a posted invoice's line items — ids, types, amounts — and its category are fixed from the posting moment: any post-posting change is rejected, at any payment count; corrections are void-and-recreate, payments removed first; drafts edit freely until finalize); `INVOICE_DELETED` / `INVOICE_VOIDED` (lifecycle closures); `INVOICE_DRAFT` (drafts are unposted — money may not touch one: recording a payment on or voiding a draft is rejected; finalize it first); `INVOICE_NOT_DRAFT` (finalize targets exactly a draft); `PAYMENT_NOT_FOUND` (no live payment mark with that id on that invoice); `ERODE_RESERVES_MISMATCH` / `ERODE_REQUIRES_EVENT` (the erode flag missing on a reserved category or present on operating; eroding needs a linked event — there is no headroom bound: the remaining reserve is a signed balance and may cross zero); `DEPRECATED_CONFIG` / `NOT_RESERVED_CATEGORY` / `UNKNOWN_ID` (cited configuration guards); `FUTURE_DATE`; `LINK_TARGET_MISSING` (the named link target does not exist); `UNAPPROVE_PAID` (an approval cannot be revoked once payments have been recorded — remove them first); `NOT_APPROVED` (money cannot post against an unapproved invoice that requires approval (`approvalRequired: true`) AND the calling key does not hold `invoice.approve`, so it cannot approve it either — a key that holds the permission auto-approves instead of failing here); `POLICY_INVOICE_BATCH_ONLY` (the write touches a POLICY-LINKED invoice's document — creating one with `links.policy`; updating fields other than its Invoice Number, finalizing, voiding, restoring, deleting, or re-linking one that is already policy-linked; or re-linking any invoice onto a policy. A policy's invoices are checked as one set so that every price component of the policy's pricing contract stays netted to its own line item, so they change only through the policy invoice batch, `POST /api/v1/companies/{companyId}/financials/policies/{policyId}/invoices/batch`, or a policy transaction or bind that carries an invoice plan. The message names the batch path with the request's company and the policy's ids. A batch voids and creates only the invoices it names; the policy's other invoices stay as they are. Recording and removing payments, approving and unapproving, and changing the payee while the invoice has no payments still work on a policy invoice). `DRAFT_ANNEX_CONFLICT` (also returned, not yet in this enum): an edit or re-link of a draft that would leave one of its parsed payment marks unable to post at finalize","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable description of the failed precondition","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"uniqueKey":"error.userMessages","typeLabel":"string[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"livePayments":{"title":"livePayments","value":{"error":{"code":"LIVE_PAYMENTS","message":"The invoice has live payments; remove them before this action","userMessages":["The invoice has live payments; remove them before this action"]}}},"unknownId":{"title":"unknownId","value":{"error":{"code":"UNKNOWN_ID","message":"lineItemTypeId does not belong to the cited category","userMessages":["lineItemTypeId does not belong to the cited category"]}}},"policyInvoiceBatchOnly":{"title":"policyInvoiceBatchOnly","value":{"error":{"code":"POLICY_INVOICE_BATCH_ONLY","message":"'invoice.voided' is not allowed because the invoice is linked to policy 550e8400-e29b-41d4-a716-446655440000. A policy's invoices change only through its invoice batch, which checks that every price component stays netted to its line item before anything is written. Send POST /api/v1/companies/8a1f3c2e-5b7d-4e9a-9c0d-2f6b1e4a7c35/financials/policies/550e8400-e29b-41d4-a716-446655440000/invoices/batch with voidInvoices naming each invoice to void, with its headJournalId from GET /api/v1/companies/8a1f3c2e-5b7d-4e9a-9c0d-2f6b1e4a7c35/financials/invoices?linkedPolicy=550e8400-e29b-41d4-a716-446655440000, and creates adding any new ones; invoices the batch does not name stay as they are.","userMessages":["'invoice.voided' is not allowed because the invoice is linked to policy 550e8400-e29b-41d4-a716-446655440000. A policy's invoices change only through its invoice batch, which checks that every price component stays netted to its line item before anything is written. Send POST /api/v1/companies/8a1f3c2e-5b7d-4e9a-9c0d-2f6b1e4a7c35/financials/policies/550e8400-e29b-41d4-a716-446655440000/invoices/batch with voidInvoices naming each invoice to void, with its headJournalId from GET /api/v1/companies/8a1f3c2e-5b7d-4e9a-9c0d-2f6b1e4a7c35/financials/invoices?linkedPolicy=550e8400-e29b-41d4-a716-446655440000, and creates adding any new ones; invoices the batch does not name stay as they are."]}}}},"exampleType":"examples"}},"exampleType":"examples"},"7cce17b2-e31d-49f0-83a2-5ff7b6fe52c3":{"description":"Internal Server Error - Unexpected error occurred","content":{"application/json":{"schema":{"type":"object","description":"Standard error response for all external API endpoints","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code","example":"VALIDATION_ERROR","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable error message","example":"submissionId: Required field is missing","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"userMessages":{"type":"array","description":"Clean, verbatim-displayable messages — one entry per failure, free of error-code tags, field paths, and internal noise. Suitable for showing to end users as-is.","items":{"type":"string","uniqueKey":"error.userMessages.items.[INDEX]","typeLabel":"string"},"example":["Exposures of type 'company' require an address"],"uniqueKey":"error.userMessages","typeLabel":"string[]"},"details":{"type":"array","description":"Additional details for validation errors (field-level errors)","items":{"type":"object","properties":{"field":{"type":"string","description":"The field that caused the error","example":"submissionId","uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","description":"Stable problem code for this individual validation failure","example":"BLANK_LIST_ELEMENT","uniqueKey":"error.details.items.[INDEX].code","typeLabel":"string"},"reason":{"type":"string","description":"Stable reason the value violates its canonical contract","example":"blank-list-element","uniqueKey":"error.details.items.[INDEX].reason","typeLabel":"string"},"expected":{"type":"string","description":"The expected canonical value contract","example":"nonblank trimmed string","uniqueKey":"error.details.items.[INDEX].expected","typeLabel":"string"},"message":{"type":"string","description":"Description of the field error","example":"Required field is missing","uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"internalError":{"title":"internalError","value":{"error":{"code":"UncaughtActionError","message":"Uncaught error occurred in \u003cactionName>","userMessages":["An unexpected error occurred. Please try again later."]}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"35370c79-340a-4ed7-a68a-8c786f4a2235":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key authentication. Send your raw API key as the `Authorization` header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key` header; those are not accepted.","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"b4993f5b-e21e-4dbd-8ace-9c59b5197d8e":{"url":"https://go.aiinsurance.io","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"Authorization","description":"API key authentication. Send your raw API key as the `Authorization` header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key` header; those are not accepted.","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"Authorization","type":"string","description":"API key authentication. Send your raw API key as the `Authorization` header value with NO scheme prefix — `Authorization: YOUR-API-KEY`. Do NOT prefix it with `Bearer ` or `ApiKey `, and do not use an `X-API-Key` header; those are not accepted.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"Authorization"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"openapi/generated-external-api.yaml"},"subdomain":"ai-insurance-fmv1","siteName":"AI Insurance","title":"Record Payment - AI Insurance","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T17:32:14.188Z","originalFileLocation":"api-reference/financials/record-payment.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Records money paid on a bill or collected on an invoice, such as a check or wire, and marks the invoice paid or partially paid. Send payBalanceDue: true to pay it in full or allocations to pay named line items; on a claim bill in a reserved category, erodeReserves decides whether the payment reduces the claim\u0026#x27;s reserve. An invoice that requires approval (approvalRequired: true) must be approved first with Approve Invoice (approveFinancialsInvoice) unless your key holds invoice.approve, in which case this call approves it; one that does not takes the payment without an approval. Remove Payment (removeFinancialsInvoicePayment) undoes a payment. Records a payment against the invoice — a gesture the server resolves into per-line settlement MARKS, executing one invoice.payment_recorded action per mark in one transaction and returning the CREATED MARK ROWS (paymentIds + createdPayments), each mark the handle for removing it. Two modes, exactly one per request. Send either payBalanceDue: true or an allocations array — both together, or neither, is a 400. - payBalanceDue: true settles the whole document: one mark per OPEN line item at that line\u0026#x27;s full remaining, in the document\u0026#x27;s line-item order, BOTH directions at once. The invoice comes back paid with balanceDueCents: 0, and the gesture\u0026#x27;s net cash equals the balanceDueCents you asked to pay, by construction. Only the literal true is accepted (payBalanceDue: false is a 400) — to pay less, name the lines. - allocations marks exactly the line items you name, for exactly the cents you name. Nothing is spread, split, or inferred: a line you do not name is untouched, and a line you name for less than its remaining stays open. Allocation amounts are in the LINE\u0026#x27;s frame. allocations[].amountCents settles its own line\u0026#x27;s remaining toward zero, so it carries the sign of that remaining — this is NOT the oriented net-cash frame balanceDueCents reads in. A payable-direction line with 8,000 remaining takes a mark of +8000; a receivable-direction line with 3,000 remaining takes a mark of +3000 too (money in, but the line\u0026#x27;s own remaining is positive). Each amount must be a nonzero integer, and a lineItemId may appear at most once per request (both 400s). Per-mark guards (422). Every mark must name a line item on the document (422 UNKNOWN_ID), be nonzero and carry its line\u0026#x27;s remaining\u0026#x27;s sign — a mark against a settled line, or one running opposite its line\u0026#x27;s remaining, is 422 INVALID_AMOUNT, as is a payBalanceDue against a document with nothing open — and its magnitude may not exceed its line\u0026#x27;s remaining\u0026#x27;s (422 AMOUNT_EXCEEDS_BALANCE_DUE). The bounds are per line; there is no document-scalar bound. The payment date must not be in the future (422 FUTURE_DATE). Reserve erosion. On an invoice in a reserved category, erodeReserves is REQUIRED (true = the marks consume the linked event\u0026#x27;s reserves; eroding requires an event link — 422 ERODE_REQUIRES_EVENT). On an operating-category invoice the field must be omitted (422 ERODE_RESERVES_MISMATCH either way it is misused). There is no headroom bound: the marks\u0026#x27; oriented reserve effect applies to the remaining reserve unbounded — the remaining reserve is a SIGNED balance, and eroding past the estimate takes it below zero (the books\u0026#x27; statement that payments have outrun an estimate that still stands), never a 422. Approval gate (422 NOT_APPROVED). On an invoice that does not require approval (approvalRequired: false, for example money coming in), the payment posts for any key that may record payments, and nothing approves the invoice. On one that does, this endpoint posts money only against an APPROVED invoice (approved: true on the invoice row). On an UNAPPROVED invoice that requires approval, the outcome depends on the calling key\u0026#x27;s permissions, mirroring the in-app behaviour where a sufficiently authorized user\u0026#x27;s payment auto-approves: - the key holds invoice.approve → the invoice is APPROVED automatically as part of this request, in the same transaction and before the payment marks, and the payment posts. The response\u0026#x27;s invoice row comes back approved: true; the auto-approval is deliberately NOT listed in journalIds (that array is the payment gesture\u0026#x27;s marks, so an idempotent replay returns an identical body). - the key does NOT hold it → 422 NOT_APPROVED. Approve the invoice first — via approve with a key that holds the permission, or in the app. A draft is rejected as 422 INVOICE_DRAFT regardless of approval: no money may post against an unposted document. Concurrency + idempotency. Requires If-Match (the invoice\u0026#x27;s current headJournalId) and a client-minted actionId. The actionId anchors the FIRST mark\u0026#x27;s journal action; sibling marks take server-minted ids in the same transaction. An identical retry replays the original outcome — the full paymentIds set included. Reusing an actionId with different allocations is 409 ACTION_ID_REUSED. Required permission: payment.record\">\u003cmeta data-mint-head name=\"application-name\" content=\"AI Insurance\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Record Payment - AI Insurance\">\u003cmeta data-mint-head property=\"og:description\" content=\"Records money paid on a bill or collected on an invoice, such as a check or wire, and marks the invoice paid or partially paid. Send payBalanceDue: true to pay it in full or allocations to pay named line items; on a claim bill in a reserved category, erodeReserves decides whether the payment reduces the claim\u0026#x27;s reserve. An invoice that requires approval (approvalRequired: true) must be approved first with Approve Invoice (approveFinancialsInvoice) unless your key holds invoice.approve, in which case this call approves it; one that does not takes the payment without an approval. Remove Payment (removeFinancialsInvoicePayment) undoes a payment. Records a payment against the invoice — a gesture the server resolves into per-line settlement MARKS, executing one invoice.payment_recorded action per mark in one transaction and returning the CREATED MARK ROWS (paymentIds + createdPayments), each mark the handle for removing it. Two modes, exactly one per request. Send either payBalanceDue: true or an allocations array — both together, or neither, is a 400. - payBalanceDue: true settles the whole document: one mark per OPEN line item at that line\u0026#x27;s full remaining, in the document\u0026#x27;s line-item order, BOTH directions at once. The invoice comes back paid with balanceDueCents: 0, and the gesture\u0026#x27;s net cash equals the balanceDueCents you asked to pay, by construction. Only the literal true is accepted (payBalanceDue: false is a 400) — to pay less, name the lines. - allocations marks exactly the line items you name, for exactly the cents you name. Nothing is spread, split, or inferred: a line you do not name is untouched, and a line you name for less than its remaining stays open. Allocation amounts are in the LINE\u0026#x27;s frame. allocations[].amountCents settles its own line\u0026#x27;s remaining toward zero, so it carries the sign of that remaining — this is NOT the oriented net-cash frame balanceDueCents reads in. A payable-direction line with 8,000 remaining takes a mark of +8000; a receivable-direction line with 3,000 remaining takes a mark of +3000 too (money in, but the line\u0026#x27;s own remaining is positive). Each amount must be a nonzero integer, and a lineItemId may appear at most once per request (both 400s). Per-mark guards (422). Every mark must name a line item on the document (422 UNKNOWN_ID), be nonzero and carry its line\u0026#x27;s remaining\u0026#x27;s sign — a mark against a settled line, or one running opposite its line\u0026#x27;s remaining, is 422 INVALID_AMOUNT, as is a payBalanceDue against a document with nothing open — and its magnitude may not exceed its line\u0026#x27;s remaining\u0026#x27;s (422 AMOUNT_EXCEEDS_BALANCE_DUE). The bounds are per line; there is no document-scalar bound. The payment date must not be in the future (422 FUTURE_DATE). Reserve erosion. On an invoice in a reserved category, erodeReserves is REQUIRED (true = the marks consume the linked event\u0026#x27;s reserves; eroding requires an event link — 422 ERODE_REQUIRES_EVENT). On an operating-category invoice the field must be omitted (422 ERODE_RESERVES_MISMATCH either way it is misused). There is no headroom bound: the marks\u0026#x27; oriented reserve effect applies to the remaining reserve unbounded — the remaining reserve is a SIGNED balance, and eroding past the estimate takes it below zero (the books\u0026#x27; statement that payments have outrun an estimate that still stands), never a 422. Approval gate (422 NOT_APPROVED). On an invoice that does not require approval (approvalRequired: false, for example money coming in), the payment posts for any key that may record payments, and nothing approves the invoice. On one that does, this endpoint posts money only against an APPROVED invoice (approved: true on the invoice row). On an UNAPPROVED invoice that requires approval, the outcome depends on the calling key\u0026#x27;s permissions, mirroring the in-app behaviour where a sufficiently authorized user\u0026#x27;s payment auto-approves: - the key holds invoice.approve → the invoice is APPROVED automatically as part of this request, in the same transaction and before the payment marks, and the payment posts. The response\u0026#x27;s invoice row comes back approved: true; the auto-approval is deliberately NOT listed in journalIds (that array is the payment gesture\u0026#x27;s marks, so an idempotent replay returns an identical body). - the key does NOT hold it → 422 NOT_APPROVED. Approve the invoice first — via approve with a key that holds the permission, or in the app. A draft is rejected as 422 INVOICE_DRAFT regardless of approval: no money may post against an unposted document. Concurrency + idempotency. Requires If-Match (the invoice\u0026#x27;s current headJournalId) and a client-minted actionId. The actionId anchors the FIRST mark\u0026#x27;s journal action; sibling marks take server-minted ids in the same transaction. An identical retry replays the original outcome — the full paymentIds set included. Reusing an actionId with different allocations is 409 ACTION_ID_REUSED. Required permission: payment.record\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AI Insurance\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ai-insurance-fmv1.mintlify.site/_mintlify/api/og/v2?division=Payments\u0026amp;title=Record+Payment\u0026amp;description=Records+money+paid+on+a+bill+or+collected+on+an+invoice%2C+such+as+a+check%0Aor+wire%2C+and+marks+the+invoice+paid+or+partially+paid.+Send%0A%60payBalanceDue%3A+true%60+to+pa\u0026amp;theme=0995c531691aeb9df7f9b066\u0026amp;signature=8189835b6174186d9eadf0ca5dfb6bdb57dee07ff6b5088da0fe81d677abe6dc\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Record Payment - AI Insurance\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Records money paid on a bill or collected on an invoice, such as a check or wire, and marks the invoice paid or partially paid. Send payBalanceDue: true to pay it in full or allocations to pay named line items; on a claim bill in a reserved category, erodeReserves decides whether the payment reduces the claim\u0026#x27;s reserve. An invoice that requires approval (approvalRequired: true) must be approved first with Approve Invoice (approveFinancialsInvoice) unless your key holds invoice.approve, in which case this call approves it; one that does not takes the payment without an approval. Remove Payment (removeFinancialsInvoicePayment) undoes a payment. Records a payment against the invoice — a gesture the server resolves into per-line settlement MARKS, executing one invoice.payment_recorded action per mark in one transaction and returning the CREATED MARK ROWS (paymentIds + createdPayments), each mark the handle for removing it. Two modes, exactly one per request. Send either payBalanceDue: true or an allocations array — both together, or neither, is a 400. - payBalanceDue: true settles the whole document: one mark per OPEN line item at that line\u0026#x27;s full remaining, in the document\u0026#x27;s line-item order, BOTH directions at once. The invoice comes back paid with balanceDueCents: 0, and the gesture\u0026#x27;s net cash equals the balanceDueCents you asked to pay, by construction. Only the literal true is accepted (payBalanceDue: false is a 400) — to pay less, name the lines. - allocations marks exactly the line items you name, for exactly the cents you name. Nothing is spread, split, or inferred: a line you do not name is untouched, and a line you name for less than its remaining stays open. Allocation amounts are in the LINE\u0026#x27;s frame. allocations[].amountCents settles its own line\u0026#x27;s remaining toward zero, so it carries the sign of that remaining — this is NOT the oriented net-cash frame balanceDueCents reads in. A payable-direction line with 8,000 remaining takes a mark of +8000; a receivable-direction line with 3,000 remaining takes a mark of +3000 too (money in, but the line\u0026#x27;s own remaining is positive). Each amount must be a nonzero integer, and a lineItemId may appear at most once per request (both 400s). Per-mark guards (422). Every mark must name a line item on the document (422 UNKNOWN_ID), be nonzero and carry its line\u0026#x27;s remaining\u0026#x27;s sign — a mark against a settled line, or one running opposite its line\u0026#x27;s remaining, is 422 INVALID_AMOUNT, as is a payBalanceDue against a document with nothing open — and its magnitude may not exceed its line\u0026#x27;s remaining\u0026#x27;s (422 AMOUNT_EXCEEDS_BALANCE_DUE). The bounds are per line; there is no document-scalar bound. The payment date must not be in the future (422 FUTURE_DATE). Reserve erosion. On an invoice in a reserved category, erodeReserves is REQUIRED (true = the marks consume the linked event\u0026#x27;s reserves; eroding requires an event link — 422 ERODE_REQUIRES_EVENT). On an operating-category invoice the field must be omitted (422 ERODE_RESERVES_MISMATCH either way it is misused). There is no headroom bound: the marks\u0026#x27; oriented reserve effect applies to the remaining reserve unbounded — the remaining reserve is a SIGNED balance, and eroding past the estimate takes it below zero (the books\u0026#x27; statement that payments have outrun an estimate that still stands), never a 422. Approval gate (422 NOT_APPROVED). On an invoice that does not require approval (approvalRequired: false, for example money coming in), the payment posts for any key that may record payments, and nothing approves the invoice. On one that does, this endpoint posts money only against an APPROVED invoice (approved: true on the invoice row). On an UNAPPROVED invoice that requires approval, the outcome depends on the calling key\u0026#x27;s permissions, mirroring the in-app behaviour where a sufficiently authorized user\u0026#x27;s payment auto-approves: - the key holds invoice.approve → the invoice is APPROVED automatically as part of this request, in the same transaction and before the payment marks, and the payment posts. The response\u0026#x27;s invoice row comes back approved: true; the auto-approval is deliberately NOT listed in journalIds (that array is the payment gesture\u0026#x27;s marks, so an idempotent replay returns an identical body). - the key does NOT hold it → 422 NOT_APPROVED. Approve the invoice first — via approve with a key that holds the permission, or in the app. A draft is rejected as 422 INVOICE_DRAFT regardless of approval: no money may post against an unposted document. Concurrency + idempotency. Requires If-Match (the invoice\u0026#x27;s current headJournalId) and a client-minted actionId. The actionId anchors the FIRST mark\u0026#x27;s journal action; sibling marks take server-minted ids in the same transaction. An identical retry replays the original outcome — the full paymentIds set included. Reusing an actionId with different allocations is 409 ACTION_ID_REUSED. Required permission: payment.record\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ai-insurance-fmv1.mintlify.site/_mintlify/api/og/v2?division=Payments\u0026amp;title=Record+Payment\u0026amp;description=Records+money+paid+on+a+bill+or+collected+on+an+invoice%2C+such+as+a+check%0Aor+wire%2C+and+marks+the+invoice+paid+or+partially+paid.+Send%0A%60payBalanceDue%3A+true%60+to+pa\u0026amp;theme=0995c531691aeb9df7f9b066\u0026amp;signature=8189835b6174186d9eadf0ca5dfb6bdb57dee07ff6b5088da0fe81d677abe6dc\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/ai-insurance-fmv1/OV-zcpS7BkiQB75q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AI Insurance\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#714CC5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/financials/record-payment.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.go.aiinsurance.io/#organization\",\"name\":\"AI Insurance\",\"url\":\"https://docs.go.aiinsurance.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ai-insurance-fmv1/HtPQvD-FDA5nbM7L/logo/dark.jpg?fit=max\u0026auto=format\u0026n=HtPQvD-FDA5nbM7L\u0026q=85\u0026s=14ace86d6e87c6eab47960c514760266\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.go.aiinsurance.io#website\",\"name\":\"AI Insurance\",\"url\":\"https://docs.go.aiinsurance.io\",\"publisher\":{\"@id\":\"https://docs.go.aiinsurance.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment#webpage\",\"url\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment\",\"name\":\"Record Payment\",\"description\":\"Records money paid on a bill or collected on an invoice, such as a check or wire, and marks the invoice paid or partially paid. Send payBalanceDue: true to pay it in full or allocations to pay named line items; on a claim bill in a reserved category, erodeReserves decides whether the payment reduces the claim's reserve. An invoice that requires approval (approvalRequired: true) must be approved first with Approve Invoice (approveFinancialsInvoice) unless your key holds invoice.approve, in which case this call approves it; one that does not takes the payment without an approval. Remove Payment (removeFinancialsInvoicePayment) undoes a payment. Records a payment against the invoice — a gesture the server resolves into per-line settlement MARKS, executing one invoice.payment_recorded action per mark in one transaction and returning the CREATED MARK ROWS (paymentIds + createdPayments), each mark the handle for removing it. Two modes, exactly one per request. Send either payBalanceDue: true or an allocations array — both together, or neither, is a 400. - payBalanceDue: true settles the whole document: one mark per OPEN line item at that line's full remaining, in the document's line-item order, BOTH directions at once. The invoice comes back paid with balanceDueCents: 0, and the gesture's net cash equals the balanceDueCents you asked to pay, by construction. Only the literal true is accepted (payBalanceDue: false is a 400) — to pay less, name the lines. - allocations marks exactly the line items you name, for exactly the cents you name. Nothing is spread, split, or inferred: a line you do not name is untouched, and a line you name for less than its remaining stays open. Allocation amounts are in the LINE's frame. allocations[].amountCents settles its own line's remaining toward zero, so it carries the sign of that remaining — this is NOT the oriented net-cash frame balanceDueCents reads in. A payable-direction line with 8,000 remaining takes a mark of +8000; a receivable-direction line with 3,000 remaining takes a mark of +3000 too (money in, but the line's own remaining is positive). Each amount must be a nonzero integer, and a lineItemId may appear at most once per request (both 400s). Per-mark guards (422). Every mark must name a line item on the document (422 UNKNOWN_ID), be nonzero and carry its line's remaining's sign — a mark against a settled line, or one running opposite its line's remaining, is 422 INVALID_AMOUNT, as is a payBalanceDue against a document with nothing open — and its magnitude may not exceed its line's remaining's (422 AMOUNT_EXCEEDS_BALANCE_DUE). The bounds are per line; there is no document-scalar bound. The payment date must not be in the future (422 FUTURE_DATE). Reserve erosion. On an invoice in a reserved category, erodeReserves is REQUIRED (true = the marks consume the linked event's reserves; eroding requires an event link — 422 ERODE_REQUIRES_EVENT). On an operating-category invoice the field must be omitted (422 ERODE_RESERVES_MISMATCH either way it is misused). There is no headroom bound: the marks' oriented reserve effect applies to the remaining reserve unbounded — the remaining reserve is a SIGNED balance, and eroding past the estimate takes it below zero (the books' statement that payments have outrun an estimate that still stands), never a 422. Approval gate (422 NOT_APPROVED). On an invoice that does not require approval (approvalRequired: false, for example money coming in), the payment posts for any key that may record payments, and nothing approves the invoice. On one that does, this endpoint posts money only against an APPROVED invoice (approved: true on the invoice row). On an UNAPPROVED invoice that requires approval, the outcome depends on the calling key's permissions, mirroring the in-app behaviour where a sufficiently authorized user's payment auto-approves: - the key holds invoice.approve → the invoice is APPROVED automatically as part of this request, in the same transaction and before the payment marks, and the payment posts. The response's invoice row comes back approved: true; the auto-approval is deliberately NOT listed in journalIds (that array is the payment gesture's marks, so an idempotent replay returns an identical body). - the key does NOT hold it → 422 NOT_APPROVED. Approve the invoice first — via approve with a key that holds the permission, or in the app. A draft is rejected as 422 INVOICE_DRAFT regardless of approval: no money may post against an unposted document. Concurrency + idempotency. Requires If-Match (the invoice's current headJournalId) and a client-minted actionId. The actionId anchors the FIRST mark's journal action; sibling marks take server-minted ids in the same transaction. An identical retry replays the original outcome — the full paymentIds set included. Reusing an actionId with different allocations is 409 ACTION_ID_REUSED. Required permission: payment.record\",\"dateModified\":\"2026-11-13T17:32:14.188Z\",\"isPartOf\":{\"@id\":\"https://docs.go.aiinsurance.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Financials\",\"item\":\"https://docs.go.aiinsurance.io/api-reference/financials/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Record Payment\",\"item\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment#apireference\",\"headline\":\"Record Payment\",\"name\":\"Record Payment\",\"description\":\"Records money paid on a bill or collected on an invoice, such as a check or wire, and marks the invoice paid or partially paid. Send payBalanceDue: true to pay it in full or allocations to pay named line items; on a claim bill in a reserved category, erodeReserves decides whether the payment reduces the claim's reserve. An invoice that requires approval (approvalRequired: true) must be approved first with Approve Invoice (approveFinancialsInvoice) unless your key holds invoice.approve, in which case this call approves it; one that does not takes the payment without an approval. Remove Payment (removeFinancialsInvoicePayment) undoes a payment. Records a payment against the invoice — a gesture the server resolves into per-line settlement MARKS, executing one invoice.payment_recorded action per mark in one transaction and returning the CREATED MARK ROWS (paymentIds + createdPayments), each mark the handle for removing it. Two modes, exactly one per request. Send either payBalanceDue: true or an allocations array — both together, or neither, is a 400. - payBalanceDue: true settles the whole document: one mark per OPEN line item at that line's full remaining, in the document's line-item order, BOTH directions at once. The invoice comes back paid with balanceDueCents: 0, and the gesture's net cash equals the balanceDueCents you asked to pay, by construction. Only the literal true is accepted (payBalanceDue: false is a 400) — to pay less, name the lines. - allocations marks exactly the line items you name, for exactly the cents you name. Nothing is spread, split, or inferred: a line you do not name is untouched, and a line you name for less than its remaining stays open. Allocation amounts are in the LINE's frame. allocations[].amountCents settles its own line's remaining toward zero, so it carries the sign of that remaining — this is NOT the oriented net-cash frame balanceDueCents reads in. A payable-direction line with 8,000 remaining takes a mark of +8000; a receivable-direction line with 3,000 remaining takes a mark of +3000 too (money in, but the line's own remaining is positive). Each amount must be a nonzero integer, and a lineItemId may appear at most once per request (both 400s). Per-mark guards (422). Every mark must name a line item on the document (422 UNKNOWN_ID), be nonzero and carry its line's remaining's sign — a mark against a settled line, or one running opposite its line's remaining, is 422 INVALID_AMOUNT, as is a payBalanceDue against a document with nothing open — and its magnitude may not exceed its line's remaining's (422 AMOUNT_EXCEEDS_BALANCE_DUE). The bounds are per line; there is no document-scalar bound. The payment date must not be in the future (422 FUTURE_DATE). Reserve erosion. On an invoice in a reserved category, erodeReserves is REQUIRED (true = the marks consume the linked event's reserves; eroding requires an event link — 422 ERODE_REQUIRES_EVENT). On an operating-category invoice the field must be omitted (422 ERODE_RESERVES_MISMATCH either way it is misused). There is no headroom bound: the marks' oriented reserve effect applies to the remaining reserve unbounded — the remaining reserve is a SIGNED balance, and eroding past the estimate takes it below zero (the books' statement that payments have outrun an estimate that still stands), never a 422. Approval gate (422 NOT_APPROVED). On an invoice that does not require approval (approvalRequired: false, for example money coming in), the payment posts for any key that may record payments, and nothing approves the invoice. On one that does, this endpoint posts money only against an APPROVED invoice (approved: true on the invoice row). On an UNAPPROVED invoice that requires approval, the outcome depends on the calling key's permissions, mirroring the in-app behaviour where a sufficiently authorized user's payment auto-approves: - the key holds invoice.approve → the invoice is APPROVED automatically as part of this request, in the same transaction and before the payment marks, and the payment posts. The response's invoice row comes back approved: true; the auto-approval is deliberately NOT listed in journalIds (that array is the payment gesture's marks, so an idempotent replay returns an identical body). - the key does NOT hold it → 422 NOT_APPROVED. Approve the invoice first — via approve with a key that holds the permission, or in the app. A draft is rejected as 422 INVOICE_DRAFT regardless of approval: no money may post against an unposted document. Concurrency + idempotency. Requires If-Match (the invoice's current headJournalId) and a client-minted actionId. The actionId anchors the FIRST mark's journal action; sibling marks take server-minted ids in the same transaction. An identical retry replays the original outcome — the full paymentIds set included. Reusing an actionId with different allocations is 409 ACTION_ID_REUSED. Required permission: payment.record\",\"url\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment\",\"mainEntityOfPage\":{\"@id\":\"https://docs.go.aiinsurance.io/api-reference/financials/record-payment#webpage\"},\"dateModified\":\"2026-11-13T17:32:14.188Z\",\"publisher\":{\"@id\":\"https://docs.go.aiinsurance.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.go.aiinsurance.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AI Insurance\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"AI Insurance\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/financials/record-payment.md","siteName":"AI Insurance","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/homepage"}]},{"tab":"App","pages":[{"title":"App","href":"/app/getting-started/overview"}]},{"tab":"Entities","pages":[{"title":"Entities","href":"/entities/overview"}]},{"tab":"Markets","pages":[{"title":"Markets","href":"/markets/overview"}]},{"tab":"Financials","pages":[{"title":"Financials","href":"/financials/overview"}]},{"tab":"API","groups":[{"group":"Getting Started","pages":[{"title":"Overview","href":"/api-reference/overview"},{"title":"Roadmap","href":"/api-reference/roadmap"},{"title":"Generating API Keys","href":"/api-reference/authentication"},{"title":"MCP Connector (Beta)","href":"/api-reference/mcp-connector"}]},{"group":"User","pages":[{"title":"Get my profile","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/me","href":"/api-reference/user/get-my-profile"},{"title":"List my accessible companies","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/me/companies","href":"/api-reference/user/list-my-accessible-companies"}]},{"group":"Companies","pages":[{"title":"Companies","href":"/api-reference/companies/overview"},{"title":"Get Company Metadata","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}","href":"/api-reference/companies/get-company-metadata"},{"title":"List Company Members","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/members","href":"/api-reference/companies/list-company-members"},{"title":"Get Company Lifecycle","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/lifecycle","href":"/api-reference/companies/get-company-lifecycle"},{"title":"Reset Sandbox","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/reset","href":"/api-reference/companies/reset-sandbox"},{"title":"Get Company Email Branding","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/email-branding","href":"/api-reference/companies/get-company-email-branding"},{"title":"Set Company Email Branding","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/email-branding","href":"/api-reference/companies/set-company-email-branding"}]},{"group":"Entities","pages":[{"title":"Overview","href":"/api-reference/entities/overview"},{"title":"List Entity Types","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entity-types","href":"/api-reference/entities/list-entity-types"},{"title":"Get Page Layout","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/pages/{pageKey}/layout","href":"/api-reference/entities/get-page-layout"},{"title":"Get Entity Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/configuration","href":"/api-reference/entities/get-entity-configuration"},{"title":"Create Entity","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}","href":"/api-reference/entities/create-entity"},{"title":"Create Entity Batch","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/batch","href":"/api-reference/entities/create-entity-batch"},{"title":"List Entities","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}","href":"/api-reference/entities/list-entities"},{"title":"Start Entity Export Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/export-runs","href":"/api-reference/entities/start-entity-export-run"},{"title":"Get Entity Export Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/export-runs/{runId}","href":"/api-reference/entities/get-entity-export-run"},{"title":"Download Entity Export Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/export-runs/{runId}/download","href":"/api-reference/entities/download-entity-export-run"},{"title":"List Export Presets For Member","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/export-presets","href":"/api-reference/entities/list-export-presets-for-member"},{"title":"Create Export Preset For Member","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/export-presets","href":"/api-reference/entities/create-export-preset-for-member"},{"title":"Replace Export Preset For Member","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/export-presets/{presetId}","href":"/api-reference/entities/replace-export-preset-for-member"},{"title":"Delete Export Preset For Member","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/export-presets/{presetId}","href":"/api-reference/entities/delete-export-preset-for-member"},{"title":"Get Entity","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/{entityId}","href":"/api-reference/entities/get-entity"},{"title":"Update Entity","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/entities/{entityType}/{entityId}","href":"/api-reference/entities/update-entity"},{"title":"Delete Entity","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/entities/{entityType}/{entityId}","href":"/api-reference/entities/delete-entity"}]},{"group":"Submission and Quote Lifecycle","pages":[{"title":"Rate, Quote, Bind","href":"/api-reference/rate-quote-bind"},{"title":"Close Submission","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/submissions/{submissionId}/close","href":"/api-reference/submission-and-quote-lifecycle/close-submission"},{"title":"Reopen Submission","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/submissions/{submissionId}/reopen","href":"/api-reference/submission-and-quote-lifecycle/reopen-submission"},{"title":"Cancel Quote","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/{quoteId}/cancel","href":"/api-reference/submission-and-quote-lifecycle/cancel-quote"}]},{"group":"Event Lifecycle","pages":[{"title":"Overview","href":"/api-reference/event-lifecycle/overview"},{"title":"Close Event","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/events/{eventId}/close","href":"/api-reference/event-lifecycle/close-event"},{"title":"Re-open Event","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/events/{eventId}/reopen","href":"/api-reference/event-lifecycle/re-open-event"},{"title":"Replace Event Open/Close History","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/events/{eventId}/open-close-history","href":"/api-reference/event-lifecycle/replace-event-openclose-history"}]},{"group":"Record Emails","pages":[{"title":"Overview","href":"/api-reference/record-emails/overview"},{"title":"List Record Email Conversations","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-conversations","href":"/api-reference/record-emails/list-record-email-conversations"},{"title":"Get Record Email Conversation","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-conversations/{threadId}","href":"/api-reference/record-emails/get-record-email-conversation"},{"title":"Remove Record Email Conversation","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-conversations/{threadId}/remove","href":"/api-reference/record-emails/remove-record-email-conversation"},{"title":"Link Earlier Record Emails","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-people/{personId}/link-earlier","href":"/api-reference/record-emails/link-earlier-record-emails"},{"title":"Unlink Record Person Emails","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-people/{personId}/unlink","href":"/api-reference/record-emails/unlink-record-person-emails"},{"title":"List Record Email Link Events","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-link-events","href":"/api-reference/record-emails/list-record-email-link-events"},{"title":"List Record Sendable Email Templates","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/sendable-email-templates","href":"/api-reference/record-emails/list-record-sendable-email-templates"},{"title":"Preview Record Email","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/emails/preview","href":"/api-reference/record-emails/preview-record-email"},{"title":"Send Record Email","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/emails","href":"/api-reference/record-emails/send-record-email"},{"title":"Retry Record Email Delivery","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/email-deliveries/{deliveryId}/retry","href":"/api-reference/record-emails/retry-record-email-delivery"},{"title":"List Record Packet Emails","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/packet-emails","href":"/api-reference/record-emails/list-record-packet-emails"},{"title":"List Policy Email Conversations","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/email-conversations","href":"/api-reference/record-emails/list-policy-email-conversations"},{"title":"Get Policy Email Conversation","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/email-conversations/{threadId}","href":"/api-reference/record-emails/get-policy-email-conversation"},{"title":"Remove Policy Email Conversation","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/email-conversations/{threadId}/remove","href":"/api-reference/record-emails/remove-policy-email-conversation"},{"title":"Link Earlier Policy Emails","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/email-people/{personId}/link-earlier","href":"/api-reference/record-emails/link-earlier-policy-emails"},{"title":"Unlink Policy Person Emails","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/email-people/{personId}/unlink","href":"/api-reference/record-emails/unlink-policy-person-emails"},{"title":"List Policy Email Link Events","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/email-link-events","href":"/api-reference/record-emails/list-policy-email-link-events"},{"title":"List Policy Sendable Email Templates","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/sendable-email-templates","href":"/api-reference/record-emails/list-policy-sendable-email-templates"},{"title":"Preview Policy Email","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/emails/preview","href":"/api-reference/record-emails/preview-policy-email"},{"title":"Send Policy Email","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/emails","href":"/api-reference/record-emails/send-policy-email"},{"title":"Retry Policy Email Delivery","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/email-deliveries/{deliveryId}/retry","href":"/api-reference/record-emails/retry-policy-email-delivery"},{"title":"List Policy Packet Emails","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/packet-emails","href":"/api-reference/record-emails/list-policy-packet-emails"}]},{"group":"OFAC Screening","pages":[{"title":"Overview","href":"/api-reference/ofac-screening/overview"},{"title":"Screen Exposure For OFAC","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/ofac/screen","href":"/api-reference/ofac-screening/screen-exposure-for-ofac"}]},{"group":"Policy Transactions","pages":[{"title":"Overview","href":"/api-reference/policies/overview"},{"title":"Concepts","href":"/api-reference/policies/concepts"},{"title":"Effective Dates \u0026 the Policy Timeline","href":"/api-reference/policies/effective-dates"},{"title":"Lifecycle Walkthrough","href":"/api-reference/policies/lifecycle-walkthrough"},{"group":"Configuration","pages":[{"title":"Get Policy Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/configuration","href":"/api-reference/field-model-policy-configuration/get-policy-configuration"}]},{"group":"Reset","pages":[{"title":"Delete All Policies","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/deleteAll","href":"/api-reference/policies/delete-all-policies"}]},{"group":"Transactions","pages":[{"title":"New Business Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/transaction/new-business","href":"/api-reference/field-model-policy-transactions/new-business-transaction"},{"title":"Endorse Policy Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/transaction/endorse","href":"/api-reference/field-model-policy-transactions/endorse-policy-transaction"},{"title":"Cancel Policy Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/transaction/cancel","href":"/api-reference/field-model-policy-transactions/cancel-policy-transaction"},{"title":"Reinstate Policy Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/transaction/reinstate","href":"/api-reference/field-model-policy-transactions/reinstate-policy-transaction"},{"title":"Renew Policy Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/transaction/renew","href":"/api-reference/field-model-policy-transactions/renew-policy-transaction"},{"title":"Generate Quote from Policy (Stateless)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/generate","href":"/api-reference/field-model-policies/generate-quote-from-policy-stateless"},{"title":"Bind Quote","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/{quoteId}/bind","href":"/api-reference/field-model-policy-transactions/bind-quote"},{"title":"Bind Quote by Reference or by Value","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/bind","href":"/api-reference/field-model-policy-transactions/bind-quote-by-reference-or-by-value"},{"title":"Delete Policy Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}","href":"/api-reference/field-model-policy-transactions/delete-policy-transaction"},{"title":"Get Policy Version","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/versions/{version}","href":"/api-reference/field-model-policy-transactions/get-policy-version"},{"title":"List Single Policy Versions","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/versions","href":"/api-reference/field-model-policy-transactions/list-single-policy-versions"},{"title":"List Policy Transactions","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/transactions","href":"/api-reference/field-model-policy-transactions/list-policy-transactions"},{"title":"Get Policy Transaction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}","href":"/api-reference/field-model-policy-transactions/get-policy-transaction"},{"title":"Update Transaction Display Author","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}","href":"/api-reference/field-model-policy-transactions/update-transaction-display-author"}]},{"group":"Contacts","pages":[{"title":"List Policy Contacts","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/contacts","href":"/api-reference/field-model-policy-transactions/list-policy-contacts"},{"title":"Add Policy Contact","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/{policyId}/contacts","href":"/api-reference/field-model-policy-transactions/add-policy-contact"},{"title":"Remove Policy Contact","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/policies/{policyId}/contacts/{personId}","href":"/api-reference/field-model-policy-transactions/remove-policy-contact"}]},{"group":"Bordereau","pages":[{"title":"List Bordereau Rows","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/bordereau","href":"/api-reference/field-model-bordereau/list-bordereau-rows"},{"title":"Start Bordereau Export Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/bordereau/export-runs","href":"/api-reference/field-model-bordereau/start-bordereau-export-run"},{"title":"Get Bordereau Export Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/bordereau/export-runs/{runId}","href":"/api-reference/field-model-bordereau/get-bordereau-export-run"},{"title":"Download Bordereau Export Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/bordereau/export-runs/{runId}/download","href":"/api-reference/field-model-bordereau/download-bordereau-export-run"},{"title":"Send Bordereau Export Run to Google Drive","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/bordereau/export-runs/{runId}/drive","href":"/api-reference/field-model-bordereau/send-bordereau-export-run-to-google-drive"}]},{"group":"Listing Policies","pages":[{"title":"List Policies","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/list","href":"/api-reference/field-model-policy-transactions/list-policies"},{"title":"List Policy Versions","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/versions","href":"/api-reference/field-model-policy-transactions/list-policy-versions"}]},{"group":"Validation","pages":[{"title":"Check Bind Conditions","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/quotes/{quoteId}/bind-conditions","href":"/api-reference/field-model-policy-validation/check-bind-conditions"},{"title":"Validate Policy","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/{policyId}/validate","href":"/api-reference/field-model-policy-validation/validate-policy"},{"title":"Validate Policies (Batch)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/policies/validate","href":"/api-reference/field-model-policy-validation/validate-policies-batch"},{"title":"Repair Policies","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/policies/repair","href":"/api-reference/field-model-policy-transactions/repair-policies"}]}]},{"group":"Policy Invoicing","pages":[{"title":"Invoicing a policy","href":"/api-reference/invoicing/overview"},{"title":"Invoice plans","href":"/api-reference/invoicing/invoice-plans"},{"title":"Quote Invoicing Overview","sidebarTitle":"Quote Invoicing Overview","href":"/api-reference/invoicing/quote-invoicing"},{"group":"Quote Invoicing","pages":[{"title":"Get Quote Invoicing","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/quotes/{quoteId}/invoicing","href":"/api-reference/policy-invoicing/get-quote-invoicing"},{"title":"Replace Quote Invoice Settings","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/quotes/{quoteId}/invoicing/settings","href":"/api-reference/policy-invoicing/replace-quote-invoice-settings"},{"title":"Generate Quote Invoices","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/{quoteId}/invoicing/generate","href":"/api-reference/policy-invoicing/generate-quote-invoices"},{"title":"Attach Quote Invoice Plan","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/quotes/{quoteId}/invoicing/plan","href":"/api-reference/policy-invoicing/attach-quote-invoice-plan"},{"title":"Clear Quote Invoice Plan","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/quotes/{quoteId}/invoicing/plan","href":"/api-reference/policy-invoicing/clear-quote-invoice-plan"}]},{"group":"Pricing Stack","pages":[{"title":"The pricing stack","href":"/api-reference/invoicing/pricing-stack"},{"title":"Get Quote Pricing Stack Intended Layer","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/quotes/{quoteId}/pricing-stack-intended-layer","href":"/api-reference/policy-invoicing/get-quote-pricing-stack-intended-layer"},{"title":"Set Quote Pricing Stack Intended Layer","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/quotes/{quoteId}/pricing-stack-intended-layer","href":"/api-reference/policy-invoicing/set-quote-pricing-stack-intended-layer"},{"title":"Clear Quote Rating","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/quotes/{quoteId}/rating","href":"/api-reference/policy-invoicing/clear-quote-rating"}]},{"title":"Update Policy Invoices","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/policies/{policyId}/invoices/batch","href":"/api-reference/financials/update-policy-invoices"}]},{"group":"Financials","pages":[{"title":"Overview","href":"/api-reference/financials/overview"},{"group":"Invoices","pages":[{"title":"List Invoices","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/invoices","href":"/api-reference/financials/list-invoices"},{"title":"Create Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices","href":"/api-reference/financials/create-invoice"},{"title":"Get Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/invoices/{invoiceId}","href":"/api-reference/financials/get-invoice"},{"title":"Update Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/invoices/{invoiceId}","href":"/api-reference/financials/update-invoice"},{"title":"Delete Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/financials/invoices/{invoiceId}","href":"/api-reference/financials/delete-invoice"},{"title":"Re-link Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/relink","href":"/api-reference/financials/re-link-invoice"}]},{"group":"Invoice Lifecycle","pages":[{"title":"Approve Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/approve","href":"/api-reference/financials/approve-invoice"},{"title":"Unapprove Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/unapprove","href":"/api-reference/financials/unapprove-invoice"},{"title":"Finalize Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/finalize","href":"/api-reference/financials/finalize-invoice"},{"title":"Void Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/void","href":"/api-reference/financials/void-invoice"},{"title":"Restore Invoice","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/restore","href":"/api-reference/financials/restore-invoice"}]},{"group":"Bill Review","pages":[{"title":"Start Invoice Bill Review","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/bill-review","href":"/api-reference/financials/start-invoice-bill-review"},{"title":"Get Invoice Bill Review","description":"Returns the latest bill review of an invoice: its status, whether it\npassed, and each finding, such as a charge that breaks the company's\nbilling standards (for example outside-counsel guidelines). Poll it after\nStart Invoice Bill Review (`startFinancialsInvoiceBillReview`) until\n`status` is `succeeded` or `failed`.\n\nReturns the invoice's LATEST bill review — the run, its verdict, and\nevery finding it raised.\n\nA bill review checks one invoice against the company's own bill review rules\nand reports what it thinks is wrong with it. Runs are immutable records of\nwhat was judged: this endpoint always answers with the most recent one, and\n[starting a new review](/api-reference/financials/start-invoice-bill-review)\nadds a run rather than editing this one.\n\n**Poll this endpoint.** `status` is `queued` or `running` while the review is\nunder way and `succeeded` or `failed` once it is terminal. `passed` is the\nverdict and is `null` until then — and stays `null` forever on a `failed`\nrun, which is why `error` is the field to read there rather than inferring a\nverdict from an empty `findings` list.\n\n**Staleness is yours to check.** `invoiceHeadJournalId` is the invoice\nversion this run judged, pinned when the review was started. Compare it with\nthe invoice's current `headJournalId`\n([Get Invoice](/api-reference/financials/get-invoice)): if they differ, the\ndocument has been edited since it was reviewed and the findings describe an\nearlier version of it.\n\n**Dismissals.** `dismissedAt` is set on a finding an operator has cleared in\nthe app. Dismissal is a stamp, never a delete, so a dismissed finding is\nstill returned — filter on the field if your integration only wants\noutstanding ones. There is no API to dismiss.\n\n`billReview` is `null` when the invoice exists but has never been\nreviewed. An id that does not resolve for this company is a `404`.\n\n**Required permission:** `invoice.view`\n","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/bill-review","href":"/api-reference/financials/get-invoice-bill-review"}]},{"group":"Payments","pages":[{"title":"Record Payment","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/payments","href":"/api-reference/financials/record-payment"},{"title":"Remove Payment","description":"Reverses a recorded payment, for example a check that was voided, bounced,\nor entered in error, by exactly undoing what it posted, its reserve effect\nincluded. Get the `paymentId` from Get Invoice (`getFinancialsInvoice`).\nRemove an invoice's payments before you void, re-link, unapprove, or\nchange the payee of that invoice.\n\nRemoves a recorded payment — the `invoice.payment_removed` action, the\nexact negation of what the payment posted (an optional `reason` rides the\nbody). An unknown `paymentId` on a live invoice is `422\nPAYMENT_NOT_FOUND`.\n\n**The horizon rule is automatic.** Removing a reserve-eroding payment\nrecorded BEFORE the scope's reserve-history reset would resurrect eroded\nreserves the reset already absorbed — so the server composes a companion\nreserve unwind in the same transaction, and `journalIds` carries BOTH\nids. Callers never handle the horizon themselves.\n\n**Concurrency + idempotency.** Requires `If-Match` (the invoice's current\n`headJournalId`); the body carries the client-minted `actionId` — an\nidentical retry replays the original outcome, companion ids included.\n\n**Required permission:** `payment.delete`\n","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/payments/{paymentId}","href":"/api-reference/financials/remove-payment"}]},{"group":"Payees","pages":[{"title":"Change Invoice Payee","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/invoices/{invoiceId}/payee","href":"/api-reference/financials/change-invoice-payee"},{"title":"Merge Payee","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/payees/{payeeId}/merge","href":"/api-reference/financials/merge-payee"}]},{"group":"Reserves","pages":[{"title":"Set Reserves","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/events/{eventId}/reserves/{categoryId}","href":"/api-reference/financials/set-reserves"},{"title":"Reset Reserve History","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/events/{eventId}/reserves/{categoryId}/history-reset","href":"/api-reference/financials/reset-reserve-history"},{"title":"List Reserve Updates","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/events/{eventId}/reserve-updates","href":"/api-reference/financials/list-reserve-updates"},{"title":"List Company Reserve Updates","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/reserve-updates","href":"/api-reference/financials/list-company-reserve-updates"}]},{"group":"Balances","pages":[{"title":"Get Balances","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/balances","href":"/api-reference/financials/get-balances"},{"title":"Get Entity Balances","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/entities/{entityType}/{entityId}/balances","href":"/api-reference/financials/get-entity-balances"}]},{"group":"Configuration","pages":[{"title":"Export Financials Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/export","href":"/api-reference/financials/export-financials-configuration"},{"title":"Import Financials Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/import","href":"/api-reference/financials/import-financials-configuration"},{"title":"List Transaction Categories","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/config/categories","href":"/api-reference/financials/list-transaction-categories"},{"title":"Set Transaction Category Money-Out Approval","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/config/categories/{categoryId}/money-out-approval","href":"/api-reference/financials/set-transaction-category-money-out-approval"},{"title":"List Policy Invoice Types","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/config/policy-invoice-types","href":"/api-reference/financials/list-policy-invoice-types"},{"title":"Create Policy Invoice Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-invoice-types","href":"/api-reference/financials/create-policy-invoice-type"},{"title":"List Policy Line Item Types","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/config/policy-line-item-types","href":"/api-reference/financials/list-policy-line-item-types"},{"title":"Create Policy Line Item Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-line-item-types","href":"/api-reference/financials/create-policy-line-item-type"},{"title":"Rename Policy Invoice Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}","href":"/api-reference/financials/rename-policy-invoice-type"},{"title":"Delete Policy Invoice Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}","href":"/api-reference/financials/delete-policy-invoice-type"},{"title":"Deprecate Policy Invoice Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}/deprecate","href":"/api-reference/financials/deprecate-policy-invoice-type"},{"title":"Reactivate Policy Invoice Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}/reactivate","href":"/api-reference/financials/reactivate-policy-invoice-type"},{"title":"Rename Policy Line Item Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/financials/config/policy-line-item-types/{lineItemTypeId}","href":"/api-reference/financials/rename-policy-line-item-type"},{"title":"Delete Policy Line Item Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/financials/config/policy-line-item-types/{lineItemTypeId}","href":"/api-reference/financials/delete-policy-line-item-type"},{"title":"Deprecate Policy Line Item Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-line-item-types/{lineItemTypeId}/deprecate","href":"/api-reference/financials/deprecate-policy-line-item-type"},{"title":"Reactivate Policy Line Item Type","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-line-item-types/{lineItemTypeId}/reactivate","href":"/api-reference/financials/reactivate-policy-line-item-type"},{"title":"Set Policy Invoice Type Direction","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}/expected-direction","href":"/api-reference/financials/set-policy-invoice-type-direction"},{"title":"Set Policy Invoice Type Payee Defaults","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}/payee-defaults","href":"/api-reference/financials/set-policy-invoice-type-payee-defaults"},{"title":"Set Policy Invoice Type Presets","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}/presets","href":"/api-reference/financials/set-policy-invoice-type-presets"},{"title":"Set Policy Invoice Type Money-Out Approval","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/financials/config/policy-invoice-types/{categoryId}/money-out-approval","href":"/api-reference/financials/set-policy-invoice-type-money-out-approval"},{"title":"Set Policy Line Item Associations","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/config/policy-line-item-types/associations","href":"/api-reference/financials/set-policy-line-item-associations"},{"title":"Reset Approval Config","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/financials/config/approvals","href":"/api-reference/financials/reset-approval-config"}]},{"group":"Maintenance","pages":[{"title":"Import Event Financials","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/events/{eventId}/import","href":"/api-reference/financials/import-event-financials"},{"title":"Check Financials Read-State Consistency","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/financials/validation/check","href":"/api-reference/financials/check-financials-read-state-consistency"},{"title":"Rebuild Financials Read-State","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/validation/sync","href":"/api-reference/financials/rebuild-financials-read-state"},{"title":"Delete All Financial Data","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/financials/deleteAll","href":"/api-reference/financials/delete-all-financial-data"}]}]},{"group":"Rating","pages":[{"title":"Overview","href":"/api-reference/rating/overview"},{"title":"Rate Quote (Read-Only)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/rate","href":"/api-reference/field-model-rating/rate-quote-read-only"},{"title":"Rate Saved Quote by Id","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/quotes/{quoteId}/rate","href":"/api-reference/field-model-rating/rate-saved-quote-by-id"}]},{"group":"Notes","pages":[{"title":"Overview","href":"/api-reference/notes/overview"},{"title":"List Notes","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/notes","href":"/api-reference/field-model-notes/list-notes"},{"title":"Create Note","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/notes","href":"/api-reference/field-model-notes/create-note"},{"title":"Get Note","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/notes/{noteId}","href":"/api-reference/field-model-notes/get-note"},{"title":"Update Note","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/notes/{noteId}","href":"/api-reference/field-model-notes/update-note"},{"title":"Delete Note","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/notes/{noteId}","href":"/api-reference/field-model-notes/delete-note"}]},{"group":"Tasks","pages":[{"title":"Overview","href":"/api-reference/tasks/overview"},{"title":"List Tasks","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/tasks","href":"/api-reference/tasks/list-tasks"},{"title":"Get Task","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/tasks/{taskId}","href":"/api-reference/tasks/get-task"},{"title":"Create Task","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/tasks","href":"/api-reference/tasks/create-task"},{"title":"Update Task","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/tasks/{taskId}","href":"/api-reference/tasks/update-task"},{"title":"Delete Task","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/tasks/{taskId}","href":"/api-reference/tasks/delete-task"}]},{"group":"Imports","hidden":true,"pages":[{"title":"Overview","href":"/api-reference/imports/overview"},{"title":"Import Rows","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/imports/rows","href":"/api-reference/imports/import-rows"},{"title":"Queue Import Job","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/imports/jobs","href":"/api-reference/imports/queue-import-job"},{"title":"Get Import Job","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/imports/jobs/{jobId}","href":"/api-reference/imports/get-import-job"},{"title":"Import Entity","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/imports","href":"/api-reference/imports/import-entity"},{"title":"Retry Import","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/imports/retry","href":"/api-reference/imports/retry-import"},{"title":"List Import Rows","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/imports/rows","href":"/api-reference/imports/list-import-rows"},{"title":"Get Import Row","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/imports/rows/{importRowId}","href":"/api-reference/imports/get-import-row"},{"title":"List Import Attempts","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/imports/attempts","href":"/api-reference/imports/list-import-attempts"},{"title":"Get Import Attempt","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/imports/attempts/{importAttemptId}","href":"/api-reference/imports/get-import-attempt"},{"title":"Replace Record Legacy Activity","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/entities/{entityType}/{entityId}/legacy-activity","href":"/api-reference/imports/replace-record-legacy-activity"}]},{"group":"Configuration Management","pages":[{"title":"Overview","href":"/api-reference/configuration/overview"},{"title":"Conversion Rules","href":"/api-reference/configuration/conversion-rules"},{"title":"Author JEXL expressions","href":"/api-reference/configuration/jexl-authoring"},{"title":"JEXL reference","href":"/api-reference/configuration/jexl-reference"},{"group":"Inspect","pages":[{"title":"Export Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/export","href":"/api-reference/fmv1-configuration/export-configuration"},{"title":"Describe Configuration (run-down)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/describe","href":"/api-reference/fmv1-configuration/describe-configuration-run-down"},{"title":"Describe Configuration Entity (fields of one entity or custom object)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/describe/{entityOrObjectKey}","href":"/api-reference/fmv1-configuration/describe-configuration-entity-fields-of-one-entity-or-custom-object"},{"title":"Get Configuration Metadata","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/metadata","href":"/api-reference/fmv1-configuration/get-configuration-metadata"},{"title":"Get Configuration JSON Schema","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/schema","href":"/api-reference/fmv1-configuration/get-configuration-json-schema"}]},{"group":"Validate \u0026 Compare","pages":[{"title":"Validate Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/validate","href":"/api-reference/fmv1-configuration/validate-configuration"},{"title":"Compare Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/compare","href":"/api-reference/fmv1-configuration/compare-configuration"},{"title":"Start Data Validation Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/data-validation-runs","href":"/api-reference/fmv1-configuration/start-data-validation-run"},{"title":"Get Data Validation Run","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/configuration/data-validation-runs/{runId}","href":"/api-reference/fmv1-configuration/get-data-validation-run"},{"title":"List Data Validation Run Findings","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/configuration/data-validation-runs/{runId}/findings","href":"/api-reference/fmv1-configuration/list-data-validation-run-findings"}]},{"group":"Apply Changes","pages":[{"title":"Import Configuration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/import","href":"/api-reference/fmv1-configuration/import-configuration"},{"title":"Patch Configuration (typed changes)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/configuration/patch","href":"/api-reference/fmv1-configuration/patch-configuration-typed-changes"}]}]},{"group":"Company Files","pages":[{"title":"Overview","href":"/api-reference/company-files/overview"},{"title":"List File Categories","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files/categories","href":"/api-reference/company-files/list-file-categories"},{"group":"Uploads","pages":[{"title":"Create Upload Intent","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files","href":"/api-reference/company-files/create-upload-intent"},{"title":"Finalize Upload","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/{fileId}/finalize","href":"/api-reference/company-files/finalize-upload"}]},{"group":"Migrations","pages":[{"title":"Prepare File Migration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/migrations/prepare","href":"/api-reference/company-files/prepare-file-migration"},{"title":"Get File Migration State","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/migrations/state","href":"/api-reference/company-files/get-file-migration-state"},{"title":"Refresh File Migration Upload","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/migrations/refresh","href":"/api-reference/company-files/refresh-file-migration-upload"},{"title":"Finalize File Migration","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/migrations/finalize","href":"/api-reference/company-files/finalize-file-migration"},{"title":"Reconcile File Migration Metadata","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/migrations/reconcile","href":"/api-reference/company-files/reconcile-file-migration-metadata"}]},{"group":"Files","pages":[{"title":"List Files","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files","href":"/api-reference/company-files/list-files"},{"title":"Get File Metadata","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files/{fileId}","href":"/api-reference/company-files/get-file-metadata"},{"title":"Rename, Move, or Categorize File","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/files/{fileId}","href":"/api-reference/company-files/rename-move-or-categorize-file"},{"title":"Bulk Move Files","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/bulk-move","href":"/api-reference/company-files/bulk-move-files"},{"title":"Delete File","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/files/{fileId}","href":"/api-reference/company-files/delete-file"}]},{"group":"Downloads","pages":[{"title":"Get Download URL","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files/{fileId}/download-url","href":"/api-reference/company-files/get-download-url"},{"title":"Batch Download URLs","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/download-urls","href":"/api-reference/company-files/batch-download-urls"}]},{"group":"Versions","pages":[{"title":"List File Versions","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files/{fileId}/versions","href":"/api-reference/company-files/list-file-versions"},{"title":"Create Re-upload Intent","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/{fileId}/versions","href":"/api-reference/company-files/create-re-upload-intent"},{"title":"Restore File Version","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/{fileId}/versions/{versionId}/restore","href":"/api-reference/company-files/restore-file-version"}]},{"group":"Placements","pages":[{"title":"List File Placements","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files/{fileId}/placements","href":"/api-reference/company-files/list-file-placements"},{"title":"Add File Placement (Share to Another Entity)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/{fileId}/placements","href":"/api-reference/company-files/add-file-placement-share-to-another-entity"},{"title":"Update File Placement (Move / Categorize per Entity)","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/files/{fileId}/placements/{placementId}","href":"/api-reference/company-files/update-file-placement-move-categorize-per-entity"},{"title":"Remove File Placement","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/files/{fileId}/placements/{placementId}","href":"/api-reference/company-files/remove-file-placement"}]},{"group":"Folders","pages":[{"title":"Create Folder","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/folders","href":"/api-reference/company-files/create-folder"},{"title":"Get Folder Tree","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/folders","href":"/api-reference/company-files/get-folder-tree"},{"title":"List Folder Contents","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/folders/{folderId}","href":"/api-reference/company-files/list-folder-contents"},{"title":"Rename, Move or Categorize Folder","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/folders/{folderId}","href":"/api-reference/company-files/rename-move-or-categorize-folder"},{"title":"Delete Folder","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/folders/{folderId}","href":"/api-reference/company-files/delete-folder"}]}]},{"group":"Forms","pages":[{"title":"Overview","href":"/api-reference/forms/overview"},{"title":"List Forms","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms","href":"/api-reference/forms/list-forms"},{"title":"Download Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms/{number}","href":"/api-reference/forms/download-form"},{"title":"Rename Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml patch /api/v1/companies/{companyId}/forms/{number}","href":"/api-reference/forms/rename-form"},{"title":"Delete Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml delete /api/v1/companies/{companyId}/forms/{number}","href":"/api-reference/forms/delete-form"},{"group":"Templates","pages":[{"title":"Upload Form Template","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/forms/template","href":"/api-reference/forms/upload-form-template"},{"title":"Replace Form Template","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/forms/template/{number}","href":"/api-reference/forms/replace-form-template"},{"title":"Touch Form Template","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/forms/template/{number}/touch","href":"/api-reference/forms/touch-form-template"},{"title":"Audit Form Template Smart Tags","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms/template/{number}/smart-tag-audit","href":"/api-reference/forms/audit-form-template-smart-tags"}]},{"group":"Static Forms","pages":[{"title":"Upload Static Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/forms/static","href":"/api-reference/forms/upload-static-form"},{"title":"Replace Static Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml put /api/v1/companies/{companyId}/forms/static/{number}","href":"/api-reference/forms/replace-static-form"}]},{"group":"Generated Forms","pages":[{"title":"List Generated Forms","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms/generated","href":"/api-reference/forms/list-generated-forms"},{"title":"Upload Event Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/forms/generated","href":"/api-reference/forms/upload-event-form"},{"title":"Touch Generated Form","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/forms/generated/{id}/touch","href":"/api-reference/forms/touch-generated-form"},{"title":"Audit Generated Form Smart Tags","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms/generated/{id}/smart-tag-audit","href":"/api-reference/forms/audit-generated-form-smart-tags"}]},{"group":"Packets","pages":[{"title":"List Form Packets","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms/packets","href":"/api-reference/forms/list-form-packets"},{"title":"Import Historical Form Packet","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/forms/packets/import","href":"/api-reference/forms/import-historical-form-packet"},{"title":"Get Form Packet Download URL","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/forms/packets/{packetId}/download-url","href":"/api-reference/forms/get-form-packet-download-url"}]}]},{"group":"Document Generation","pages":[{"title":"Overview","href":"/api-reference/documents/overview"}]},{"group":"Submission Parsing","pages":[{"title":"Overview","href":"/api-reference/parsing/overview"},{"title":"Trigger Parse","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml post /api/v1/companies/{companyId}/files/trigger-parse","href":"/api-reference/submission-parsing/trigger-parse"},{"title":"List Parse Runs","deprecated":null,"version":null,"openapi":"/openapi/generated-external-api.yaml get /api/v1/companies/{companyId}/files/parse-runs","href":"/api-reference/submission-parsing/list-parse-runs"}]},{"group":"Reference","pages":[{"title":"Structured Field Values","href":"/api-reference/field-values/overview"},{"title":"Data Models","href":"/api-reference/data-models"},{"title":"API Changelog","href":"/api-reference/changelog"}]}]}]},"basePath":"","title":"Record Payment - AI Insurance","buildId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","deploymentId":"dpl_5joLUXmnJgwqjrHAS4dxZrQTdxgh","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DPDWPCdE.js","utils-DyjUHyLo.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BWYE1cdS.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-COAzxpEw.js","snippetPresets-DNiD_S52.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-CjwVt80x.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ByHQMk7z.js","shallow-CaZuw1AO.js","getApiPlaygroundDisplay-DPVPOknm.js","CodeSnippet-B31CH-Mp.js","CodeSnippets-BxTYZWz6.js","Page-DDHbuAIY.js","getPastedJson-DhoAwiNO.js","icon-Dhq8z75J.js","MethodPill-DLXmKOwr.js","DuplicateIcon-jzdVwyRU.js","createIcon-eD0b3klN.js","DynamicMarkdown-BfddVCX7.js","SectionHeading-2pSCIo17.js","axios-vUo_bRtp.js","Markdown-DsWjhwJ4.js","clsx-B2t_mZQG.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CUljsAY7.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Cf70306N.js"]}