Refund a Transaction
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Authorize.Net account
Refunds all or part of a settled Authorize.Net payment. You give it the transaction ID of the original payment and the amount to refund. It works for both credit card and eCheck payments.
The action first looks up the original transaction in Authorize.Net to get the masked card or bank account details. Then it sends the refund. You don't need to supply any card or bank data.
This action is part of the Authorize.Net add-on (DnnSharp.Authorize.Net). The add-on is installed separately and needs the AUTHORIZE feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Authorize.Net actions, the add-on isn't installed.
Typical Use Cases
- Refund an order from an admin listing or form
- Give a partial refund, for example for one returned item
- Refund payments automatically from an API endpoint or a scheduled job
Don't use it to
- Cancel a payment that hasn't settled yet. Authorize.Net only refunds settled transactions. Void unsettled transactions in the Authorize.Net Merchant Interface instead.
Related Actions
| Action Name | Description |
|---|---|
| Make a payment with Credit Card | Charges a card and returns the transaction ID you refund with this action. |
| Make a payment with Electronic Check | Takes a bank payment and returns its transaction ID. |
| Create Subscription | Creates a recurring payment in Authorize.Net. |
| Update Subscription | Changes an existing Authorize.Net subscription. |
| Execute Actions | Catches the error if the refund fails and there are no On Error actions. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| API Login ID | The API Login ID of the Authorize.Net account that took the payment. Use the sandbox login when Go Live is off. | Yes | empty string | Yes |
| Transaction Key | The Transaction Key that goes with the API Login ID. | Yes | empty string | Yes |
| Transaction Amount | The amount to refund, as a plain number with no currency symbol, for example 8.95. It can be less than the original payment for a partial refund, but not more. | Yes | empty string | Yes |
| Transaction ID | The transaction ID of the original, settled payment, for example [AnetTransactionId]. | Yes | empty string | Yes |
| Go Live | When on, the refund is sent to the Authorize.Net production environment. When off, it's sent to the sandbox. Use the same setting that was used for the payment. | Yes | false | No |
| On Success | Actions to run when the refund is accepted. | No | None | No |
| On Error | Actions to run when the lookup or the refund fails. Use [AuthorizeErrorCode] and [AuthorizeErrorMessage] to see why. | No | None | No |
Output Parameters Reference
The token names are fixed.
| Token | Description |
|---|---|
[AuthorizeTransactionId] | The transaction ID of the refund. It's a new ID, not the original one. |
[AuthorizeResponseCode] | The response code of the refund. 1 means approved. |
[AuthorizeResponseMessage] | The Authorize.Net message code for the refund, for example 1. It's a code, not a text message. |
[AuthorizeAuthCode] | The authorization code, if Authorize.Net returns one. |
[AuthorizeErrorCode] | The Authorize.Net error code when something fails, for example E00007 for invalid credentials. It's -2 if the lookup got no response and -1 if the refund got no response. |
[AuthorizeErrorMessage] | The error text when something fails. |
The success tokens are only set when the refund is accepted. The error tokens are only set when something fails.
What happens when it fails
The action fails if the lookup of the original transaction fails, for example because the transaction ID doesn't exist, or if Authorize.Net rejects the refund, for example because the transaction hasn't settled yet.
- With On Error actions, those actions run, and the error tokens tell you why.
- Without On Error actions, the action throws an error with the message
Message:followed by the error code and text. It stops execution, unless it's caught by the On Error of an enclosing Execute Actions.
If Transaction Amount isn't a number, the action throws Invalid amount value! before it contacts Authorize.Net. On Error doesn't run in that case.
Considerations
- Settled transactions only. Authorize.Net settles transactions once a day. Until then, it rejects a refund. Void the transaction in the Authorize.Net Merchant Interface instead.
- Save the transaction ID when you take the payment. Set the Output Authorize.Net Response Transaction ID Token Name of the payment action, and store the value with the order.
- Check the response code. Use
[AuthorizeResponseCode] == "1"in the condition of the On Success actions if you want to be sure the refund was approved, not held for review. - Amount format. The amount is read with the server's number format. On an English server, use a dot for decimals, for example
8.95. - Control who can refund. Put this action only where trusted users can reach it, for example an admin page. Don't let the user type the transaction ID or amount on a public form.
- Test with the sandbox. With Go Live off, the action uses the Authorize.Net sandbox, so the transaction ID must come from a sandbox payment. Make that payment while the sandbox account's transaction mode is set to live in the Merchant Interface. Payments made in the account's test mode don't get a real transaction ID. Then wait until the payment has settled.
- When the flow continues. If there are no On Success actions, the actions after it run after a successful refund. If On Success or On Error contains an action that ends execution, such as Display Message, nothing after it runs.
Examples
To understand how to use the below examples, please see Running Examples.
1. Refund an order and show the result
This action refunds the RefundAmount of the payment in the TransactionId token, in production. On success, it shows the new refund ID. On error, it shows the Authorize.Net error.
{
"Title": "Refund a Transaction",
"ActionType": "RefundTransaction",
"Description": "Refund the order payment",
"Parameters": {
"AuthorizeNetAPILoginID": "[AnetLoginId]",
"AuthorizeNetTransactionKey": "[AnetTransactionKey]",
"AuthorizeNetTransactionAmount": "[RefundAmount]",
"AuthorizeNetTransactionId": "[TransactionId]",
"AuthorizeNetLiveMode": true,
"OnSuccess": [
{
"Title": "Display Message",
"ActionType": "ShowMessage",
"Parameters": {
"Message": "<p>Refund of [RefundAmount] issued. Refund transaction ID: [AuthorizeTransactionId]</p>"
}
}
],
"OnError": [
{
"Title": "Display Error Message",
"ActionType": "ShowError",
"Parameters": {
"Message": "<p>The refund failed: [AuthorizeErrorMessage] ([AuthorizeErrorCode])</p>"
}
}
]
}
}
Revised 09/27/2026