Records a payment event and atomically posts the allocated journal
entries per the configured waterfall (fees → interest → principal
by default). Returns the resulting journal_entry_id.
OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a
Lambda Authorizer that verifies signature against the issuer's JWKS,
checks iss, aud, exp, nbf, and the tenant_id custom claim.
Granular scopes are required per operation.
Required on every POST. Must be a deterministic, client-chosen
identifier unique per tenant. Recommended format:
<event_type>:<resource_id>:<natural_key>.
Retained for 24h minimum.
Deprecated — use traceparent instead (ADR-0011).
Client-supplied correlation ID. Accepted until 2026-10-01 for
backward compatibility; will be removed after that date.
W3C Trace Context traceparent header for distributed tracing (RFC 7230).
When present, the service extracts the parent span context and creates
child spans under it, enabling end-to-end trace correlation across
API Gateway, the service, and the database.
Format: 00-<trace-id>-<parent-id>-<flags>
Non-negative integer amount in the currency's minor unit, serialized
as a string to preserve precision (JS numbers cannot safely represent
values above 2^53). BIGINT on the wire, BIGINT in the database.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Clarivo","colors":{"primary":"#3656FF","light":"#3656FF","dark":"#0D1B4A"},"logo":{"light":"https://mintcdn.com/ernestova/-pN-cwd52UwuGXwf/logo/light.png?fit=max\u0026auto=format\u0026n=-pN-cwd52UwuGXwf\u0026q=85\u0026s=07db77b0fdcb82f7d6b8a0b1b851fbcd","dark":"https://mintcdn.com/ernestova/2tfxeYsa0xd8zPya/logo/dark.svg?fit=max\u0026auto=format\u0026n=2tfxeYsa0xd8zPya\u0026q=85\u0026s=15255839f268b64ae0daecf3e12a141b"},"favicon":"https://mintcdn.com/ernestova/2tfxeYsa0xd8zPya/favicon.svg?fit=max\u0026auto=format\u0026n=2tfxeYsa0xd8zPya\u0026q=85\u0026s=8cd2a3b2d07d87e76e2f77fecd4b0d62","navbar":{"links":[{"href":"mailto:[email protected]","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.clarivo.co"}},"footer":{"socials":{"linkedin":"https://linkedin.com/company/clarivo"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://clarivo.co"},{"anchor":"Support","icon":"envelope","href":"mailto:[email protected]"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ernestova","hasAudioNarration":false,"actualSubdomain":"ernestova","customDomains":["docs.clarivo.co"],"gitSource":{"type":"github","owner":"ernestova","repo":"docs.clarivo.co","deployBranch":"main","isPrivate":true,"contentDirectory":"","mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a20d8f020d2facfe30018f2","collectionId":"0de2cfa5-1f08-4691-9286-c83cfbe7e607","schemaVersion":"v2"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a20d8f020d2facfe30018f2:success","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API reference","count":13},{"language":"default","tag":"Guides","count":12},{"language":"default","tag":"Endpoints","count":12},{"language":"default","tag":"Writing content","count":4},{"language":"default","tag":"AI tools","count":3},{"language":"default","tag":"Getting started","count":3},{"language":"default","tag":"Customization","count":2},{"language":"default","tag":"balances","count":2},{"language":"default","tag":"health","count":2},{"language":"default","tag":"journal","count":2}]},"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":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","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":"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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/payments/record-a-loan-payment-and-post-to-ledger","slug":"/api-reference/payments/record-a-loan-payment-and-post-to-ledger","pageMetadata":{"title":"Record a loan payment and post to ledger","description":"Records a payment event and atomically posts the allocated journal\nentries per the configured waterfall (fees → interest → principal\nby default). Returns the resulting `journal_entry_id`.\n\nRequires `hpts:payments:write` scope.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /payments","href":"/api-reference/payments/record-a-loan-payment-and-post-to-ledger","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 code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"Records a payment event and atomically posts the allocated journal\\nentries per the configured waterfall (fees → interest → principal\\nby default). Returns the resulting \", _jsx(_components.code, {\n children: \"journal_entry_id\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Requires \", _jsx(_components.code, {\n children: \"hpts:payments:write\"\n }), \" scope.\"]\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 a loan payment and post to ledger","description":"Records a payment event and atomically posts the allocated journal\nentries per the configured waterfall (fees → interest → principal\nby default). Returns the resulting `journal_entry_id`.\n\nRequires `hpts:payments:write` scope.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /payments","href":"/api-reference/payments/record-a-loan-payment-and-post-to-ledger","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["payments"],"operationId":"postPayment","summary":"Record a loan payment and post to ledger","description":"Records a payment event and atomically posts the allocated journal\nentries per the configured waterfall (fees → interest → principal\nby default). Returns the resulting `journal_entry_id`.\n\nRequires `hpts:payments:write` scope.\n","security":["71445a6c-b30e-4017-83e6-155306e3d006","42515083-8350-46fc-bc89-0171957bf59f"],"parameters":["d4abf14a-9824-4ff6-a6dd-65af3159afde","6884c009-7b77-4532-9802-f9c72631beab","51915692-cb7b-4a13-97ee-7535a6b88d95","30b17788-9906-401a-9495-279689312b8d"],"requestBody":"0a1739af-d03f-4c62-a510-f20a5aa3e500","responses":{"200":"a2ab8126-8206-4cf9-8736-ed9c4864918d","201":"14ebb20f-7b61-4c02-a6b0-75f4b0c3fe45","400":"91592122-0219-42c3-93d3-8ec601089ac6","401":"7da3a187-e584-4bf5-8562-95d8fe7b2cff","403":"7f6c259f-96a3-40ec-bd61-ec49f98b16d6","409":"e1d667e4-bf79-4394-986c-252b4deba36c","422":"060a4a27-5aa3-40b9-aedf-4b87568e2c60","429":"120d4b11-67d3-4712-9686-cd90f82f4843","500":"f502d167-b184-4958-8ffe-680ed779a3d1"},"method":"post","type":"path","servers":["e731acad-b03e-44e4-a100-eb93147f0325","2813c222-aadd-4611-bdc7-49cf940cf5fd","f769c33e-7e3e-4801-a152-bf26a8f377df","31944ad7-e0d6-42ce-b3b7-1a9f0c7995d6","38f0ca98-ba0e-4617-b137-275552dc1925","9bac47f9-a24d-49e8-a311-b715f6daa259"],"path":"/payments","baseUrlOptions":["https://ledger.clarivo.co/v1","https://ledger.staging.clarivo.co/v1","https://ledger.dev.clarivo.co/v1","https://partner.hpts.example.com/v1","http://localhost:3000/v1","http://localhost:4010/v1"],"title":"Record a loan payment and post to ledger","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"d4abf14a-9824-4ff6-a6dd-65af3159afde":{"name":"Idempotency-Key","in":"header","required":true,"description":"Required on every POST. Must be a deterministic, client-chosen\nidentifier unique per tenant. Recommended format:\n`\u003cevent_type>:\u003cresource_id>:\u003cnatural_key>`.\nRetained for 24h minimum.\n","schema":{"type":"string","minLength":8,"maxLength":255,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:\\-]{7,254}$","examples":["payment:loan_42:proc_txn_abc123"],"isRequired":true,"description":"Required on every POST. Must be a deterministic, client-chosen\nidentifier unique per tenant. Recommended format:\n`\u003cevent_type>:\u003cresource_id>:\u003cnatural_key>`.\nRetained for 24h minimum.\n","uniqueKey":"","typeLabel":"string"}},"6884c009-7b77-4532-9802-f9c72631beab":{"name":"X-Trace-Id","in":"header","required":false,"deprecated":true,"description":"**Deprecated — use `traceparent` instead (ADR-0011).**\nClient-supplied correlation ID. Accepted until 2026-10-01 for\nbackward compatibility; will be removed after that date.\n","schema":{"type":"string","pattern":"^[A-Za-z0-9\\-]{8,128}$","isRequired":false,"description":"**Deprecated — use `traceparent` instead (ADR-0011).**\nClient-supplied correlation ID. Accepted until 2026-10-01 for\nbackward compatibility; will be removed after that date.\n","uniqueKey":"","typeLabel":"string"}},"51915692-cb7b-4a13-97ee-7535a6b88d95":{"name":"traceparent","in":"header","required":false,"description":"W3C Trace Context `traceparent` header for distributed tracing (RFC 7230).\nWhen present, the service extracts the parent span context and creates\nchild spans under it, enabling end-to-end trace correlation across\nAPI Gateway, the service, and the database.\nFormat: `00-\u003ctrace-id>-\u003cparent-id>-\u003cflags>`\n","schema":{"type":"string","pattern":"^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$","example":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","isRequired":false,"description":"W3C Trace Context `traceparent` header for distributed tracing (RFC 7230).\nWhen present, the service extracts the parent span context and creates\nchild spans under it, enabling end-to-end trace correlation across\nAPI Gateway, the service, and the database.\nFormat: `00-\u003ctrace-id>-\u003cparent-id>-\u003cflags>`\n","uniqueKey":"","typeLabel":"string"}},"30b17788-9906-401a-9495-279689312b8d":{"name":"tracestate","in":"header","required":false,"description":"W3C Trace Context `tracestate` header. Carries vendor-specific trace\nmetadata (e.g. AWS X-Ray sampling decision). Passed through unchanged.\n","schema":{"type":"string","isRequired":false,"description":"W3C Trace Context `tracestate` header. Carries vendor-specific trace\nmetadata (e.g. AWS X-Ray sampling decision). Passed through unchanged.\n","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["loan_id","borrower_id","amount_minor","currency","effective_at","source_method"],"properties":{"loan_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"isRequired":true,"uniqueKey":"loan_id","typeLabel":"string\u003cuuid>"},"borrower_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"isRequired":true,"uniqueKey":"borrower_id","typeLabel":"string\u003cuuid>"},"amount_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"amount_minor","typeLabel":"string"},"currency":{"type":"string","description":"ISO 4217 three-letter currency code.","pattern":"^[A-Z]{3}$","minLength":3,"maxLength":3,"examples":["USD","MXN","EUR"],"isRequired":true,"uniqueKey":"currency","typeLabel":"string"},"effective_at":{"type":"string","format":"date","description":"Accounting date. Must be within an open period.","isRequired":true,"uniqueKey":"effective_at","typeLabel":"string\u003cdate>"},"source_method":{"type":"string","enum":["ach","card","wire","cash","internal"],"isRequired":true,"uniqueKey":"source_method","typeLabel":"enum\u003cstring>"},"external_ref":{"type":"string","minLength":1,"maxLength":255,"description":"Processor/bank reference (e.g., Stripe charge ID).","uniqueKey":"external_ref","typeLabel":"string"},"waterfall_override":{"type":"array","description":"Override default per-program waterfall. Each element is one of\n\"fees\", \"interest\", \"principal\", in desired allocation order.\n","items":{"type":"string","enum":["fees","interest","principal"],"uniqueKey":"waterfall_override.items.[INDEX]","typeLabel":"enum\u003cstring>"},"minItems":1,"maxItems":3,"uniqueItems":true,"uniqueKey":"waterfall_override","typeLabel":"enum\u003cstring>[]"},"metadata":{"type":"object","description":"Free-form key-value metadata. Never used for financial logic.\nSize limit 2 KB serialized. Keys must match `^[a-zA-Z][a-zA-Z0-9_]*$`.\n","maxProperties":20,"additionalProperties":{"oneOf":[{"type":"string","maxLength":500,"uniqueKey":"metadata.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"metadata.additionalProperties.oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"metadata.additionalProperties.oneOf.2","typeLabel":"boolean"}],"uniqueKey":"metadata.additionalProperties","typeLabel":"string | number | boolean"},"uniqueKey":"metadata","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"standardPayment":{"title":"standardPayment","value":{"loan_id":"11111111-1111-1111-1111-111111111111","borrower_id":"22222222-2222-2222-2222-222222222222","amount_minor":"88849","currency":"USD","effective_at":"2026-04-15","source_method":"ach","external_ref":"stripe_ch_xyz123"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"a2ab8126-8206-4cf9-8736-ed9c4864918d":{"description":"Idempotency hit. Same key + same payload returned the original result.\n","headers":{"Idempotency-Key":{"schema":{"type":"string"},"description":"Echo of the Idempotency-Key that produced this response."},"Idempotency-Replay":{"schema":{"type":"string","enum":[true]},"description":"Present when response is a replay of an earlier call."}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["payment_event_id","journal_entry_id","allocation","posted_at"],"properties":{"payment_event_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"isRequired":true,"uniqueKey":"payment_event_id","typeLabel":"string\u003cuuid>"},"journal_entry_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"isRequired":true,"uniqueKey":"journal_entry_id","typeLabel":"string\u003cuuid>"},"allocation":{"type":"object","required":["fees_minor","interest_minor","principal_minor","suspense_minor"],"additionalProperties":false,"properties":{"fees_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.fees_minor","typeLabel":"string"},"interest_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.interest_minor","typeLabel":"string"},"principal_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.principal_minor","typeLabel":"string"},"suspense_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.suspense_minor","typeLabel":"string"}},"isRequired":true,"uniqueKey":"allocation","typeLabel":"object"},"posted_at":{"type":"string","format":"date-time","description":"RFC 3339 timestamp, UTC.","isRequired":true,"uniqueKey":"posted_at","typeLabel":"string\u003cdate-time>"},"correlation_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"uniqueKey":"correlation_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"payment_event_id":"11111111-1111-1111-1111-111111111111","journal_entry_id":"11111111-1111-1111-1111-111111111111","allocation":{"fees_minor":"88849","interest_minor":"88849","principal_minor":"88849","suspense_minor":"88849"},"posted_at":"2023-11-07T05:31:56Z","correlation_id":"11111111-1111-1111-1111-111111111111"}}},"exampleType":"generated"}},"exampleType":"generated"},"14ebb20f-7b61-4c02-a6b0-75f4b0c3fe45":{"description":"Payment posted. Returns the journal entry reference.","headers":{"Idempotency-Key":{"schema":{"type":"string"},"description":"Echo of the Idempotency-Key that produced this response."},"Location":{"schema":{"type":"string","format":"uri"},"description":"URI of the created journal entry"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["payment_event_id","journal_entry_id","allocation","posted_at"],"properties":{"payment_event_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"isRequired":true,"uniqueKey":"payment_event_id","typeLabel":"string\u003cuuid>"},"journal_entry_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"isRequired":true,"uniqueKey":"journal_entry_id","typeLabel":"string\u003cuuid>"},"allocation":{"type":"object","required":["fees_minor","interest_minor","principal_minor","suspense_minor"],"additionalProperties":false,"properties":{"fees_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.fees_minor","typeLabel":"string"},"interest_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.interest_minor","typeLabel":"string"},"principal_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.principal_minor","typeLabel":"string"},"suspense_minor":{"type":"string","description":"Non-negative integer amount in the currency's minor unit, serialized\nas a string to preserve precision (JS numbers cannot safely represent\nvalues above 2^53). BIGINT on the wire, BIGINT in the database.\n","pattern":"^(0|[1-9][0-9]{0,18})$","minLength":1,"maxLength":19,"examples":["88849","10000000"],"isRequired":true,"uniqueKey":"allocation.suspense_minor","typeLabel":"string"}},"isRequired":true,"uniqueKey":"allocation","typeLabel":"object"},"posted_at":{"type":"string","format":"date-time","description":"RFC 3339 timestamp, UTC.","isRequired":true,"uniqueKey":"posted_at","typeLabel":"string\u003cdate-time>"},"correlation_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"uniqueKey":"correlation_id","typeLabel":"string\u003cuuid>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"payment_event_id":"11111111-1111-1111-1111-111111111111","journal_entry_id":"11111111-1111-1111-1111-111111111111","allocation":{"fees_minor":"88849","interest_minor":"88849","principal_minor":"88849","suspense_minor":"88849"},"posted_at":"2023-11-07T05:31:56Z","correlation_id":"11111111-1111-1111-1111-111111111111"}}},"exampleType":"generated"}},"exampleType":"generated"},"91592122-0219-42c3-93d3-8ec601089ac6":{"description":"Malformed request","content":{"application/problem+json":{"schema":{"type":"object","required":["type","title","status"],"additionalProperties":true,"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"7da3a187-e584-4bf5-8562-95d8fe7b2cff":{"description":"Missing or invalid credentials","content":{"application/problem+json":{"schema":{"type":"object","required":["type","title","status"],"additionalProperties":true,"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"7f6c259f-96a3-40ec-bd61-ec49f98b16d6":{"description":"Authenticated but not authorized for this scope/tenant","content":{"application/problem+json":{"schema":{"type":"object","required":["type","title","status"],"additionalProperties":true,"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"e1d667e4-bf79-4394-986c-252b4deba36c":{"description":"A request with this Idempotency-Key is currently in flight.\nThe client must back off and retry; do not change the payload.\n","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1,"maximum":30},"description":"Seconds to wait before retry"}},"content":{"application/problem+json":{"schema":{"type":"object","required":["conflict_kind","type","title","status"],"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"conflict_kind":{"type":"string","enum":["idempotency_in_progress","idempotency_mismatch"],"description":"- `idempotency_in_progress`: another request with this key is\n currently executing. Retry after Retry-After seconds.\n- `idempotency_mismatch`: this key was previously used with a\n different payload. The key may not be reused with a new\n payload within its retention window.\n","isRequired":true,"uniqueKey":"conflict_kind","typeLabel":"enum\u003cstring>"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"},"original_request_fingerprint":{"type":"string","description":"SHA-256 hex of the original request body.","pattern":"^[0-9a-f]{64}$","uniqueKey":"original_request_fingerprint","typeLabel":"string"},"received_request_fingerprint":{"type":"string","description":"SHA-256 hex of the current request body.","pattern":"^[0-9a-f]{64}$","uniqueKey":"received_request_fingerprint","typeLabel":"string"},"original_journal_entry_id":{"type":"string","format":"uuid","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","examples":["11111111-1111-1111-1111-111111111111"],"uniqueKey":"original_journal_entry_id","typeLabel":"string\u003cuuid>"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"conflict_kind":"idempotency_in_progress","detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>","original_request_fingerprint":"\u003cstring>","received_request_fingerprint":"\u003cstring>","original_journal_entry_id":"11111111-1111-1111-1111-111111111111"}}},"exampleType":"generated"}},"exampleType":"generated"},"060a4a27-5aa3-40b9-aedf-4b87568e2c60":{"description":"Semantic validation failure. For idempotency, a replay with a\n*different payload* than the original returns this with type\n`idempotency_mismatch`.\n","content":{"application/problem+json":{"schema":{"type":"object","required":["type","title","status"],"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"type":"string","description":"JSON pointer to the offending field.","examples":["/amount_minor","/loans/3/interest_minor"],"isRequired":true,"uniqueKey":"errors.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","pattern":"^[a-z_]+$","examples":["required","pattern_mismatch","out_of_range"],"isRequired":true,"uniqueKey":"errors.items.[INDEX].code","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"uniqueKey":"errors","typeLabel":"object[]"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>","errors":[{"field":"/amount_minor","code":"required","message":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"120d4b11-67d3-4712-9686-cd90f82f4843":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1}}},"content":{"application/problem+json":{"schema":{"type":"object","required":["type","title","status"],"additionalProperties":true,"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"f502d167-b184-4958-8ffe-680ed779a3d1":{"description":"Unexpected server error","content":{"application/problem+json":{"schema":{"type":"object","required":["type","title","status"],"additionalProperties":true,"properties":{"type":{"type":"string","format":"uri","description":"URI identifying the problem type.","examples":["https://errors.hpts.example.com/bad_request"],"isRequired":true,"uniqueKey":"type","typeLabel":"string\u003curi>"},"title":{"type":"string","description":"Human-readable summary, same across occurrences.","isRequired":true,"uniqueKey":"title","typeLabel":"string"},"status":{"type":"integer","minimum":400,"maximum":599,"isRequired":true,"uniqueKey":"status","typeLabel":"integer"},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence.","uniqueKey":"detail","typeLabel":"string"},"instance":{"type":"string","format":"uri","description":"URI identifying this specific occurrence.","uniqueKey":"instance","typeLabel":"string\u003curi>"},"trace_id":{"type":"string","description":"Distributed-trace ID for cross-system correlation.","uniqueKey":"trace_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"https://errors.hpts.example.com/bad_request","title":"\u003cstring>","status":499,"detail":"\u003cstring>","instance":"\u003cstring>","trace_id":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"71445a6c-b30e-4017-83e6-155306e3d006":{"bearerAuth":{"type":"oauth2","description":"OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a\nLambda Authorizer that verifies signature against the issuer's JWKS,\nchecks `iss`, `aud`, `exp`, `nbf`, and the `tenant_id` custom claim.\nGranular scopes are required per operation.\n","flows":{"clientCredentials":{"tokenUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:payments:write":"Post payment events","hpts:disbursements:write":"Post disbursement events","hpts:accruals:write":"Post batch accruals","hpts:reversals:write":"Post reversals (privileged; audited)","hpts:ledger:read":"Read journal entries","hpts:balances:read":"Read balances","hpts:loans:read":"Read loan metadata","hpts:reconciliation:read":"Read reconciliation reports","hpts:admin:*":"Administrative operations"}},"authorizationCode":{"authorizationUrl":"https://auth.example.com/oauth2/authorize","tokenUrl":"https://auth.example.com/oauth2/token","refreshUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:balances:read":"Read balances","hpts:ledger:read":"Read journal entries"}}},"scopes":["hpts:payments:write"]}},"42515083-8350-46fc-bc89-0171957bf59f":{"mtlsAuth":{"type":"mutualTLS","description":"Mutual TLS for B2B partner integrations. Partners present a client\ncertificate issued by AWS Private CA. API Gateway enforces against a\ntruststore; the `CN` is asserted as the partner identity and cross-\nchecked against the tenant claim in the accompanying JWT.\n","scopes":[]},"bearerAuth":{"type":"oauth2","description":"OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a\nLambda Authorizer that verifies signature against the issuer's JWKS,\nchecks `iss`, `aud`, `exp`, `nbf`, and the `tenant_id` custom claim.\nGranular scopes are required per operation.\n","flows":{"clientCredentials":{"tokenUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:payments:write":"Post payment events","hpts:disbursements:write":"Post disbursement events","hpts:accruals:write":"Post batch accruals","hpts:reversals:write":"Post reversals (privileged; audited)","hpts:ledger:read":"Read journal entries","hpts:balances:read":"Read balances","hpts:loans:read":"Read loan metadata","hpts:reconciliation:read":"Read reconciliation reports","hpts:admin:*":"Administrative operations"}},"authorizationCode":{"authorizationUrl":"https://auth.example.com/oauth2/authorize","tokenUrl":"https://auth.example.com/oauth2/token","refreshUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:balances:read":"Read balances","hpts:ledger:read":"Read journal entries"}}},"scopes":["hpts:payments:write"]}}},"servers":{"e731acad-b03e-44e4-a100-eb93147f0325":{"url":"https://ledger.clarivo.co/v1","description":"Production"},"2813c222-aadd-4611-bdc7-49cf940cf5fd":{"url":"https://ledger.staging.clarivo.co/v1","description":"Staging"},"f769c33e-7e3e-4801-a152-bf26a8f377df":{"url":"https://ledger.dev.clarivo.co/v1","description":"Development"},"31944ad7-e0d6-42ce-b3b7-1a9f0c7995d6":{"url":"https://partner.hpts.example.com/v1","description":"B2B partner endpoint (mTLS required)"},"38f0ca98-ba0e-4617-b137-275552dc1925":{"url":"http://localhost:3000/v1","description":"Local (cmd/server)"},"9bac47f9-a24d-49e8-a311-b715f6daa259":{"url":"http://localhost:4010/v1","description":"Local Prism mock"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"oauth2","description":"OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a\nLambda Authorizer that verifies signature against the issuer's JWKS,\nchecks `iss`, `aud`, `exp`, `nbf`, and the `tenant_id` custom claim.\nGranular scopes are required per operation.\n","flows":{"clientCredentials":{"tokenUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:payments:write":"Post payment events","hpts:disbursements:write":"Post disbursement events","hpts:accruals:write":"Post batch accruals","hpts:reversals:write":"Post reversals (privileged; audited)","hpts:ledger:read":"Read journal entries","hpts:balances:read":"Read balances","hpts:loans:read":"Read loan metadata","hpts:reconciliation:read":"Read reconciliation reports","hpts:admin:*":"Administrative operations"}},"authorizationCode":{"authorizationUrl":"https://auth.example.com/oauth2/authorize","tokenUrl":"https://auth.example.com/oauth2/token","refreshUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:balances:read":"Read balances","hpts:ledger:read":"Read journal entries"}}},"scopes":["hpts:payments:write"]},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a\nLambda Authorizer that verifies signature against the issuer's JWKS,\nchecks `iss`, `aud`, `exp`, `nbf`, and the `tenant_id` custom claim.\nGranular scopes are required per operation.\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"oauth2","description":"OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a\nLambda Authorizer that verifies signature against the issuer's JWKS,\nchecks `iss`, `aud`, `exp`, `nbf`, and the `tenant_id` custom claim.\nGranular scopes are required per operation.\n","flows":{"clientCredentials":{"tokenUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:payments:write":"Post payment events","hpts:disbursements:write":"Post disbursement events","hpts:accruals:write":"Post batch accruals","hpts:reversals:write":"Post reversals (privileged; audited)","hpts:ledger:read":"Read journal entries","hpts:balances:read":"Read balances","hpts:loans:read":"Read loan metadata","hpts:reconciliation:read":"Read reconciliation reports","hpts:admin:*":"Administrative operations"}},"authorizationCode":{"authorizationUrl":"https://auth.example.com/oauth2/authorize","tokenUrl":"https://auth.example.com/oauth2/token","refreshUrl":"https://auth.example.com/oauth2/token","scopes":{"hpts:balances:read":"Read balances","hpts:ledger:read":"Read journal entries"}}},"scopes":["hpts:payments:write"]},"schema":{"title":"OAuth2 Auth","type":"string","isRequired":true,"description":"OAuth2 JWT bearer tokens. Tokens are validated at API Gateway via a\nLambda Authorizer that verifies signature against the issuer's JWKS,\nchecks `iss`, `aud`, `exp`, `nbf`, and the `tenant_id` custom claim.\nGranular scopes are required per operation.\n","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.yaml"},"subdomain":"ernestova","siteName":"Clarivo","title":"Record a loan payment and post to ledger - Clarivo","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-01T23:06:24.597Z","originalFileLocation":"api-reference/payments/record-a-loan-payment-and-post-to-ledger.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 a payment event and atomically posts the allocated journal entries per the configured waterfall (fees → interest → principal by default). Returns the resulting journal_entry_id. Requires hpts:payments:write scope.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Clarivo\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_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/ernestova/hQJxd9lKbBwLpjSM/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Record a loan payment and post to ledger - Clarivo\">\u003cmeta data-mint-head property=\"og:description\" content=\"Records a payment event and atomically posts the allocated journal entries per the configured waterfall (fees → interest → principal by default). Returns the resulting journal_entry_id. Requires hpts:payments:write scope.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Clarivo\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ernestova.mintlify.app/_mintlify/api/og/v2?division=payments\u0026amp;title=Record+a+loan+payment+and+post+to+ledger\u0026amp;description=Records+a+payment+event+and+atomically+posts+the+allocated+journal%0Aentries+per+the+configured+waterfall+%28fees+%E2%86%92+interest+%E2%86%92+principal%0Aby+default%29.+Returns+the+re\u0026amp;theme=727e387f59ed6cd9c522712f\u0026amp;signature=149e4ebec0d5054de24d797a34d6fbf7c0646edddf96a9ca6f5d9af56549cdab\">\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 a loan payment and post to ledger - Clarivo\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Records a payment event and atomically posts the allocated journal entries per the configured waterfall (fees → interest → principal by default). Returns the resulting journal_entry_id. Requires hpts:payments:write scope.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ernestova.mintlify.app/_mintlify/api/og/v2?division=payments\u0026amp;title=Record+a+loan+payment+and+post+to+ledger\u0026amp;description=Records+a+payment+event+and+atomically+posts+the+allocated+journal%0Aentries+per+the+configured+waterfall+%28fees+%E2%86%92+interest+%E2%86%92+principal%0Aby+default%29.+Returns+the+re\u0026amp;theme=727e387f59ed6cd9c522712f\u0026amp;signature=149e4ebec0d5054de24d797a34d6fbf7c0646edddf96a9ca6f5d9af56549cdab\">\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/ernestova/hQJxd9lKbBwLpjSM/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Clarivo\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3656FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/payments/record-a-loan-payment-and-post-to-ledger.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.clarivo.co/#organization\",\"name\":\"Clarivo\",\"url\":\"https://docs.clarivo.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ernestova/-pN-cwd52UwuGXwf/logo/light.png?fit=max\u0026auto=format\u0026n=-pN-cwd52UwuGXwf\u0026q=85\u0026s=07db77b0fdcb82f7d6b8a0b1b851fbcd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.clarivo.co#website\",\"name\":\"Clarivo\",\"url\":\"https://docs.clarivo.co\",\"publisher\":{\"@id\":\"https://docs.clarivo.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger#webpage\",\"url\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger\",\"name\":\"Record a loan payment and post to ledger\",\"description\":\"Records a payment event and atomically posts the allocated journal entries per the configured waterfall (fees → interest → principal by default). Returns the resulting journal_entry_id. Requires hpts:payments:write scope.\",\"dateModified\":\"2026-05-01T23:06:24.597Z\",\"isPartOf\":{\"@id\":\"https://docs.clarivo.co#website\"},\"breadcrumb\":{\"@id\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.clarivo.co/api-reference/health/liveness-probe\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Record a loan payment and post to ledger\",\"item\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger#apireference\",\"headline\":\"Record a loan payment and post to ledger\",\"name\":\"Record a loan payment and post to ledger\",\"description\":\"Records a payment event and atomically posts the allocated journal entries per the configured waterfall (fees → interest → principal by default). Returns the resulting journal_entry_id. Requires hpts:payments:write scope.\",\"url\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger\",\"mainEntityOfPage\":{\"@id\":\"https://docs.clarivo.co/api-reference/payments/record-a-loan-payment-and-post-to-ledger#webpage\"},\"dateModified\":\"2026-05-01T23:06:24.597Z\",\"publisher\":{\"@id\":\"https://docs.clarivo.co/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.clarivo.co#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Clarivo\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Clarivo","nav":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://clarivo.co"},{"anchor":"Support","icon":"envelope","href":"mailto:[email protected]"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","groups":[{"group":"API documentation","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"group":"Endpoints","pages":[{"group":"health","pages":[{"title":"Liveness probe","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /health/live","href":"/api-reference/health/liveness-probe"},{"title":"Readiness probe (checks DB connectivity)","description":null,"deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /health/ready","href":"/api-reference/health/readiness-probe-checks-db-connectivity"}]},{"group":"payments","pages":[{"title":"Record a loan payment and post to ledger","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /payments","href":"/api-reference/payments/record-a-loan-payment-and-post-to-ledger"}]},{"group":"disbursements","pages":[{"title":"Record a loan disbursement","description":"Debits Principal Receivable, credits the disbursement clearing account.\nRequires `hpts:disbursements:write` scope.\n","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /disbursements","href":"/api-reference/disbursements/record-a-loan-disbursement"}]},{"group":"accruals","pages":[{"title":"Post a batched daily interest accrual for a program","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /accruals/batch","href":"/api-reference/accruals/post-a-batched-daily-interest-accrual-for-a-program"}]},{"group":"reversals","pages":[{"title":"Post a reversal of an existing journal entry","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml post /reversals","href":"/api-reference/reversals/post-a-reversal-of-an-existing-journal-entry"}]},{"group":"balances","pages":[{"title":"Current balance for a loan (all sub-accounts)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /loans/{loan_id}/balance","href":"/api-reference/balances/current-balance-for-a-loan-all-sub-accounts"},{"title":"General-ledger account balance","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /accounts/{account_code}/balance","href":"/api-reference/balances/general-ledger-account-balance"}]},{"group":"journal","pages":[{"title":"Fetch a journal entry with its lines","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /journal-entries/{journal_entry_id}","href":"/api-reference/journal/fetch-a-journal-entry-with-its-lines"},{"title":"Paginated journal history for a loan","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /loans/{loan_id}/journal-entries","href":"/api-reference/journal/paginated-journal-history-for-a-loan"}]},{"group":"reconciliation","pages":[{"title":"Latest reconciliation check results","deprecated":null,"version":null,"openapi":"/api-reference/openapi.yaml get /reconciliation/status","href":"/api-reference/reconciliation/latest-reconciliation-check-results"}]},{"group":"API Reference","pages":[{"title":"Fires when a journal entry is posted","version":null,"deprecated":null,"openapi":"/api-reference/openapi.yaml webhook journalEntryPosted","href":"/api-reference/fires-when-a-journal-entry-is-posted"}]}]}]}]},"title":"Record a loan payment and post to ledger - Clarivo","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-WRhTSUDL.js","utils-ChMov4Kr.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-_REmC2bI.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp6nVRCu.js","snippetPresets-DZadmXoU.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CY2WdoTl.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DwYG-Q4l.js","shallow-BXQIGwv4.js","getApiPlaygroundDisplay-CK5nK5B9.js","CodeSnippet-TH4a2aGW.js","CodeSnippets-DwsQiOFS.js","Page-R3M_BF4L.js","getPastedJson-DD7kUzi_.js","icon-holE3QoJ.js","MethodPill-DUW0T8us.js","DuplicateIcon-CI_p4be-.js","createIcon-BdbRvavb.js","DynamicMarkdown-DN96a4Ur.js","SectionHeading-SCu36A9d.js","axios-vUo_bRtp.js","Markdown-CCeGv-zI.js","clsx-BGBGWFTt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-Cv_O2fky.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-2C5OB2eV.js"]}