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.

id
int(11)
Internal XONIC customer number.
If specified and already exists → Update. Blank or 0 → New customer with AUTO_INCREMENT.
external
varchar(255)
External customer number (e.g., from an ERP/business management system such as SelectLine).
Takes precedence over ` id ` when matching existing customers.
email_address
varchar(255)
Customer's email address.
gender
char(1)
Gender / Title
  • m: male (Mr.)
  • f: female (Ms.)
  • d: diverse
firstname
varchar(255)
Customer's first name.
lastname
varchar(255)
Customer's last name.
pseudonym
varchar(255)
Customer's username / display name.
password
varchar(255)
Password (plain text).
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.
telephone
varchar(255)
Phone number.
fax
varchar(255)
Fax number.
language
varchar(2)
Customer's language as an ISO-2 code.
  • de: German (default)
  • en: English
Is automatically converted to the internal " language_id " value.
group_id
int(11)
Customer group ID.
Customer groups can be defined or updated in the ` <groups>` block of the XML file.
default_address
int(11)
Default shipping address (address book ID).
If not specified, this is automatically set to the first imported address.
billing_address
int(11)
Billing address (address book ID).
If not specified, this is automatically set to the first imported address.
newsletter
tinyint(1)
Newsletter subscription
  • 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.

gender
char(1)
Title for the address (m, f, d).
firstname
varchar(255)
First name.
lastname
varchar(255)
Last name.
company
varchar(255)
Company name.
Is also copied to the " customers_company " field in the customer record.
tax_id
varchar(255)
Value-Added Tax (VAT) identification number (e.g., DE123456789).
street_address
varchar(255)
Street and house number.
postcode
varchar(10)
Zip code.
city
varchar(255)
City / Town.
suburb
varchar(255)
Neighborhood / District.
country_code
char(2)
ISO 3166-1 Alpha-2 country code (e.g., DE, AT, CH).
Recommended over the country field.
country
varchar(255)
Country name (alternative to 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.
state
varchar(255)
State / Region / Canton.
additional1
varchar(255)
Additional address information 1 (free-form field, e.g., floor, building).
additional2
varchar(255)
Address detail 2.
additional3
varchar(255)
Additional address 3.

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.

id
int(11)
Group ID. Leave blank for automatic assignment.
name
varchar(255)
Name of the customer group.

Additional Fields

Additional fields can be transmitted as name-value pairs via the " <extra_fields>" block. The following fields are processed specifically:

document lock
boolean
Lock customer account.
  • true: Customer is locked (customers_lock = 1)
  • false: Customer is active (customers_lock = 0)
Area Manager
varchar(255)
Assignment to area managers.
Multiple area managers separated by semicolons. Prefix S for superuser flag.
Example: EXT-001;SEXT-002;EXT-003
The area manager's external customer number is converted to the internal ID.
approvernr
varchar(255)
External customer number of the approver.
Is converted to the internal customer ID and stored as an approver relationship.
castrolnr
varchar(255)
Castrol customer number (industry-specific).

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.

category_id
int(11)
Category ID to which the discount applies.
0 = Top level – together with subcategories = 1, the discount applies to the entire product range.
value
decimal
Discount as a percentage (required field).
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.
subcategories
tinyint(1)
Discount also applies to subcategories.
0 / 1, default: 1.
qpb
tinyint(1)
Discount also applies to tiered pricing.
0 / 1, Default: 0.
option
tinyint(1)
Discount also applies to attribute surcharges.
0 / 1, default: 0.
special
tinyint(1)
Discount also applies to special offers (promotional prices from the special offers management).
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).

The file is embedded in a wrapper consisting of <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>

Download XSL Definition

Last updated: July 23, 2026

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.