Headless Shopware (Composable Frontend)
Last edited on: 20.03.2025
Introduction
Klarna Payments is now also compatible with Shopware 6 headless shops that follow the sich an dem Demo Shopware Frontend Template Klarna payments work directly and do not require any additional frontend adjustments.
Setup
For using Klarna Payments in headless Shopware shops, no special settings are required. All necessary functions are directly integrated into the Klarna Payments plugin.
However, make sure that the following Shopware Store API endpoints are present and used in your shop:
Shopware Store-api | Description |
---|---|
/store-api/payment-method | This endpoint is called when the payment methods need to be loaded. |
/store-api/handle-payment | This endpoint is called when the customer completes the order and begins the payment process. |
Process
As soon as the customer starts the checkout process, i.e., when the cart is first accessed, the endpoint /store-api/payment-method is called. This process loads all available Klarna payment methods and presents them to the customer for selection.
The payment methods available to the customer during the checkout process depend on several factors:
error possibility | description |
---|---|
Missing or incorrect plugin configuration | Check if Klarna Payments is installed and activated. |
Incorrect API keys or faulty API configuration | Check the API configuration in the Klarna plugin under Settings -> Extensions -> Klarna and ensure that the API keys and other required information are entered correctly. If you don't have an API key yet, log in to your Klarna merchant account and create a new key, or contact [email protected]. |
Payment methods not activated | Go to Settings -> Payment Methods and make sure that the Klarna payment methods are activated. Ensure that they are assigned to the appropriate sales channel. |
Geographical and currency restrictions | Check if Klarna is available in your country. Make sure that the customer has selected the correct language and currency based on their billing address. |
Caching-problem | Clear the cache of your shop and reload the page. You can clear the cache in the Shopware admin area under Settings -> Cache/Performance -> Clear Cache. |
INFORMATION: The Klarna payment methods are provided by Klarna via the Create Session API. If no payment methods are transmitted, check the points mentioned above. Otherwise, please contact Klarna support via the Shopware Account Portal or directly at [email protected].
After the order is completed, the customer is redirected to an external Klarna page via the Shopware /store-api/handle-payment (via the Klarna Hosted Payment Page). There, the customer is prompted to complete the payment. In the background, the order is created in Klarna, with all necessary Klarna data and relevant Shopware order information transmitted. After successful payment, the customer is redirected to the Shopware success page. In case of an error or cancellation, the customer is instead redirected to the Shopware error page.
Order management in the Shopware backend
The display and management of order data in the Shopware backend remains unchanged even with a headless shop. All available functions and display options are still accessible through the backend. For more details on this, please refer to our documentation on Order Management.