The XML API for Sage 200 can easily create stock transfers in Sage 200, or write off stock, etc. An XML file is submitted to import folder, and PostTrans XML API will process it creating a Stock movement in your Sage 200 company.
After creating a Stock movement, the XML file is moved to a processed folder. If the process fails validation, then the error/errors are appended to the top of the file, and the file is moved to a Fail folder. A user can then easily edit the Stock Movement XML file and resubmit to PostTrans XML API for Sage 200.
Click here for an overview of the XML API for Sage 200
List of Examples
Example – 300 Stock Adjust.xml
<?xml version="1.0" ?>
<sage200Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO03</companyCode>
<mappings>
SW_ADJignoreInsufficientFreeStockException=1
SW_ADJignoreStockLevelBelowZeroException=1
SW_ADJcreateBinsIfNeedBe=1
</mappings>
</settings>
<AdjHeader>
<!-- ===== Header ==== -->
<THAdjType>AO</THAdjType> <!-- Text 2 - Type of Adjustment, basically sets the IN/OUT for TLQty -->
<!-- Values:AI,Adjustment In ,AO,Adjustment Out,FO,FOC OUT,PI,Project Issue,GR,Goods Return OUT,WO,Write Off-->
<THTranRef>My Test</THTranRef> <!-- Text 20 - Transaction Reference, overides vallue set on Header -->
<THTranRef2>My Test 2</THTranRef2> <!-- Text 20 - Transaction Reference2, overides vallue set on Header -->
<THTransDate>2020-02-20</THTransDate> <!-- Date - Transaction Date, overides the date set on Header -->
<!-- One or more lines -->
<AdjLine>
<!-- ===== Adjustment Lines ==== -->
<TLStock>CA/WALL/H70/OAK</TLStock> <!-- Text 30 - Stock Code -->
<TLQty>2</TLQty> <!-- Double - Quantity -->
<!-- OUT as set by 'AO' in <THAdjType> -->
<TLLoc>FACTORY</TLLoc> <!-- Text 20 - Location -->
<TLBin></TLBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
<!-- IN as Contra to above, if obmitted then stock will be Written Off -->
<TLLoc>WAREHOUSE</TLLoc> <!-- Text 20 - Location -->
<TLBin></TLBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
</AdjLine>
</AdjHeader>
</sage200Data>
Example – 310 Stock Adjust OUT and Write Off.xml
<?xml version="1.0" ?>
<sage200Data>
<settings> <!-- Optional overide API settings/mappings -->
<companyCode>DEMO03</companyCode>
<mappings>
SW_ADJignoreInsufficientFreeStockException=1
SW_ADJignoreStockLevelBelowZeroException=1
SW_ADJcreateBinsIfNeedBe=1 //Create Bins within a location if they dont exist
</mappings>
</settings>
<AdjHeader>
<!-- ===== Header ==== -->
<THAdjType>AO</THAdjType> <!-- Text 2 - Type of Adjustment, basically sets the IN/OUT for TLQty -->
<!-- Values:AI,Adjustment In ,AO,Adjustment Out,FO,FOC OUT,PI,Project Issue,GR,Goods Return OUT,WO,Write Off-->
<THTranRef>My Test</THTranRef> <!-- Text 20 - Transaction Reference, overides vallue set on Header -->
<THTranRef2>My Test 2</THTranRef2> <!-- Text 20 - Transaction Reference2, overides vallue set on Header -->
<THTransDate>2020-02-20</THTransDate> <!-- Date - Transaction Date, overides the date set on Header -->
<THWoCategory>Stock Write Offs</THWoCategory> <!-- Text 20 - Write Off Category -->
<!-- One or more lines -->
<AdjLine>
<!-- ===== Adjustment Lines ==== -->
<TLStock>IR/HINGE</TLStock> <!-- Text 30 - Sage 200 Stock Code -->
<TLQty>1</TLQty> <!-- Double - Quantity -->
<!-- OUT as set by 'AO' in <THAdjType> -->
<TLLoc>FACTORY</TLLoc> <!-- Text 20 - Location SHOWROOM,WAREHOUSE,FACTORY -->
<TLBin></TLBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
<!-- IN as Contra to above, if obmitted then stock will be Written Off -->
<TLContraLoc>SHOWROOM</TLContraLoc> <!-- Text 20 - Location -->
<TLContraBin>23</TLContraBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
</AdjLine>
<AdjLine>
<!-- ===== Write Off Stock ==== -->
<TLStock>IR/HINGE</TLStock> <!-- Text 30 - Sage 200 Stock Code -->
<TLQty>1</TLQty> <!-- Double - Quantity -->
<!-- OUT as set by 'AO' in <THAdjType> -->
<TLLoc>FACTORY</TLLoc> <!-- Text 20 - Location SHOWROOM,WAREHOUSE,FACTORY -->
<TLBin></TLBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
<!-- We have no IN location so stock is written off -->
</AdjLine>
</AdjHeader>
</sage200Data>
Example – 330 Stock Adjust Goods Return OUT.xml
<?xml version="1.0" ?>
<sage200Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO03</companyCode>
<mappings>
SW_ADJignoreInsufficientFreeStockException=1
SW_ADJignoreStockLevelBelowZeroException=1
SW_ADJcreateBinsIfNeedBe=1 //Create Bins within a location if they dont exist
</mappings>
</settings>
<AdjHeader>
<!-- ===== Header ==== -->
<THAdjType>GR</THAdjType> <!-- GR,Goods Return OUT -->
<!-- Values:AI,Adjustment In ,AO,Adjustment Out,FO,FOC OUT,PI,Project Issue,GR,Goods Return OUT,WO,Write Off-->
<THTranRef>My Test</THTranRef> <!-- Text 20 - Transaction Reference, overides vallue set on Header -->
<THTranRef2>My Test 2</THTranRef2> <!-- Text 20 - Transaction Reference2, overides vallue set on Header -->
<THTransDate>2020-02-20</THTransDate> <!-- Date - Transaction Date, overides the date set on Header -->
<THAccRef>ABC001</THAccRef> <!-- Text 8 - Customer/Supplier Ref. Must be set to Customer or Supplier for Stock adjustment type FO or GR -->
<AdjLine>
<!-- ===== Adjustment Lines ==== -->
<TLStock>IR/HINGE</TLStock> <!-- Text 30 - Stock Code -->
<TLQty>1</TLQty> <!-- Double - Quantity -->
<!-- OUT as set by 'AO' in <THAdjType> -->
<TLLoc>FACTORY</TLLoc> <!-- Text 20 - Location SHOWROOM,WAREHOUSE,FACTORY -->
<TLBin></TLBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
</AdjLine>
<AdjLine>
<!-- ===== Adjustment Lines ==== -->
<TLStock>IR/SCREW/4x20</TLStock> <!-- Text 30 - Stock Code -->
<TLQty>2</TLQty> <!-- Double - Quantity -->
<!-- OUT as set by 'AO' in <THAdjType> -->
<TLLoc>FACTORY</TLLoc> <!-- Text 20 - Location SHOWROOM,WAREHOUSE,FACTORY -->
<TLBin></TLBin> <!-- Text 20 - Bin Location. Set to 'Unspecified' if no value. -->
</AdjLine>
</AdjHeader>
</sage200Data>