Refund Transaction
Endpoint for initiating Refund type of Transactions.
info
Please be aware that this endpoint requires a Manage Transactions API Key.
POST /api/v1/groups/{group_id}/transaction/{transaction_id}/reversal
Refund rules
- Only
settledandpartially_refundedtransactions can be refunded. - A transaction can be refunded more than once with partial amounts, until the refunds add up to the original amount.
- One refund at a time. A new refund is accepted only after the previous one has completed or failed. While a refund is in progress the transaction status is
pending, and a new refund request returns400 Previous refund is still pending. amounts.requested_amountis the amount of this refund, not a running total. It must be greater than 0 and at most the original amount minusrefunded_amount.
Refund lifecycle
| Step | status | Amounts | Webhook |
|---|---|---|---|
| Refund requested | pending, transaction_type becomes refund | refunded_amount grows by this refund | transaction.refund |
| Refund completed | partially_refunded, or refunded once the full amount is refunded | refunded_settled_amount grows by this refund | transaction.settlement |
| Refund failed | Back to settled, or partially_refunded if an earlier refund completed | refunded_amount goes back down | transaction.decline |
| ACH refund returned by the bank | Same as failed | refunded_amount and refunded_settled_amount go back down | transaction.decline |
Card refunds can already be completed in the response. ACH refunds stay pending until the bank transfer completes.
Amount fields
| Field | Meaning |
|---|---|
refunded_amount | Sum of all refunds, including the one in progress. |
refunded_settled_amount | Sum of completed refunds. |
net_amount, transaction_fee | Not returned while a refund is in progress. After completion, net_amount is reduced by the completed refunds. |
Example: two partial refunds on a 100.00 sale
- Refund
3000->pending,refunded_amount: 3000. - A second refund now returns
400 Previous refund is still pending. - The refund completes ->
partially_refunded,refunded_settled_amount: 3000. - Refund
7000->pending. Once it completes ->refunded. - Any further refund returns
400 Cannot refund more than the original amount.
Request Parameters
| Name | Description | Type | Required |
|---|---|---|---|
| type | refund | string | Required |
| amounts.requested_amount | The amount to be refunded. | uint64 | Required |
Response
| Code | Description |
|---|---|
| 201 | Success |
| 400 | Bad Request / Validation error |
| 500 | Internal Error |
400 error messages:
Non Settled transactions cannot be refundedPrevious refund is still pendingCannot refund more than the original amountTransaction refund failedReferenced transaction not found
Example Usage
- JavaScript
- Python
- Go
transaction.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');
var requestOptions = {
method: 'POST',
headers: headers,
redirect: 'follow',
body: {
// request body data
}
};
const group_id = '';
fetch(
`https://api.reverepayments.dev/api/v1/groups/${group_id}/transaction/{transaction_id}/reversal`,
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
transaction.py
import requests
url = "https://api.reverepayments.dev/api/v1/groups/{group_id}/transaction/{transaction_id}/reversal"
headers = {
'Authorization': 'API_KEY'
}
response = requests.request("POST", url, headers=headers, json={
// request body data
})
print(response.text)
transaction.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.reverepayments.dev/api/v1/groups/{group_id}/transaction/{transaction_id}/reversal"
client := &http.Client{}
body := bytes.NewBuffer(nil)
_ = json.NewEncoder(body).Encode(map[string]any{
// body data
})
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
bytes, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(bytes))
}
Example Request
{
"type": "refund",
"amounts": {
"requested_amount": 3000
}
}
Example Success Response
{
"id": "c05861f0-6384-414d-b837-0ed71cefbbe5",
"group_id": "<group_id>",
"gateway": "revere_pay",
"processor_id": "<processor_id>",
"processor_name": "NO AFFILIATE",
"processor_type": "revere_pay",
"transaction_type": "refund",
"payment_method": "card",
"payment_details": {
"card": {
"brand": "Visa",
"card_type": "debit",
"first_six": "411111",
"last_four": "1111",
"customer_name": "James Testington",
"expiration_date": "29/11",
"avs": "not available",
"cvv": "no match",
"issued_country": "US"
}
},
"amounts": {
"requested_amount": 3000,
"authorized_amount": 3000,
"captured_amount": 3000,
"settled_amount": 3000,
"refunded_amount": 3000,
"included_tax_amount": 300,
"included_shipping_amount": 1000
},
"currency": "USD",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed lacus ac mi gravida euismod. Curabitur augue sapien, aliquam eu varius eu, gravida ac nunc. Duis commodo imperdiet augue. Proin consequat odio et pretium molestie.",
"source": "api",
"order_id": "98765",
"po_number": "12345",
"email_receipt": false,
"email_address": "test@example.com",
"user_id": "d1119f68-5d24-4e54-a8bf-e3cb6e27f4e8",
"username": "james_testington",
"billing_address": {
"first_name": "James",
"last_name": "Testington",
"company": "James' Company",
"city": "Scranton",
"line_1": "Slough Avenue",
"line_2": "1725",
"subdivision": "PA",
"postal_code": "18505",
"country": "US",
"email": "test@example.com"
},
"shipping_address": {
"first_name": "James",
"last_name": "Testington",
"company": "James' Company",
"city": "Scranton",
"line_1": "Slough Avenue",
"line_2": "1725",
"subdivision": "PA",
"postal_code": "18505",
"country": "US"
},
"form_external_id": "",
"form_entry_id": "",
"subscription_id": "",
"plan_id": "",
"custom_fields": null,
"response_code": "SUCCESS",
"response_text": "confirmed",
"status": "pending",
"created_at": "2026-04-11T14:27:17.952373Z"
}