Import customer data—including addresses, customer groups, and newsletter subscriptions—into your XONIC Shop via the XML interface. Supports external customer numbers for ERP/WaWi integration.
Customers
Field Definition
Required fields are marked with a pencil icon. The field definitions follow MySQL syntax.
An existing customer is identified by the external customer number (external) or the internal customer number (id). If no match is found, a new customer is created.
If specified and already exists → Update. Blank or 0 → New customer with AUTO_INCREMENT.
Takes precedence over `
id ` when matching existing customers.m: male (Mr.)f: female (Ms.)d: diverse
Is automatically stored in encrypted form during import. If no password is specified, the existing password is retained (for updates) or none is set (for new customers).
For new customers with the "
XML_PORT_NEW_CUSTOMER_MAIL=true " option enabled, a password is automatically generated and sent via a welcome email.de: German (default)en: English
language_id " value.Customer groups can be defined or updated in the `
<groups>` block of the XML file.If not specified, this is automatically set to the first imported address.
If not specified, this is automatically set to the first imported address.
1: Subscribed (creates/updates newsletter subscriber entry)0: Not subscribed (deletes existing subscription)
Addresses
Multiple addresses can be imported for each customer. Each address is specified as a separate ` <address>` node within the ` <addresses>` block. The first address is automatically set as the default shipping and billing address.
m, f, d).Is also copied to the "
customers_company " field in the customer record.DE123456789).DE, AT, CH).Recommended over the
country field.country_code).Is internally resolved to the
country_id. If neither country_code nor country is specified, the default country configured in the shop is used.Customer Groups
Customer groups can be defined in the optional " <groups>" block before the customer data. Existing groups are updated based on their ID; new groups are created automatically.
Additional Fields
Additional fields can be transmitted as name-value pairs via the " <extra_fields>" block. The following fields are processed specifically:
true: Customer is locked (customers_lock = 1)false: Customer is active (customers_lock = 0)
Multiple area managers separated by semicolons. Prefix
S for superuser flag.Example:
EXT-001;SEXT-002;EXT-003The area manager's external customer number is converted to the internal ID.
Is converted to the internal customer ID and stored as an approver relationship.
Discounts
Starting with Shop version 4.8.6, an optional ` <discounts>` node can be transmitted within the ` <customer>` element. Each ` <discount>` entry corresponds to a discount line in the " Discounts " field of Customer Management (x% on Category N).
If there are multiple customer accounts in the shop with the same external customer number (e.g., multiple contacts for a single company), the transmitted discounts are automatically applied to all accounts with that number starting with Shop version 4.8.8. The remaining customer data (name, email, addresses) remains unaffected.
0 = Top level – together with subcategories = 1, the discount applies to the entire product range.Decimal points are allowed (e.g.,
8,5). Values greater than 100 are capped at 100; values less than or equal to 0 are ignored.0 / 1, default: 1.0 / 1, Default: 0.0 / 1, default: 0.Does not apply to customer-specific prices—see note below the table.
0 / 1, default: 0.For the <discounts> node , the "Replace if present" semantics apply:
- Node with entries present: The customer’s entire discount history is replaced.
- Empty node (
<discounts></discounts>): All of the customer’s discounts are removed. - Node is missing: The discounts remain unchanged—existing mappings have no effect.
The customer’s internal activation flag is automatically updated—the discounts take effect immediately in the store.
Interaction with customer-specific prices: By default, a category discount is applied in addition to a customer-specific price (the discount then applies to the customer’s price). Starting with Shop version 4.8.8, this can be disabled via the “Apply Category Discounts to Customer-Specific Prices” setting in the shop configuration—the customer-specific price is then the final price and is excluded from the discount.
Example within the ` <customer>` element:
<discounts>
<discount>
<category_id>0</category_id>
<value>8,5</value>
</discount>
<discount>
<category_id>22</category_id>
<subcategories>0</subcategories>
<value>15</value>
<special>1</special>
</discount>
</discounts>
Sample XML
The XML file must follow the following naming convention:Customers(.)*.xml
Location: /xoport/xml/import/
Trigger import: /xpanel/xoport/import_customers.php (alias as of Shop version 4.8.6: update_customers.php).
<customer_data><customers> — each customer is a <customer> element (see example). Starting with Shop version 4.8.6, <customers> is also accepted directly as the root element. Only fields contained in the file are written—missing master data fields remain unchanged (delta import, e.g., only <external> + <discounts>); a field submitted as empty clears the value in the shop. Starting with version 4.8.6, the JSON response also reports customers.imported / customers.skipped_unknown — imported: 0 indicates an incorrect root element or unknown customer numbers.<?xml version="1.0" encoding="UTF-8"?>
<customer_data>
<!-- Kundengruppen (optional) -->
<groups>
<group>
<id>1</id>
<name>Standardkunde</name>
</group>
<group>
<id>2</id>
<name>Premium</name>
</group>
</groups>
<!-- Kundendaten -->
<customers>
<customer>
<id></id>
<external>ERP-12345</external>
<group_id>1</group_id>
<language>de</language>
<gender>m</gender>
<firstname>Max</firstname>
<lastname>Mustermann</lastname>
<email_address>max@example.com</email_address>
<telephone>+49 371 123456</telephone>
<newsletter>1</newsletter>
<addresses>
<address>
<gender>m</gender>
<firstname>Max</firstname>
<lastname>Mustermann</lastname>
<company>Meine GmbH</company>
<tax_id>DE123456789</tax_id>
<street_address>Hauptstraße 1</street_address>
<postcode>09247</postcode>
<city>Chemnitz</city>
<country_code>DE</country_code>
<state>Sachsen</state>
</address>
</addresses>
<extra_fields>
<extra_field>
<name>belegsperre</name>
<value>false</value>
</extra_field>
</extra_fields>
<discounts>
<discount>
<category_id>0</category_id>
<value>8,5</value>
</discount>
</discounts>
</customer>
</customers>
</customer_data>
Last updated: July 23, 2026