Money-moving mutations — useCreateSubscription, useChangePlan, useTopUp, usePayInvoice, and friends — resolve to a SettleOutcome: a discriminated union on kind that tells you exactly how the money moved. Pass the matching on* handler in the hook’s options, or call client.handleSettlement(result, handlers).
Outcomes
kind
Meaning
Handler
charged_inline
Card charged + invoice paid immediately
onChargedInline
requires_form
A hosted PSP form is needed (3DS / new card) — open result.client
requires_form carries a PSP client payload and a reason code — hand it to your hosted
checkout / Stripe Elements flow to collect authentication or a new card. The other outcomes are
terminal: the money has already moved (or there was nothing to do).
On success, the hook also invalidates the affected queries (customer, subscriptions, invoices, wallets) so the rest of your UI refreshes automatically.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"UnitPay","colors":{"primary":"#003024","light":"#A4EA49","dark":"#003024"},"logo":{"light":"https://mintcdn.com/unitpay-3b8bda6f/So8jMiDXR87FDNME/logo/light.svg?fit=max\u0026auto=format\u0026n=So8jMiDXR87FDNME\u0026q=85\u0026s=2268c97b201018b9200258950f8b97cc","dark":"https://mintcdn.com/unitpay-3b8bda6f/So8jMiDXR87FDNME/logo/dark.svg?fit=max\u0026auto=format\u0026n=So8jMiDXR87FDNME\u0026q=85\u0026s=79d760422ca637b13fb416086c9c4800"},"favicon":"https://mintcdn.com/unitpay-3b8bda6f/So8jMiDXR87FDNME/favicon.svg?fit=max\u0026auto=format\u0026n=So8jMiDXR87FDNME\u0026q=85\u0026s=645bf792c265c9572b9e168bf8e16380","navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://app.useunitpay.com"}},"contextual":{"options":["copy","view"],"display":"header"},"interaction":{"drilldown":true},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://app.useunitpay.com"},{"anchor":"Website","icon":"globe","href":"https://useunitpay.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"unitpay-3b8bda6f","hasAudioNarration":false,"actualSubdomain":"unitpay-3b8bda6f","customDomains":["docs.useunitpay.com"],"gitSource":{"type":"github","owner":"unitpayhq","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae95a40bb9827c4f4ffc0e2:success","clientVersion":"0.0.4342","searchFilterCounts":[{"language":"default","tag":"React SDK","count":15},{"language":"default","tag":"Documentation","count":11},{"language":"default","tag":"Building blocks","count":10},{"language":"default","tag":"Get started","count":5},{"language":"default","tag":"Credits","count":5},{"language":"default","tag":"Node SDK","count":5},{"language":"default","tag":"Overview","count":5},{"language":"default","tag":"Billing","count":1}]},"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":"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":"site-roles","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":"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":"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":"turbopuffer-dual-write","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":"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":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"language-tabs.css","content":"[data-testid=\"code-sample-language-select\"],.code-sample-language-select,[aria-haspopup=\"listbox\"]{}"},{"filePath":"style.css","content":".prose>.api-section{display:none!important}#topbar-cta-button .bg-primary-dark{background-color:#a4ea49!important}#topbar-cta-button .text-white,#topbar-cta-button svg{color:#003024!important}"}]}
{"page":{"pagePath":"react/settlement","slug":"/react/settlement","pageMetadata":{"title":"Settlement model","description":"How money-moving mutations resolve","href":"/react/settlement"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How money-moving mutations resolve\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Money-moving mutations — `,_jsx(_components.code,{children:`useCreateSubscription`}),`, `,_jsx(_components.code,{children:`useChangePlan`}),`, `,_jsx(_components.code,{children:`useTopUp`}),`, `,_jsx(_components.code,{children:`usePayInvoice`}),`, and friends — resolve to a `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`SettleOutcome`})}),`: a discriminated union on `,_jsx(_components.code,{children:`kind`}),` that tells you exactly how the money moved. Pass the matching `,_jsx(_components.code,{children:`on*`}),` handler in the hook’s options, or call `,_jsx(_components.code,{children:`client.handleSettlement(result, handlers)`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`outcomes`,children:`Outcomes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`kind`})}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`Handler`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`charged_inline`})}),_jsx(_components.td,{children:`Card charged + invoice paid immediately`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onChargedInline`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`requires_form`})}),_jsxs(_components.td,{children:[`A hosted PSP form is needed (3DS / new card) — open `,_jsx(_components.code,{children:`result.client`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onRequiresForm`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`invoice_sent`})}),_jsx(_components.td,{children:`NET-terms invoice issued + emailed (send-invoice customers)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onInvoiceSent`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`invoice_added`})}),_jsx(_components.td,{children:`Charge appended to the next invoice`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onInvoiceAdded`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`deferred`})}),_jsx(_components.td,{children:`Scheduled for a future date`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onDeferred`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`created_no_charge`})}),_jsx(_components.td,{children:`Created with nothing to charge`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onCreated`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_action`})}),_jsx(_components.td,{children:`Already settled / zero amount`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`onNoAction`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`useCreateSubscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@unitpay/react'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Subscribe`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`createSubscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`isPending`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` useCreateSubscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onChargedInline`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ({ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`subscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` router`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`/welcome/\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`subscription`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onRequiresForm`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ({ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`reason`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` openHostedCheckout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reason`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onInvoiceSent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ({ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`invoice`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` toast`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Invoice \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`invoice`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`invoiceNumber`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" on its way`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` disabled`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`isPending`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onClick`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` createSubscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`planId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'pro'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Subscribe`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`requires_form`}),` carries a PSP `,_jsx(_components.code,{children:`client`}),` payload and a `,_jsx(_components.code,{children:`reason`}),` code — hand it to your hosted\ncheckout / Stripe Elements flow to collect authentication or a new card. The other outcomes are\nterminal: the money has already moved (or there was nothing to do).`]})}),`\n`,_jsx(_components.p,{children:`On success, the hook also invalidates the affected queries (customer, subscriptions, invoices, wallets) so the rest of your UI refreshes automatically.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Settlement model","description":"How money-moving mutations resolve","href":"/react/settlement"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Outcomes","slug":"outcomes","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/unitpay-3b8bda6f/5a837a9bbe0b0ff8/dynamic-response.js"],"subdomain":"unitpay-3b8bda6f","siteName":"UnitPay","title":"Settlement model - UnitPay","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-02T06:21:51.447Z","originalFileLocation":"react/settlement.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=\"How money-moving mutations resolve\">\u003cmeta data-mint-head name=\"application-name\" content=\"UnitPay\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Settlement model - UnitPay\">\u003cmeta data-mint-head property=\"og:description\" content=\"How money-moving mutations resolve\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"UnitPay\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.useunitpay.com/react/settlement\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://unitpay-3b8bda6f.mintlify.site/_mintlify/api/og/v2?division=Overview\u0026amp;title=Settlement+model\u0026amp;description=How+money-moving+mutations+resolve\u0026amp;theme=e74e94a481e7bc29c04565e9\u0026amp;signature=cfdc10d8499ef74819a7172590b0404d6b314ed79e86fdc797b6612659fdb909\">\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=\"Settlement model - UnitPay\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How money-moving mutations resolve\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://unitpay-3b8bda6f.mintlify.site/_mintlify/api/og/v2?division=Overview\u0026amp;title=Settlement+model\u0026amp;description=How+money-moving+mutations+resolve\u0026amp;theme=e74e94a481e7bc29c04565e9\u0026amp;signature=cfdc10d8499ef74819a7172590b0404d6b314ed79e86fdc797b6612659fdb909\">\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/unitpay-3b8bda6f/QqqG_raKXAXQLKC0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"UnitPay\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#003024\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.useunitpay.com/react/settlement\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/react/settlement.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.useunitpay.com/#organization\",\"name\":\"UnitPay\",\"url\":\"https://docs.useunitpay.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/unitpay-3b8bda6f/So8jMiDXR87FDNME/logo/light.svg?fit=max\u0026auto=format\u0026n=So8jMiDXR87FDNME\u0026q=85\u0026s=2268c97b201018b9200258950f8b97cc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.useunitpay.com#website\",\"name\":\"UnitPay\",\"url\":\"https://docs.useunitpay.com\",\"publisher\":{\"@id\":\"https://docs.useunitpay.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.useunitpay.com/react/settlement#webpage\",\"url\":\"https://docs.useunitpay.com/react/settlement\",\"name\":\"Settlement model\",\"description\":\"How money-moving mutations resolve\",\"dateModified\":\"2026-07-02T06:21:51.447Z\",\"isPartOf\":{\"@id\":\"https://docs.useunitpay.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.useunitpay.com/react/settlement#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.useunitpay.com/react/settlement#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Overview\",\"item\":\"https://docs.useunitpay.com/react/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Settlement model\",\"item\":\"https://docs.useunitpay.com/react/settlement\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.useunitpay.com/react/settlement#article\",\"headline\":\"Settlement model\",\"name\":\"Settlement model\",\"description\":\"How money-moving mutations resolve\",\"url\":\"https://docs.useunitpay.com/react/settlement\",\"mainEntityOfPage\":{\"@id\":\"https://docs.useunitpay.com/react/settlement#webpage\"},\"dateModified\":\"2026-07-02T06:21:51.447Z\",\"publisher\":{\"@id\":\"https://docs.useunitpay.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.useunitpay.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"UnitPay\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"UnitPay\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/react/settlement.md","siteName":"UnitPay","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://app.useunitpay.com"},{"anchor":"Website","icon":"globe","href":"https://useunitpay.com"}]},"tabs":[{"tab":"Documentation","icon":"folder-open","pages":[{"title":"Documentation","href":"/welcome"}]},{"tab":"Node SDK","icon":"node-js","pages":[{"title":"Node SDK","href":"/node/introduction"}]},{"tab":"React SDK","icon":"react","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/react/introduction"},{"title":"UnitPayProvider","href":"/react/provider"},{"title":"Next.js adapter","description":"Proxy SDK requests through your own backend","href":"/react/next-adapter"},{"title":"Settlement model","href":"/react/settlement"},{"title":"Error handling","description":"The SDK's typed error model","href":"/react/errors"}]},{"group":"Building blocks","pages":[{"title":"Customer","href":"/react/customer"},{"title":"Entitlements \u0026 gates","href":"/react/entitlements-and-gates"},{"title":"Subscriptions","href":"/react/subscriptions"},{"title":"Invoices","href":"/react/invoices"},{"title":"Payment methods","href":"/react/payment-methods"},{"title":"Credits \u0026 wallets","href":"/react/credits-and-wallets"},{"title":"Usage \u0026 analytics","href":"/react/usage-and-analytics"},{"title":"Catalog \u0026 pricing","href":"/react/catalog-and-pricing"},{"title":"Checkout","href":"/react/checkout"},{"title":"Imperative API","href":"/react/imperative"}]}]}]},"basePath":"","title":"Settlement model - UnitPay","deploymentId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","buildId":"dpl_QQ3G2kinQNQFFK6Sh8dmX2teK74w","dynamics":[],"chunks":[]}