Skip to main content
Reversals are used to cancel previous transaction requests. Authorization reversals notify the cardholder’s issuer that all or part of a transaction has been canceled and that the authorization hold should be released. You cannot reverse an authorization that has been captured and has had money withdrawn from the customer’s account. For those transactions, you would need to submit a refund. Reversals cannot be applied on previously reversed transaction or account verifications.
When to Use
  • You need to cancel all or part of an authorization.
  • The authorization cannot be captured within 10 days.
ScenarioBen buys a mechanical keyboard from CoolTechGear.com. After he finishes checking out, he realizes he bought the exact model last week, and cancels the order minutes later. Because the authorization has not been captured yet, CoolTechGear.com is able to reverse the authorization.

Steps

  1. Retrieve the transactionId from the previous transaction you need to reverse. This is how we link the reversal to its previous transaction.
    Reversal mutations differ from the other transaction mutations (i.e., captures, incremental authorizations, and refunds) in that you must reference the previous transaction’s transactionId instead of the paymentId. This is because transactionId targets the specific transaction in the payment life cycle to be reversed, whereas paymentId identifies the cohort of related transactions within a payment.
  2. Run the reverseTransaction mutation, passing in the pertinent inputs
    Required inputDescription
    transactionIdThe unique “payment ID” returned on the original, approved authorization, used to tie that transaction together with this incremental authorization.
    acceptorIDThe unique, 36 character identifier assigned to the entity providing the goods or services to the cardholder. Other processors may refer to this as the Merchant ID (MID), Outlet ID, or Customer number.
    transactionReferenceThe unique transaction identifier created by YOU to distiniguish this transaction from another.
    transactionAmountDetailsThe transaction currency and amount to be refunded. You can refund the full amount or only a portion of it. If you do not specify an amount, Tesouro will by default refund the full amount.
mutation reverseTransaction($input: ReverseTransactionInput!) {
  reverseTransaction(reverseTransactionInput: $input) {
    reverseTransactionResponse {
      status: __typename
      activityDate
      transactionId
      paymentId
      activityDate
    }
    errors {
      errorType: __typename
      ... on RuleInViolationError {
        explanationOfRule
        advice
      }
      ... on ValidationFailureError {
        fieldName
        fieldPath
        valueInError
      }
      ... on IGraphQlError {
        message
        transactionId
        processorResponseCode
      }
    }
  }
}
{
  "data": {
    "reverseTransaction": {
      "transactionInformation": {
        "paymentId": "64495c8b-4c0f-11ee-bf97-0e7d489d8cb0"
      }
    }
  }
}
Run in Playground