Menu

Product Movement

XML API for Sage 50 Product Movement/Adjustment

The PostTrans XML API for Sage 50 provides to ability to create Product Movement/Adjustment Transactions in Sage 50, from a simple to understand XML file.

The following XML file if submitted to import directory or IMAP e-mail account. At the top of the XML file, we can optionally set the Sage 50 Company for the Sage 50 API to import the Project Movement/Adjustment Transaction.

List of Tags/Entities for mapping are at bottom of page.

Click here for an overview of the XML API for Sage 50

Example - 200 Product Movement AI.xml

Example of Adjustment IN of Products in Sage 50

<?xml version="1.0" ?>
<sage50Data>
   <!-- see https://www.posttrans.co.uk/XML-API/XML-API-for-Sage-50/Product-Adjustment -->
   <settings>  <!-- Optional overide settings/mappings -->
      <companyCode>DEMO01</companyCode>
      <mappings>
         mappingReset // Clear all settings XML_API_mappings.xml
      </mappings>
   </settings>
   
  <MoveHeader>  
     <THAdjType>AI</THAdjType>  
      <!-- Stock Adjustment Type,AI,Adjustment In ,AO,Adjustment Out,MI,Movement In,MO,Movement Out,
      GI,Goods IN,GO,Goods Out,GR,Goods Returned,DI,Damages In,DO,Damages Out,WO,Write Off    -->

      <THTranRef>WOP 2516</THTranRef>   <!-- Movement Referance -->
      <THTransDate>2021-02-20</THTransDate> 

      <MoveLine>
         <TLProduct>KEY001</TLProduct>
         <TLDetails>3 moved in for manufacture APP</TLDetails>
         <TLQty>3</TLQty>
         <TLCostPrice>250</TLCostPrice>  <!-- Optional, else will lookup value -->
      </MoveLine>
      
      <MoveLine>
         <TLProduct>CAS001</TLProduct>
         <!-- Product Description will be looked up -->
         <TLQty>3</TLQty>
      </MoveLine>
  </MoveHeader>
</sage50Data>

Example - 201 Product Movement AO.xml

Example of Adjustment OUT of Products in Sage 50

<?xml version="1.0" ?>
<sage50Data>
   <!-- see https://www.posttrans.co.uk/XML-API/XML-API-for-Sage-50/Product-Adjustment -->
   <settings>  <!-- Optional overide settings/mappings -->
      <companyCode>DEMO01</companyCode>
      <mappings>
         mappingReset // Clear all settings XML_API_mappings.xml
      </mappings>
   </settings>
   
  <MoveHeader>  
     <THAdjType>AO</THAdjType>  
      <!-- Stock Adjustment Type,AI,Adjustment In ,AO,Adjustment Out,MI,Movement In,MO,Movement Out,
      GI,Goods IN,GO,Goods Out,GR,Goods Returned,DI,Damages In,DO,Damages Out,WO,Write Off    -->

      <THTranRef>WOP 2516</THTranRef>   <!-- Movement Referance -->
      <THTransDate>2021-02-20</THTransDate> 

      <MoveLine>
         <TLProduct>ENV002</TLProduct>
         <TLDetails>Build WOP 2516</TLDetails>
         <TLQty>1</TLQty>
      </MoveLine>
      <MoveLine>
         <TLProduct>ENV003</TLProduct>
         <TLDetails>Build WOP 2516</TLDetails>
         <TLQty>2</TLQty>
      </MoveLine>
  </MoveHeader>
</sage50Data>

Example - 205 Product Movement WO.xml

Example of Write Off Products in Sage 50

<?xml version="1.0" ?>
<sage50Data>
   <!-- see https://www.posttrans.co.uk/XML-API/XML-API-for-Sage-50/Product-Adjustment -->
   <settings>  <!-- Optional overide settings/mappings -->
      <companyCode>DEMO01</companyCode>
      <mappings>
         mappingReset // Clear all settings XML_API_mappings.xml
      </mappings>
   </settings>
   
  <MoveHeader>  
   <THAdjType>WO</THAdjType>  
      <!-- Stock Adjustment Type,AI,Adjustment In ,AO,Adjustment Out,MI,Movement In,MO,Movement Out,
      GI,Goods IN,GO,Goods Out,GR,Goods Returned,DI,Damages In,DO,Damages Out,WO,Write Off    -->

   <THTranRef>Stock Take</THTranRef>   <!-- Movement Referance -->
   <THTransDate>2021-02-20</THTransDate> 

   <MoveLine>
      <TLProduct>ENV002</TLProduct>
      <TLDetails>Broken</TLDetails>
      <TLQty>1</TLQty>
   </MoveLine>

  </MoveHeader>
</sage50Data>

Example - 210 Product Movement GO.xml

Example of Goods Out Movement, relating to a Sales Order or Invoice, in Sage 50

<?xml version="1.0" ?>
<sage50Data>
   <!-- see https://www.posttrans.co.uk/XML-API/XML-API-for-Sage-50/Product-Adjustment -->
   <settings>  <!-- Optional overide settings/mappings -->
      <companyCode>DEMO01</companyCode>
      <mappings>
         mappingReset // Clear all settings XML_API_mappings.xml
      </mappings>
   </settings>
   
  <MoveHeader>  
     <THAdjType>GO</THAdjType>  
      <!-- Stock Adjustment Type,AI,Adjustment In ,AO,Adjustment Out,MI,Movement In,MO,Movement Out,
      GI,Goods IN,GO,Goods Out,GR,Goods Returned,DI,Damages In,DO,Damages Out,WO,Write Off -->

      <THTranRef>TEST02</THTranRef>   <!-- Movement Referance -->
      <THTransDate>2017-02-20</THTransDate> 

      <MoveLine>
         <!-- Sage 50 Product Line -->
         <TLProduct>KEY001</TLProduct>
         <TLDetails>3 moved in for manufacture APP</TLDetails>
         <TLQty>3</TLQty>
         <TLCostPrice>250</TLCostPrice>  
         
         <!-- GI/GO should relateto a PO/SO transaction -->
         <TLTransRef>31</TLTransRef> <!-- Ref to SO31 -->
         <TLTransRefType>2</TLTransRefType> <!-- Related to 1,Invoice,2,SOP,3,POP -->
      </MoveLine>
  </MoveHeader>
</sage50Data>

Example - 211 Product Movement GI.xml

Example of Goods In Movement, relating to a Purchase Order, in Sage 50

<?xml version="1.0" ?>
<sage50Data>
   <!-- see https://www.posttrans.co.uk/XML-API/XML-API-for-Sage-50/Product-Adjustment -->
   <settings>  <!-- Optional overide settings/mappings -->
      <companyCode>DEMO01</companyCode>
      <mappings>
         mappingReset // Clear all settings XML_API_mappings.xml
      </mappings>
   </settings>
   
  <MoveHeader>  
   <THAdjType>GI</THAdjType>  
      <!-- Stock Adjustment Type,AI,Adjustment In ,AO,Adjustment Out,MI,Movement In,MO,Movement Out,
      GI,Goods IN,GO,Goods Out,GR,Goods Returned,DI,Damages In,DO,Damages Out,WO,Write Off    -->

   <THTranRef>Stock Take</THTranRef>   <!-- Movement Referance -->
   <THTransDate>2021-02-20</THTransDate> 

   <MoveLine>
      <TLProduct>ENV002</TLProduct>
      <TLDetails>Delivery </TLDetails>
      <TLQty>1</TLQty>
      
      <!-- GI/GO should relateto a PO/SO transaction -->
      <TLTransRef>31</TLTransRef> <!-- Ref to PO31 -->
      <TLTransRefType>3</TLTransRefType> <!-- Related to 1,Invoice,2,SOP,3,POP -->
   </MoveLine>

  </MoveHeader>
</sage50Data>

XML API Tags for Sage 50 'Product Movement/Adjustment'

Tag Name

Data Type

Description

Important Header Fields:

THAdjType^

Text 3 Head

Transaction Reference, overides vallue set on Header
        In Cell Searching values:Stock Adjustment Type
                  AI, Adjustment In
                  AO, Adjustment Out
                  MI, Movement In
                  MO, Movement Out
                  GI, Goods IN
                  GO, Goods Out
                  GR, Goods Returned
                  DI, Damages In
                  DO, Damages Out
                  WO, Write Off

THTranRef

Text 30 Head

Transaction Reference, overides vallue set on Header

THTransDate

Date Head

Transaction Date, overides the date set on Header

Project (Pro):

THProject^

Text 12 Head

Project
    In Cell Searching values in table ProjectCode

THCostCode^

Text 8 Head

Cost Code
    In Cell Searching values in table ProjectCostCode

Adjustment Lines:

TLProduct^

Text 30

Product Description. PostTrans stops importing after finding 5 consecutive blank cells.
    In Cell Searching values in table ProdCodeNoDesc_STOCK

TLDetails

Text 60

Details

TLQty^

Double

Quantity, ignores any lines with zero qty. This allows a long product list to be listed, and user simply edit a qty to book IN/OUT
    Changes in this cell will recalc other cells. Delete ^ to disable this calculation.

TLCostPrice

Currency

Cost Price

TLSalesPrice

Currency

Sales Price

TLTransRef

Integer

For Good Out drill down put a valid Transactions Ref here. This is not validated so make sure it is correct

TLTransRefType^

Integer

Type of the above
        In Cell Searching values:Trans Ref Type
                  1, Invoice
                  2, SOP
                  3, POP

TLProject^

Text 12

Project
    In Cell Searching values in table ProjectCode

TLCostCode^

Text 8

Cost Code
    In Cell Searching values in table ProjectCostCode


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.