If your customer updates their shopping cart or if you make any changes to payment details, you have to update the payment session before creating an order.
When the customer modifies the content of their shopping cart before authorization, you can update a payment session in two steps.
1.
Send a POST request to the [{apiUrl}](https://docs.klarna.com/payments/web-payments/integrate-with-klarna-payments/other-actions/update-the-cart/)/payments/v1/sessions/{sessionID} endpoint.
2.
Send a load() call to make the changes visible to your customer.
To update the payment session, send the updated order details in a POST request to the [{apiUrl}](https://docs.klarna.com/payments/web-payments/integrate-with-klarna-payments/other-actions/update-the-cart/)/payments/v1/sessions/{sessionID} endpoint.
The sessionID path parameter must match the session identifier (session_id) you got in response to the create session request.
Here are examples of common errors with troubleshooting suggestions. You can use the value in correlation_id to find entries related to the request under Logs in the Merchant portal.
Some of the order line details don't follow our guidelines or violate API field restrictions. Refer to the Klarna payments API reference for details.
BAD_VALUE
Bad value: purchase_currency
purchase_currency is incorrectly formatted or doesn’t match locale. This may occur if the customer updates their billing address, causing country to be updated.
NOT_FOUND
Invalid session id
The session identifier specified in the path can't be found. Make sure the value in sessionID has the correct value and try again.
If your customer updates the cart after the authorize() call, you can share updates with Klarna in two ways:
If the Klarna widget is still displayed to the customer in the browser, send a new authorize() call with updated details to start a new risk and fraud assessment process.
In response to a successful authorize() call, you'll get a new authorization_token. Make sure to use the new token to place an order.
If your checkout solution lets the customer change the order details after payment, for example, on an order review page, you have to re-authorize the session. In this case, a Klarna widget is typically not displayed, meaning you can't authorize the purchase in the standard way with init(), load(), and authorize() calls. A reauthorize() call can handle this and any necessary customer communication in fullscreen modals.
We recommend you display modals launched during re-authorization as the customer might need to provide some input to complete the purchase.