Void or Refund a Single Payment
POST
/rest/merchants/{MID}/groups/{GroupID}/payments/{PaymentID}/void-or-refund
Description: Attempts to void or refund the specified individual scheduled payment. The system determines whether a void (same-day reversal) or refund (post-settlement credit) is appropriate based on settlement state.
Use the group endpoint for bulk operations: To void or refund all payments in a group at once,
use POST /groups/{GroupID}/void-or-refund instead.
Irreversible: Void and refund operations cannot be undone. Verify the payment ID before calling this endpoint in production.
Path Parameters
MID (required)
Type: string — 8 or 11 digits
Example:
32350000576GroupID (required)
Type: string (UUID)
Example:
01234567-abcd-1234-9876-abcdef123456PaymentID (required)
Type: string (UUID)
Example:
aaaaaaaa-1111-2222-3333-444444444444No request body is required for this endpoint.
Example Request
POST /rest/merchants/32350000576/groups/01234567-abcd-1234-9876-abcdef123456/payments/aaaaaaaa-1111-2222-3333-444444444444/void-or-refund Authorization: Bearer <token>
Responses
200 OK — Success
{
"paymentId": "aaaaaaaa-1111-2222-3333-444444444444",
"paymentGroupId": "01234567-abcd-1234-9876-abcdef123456",
"success": true,
"transactionResponse": {
"retref": 987654321098,
"respcode": "00",
"respstat": "A",
"resptext": "Approval",
"amount": 125.00,
"lastFour": "4242",
"accountType": "VISA"
}
}
200 OK — Failed
A 200 status is returned even when the void/refund was rejected by the gateway. Check success.
{
"paymentId": "aaaaaaaa-1111-2222-3333-444444444444",
"paymentGroupId": "01234567-abcd-1234-9876-abcdef123456",
"success": false,
"errorMessage": "Transaction not found in gateway or not eligible for void/refund."
}
Error Responses
| Status | Meaning |
|---|---|
| 400 | Invalid path parameter format. |
| 401 | Missing or expired bearer token. |
| 404 | Payment not found or does not belong to this merchant/group. |
| 500 | Unexpected server error. |
Response Fields
| Field | Type | Description |
|---|---|---|
paymentId | string (UUID) | The payment that was voided or refunded. |
paymentGroupId | string (UUID) | The parent group. |
success | boolean | Whether the operation succeeded at the gateway. |
errorMessage | string | Error detail if success is false. Omitted on success. |
transactionResponse | object | Gateway response details. Omitted on failure. |