Click or drag to resize

ESDocumentProduct Class

Ecommerce standards document that contains a list of product records
Inheritance Hierarchy

Namespace:  EcommerceStandardsDocuments
Assembly:  EcommerceStandardsDocuments.Library (in EcommerceStandardsDocuments.Library.dll) Version: (

The ESDocumentProduct type exposes the following members.

Public fieldconfigs
A dictionary of additional configurations and settings to include with each Ecommerce Standard Document. Typically documents would contain the "dataFields" key that would have a comma delimited list of record properties that are expected to contain data when reading the document's records. Any records not containing data for properties in list could then have the data set to a default when saved to a database.
(Inherited from ESDocument.)
Public fielddataRecords
List of product records
Public fielddataTransferMode
Denotes if the data being placed into document is a complete data set, or partial data being transferred containing only data changes.
(Inherited from ESDocument.)
Public fieldmessage
Message providing details of if the data could be obtained when requesting the document. The message gives meaning to the result status.
(Inherited from ESDocument.)
Public fieldresultStatus
Code that denotes if the data could be successfully obtained for the document, and if not why. See ESDocumentConstants Class for the list of status codes
(Inherited from ESDocument.)
Public fieldtotalDataRecords
The total number of records placed within document. For documents that contain multiple record lists, please check the relevant documentation to see how this number applies.
(Inherited from ESDocument.)
Public fieldversion
Version of the Ecommerce Standards Document. Verifying the version of the document is critical for systems transferring and manipulating the data.
(Inherited from ESDocument.)
An example of the Product Ecommerce Standards document in its JSON serialised form
    "version": 1.3,
    "resultStatus": 1,
    "message":"The product data has been successfully obtained.",
    "dataTransferMode": "COMPLETE",
    "totalDataRecords": 2,
            "brand":"Swisho Paper",
            "name":"Swisho Green Paper",
            "description1":"Swisho green coloured paper is the ultimate green paper.",
            "description2":"Paper built strong and tough by Swisho",
            "description3":"Recommended to be used with dark inks.",
            "weight": 20.1,
            "width": 21,
            "height": 29.7,
            "depth": 10,
            "averageCost": 10.00,
            "warehouse":"Swisho Warehouse",
            "deliveryTimeNoStock": 112112,
            "deliveryTimeInStock": 1212,
            "stockQuantity": 200,
            "stockNoneQuantity": 0,
            "stockLowQuantity": 10,
            "isPriceTaxInclusive": "N",
            "keySellUnitID": 2,
            "ordering": 1,
                    "baseQuantity": "6"
                    "baseQuantity": "24",
                    "parentQuantity": "4"
An example of the Product Ecommerce Standards document in its JSON serialised form
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EcommerceStandardsDocuments;

namespace MyApp
    public class MyClass
    /// <summary> Obtains a list of products records contained within an a products Ecommerce Standards Document</summary>
    public ESDocumentProducts getProducts()
        List<ESDRecordProduct> products = new List<ESDRecord>();
        Dictionary<string, string> docConfigs = new Dictionary<string, string>();

        //create a new product Ecomerce Standards Document
        ESDocumentProduct productsDoc = new ESDocumentProduct(ESDocumentConstants.RESULT_ERROR_UNKNOWN, "Unable to get product data.", null, null);

        //create a record for a tea towel product
        ESDRecordProduct product1 = new ESDRecordProduct();
        product1.keyProductID = "1";
        product1.productCode = "PROD-1"; = "Tea Towels";

        //create another record for a kettle product
       ESDRecordProduct product2 = new ESDRecordProduct();
        product2.keyProductID = "2";
        product2.productCode = "PROD-2"; = "Kettle";

        //in the document configs list all the properties of the product records that are being set, any properties not in the list can be ignored by the system when processing the product records

        productsDoc.configs = docConfigs;
        productsDoc.dataRecords = products.ToArray();
        productsDoc.resultStatus = ESDocumentConstants.RESULT_SUCCESS;
        productsDoc.message = "Product data has been successfully obtained.";

        return productsDoc;
See Also