Shopware

How is the integration of Shopware done?

Prerequisites
Adjustments in Shopware and the moinAI Hub are necessary for the integration. Make sure that access with administrator rights is used for both applications (for the user roles in the moinAI Hub).

Step-by-step instructions for Shopware integration
There are two ways to implement the Shopware integration. The recommended procedure is explained in detail below.


Prepare Shopware

1. Create a role

    1. Log in to the Shopware admin dashboard.
    2. Open the Users & Permissions area (Settings → System → Users & Permissions).
    3. Create a new role (Create role) and assign a suitable name, e.g. “moinAI Role”.
    4. Activate the necessary authorizations:
      • Customers → Show customers
      • Orders → Show orders
        Bildschirmfoto 2024-12-16 um 13.53.40
      • Save the newly added role.

2. Create integration

    1. Call up the Integrations area (Settings → System → Integrations).
    2. Add a new integration (Add integration) and assign a suitable name, e.g. “moinAI Integration”. Bildschirmfoto 2024-12-16 um 13.56.26
    3. Assign the previously created role “moinAI Role”.
    4. Saving the integration. The access key and secret key must be noted down or saved in a safe place, as they are no longer displayed after the integration has been saved.Bildschirmfoto 2024-12-16 um 13.58.16

Configure moinAI Hub

  1. After logging into the moinAI Hub, the Shopware integration is called up via Integrations → Shopware
  2. Integration Credentials: This is where you enter the access key and secret key that were previously created in the Shopware integration.
  3. After entering the keys, a test call should be made to ensure that the connection has been successfully established.
  4. The configuration must then be saved.

Set up context variables

To enable moinAI to retrieve order and customer information from Shopware, you must define two variables in a moinAI form:

  • shopware_order_number: The order number.
  • shopware_email: The customer's e-mail address (case-insensitive).

 

Test integration
  1. Once the context variables have been added to the form, the integration can be tested with corresponding test data. To do this, the form must be linked to a suitable theme and then tested.  
  2. If all relevant data is transferred, the integration has been successfully implemented and can be used in live operation.


Possible errors and how to fix them

  • Error: “not_configured”
The integration is incomplete. Make sure that all steps have been carried out correctly.
  • Error: “missing_data”
The required variables shopware_order_number or shopware_email are missing. Check your form configuration.
  • Error: “token_refresh_error”

The token could not be refreshed. Make sure that the integration in Shopware is still active.


Alternative: Integration via user credentials 

Regardless of the implementation described, integration with the user credentials of the Shopware access is also possible: The credentials are entered directly in the moinAI Hub in the Integrations → Shopware area. Once entered, the Shopware implementation can be finalized. 
The user credentials can be updated in the moinAI Hub at any time. The adjustments are made in the same area (Integrations →
Shopware).