Active Investments Only: Only investments with an āactiveā status can be withdrawn. Attempting to withdraw completed or cancelled investments will result in an error.
Interest Calculation: Interest is calculated up to the exact moment of withdrawal, including partial days.
Blockchain Confirmation: The transaction may take a few moments to be confirmed on the blockchain before the funds appear in the agentās wallet.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Mage API Documentation","colors":{"primary":"#FF5722","light":"#FF7043","dark":"#E64A19"},"logo":{"light":"https://mintcdn.com/mage-bank/_nadq0QJn3EnDhRd/logo/logo-light.svg?fit=max\u0026auto=format\u0026n=_nadq0QJn3EnDhRd\u0026q=85\u0026s=219a4c58a03182e18d28e9d2afb98f31","dark":"https://mintcdn.com/mage-bank/_nadq0QJn3EnDhRd/logo/logo-dark.svg?fit=max\u0026auto=format\u0026n=_nadq0QJn3EnDhRd\u0026q=85\u0026s=caaba7488d66d3c05d6c3f621e1d501d"},"favicon":"/logo/favicon.png","api":{"playground":{"display":"interactive"},"mdx":{"server":"https://api.magebank.ai"}},"appearance":{"default":"dark"},"background":{"color":{"light":"#fff","dark":"#000"}},"navbar":{"links":[{"label":"Support","href":"mailto:[email protected]"}],"primary":{"type":"button","label":"Dashboard","href":"https://www.magebank.ai/dashboard"}},"footer":{"socials":{"x":"https://x.com/magebank","github":"https://github.com/magebank","linkedin":"https://linkedin.com/company/magebank"}},"banner":{"content":"š Mage is now live! Visit our [Dashboard](https://www.magebank.ai/dashboard) to start managing your AI agents' finances.","dismissible":true},"contextual":{"options":["copy","view"]},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://www.magebank.ai/dashboard"},{"anchor":"LLM.txt","icon":"robot","href":"https://raw.githubusercontent.com/MageBankAI/docs/refs/heads/master/LLM.txt"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"mage-bank","hasAudioNarration":false,"actualSubdomain":"mage-bank","customDomains":["docs.magebank.ai"],"gitSource":{"type":"github","owner":"magebankai","repo":"docs","deployBranch":"master","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e6e8328cd78292a4fb44","collectionId":"9cbc1059-e065-4299-9807-cb62384e3d04","schemaVersion":"v2"},"entitlements":{},"buildId":"6ae92843b35e9cea405c8119:success","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"Savings","count":8},{"language":"default","tag":"Payments","count":7},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Agents","count":6},{"language":"default","tag":"User Guide","count":5},{"language":"default","tag":"Transactions","count":2},{"language":"default","tag":"Users","count":2},{"language":"default","tag":"Get Started","count":2}]},"assistantConfig":{},"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":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"body:not(.auth-authenticated)>*:not(#auth-modal):not(script):not(style):not(link){filter:blur(15px)!important;pointer-events:none!important;user-select:none!important}html:not(.auth-authenticated),body:not(.auth-authenticated){overflow:hidden!important}#navbar img,.navbar img,[data-testid=\"navbar\"] img,.navbar-logo img,.logo img{height:36px!important;max-height:36px!important;width:auto!important;transform:translateX(-8px)!important;-webkit-transform:translateX(-8px)!important;-moz-transform:translateX(-8px)!important;-ms-transform:translateX(-8px)!important;-o-transform:translateX(-8px)!important}img[src*=\"logo-light\"],img[src*=\"logo-dark\"]{height:36px!important;max-height:36px!important;width:auto!important;transform:translateX(-8px)!important;-webkit-transform:translateX(-8px)!important;-moz-transform:translateX(-8px)!important;-ms-transform:translateX(-8px)!important;-o-transform:translateX(-8px)!important}body.auth-active{overflow:hidden!important}body.auth-active::-webkit-scrollbar{display:none!important}body.auth-active{-ms-overflow-style:none!important;scrollbar-width:none!important}html.auth-active{overflow:hidden!important}#auth-modal{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:10000;display:flex;align-items:center;justify-content:center;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif}.auth-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:16px}.auth-modal{position:relative;background:#1a1a1a;border-radius:16px;box-shadow:0 25px 50px rgba(0, 0, 0, 0.6),\n 0 0 0 1px rgba(255, 255, 255, 0.08);max-width:400px;width:100%;border:1px solid rgba(13, 13, 13, 0.05);overflow:hidden;display:flex;flex-direction:column}#auth-modal[data-theme=\"dark\"] .auth-modal{background:#1a1a1a;box-shadow:0 25px 50px rgba(0, 0, 0, 0.6),\n 0 0 0 1px rgba(255, 255, 255, 0.08);border:1px solid rgba(13, 13, 13, 0.05)}#auth-modal[data-theme=\"light\"] .auth-modal,.light #auth-modal .auth-modal,[data-theme=\"light\"] #auth-modal .auth-modal,body.light #auth-modal .auth-modal{background:#ffffff!important;box-shadow:0 25px 50px rgba(0, 0, 0, 0.15),\n 0 0 0 1px rgba(0, 0, 0, 0.08)!important;border:1px solid rgba(0, 0, 0, 0.08)!important}#auth-modal[data-theme=\"light\"]{background:transparent!important}#auth-modal[data-theme=\"light\"] .auth-overlay{background:rgba(0, 0, 0, 0.3)!important}.auth-header{position:relative;padding:20px;border-bottom:1px solid rgba(230, 230, 232, 0.1);flex-shrink:0}#auth-modal[data-theme=\"dark\"] .auth-header{border-bottom:1px solid rgba(230, 230, 232, 0.1)}#auth-modal[data-theme=\"light\"] .auth-header,.light #auth-modal .auth-header,[data-theme=\"light\"] #auth-modal .auth-header,body.light #auth-modal .auth-header{border-bottom:1px solid rgba(0, 0, 0, 0.1)!important}.auth-header-content{display:flex;align-items:center;gap:8px}.auth-theme-toggle{display:none!important}.auth-icon-container{width:32px;height:32px;background:rgba(255, 122, 0, 0.1);border:1px solid rgba(255, 122, 0, 0.2);border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.auth-logo{height:16px;width:16px;color:#FF7A00}.auth-header-text{flex:1}.auth-header h2{margin:0;font-size:16px;font-weight:700;color:#ffffff;letter-spacing:-0.2px;line-height:1.2}#auth-modal[data-theme=\"dark\"] .auth-header h2{color:#ffffff}#auth-modal[data-theme=\"light\"] .auth-header h2,.light #auth-modal .auth-header h2,[data-theme=\"light\"] #auth-modal .auth-header h2,body.light #auth-modal .auth-header h2{color:#1a1a1a!important}.auth-header p{margin:2px 0 0 0;font-size:12px;color:rgba(255, 255, 255, 0.7);line-height:1.3;font-weight:500}#auth-modal[data-theme=\"dark\"] .auth-header p{color:rgba(255, 255, 255, 0.7)}#auth-modal[data-theme=\"light\"] .auth-header p,.light #auth-modal .auth-header p,[data-theme=\"light\"] #auth-modal .auth-header p,body.light #auth-modal .auth-header p{color:rgba(26, 26, 26, 0.7)!important}.auth-content{flex:1;overflow-y:auto;padding:20px}.auth-form{display:flex;flex-direction:column;gap:24px}.auth-input-group{display:flex;flex-direction:column;gap:8px}.auth-input-label{font-size:12px;font-weight:700;color:#ffffff;display:flex;align-items:center;gap:4px}#auth-modal[data-theme=\"dark\"] .auth-input-label{color:#ffffff}#auth-modal[data-theme=\"light\"] .auth-input-label,.light #auth-modal .auth-input-label,[data-theme=\"light\"] #auth-modal .auth-input-label,body.light #auth-modal .auth-input-label{color:#1a1a1a!important}.auth-label-icon{width:12px;height:12px;color:rgba(255, 255, 255, 0.6)}#auth-modal[data-theme=\"dark\"] .auth-label-icon{color:rgba(255, 255, 255, 0.6)}#auth-modal[data-theme=\"light\"] .auth-label-icon,.light #auth-modal .auth-label-icon,[data-theme=\"light\"] #auth-modal .auth-label-icon,body.light #auth-modal .auth-label-icon{color:rgba(26, 26, 26, 0.6)!important}#auth-password{width:100%;border:1px solid rgba(230, 230, 232, 0.2);border-radius:8px;padding:8px 12px;font-size:14px;font-weight:500;color:#ffffff;background:rgba(45, 45, 45, 0.7);outline:none;box-sizing:border-box;transition:border-color 0.2s ease, box-shadow 0.2s ease}#auth-modal[data-theme=\"dark\"] #auth-password{color:#ffffff;background:rgba(45, 45, 45, 0.7);border:1px solid rgba(230, 230, 232, 0.2)}#auth-modal[data-theme=\"light\"] #auth-password,.light #auth-modal #auth-password,[data-theme=\"light\"] #auth-modal #auth-password,body.light #auth-modal #auth-password{color:#1a1a1a!important;background:rgba(245, 245, 245, 0.8)!important;border:1px solid rgba(0, 0, 0, 0.15)!important}#auth-password:hover{border-color:#FF7A00}#auth-password:focus{border-color:#FF7A00;box-shadow:0 0 0 1px rgba(255, 122, 0, 0.2);background:rgba(45, 45, 45, 0.9)}#auth-modal[data-theme=\"dark\"] #auth-password:focus{background:rgba(45, 45, 45, 0.9)}#auth-modal[data-theme=\"light\"] #auth-password:focus,.light #auth-modal #auth-password:focus,[data-theme=\"light\"] #auth-modal #auth-password:focus,body.light #auth-modal #auth-password:focus{background:rgba(245, 245, 245, 1)!important}#auth-password::placeholder{color:rgba(255, 255, 255, 0.5);font-weight:400}#auth-modal[data-theme=\"dark\"] #auth-password::placeholder{color:rgba(255, 255, 255, 0.5)}#auth-modal[data-theme=\"light\"] #auth-password::placeholder,.light #auth-modal #auth-password::placeholder,[data-theme=\"light\"] #auth-modal #auth-password::placeholder,body.light #auth-modal #auth-password::placeholder{color:rgba(26, 26, 26, 0.5)!important}#auth-password.error{border-color:#ef4444;animation:shake 0.3s ease-in-out}@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}.auth-footer{padding:20px;border-top:1px solid rgba(230, 230, 232, 0.1);background:rgba(249, 249, 249, 0.02);display:flex;justify-content:flex-end;gap:8px;flex-shrink:0}#auth-modal[data-theme=\"dark\"] .auth-footer{border-top:1px solid rgba(230, 230, 232, 0.1);background:rgba(249, 249, 249, 0.02)}#auth-modal[data-theme=\"light\"] .auth-footer,.light #auth-modal .auth-footer,[data-theme=\"light\"] #auth-modal .auth-footer,body.light #auth-modal .auth-footer{border-top:1px solid rgba(0, 0, 0, 0.1)!important;background:rgba(0, 0, 0, 0.02)!important}.auth-submit{display:flex;gap:6px;justify-content:center;align-items:center;background:#2D2D2D;padding:10px 16px;color:white;font-size:13px;border-radius:8px;border:none;border-bottom:2px solid rgba(255, 255, 255, 0.2);font-weight:600;cursor:pointer;transition:all 0.2s ease;min-height:40px;position:relative;overflow:hidden}#auth-modal[data-theme=\"dark\"] .auth-submit{background:#2D2D2D;color:white;border-bottom:2px solid rgba(255, 255, 255, 0.2)}#auth-modal[data-theme=\"light\"] .auth-submit,.light #auth-modal .auth-submit,[data-theme=\"light\"] #auth-modal .auth-submit,body.light #auth-modal .auth-submit{background:#f0f0f0!important;color:#1a1a1a!important;border-bottom:2px solid rgba(0, 0, 0, 0.15)!important}.auth-submit:hover{background:#1a1a1a;border-bottom-color:rgba(255, 255, 255, 0.3);transform:translateY(-1px)}#auth-modal[data-theme=\"dark\"] .auth-submit:hover{background:#1a1a1a;border-bottom-color:rgba(255, 255, 255, 0.3)}#auth-modal[data-theme=\"light\"] .auth-submit:hover,.light #auth-modal .auth-submit:hover,[data-theme=\"light\"] #auth-modal .auth-submit:hover,body.light #auth-modal .auth-submit:hover{background:#e0e0e0!important;border-bottom-color:rgba(0, 0, 0, 0.25)!important}.auth-submit:active{transform:translateY(0);border-bottom-width:1px}.auth-submit:disabled{opacity:0.5;cursor:not-allowed;transform:none}.auth-submit:disabled:hover{background:#2D2D2D;border-bottom-color:rgba(255, 255, 255, 0.2);transform:none}#auth-modal[data-theme=\"dark\"] .auth-submit:disabled:hover{background:#2D2D2D;border-bottom-color:rgba(255, 255, 255, 0.2)}#auth-modal[data-theme=\"light\"] .auth-submit:disabled:hover,.light #auth-modal .auth-submit:disabled:hover,[data-theme=\"light\"] #auth-modal .auth-submit:disabled:hover,body.light #auth-modal .auth-submit:disabled:hover{background:#f0f0f0!important;border-bottom-color:rgba(0, 0, 0, 0.15)!important}.auth-submit-icon{width:14px;height:14px;flex-shrink:0}.auth-error{background:rgba(239, 68, 68, 0.1);border:1px solid rgba(239, 68, 68, 0.2);color:#ef4444;padding:8px 12px;border-radius:8px;display:flex;align-items:flex-start;gap:8px;margin-top:12px}.auth-error-icon{width:16px;height:16px;margin-top:2px;flex-shrink:0;color:#ef4444}.auth-error-text{font-size:12px;font-weight:500}@media (max-width: 480px){.auth-overlay{padding:8px}.auth-modal{max-width:100%}.auth-header{padding:12px}.auth-content{padding:12px}.auth-footer{padding:12px}.auth-header h2{font-size:14px}.auth-header p{font-size:11px}}"}],"page":{"pagePath":"api-reference/savings/withdraw","slug":"/api-reference/savings/withdraw","pageMetadata":{"title":"Withdraw Savings","api":"POST /savings/withdraw","description":"Withdraw funds from a savings investment","href":"/api-reference/savings/withdraw"},"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: \"Withdraw funds from a savings investment\"\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`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Expandable,Heading,Info,Note,ParamField,ResponseField,Table,Warning}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Complete Withdrawal`}),`: Closes an active investment and returns the principal plus earned interest to the agentās wallet.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-headers`,children:`Request Headers`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsx(_components.p,{children:`Your API key for authentication`})}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`Must be set to `,_jsx(_components.code,{children:`application/json`})]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`investmentId`,type:`string`,required:true,id:`param-investment-id`,children:_jsx(_components.p,{children:`The short ID or UUID of the investment`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsx(_components.p,{children:`Whether the withdrawal was successful`})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,id:`param-message`,children:_jsx(_components.p,{children:`Information about the withdrawal`})}),`\n`,_jsx(ResponseField,{name:`withdrawalDetails`,type:`object`,id:`param-withdrawal-details`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`principal`,type:`string`,id:`param-principal`,children:_jsx(_components.p,{children:`Original amount invested`})}),_jsx(ResponseField,{name:`interest`,type:`string`,id:`param-interest`,children:_jsx(_components.p,{children:`Interest earned during the investment period`})}),_jsx(ResponseField,{name:`totalAmount`,type:`string`,id:`param-total-amount`,children:_jsx(_components.p,{children:`Total amount withdrawn (principal + interest)`})}),_jsx(ResponseField,{name:`duration`,type:`object`,id:`param-duration`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`days`,type:`number`,id:`param-days`,children:_jsx(_components.p,{children:`Number of days the investment was active`})}),_jsx(ResponseField,{name:`hours`,type:`number`,id:`param-hours`,children:_jsx(_components.p,{children:`Number of hours beyond whole days`})}),_jsx(ResponseField,{name:`minutes`,type:`number`,id:`param-minutes`,children:_jsx(_components.p,{children:`Number of minutes beyond whole hours`})})]})})]})}),`\n`,_jsx(ResponseField,{name:`transaction`,type:`object`,id:`param-transaction`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`txHash`,type:`string`,id:`param-tx-hash`,children:_jsx(_components.p,{children:`Transaction hash on the blockchain`})}),_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.p,{children:`Status of the transaction`})})]})}),`\n`,_jsx(ResponseField,{name:`agentId`,type:`string`,id:`param-agent-id`,children:_jsx(_components.p,{children:`The ID of the agent that owned the investment`})}),`\n`,_jsx(ResponseField,{name:`updatedBalance`,type:`string`,id:`param-updated-balance`,children:_jsx(_components.p,{children:`New balance of the agent after the withdrawal`})}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`status-codes`,children:`Status Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsx(_components.td,{children:`Withdrawal completed successfully`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:`Bad Request - Invalid or missing parameters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`Unauthorized - Invalid or missing API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`Not Found - Investment not found`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Internal Server Error`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Active Investments Only`}),`: Only investments with an āactiveā status can be withdrawn. Attempting to withdraw completed or cancelled investments will result in an error.`]})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Interest Calculation`}),`: Interest is calculated up to the exact moment of withdrawal, including partial days.`]})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Blockchain Confirmation`}),`: The transaction may take a few moments to be confirmed on the blockchain before the funds appear in the agentās wallet.`]})})]})}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":"Withdraw Savings","api":"POST /savings/withdraw","description":"Withdraw funds from a savings investment","href":"/api-reference/savings/withdraw"}}},"mdxSourceWithNoJs":{"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,Expandable,Heading,Info,Note,ParamField,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Complete Withdrawal`}),`: Closes an active investment and returns the principal plus earned interest to the agentās wallet.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-headers`,children:`Request Headers`}),`\n`,_jsx(ParamField,{header:`x-api-key`,type:`string`,required:true,id:`param-x-api-key`,children:_jsx(_components.p,{children:`Your API key for authentication`})}),`\n`,_jsx(ParamField,{header:`Content-Type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`Must be set to `,_jsx(_components.code,{children:`application/json`})]})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(ParamField,{body:`investmentId`,type:`string`,required:true,id:`param-investment-id`,children:_jsx(_components.p,{children:`The short ID or UUID of the investment`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsx(_components.p,{children:`Whether the withdrawal was successful`})}),`\n`,_jsx(ResponseField,{name:`message`,type:`string`,id:`param-message`,children:_jsx(_components.p,{children:`Information about the withdrawal`})}),`\n`,_jsx(ResponseField,{name:`withdrawalDetails`,type:`object`,id:`param-withdrawal-details`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`principal`,type:`string`,id:`param-principal`,children:_jsx(_components.p,{children:`Original amount invested`})}),_jsx(ResponseField,{name:`interest`,type:`string`,id:`param-interest`,children:_jsx(_components.p,{children:`Interest earned during the investment period`})}),_jsx(ResponseField,{name:`totalAmount`,type:`string`,id:`param-total-amount`,children:_jsx(_components.p,{children:`Total amount withdrawn (principal + interest)`})}),_jsx(ResponseField,{name:`duration`,type:`object`,id:`param-duration`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`days`,type:`number`,id:`param-days`,children:_jsx(_components.p,{children:`Number of days the investment was active`})}),_jsx(ResponseField,{name:`hours`,type:`number`,id:`param-hours`,children:_jsx(_components.p,{children:`Number of hours beyond whole days`})}),_jsx(ResponseField,{name:`minutes`,type:`number`,id:`param-minutes`,children:_jsx(_components.p,{children:`Number of minutes beyond whole hours`})})]})})]})}),`\n`,_jsx(ResponseField,{name:`transaction`,type:`object`,id:`param-transaction`,children:_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`txHash`,type:`string`,id:`param-tx-hash`,children:_jsx(_components.p,{children:`Transaction hash on the blockchain`})}),_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsx(_components.p,{children:`Status of the transaction`})})]})}),`\n`,_jsx(ResponseField,{name:`agentId`,type:`string`,id:`param-agent-id`,children:_jsx(_components.p,{children:`The ID of the agent that owned the investment`})}),`\n`,_jsx(ResponseField,{name:`updatedBalance`,type:`string`,id:`param-updated-balance`,children:_jsx(_components.p,{children:`New balance of the agent after the withdrawal`})}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`200`,numberOfLines:`20`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Withdrawal completed successfully.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"withdrawalDetails\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"principal\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1000.00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"interest\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"45.75\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"totalAmount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1045.75\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"duration\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"days\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hours\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"minutes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`23`})]}),`\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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"transaction\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"txHash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x123...abc\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agentId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent_k77NTwxp2Ym3JCmVsKtXQA\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updatedBalance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1545.75\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400`,numberOfLines:`3`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Investment ID is required\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`404`,numberOfLines:`3`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Investment not found\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400`,numberOfLines:`7`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Investment has already been completed or cancelled\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_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\":`#D4D4D4`},children:\"```json \"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`401`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Unauthorized`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invalid or missing API key\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`500 Internal Server Error`,numberOfLines:`3`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Internal Server Error\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`status-codes`,children:`Status Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`200`}),_jsx(_components.td,{children:`Withdrawal completed successfully`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:`Bad Request - Invalid or missing parameters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`Unauthorized - Invalid or missing API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`Not Found - Investment not found`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:`Internal Server Error`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Active Investments Only`}),`: Only investments with an āactiveā status can be withdrawn. Attempting to withdraw completed or cancelled investments will result in an error.`]})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Interest Calculation`}),`: Interest is calculated up to the exact moment of withdrawal, including partial days.`]})}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Blockchain Confirmation`}),`: The transaction may take a few moments to be confirmed on the blockchain before the funds appear in the agentās wallet.`]})})]})}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":"Withdraw Savings","api":"POST /savings/withdraw","description":"Withdraw funds from a savings investment","href":"/api-reference/savings/withdraw"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Request Headers","slug":"request-headers","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Status Codes","slug":"status-codes","depth":2,"children":[]}],"codeExamples":{"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"20\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Withdrawal completed successfully.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"withdrawalDetails\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"principal\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"1000.00\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"interest\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"45.75\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"totalAmount\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"1045.75\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"duration\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"days\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">30\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hours\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">5\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"minutes\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">23\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"transaction\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"txHash\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"0x123...abc\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"completed\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"agentId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"agent_k77NTwxp2Ym3JCmVsKtXQA\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"updatedBalance\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"1545.75\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"400","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"3\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Investment ID is required\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"404","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"3\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Investment not found\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"400","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Investment has already been completed or cancelled\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">```json \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">401\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> Unauthorized\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Invalid or missing API key\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"500 Internal Server Error","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"3\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Internal Server Error\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Withdraw Savings","path":"/savings/withdraw","servers":[{"url":"https://api.magebank.ai"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"x-api-key":{"schema":[{"type":"string","description":"Your API key for authentication","required":true}]},"Content-Type":{"schema":[{"type":"string","description":"Must be set to `application/json`","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"investmentId":[{"type":"string","description":"The short ID or UUID of the investment","required":true}]}}],"examples":{"example":{"value":{"investmentId":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"Whether the withdrawal was successful"}],"message":[{"type":"string","description":"Information about the withdrawal"}],"withdrawalDetails":[{"type":"object","properties":{"principal":[{"type":"string","description":"Original amount invested"}],"interest":[{"type":"string","description":"Interest earned during the investment period"}],"totalAmount":[{"type":"string","description":"Total amount withdrawn (principal + interest)"}],"duration":[{"type":"object","properties":{"days":[{"type":"number","description":"Number of days the investment was active"}],"hours":[{"type":"number","description":"Number of hours beyond whole days"}],"minutes":[{"type":"number","description":"Number of minutes beyond whole hours"}]}}]}}],"transaction":[{"type":"object","properties":{"txHash":[{"type":"string","description":"Transaction hash on the blockchain"}],"status":[{"type":"string","description":"Status of the transaction"}]}}],"agentId":[{"type":"string","description":"The ID of the agent that owned the investment"}],"updatedBalance":[{"type":"string","description":"New balance of the agent after the withdrawal"}]}}],"examples":{"example":{"value":{"success":true,"message":"\u003cstring>","withdrawalDetails":{"principal":"\u003cstring>","interest":"\u003cstring>","totalAmount":"\u003cstring>","duration":{"days":123,"hours":123,"minutes":123}},"transaction":{"txHash":"\u003cstring>","status":"\u003cstring>"},"agentId":"\u003cstring>","updatedBalance":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":["/_mintlify/custom/mage-bank/1e4b99045996c61b/auth.js"],"subdomain":"mage-bank","siteName":"Mage API Documentation","title":"Withdraw Savings - Mage API Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T08:07:27.050Z","originalFileLocation":"api-reference/savings/withdraw.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=\"dark\"}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=\"Withdraw funds from a savings investment\">\u003cmeta data-mint-head name=\"application-name\" content=\"Mage API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_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/mage-bank/g0X0PUMQLAKhbfWc/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Withdraw Savings - Mage API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Withdraw funds from a savings investment\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Mage API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.magebank.ai/api-reference/savings/withdraw\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://mage-bank.mintlify.app/_mintlify/api/og/v2?division=Savings\u0026amp;title=Withdraw+Savings\u0026amp;description=Withdraw+funds+from+a+savings+investment\u0026amp;theme=dee5e68ffd04fa1fff3d24df\u0026amp;signature=e94d73912a9d66a1caa6e9401d612db64986c7a0499e9aee3fccb21985b946c6\">\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=\"Withdraw Savings - Mage API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Withdraw funds from a savings investment\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://mage-bank.mintlify.app/_mintlify/api/og/v2?division=Savings\u0026amp;title=Withdraw+Savings\u0026amp;description=Withdraw+funds+from+a+savings+investment\u0026amp;theme=dee5e68ffd04fa1fff3d24df\u0026amp;signature=e94d73912a9d66a1caa6e9401d612db64986c7a0499e9aee3fccb21985b946c6\">\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/mage-bank/g0X0PUMQLAKhbfWc/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Mage API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF5722\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.magebank.ai/api-reference/savings/withdraw\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/savings/withdraw.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.magebank.ai/#organization\",\"name\":\"Mage API Documentation\",\"url\":\"https://docs.magebank.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/mage-bank/_nadq0QJn3EnDhRd/logo/logo-light.svg?fit=max\u0026auto=format\u0026n=_nadq0QJn3EnDhRd\u0026q=85\u0026s=219a4c58a03182e18d28e9d2afb98f31\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.magebank.ai#website\",\"name\":\"Mage API Documentation\",\"url\":\"https://docs.magebank.ai\",\"publisher\":{\"@id\":\"https://docs.magebank.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.magebank.ai/api-reference/savings/withdraw#webpage\",\"url\":\"https://docs.magebank.ai/api-reference/savings/withdraw\",\"name\":\"Withdraw Savings\",\"description\":\"Withdraw funds from a savings investment\",\"dateModified\":\"2026-01-07T08:07:27.050Z\",\"isPartOf\":{\"@id\":\"https://docs.magebank.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.magebank.ai/api-reference/savings/withdraw#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.magebank.ai/api-reference/savings/withdraw#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Savings\",\"item\":\"https://docs.magebank.ai/api-reference/savings/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Withdraw Savings\",\"item\":\"https://docs.magebank.ai/api-reference/savings/withdraw\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.magebank.ai/api-reference/savings/withdraw#apireference\",\"headline\":\"Withdraw Savings\",\"name\":\"Withdraw Savings\",\"description\":\"Withdraw funds from a savings investment\",\"url\":\"https://docs.magebank.ai/api-reference/savings/withdraw\",\"mainEntityOfPage\":{\"@id\":\"https://docs.magebank.ai/api-reference/savings/withdraw#webpage\"},\"dateModified\":\"2026-01-07T08:07:27.050Z\",\"publisher\":{\"@id\":\"https://docs.magebank.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.magebank.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Mage API Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Mage API Documentation","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://www.magebank.ai/dashboard"},{"anchor":"LLM.txt","icon":"robot","href":"https://raw.githubusercontent.com/MageBankAI/docs/refs/heads/master/LLM.txt"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API Reference","groups":[{"group":"Users","pages":[{"title":"Introduction","href":"/api-reference/users/introduction"},{"title":"Get Wallet Balance","api":"GET /user/wallet-balance","href":"/api-reference/users/get-wallet-balance"}]},{"group":"Agents","pages":[{"title":"Introduction","href":"/api-reference/agents/introduction"},{"title":"Get Agent","api":"GET /agentsWith/{id}","href":"/api-reference/agents/get-agent"},{"title":"Create Agent","api":"POST /agents/create","href":"/api-reference/agents/create-agent"},{"title":"List User Agents","api":"GET /agents/{id}","href":"/api-reference/agents/get-user-agents"},{"title":"Deposit to Agent","api":"POST /agents/deposit","href":"/api-reference/agents/deposit"},{"title":"Withdraw from Agent","api":"POST /agents/withdraw","href":"/api-reference/agents/withdraw"}]},{"group":"Payments","pages":[{"title":"Introduction","href":"/api-reference/payments/introduction"},{"title":"Register Payment","api":"POST /payments/register","href":"/api-reference/payments/register-payment"},{"title":"Approve Payment","api":"POST /payments/setApprove","href":"/api-reference/payments/approve-payment"},{"title":"Decline Payment","api":"POST /payments/setDecline","href":"/api-reference/payments/decline-payment"},{"title":"Get Payment","api":"GET /payments/{id}","href":"/api-reference/payments/get-payment"},{"title":"List User Payments","api":"GET /user/payments","href":"/api-reference/payments/get-user-payments"},{"title":"Export Payments","api":"POST /payments/export","href":"/api-reference/payments/export-payments"}]},{"group":"Transactions","pages":[{"title":"Introduction","href":"/api-reference/transactions/introduction"},{"title":"Transaction Summary","api":"GET /transactions/summary","href":"/api-reference/transactions/get-transaction-summary"}]},{"group":"Savings","pages":[{"title":"Introduction","href":"/api-reference/savings/introduction"},{"title":"Get Interest Rate","api":"GET /investment/interest-rate","href":"/api-reference/savings/get-interest-rate"},{"title":"Calculate Interest","api":"POST /investment/calculator","href":"/api-reference/savings/calculate-interest"},{"title":"Deposit Savings","api":"POST /savings/deposit","description":"Deposit savings into an agent's account","href":"/api-reference/savings/deposit"},{"title":"Withdraw Savings","api":"POST /savings/withdraw","href":"/api-reference/savings/withdraw"},{"title":"Get Savings Dashboard","api":"GET /savings/dashboard","description":"Get a comprehensive overview of the user's savings portfolio","href":"/api-reference/savings/get-dashboard"},{"title":"Get Agent Investments","api":"GET /savings/{agentId}","href":"/api-reference/savings/get-agent-investments"},{"title":"Get User Investments","api":"GET /savings/myinvestments","href":"/api-reference/savings/get-user-investments"}]}]}]},"basePath":"","title":"Withdraw Savings - Mage API Documentation","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["BannerMarkdown-DicSZcaX.js","dist-CIQkMg3R.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-ClVdStUn.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-DX1Meug0.js","utils-B_OMIQVC.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-ChxhRPMa.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CuKvD8Iv.js","snippetPresets-C5d7p2hp.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CfHcE8m4.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C1zZV314.js","shallow-CmQhqCJn.js","getApiPlaygroundDisplay-YRo9s1O7.js","CodeSnippet-RN1MTdfk.js","CodeSnippets-DKLPHxJA.js","Page-BAvA99GL.js","getPastedJson-bz0M41mU.js","icon-CsmhpPrv.js","MethodPill-CNGsVE77.js","DuplicateIcon-DilfU_Z2.js","createIcon-BdsYzQck.js","DynamicMarkdown-CbqEDjbV.js","SectionHeading-O6hXpFCN.js","axios-vUo_bRtp.js"]}