{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml","api-docs-apis/openapi.yaml":"api-docs-apis/openapi.yaml"},"props":{"metadata":{"markdoc":{"tagList":["replay-openapi","openapi-response-sample"]},"type":"markdown"},"seo":{"title":"Reefpay Docs","description":"Reefpay is the groundbreaking payment gateway that lets you integrate with the future of payments."},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"cancel-void-and-refund","__idx":0},"children":["Cancel, void, and refund"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both operations go to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/transactions/{id}/cancel"]},". The body decides which"," ","one you get."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Void"},"children":["Void"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Refund"},"children":["Refund"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use it when"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The transaction has not settled"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The transaction has settled"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Body"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"type\": \"VOID\"}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"type\": \"REFUND\", \"amount\": …}"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Always the full original"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Full or partial"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The cardholder sees"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Usually nothing, or a hold disappearing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A credit on their statement"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Settles"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Never. The transaction leaves the batch"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["As a separate credit"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Void when you can, refund when you must."]}," A void removes the transaction"," ","before it ever reaches the cardholder's statement, which means no charge and no"," ","credit to explain. A refund is two visible entries and takes days to reach them."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"which-one-applies","__idx":1},"children":["Which one applies"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Read ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["is_settled"]}," on the transaction."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," — it has not settled. Void it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," — it has settled. Refund it."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sending a void for a settled transaction fails, and sending a refund for an"," ","unsettled one is not the operation you want. When in doubt, read the transaction"," ","first with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/transactions/{id}"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"void","__idx":2},"children":["Void"]},{"$$mdtype":"Tag","name":"ReplayOpenApi","attributes":{"descriptionFile":"api-docs-apis/openapi.yaml","operationId":"cancelTransaction","exampleKey":"voidTransaction","parameters":{},"options":{},"environments":{}},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A void takes only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]},". There is no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}," field, because a void is always"," ","for the full original amount — you cannot void part of a transaction."]},{"$$mdtype":"Tag","name":"OpenApiResponseSample","attributes":{"descriptionFile":"api-docs-apis/openapi.yaml","operationId":"cancelTransaction","exampleKey":"voidTransaction","responseSamplesResolved":[{"lang":"json","title":"200 application/json","source":"{\n  \"id\": \"TRANSACTION-01KEW38F2RT6N4Z1AJGV5MPQ82\",\n  \"reference_transaction_id\": \"TRANSACTION-01KEW32V6YNV11T33XGDR7TGWC\",\n  \"type\": \"CANCEL\",\n  \"result\": \"APPROVED\",\n  \"client_id\": \"CLIENT-01KFDKXMQ637EKEAY410MSQSXB\",\n  \"client_dba\": \"Acme Jewelry\",\n  \"integrations\": [\n    \"TSYS\"\n  ],\n  \"response_code\": \"00\",\n  \"response_description\": \"Approved\",\n  \"batch_id\": \"BATCH-01KEW32V6YNV11T33XGDR7TGWC\",\n  \"is_settled\": false,\n  \"time_created\": \"2026-07-15T17:30:44Z\",\n  \"amount\": 10000,\n  \"tip\": 0,\n  \"currency\": \"USD\",\n  \"payment_method\": {\n    \"type\": \"CARD\",\n    \"truncated_pan\": \"****-****-****-5439\",\n    \"payment_token\": \"PAYMENT_TOKEN-01KFDKXMQ637EKEAY410MSQSXB\",\n    \"expiry\": null,\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"entry_method\": \"keyed\",\n    \"auth_code\": \"123456\",\n    \"retrieval_reference_number\": \"000000603076\",\n    \"card_type\": \"UNKNOWN\",\n    \"card_brand\": \"Visa\",\n    \"cvv_result_code\": null\n  },\n  \"initiator\": \"CUSTOMER\",\n  \"network_transaction_id\": \"MCC1234567890\",\n  \"metadata\": {\n    \"order_id\": \"ORD-10432\",\n    \"sales_channel\": \"web\",\n    \"customer_reference\": \"cust-8891\"\n  }\n}"},{"lang":"json","title":"400 application/json","source":"{\n  \"error_code\": \"INVALID_REQUEST_DATA\",\n  \"error_message\": \"The API request contains invalid data.\",\n  \"details\": {\n    \"amount\": \"Invalid amount\",\n    \"payment_method.pan\": \"Malformed PAN\"\n  },\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"13\",\n    \"message\": \"Invalid amount\"\n  }\n}"},{"lang":"json","title":"401 application/json","source":"{\n  \"error_code\": \"NOT_AUTHENTICATED\",\n  \"error_message\": \"Access credentials missing or invalid.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"403 application/json","source":"{\n  \"error_code\": \"UNAUTHORIZED_ACTION\",\n  \"error_message\": \"Requested action is unavailable or forbidden.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"404 application/json","source":"{\n  \"error_code\": \"RESOURCE_NOT_FOUND\",\n  \"error_message\": \"Resource not found.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"409 application/json","source":"{\n  \"error_code\": \"DUPLICATE_ACTION\",\n  \"error_message\": \"Duplicate action requested.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"12\",\n    \"message\": \"Invalid transaction\"\n  }\n}"},{"lang":"json","title":"500 application/json","source":"{\n  \"error_code\": \"SYSTEM_ERROR\",\n  \"error_message\": \"Internal system error.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"96\",\n    \"message\": \"System malfunction\"\n  }\n}"},{"lang":"json","title":"502 application/json","source":"{\n  \"error_code\": \"DOWNSTREAM_ERROR\",\n  \"error_message\": \"Downstream service returned invalid or unexpected response.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"VERICHECK\",\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The result is a new transaction with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CANCEL"]}]},". Note the word: you"," ","send ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VOID"]}," and you read ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CANCEL"]},". Its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reference_transaction_id"]}," points at the"," ","transaction it voided."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"refund","__idx":3},"children":["Refund"]},{"$$mdtype":"Tag","name":"ReplayOpenApi","attributes":{"descriptionFile":"api-docs-apis/openapi.yaml","operationId":"cancelTransaction","exampleKey":"refundTransaction","parameters":{},"options":{},"environments":{}},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}," is required, and it may be less than the original — that example refunds"," ","25.00 of a 100.00 sale. It may not be more."]},{"$$mdtype":"Tag","name":"OpenApiResponseSample","attributes":{"descriptionFile":"api-docs-apis/openapi.yaml","operationId":"cancelTransaction","exampleKey":"refundTransaction","responseSamplesResolved":[{"lang":"json","title":"200 application/json","source":"{\n  \"id\": \"TRANSACTION-01KEW3B7XKC9P5W2DMHY6NRS13\",\n  \"reference_transaction_id\": \"TRANSACTION-01KEW32V6YNV11T33XGDR7TGWC\",\n  \"type\": \"REFUND\",\n  \"result\": \"APPROVED\",\n  \"client_id\": \"CLIENT-01KFDKXMQ637EKEAY410MSQSXB\",\n  \"client_dba\": \"Acme Jewelry\",\n  \"integrations\": [\n    \"TSYS\"\n  ],\n  \"response_code\": \"00\",\n  \"response_description\": \"Approved\",\n  \"batch_id\": null,\n  \"is_settled\": false,\n  \"time_created\": \"2026-07-16T10:12:58Z\",\n  \"amount\": 2500,\n  \"tip\": 0,\n  \"currency\": \"USD\",\n  \"payment_method\": {\n    \"type\": \"CARD\",\n    \"truncated_pan\": \"****-****-****-5439\",\n    \"payment_token\": \"PAYMENT_TOKEN-01KFDKXMQ637EKEAY410MSQSXB\",\n    \"expiry\": null,\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"entry_method\": \"keyed\",\n    \"auth_code\": \"123456\",\n    \"retrieval_reference_number\": \"000000603076\",\n    \"card_type\": \"UNKNOWN\",\n    \"card_brand\": \"Visa\",\n    \"cvv_result_code\": null\n  },\n  \"initiator\": \"CUSTOMER\",\n  \"network_transaction_id\": \"MCC1234567890\",\n  \"metadata\": {\n    \"order_id\": \"ORD-10432\",\n    \"sales_channel\": \"web\",\n    \"customer_reference\": \"cust-8891\"\n  }\n}"},{"lang":"json","title":"400 application/json","source":"{\n  \"error_code\": \"INVALID_REQUEST_DATA\",\n  \"error_message\": \"The API request contains invalid data.\",\n  \"details\": {\n    \"amount\": \"Invalid amount\",\n    \"payment_method.pan\": \"Malformed PAN\"\n  },\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"13\",\n    \"message\": \"Invalid amount\"\n  }\n}"},{"lang":"json","title":"401 application/json","source":"{\n  \"error_code\": \"NOT_AUTHENTICATED\",\n  \"error_message\": \"Access credentials missing or invalid.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"403 application/json","source":"{\n  \"error_code\": \"UNAUTHORIZED_ACTION\",\n  \"error_message\": \"Requested action is unavailable or forbidden.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"404 application/json","source":"{\n  \"error_code\": \"RESOURCE_NOT_FOUND\",\n  \"error_message\": \"Resource not found.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"409 application/json","source":"{\n  \"error_code\": \"DUPLICATE_ACTION\",\n  \"error_message\": \"Duplicate action requested.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"12\",\n    \"message\": \"Invalid transaction\"\n  }\n}"},{"lang":"json","title":"500 application/json","source":"{\n  \"error_code\": \"SYSTEM_ERROR\",\n  \"error_message\": \"Internal system error.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"96\",\n    \"message\": \"System malfunction\"\n  }\n}"},{"lang":"json","title":"502 application/json","source":"{\n  \"error_code\": \"DOWNSTREAM_ERROR\",\n  \"error_message\": \"Downstream service returned invalid or unexpected response.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"VERICHECK\",\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A refund is its own transaction with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND"]},", and it settles in a"," ","batch like any other. The money reaches the cardholder when that batch settles,"," ","not when you make the call."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"partial-refunds","__idx":4},"children":["Partial refunds"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Send the amount you are returning. To refund in several parts, call the endpoint"," ","again with the next amount; each call is a separate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND"]}," transaction against"," ","the same original."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The gateway does not stop you from refunding more in total than the original"," ","transaction, so ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["track the running total yourself"]}," if you issue partial"," ","refunds. Reading the original back and summing the refunds that reference it is"," ","the reliable way to do that."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"releasing-an-authorization","__idx":5},"children":["Releasing an authorization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An authorization you never capture is a hold on someone's funds. Void it rather"," ","than leaving it to expire — the issuer decides when that happens, and it is"," ","usually days."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/payments/authorize-and-capture"},"children":["Authorize and capture"]}," covers the flow"," ","that leads here."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":6},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/after-the-payment/transaction-lifecycle"},"children":["Transaction lifecycle"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/after-the-payment/batches-and-settlement"},"children":["Batches and settlement"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/after-the-payment/find-and-report-on-transactions"},"children":["Find and report on transactions"]}]}]}]},"headings":[{"value":"Cancel, void, and refund","id":"cancel-void-and-refund","depth":1},{"value":"Which one applies","id":"which-one-applies","depth":2},{"value":"Void","id":"void","depth":2},{"value":"Refund","id":"refund","depth":2},{"value":"Partial refunds","id":"partial-refunds","depth":2},{"value":"Releasing an authorization","id":"releasing-an-authorization","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Cancel, void, and refund","shortTitle":"Cancel and refund","intro":"Returning money uses one endpoint and two request shapes. Which one applies depends entirely on whether the transaction has settled.","type":"how-to","seo":{"title":""}},"lastModified":"2026-09-17T09:08:13.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/after-the-payment/cancel-void-and-refund","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}