Use the Order management API to update the total amount of an order before it is captured, canceled, or expired.
When your customer contacts you to change, add, or remove a product from the order and you need to update the total order amount, this API call enables you to make the required changes.
The updated amount replaces the original order amount, including the order lines if you sent them when creating an order.
The following diagram depicts how this API call works:
Sequence diagram of the API call to update an order amount.
You can only update the amount if the order meets the following conditions:
Supported payment method | Identifier | Available markets |
---|---|---|
Pay later | INVOICE | All (excluding CH) |
Pay later | B2B_INVOICE | All (excluding CH) |
Base account | BASE_ACCOUNT | All (excluding CH) |
Pay now | DIRECT_DEBIT | All (excluding CH) |
Fixed amount | FIXED_AMOUNT | AT, DE, DK, FI, FR, NL, NO & SE |
To update the order amount, send the updated order details in a PATCH
request to the {apiUrl}/ordermanagement/v1/orders/{order_id}/authorization
endpoint. The order_id
is the identifier you get in a successful response when placing a new order.
Include the following in your request:
order_amount
(required): the new amount for the order. If you’re decreasing the order amount, this has to be less than the current authorized amount. If you’re increasing the order amount, this has to be more than the current authorized amountdescription
(optional): text to add detailsorder_lines
(optional): the new order lines that will replace the existing ones{
"order_amount": 6000,
"description": "",
"order_lines": [
{
"type": "physical",
"reference": "123050",
"name": "Tomatoes",
"quantity": 10,
"quantity_unit": "kg",
Sample request to update the order amount.
We recommend you always send updated order lines to improve the customer experience. The order lines can later help your customer visualize their purchase in the Klarna app and in the invoice.
The original order lines will be deleted if you don't send order lines in this call.
If the request is successful, the order amount is updated, and you'll receive a 204 No content
response.
If your request contains errors, you'll receive an error response. Make sure your request meets the conditions for updating the order and the parameters are correct. You can use the correlation_id
and the order_id
values to troubleshoot the call in the Merchant portal Logs section.
{
"error_code": "NOT_ALLOWED",
"error_messages": [
"Update not allowed."
],
"correlation_id": "a3183112-74bc-44ac-9453-51af2577d717"
}
Sample of an error response to update order amount.
Ready to send this request? See the API reference of this call.