Here you find details of the calls that enable you to refund and extend your orders. For each call, you can find a description, technical details, and sample requests and responses.
Use the Order management API to refund the items on a captured order.
When your customers return the items they bought and you need to refund that order, use this API call to credit the amount back to your customers.
The following diagram depicts how this API call works:
If you want to learn how to correctly allocate refunds when you deliver in multiple shipments, see the Refund allocation section.
To refund the amount of an order, send a POST request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/refunds endpoint.
Include the following in your request:
Header
Body
If the request is successful, you'll receive a 201 Created
response, including refund_id
and location
as HTTP response headers.
If your request contains errors, you'll receive an error response. Make sure the order is already captured and the order_id
is correct.
You can use the correlation_id
and the order_id
values to troubleshoot the call in the Merchant portal logs section.
Ready to send this request? See the API reference of this call.
Use the Order management API to make a refund with fees when your customers want to return items.
When your customers ask for a refund and want to return the items they bought, you can charge a return fee using this API call.
Your customers are charged with this return fee at the moment of refund, meaning that we take the return fee from the refunded amount they receive.
Charging the return fee is only possible if the orders meet the required conditions:
To charge return fees, you have to call the same endpoint you use for refunding an order, but with type: return_fee
as an additional parameter in order_lines
.
Send a POST
request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/refunds
endpoint.
Include the following in your request:
Header
Klarna-Idempotency-Key
: This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts.Body
refunded_amount
(required): the total order amount to be refunded. It must be less or equal to the captured_amount from the order capturereference
(optional): Internal reference to the refund. This will be included in the settlement files.description
(optional): text to add details of the refunds. Your customers can see this descriptionorder_lines
(required): list of details associated with this capture. You have to add an extra order line representing the return fee and set its type to return_feeYou must add the parameter type: return_fee
in the order lines to charge the return fee successfully. Adding this parameter lets your customer visualize the fee in the Klarna app.
If the request is successful, you'll receive a 201 Created
response, including refund_id
and location
as HTTP response headers.
If your request contains errors, you'll receive an error response. Make sure the order is already captured and the order_id
in the request is correct.
You can use the correlation_id
, and the order_id
values to troubleshoot the call in the Merchant portal logs section.
You can also remove the charged fees added in the request explained above. For this action, you have to send a new request to refund an order, including the amount previously charged as a return fee.
Ready to send this request? See the API reference of this call.
Use the Order management API to extend the authorization date and allow yourself more time to capture the order.
When you need more time to capture and fulfill an order before it expires, you can extend its authorization time using this API call.
Extend the order authorization by adding the number of expiration days associated with your account to the date at the moment of extension. For example, let's say you place the order on the 1st of January and your account is configured for 28 days of order expiry; if you make an extension on the 15th of January, the new expiry date will be the 13th of February (adding 28 more days).
If you try to extend an order multiple times on the same day, you'll get the same expiry date each time you try. You can extend an order up to 180 days after it’s created, making extensions at different times on different dates.
After an order has expired, you can't extend it with this API call anymore.
For the US 🇺🇸 market, you can't extend orders using the payment method "Slice it" (Fixed-Sum Credit).
To extend the authorization date of an order, send a POST request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/extend-authorization-time
endpoint.
Provide order_id
as a path parameter. The order_id
is the identifier you get in a successful response when placing a new order.
You don't need a request body for this POST
method.
If the request is successful, you'll receive a 204 No content response.
If your request contains errors, you'll receive an error response. Make sure the order is not expired or canceled and the order_id
is correct.
You can use the correlation_id
and the order_id
values to troubleshoot the call in the Merchant portal logs section.
Ready to send this request? See the API reference of this call.
Use the Order management API to release the authorization of an order.
When you have an order that isn't fully captured and you don't plan to perform more captures on it, you should cancel it by releasing the order's authorization.
With this action, your customers won't be debited for the remaining authorized order amount. If your customers paid by card, we'll refund the remaining amount to their account.
To release the authorization of an order, send a POST request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/release-remaining-authorization
endpoint.
Provide the order_id
as path parameters. The order_id
is the identifier you get in a successful response when placing a new order.
You don't need a request body for this POST
method.
If the request is successful, you'll receive a 204 No content
response.
If your request contains errors, you'll receive an error response. Make sure the order is not captured or canceled and the order_id
is correct.
You can use the correlation_id
and the order_id
values to troubleshoot the call in the Merchant portal logs section.
Ready to send this request? See the API reference of this call.
Use the Order management API to extend the order’s payment due date.
When you want to give your customers more time to pay for their purchase, you have to extend the order's payment due date.
To get an extension for the payment date, follow these steps:
As we relate every capture with an individual invoice for the customer, you can extend the payment due date per capture.
This is a paid feature. Given that the order extension increases the credit costs, we charge a fee. For more information, see the pricing section.
Extending the payment date is only possible for orders associated with a pay-later method, such as Pay in 30 days or Pay in 4 installments.
To get the available options for extending an order's payment due date, send a GET request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/extend-due-date-options
endpoint.
Provide order_id
and capture_id
as path parameters. The order_id
is the identifier you get in a successful response when placing a new order, and the capture_id
is the identifier you get when successfully capturing an order.
You don't need a request body for this POST
method.
If your request is successful, you'll receive a response body including number_of_days
for the amount of days this order can be extended.
If your request contains errors, you'll receive an error response. Ensure the order_id
and the capture_id
values you provided are valid and correctly formatted.
You can use the correlation_id
and the order_id
value to troubleshoot the call in the Merchant portal logs section.
To extend the payment due date for a specific order, send a PATCH
request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/captures/{capture_id}/extend-due-date-options
endpoint.
Provide one of the extension options you got as number_of_days
from Step 1.
If the request is successful, you'll receive a 204 No content response.
If your request contains errors, you'll receive an error response. Ensure the order_id
and the capture_id
values you provided are valid and correctly formatted.
You can use the correlation_id
and the order_id
value to troubleshoot the call in the Merchant portal logs section.
Ready to send this request? See the API reference of this call.