Cancels a transaction that the customer has not paid yet.SayaBeliPay cancels the payment with the payment processor first, so the customer’s checkout page stops accepting payment, and only then marks the transaction Cancelled. If the customer has already paid, or is paying at that moment, nothing is cancelled and you get a 409 response instead (see below).
Request
curl -X POST https://sayabelipay.com/api/transaction/9B8FEEB60F9E3/cancel \ -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET"
Path parameter
Notes
ref
The transaction_id of a transaction currently in Pending status.
The customer has already paid, or their bank is still processing the payment. Nothing was cancelled.
Don’t cancel the order. Check the status again shortly: it will become Success (or fail on its own).
502
The payment processor could not be reached. Nothing was cancelled.
Safe to retry the same request.
Not eligible: 404
{ "success": false, "message": "Pending transaction not found" }
Already paid: 409
{ "success": false, "message": "This payment has already been completed by the customer and cannot be cancelled." }
Payment in progress: 409
{ "success": false, "message": "The customer is completing this payment right now. Please check its status again shortly." }
Processor unreachable: 502
{ "success": false, "message": "Could not reach the payment provider to cancel this payment. Please try again." }
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SayaBeliPay","colors":{"primary":"#5b21b6","light":"#8b5cf6","dark":"#4c1d95"},"logo":{"light":"https://mintcdn.com/the-strategic-people/pe-wot_0iIj4nIIW/logo/light.png?fit=max\u0026auto=format\u0026n=pe-wot_0iIj4nIIW\u0026q=85\u0026s=4781857161a9ae468282a9d237259c2f","dark":"https://mintcdn.com/the-strategic-people/pe-wot_0iIj4nIIW/logo/dark.png?fit=max\u0026auto=format\u0026n=pe-wot_0iIj4nIIW\u0026q=85\u0026s=0f2a2060c8de001ad98e284f0b5cde54"},"favicon":"https://mintcdn.com/the-strategic-people/O_AkguIFJm8j5Cc-/favicon.svg?fit=max\u0026auto=format\u0026n=O_AkguIFJm8j5Cc-\u0026q=85\u0026s=37f8f2cf503f6ee1ec98e11da31e7efe","styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"the-strategic-people","hasAudioNarration":false,"actualSubdomain":"the-strategic-people","customDomains":["docs.sayabelipay.com"],"gitSource":{"type":"github","owner":"fullerfort","repo":"docs-sayabelipay","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6b1100809ffae5051c41dab2"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6af170b8d9bd2366654f9863","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"Documentation","count":13},{"language":"default","tag":"API Reference","count":7},{"language":"default","tag":"Guides","count":4},{"language":"default","tag":"Overview","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/cancel-transaction","slug":"/api-reference/cancel-transaction","pageMetadata":{"title":"Cancel a Pending Transaction","description":"POST /api/transaction/{ref}/cancel","href":"/api-reference/cancel-transaction"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"POST /api/transaction/\", \"/cancel\"]\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`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Cancels a transaction that the customer has not paid yet.`}),`\n`,_jsxs(_components.p,{children:[`SayaBeliPay cancels the payment with the payment processor first, so the customer’s checkout page stops accepting payment, and only then marks the transaction `,_jsx(_components.code,{children:`Cancelled`}),`. If the customer has already paid, or is paying at that moment, nothing is cancelled and you get a `,_jsx(_components.code,{children:`409`}),` response instead (see below).`]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(CodeBlock,{filename:``,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:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://sayabelipay.com/api/transaction/9B8FEEB60F9E3/cancel`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -u`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"YOUR_CLIENT_ID:YOUR_CLIENT_SECRET\"`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Path parameter`}),_jsx(_components.th,{children:`Notes`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ref`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`transaction_id`}),` of a transaction currently in `,_jsx(_components.code,{children:`Pending`}),` status.`]})]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"transaction_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"9B8FEEB60F9E3\"`}),_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:` \"order_no\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ORDER-1234\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Cancelled\"`}),_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:` \"...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`Cancelled`}),` transaction is final. The customer can no longer pay it.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP status`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsxs(_components.td,{children:[`The transaction is not `,_jsx(_components.code,{children:`Pending`}),` (already `,_jsx(_components.code,{children:`Success`}),`, `,_jsx(_components.code,{children:`Cancelled`}),`, or another final state), or it doesn’t exist.`]}),_jsxs(_components.td,{children:[`Nothing to cancel. Check its status with `,_jsx(_components.a,{href:`/api-reference/transaction-details`,children:`Transaction Details`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`409`})}),_jsx(_components.td,{children:`The customer has already paid, or their bank is still processing the payment. Nothing was cancelled.`}),_jsxs(_components.td,{children:[`Don’t cancel the order. Check the status again shortly: it will become `,_jsx(_components.code,{children:`Success`}),` (or fail on its own).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`502`})}),_jsx(_components.td,{children:`The payment processor could not be reached. Nothing was cancelled.`}),_jsx(_components.td,{children:`Safe to retry the same request.`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`not-eligible-404`,children:[`Not eligible: `,_jsx(_components.code,{children:`404`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Pending transaction not found\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`3`,id:`already-paid-409`,children:[`Already paid: `,_jsx(_components.code,{children:`409`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"This payment has already been completed by the customer and cannot be cancelled.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`3`,id:`payment-in-progress-409`,children:[`Payment in progress: `,_jsx(_components.code,{children:`409`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The customer is completing this payment right now. Please check its status again shortly.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`3`,id:`processor-unreachable-502`,children:[`Processor unreachable: `,_jsx(_components.code,{children:`502`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Could not reach the payment provider to cancel this payment. Please try again.\"`}),_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":"Cancel a Pending Transaction","description":"POST /api/transaction/{ref}/cancel","href":"/api-reference/cancel-transaction"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request","slug":"request","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[{"title":"Not eligible: 404","slug":"not-eligible-404","depth":3,"children":[]},{"title":"Already paid: 409","slug":"already-paid-409","depth":3,"children":[]},{"title":"Payment in progress: 409","slug":"payment-in-progress-409","depth":3,"children":[]},{"title":"Processor unreachable: 502","slug":"processor-unreachable-502","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"the-strategic-people","siteName":"SayaBeliPay","title":"Cancel a Pending Transaction - SayaBeliPay","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-09T06:38:12.470Z","originalFileLocation":"api-reference/cancel-transaction.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=\"POST /api/transaction/{ref}/cancel\">\u003cmeta data-mint-head name=\"application-name\" content=\"SayaBeliPay\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_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/the-strategic-people/_7xq4q-mzy-FFfXN/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cancel a Pending Transaction - SayaBeliPay\">\u003cmeta data-mint-head property=\"og:description\" content=\"POST /api/transaction/{ref}/cancel\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SayaBeliPay\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sayabelipay.com/api-reference/cancel-transaction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://the-strategic-people.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Cancel+a+Pending+Transaction\u0026amp;description=POST+%2Fapi%2Ftransaction%2F%7Bref%7D%2Fcancel\u0026amp;theme=5c785fb81ee0d62108d1c6ed\u0026amp;signature=e805a8cb3ec800025d2f4b00bb20b9bacb3bed5f0f03afe00ce6e8fc2218026e\">\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=\"Cancel a Pending Transaction - SayaBeliPay\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"POST /api/transaction/{ref}/cancel\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://the-strategic-people.mintlify.site/_mintlify/api/og/v2?division=API+Reference\u0026amp;title=Cancel+a+Pending+Transaction\u0026amp;description=POST+%2Fapi%2Ftransaction%2F%7Bref%7D%2Fcancel\u0026amp;theme=5c785fb81ee0d62108d1c6ed\u0026amp;signature=e805a8cb3ec800025d2f4b00bb20b9bacb3bed5f0f03afe00ce6e8fc2218026e\">\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/the-strategic-people/_7xq4q-mzy-FFfXN/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SayaBeliPay\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5b21b6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sayabelipay.com/api-reference/cancel-transaction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/cancel-transaction.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sayabelipay.com/#organization\",\"name\":\"SayaBeliPay\",\"url\":\"https://docs.sayabelipay.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/the-strategic-people/pe-wot_0iIj4nIIW/logo/light.png?fit=max\u0026auto=format\u0026n=pe-wot_0iIj4nIIW\u0026q=85\u0026s=4781857161a9ae468282a9d237259c2f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sayabelipay.com#website\",\"name\":\"SayaBeliPay\",\"url\":\"https://docs.sayabelipay.com\",\"publisher\":{\"@id\":\"https://docs.sayabelipay.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction#webpage\",\"url\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction\",\"name\":\"Cancel a Pending Transaction\",\"description\":\"POST /api/transaction/{ref}/cancel\",\"dateModified\":\"2026-11-09T06:38:12.470Z\",\"isPartOf\":{\"@id\":\"https://docs.sayabelipay.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://docs.sayabelipay.com/api-reference/create-payment\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cancel a Pending Transaction\",\"item\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction#article\",\"headline\":\"Cancel a Pending Transaction\",\"name\":\"Cancel a Pending Transaction\",\"description\":\"POST /api/transaction/{ref}/cancel\",\"url\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sayabelipay.com/api-reference/cancel-transaction#webpage\"},\"dateModified\":\"2026-11-09T06:38:12.470Z\",\"publisher\":{\"@id\":\"https://docs.sayabelipay.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sayabelipay.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SayaBeliPay\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"SayaBeliPay\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/cancel-transaction.md","siteName":"SayaBeliPay","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":""},{"title":"Getting Started","href":"/getting-started"}]},{"group":"Guides","pages":[{"title":"Hash Generation","href":"/guides/hash-generation"},{"title":"Payment Channels","href":"/guides/payment-channels"},{"title":"DuitNow QR Generation","href":"/guides/duitnow-qr-own-page"},{"title":"Getting Payment Status","href":"/guides/payment-status"}]},{"group":"API Reference","pages":[{"title":"Create a Payment","href":"/api-reference/create-payment"},{"title":"Payment Methods Available","href":"/api-reference/fpx-bank-list"},{"title":"List Transactions","href":"/api-reference/list-transactions"},{"title":"Transaction Details","description":"GET /api/transaction/{ref}","href":"/api-reference/transaction-details"},{"title":"Cancel a Pending Transaction","href":"/api-reference/cancel-transaction"},{"title":"Refund a Payment","description":"POST /api/refund","href":"/api-reference/refund"},{"title":"Not Currently Available","href":"/api-reference/not-available"}]}]}]},"basePath":"","title":"Cancel a Pending Transaction - SayaBeliPay","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":[],"chunks":[]}