wmx2file

Utility package

Tool version

1.8

Tool files

download

Tool name

wmx2file.exe

Export tool settings

You need to create a file called settings.xml and place it in the same folder as the tool.

settings.xml

<?xml version="1.0" encoding="utf-8"?>
<Settings>
    <!-- ERP Web Service account provided by Webmercs -->
    <Email></Email>
    <Password></Password>

    <!-- Email for receiving error reports. Separate multiple emails with ; -->
    <AdminEmail></AdminEmail>

    <!-- combine multiple orders into single file -->
    <MultipleOrdersPerFile>fasle</MultipleOrdersPerFile>

    <!-- If you want to test without writing order# to webshop database or marking the order as exported -->
    <TestMode>true</TestMode>

    <!-- Optional. Defines settings which control how orders are chosen for export. -->
    <Filter>
        <!-- Specifies exact order for export -->
        <OrderId>0</OrderId>

        <!-- Specifies how old exported orders are. -->
        <LastDaysCount>-1</LastDaysCount>

        <!-- Specifies that only orders marked as 'Printed' should be exported. -->
        <OnlyPrinted>true</OnlyPrinted>

        <!-- Specify a date range. Orders created within it would be exported. -->
        <FromDate>2008-01-01</FromDate>
        <ToDate>2008-01-31</ToDate>

        <!-- Specifies that only orders not marked as exported should be processed. -->
        <OnlyNotExported>true</OnlyNotExported>

        <!-- Specifies that only orders which belong to corporate customers should be exported. -->
        <OnlyCorporate>false</OnlyCorporate>

        <!-- Specifies whether 'Ordered' orders having no vendor responses should be exported. -->
        <SkipVendorOrdersCheck>false</SkipVendorOrdersCheck>

        <!-- Specifies comma-separated list of order status names -->
        <StatusNames>In Process,Deleted</StatusNames>

        <!-- [Obsolete] Specifies coma-separated list of order status codes from the limited set: [InProcess|Shipped|Pending|Paid|Ordered]-->
        <Status>Shipped,Ordered</Status>

        <!-- [true|false] Specified whether orders only with 'Shipped' or 'Ordered' status should be exported -->
        <!--              Makes sense only when <Status> is not defined. -->
        <CheckStatus>true</CheckStatus>
    </Filter>

    <!-- Optional. Allows to configure one or more target export locations. -->
    <Targets>
        <!-- copy exported file to the folder. Attribute "encoding" is optional. -->
        <CopyToFolder encoding="utf-8">c:\Export\</CopyToFolder>
 
        <!-- Post exported file to the specified location. Attribute "encoding" is optional. -->
	    <HttpPost encoding="utf-8">
	        <Url>http://example.com/Incoming</Url>
            <Username></Username>
            <Password></Password>
        </HttpPost>
 
        <!-- Send file to FTP. Attribute "encoding" is optional. -->
        <CopyToFtp>
            <Host>ftp.webmercs.com</Host>
            <Username></Username>
            <Password></Password>
            <TargetFolder></TargetFolder>
        </CopyToFtp>
    </Targets>
</Settings>

Filter and Targets element and all of sub-elements are optional and therefore can be omitted.

Using the utility

Downloading orders

wmx2file.exe -batch [o:OrderNumber] [noflag]

The default function of the utility is to download all orders that are not marked as downloaded already, and then mark them as downloaded.
Contact Webmercs to have orders up to a certain date or order number marked as downloaded.

noflag indicates that orders should not be marked as downloaded.
OrderNumber should be replaced with a real webshop order number for downloading one order. Always convenient when testing.

examples:
wmx2file -batch noflag
wmx2file -batch
wmx2file -batch o:26850

Updating orders after import

NB! This command should be executed on orders which were retrieved with noflag command line argument.

wmx2file.exe -confirm o:<OrderId> en:<ExternalOrderNumber>

where
<OrderId> is the Webmercs order number
<ExternalOrderNumber> is an external reference to the order (typically the order number assigned to this order in your own accounting system)

Example of the order detail XML

<Order>
  <OrderId>10000</OrderId>
  <DealerId>1</DealerId>
  <ExternalCode>WMX-10000</ExternalCode>
  <OrderTime>2008-11-02T15:40:46.96+01:00</OrderTime>
  <CurrentTime>2008-11-14T16:13:44.667+01:00</CurrentTime>
  <ShipToID />
  <ShipDate>2008-11-14T15:03:11.267+01:00</ShipDate>
  <Status>Sendt</Status>
  <AuthorPersonalNumber>12</AuthorPersonalNumber>
  <SalesRepName>Mr. PlacedBy</SalesRepName>
  <UserDepartment />
  <Comment>User comment</Comment>
  <AdminComment>11.11.08 - sent email</AdminComment>
  <ExtraSum>0.0000</ExtraSum>
  <AdditionalCharge>10.0000</AdditionalCharge>
  <TaxSum>1260.2000</TaxSum>
  <ShippingSum>215.2000</ShippingSum>
  <ShippingMethodID>2</ShippingMethodID>
  <ShippingMethod>Posten Standard</ShippingMethod>
  <SubTotal>4825.6000</SubTotal>
  <Total>6301.0000</Total>
  <Discount>0.0000</Discount>
  <DiscountCouponCode />
  <OrgNumber>1234-6789</OrgNumber>
  <PaymentTypeId>10</PaymentTypeId>
  <PaymentTerms>Faktura</PaymentTerms>
  <PaymentType>Faktura30</PaymentType>
  <PaymentDays>30</PaymentDays>
  <PaymentTab>1</PaymentTab>
  <PaymentGroup>3</PaymentGroup>
  <UserIP>85.1.1.1</UserIP>
  <DueDate>2008-12-14T16:13:44.667+01:00</DueDate>
  <InvoiceNumber />
  <CustomerPO>#12345</CustomerPO>
  <WarehouseNumber />
  <Author>
    <UserId>1</UserId>
    <PersonalNumber>12</PersonalNumber>
    <Name>Mr. PlacedBy</Name>
    <Department />
    <Email>sales@web.no</Email>
  </Author>
  <SalesRep>
    <UserId>4</UserId>
    <PersonalNumber>141</PersonalNumber>
    <Name>Mr. SalesRep</Name>
    <Department />
    <Email>info@web.no</Email>
  </SalesRep>
  <Customer>
    <UserID>23427</UserID>
    <CustomerId>7</CustomerId>
    <Number>30004</Number>
    <UserEmail>someuser@example.com</UserEmail>
    <CreditLimit>0.0000</CreditLimit>
    <PaymentTermsID>1</PaymentTermsID>
    <DefaultBillingContact>
      <ContactId>4E8514CA-6E8E-45C4-9326-EA54349A1835</ContactId>
      <AddressId>134716</AddressId>
      <FirstName>John</FirstName>
      <LastName>Smith</LastName>
      <ZipCode>6509</ZipCode>
      <Address1>Langveien 1</Address1>
      <Address2 />
      <City>KRISTIANSUND N</City>
      <CountryCode>NO</CountryCode>
      <Phone>99999999</Phone>
      <WorkPhone />
      <Fax />
      <Company />
      <Department />
      <InvoiceNumber />
      <StateName>NO</StateName>
    </DefaultBillingContact>
    <DefaultShippingContact>
      <ContactId>37EEE4FE-8817-4647-89ED-6A1238932A9D</ContactId>
      <AddressId>204504</AddressId>
      <FirstName>John</FirstName>
      <LastName>Smith</LastName>
      <ZipCode>6509</ZipCode>
      <Address1>langveien 1</Address1>
      <Address2 />
      <City>KRISTIANSUND N</City>
      <CountryCode>NO</CountryCode>
      <Phone>99999999</Phone>
      <WorkPhone />
      <Fax />
      <Company />
      <Department />
      <StateName>NO</StateName>
    </DefaultShippingContact>
  </Customer>
  <BillingContact>
    <ContactId>4E8514CA-6E8E-45C4-9326-EA54349A1835</ContactId>
    <AddressId>419369</AddressId>
    <FirstName>John</FirstName>
    <LastName>Smith</LastName>
    <ZipCode>6509</ZipCode>
    <Address1>langveien 1</Address1>
    <Address2 />
    <City>KRISTIANSUND N</City>
    <CountryCode>NO</CountryCode>
    <Phone>99999999</Phone>
    <WorkPhone />
    <Fax />
    <Company />
    <Department />
    <InvoiceNumber />
    <StateName>NO</StateName>
  </BillingContact>
  <ShippingContact>
    <ContactId>37EEE4FE-8817-4647-89ED-6A1238932A9D</ContactId>
    <AddressId>419370</AddressId>
    <FirstName>John</FirstName>
    <LastName>Smith</LastName>
    <ZipCode>6509</ZipCode>
    <Address1>langveien 1</Address1>
    <Address2 />
    <City>KRISTIANSUND N</City>
    <CountryCode>NO</CountryCode>
    <Phone>99999999</Phone>
    <WorkPhone />
    <Fax />
    <Company />
    <Department />
    <StateName>NO</StateName>
  </ShippingContact>
  <OrderContent>
    <OrderLine>
      <OrderLineId>276548</OrderLineId>
      <ProductId>1891359</ProductId>
      <ProductName>PHENOM TRIPLE-CORE 2.3 GHZ L2=512KB CORE L3=2MB SOC AM2+ 95W PIB</ProductName>
      <BrandName>AMD</BrandName>
      <BrandId>270</BrandId>
      <BrandCode />
      <BrandSku>HD8650WCGHBOX</BrandSku>
      <VendorBrandSku>HD8650WCGHBOX</VendorBrandSku>
      <SellingPrice>721.6000</SellingPrice>
      <PriceWithoutDiscount>721.6000</PriceWithoutDiscount>
      <Qty>1</Qty>
      <Stock>3</Stock>
      <SnapStock>91</SnapStock>
      <ClaimNumber />
      <BundleName />
      <Cost>678.0000</Cost>
      <SalesTax>25.00</SalesTax>
      <Weight>1.80</Weight>
      <Comment />
      <Vendor>
        <Id>7</Id>
        <Name>GNT</Name>
        <ShortName>GNT</ShortName>
        <Code />
      </Vendor>
      <Category>
        <Id>36124</Id>
        <Name>Prosessorer</Name>
        <Code />
      </Category>
      <CategoryFolder>
        <Id>103086</Id>
        <Name>Prossessorer</Name>
        <Code />
      </CategoryFolder>
    </OrderLine>
    <OrderLine>
      <OrderLineId>276549</OrderLineId>
      <ProductId>1853623</ProductId>
      <ProductName>GA-MA78GM-S2H AMD AM2+ PHENOM AM2 ATHLON64 DDR2 1066 SATA 3GB S  16</ProductName>
      <BrandName>GIGABYTE</BrandName>
      <BrandId>139</BrandId>
      <BrandCode />
      <BrandSku>GA-MA78GM-S2H</BrandSku>
      <VendorBrandSku>GA-MA78GM-S2H</VendorBrandSku>
      <SellingPrice>467.2000</SellingPrice>
      <PriceWithoutDiscount>467.2000</PriceWithoutDiscount>
      <Qty>1</Qty>
      <Stock>100</Stock>
      <SnapStock>224</SnapStock>
      <ClaimNumber />
      <BundleName />
      <Cost>535.0000</Cost>
      <SalesTax>25.00</SalesTax>
      <Weight>2.70</Weight>
      <Comment />
      <Vendor>
        <Id>21</Id>
        <Name>Norek</Name>
        <ShortName>Norek</ShortName>
        <Code />
      </Vendor>
      <Category>
        <Id>36123</Id>
        <Name>Hovedkort</Name>
        <Code />
      </Category>
      <CategoryFolder>
        <Id>103046</Id>
        <Name>Hovedkort/Skjermkort/Lydkort</Name>
        <Code />
      </CategoryFolder>
    </OrderLine>
    <OrderLine>
      <OrderLineId>276550</OrderLineId>
      <ProductId>1824598</ProductId>
      <ProductName>DDR2 HyperX PC8500 4096MB CL5, Kit 4x matched HyperX 1GB DDR2</ProductName>
      <BrandName>KINGSTON</BrandName>
      <BrandId>5</BrandId>
      <BrandCode />
      <BrandSku>KHX8500D2K4/4G</BrandSku>
      <VendorBrandSku>KHX8500D2K4/4G</VendorBrandSku>
      <SellingPrice>621.6000</SellingPrice>
      <PriceWithoutDiscount>621.6000</PriceWithoutDiscount>
      <Qty>1</Qty>
      <Stock>1</Stock>
      <SnapStock>27</SnapStock>
      <ClaimNumber />
      <BundleName />
      <Cost>539.0000</Cost>
      <SalesTax>25.00</SalesTax>
      <Weight>0.10</Weight>
      <Comment />
      <Vendor>
        <Id>7</Id>
        <Name>GNT</Name>
        <ShortName>GNT</ShortName>
        <Code />
      </Vendor>
      <Category>
        <Id>36213</Id>
        <Name>Systemminne</Name>
        <Code />
      </Category>
      <CategoryFolder>
        <Id>103173</Id>
        <Name>Minne</Name>
        <Code />
      </CategoryFolder>
    </OrderLine>
    <OrderLine>
      <OrderLineId>276556</OrderLineId>
      <ProductId>334242</ProductId>
      <ProductName>Wireless-G PCI 54 Mbps 802.11g , WPA/AES</ProductName>
      <BrandName>LINKSYS</BrandName>
      <BrandId>366</BrandId>
      <BrandCode />
      <BrandSku>WMP54G</BrandSku>
      <VendorBrandSku>WMP54G</VendorBrandSku>
      <SellingPrice>209.6000</SellingPrice>
      <PriceWithoutDiscount>209.6000</PriceWithoutDiscount>
      <Qty>1</Qty>
      <Stock>147</Stock>
      <SnapStock>147</SnapStock>
      <ClaimNumber />
      <BundleName />
      <Cost>173.0000</Cost>
      <SalesTax>25.00</SalesTax>
      <Weight>0.24</Weight>
      <Comment />
      <Vendor>
        <Id>3</Id>
        <Name>Ingram Micro</Name>
        <ShortName>IM</ShortName>
        <Code />
      </Vendor>
      <Category>
        <Id>36180</Id>
        <Name>Trådløst Nettverk</Name>
        <Code />
      </Category>
      <CategoryFolder>
        <Id>102690</Id>
        <Name>Nettverk/Kommunikasjon</Name>
        <Code />
      </CategoryFolder>
    </OrderLine>
  </OrderContent>
  <VendorOrder>
    <Id>1000001</Id>
    <VendorId>3</VendorId>
    <VendorOrderNumber>3000007</VendorOrderNumber>
    <WebShopReference>10000AIX</WebShopReference>
    <TrackingNumber>
      <Number>CS3XXXXXXXXDK</Number>
      <TrackingUrl>http://example.com/Shipment.aspx?Number=CS3XXXXXXXXDK</TrackingUrl>
    </TrackingNumber>
    <TrackingNumber>
      <Number>CS5XXXXXXXXDK</Number>
      <TrackingUrl>http://example.com/Shipment.aspx?Number=CS5XXXXXXXXDK</TrackingUrl>
    </TrackingNumber>
  </VendorOrder>
  <VendorOrder>
    <Id>1000002</Id>
    <VendorId>7</VendorId>
    <VendorOrderNumber>700001</VendorOrderNumber>
    <WebShopReference>10000ZBZ</WebShopReference>
    <TrackingNumber>
      <Number>34000XXXXXXXXXXX09</Number>
      <TrackingUrl>http://example.com/Default.aspx?fraktnr=34000XXXXXXXXXXX09</TrackingUrl>
    </TrackingNumber>
    <TrackingNumber>
      <Number>34000XXXXXXXXXXX19</Number>
      <TrackingUrl>http://example.com/Default.aspx?fraktnr=34000XXXXXXXXXXX19</TrackingUrl>
    </TrackingNumber>
  </VendorOrder>
  <Settings>
    <DealerName>Default</DealerName>
    <CurrencyCode>NOK</CurrencyCode>
    <PaymentProfile>Default</PaymentProfile>
    <VatCode>353</VatCode>
    <FreightLineSku>FRAKT</FreightLineSku>
    <PaymentExternalCode />
    <CountryCode>NO</CountryCode>
    <DocumentVersion>1.02</DocumentVersion>
  </Settings>
</Order>