PostTrans XML API for Sage 200 - Stock Adjustments
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
- 300 Stock Adjust.xml
- 310 Stock Adjust OUT and Write Off.xml
- 330 Stock Adjust Goods Return OUT.xml
- List Of Tags used
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>
XML API Tags for Sage 200 Entity 'StockAdjHeader'
|
Tag Name |
Data Type |
Description |
|
Header Values: |
||
|
THAdjType^ |
Text 2 HeadOnly |
Type of Adjustment, basically sets the IN/OUT for TLQty |
|
THAccRef^ |
Text 8 Head |
Customer/Supplier Ref. Must be set to Customer or Supplier for Stock adjustment type FO or GR |
|
THTranRef |
Text 20 Head |
Transaction Reference, overides vallue set on Header |
|
THTranRef2 |
Text 20 Head |
Transaction Reference2, overides vallue set on Header |
|
THTransDate |
Date Head |
Transaction Date, overides the date set on Header |
|
THProjectCode^ |
Text 30 Head |
Project if Project stock issue. Can be Projectcode/Phase |
|
TLProject^ |
Text 12 |
Project |
|
TLPhaseFilter^ |
Text 30 |
Phase Filter. If project has duplicate Project items in different phases, this can direct to correct Phase |
|
TLCostCode^ |
Text 8 |
Cost Code |
|
Adjustment Lines: |
||
|
TLStock^ |
Text 30 |
Product Description. PostTrans stops importing after finding 5 consecutive blank cells. |
|
TLDetails |
Text 60 |
Details |
|
TLQty^ |
Double |
Quantity IN/OUT |
|
Location: |
||
|
TLLoc^ |
Text 20 |
Location. DoubleClick to see Stock Levels |
|
TLContraLoc^ |
Text 20 |
Contra Location, Use this to move stock between locations. Set type to "1,Adjustment In" makes TLQty,TLLoc,TLBin the IN Qty/location, and thus a Ref in TLMoveLoc,TLMoveBin specify the Location and Bin to move stock from. |
|
TLContraBin^ |
Text 20 |
Contrat Bin Location. Set to 'Unspecified' if column not in template. |
|
TLCostPrice |
Currency |
Cost Price |
|
TLStdPrice |
Currency |
Std Sales Price |
|
TLSellByDate |
Date |
Sell lBy Date |
|
TLUseByDate |
Date |
Use By Date |
|
TLBatSerial^ |
Text 30 |
Batch Ref or for Serial then a comma seperated list or list with each on new line. DoubleClick to see Stock Levels |
|
TLBatSerRef |
Text 30 |
Batch/Serial Ref. Searching is provided on AO when location/BIN has been entered |
|
THWoCategory^ |
Text 20 Head |
Write Off Category |
|
Analysis Codes: |
||
|
TLAnal1^ |
Text 60 |
Analyisis code 1 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal2^ |
Text 60 |
Analyisis code 2 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal3^ |
Text 60 |
Analyisis code 3 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal4^ |
Text 60 |
Analyisis code 4 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal5^ |
Text 60 |
Analyisis code 5 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal6^ |
Text 60 |
Analyisis code 6 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal7^ |
Text 60 |
Analyisis code 7 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal8^ |
Text 60 |
Analyisis code 8 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal9^ |
Text 60 |
Analyisis code 9 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal10^ |
Text 60 |
Analyisis code 10 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal11^ |
Text 60 |
Analyisis code 11 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal12^ |
Text 60 |
Analyisis code 12 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal13^ |
Text 60 |
Analyisis code 13 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal14^ |
Text 60 |
Analyisis code 14 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal15^ |
Text 60 |
Analyisis code 15 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal16^ |
Text 60 |
Analyisis code 16 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal17^ |
Text 60 |
Analyisis code 17 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal18^ |
Text 60 |
Analyisis code 18 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal19^ |
Text 60 |
Analyisis code 19 - Setup View >> Analaysis code menu option will list mapping numbers and values |
|
TLAnal20^ |
Text 60 |
Analyisis code 20 - Setup View >> Analaysis code menu option will list mapping numbers and values |
Req = Field is required EOF = End of file, Stop when no more values
Head A header tag can be used in header section, before row 30, of the transaction template. Or in the rows data of data, below row 30, of the template like a traditional CSV importer.
With data type Yes/No fields, if cell starts with 'y' or 'Y' is taken as TRUE
Where ^ denotes a In Cell Code Search, delete ^ at end of tag, to turn off code search
All Text fields are trimmed (spaces before) by default. Add ' to the end of the tag name to stop this.
