Skip to main content

Cancel Transaction

POST/v3/payment/reverse

What is this?

Cancel or reverse a transaction. Use this to void a payment before settlement, or to request a refund for a completed transaction.

Reverse cancels a transaction — used mainly to prevent double charges when a timeout occurs.

Refund returns funds to the customer — based on the payment provider's policy and time limits.


How to Use

Step 1: Decide Between Reverse or Refund

  • Reverse — use within ~15 minutes of a transaction to cancel it. Prevents double charges caused by timeouts.
  • Refund — use to return funds for a completed transaction. Subject to the payment provider's refund period.

Step 2: For Reverse — Get the Order ID

Locate the orderId from the original transaction response.

Step 3: For Refund — Get the Transaction ID

Locate the transactionId and prepare the refund amount and reason.

Step 4: Make the Request

Send the appropriate request. Check the code field in the response — if "SUCCESS", the operation completed.


Reverse

If a transaction times out, perform a reverse before creating a new transaction. This prevents a double charge.

Request Parameters

orderIdStringrequired

Order ID of the transaction to reverse

Example: "180730103903010431152179"

Example Request
JSON
1{
2 "orderId": "180730103903010431152179"
3}

Response Parameters

itemObject

Transaction response object

codeString

"SUCCESS" if the reverse succeeded, otherwise an error code.

error.codeString

Error code if the request failed.

error.messageString

Error message if the request failed.

error.debugString

Debug message (sandbox only).


Refund

Refund eligibility depends on the payment provider. Each payment method has its own refund period. If the refund period has passed, contact support@revenuemonster.my with:

  • Transaction ID
  • Reference ID (if applicable)
  • Total Transaction Amount
  • Total Refund Amount
  • Reason for refund

Request Parameters

transactionIdStringrequired

Transaction ID to refund

Example: "180730103903010431152179"

refund.typeStringrequired

Refund type (e.g., "FULL")

Example: "FULL"

refund.currencyTypeStringrequired

Refund currency type

Example: "MYR"

refund.amountUint64required

Refund amount in smallest currency unit

Example: 100

reasonStringrequired

Reason for the refund

Example Request
JSON
1{
2 "transactionId": "180730103903010431152179",
3 "refund": {
4 "type": "FULL",
5 "currencyType": "MYR",
6 "amount": 100
7 },
8 "reason": "Customer requested refund"
9}

Response Parameters

itemObject

Transaction response object

codeString

"SUCCESS" if the refund succeeded, otherwise an error code.

error.codeString

Error code if the request failed.

error.messageString

Error message if the request failed.

error.debugString

Debug message (sandbox only).