{ "error": "Refund failed", "responsetext": "Refund amount may not exceed the transaction balance"}
{ "error": "Unable to refund charge.", "hint": "Please verify the charge_id is correct. \n charge_id: ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK"}
Refund a succeeded card charge. The full amount is returned to the customer’s card — partial refunds are not supported. The charge must belong to the merchant whose API key is used; otherwise the API responds with a 422 indistinguishable from “not found”, by design.
Refunds are supported for card deposits processed through the NMI or Rapyd gateways. Payout charges are rejected with "Only credit charges can be refunded.", and charges on other processors return "We cannot refund this transaction through this processor at the moment." — both as a 422.
Sandbox. Sandbox accounts process cards through a test gateway that this endpoint does not support, so every refund of a sandbox card charge returns 422 with "We cannot refund this transaction through this processor at the moment.", whatever the charge’s age. To exercise your checkout.refunded handler in sandbox, pay the test amount $1.08 — see Sandbox Test Data. Bank-rail deposits have no refund path in any environment; return money to a bank customer with a fixed-amount withdrawal instead.
The request takes no body — the full charge amount is always refunded.
On success the charge transitions to the terminal refunded status and the response is the same charge object returned by Retrieve a Charge, with status: "refunded".
A charge can only be refunded once; a second attempt fails because the charge is no longer in the succeeded status.
If you subscribe to the opt-in checkout.refunded webhook, it fires when the charge transitions.
Once a card charge is recorded as succeeded it can be refunded whether or not the daily settlement batch has run, so same-day refunds work. If the processor declines a refund for any reason, the API returns a 422 whose responsetext carries the processor’s decline reason.
curl -X POST "https://api-sandbox.paywithsoap.com/api/v1/charges/ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK/refund" \ -H "Authorization: Bearer YOUR_API_KEY"
Current state of the charge. Not every value is reachable on every flow or processor: held occurs on withdrawals that place a hold; voided and returned follow a succeeded charge that the processor later reversed; cancelled is processor-specific — a transfer that was accepted (usually pending) and then cancelled by the rail, seen on bank-transfer deposits and payouts — and emits the opt-in checkout.cancelled event (ask Soap whether your rails emit it); refunded is set by a full refund of a succeeded NMI or Rapyd card deposit via POST /api/v1/charges/{id}/refund or the dashboard, and emits the opt-in checkout.refunded event. See the charge lifecycle for the full transition map and which webhook each transition emits.
3D Secure verification details. Card charges only: present as an object when 3DS was performed and as null otherwise. Absent on bank and crypto charges.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Soap","colors":{"primary":"#4B9EF4","light":"#FFF5E1","dark":"#1C1C1E"},"logo":{"light":"https://mintcdn.com/soappaymentsinc/xLCEKqTin27F3B_G/logo/soap-payments-light-large.png?fit=max\u0026auto=format\u0026n=xLCEKqTin27F3B_G\u0026q=85\u0026s=80edefa85946042d6b589971385d221a","dark":"https://mintcdn.com/soappaymentsinc/xLCEKqTin27F3B_G/logo/soap-payments-dark-large.png?fit=max\u0026auto=format\u0026n=xLCEKqTin27F3B_G\u0026q=85\u0026s=5c1cd400b95800d745b2adfae3d0dbdf"},"favicon":"https://mintcdn.com/soappaymentsinc/wi7l5TPQvnY0ywwl/favicon.svg?fit=max\u0026auto=format\u0026n=wi7l5TPQvnY0ywwl\u0026q=85\u0026s=599c1c310c53f1e169af11ff2d739d3a","api":{"openapi":"api-reference/openapi.json"},"background":{"color":{"light":"#FFFFFF","dark":"#000000"}},"navbar":{"links":[],"primary":{"type":"button","label":"Request Access","href":"https://www.paywithsoap.com"}},"footer":{"socials":{"twitter":"https://x.com/paywithsoap","github":"https://github.com/Soap-Payments","linkedin":"https://www.linkedin.com/company/soap-payments"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode","add-mcp"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"soappaymentsinc","hasAudioNarration":false,"actualSubdomain":"soappaymentsinc","customDomains":["docs.paywithsoap.com"],"gitSource":{"type":"github","owner":"soap-payments","repo":"soap-monorepo","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":"","_id":"6adeb175ae0dc487a6162dea"},"entitlements":{},"buildId":"6af344e18b1d48fe4630ffb2","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"API Reference","count":39},{"language":"default","tag":"Webhooks","count":19},{"language":"default","tag":"API Endpoints","count":16},{"language":"default","tag":"Checkouts","count":8},{"language":"default","tag":"Receive Payments","count":5},{"language":"default","tag":"API Documentation","count":3},{"language":"default","tag":"Documentation","count":3},{"language":"default","tag":"Getting Started","count":3},{"language":"default","tag":"Send Payments","count":2},{"language":"default","tag":"Testing","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/api-v1/charges/refund","slug":"/api-reference/api-v1/charges/refund","pageMetadata":{"title":"Refund a Charge","openapi":"POST /api/v1/charges/{id}/refund","description":"Refund a succeeded card deposit in full (NMI and Rapyd)","href":"/api-reference/api-v1/charges/refund"},"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: \"Refund a succeeded card deposit in full (NMI and Rapyd)\"\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={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Note,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Refund a succeeded card charge. The full amount is returned to the customer’s card — partial refunds are not supported. The charge must belong to the merchant whose API key is used; otherwise the API responds with a 422 indistinguishable from “not found”, by design.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Refunds are supported for `,_jsx(_components.strong,{children:`card deposits processed through the NMI or Rapyd gateways`}),`. Payout charges are rejected with `,_jsx(_components.code,{children:`\"Only credit charges can be refunded.\"`}),`, and charges on other processors return `,_jsx(_components.code,{children:`\"We cannot refund this transaction through this processor at the moment.\"`}),` — both as a 422.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Sandbox.`}),` Sandbox accounts process cards through a test gateway that this endpoint does not support, so every refund of a sandbox card charge returns `,_jsx(_components.code,{children:`422`}),` with `,_jsx(_components.code,{children:`\"We cannot refund this transaction through this processor at the moment.\"`}),`, whatever the charge’s age. To exercise your `,_jsx(_components.code,{children:`checkout.refunded`}),` handler in sandbox, pay the test amount `,_jsx(_components.code,{children:`$1.08`}),` — see `,_jsx(_components.a,{href:`/api-reference/api-v1/testing#testing-webhooks`,children:`Sandbox Test Data`}),`. Bank-rail deposits have no refund path in any environment; return money to a bank customer with a fixed-amount withdrawal instead.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`behavior`,children:`Behavior`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The request takes `,_jsx(_components.strong,{children:`no body`}),` — the full charge amount is always refunded.`]}),`\n`,_jsxs(_components.li,{children:[`On success the charge transitions to the terminal `,_jsx(_components.code,{children:`refunded`}),` status and the response is the `,_jsxs(_components.strong,{children:[`same charge object returned by `,_jsx(_components.a,{href:`/api-reference/api-v1/charges/show`,children:`Retrieve a Charge`})]}),`, with `,_jsx(_components.code,{children:`status: \"refunded\"`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`A charge can only be refunded once; a second attempt fails because the charge is no longer in the `,_jsx(_components.code,{children:`succeeded`}),` status.`]}),`\n`,_jsxs(_components.li,{children:[`If you subscribe to the opt-in `,_jsx(_components.a,{href:`/api-reference/api-v1/webhooks/checkout-refunded`,children:_jsx(_components.code,{children:`checkout.refunded`})}),` webhook, it fires when the charge transitions.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`settlement-timing`,children:`Settlement timing`}),`\n`,_jsxs(_components.p,{children:[`Once a card charge is recorded as `,_jsx(_components.code,{children:`succeeded`}),` it can be refunded whether or not the daily settlement batch has run, so same-day refunds work. If the processor declines a refund for any reason, the API returns a 422 whose `,_jsx(_components.code,{children:`responsetext`}),` carries the processor’s decline reason.`]})]})}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":"Refund a Charge","openapi":"POST /api/v1/charges/{id}/refund","description":"Refund a succeeded card deposit in full (NMI and Rapyd)","href":"/api-reference/api-v1/charges/refund"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,RequestExample,ResponseExample,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Refund a succeeded card charge. The full amount is returned to the customer’s card — partial refunds are not supported. The charge must belong to the merchant whose API key is used; otherwise the API responds with a 422 indistinguishable from “not found”, by design.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Refunds are supported for `,_jsx(_components.strong,{children:`card deposits processed through the NMI or Rapyd gateways`}),`. Payout charges are rejected with `,_jsx(_components.code,{children:`\"Only credit charges can be refunded.\"`}),`, and charges on other processors return `,_jsx(_components.code,{children:`\"We cannot refund this transaction through this processor at the moment.\"`}),` — both as a 422.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Sandbox.`}),` Sandbox accounts process cards through a test gateway that this endpoint does not support, so every refund of a sandbox card charge returns `,_jsx(_components.code,{children:`422`}),` with `,_jsx(_components.code,{children:`\"We cannot refund this transaction through this processor at the moment.\"`}),`, whatever the charge’s age. To exercise your `,_jsx(_components.code,{children:`checkout.refunded`}),` handler in sandbox, pay the test amount `,_jsx(_components.code,{children:`$1.08`}),` — see `,_jsx(_components.a,{href:`/api-reference/api-v1/testing#testing-webhooks`,children:`Sandbox Test Data`}),`. Bank-rail deposits have no refund path in any environment; return money to a bank customer with a fixed-amount withdrawal instead.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`behavior`,children:`Behavior`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The request takes `,_jsx(_components.strong,{children:`no body`}),` — the full charge amount is always refunded.`]}),`\n`,_jsxs(_components.li,{children:[`On success the charge transitions to the terminal `,_jsx(_components.code,{children:`refunded`}),` status and the response is the `,_jsxs(_components.strong,{children:[`same charge object returned by `,_jsx(_components.a,{href:`/api-reference/api-v1/charges/show`,children:`Retrieve a Charge`})]}),`, with `,_jsx(_components.code,{children:`status: \"refunded\"`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`A charge can only be refunded once; a second attempt fails because the charge is no longer in the `,_jsx(_components.code,{children:`succeeded`}),` status.`]}),`\n`,_jsxs(_components.li,{children:[`If you subscribe to the opt-in `,_jsx(_components.a,{href:`/api-reference/api-v1/webhooks/checkout-refunded`,children:_jsx(_components.code,{children:`checkout.refunded`})}),` webhook, it fires when the charge transitions.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`settlement-timing`,children:`Settlement timing`}),`\n`,_jsxs(_components.p,{children:[`Once a card charge is recorded as `,_jsx(_components.code,{children:`succeeded`}),` it can be refunded whether or not the daily settlement batch has run, so same-day refunds work. If the processor declines a refund for any reason, the API returns a 422 whose `,_jsx(_components.code,{children:`responsetext`}),` carries the processor’s decline reason.`]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`Curl`,numberOfLines:`2`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` -X POST `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api-sandbox.paywithsoap.com/api/v1/charges/ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK/refund\"`}),_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:` -H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization: Bearer YOUR_API_KEY\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Ruby`,numberOfLines:`14`,language:`ruby`,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:`ruby`,children:_jsxs(_components.code,{language:`ruby`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`require`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'net/http'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`require`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'uri'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`charge_id = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`uri = URI.parse(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api-sandbox.paywithsoap.com/api/v1/charges/#{charge_id}/refund\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`http = Net::HTTP.new(uri.host, uri.port)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`http.use_ssl = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`request = Net::HTTP::Post.new(uri.request_uri)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`request[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer YOUR_API_KEY'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response = http.request(request)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`puts response.body`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`21`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` axios = require(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'axios'`}),_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:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` refundCharge = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (chargeId) => {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_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\":`#C586C0`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` axios.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `https://api-sandbox.paywithsoap.com/api/v1/charges/${chargeId}/refund`\"}),_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`,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:` headers: {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Bearer YOUR_API_KEY'`})]}),`\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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.log(response.data);`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (error) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` console.error(error);`})}),`\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`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`refundCharge(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`Error (processor declined)`,numberOfLines:`4`,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:`4`,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:`\"Refund failed\"`}),_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:` \"responsetext\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Refund amount may not exceed the transaction balance\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Error (unknown charge)`,numberOfLines:`4`,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:`4`,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:`\"Unable to refund charge.\"`}),_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:` \"hint\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Please verify the charge_id is correct. `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` charge_id: ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})]})}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":"Refund a Charge","openapi":"POST /api/v1/charges/{id}/refund","description":"Refund a succeeded card deposit in full (NMI and Rapyd)","href":"/api-reference/api-v1/charges/refund"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Behavior","slug":"behavior","depth":2,"children":[]},{"title":"Settlement timing","slug":"settlement-timing","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Curl","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=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"2\">\u003cspan class=\"line\">\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> -X POST \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api-sandbox.paywithsoap.com/api/v1/charges/ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK/refund\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> -H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Authorization: Bearer YOUR_API_KEY\"\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Ruby","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=\"ruby\">\u003ccode language=\"ruby\" numberOfLines=\"14\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">require\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'net/http'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">require\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'uri'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">charge_id = \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">uri = URI.parse(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api-sandbox.paywithsoap.com/api/v1/charges/#{charge_id}/refund\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">http = Net::HTTP.new(uri.host, uri.port)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">http.use_ssl = \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">true\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">request = Net::HTTP::Post.new(uri.request_uri)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">request[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">] = \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Bearer YOUR_API_KEY'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response = http.request(request)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">puts response.body\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","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=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"21\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> axios = require(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'axios'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> refundCharge = \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">async\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> (chargeId) => {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> try\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response = \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> axios.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> `https://api-sandbox.paywithsoap.com/api/v1/charges/${chargeId}/refund`\u003c/span>\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:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> headers: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Authorization'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Bearer YOUR_API_KEY'\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:#1F2328;--shiki-dark:#D4D4D4\"> );\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> console.log(response.data);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> } \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">catch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> (error) {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> console.error(error);\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\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">refundCharge(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Error (processor declined)","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=\"4\">\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\">\"Refund failed\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"responsetext\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Refund amount may not exceed the transaction balance\"\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":"Error (unknown charge)","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=\"4\">\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\">\"Unable to refund charge.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hint\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Please verify the charge_id is correct. \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\n\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> charge_id: ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK\"\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":[]}}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Refund a charge","description":"Refund a succeeded card deposit in full (NMI and Rapyd)","tags":["Charges"],"security":["caf922c9-4bcb-40b0-a29e-fdfad23ab940"],"parameters":["59a71f55-8518-4674-aa6c-f2cc608fffe2"],"responses":{"200":"573840c5-20bc-400e-b922-064b942d345c","422":"505f4b43-d91c-4c70-8d30-7866c66e3823"},"method":"post","type":"path","servers":["468fc569-84d9-45af-b45a-8a52ff694e75"],"path":"/api/v1/charges/{id}/refund","baseUrlOptions":["https://api-sandbox.paywithsoap.com"],"title":"Refund a charge","codeSamples":[],"requiredOnlyExamples":false,"requestExamples":[{"dropdown":false,"language":"shellscript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"shellscript","children":{"type":"code","key":null,"ref":null,"props":{"language":"shellscript","numberOfLines":"2","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#8250DF","--shiki-dark":"#DCDCAA"},"children":"curl"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" -X POST "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"https://api-sandbox.paywithsoap.com/api/v1/charges/ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK/refund\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" \\"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" -H "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Authorization: Bearer YOUR_API_KEY\""}}]}},"\n"]}}}},"filename":"Curl"},{"dropdown":false,"language":"ruby","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"ruby","children":{"type":"code","key":null,"ref":null,"props":{"language":"ruby","numberOfLines":"14","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"require"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" 'net/http'"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"require"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" 'uri'"}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"charge_id = "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK'"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"uri = URI.parse("}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"https://api-sandbox.paywithsoap.com/api/v1/charges/#{charge_id}/refund\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":")"}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"http = Net::HTTP.new(uri.host, uri.port)"}}}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"http.use_ssl = "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"true"}}]}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"request = Net::HTTP::Post.new(uri.request_uri)"}}}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"request["}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'Authorization'"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"] = "}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'Bearer YOUR_API_KEY'"}}]}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"response = http.request(request)"}}}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"puts response.body"}}}},"\n"]}}}},"filename":"Ruby"},{"dropdown":false,"language":"javascript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"javascript","children":{"type":"code","key":null,"ref":null,"props":{"language":"javascript","numberOfLines":"21","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"const"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" axios = require("}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'axios'"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":");"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"const"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" refundCharge = "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"async"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" (chargeId) => {"}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":" try"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" {"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":" const"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" response = "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"await"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" axios.post("}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" `https://api-sandbox.paywithsoap.com/api/v1/charges/${chargeId}/refund`"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" {},"}}}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" {"}}}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" headers: {"}}}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" 'Authorization'"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'Bearer YOUR_API_KEY'"}}]}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" );"}}}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"28","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" console.log(response.data);"}}}},"\n",{"type":"span","key":"30","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" } "}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#C586C0"},"children":"catch"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" (error) {"}}]}},"\n",{"type":"span","key":"32","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" console.error(error);"}}}},"\n",{"type":"span","key":"34","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"36","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"};"}}}},"\n",{"type":"span","key":"38","ref":null,"props":{"className":"line","children":null}},"\n",{"type":"span","key":"40","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"refundCharge("}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"'ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK'"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":");"}}]}},"\n"]}}}},"filename":"JavaScript"}],"requestExampleType":"mdx","responseExamples":[{"dropdown":false,"language":"json","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"json","children":{"type":"code","key":null,"ref":null,"props":{"language":"json","numberOfLines":"4","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"{"}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"error\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Refund failed\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"responsetext\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Refund amount may not exceed the transaction balance\""}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"}"}}}},"\n"]}}}},"filename":"Error (processor declined)"},{"dropdown":false,"language":"json","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"json","children":{"type":"code","key":null,"ref":null,"props":{"language":"json","numberOfLines":"4","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"{"}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"error\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Unable to refund charge.\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hint\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Please verify the charge_id is correct. "}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":"\\n"}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" charge_id: ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK\""}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"}"}}}},"\n"]}}}},"filename":"Error (unknown charge)"}],"responseExampleType":"mdx"},"dependencies":{"parameters":{"59a71f55-8518-4674-aa6c-f2cc608fffe2":{"name":"id","in":"path","required":true,"description":"Unique identifier of the charge to refund.","schema":{"type":"string","example":"ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","isRequired":true,"description":"Unique identifier of the charge to refund.","uniqueKey":"","typeLabel":"string"}}},"responses":{"573840c5-20bc-400e-b922-064b942d345c":{"description":"The refund succeeded. Returns the charge in the same shape as GET /api/v1/charges/{id}, with status \"refunded\".","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","uniqueKey":"id","typeLabel":"string"},"amount_cents":{"type":"integer","description":"Charge amount in cents.","example":2999,"uniqueKey":"amount_cents","typeLabel":"integer"},"transaction_type":{"type":"string","description":"Direction of the charge: `credit` for deposits (money into the customer balance), `debit` for withdrawals (money out).","enum":["credit","debit"],"example":"debit","uniqueKey":"transaction_type","typeLabel":"enum\u003cstring>"},"currency":{"type":"string","example":"USD","uniqueKey":"currency","typeLabel":"string"},"status":{"type":"string","description":"Current state of the charge. Not every value is reachable on every flow or processor: `held` occurs on withdrawals that place a hold; `voided` and `returned` follow a succeeded charge that the processor later reversed; `cancelled` is processor-specific — a transfer that was accepted (usually `pending`) and then cancelled by the rail, seen on bank-transfer deposits and payouts — and emits the opt-in `checkout.cancelled` event (ask Soap whether your rails emit it); `refunded` is set by a full refund of a succeeded NMI or Rapyd card deposit via POST /api/v1/charges/{id}/refund or the dashboard, and emits the opt-in `checkout.refunded` event. See the charge lifecycle for the full transition map and which webhook each transition emits.","enum":["created","pending","succeeded","failed","held","voided","returned","refunded","cancelled"],"example":"succeeded","uniqueKey":"status","typeLabel":"enum\u003cstring>"},"failure_code":{"oneOf":[{"type":"string","description":"Machine-readable failure code. Always present; null unless the charge failed (a cancelled charge may also carry one).","example":null,"uniqueKey":"failure_code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Machine-readable failure code. Always present; null unless the charge failed (a cancelled charge may also carry one).","example":null,"uniqueKey":"failure_code.oneOf.1","typeLabel":"null"}],"uniqueKey":"failure_code","typeLabel":"string | null"},"failure_message":{"oneOf":[{"type":"string","description":"Human-readable failure reason. Always present; null unless the charge failed (a cancelled charge may also carry one).","example":null,"uniqueKey":"failure_message.oneOf.0","typeLabel":"string"},{"type":"null","description":"Human-readable failure reason. Always present; null unless the charge failed (a cancelled charge may also carry one).","example":null,"uniqueKey":"failure_message.oneOf.1","typeLabel":"null"}],"uniqueKey":"failure_message","typeLabel":"string | null"},"created_at":{"type":"string","format":"date-time","example":"2026-05-31T10:30:00.000Z","uniqueKey":"created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-31T10:30:05.000Z","uniqueKey":"updated_at","typeLabel":"string\u003cdate-time>"},"customer":{"type":"object","properties":{"id":{"type":"string","example":"cus_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","uniqueKey":"customer.id","typeLabel":"string"},"first_name":{"type":"string","example":"Sarah","uniqueKey":"customer.first_name","typeLabel":"string"},"last_name":{"type":"string","example":"Johnson","uniqueKey":"customer.last_name","typeLabel":"string"}},"uniqueKey":"customer","typeLabel":"object"},"payment_method":{"type":"object","description":"Payment method used for the charge. Exactly one of `card`, `bank_account`, or `crypto_wallet` is populated, matching `payment_type`.","properties":{"id":{"type":"string","example":"pm_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","uniqueKey":"payment_method.id","typeLabel":"string"},"payment_type":{"type":"string","enum":["card","bank_account","crypto_wallet"],"example":"card","uniqueKey":"payment_method.payment_type","typeLabel":"enum\u003cstring>"},"created_at":{"type":"string","format":"date-time","example":"2026-05-31T10:30:00.000Z","uniqueKey":"payment_method.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-31T10:30:05.000Z","uniqueKey":"payment_method.updated_at","typeLabel":"string\u003cdate-time>"},"saved":{"type":"boolean","description":"Whether the customer chose to save this payment method for future use.","example":true,"uniqueKey":"payment_method.saved","typeLabel":"boolean"},"fingerprint":{"type":"string","description":"Stable SHA-256 fingerprint of the underlying instrument. Useful for de-duplicating payment methods across charges.","example":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","uniqueKey":"payment_method.fingerprint","typeLabel":"string"},"card":{"oneOf":[{"type":"object","description":"Present when `payment_type` is `card`.","properties":{"last_four":{"type":"string","example":"4242","uniqueKey":"payment_method.card.oneOf.0.last_four","typeLabel":"string"},"card_brand":{"type":"string","example":"visa","uniqueKey":"payment_method.card.oneOf.0.card_brand","typeLabel":"string"},"card_expiration_month":{"type":"integer","example":12,"uniqueKey":"payment_method.card.oneOf.0.card_expiration_month","typeLabel":"integer"},"card_expiration_year":{"type":"integer","example":2027,"uniqueKey":"payment_method.card.oneOf.0.card_expiration_year","typeLabel":"integer"},"card_issuer_country":{"type":"string","example":"US","uniqueKey":"payment_method.card.oneOf.0.card_issuer_country","typeLabel":"string"},"name_on_card":{"type":"string","example":"Sarah Johnson","uniqueKey":"payment_method.card.oneOf.0.name_on_card","typeLabel":"string"},"card_type":{"type":"string","example":"credit","uniqueKey":"payment_method.card.oneOf.0.card_type","typeLabel":"string"},"first_name":{"type":"string","example":"Sarah","uniqueKey":"payment_method.card.oneOf.0.first_name","typeLabel":"string"},"last_name":{"type":"string","example":"Johnson","uniqueKey":"payment_method.card.oneOf.0.last_name","typeLabel":"string"},"zip":{"type":"string","example":"10001","uniqueKey":"payment_method.card.oneOf.0.zip","typeLabel":"string"},"google_pay":{"type":"boolean","example":false,"uniqueKey":"payment_method.card.oneOf.0.google_pay","typeLabel":"boolean"},"apple_pay":{"type":"boolean","example":false,"uniqueKey":"payment_method.card.oneOf.0.apple_pay","typeLabel":"boolean"},"bin":{"type":"string","example":"424242","uniqueKey":"payment_method.card.oneOf.0.bin","typeLabel":"string"}},"uniqueKey":"payment_method.card.oneOf.0","typeLabel":"object"},{"type":"null","description":"Present when `payment_type` is `card`.","properties":{"last_four":{"type":"string","example":"4242"},"card_brand":{"type":"string","example":"visa"},"card_expiration_month":{"type":"integer","example":12},"card_expiration_year":{"type":"integer","example":2027},"card_issuer_country":{"type":"string","example":"US"},"name_on_card":{"type":"string","example":"Sarah Johnson"},"card_type":{"type":"string","example":"credit"},"first_name":{"type":"string","example":"Sarah"},"last_name":{"type":"string","example":"Johnson"},"zip":{"type":"string","example":"10001"},"google_pay":{"type":"boolean","example":false},"apple_pay":{"type":"boolean","example":false},"bin":{"type":"string","example":"424242"}},"uniqueKey":"payment_method.card.oneOf.1","typeLabel":"null"}],"uniqueKey":"payment_method.card","typeLabel":"object | null"},"bank_account":{"oneOf":[{"type":"object","description":"Present when `payment_type` is `bank_account`.","properties":{"last_four":{"type":"string","example":"1234","uniqueKey":"payment_method.bank_account.oneOf.0.last_four","typeLabel":"string"},"bank_brand":{"type":"string","example":"chase","uniqueKey":"payment_method.bank_account.oneOf.0.bank_brand","typeLabel":"string"},"bank_account_type":{"type":"string","example":"checking","uniqueKey":"payment_method.bank_account.oneOf.0.bank_account_type","typeLabel":"string"},"bank_account_name":{"type":"string","example":"Alice Brown","uniqueKey":"payment_method.bank_account.oneOf.0.bank_account_name","typeLabel":"string"},"first_name":{"type":"string","example":"Alice","uniqueKey":"payment_method.bank_account.oneOf.0.first_name","typeLabel":"string"},"last_name":{"type":"string","example":"Brown","uniqueKey":"payment_method.bank_account.oneOf.0.last_name","typeLabel":"string"}},"uniqueKey":"payment_method.bank_account.oneOf.0","typeLabel":"object"},{"type":"null","description":"Present when `payment_type` is `bank_account`.","properties":{"last_four":{"type":"string","example":"1234"},"bank_brand":{"type":"string","example":"chase"},"bank_account_type":{"type":"string","example":"checking"},"bank_account_name":{"type":"string","example":"Alice Brown"},"first_name":{"type":"string","example":"Alice"},"last_name":{"type":"string","example":"Brown"}},"uniqueKey":"payment_method.bank_account.oneOf.1","typeLabel":"null"}],"uniqueKey":"payment_method.bank_account","typeLabel":"object | null"},"crypto_wallet":{"oneOf":[{"type":"object","description":"Present when `payment_type` is `crypto_wallet`.","properties":{"crypto_wallet_address":{"type":"string","example":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5","uniqueKey":"payment_method.crypto_wallet.oneOf.0.crypto_wallet_address","typeLabel":"string"}},"uniqueKey":"payment_method.crypto_wallet.oneOf.0","typeLabel":"object"},{"type":"null","description":"Present when `payment_type` is `crypto_wallet`.","properties":{"crypto_wallet_address":{"type":"string","example":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5"}},"uniqueKey":"payment_method.crypto_wallet.oneOf.1","typeLabel":"null"}],"uniqueKey":"payment_method.crypto_wallet","typeLabel":"object | null"}},"uniqueKey":"payment_method","typeLabel":"object"},"avs_result":{"oneOf":[{"type":"string","description":"Address Verification System result from the processor. Card charges only.","example":null,"uniqueKey":"avs_result.oneOf.0","typeLabel":"string"},{"type":"null","description":"Address Verification System result from the processor. Card charges only.","example":null,"uniqueKey":"avs_result.oneOf.1","typeLabel":"null"}],"uniqueKey":"avs_result","typeLabel":"string | null"},"cvv_result":{"oneOf":[{"type":"string","description":"CVV verification result from the processor. Card charges only.","example":null,"uniqueKey":"cvv_result.oneOf.0","typeLabel":"string"},{"type":"null","description":"CVV verification result from the processor. Card charges only.","example":null,"uniqueKey":"cvv_result.oneOf.1","typeLabel":"null"}],"uniqueKey":"cvv_result","typeLabel":"string | null"},"network_authorization_code":{"oneOf":[{"type":"string","description":"Authorization code returned by the card network. Card charges only.","example":null,"uniqueKey":"network_authorization_code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Authorization code returned by the card network. Card charges only.","example":null,"uniqueKey":"network_authorization_code.oneOf.1","typeLabel":"null"}],"uniqueKey":"network_authorization_code","typeLabel":"string | null"},"processor_charge_id":{"oneOf":[{"type":"string","description":"External processor's identifier for this charge. Card charges only.","example":null,"uniqueKey":"processor_charge_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"External processor's identifier for this charge. Card charges only.","example":null,"uniqueKey":"processor_charge_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"processor_charge_id","typeLabel":"string | null"},"threeds":{"oneOf":[{"type":"object","description":"3D Secure verification details. Card charges only: present as an object when 3DS was performed and as `null` otherwise. Absent on bank and crypto charges.","properties":{"eci":{"type":"string","example":"05","uniqueKey":"threeds.oneOf.0.eci","typeLabel":"string"},"version":{"type":"string","example":"2.2.0","uniqueKey":"threeds.oneOf.0.version","typeLabel":"string"},"liability_shifted":{"type":"boolean","example":true,"uniqueKey":"threeds.oneOf.0.liability_shifted","typeLabel":"boolean"},"failure_reason":{"oneOf":[{"type":"string","example":null,"uniqueKey":"threeds.oneOf.0.failure_reason.oneOf.0","typeLabel":"string"},{"type":"null","example":null,"uniqueKey":"threeds.oneOf.0.failure_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"threeds.oneOf.0.failure_reason","typeLabel":"string | null"},"status":{"oneOf":[{"type":"string","example":"success","description":"Status of the 3DS session as reported by the 3DS provider.","uniqueKey":"threeds.oneOf.0.status.oneOf.0","typeLabel":"string"},{"type":"null","example":"success","description":"Status of the 3DS session as reported by the 3DS provider.","uniqueKey":"threeds.oneOf.0.status.oneOf.1","typeLabel":"null"}],"uniqueKey":"threeds.oneOf.0.status","typeLabel":"string | null"}},"uniqueKey":"threeds.oneOf.0","typeLabel":"object"},{"type":"null","description":"3D Secure verification details. Card charges only: present as an object when 3DS was performed and as `null` otherwise. Absent on bank and crypto charges.","properties":{"eci":{"type":"string","example":"05"},"version":{"type":"string","example":"2.2.0"},"liability_shifted":{"type":"boolean","example":true},"failure_reason":{"oneOf":[{"type":"string","example":null},{"type":"null","example":null}]},"status":{"oneOf":[{"type":"string","example":"success","description":"Status of the 3DS session as reported by the 3DS provider."},{"type":"null","example":"success","description":"Status of the 3DS session as reported by the 3DS provider."}]}},"uniqueKey":"threeds.oneOf.1","typeLabel":"null"}],"uniqueKey":"threeds","typeLabel":"object | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"ch_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","amount_cents":2999,"transaction_type":"debit","currency":"USD","status":"succeeded","failure_code":null,"failure_message":null,"created_at":"2026-05-31T10:30:00.000Z","updated_at":"2026-05-31T10:30:05.000Z","customer":{"id":"cus_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","first_name":"Sarah","last_name":"Johnson"},"payment_method":{"id":"pm_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK","payment_type":"card","created_at":"2026-05-31T10:30:00.000Z","updated_at":"2026-05-31T10:30:05.000Z","saved":true,"fingerprint":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","card":{"last_four":"4242","card_brand":"visa","card_expiration_month":12,"card_expiration_year":2027,"card_issuer_country":"US","name_on_card":"Sarah Johnson","card_type":"credit","first_name":"Sarah","last_name":"Johnson","zip":"10001","google_pay":false,"apple_pay":false,"bin":"424242"},"bank_account":{"last_four":"1234","bank_brand":"chase","bank_account_type":"checking","bank_account_name":"Alice Brown","first_name":"Alice","last_name":"Brown"},"crypto_wallet":{"crypto_wallet_address":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb5"}},"avs_result":null,"cvv_result":null,"network_authorization_code":null,"processor_charge_id":null,"threeds":{"eci":"05","version":"2.2.0","liability_shifted":true,"failure_reason":null,"status":"success"}}}},"exampleType":"generated"}},"exampleType":"generated"},"505f4b43-d91c-4c70-8d30-7866c66e3823":{"description":"The refund could not be processed — unknown charge or wrong merchant (opaque error), charge not refundable (not a succeeded card deposit on NMI or Rapyd, or already refunded), or the processor declined the refund.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Refund failed","description":"Fixed strings include \"Refund failed\" (processor decline), \"Only credit charges can be refunded.\" (payout charge), \"We cannot refund this transaction through this processor at the moment.\" (unsupported processor) and \"Unable to refund charge.\" (unknown charge or wrong merchant).","uniqueKey":"error","typeLabel":"string"},"responsetext":{"type":"string","description":"The processor's decline reason, when the gateway rejected the refund.","example":"Refund amount may not exceed the transaction balance","uniqueKey":"responsetext","typeLabel":"string"},"hint":{"type":"string","description":"Present on lookup/ownership failures.","uniqueKey":"hint","typeLabel":"string"}},"additionalProperties":true,"description":"For NMI declines the processor's full response body is merged into this object, so additional gateway fields may appear alongside `error` and `responsetext`.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"Refund failed","responsetext":"Refund amount may not exceed the transaction balance","hint":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"caf922c9-4bcb-40b0-a29e-fdfad23ab940":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication using your API key (key_...). Used for every endpoint except POST /api/v1/device_pings.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"468fc569-84d9-45af-b45a-8a52ff694e75":{"url":"https://api-sandbox.paywithsoap.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Bearer token authentication using your API key (key_...). Used for every endpoint except POST /api/v1/device_pings.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer token authentication using your API key (key_...). Used for every endpoint except POST /api/v1/device_pings.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"soappaymentsinc","siteName":"Soap","title":"Refund a Charge - Soap","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-26T13:54:10.293Z","originalFileLocation":"api-reference/api-v1/charges/refund.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=\"Refund a succeeded card deposit in full (NMI and Rapyd)\">\u003cmeta data-mint-head name=\"application-name\" content=\"Soap\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_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/soappaymentsinc/uwmep72Fim3-ANhF/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Refund a Charge - Soap\">\u003cmeta data-mint-head property=\"og:description\" content=\"Refund a succeeded card deposit in full (NMI and Rapyd)\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Soap\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://soappaymentsinc.mintlify.site/_mintlify/api/og/v2?division=API+Endpoints\u0026amp;title=Refund+a+Charge\u0026amp;description=Refund+a+succeeded+card+deposit+in+full+%28NMI+and+Rapyd%29\u0026amp;theme=8f5505fbb6d7285f5c0028dd\u0026amp;signature=275d42d6911553e90af26ce851338cb8f4e6c00d8d85c30d6b853ebf4d237908\">\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=\"Refund a Charge - Soap\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Refund a succeeded card deposit in full (NMI and Rapyd)\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://soappaymentsinc.mintlify.site/_mintlify/api/og/v2?division=API+Endpoints\u0026amp;title=Refund+a+Charge\u0026amp;description=Refund+a+succeeded+card+deposit+in+full+%28NMI+and+Rapyd%29\u0026amp;theme=8f5505fbb6d7285f5c0028dd\u0026amp;signature=275d42d6911553e90af26ce851338cb8f4e6c00d8d85c30d6b853ebf4d237908\">\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/soappaymentsinc/uwmep72Fim3-ANhF/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Soap\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4B9EF4\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/api-v1/charges/refund.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.paywithsoap.com/#organization\",\"name\":\"Soap\",\"url\":\"https://docs.paywithsoap.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/soappaymentsinc/xLCEKqTin27F3B_G/logo/soap-payments-light-large.png?fit=max\u0026auto=format\u0026n=xLCEKqTin27F3B_G\u0026q=85\u0026s=80edefa85946042d6b589971385d221a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.paywithsoap.com#website\",\"name\":\"Soap\",\"url\":\"https://docs.paywithsoap.com\",\"publisher\":{\"@id\":\"https://docs.paywithsoap.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund#webpage\",\"url\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund\",\"name\":\"Refund a Charge\",\"description\":\"Refund a succeeded card deposit in full (NMI and Rapyd)\",\"dateModified\":\"2026-09-26T13:54:10.293Z\",\"isPartOf\":{\"@id\":\"https://docs.paywithsoap.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Endpoints\",\"item\":\"https://docs.paywithsoap.com/api-reference/api-v1/customers/create\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Refund a Charge\",\"item\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund#apireference\",\"headline\":\"Refund a Charge\",\"name\":\"Refund a Charge\",\"description\":\"Refund a succeeded card deposit in full (NMI and Rapyd)\",\"url\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund\",\"mainEntityOfPage\":{\"@id\":\"https://docs.paywithsoap.com/api-reference/api-v1/charges/refund#webpage\"},\"dateModified\":\"2026-09-26T13:54:10.293Z\",\"publisher\":{\"@id\":\"https://docs.paywithsoap.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.paywithsoap.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Soap\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Soap\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/api-v1/charges/refund.md","siteName":"Soap","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/get_started/introduction"}]},{"anchor":"API Reference","icon":"rectangle-terminal","groups":[{"group":"API Documentation","pages":[{"title":"API Introduction","href":"/api-reference/introduction"},{"title":"Checkouts, Charges and Reviews","href":"/api-reference/lifecycles"},{"title":"Soap Docs MCP Server","href":"/api-reference/soap-mcp-server"}]},{"group":"API Endpoints","pages":[{"title":"Create Customer","openapi":"POST /api/v1/customers","href":"/api-reference/api-v1/customers/create"},{"title":"Update Customer","openapi":"PATCH /api/v1/customers/{id}","href":"/api-reference/api-v1/customers/update"},{"title":"Search Customers","openapi":"GET /api/v1/customers/search","href":"/api-reference/api-v1/customers/search"},{"group":"Checkouts","pages":[{"title":"Create Checkout","openapi":"POST /api/v1/checkouts","href":"/api-reference/api-v1/checkouts/create"},{"group":"Receive Payments","pages":[{"title":"DraftKings Style Deposit","href":"/api-reference/api-v1/checkouts/draftkings-deposit"},{"title":"Preset Amount Deposit","href":"/api-reference/api-v1/checkouts/preset-deposit"},{"title":"Subscription Checkout","href":"/api-reference/api-v1/checkouts/subscription-checkout"},{"title":"Digital Goods Purchase","href":"/api-reference/api-v1/checkouts/sweeps-purchase"},{"title":"Ecomm Purchase","href":"/api-reference/api-v1/checkouts/ecomm-purchase"}]},{"group":"Send Payments","pages":[{"title":"Balance Withdrawal","href":"/api-reference/api-v1/checkouts/balance-withdrawal"},{"title":"Preset Amount Withdrawal","href":"/api-reference/api-v1/checkouts/preset-withdrawal"}]}]},{"title":"Retrieve a Charge","openapi":"GET /api/v1/charges/{id}","description":"Fetch a single charge by ID, including the customer and payment method used","href":"/api-reference/api-v1/charges/show"},{"title":"Refund a Charge","openapi":"POST /api/v1/charges/{id}/refund","href":"/api-reference/api-v1/charges/refund"},{"title":"Upsert KYC","openapi":"POST /api/v1/kyc/upsert","description":"Submits a KYC identity record for a customer","href":"/api-reference/api-v1/kyc/upsert"},{"title":"Create Device Ping","openapi":"POST /api/v1/device_pings","href":"/api-reference/api-v1/device_pings/create"},{"title":"Get Latest Geo Check","openapi":"GET /api/v1/device_pings/latest_geo_check","href":"/api-reference/api-v1/device_pings/latest_geo_check"}]},{"group":"Webhooks","pages":[{"title":"Webhooks Overview","href":"/api-reference/api-v1/webhooks/webhooks"},{"title":"Receiving Webhooks","href":"/api-reference/api-v1/webhooks/setup"},{"title":"checkout.succeeded","href":"/api-reference/api-v1/webhooks/checkout-succeeded"},{"title":"checkout.hold","href":"/api-reference/api-v1/webhooks/checkout-hold"},{"title":"checkout.release_hold","href":"/api-reference/api-v1/webhooks/checkout-release-hold"},{"title":"checkout.returned","href":"/api-reference/api-v1/webhooks/checkout-returned"},{"title":"checkout.failed","href":"/api-reference/api-v1/webhooks/checkout-failed"},{"title":"checkout.pending","href":"/api-reference/api-v1/webhooks/checkout-pending"},{"title":"checkout.terminally_failed","href":"/api-reference/api-v1/webhooks/checkout-terminally-failed"},{"title":"checkout.expired","href":"/api-reference/api-v1/webhooks/checkout-expired"},{"title":"checkout.voided","href":"/api-reference/api-v1/webhooks/checkout-voided"},{"title":"checkout.refunded","href":"/api-reference/api-v1/webhooks/checkout-refunded"},{"title":"checkout.cancelled","href":"/api-reference/api-v1/webhooks/checkout-cancelled"},{"title":"checkout.review.created","href":"/api-reference/api-v1/webhooks/checkout-review-created"},{"title":"checkout.review.approved","href":"/api-reference/api-v1/webhooks/checkout-review-approved"},{"title":"checkout.review.declined","href":"/api-reference/api-v1/webhooks/checkout-review-declined"},{"title":"customer.kyc.created","href":"/api-reference/api-v1/webhooks/customer-kyc-created"},{"title":"customer.restricted","href":"/api-reference/api-v1/webhooks/customer-restricted"},{"title":"customer.unrestricted","href":"/api-reference/api-v1/webhooks/customer-unrestricted"}]},{"group":"Testing","pages":[{"title":"Sandbox Test Data","href":"/api-reference/api-v1/testing"}]}]},{"anchor":"Changelog","icon":"clock-rotate-left","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Refund a Charge - Soap","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js","Markdown-D13FWkIM.js","clsx-D3Isdib3.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-C-XZBk9h.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink--qIqmmVG.js"]}