Refund a Payment

Refunding a payment returns the entire captured amount or part of the captured amount to the customer's account. Klarna supports multiple refund requests when the total amount of all refunds is less than the captured amount.'
Cybersource
recommends using the optional fields for a refund to ensure the request is successful. For more information, see Optional Fields for a Refund.

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

The refund service responds with one of these statuses as the
apRefundReply_status
field value:
  • FAILED
    : The refund request is not successful. Send a new refund request. A failed request can be due to either Klarna rejecting the transaction or a technical error.
  • PENDING
    : The refund request is accepted but is not refunded. Request the check status service to retrieve status updates. For more information, see Check a Request Status.
  • REFUNDED
    : The captured payment is successfully refunded.

Required Fields for a Refund

Include these required fields to

Optional Fields for a Refund

billTo_language
If this field is not included, the language is set to English by default.
For a list of possible values, see the
ISO Standard Language Codes
guide.
Set to
coupon
.
Replace the
#
character with the number
0
for the first item and consecutive numbers for any additional items.
Replace the
#
character with the number
0
for the first item and consecutive numbers for any additional items.
Replace the
#
character with the number
0
for the first item and consecutive numbers for any additional items.
Replace the
#
character with the number
0
for the first item and consecutive numbers for any additional items.
Replace the
#
character with the number
0
for the first item and consecutive numbers for any additional items.
Replace the
#
character with the number
0
for the first item and consecutive numbers for any additional items.

XML Example: Refund

Light Dark
Request
123456789101112
<="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantID>test_merchant</merchantID> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <purchaseTotals> <currency>USD</currency> <grandTotalAmount>154.50</grandTotalAmount> </purchaseTotals> <apPaymentType>KLI</apPaymentType> <apRefundService run="true"> <refundRequestID>6957576170986768803011</refundRequestID> </apRefundService> </>
Response
12345678910111213141516171819202122
<:c="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <requestID>6957582387066840103011</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTeSvaHi+ZXThj/6IZYjWmrWbZoV7NKCojmjMcX7SB3i0ZiwyaSZejFlof+k3krsEu93k+yRAABS1G</requestToken> <purchaseTotals> <currency>USD</currency> </purchaseTotals> <apRefundReply> <reasonCode>100</reasonCode> <transactionID>b30d7de1-215d-4989-8b82-f190d39457a4</transactionID> <status>REFUNDED</status> <processorResponse>00006</processorResponse> <amount>154.50</amount> <dateTime>2023-09-26T19:57:19Z</dateTime> <reconciliationID>XFZ55MYPWYRA</reconciliationID> <returnRef>XFZ40MYVGPWJ</returnRef> <paymentStatus>refunded</paymentStatus> <responseCode>00006</responseCode> </apRefundReply> </>