Refund a Direct Debit

You can refund a direct debit only for the entire amount of the payment. The direct debit must have
Settled
or
Settled_accepted
status before you can send a refund request.

Refund Period

In the
Bacs
scheme, there is no time limit for refunds. A customer can request a refund at any time after the original settlement date.
Cybersource
keeps active customer data for up to 6 months past a transaction settlement date. If a customer requests a refund more than 6 months past the settlement date,
Cybersource
must manually match the customer data to the transaction and might not be able to make the match.

Endpoints

Set the
apRefundService_run
field to
true
, and send the request to one of these endpoints:
Production:
https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor

Response Statuses

This table describes the possible statuses you can receive in a refund response message. The status is found in the
apRefundReply_status
field.
Payment Statuses for the Refund Service
Status
Description
Response Time
Pending
The refund request was accepted by the
Cybersource
partner and is sent to the scheme. Send a check status request for status updates. See Check a Direct Debit Status.
Immediate in API response.
Failed
The refund request was not accepted.
Immediate in API response.
Refund_initiated
The refund request was sent to the scheme in a batch.
D
Refunded
The customer's account received the refund.
D
Refund_rejected
The scheme rejected the refund request. A refund can be rejected for several reasons, such as when a customer closes the account that was used for paying the merchant.
D
D is the date on which the direct debit is executed.
D + is the count of business days after the execution date.
The refund service also responds with a reason code in the
apRefundReply_reasonCode
field. For more information about reason codes, see the Reason Codes for Bacs Direct Debits for the Simple Order API.

Required Fields for Refunding a Direct Debit

Set to
STL
.
Set to the request ID from the sale response.
Set to
true
.
Set to
bacs
.
Set to
GBP
.
Value cannot exceed 11 digits. Total amount maximum is 20 Million
GBP
.

Test Triggers for Refunds

In the
Cybersource
test environment, you can simulate specific response messages that you receive from transaction requests by including certain values in your transaction requests. The simulated environment enables you to become familiar with the response messages and develop methods for error handling.
Your account must be configured for testing trigger values. Contact your
Cybersource
account manager for more details.

Test Endpoint

For test transactions, send an API request to the test endpoint.
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor

Trigger Values

To test, send a refund request and set the
purchaseTotals_grandTotalAmount
field to a value listed in the Trigger Value column. The
Cybersource
response status is returned in the
apRefundReply_status
field.
Direct Debit Triggers for Refunds
Cybersource
Response Status
Trigger Value
Failed
2000.07
Pending
2000.00
Refunded
Any value that is not used in the triggers for testing other statuses.

Simple Order Example: Refunding a Direct Debit

Light Dark
Request
123456789101112
<="urn:schemas-cybersource-com:transaction-data-1.214"> <merchantID>test-merchant</merchantID> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <purchaseTotals> <currency>GBP</currency> <grandTotalAmount>20</grandTotalAmount> </purchaseTotals> <apPaymentType>STL</apPaymentType> <apRefundService run="true"> <refundRequestID>5235448386266004701064</refundRequestID> </apRefundService> </>
Response to a Successful Request
123456789101112131415161718192021
<:c="urn:schemas-cybersource-com:transaction-data-1.214"> <merchantReferenceCode>DEF56789</merchantReferenceCode> <requestID>5591931695706359004012</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <purchaseTotals> <currency>GBP</currency> </purchaseTotals> <apRefundReply> <reasonCode>100</reasonCode> <transactionID>szl-3cd0789c-8180-4b7f-ba5c-ba83f286768e</transactionID> <status>PENDING</status> <processorResponse>00001</processorResponse> <amount>20.00</amount> <dateTime>2019-05-30T05:12:54Z</dateTime> <reconciliationID>XFZ3ZVTDFCM5</reconciliationID> <returnRef>XFZ3YVOEOX63</returnRef> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> </apRefundReply> </>