Skip to main content

Payment Refund

Overview​

Payment Refund will refund an amount to a previously authorized and captured transaction.

Prerequisites​

There is one prerequisite resource that must be created before requesting a payment refund.

           Object           Definition
Chargent TransactionTransactions record the results of the requests made to the payment gateway on the Chargent Order. Transactions are also used to make additional requests in the payments lifecycle.

Refund Types​

There are two types of payment refunds.

TypeDescription
Full RefundInput up to the full charge amount to perform a full refund.
Partial RefundInput a lesser value than the charge amount to perform a partial refund

Create Full Payment Refund​

Resource URL​

HTTP RequestURL
POST/services/apexrest/ChargentBase/payments/payments/{{transactionId}}/refunds

Request​

JSON Example
{
"amount": 800 // full amount for previously authorized and captured transaction
}

Response​

JSON Example
{
"logs": [],
"gatewayResponse": {
"gatewayToken": "{{token}}",
"gatewayResultCodeDescription": "",
"gatewayResultCode": "200",
"gatewayMessage": "",
"gatewayDate": "2023-12-07T20:19:40.193Z",
"gatewayAuthorizationCode": "{{authCode}}"
},
"refund": {
"status": "Approved",
"requestDate": "2023-12-07T20:19:40.192Z",
"id": "{{transactionId}}",
"effectiveDate": "2023-12-07T20:19:40.192Z",
"amount": 800.0
}
}

Create Partial Payment Refund​

Resource URL​

HTTP RequestURL
POST/services/apexrest/ChargentBase/payments/payments/{{transactionId}}/refunds

Request​

JSON Example
{
"amount": 50.00 // less than total amount for previously authorized and captured transaction
}

Response​

JSON Example
{
"logs": [],
"gatewayResponse": {
"gatewayToken": "{{token}}",
"gatewayResultCodeDescription": "",
"gatewayResultCode": "200",
"gatewayMessage": "",
"gatewayDate": "2023-12-07T20:22:18.604Z",
"gatewayAuthorizationCode": "{{authCode}}"
},
"refund": {
"status": "Approved",
"requestDate": "2023-12-07T20:22:18.604Z",
"id": "{{transactionId}}",
"effectiveDate": "2023-12-07T20:22:18.604Z",
"amount": 50.0
}
}

Learn More​

Learn more about Payment Refunds.