OrderPayment_Refund
#
Description#
This function allows you to issue a refund against an existing captured payment record.
Note
Refunds can only apply to payments which have been captured (type 4 or type 5). Use OrderPayment_VOID
to void a payment authorization (type 3).
Request Body Parameters#
Parameter |
Type | Description |
---|---|---|
OrderPayment_ID |
Number | Payment record to Refund. This is returned in the OrderList_Load_Query or OrderPaymentList_Load. |
Amount |
Number | Amount to refund. Not currency formatted. Note: The refund amount can only be up to the total amount captured. |
Response Parameters#
Parameter |
Type | Description |
---|---|---|
total_auth |
Number | Total Amount Authorized |
formatted_total_auth |
String | Currency Formatted Total Amount Authorized |
total_capt |
Number | Total Amount Captured |
formatted_total_capt |
String | Currency Formatted Total Amount Captured |
total_rfnd |
Number | Total Amount Refunded |
formatted_total_rfnd |
String | Currency Formatted Total Amount Refunded |
net_capt |
Number | Total amount captured minus total amount refunded |
formatted_net_capt |
String | Formatted total amount captured minus total amount refunded |
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "OrderPayment_Refund",
"OrderPayment_ID": 5,
"Amount": 10.0
}
Example Response#
{
"success": 1,
"data": {
"total_auth": 18.0,
"formatted_total_auth": "$18.00",
"total_capt": 10.0,
"formatted_total_capt": "$10.00",
"total_rfnd": 10.0,
"formatted_total_rfnd": "$10.00",
"net_capt": 0.0,
"formatted_net_capt": "$0.00"
}
}
Error Responses#
Error Code | Error Message | Error Description |
---|---|---|
MER-JSN-PAY-00018 |
Invalid transaction type | A refund can only be applied to a payment type of 4 or 5. |