---
Title: Order XML
Language: cs-CZ
Canonical URL to this Markdown version of this page: [https://docs.kvik.shop/cs/xml2db-api/order-xml.md](https://docs.kvik.shop/cs/xml2db-api/order-xml.md)
Canonical URL to HTML version of this page (for humans): [https://docs.kvik.shop/cs/xml2db-api/order-xml](https://docs.kvik.shop/cs/xml2db-api/order-xml)
---

# Order XML

Breadcrumb: [XML2DB API](https://docs.kvik.shop/cs/xml2db-api.md) > [Order XML](https://docs.kvik.shop/cs/xml2db-api/order-xml.md)



The full order data for the given order code serialized as XML.

The root `<order>` element contains the complete purchase record, including identifiers, status, timestamps, monetary totals, customer and address information, payment and delivery details, line items (ordered products), and invoice references.


## Element reference

- `<order>`: Root element.
  - `uuid`: Unique order identifier (UUID v4).
  - `code`: Human-readable order code (e.g. ORD-2024-001).
  - `variableNumber`: Legacy variable symbol for bank transfers. Same value as `paymentReferenceNumber`, kept for backward compatibility.
  - `paymentReferenceNumber`: Payment reference number used for matching incoming bank transfers.
  - `invoiceNumber`: Issued invoice number, if any. Empty string when no invoice has been issued.
  - `originName`: Order origin channel (e.g. "eshop", "heureka", "zbozi").
  - `originStatusId`: Marketplace-specific order status ID. Only present for marketplace-origin orders (e.g. Heureka).
  - `originCode`: Marketplace-specific order code. Only present for marketplace-origin orders.
  - `currencyCode`: ISO 4217 currency code of the order (e.g. CZK, EUR).
  - `languageCode`: ISO 639-1 language code of the order (e.g. cs, en, sk).
  - `domainName`: Shop domain without www prefix.
- `<status code="…" name="…"/>`: Current order status with machine-readable `code` and localized human-readable `name`.
- `<time datetime="…" timestamp="…" timezone="…"/>`: Order creation timestamp.
- `<money totalPrice="…" totalPriceWithoutVat="…" `currencyCode`="…"/>`: Grand total including and excluding VAT.
- `<comment>`: Customer-facing order note. Only present when the customer left a comment.
- `<internalNote>`: Internal merchant note. Only present when set by staff.
- `<subscribedToNewsletter email="…"/>`: Newsletter subscription indicator. Only appears when the contact email belongs to a user account with an active newsletter agreement.
- `<user>`: Registered user account linked to the order contact email. Omitted entirely for guest checkouts.
  - `id`: User account internal ID.
  - `uuid`: User account UUID.
  - `email`: User's email address.
  - `codename`: User account public identifier.
  - `registered`: "true" if the account has completed registration, "false" for placeholder accounts.
  - `banned`: "true" if the account is banned.
  - `<internalNote>`: Staff note on the user account. Only present when non-empty.
  - `<lastEditTime>`: Last modification timestamp of the user account. Always present.
  - `<registrationTime>`: Account registration timestamp. Only present for registered accounts.
  - `<bonusPoints sum="…" lastChange="…"/>`: Loyalty points summary. Only present for registered accounts. `lastChange` is an ISO 8601 datetime.
  - `<addresses>`: Saved addresses of the user account. Only present for registered accounts.
    - `<contactAddress>`: Primary or secondary contact address.
      - `uuid`: Address UUID.
      - `primary`: "true" if this is the user's primary contact address.
      - `<personName>`: Person name.
        - `givenName`: First name.
        - `familyName`: Surname.
        - `honorificPrefix`: Title or prefix (e.g. "Mr.", "Dr."). Only present when set.
        - `honorificSuffix`: Suffix (e.g. "Jr."). Only present when set.
      - `<emailAddress>`: Email address with `email` attribute.
      - `<phoneNumber>`: Phone number with `countryPrefix` and `nationalNumber` attributes. Only present when set.
    - `<deliveryAddress>`: Primary or secondary delivery address.
      - `uuid`, `primary`: Same semantics as `contactAddress`.
      - `<personName>`: Delivery recipient name. Same structure as `contactAddress` `personName`.
      - `<companyName>`: Company name. Only present when set.
      - `<postalAddress>`: Street, city, postal code, and optional `countryCode` and `detailedDescription`.
      - `<emailAddress>`, `<phoneNumber>`: Contact details. Only present when set.
    - `<billingAddress>`: Primary or secondary billing address.
      - `uuid`, `primary`: Same semantics as `contactAddress`.
      - `<companyIdentification>`: Company identification.
        - `companyName`: Company name.
        - `companyRegNumber`: Company registration number. Only present when set.
        - `vatIdNumber`: VAT identification number. Only present when set.
        - `taxIdNumber`: Tax identification number. Only present when set.
      - `<postalAddress>`: Billing street address. Same structure as `deliveryAddress` `postalAddress`.
  - `<userGroups>`: User group memberships and agreements. Only present inside `<user>`.
    - `<userGroup>`: A single group or agreement.
      - `type`: Group type (e.g. "agreement", "custom").
      - `codename`: Machine-readable identifier. Only present for custom groups.
      - `name`: Human-readable group name.
      - `membership`: "included" or "excluded".
      - `<userGroupLinkHistory>`: Join/change history for agreement-type groups. Only present when history exists.
        - `variantName`: Name variant at the time of agreement. Only present when set.
        - `<ip>`: IP address of the client that accepted the agreement.
        - `<userAgent>`: User agent string.
        - `<time>`: Timestamp of the agreement action.
  - `<referrerUrl url="…"/>`: Marketing referrer URL captured during order placement. Only present when non-empty.
  - `<ip>`: IP address from which the order was placed. Only present when captured.
- `<contactInfo>`: Contact person for this order.
  - `firstName`, `familyName`: Contact person's name.
  - `email`: Contact email.
  - `phoneNumber`: Full formatted phone number.
  - `<phoneNumber>`: Structured phone number with `countryPrefix` and `nationalNumber`.
- `<billingInfo>`: Billing party details.
  - `countryCode`: ISO country code of the billing address. Only present when the country is set.
  - `companyName`: Company name. Only present when set.
  - `companyRegNumber`: Company registration number. Only present when set.
  - `ic`: Legacy alias of `companyRegNumber`. Only present when `companyRegNumber` is set.
  - `vatIdNumber`: VAT identification number (e.g. CZ12345678). Only present when set.
  - `taxIdNumber`: Tax identification number. Only present when set.
  - `dic`: Legacy alias of `taxIdNumber`. Only present when `taxIdNumber` is set.
  - `isVatIdVerified`: "true" or "false" indicating whether the VAT ID was verified against an external registry. Only present when verification was performed.
  - `<address>`: Billing postal address with `detailedDescription`, `street`, `city`, `postcode`, `countryCode`. Only present when the address is filled.
  - `<addressAutocomplete>`: Autocomplete metadata. Only present when address was resolved via an autocomplete service.
    - `type`: Autocomplete provider type.
    - `<postalAddress>`: Parsed street, city, postal code. Only present when parsed.
    - `<location>`: Lat/lng coordinates. Only present when available.
- `<deliveryInfo>`: Delivery recipient details.
  - `countryCode`: ISO country code of the delivery address. Only present when the country is set.
  - `companyName`: Company name. Only present when set.
  - `firstName`: Recipient first name. Only present when set.
  - `familyName`: Recipient surname. Only present when set.
  - `email`: Delivery contact email. Only present when set.
  - `phoneNumber`: Full formatted phone number. Only present when set.
  - `<phoneNumber>`: Structured phone number with `countryPrefix` and `nationalNumber`. Only present when phone number is set.
  - `<address>`: Delivery postal address with `detailedDescription`, `street`, `city`, `postcode`, `countryCode`. Only present when the address is filled.
    - `<county>`: Administrative region with `name`, `code`, and `type` attributes. Only present for address formats that include a county.
  - `<addressAutocomplete>`: Same structure as `billingInfo` autocomplete. Only present when applicable.
- `<payments>`: Payment transactions. Always present.
  - `<payment>`: Individual payment transaction when payment entities exist; otherwise a single legacy payment from order-level attributes.
    - `methodName`: Payment method codename (e.g. "card", "bank_transfer", "cash_on_delivery").
    - `customCode`: Merchant-defined payment method code.
    - `linkCustomCode`: Code linking payment to a delivery setup.
    - `externalNumber`: External payment gateway transaction ID.
    - `externalState`: External payment state (e.g. "done", "pending", "failed").
    - `priceAmount`: Payment amount.
    - `currency`: Payment currency code.
    - `createdDatetime`: Payment creation time in ISO 8601 / ATOM format. Only present in the payment-entities path (legacy path has this attribute commented out in code).
    - `updatedDatetime`: Last payment status update time. In the legacy path, only present when an external payment datetime exists.
    - `<paymentDoneCheck done="…"/>`: Merchant-side confirmation that the order is marked as paid.
    - `<k2Payment paymentId="…" paymentDeliveryLinkId="…"/>`: K2 ERP integration identifiers. Only present when xmlToDatabase module has `enableK2ElementsInOrder` enabled. Both attributes are conditional on the underlying custom code values.
- `<deliveries>`: Shipping methods.
  - `<delivery>`: A single delivery method.
    - `methodName`: Delivery method codename (e.g. "dpd", "ppl", "zasilkovna").
    - `packageCount`: Number of packages.
    - `customCode`: Merchant-defined delivery method code. Only present when non-empty.
    - `priceCustomCode`: Merchant-defined delivery price code. Only present when non-empty.
    - `<store>`: Pickup point information. Only present for pickup-point delivery methods. The element name matches the method name (e.g. `<dpd>`, `<zasilkovna>`) and has `storeId`, `storeCode`, `storeName` attributes.
    - `<k2Delivery deliveryId="…" deliveryPriceId="…"/>`: K2 ERP delivery identifiers. Only present when xmlToDatabase module has `enableK2ElementsInOrder` enabled. Both attributes are conditional on the underlying custom code values.
- `<deliveryDateTime text="…">…</deliveryDateTime>`: Requested or promised delivery date. The `text` attribute contains a human-readable formatted date. Only present when a delivery datetime is set.
- `<deliveryPartialConfirmed>`, `<deliveryAfternoonConfirmed>`, `<deliveryTodayConfirmed>`: Boolean flags indicating delivery confirmation status. Only present when the corresponding order item tags are configured as confirmed.
- `<bonusPoints changeAmount="…" totalAmount="…"/>`: Loyalty points change for this order. Only present when bonusSystem module is enabled and rewards are active. `changeAmount` is the sum of points changes on this order; `totalAmount` is the customer's current points balance.
- `<orderedProducts>`: Line items of the order. Contains polymorphic `<orderedProduct>` elements.
  - `<orderedProduct` `type`="product">`: A physical or digital merchandise line item.
    - `name`: Product name as shown to the customer.
    - `count`: Quantity ordered.
    - `vat`: VAT rate percentage applied to this line.
    - `type`: "product" for merchandise.
    - `id`: Product codename or SKU. Only present when the order item has a codename.
    - `<money>`: Line item pricing.
      - `price`: Unit price with VAT.
      - `priceWithoutVat`: Unit price without VAT.
      - `totalPrice`: Line total with VAT (price * count).
      - `totalPriceWithoutVat`: Line total without VAT.
      - `currencyCode`: Currency.
      - `vat`: VAT rate percentage.
    - `<strikethroughPrice>`: Original price before discount. Only present when a discount is applied.
      - `amountWithoutVat`, `amountWithVat`, `currencyCode`, `vatRateName`, `vatRate`, `vatAmount`.
    - `<retailPrice>`: Manufacturer's suggested retail price (MSRP). Only present when available.
      - Same attributes as `strikethroughPrice`.
    - `<pricing>`: Pricing calculation audit trail. Only present for product-type items when the stored order-item history contains pricing step data.
      - `<pricingSteps>`: Container for the individual pricing steps that produced the line-item price.
        - `<productPricePricingStep>` / `<supplyPricingStep>` / `<discountPricingStep>` / `<exchangePricingStep>` / `<roundPricingStep>` / `<minimalProfitPricingStep>` / `<refundableDepositPricingStep>` / `<fastestSupplyOptionPricingStep>` / `<profitPricingStep>` / `<supplyProfitPricingStep>` / `<priceSurchargePricingStep>` / `<externalProductPricePricingStep>`: A single pricing step. The element name is derived from the step class short name (lowercased first letter). Each step always carries `finalPrice` plus type-specific attributes. The internal `supply`, `initialPrice`, `productPrice`, and `discount` fields are never exposed.
          - `finalPrice`: Resulting price after this step, serialized as a price query string. Each price query string is a set of `&`-separated key/value pairs with the following keys:
              - `C` — ISO 4217 currency code of the price (e.g. `CZK`, `EUR`).
              - `A` — price amount without VAT.
              - `Z` — price amount with VAT. Included only when the with-VAT and without-VAT amounts differ (i.e. when VAT is applied).
              - `VAT` — VAT amount. Included only when VAT is non-zero.
              - `VATRATE` — VAT rate as a percentage (e.g. `21`). Included only when VAT is non-zero.
              - Example: `C=CZK&A=1500.00&Z=1815.00&VAT=315.00&VATRATE=21` means 1,500.00 CZK without VAT, 1,815.00 CZK with VAT, 315.00 CZK VAT, at 21 % VAT rate.
          - `productPriceType` (`<productPricePricingStep>`): Product price list type, e.g. `retail`.
          - `productPriceUuid` (`<productPricePricingStep>`): UUID of the product price record.
          - `forAllUsers` (`<productPricePricingStep>`, `<discountPricingStep>`): "true" when the price or discount applies to all user accounts.
          - `userAccountEmail` (`<productPricePricingStep>`, `<discountPricingStep>`): Email of the user account the price or discount is restricted to. Only present when set.
          - `userGroups` (`<productPricePricingStep>`, `<discountPricingStep>`, `<profitPricingStep>`, `<priceSurchargePricingStep>`): Comma-separated list of user group identifiers in `type-codename` format. Only present when restricted to specific groups.
          - `productCodename` (`<productPricePricingStep>`, `<discountPricingStep>`): Product codename when the price or discount is restricted to a specific product. Only present when set.
          - `productGroups` (`<discountPricingStep>`, `<profitPricingStep>`, `<priceSurchargePricingStep>`): Comma-separated list of product group identifiers. Only present when the discount or profit rule is restricted to specific groups.
          - `forAllProducts` (`<discountPricingStep>`): "true" when the discount applies to all products. Only present when set.
          - `discountUuid` (`<discountPricingStep>`): UUID of the applied discount.
          - `discountPrice` (`<discountPricingStep>`): Discount amount as a price query string (same `C`, `A`, `Z`, `VAT`, `VATRATE` format as `finalPrice`).
          - `discountPercents` (`<discountPricingStep>`): Discount percentage calculated from the price difference, rounded to two decimals.
          - `discountType` (`<discountPricingStep>`): Discount type codename.
          - `discountCode` (`<discountPricingStep>`): Coupon or discount code. Only present for coupon-type discounts.
          - `supplierCodename` (`<supplyPricingStep>`, `<profitPricingStep>`): Supplier codename. Only present when linked to a supplier.
          - `supplierKey` (`<supplyPricingStep>`): Supplier's internal key for the product.
          - `supplyPriceAmount` (`<supplyPricingStep>`): Supplier's base price amount.
          - `supplyCurrencyCode` (`<supplyPricingStep>`): Currency code of the supplier's base price.
          - `supplierPriceAdjustmentMultiplier` (`<supplyPricingStep>`): Multiplier applied to the supplier price. Defaults to 1.0.
          - `supplierPriceAdjustmentAdd` (`<supplyPricingStep>`): Fixed amount added to the supplier price. Defaults to 0.0.
          - `supplierPriceAdjustmentCurrencyCode` (`<supplyPricingStep>`): Currency code of the fixed addend. Only present when set.
          - `counterCurrency` (`<exchangePricingStep>`): Target currency code.
          - `baseCurrency` (`<exchangePricingStep>`): Source currency code.
          - `ratio` (`<exchangePricingStep>`): Exchange rate ratio used.
          - `<exchangeRateEntity>` (`<exchangePricingStep>`): Exchange rate record data. Only present when available.
          - `roundMode` (`<roundPricingStep>`): Rounding mode, one of `halfUp`, `up`, or `down`.
          - `smallestCashUnit` (`<roundPricingStep>`): Smallest cash unit used for rounding.
          - `refundableDepositPrice` (`<refundableDepositPricingStep>`): Deposit amount as a price query string (same `C`, `A`, `Z`, `VAT`, `VATRATE` format as `finalPrice`). Only present when a deposit price exists.
          - `refundableDepositCode` (`<refundableDepositPricingStep>`): Deposit code. Only present when set.
          - `refundableDepositBehavior` (`<refundableDepositPricingStep>`): Whether the deposit is `included` in or `excluded` from the price.
          - `hasRefundableDeposit` (`<refundableDepositPricingStep>`): "true" when a positive deposit is configured, "false" when no deposit applies, omitted when the presence is uncertain.
          - `priceFrom` (`<profitPricingStep>`, `<supplyProfitPricingStep>`, `<priceSurchargePricingStep>`): Starting price threshold of the rule.
          - `priceMultiplier` (`<profitPricingStep>`, `<supplyProfitPricingStep>`, `<priceSurchargePricingStep>`): Multiplier applied by the rule. Defaults to 1.0.
          - `priceAdd` (`<profitPricingStep>`, `<supplyProfitPricingStep>`, `<priceSurchargePricingStep>`): Fixed amount added by the rule. Defaults to 0.0.
          - `sort` (`<profitPricingStep>`, `<priceSurchargePricingStep>`): Rule sort order.
          - `<surchargePricingStep>` (`<fastestSupplyOptionPricingStep>`): Nested profit or surcharge step that determined the fastest supply option.
          - `priceSurchargeApplicationType` (`<priceSurchargePricingStep>`): Application scope, `supply` or `retail`.
          - `priceSurchargeRuleId` (`<priceSurchargePricingStep>`): ID of the surcharge rule.
          - `supplierCodenames` (`<priceSurchargePricingStep>`): Comma-separated supplier identifiers the rule applies to. Only present when set.
          - `domainName` (`<priceSurchargePricingStep>`): Domain name the rule applies to. Only present when set.
          - `domainId` (`<priceSurchargePricingStep>`): Domain ID the rule applies to. Only present when set.
          - `<retailApplicationSurchargePricingStep>` (`<priceSurchargePricingStep>`): Nested surcharge step for retail application. Only present when applicable.
    - `<vehicle>`: Vehicle compatibility data. Only present when the product is linked to a vehicle.
      - `slugPath`: URL slug path of the vehicle.
      - `vehicleBrandName`: Brand name (e.g. "Skoda").
      - `vehicleModelName`: Model name (e.g. "Octavia III").
      - `name`: Full vehicle name.
      - `powerKwFrom`: Power range start in kilowatts. May be omitted if not defined.
      - `powerHpFrom`: Power range start in horsepower. May be omitted if not defined.
      - `monthFrom`: Production start in Y-m format. May be omitted if not defined.
      - `monthTo`: Production end in Y-m format. May be omitted if not defined.
    - `<vehicleSearchResultDetail>`: Raw vehicle search detail string. Only present if the item originated from a VIN or vehicle search.
    - `<deliveryDateTime>`: Product-specific delivery promise. Only present when set.
    - `<deliveryDateTimePickupInStore>`: In-store pickup date promise. Only present when pickup in store is applicable.
    - `<deliveryPartialConfirmed>`, `<deliveryAfternoonConfirmed>`, `<deliveryTodayConfirmed>`: Product-level delivery confirmation flags. Only present when confirmed tags exist.
    - `<primarySupply>`: Primary supply source chosen for fulfillment. Only present for product-type items with a selected supply.
      - `<supply>`: Supply details.
        - `supplierName`: Supplier display name. Empty string when supplier is not linked to an entity.
        - `supplierCodename`: Supplier codename. Empty string when supplier is not linked to an entity.
        - `supplierKey`: Supplier key.
        - `supplierCustomCode`: Merchant-defined supplier code. Only present when non-empty.
        - `orderingNumber`: Ordering number, falling back to `supplier_key`.
        - `disabled`: "true" or "false" indicating whether the supply is disabled.
        - `multipleBuyQuantity`: Minimum order quantity. Only present when set.
        - `<money priceWithoutVat="…" purchasePrice="…" currencyCode="…"/>`: Supply pricing.
        - `<stock status="…" availableCount="…"/>`: Stock status and available quantity.
    - `<availableSupplies>`: All supplier offers for the product. Only present when the product has supplies.
      - `<supply>`: Same structure as `primarySupply`.
    - `<ean>`: EAN barcode(s). Repeated for each EAN assigned to the product.
    - `<upc>`: UPC barcode(s). Repeated for each UPC assigned to the product.
    - `<tecdoc>`: TecDoc catalog reference. Only present for auto-parts with TecDoc mapping.
      - `articleNo`: TecDoc article number.
      - `simplifiedArticleNo`: Simplified article number.
      - `brandNo`: TecDoc brand number.
      - `brandName`: Brand name.
      - `crossed`: "yes" or "no" indicating whether the article is crossed/replaced.
      - `genericArticleId`: Generic article ID. Only present when set.
    - `<mainPartNo>`: Manufacturer part number.
    - `<brandName isOriginal="…">…</brandName>`: Product brand name. `isOriginal` indicates whether it is an original equipment manufacturer (OEM) brand.
    - `<product>`: Full product catalog data. Only present when xmlToDatabase module has `enableProductInOrder` enabled.
      - `codename`, `name`: Product identifiers.
      - `<url>`: Product detail page URL. Only present when generated URL is non-empty.
      - `<note>`: Product note. Only present when non-empty.
      - `<unit>`: Unit of measurement abbreviation. Only present when non-empty.
      - `<piecesCount>`: Number of pieces per unit. Only present when non-zero.
      - `<warranty>`: Warranty period in months. Only present when non-zero.
      - `<productPrices>`: Retail price list across allowed currencies. Always present when product catalog data is included.
        - `<productPrice` `type`="retail">`: Price type container.
          - `<price>`: Price value with `amountWithoutVat`, `amountWithVat`, `currencyCode`, `vatRateName`, `vatRate`, `vatAmount`.
      - `<productGroups>`: Categorization groups the product belongs to. Always present.
        - `<productGroup>`: Group with `type`, `name`, `codename`.
      - `<productCodes>`: Identifying codes (EAN, MPN, etc.). Always present.
        - `<productCode>`: Code with `type`, `code`, `codeSimplified`, `abbreviation`, and optional `brandName`.
      - `<images>`: Product images. Always present but may be empty.
        - `<image>`: Image container. Only present when the product has a main image.
          - `<url>`: Image CDN URL.
      - `<supplies>`: All supplier offers for the product. Always present.
        - `<supply>`: Same structure as `orderedProduct` `primarySupply`.
    - `<k2Product productId="…"/>`: K2 ERP product identifier. Only present when xmlToDatabase module has `enableK2ElementsInOrder` enabled and a supplier custom code exists.
    - `<refundableDeposit>`: Refundable deposit indicator (e.g. battery core charge). Values: `yes` = deposit required, `probably` = may apply, `no` = none. Always present for product-type items.
    - `<availabilityLabel>`: Real-time availability messaging label. Only present when configured. All attributes and children are conditional on the label configuration.
      - `code`, `label`, `shortLabel`, `shortSubLabel`, `subLabel`, `color`.
      - `<description>`: Full availability description (CDATA).
      - `<shortDescription>`: Short availability description (CDATA).
  - `<orderedProduct` `type`="delivery">`: Shipping cost line item.
    - `name`: Delivery method display name.
    - `count`: Always 1 for delivery lines.
    - `vat`: VAT rate applied to delivery.
    - `type`: "delivery".
    - `id`: Delivery method codename. Only present when non-empty.
    - `<money>`: Same structure as product-type money.
    - `<k2Delivery deliveryId="…" deliveryPriceId="…"/>`: K2 ERP delivery identifiers. Only present when xmlToDatabase module has `enableK2ElementsInOrder` enabled.
  - `<orderedProduct` `type`="payment">`: Payment fee line item.
    - `name`: Payment method display name.
    - `count`: Always 1 for payment lines.
    - `vat`: VAT rate applied to payment fee.
    - `type`: "payment".
    - `id`: Payment method codename. Only present when non-empty.
    - `<money>`: Same structure as product-type money.
    - `<k2Payment paymentId="…" paymentDeliveryLinkId="…"/>`: K2 ERP payment identifiers. Only present when xmlToDatabase module has `enableK2ElementsInOrder` enabled.
- `<invoices>`: Issued invoices. Only present when an invoice number is assigned.
  - `<invoice invoiceNumber="…">`: Single invoice.
    - `<issueDate>`: Invoice issue date. Always present when invoices exist.
      - `<date date`="…" timezone="…"/>`: Date value with timezone.
    - `<dueDate>`: Payment due date. Only present when set.
      - `<date>`: Same structure as `issueDate`.
    - `<taxableSupplyDate>`: Tax point date. Only present when set.
      - `<date>`: Same structure as `issueDate`.


## Conditional elements

- `<comment>` appears only when the customer left a non-empty comment during checkout.
- `<internalNote>` at the order level appears only when staff has set an internal note.
- `<subscribedToNewsletter>` appears only when the contact email is linked to a registered user account that has an active newsletter agreement.
- `<user>` appears only for registered customers (when the order contact email matches an existing user account). Inside `<user>`, `<registrationTime>`, `<bonusPoints>` (with `sum` and `lastChange`), and `<addresses>` are omitted for unregistered placeholder accounts. Guest checkouts omit the entire `<user>` element, which also means `<referrerUrl>` and `<ip>` are absent because they are appended inside `<user>`.
- `<referrerUrl>` and `<ip>` inside `<user>` appear only when the respective values were captured during order placement.
- `<billingInfo>` and `<deliveryInfo>` `<addressAutocomplete>` elements appear only when the address was resolved via an autocomplete service during checkout.
- `<deliveryInfo>` `<address>` may contain a `<county>` sub-element depending on the country address format (e.g. for US or UK addresses).
- `<payments>` always exists but uses two different shapes: when payment entities exist, it contains individual `<payment>` elements per transaction; otherwise it falls back to a single legacy `<payment>` derived from order-level payment attributes.
- `<deliveries>` `<delivery>` may contain a `<store>` child (element name matches the delivery method codename, e.g. `<dpd>` or `<zasilkovna>`) for pickup-point deliveries.
- `<k2Delivery>` and `<k2Payment>` appear only when the xmlToDatabase module has `enableK2ElementsInOrder` enabled.
- `<deliveryPartialConfirmed>`, `<deliveryAfternoonConfirmed>`, and `<deliveryTodayConfirmed>` at both order and product level appear only when the corresponding order item tags are configured as confirmed in the system.
- `<bonusPoints>` at the order level appears only when the bonusSystem module is enabled and rewards are active for the shop.
- `<orderedProduct>` is polymorphic:
    - `type`="product"` represents a merchandise line item. It may include vehicle data, supply sources, product codes, TecDoc references, full catalog product data, K2 identifiers, refundable deposit flags, and availability labels. Many child elements are conditional on product configuration and module settings.
    - `type`="delivery"` represents shipping costs and contains base attributes plus `<money>` and optionally `<k2Delivery>`.
    - `type`="payment"` represents payment fees and contains base attributes plus `<money>` and optionally `<k2Payment>`.
- `<invoices>` appears only when an invoice number has been assigned to the order. Inside `<invoice>`, `<issueDate>` is always present when invoices exist, while `<dueDate>` and `<taxableSupplyDate>` are conditional on the order entity.
- `<pricing>` appears only for product-type ordered products that have a stored `InsertedOrderedProductHistoryEntity` with pricing step data. The individual step element names depend on the step type. The factory removes the internal `supply`, `initialPrice`, `productPrice`, and `discount` fields before rendering.
- `<receipts>` is produced but intentionally omitted from this example.

Marketplace orders (e.g. Heureka) include `originStatusId` and `originCode` attributes on the root `<order>` element to map the external marketplace state.


## Example XML

```xml
<?xml version="1.0" encoding="UTF-8"?>
<order uuid="a3f7c912-1d4b-4e6f-8c2a-3b9d0e5f7a18"
       code="ORD-2024-001"
       variableNumber="1234567890"
       paymentReferenceNumber="1234567890"
       invoiceNumber="INV-2024-001"
       originName="eshop"
       originStatusId="42"
       originCode="HEU-12345"
       currencyCode="CZK"
       languageCode="en"
       domainName="example.com">
    <status code="1" name="New"/>
    <time datetime="2024-01-15 09:30:00" timestamp="1705311000" timezone="Europe/Prague"/>
    <money totalPrice="1250.00" totalPriceWithoutVat="1033.06" currencyCode="CZK"/>
    <comment>Please leave the package at the front door</comment>
    <internalNote>VIP customer - handle with care</internalNote>
    <subscribedToNewsletter email="customer@example.com"/>
    <user id="123"
          uuid="b4g8d023-2e5c-5f7g-9d3b-4c0e1f6g8b29"
          email="customer@example.com"
          codename="customer001"
          registered="true"
          banned="false">
        <internalNote>VIP customer</internalNote>
        <lastEditTime datetime="2024-01-10 14:20:00" timestamp="1704897600" timezone="Europe/Prague"/>
        <registrationTime datetime="2023-06-01 10:00:00" timestamp="1685606400" timezone="Europe/Prague"/>
        <bonusPoints sum="150" lastChange="2024-01-10T14:20:00+01:00"/>
        <addresses>
            <contactAddress uuid="c5h9e134-3f6d-6g8h-0e4c-5d1f2g7h9c30" primary="true">
                <personName givenName="John" familyName="Doe"/>
                <emailAddress email="customer@example.com"/>
                <phoneNumber countryPrefix="+420" nationalNumber="123456789"/>
            </contactAddress>
            <deliveryAddress uuid="d6i0f245-4g7e-7h9i-1f5d-6e2g3h8i0d41" primary="true">
                <personName givenName="John" familyName="Doe"/>
                <companyName>Acme Ltd.</companyName>
                <postalAddress streetAndHouseNumber="Main Street 123" city="Prague" postalCode="11000" countryCode="CZ" detailedDescription="Floor 2"/>
                <emailAddress email="customer@example.com"/>
                <phoneNumber countryPrefix="+420" nationalNumber="123456789"/>
            </deliveryAddress>
            <billingAddress uuid="e7g1h356-5h8f-8i0j-2g6e-7f3h4i9j1e52" primary="true">
                <companyIdentification companyName="Acme Ltd." companyRegNumber="12345678" vatIdNumber="CZ12345678" taxIdNumber="CZ12345678"/>
                <postalAddress streetAndHouseNumber="Main Street 123" city="Prague" postalCode="11000" countryCode="CZ" detailedDescription="Floor 2"/>
            </billingAddress>
        </addresses>
        <userGroups>
            <userGroup type="agreement" codename="newsletter" name="Newsletter" membership="included">
                <userGroupLinkHistory variantName="Newsletter">
                    <ip>192.168.1.1</ip>
                    <userAgent>Mozilla/5.0</userAgent>
                    <time datetime="2023-06-01 10:00:00" timestamp="1685606400" timezone="Europe/Prague"/>
                </userGroupLinkHistory>
            </userGroup>
        </userGroups>
        <referrerUrl url="https://google.com"/>
        <ip>192.168.1.1</ip>
    </user>
    <contactInfo firstName="John" familyName="Doe" email="customer@example.com" phoneNumber="+420123456789">
        <phoneNumber countryPrefix="+420" nationalNumber="123456789"/>
    </contactInfo>
    <billingInfo countryCode="CZ"
                 companyName="Acme Ltd."
                 companyRegNumber="12345678"
                 ic="12345678"
                 vatIdNumber="CZ12345678"
                 taxIdNumber="CZ12345678"
                 dic="CZ12345678"
                 isVatIdVerified="true">
        <address detailedDescription="Floor 2"
                 street="Main Street 123"
                 city="Prague"
                 postcode="11000"
                 countryCode="CZ"/>
        <addressAutocomplete type="addressAutocomplete">
            <postalAddress>
                <streetAndHouseNumber>Main Street 123</streetAndHouseNumber>
                <city>Prague</city>
                <postalCode>110 00</postalCode>
            </postalAddress>
            <location>
                <lat>50.0755</lat>
                <lng>14.4378</lng>
            </location>
        </addressAutocomplete>
    </billingInfo>
    <deliveryInfo countryCode="CZ"
                  companyName="Acme Ltd."
                  firstName="John"
                  familyName="Doe"
                  email="customer@example.com"
                  phoneNumber="+420123456789">
        <phoneNumber countryPrefix="+420" nationalNumber="123456789"/>
        <address detailedDescription="Floor 2"
                 street="Main Street 123"
                 city="Prague"
                 postcode="11000"
                 countryCode="CZ">
            <county name="Prague" code="CZ010" type="region"/>
        </address>
        <addressAutocomplete type="addressAutocomplete">
            <postalAddress>
                <streetAndHouseNumber>Main Street 123</streetAndHouseNumber>
                <city>Prague</city>
                <postalCode>110 00</postalCode>
            </postalAddress>
            <location>
                <lat>50.0755</lat>
                <lng>14.4378</lng>
            </location>
        </addressAutocomplete>
    </deliveryInfo>
    <payments>
        <payment methodName="card"
                 customCode="CARD-01"
                 linkCustomCode="LINK-01"
                 externalNumber="PAY-12345"
                 externalState="done"
                 priceAmount="1250.00"
                 currency="CZK"
                 createdDatetime="2024-01-15T09:30:00+01:00"
                 updatedDatetime="2024-01-15T09:35:00+01:00">
            <paymentDoneCheck done="true"/>
            <k2Payment paymentId="CARD-01" paymentDeliveryLinkId="LINK-01"/>
        </payment>
    </payments>
    <deliveries>
        <delivery methodName="dpd"
                  packageCount="1"
                  customCode="DPD-01"
                  priceCustomCode="DPD-PRICE-01">
            <dpd storeId="DPD-123" storeCode="DP123" storeName="Prague Central"/>
            <k2Delivery deliveryId="DPD-01" deliveryPriceId="DPD-PRICE-01"/>
        </delivery>
    </deliveries>
    <deliveryDateTime text="Monday, Jan 15">2024-01-15</deliveryDateTime>
    <deliveryPartialConfirmed>true</deliveryPartialConfirmed>
    <deliveryAfternoonConfirmed>false</deliveryAfternoonConfirmed>
    <deliveryTodayConfirmed>true</deliveryTodayConfirmed>
    <bonusPoints changeAmount="50" totalAmount="150"/>
    <orderedProducts>
        <orderedProduct name="Bosch Brake Pads"
                        count="2"
                        vat="21.0"
                        type="product"
                        id="BPB-123456">
            <money price="500.00"
                   priceWithoutVat="413.22"
                   totalPrice="1000.00"
                   totalPriceWithoutVat="826.45"
                   currencyCode="CZK"
                   vat="21.0"/>
            <strikethroughPrice amountWithoutVat="450.00"
                                amountWithVat="544.50"
                                currencyCode="CZK"
                                vatRateName="Standard"
                                vatRate="21"
                                vatAmount="94.50"/>
            <retailPrice amountWithoutVat="413.22"
                         amountWithVat="500.00"
                         currencyCode="CZK"
                         vatRateName="Standard"
                         vatRate="21"
                         vatAmount="86.78"/>
            <pricing>
                <pricingSteps>
                    <supplyPricingStep finalPrice="C=CZK&amp;A=1200.00&amp;Z=1452.00&amp;VAT=252.00&amp;VATRATE=21"
                                       supplierCodename="autopartssupplier"
                                       supplierKey="98765"
                                       supplyPriceAmount="1200"
                                       supplyCurrencyCode="CZK"
                                       supplierPriceAdjustmentMultiplier="1"
                                       supplierPriceAdjustmentAdd="0"
                                       supplierPriceAdjustmentCurrencyCode="CZK"/>
                    <productPricePricingStep finalPrice="C=CZK&amp;A=1500.00&amp;Z=1815.00&amp;VAT=315.00&amp;VATRATE=21"
                                             productPriceType="retail"
                                             productPriceUuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                                             forAllUsers="true"
                                             productCodename="BPB-123456"/>
                    <discountPricingStep finalPrice="C=CZK&amp;A=1350.00&amp;Z=1633.50&amp;VAT=283.50&amp;VATRATE=21"
                                         discountUuid="b2c3d4e5-f6a7-8901-bcde-f12345678901"
                                         discountPrice="C=CZK&amp;A=150.00&amp;Z=181.50&amp;VAT=31.50&amp;VATRATE=21"
                                         discountPercents="10"
                                         discountType="product_discount"
                                         discountCode="SUMMER10"/>
                </pricingSteps>
            </pricing>
            <vehicle slugPath="skoda/octavia-iii"
                     vehicleBrandName="Skoda"
                     vehicleModelName="Octavia III"
                     name="Skoda Octavia III 1.6 TDI"
                     powerKwFrom="77"
                     powerHpFrom="105"
                     monthFrom="2012-11"
                     monthTo="2020-12"/>
            <vehicleSearchResultDetail>VIN detail</vehicleSearchResultDetail>
            <deliveryDateTime text="Monday, Jan 15">2024-01-15</deliveryDateTime>
            <deliveryDateTimePickupInStore text="Tuesday, Jan 16">2024-01-16</deliveryDateTimePickupInStore>
            <deliveryPartialConfirmed>true</deliveryPartialConfirmed>
            <deliveryAfternoonConfirmed>false</deliveryAfternoonConfirmed>
            <deliveryTodayConfirmed>true</deliveryTodayConfirmed>
            <primarySupply>
                <supply supplierName="LocalStock"
                        supplierCodename="localstock"
                        supplierKey="BOS-BP1234"
                        supplierCustomCode="LOC-01"
                        orderingNumber="BOS-BP1234"
                        disabled="false"
                        multipleBuyQuantity="1">
                    <money priceWithoutVat="300.00"
                           purchasePrice="200.00"
                           currencyCode="CZK"/>
                    <stock status="available" availableCount="15"/>
                </supply>
            </primarySupply>
            <availableSupplies>
                <supply supplierName="LocalStock"
                        supplierCodename="localstock"
                        supplierKey="BOS-BP1234"
                        supplierCustomCode="LOC-01"
                        orderingNumber="BOS-BP1234"
                        disabled="false">
                    <money priceWithoutVat="300.00"
                           purchasePrice="200.00"
                           currencyCode="CZK"/>
                    <stock status="available" availableCount="15"/>
                </supply>
            </availableSupplies>
            <ean>1234567890123</ean>
            <upc>123456789012</upc>
            <tecdoc articleNo="BP1234"
                    simplifiedArticleNo="BP1234"
                    brandNo="123"
                    brandName="Bosch"
                    crossed="no"
                    genericArticleId="456"/>
            <mainPartNo>BP1234</mainPartNo>
            <brandName isOriginal="true">Bosch</brandName>
            <product codename="3b9d0e5f7a18a3f7c912"
                     name="Bosch Brake Pads BP1234">
                <url>https://example.com/bosch-brake-pads-bp1234</url>
                <note>High quality brake pads</note>
                <unit>pcs</unit>
                <piecesCount>1</piecesCount>
                <warranty>24</warranty>
                <productPrices>
                    <productPrice type="retail">
                        <price amountWithoutVat="413.22"
                               amountWithVat="500.00"
                               currencyCode="CZK"
                               vatRateName="Standard"
                               vatRate="21"
                               vatAmount="86.78"/>
                    </productPrice>
                </productPrices>
                <productGroups>
                    <productGroup type="category" name="Brake Pads" codename="brake-pads"/>
                </productGroups>
                <productCodes>
                    <productCode type="ean" code="1234567890123" codeSimplified="1234567890123" abbreviation="EAN"/>
                    <productCode type="mpn" code="BP1234" codeSimplified="BP1234" abbreviation="MPN" brandName="Bosch"/>
                </productCodes>
                <images>
                    <image>
                        <url>https://cdn.example.com/img/bp1234.jpg</url>
                    </image>
                </images>
                <supplies>
                    <supply supplierName="LocalStock"
                            supplierCodename="localstock"
                            supplierKey="BOS-BP1234"
                            supplierCustomCode="LOC-01"
                            orderingNumber="BOS-BP1234"
                            disabled="false">
                        <money priceWithoutVat="300.00"
                               purchasePrice="200.00"
                               currencyCode="CZK"/>
                        <stock status="available" availableCount="15"/>
                    </supply>
                </supplies>
            </product>
            <k2Product productId="BOS-BP1234"/>
            <refundableDeposit>yes</refundableDeposit>
            <availabilityLabel code="in-stock"
                               label="In stock"
                               shortLabel="In stock"
                               shortSubLabel="Shipping today"
                               subLabel="Ships within 24 hours"
                               color="#00AA00">
                <description><![CDATA[Item is in stock and ships immediately.]]></description>
                <shortDescription><![CDATA[In stock]]></shortDescription>
            </availabilityLabel>
        </orderedProduct>
        <orderedProduct name="DPD"
                        count="1"
                        vat="21.0"
                        type="delivery"
                        id="DPD-01">
            <money price="150.00"
                   priceWithoutVat="123.97"
                   totalPrice="150.00"
                   totalPriceWithoutVat="123.97"
                   currencyCode="CZK"
                   vat="21.0"/>
            <k2Delivery deliveryId="DPD-01" deliveryPriceId="DPD-PRICE-01"/>
        </orderedProduct>
        <orderedProduct name="Card payment"
                        count="1"
                        vat="21.0"
                        type="payment"
                        id="CARD-01">
            <money price="0.00"
                   priceWithoutVat="0.00"
                   totalPrice="0.00"
                   totalPriceWithoutVat="0.00"
                   currencyCode="CZK"
                   vat="21.0"/>
            <k2Payment paymentId="CARD-01" paymentDeliveryLinkId="LINK-01"/>
        </orderedProduct>
    </orderedProducts>
    <invoices>
        <invoice invoiceNumber="INV-2024-001">
            <issueDate>
                <date date="2024-01-15" timezone="Europe/Prague"/>
            </issueDate>
            <dueDate>
                <date date="2024-01-29" timezone="Europe/Prague"/>
            </dueDate>
            <taxableSupplyDate>
                <date date="2024-01-15" timezone="Europe/Prague"/>
            </taxableSupplyDate>
        </invoice>
    </invoices>
</order>
```