Skip to main content

EzXml - Live stock

EzXml Connector - Live Stock This document describes how the EzXml connector retrieves and calculates live stock information for items. L...

Updated over a week ago

EzXml Connector - Live Stock

This document describes how the EzXml connector retrieves and calculates live stock information for items. Live stock provides real-time inventory data, which can include current available quantities and future stock availability dates. This information is displayed within the App4Sales application to provide up-to-date inventory status.

Activation & Sources

The EzXml connector retrieves live stock primarily from an XML file named FD_stock.xml. This file is downloaded via FTP. If the FD_stock.xml file is not found or contains no stock data, the connector falls back to using stock information available in the FD_catalog.xml file, which is also downloaded via FTP.

Data Source Configuration

Stock data is pulled from the external system via FTP from the following XML files:

  • Primary Source: FD_stock.xml (XML format)

  • Fallback Source: FD_catalog.xml (XML format)

The FTP server details (host, username, password, and folder paths) are configured within the connector's settings. The stock values are read from the variant elements within these XML files.

Data Mapping Table - Live Stock (Primary Source: FD_stock.xml)

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

Item Identifier

id (from variant element)

Unique identifier for the item.

Available Stock

stock (from variant element)

The quantity of stock available. This value is used if available_on is empty or represents the current date.

To Be Received

stock (from variant element)

The quantity of stock expected to be received in the future. This value is used if available_on represents a future date.

Next Delivery Date

available_on (from variant element)

The date when the future stock (To Be Received) is expected to become available. The date is parsed from the format "yyyyMMdd" or "yyyy-MM-dd". If this field is empty, the stock is considered currently available. Past dates are ignored.

Data Mapping Table - Live Stock (Fallback Source: FD_catalog.xml)

App4Sales Field

Source Field (API/Excel/DB)

Logic/Notes

Item Identifier

Id (from Variant object)

Unique identifier for the item.

Available Stock

Stock (from Variant object)

The quantity of stock available. This value is used if the FD_stock.xml file is not available or contains no stock data. Defaults to 0 if the source field is null.

Calculation Logic

The connector prioritizes stock information from FD_stock.xml. If this file is available and contains data, it processes each variant entry:

  • If an available_on date is present and is today's date, the corresponding stock quantity is considered Available Stock.

  • If an available_on date is present and is a future date, the corresponding stock quantity is considered To Be Received, and the date itself is noted as the Next Delivery Date.

  • Entries with available_on dates in the past are ignored.

  • If available_on is not specified, the stock quantity is treated as Available Stock.

If FD_stock.xml is empty or not found, the connector uses stock values from FD_catalog.xml. In this fallback scenario, the Stock field within each item's variant in FD_catalog.xml is taken directly as the Available Stock. If this field is null, it defaults to 0.

Output & UX

The processed stock values are mapped to internal App4Sales fields. Specifically:

  • The current available stock is stored as AvailableStock.

  • Future stock quantities are stored as ToBeReceived.

  • The expected date for future stock is stored as NextDeliveryDate.

These fields are then used to display the stock indicator and quantities in the App4Sales mobile application.

Related Settings & Prerequisites

The live stock functionality relies on proper configuration of FTP settings to access the FD_stock.xml and FD_catalog.xml files. These settings include the FTP host, username, password, and the specific directory paths where the XML files are located.

Known Limitations

  • This connector does not explicitly support multiple warehouses for stock. All stock quantities are aggregated or assumed to be for a single, undifferentiated stock pool.

  • The stock quantities are provided as decimal values and converted to string for storage; rounding rules are implicitly handled by the App4Sales platform.

Did this answer your question?