The PostTrans XML API for Sage 200 provides to ability to update, or create Customer details in Sage 200, from a simple to understand XML file, which can be combined to update account details before importing and Sales Order, Invoice, Credit etc. See Transaction examples. Simple Order with Delivery Address with XML API for Sage 200
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 200 Company for the Sage 200 API to import or update Customer details and override settings which can also be set in XML_API_mappings.xml (“View >> Mapping Settings” menu) more info
Click here for an overview of the XML API for Sage 200
List of Examples
Example - 10 Simple Customer Account update.xml
<?xml version="1.0" ?>
<sage200Data>
<settings>
<companyCode>DEMO03</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_CUautoAddSaluation=1 //If Saluation not in Sage 200 list then add, else ignore value
CuCreditLimit,onlyOnCreate //Do not set if account already exisits
CuDefTaxCode,onlyOnCreate
CuUseDefTax,onlyOnCreate
CuCurrency,onlyOnCreate
</mappings>
</settings>
<Customer>
<CuRef>TEST02</CuRef>
<CuName>Comtek Accounts</CuName>
<CuMainAdd1>Venture House</CuMainAdd1>
<CuMainAdd2>Venture Court</CuMainAdd2>
<CuMainAdd3>Bolness Rd.</CuMainAdd3>
<CuMainAdd4>Wisbech</CuMainAdd4>
<CuMainPostcode>PE13 2QL</CuMainPostcode>
<CuSalutation>Mr</CuSalutation> <!-- Contact can only be updated on creation -->
<CuFirstName>Sam</CuFirstName>
<CuMiddleName></CuMiddleName>
<CuLastName>Smith</CuLastName>
<CuMPhCo>+44</CuMPhCo>
<CuMPhAr>1612</CuMPhAr>
<CuMPhNo>4762377</CuMPhNo>
<CuEmail1>ss@ss.com</CuEmail1>
<CuCreditLimit>1000</CuCreditLimit>
<CuCurrency>GBP</CuCurrency> <!-- GBP,USD -->
<CuDefTaxCode>1</CuDefTaxCode> <!-- 0=0%,1=Standard Rate, etc.-->
<CuUseDefTax>False</CuUseDefTax>
<CuTaxRegCode>612 5749 32</CuTaxRegCode> <!-- Will fail if not formated -->
<CuAccOpened>2020-02-20</CuAccOpened>
<CuTermsAgreed>True</CuTermsAgreed>
<CuAnal1>Alan Ward</CuAnal1> <!-- These are numbered in Sage 200 -->
<CuAnal2>CVR Coverings</CuAnal2>
<CuAnal3>B</CuAnal3>
<CuAnal4>Newspaper</CuAnal4>
<CuAnal5>MID Midlands</CuAnal5>
<CuAnal6>Midlands</CuAnal6>
</Customer>
</sage200Data>
Results in new or updated Sage 200 Customer:
Example - 20 Simple Customer update with external Reference.xml
In this example we have renamed the “CuRef” field, to “GUID”, which normally holds the account code using “CuRef=GUID”. And we have also defined CuSpareText1 to store the GUID value using the command “mappingCustomerCodeCounter("_","CuSpareText1")” and also name any new accounts “_0000001”, and then “_0000002” using a counter.
If another update is processed with same GUID number, stored in CuSpareText1, then PostTrans XML API will look up the Sage 200 Customer record. This can then be followed through to the Transactions import. SEE EXAMPLE
<?xml version="1.0" ?>
<sage200Data>
<settings>
<companyCode>DEMO03</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_CUautoAddSaluation=1 //If Saluation not in Sage 200 list then add, else ignore value
//Make system use and external GUID stored in Sage 200 user field on
//customer record called GUID, and refured to as GUID in XML
mappingCustomerCodeCounter("_","CuSpareText1") // Use CuSpareText1 to store/identify account ID
//CuRef will be a counter prefixed with "_", eg "_0000001" - MUST BE SPECIFIED
//The XML Value of "GUID" will no identify the account
// Renamed by THAccCode=GUID and CuRef=GUID later
//If auto generate account code is ON in Sage 200 then will be created by Sage 200
//If not Counter is stored in CustomerCounter.xml in settings folder
CuRef=GUID
CuCreditLimit,onlyOnCreate //Do not set if account already exisits
CuDefTaxCode,onlyOnCreate
CuUseDefTax,onlyOnCreate
CuCurrency,onlyOnCreate
</mappings>
</settings>
<Customer>
<GUID>12394568821252</GUID>
<CuName>Comtek Accounts</CuName>
<CuMainAdd1>Venture House</CuMainAdd1>
<CuMainAdd2>Venture Court</CuMainAdd2>
<CuMainAdd3>Bolness Rd.</CuMainAdd3>
<CuMainAdd4>Wisbech</CuMainAdd4>
<CuMainPostcode>PE13 2QL</CuMainPostcode>
<CuSalutation>Mr</CuSalutation>
<CuFirstName>Sam</CuFirstName>
<CuMiddleName></CuMiddleName>
<CuLastName>Smith</CuLastName>
<CuMPhCo>+44</CuMPhCo>
<CuMPhAr>1612</CuMPhAr>
<CuMPhNo>4762377</CuMPhNo>
<CuEmail1>ss@ss.com</CuEmail1>
<CuCreditLimit>1000</CuCreditLimit>
<CuCurrency>GBP</CuCurrency> <!-- GBP,USD,... ISO 4217:2015 -->
<CuDefTaxCode>1</CuDefTaxCode> <!-- 0=0%,1=Standard Rate, etc.-->
<CuUseDefTax>False</CuUseDefTax>
<CuTaxRegCode>612 5749 32</CuTaxRegCode> <!-- Will fail SAGE 200 API validation if not formated -->
<CuAccOpened>2020-02-20</CuAccOpened>
<CuTermsAgreed>True</CuTermsAgreed>
<CuAnal1>Alan Ward</CuAnal1> <!-- These are numbered in Sage 200 -->
<CuAnal2>CVR Coverings</CuAnal2>
<CuAnal3>B</CuAnal3>
<CuAnal4>Newspaper</CuAnal4>
<CuAnal5>MID Midlands</CuAnal5>
<CuAnal6>Midlands</CuAnal6>
</Customer>
</sage200Data>
Results in Accounts numbered and prefixed with "_"