-
-
Notifications
You must be signed in to change notification settings - Fork 86
04. Refund API
Vincent Kok edited this page Jun 7, 2024
·
2 revisions
using IRefundClient refundClient = new RefundClient("{yourApiKey}");
RefundResponse refundResponse = await this._refundClient.CreateRefundAsync("{paymentId}", new RefundRequest() {
Amount = new Amount(Currency.EUR, "100"),
Description = "{description}"
});
using IRefundClient refundClient = new RefundClient("{yourApiKey}");
RefundResponse refundResponse = await this._refundClient.GetPaymentRefundAsync("{paymentId}", "{refundId}");
Mollie allows you to set offset and count properties so you can paginate the list. The offset and count parameters are optional.
using IRefundClient refundClient = new RefundClient("{yourApiKey}");
ListResponse<RefundListData> refundList = await this._refundClient.GetPaymentRefundListAsync("{paymentId}", "{offset}", "{count}");
using IRefundClient refundClient = new RefundClient("{yourApiKey}");
await refundClient.CancelPaymentRefundAsync("{paymentId}", "{refundId}");
When using the Orders API, refunds should be made against the Order. When using pay after delivery payment methods such as Klarna Pay later and Klarna Slice it, this ensures that your customer will receive credit invoices with the correct product information on them and generally have a great experience.
OrderRefundRequest orderRefundRequest = new OrderRefundRequest() {
Lines = new List<OrderLineDetails>() {
Id = {orderLineId},
Quantity = 5,
Amount = new Amount("EUR", 5)
},
Description = ""
};
using IRefundClient refundClient = new RefundClient("{yourApiKey}");
OrderRefundResponse result = await refundClient.CreateOrderRefundAsync({orderId}, orderRefundRequest);
Retrieve all order refunds.
using IRefundClient refundClient = new RefundClient("{yourApiKey}");
ListResponse<RefundResponse> result = await refundClient.GetOrderRefundListAsync({orderId});