This article has been automatically translated from its original language. Screenshots may be displayed in the original language.
Diesen Artikel auf Deutsch lesen

In this article you will learn everything about using Komfortkasse with Shopware (version 4 and 5).


Read the article Getting started: Setting up and connecting to the shop beforehand.


Setting up the Shopware API

A new user with API access must be created for Komfortkasse to access the Shopware shop. To do this, log in to the Shopware backend. Open the user management and add a new user:

You can name the user komfortkasse, for example. Activate the user with the Activated checkbox. Also activate the checkbox for API access and copy the API key. Give the user sufficient rights, e.g. by adding them to the local_admins role:



You must specify an e-mail address, but this will not be used any further. You can therefore use any e-mail address. Save the new user.


More information on required rights

We strongly recommend using a role with all rights, such as local_admins. If you use a separate user role for the Komfortkasse user, make sure that the following rights are specified:

  • customer: read, detail
  • order: read, update

If you also use the inventory update on cancelation, the following is also required:

  • article: read, save


Then empty the shop cache (Settings - Caches/Performance - Empty shop cache).



Specify the username and the API key in the Shop settings in your Komfortkasse merchant area. To do this, select the shop in the Settings - Shops menu. Click on Edit settings in the API access settings area and then enter the data:

Then click Save settings.


As soon as the API credentials have been saved, Komfortkasse can read out other required settings from the shop, e.g. existing payment methods, subshops and order status. While the data is being read out, you may see a corresponding display next to the respective field:


API settings

If the data cannot be read out by the shop, you will find some possible causes of errors further down in this article in the Troubleshooting section.

If the data has been successfully read, the correct names are displayed instead of the IDs:


Komfortkasse supports the payment codes Prepayment, Invoice, and Cash on delivery. If you do not use all three payment codes in your shop, click on deactivate or activate for the respective payment code:


Once the desired Payment codes have been activated, click Edit settings again. You can then make the settings for Subshops, Payment codes and Status.


For all settings where data from the shop is used, you can use the Read data again button to read the data from the shop again (e.g. if a new Payment codes has been added to the shop).


Subshops

If no subshops are used (or if all existing subshops are to be used in Komfortkasse), then no selection needs to be made here.

Otherwise, the desired subshops can be selected here:

Pure language stores do not need to be set up separately in Komfortkasse, as Komfortkasse automatically recognizes the language. Subshops only need to be set up separately if they are actually different shops, e.g. with their own names and logos. More information on this can be found below in the Subshops chapter.


The following settings are described using prepayment as an example. The settings for invoice and Cash on delivery are similar, the differences to prepayment are described at the end. Even if you only use invoice payment in your online shop, you should read the following descriptions.


Payment codes ID

Here you can select which Shopware payment codes should be used for "Prepayment" in Komfortkasse. Normally, this is the "Prepayment" payment codes available in Shopware by default:


Order status and Payment status for Open orders

Here you can select which orders Komfortkasse considers to be "open" and expects payments for them. Either the order status, the Payment status or both statuses can be specified. (If, for example, only the order status is specified, the Payment status is ignored)

The order status "Open" and/or the Payment status "Open" is usually specified for prepayment. Other statuses may also be useful, e.g. "1st/2nd/3rd reminder":


Payment status for partially paid orders

Orders for which a partial payment is received are set to this Payment status in Shopware by Komfortkasse. (No order status can be selected):


Order status and Payment status for paid orders

Orders that have been completely paid in Komfortkasse are set to this status in Shopware by Komfortkasse. An Order status and/or a Payment status can be selected. If, for example, only the Payment status is to be changed but the Order status is not to be changed, "Do not change" is selected for the Order status:


Order status and Payment status for orders cancelled

If an order is cancelled in Komfortkasse (e.g. because no payments have been received over a long period), this status is set in Shopware. An Order status and/or a Payment status can be selected. If, for example, only the Payment status is to be changed but the Order status is not to be changed, "Do not change" is selected for the Order status:

Order status and Payment status for refunded orders

If a refund is executed for an order in Komfortkasse, this status can be set in Shopware. An Order status and/or a Payment status can be selected. If, for example, only the Payment status is to be changed but the Order status is not to be changed, "Do not change" is selected for the Order status:


Payment status for Dunning level 1, 2, 3,...

If Komfortkasse sends Pre-collection letters (payment reminders) for an order, the Payment status can be set in Shopware. These settings are optional.


Payment status for Debt collection

If the integrated Debt collection in Komfortkasse is used and an order has been transferred for collection, the following Payment status is set in Shopware.

(Debt collection for orders with Payment codes prepayment is normally not possible, but there are exceptional cases where this may be the case)


Payment methods for monitoring

If the monitoring of other payment codes is used (optional), the payment codes that are to be monitored are selected here.

(The note "No longer available in the shop" is displayed if a payment method or status is no longer available in the shop but is still present in orders in Komfortkasse. This can be the case, for example, when a shop is newly set up)


Settings for invoice payment

The same settings are available for payment on invoice as for prepayment, with one difference: If no payment is received for an order, it is not cancelled but marked as overdue. This is technically the same process, but in practice it usually triggers other follow-up processes: While a prepayment order without payment can simply be cancelled, an overdue order with invoice payment usually has to be reprocessed manually or passed on to Debt collection, for example.


Settings for Cash on delivery

The same settings are available for Last name as for invoice, with the following restrictions:

  • Pre-collection letters are not available
  • Debt collection is not available


Settings for documents

Komfortkasse automatically processes documents such as invoices and Credit Notes from Shopware. Invoice numbers, for example, are transferred from invoices. If Credit Notes or cancellation invoices exist, the order amount is reduced accordingly.

Document types from Shopware can be specified separately in each case. The Document type (name) is specified in the basic settings in Shopware:

The following settings are available for selection:

  • Document types for Invoice numbers:
    Invoice numbers are read from these document types. The names of the document types for invoices and Credit Notes should be specified here.
  • Document types that overwrite the order amount:
    The amount is read from these document types and used instead of the amount from the order. Your names of the document types for invoices should be specified here. If, for example, only one part of an order is available and an invoice is only issued for this part, the invoice amount is transferred to Komfortkasse as an open amount instead of the order amount.
  • Document types that reduce the order amount:
    The amount is read from these document types and deducted from the order amount (or invoice amount). Your names of the document types for Credit Notes and Cancellation Invoices should be specified here. If, for example, part of an order is returned and a Credit Note is issued for it, the Credit Note amount is deducted from the total amount in Komfortkasse.


Import tracking code

If yes, the tracking code is transferred to Komfortkasse as the consignment number (delivery note number). This is useful, for example, when processing Cash on delivery payments.


Correct stock in the event of a cancellation

If the item stock is used in Shopware and the stock is automatically reduced when an order is entered, this stock is not automatically increased again by the Shopware API when a prepayment order is canceled. This can be achieved with this setting: if active, the stock is automatically increased again in Shopware when a prepayment order is canceled by Komfortkasse.

The API call PUT /articles/<article ID> increases the attribute mainDetail.inStock by the corresponding quantity.


Connecting the connection

Once all the settings for the API have been fully specified, the shop can be connected to Komfortkasse. To do this, select the actions menu ≡ Connect.


Troubleshooting

If the connection cannot be established, validate whether the API is working correctly:

In your web browser, call up the url http(s)://<your-shop>/api/orders. Enter the username you have just created as the username and the API key as the password. If you now see an output, the Shopware API is working. If you get the message Missing or invalid auth or the window for entering the password appears again and again, the API is not yet working properly.


Validate:

  • Have the username and API key been entered correctly? Pay attention to upper and lower case and spaces!
  • Has the user been activated? (checkbox under the username)
  • Has the API access been activated? (checkbox to the left of the API key)
  • Does the user have sufficient rights? (Add the user to the local_admins role)
  • Has the cache been emptied?

If access still does not work, you may find more information in the Shopware log (/logs folder in the Shopware directory) or in the log files of your web server.


Activate prepayment in Shopware

To be able to use Komfortkasse, you must activate payments by prepayment in Shopware. If you already offer prepayment in your shop, you can skip this step. If you are installing Shopware for the first time, prepayment is usually already activated by default.


Log in to the Shopware backend and open Settings - Payment codes. Select "Prepayment" from the list. (If prepayment is not available, select "New" and add the following data. In this case, you must specify the correct payment type ID, e.g. "5", in the Komfortkasse merchant area in the Shop settings)


Activate the "Active" checkbox.


You have now activated prepayment in your shop.


Deactivating the sending of Payment information in Shopware

Normally, your customers will receive the Payment information directly from Komfortkasse. If you already offer prepayment, you have probably already configured your shop so that your customers receive your Bank details. You should now deactivate this sending (unless you want Payment information to continue to be sent directly from the shop and not from Komfortkasse).


Log in to the Shopware backend and open the e-mail templates (Settings - E-mail templates). Open the "sORDER" template under "System emails".


In the email text, remove the texts between {if $additional.payment.name == "prepayment"} and {/if}. Remove the text in the "Plain text" tab and HTML text!



If you operate your shop in several languages, also remove the text in the respective translations (in the "Content" and "Html content" fields).



Cancellation of order items with Shopware ERP (Pickware)

If you use Shopware ERP (Pickware), you can also cancel the order items when canceling an order via Komfortkasse. To do this, activate the "Cancel order items" option in the configuration of the Komfortkasse plugin in your shop:

More information on subshops

If Shopware subshops are used, there are two ways to connect them to Komfortkasse:

  1. Do not use subshops in Komfortkasse, create only one shop in Komfortkasse
  2. Use subshops in Komfortkasse and create multiple shops in Komfortkasse


With option 1, only one shop is created in Komfortkasse and the orders from all subshops are imported into this shop. This option can be used if subshops are only used for languages. The language is automatically recognized in Komfortkasse and specified in the order, so the language subshops from Shopware do not have to be created in Komfortkasse.


If different shops are used, e.g. with different names, logos or URLs, option 2 must be used. To do this, each subshop in Shopware is created as a separate shop in Komfortkasse. (Language subshops can be combined - so if, for example, two shops in three languages each are created in Shopware, only two shops need to be created in Komfortkasse)

In the Komfortkasse merchant area, the Shopware subshops to be used are then selected for the respective shop:

(If there are no subshops in the list, but only a text field is displayed, the subshops must first be transferred on by "Reload values". The username and API key must be entered for this)


Procedure for newly created subshops

Proceed as follows if you have created a new subshop in Shopware and want to integrate it into Komfortkasse:

  1. First create the shop in Komfortkasse ("Connect additional shop") and enter the URL, logo, e-mail settings, etc..
  2. Then specify the API username and API key and save the data. (From this timestamp Komfortkasse can communicate with the shop and the required settings such as subshops, payment codes, status, etc. can be read)
  3. Then select the correct subshop (or subshops) from the list and save the data. Make sure that the subshops have been saved correctly.
  4. Enter the desired status values and connect.



Refunds

Refunds can be created directly from Shopware without any further manual intervention. For more information on the general function of refunds, see Refunds.


A refund is created from a document in Shopware. A Document type is specified for this purpose. A standard type (e.g. "Credit Note") can be used, but we recommend that you create your own Document type just for this purpose (e.g. "Refund Bank Transfer" or similar).


In the Komfortkasse merchant area, the creation of refunds from the shop system must be activated in the General settings:

So here you only have to select in shop system or in shop system and merchant area.


The desired Document type must be specified in the settings of the Komfortkasse plugin in Shopware:



Komfortkasse performs some checks to avoid unintentional or multiple refunds. By default, for example, only refunds for which there is a posting in Komfortkasse are executed. It is essential to test the process before starting the automatic refunds.