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.
POSTrequest to the
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
sessionID path parameter must match the session identifier (
session_id) you got in response to the create session request.
If the request is successful, the Klarna payments session is updated and you'll receive a
204 No content response.
If your request contains errors, you'll receive an error response.
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.
|Error code||Error message||Description|
|The tax details in the request aren't aligned with the rules for tax handling.|
|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.|
|purchase_currency is incorrectly formatted or doesn’t match locale . This may occur if the customer updates their billing address, causing |
|The session identifier specified in the path can't be found. Make sure the value in |
To show the updated order details to your customer, send the updated details in a
load() call to Klarna.
Learn how to handle responses to the load() call.
If your customer updates the cart after the authorize() call, you can share updates with Klarna in two ways:
authorize()call with updated details to start a new risk and fraud assessment process.
authorize()call, you'll get a new
authorization_token. Make sure to use the new token to place an order.
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.