PostTrans XML API for Sage 50 - Customer Account
The PostTrans XML API for Sage 50 provides to ability to update, or create Customer details in Sage 50 , 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.
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 or update Customer details and override settings which can also be set in XML_API_mappings.xml (“View >> Mapping Settings” menu)
Click here for an overview of the XML API for Sage 50
List of Examples
Example - 10 Simple Customer Account update.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings 50_XML_API_mappings.xml
CuCreditLimit,onlyOnCreate //Do not set if account already exisits
CuTaxCode,onlyOnCreate
CuCurrency,onlyOnCreate
cuDateOpened,onlyOnCreate
</mappings>
</settings>
<Customer>
<CuCode>TEST03</CuCode>
<CuName>Comtek Accounts</CuName>
<CuAdd1>Venture House</CuAdd1>
<CuAdd2>Venture Court</CuAdd2>
<CuAdd3>Bolness Rd.</CuAdd3>
<CuAdd4>Wisbech</CuAdd4>
<CuPostcode>PE13 2QL</CuPostcode>
<CuContactName>Mr Sam Smith</CuContactName> <!-- Contact can only be updated on creation -->
<CuPhone>+44 945 463523</CuPhone>
<Cue-mail1>ss@ss.com</Cue-mail1>
<CuCreditLimit>1000</CuCreditLimit>
<CuCurrency>1</CuCurrency> <!-- 1,GBP,2,USD -->
<CuTaxCode>1</CuTaxCode> <!-- Sage 50 0=0%,1=Standard Rate, etc.-->
<CuVATRegNo>612 5749 32</CuVATRegNo>
<cuDateOpened>2020-02-20</cuDateOpened>
<CuTermsAgreed>True</CuTermsAgreed>
<CuSettDays>30</CuSettDays> <!-- 30 Days payment term -->
<CuAnal1>Midlands</CuAnal1>
<CuAnal2>CVR Coverings</CuAnal2>
<CuAnal3>B</CuAnal3>
</Customer>
</sage50Data>
Results in new or updated Sage 50 Customer:

XML API Tags for Sage 50 Entity 'Customer'
|
Tag Name |
Data Type |
Description |
|
Important Fields: |
||
|
CuCode |
Text 8 |
Account Reference |
|
Account Details: |
||
|
CuName |
Text 60 |
Account Name |
|
CuInactive |
Yes/No- |
Inactive Flag - yes/No |
|
Registered Address: |
||
|
CuAdd1 |
Text 60 |
Account Address Line 1 |
|
CuAdd2 |
Text 60 |
Account Address Line 2 |
|
CuAdd3 |
Text 60 |
Account Address Line 3 |
|
CuAdd4 |
Text 60 |
Account Address Line 4 |
|
CuPostcode^ |
Text 60 |
Account Postcode. If Postcode Search is enabled in ‘Setup >> Lookup >> Address Lookup’ then enter Space,Space + Postcode to search for an address. |
|
CuCountryCode^ |
Text 2 |
Country Code. |
|
CuVATRegNo |
Text 20 |
VAT Registration Number |
|
Contact Information: |
||
|
CuContactName |
Text 30 |
Contact Name |
|
CuTradeContact |
Text 30 |
Name of Trade Contact |
|
CuPhone |
Text 30 |
Telephone Number |
|
CuPhone2 |
Text 30 |
Second Telephone Number |
|
CuFax |
Text 30 |
Fax Number |
|
CuWWW |
Text 255 |
WWW Address |
|
e-mail Settings: |
||
|
Cue-mail1 |
Text 255 |
EMail Address |
|
Cue-mail2 |
Text 255 |
EMail Address 2 |
|
Cue-mail3 |
Text 255 |
EMail Address 3 |
|
Cue-mail4 |
Text 255 |
e-mail4 |
|
Cue-mail5 |
Text 255 |
e-mail5 |
|
Cue-mail6 |
Text 255 |
e-mail6 |
|
CuSendInvEmail |
Yes/No- |
Send Invoices To This Account via Email |
|
CuSendLettersEmail |
Yes/No- |
Send Letters To This Account via Email |
|
Defaults - Custom Fields: |
||
|
CuAnal1 |
Text 30 |
Analysis 1 |
|
CuAnal2 |
Text 30 |
Analysis 2 |
|
CuAnal3 |
Text 30 |
Analysis 3 |
|
CuAnal4 |
Text 30 |
Anal4 |
|
CuAnal5 |
Text 30 |
Anal5 |
|
CuAnal6 |
Text 30 |
Anal6 |
|
Defaults - Pricing and Discounting: |
||
|
CuDiscRate |
Double |
Discount Rate % |
|
CuDiscType^ |
Integer |
Discount Type |
|
CuPriceList^ |
Text 8 |
Price List Reference |
|
Defaults - Misc Defaults: |
||
|
CuNomCode^ |
Text 8 |
Default Nominal Code |
|
CuOverideProductNom |
Yes/No- |
Override Product Nominal Code in Invoicing |
|
CuTaxCode^ |
Integer |
Default Tax Code |
|
CuOverideProductTax |
Yes/No- |
Override the products own Tax Code. |
|
CuCurrency^ |
Integer |
Currency |
|
CuDepartment^ |
Text 2 |
Department Number |
|
Credit Control - Terms: |
||
|
CuCreditLimit |
Currency |
Credit Limit |
|
CuSettDays |
Integer |
Settlement Due Days |
|
CuSettDiscount |
Double |
Settlement Discount Rate |
|
CuPaymentDueDays |
Integer |
Payment Due Days |
|
CuAvgPayDays |
Integer |
Average Time To Pay |
|
CuTermsTxt |
Text 30 |
Terms |
|
CuCreditRef |
Text 60 |
Credit Bureau Reference |
|
CuBureau^ |
Integer |
Credit Bureau Used |
|
CuPriorityCust |
Yes/No- |
Priority Customer |
|
CuCreditPosition^ |
Integer |
Credit Position |
|
CuStatus^ |
Integer |
Account Status |
|
Credit Control - Restrictions: |
||
|
CuApplyCharges |
Yes/No- |
Can Charge Credit |
|
CuTermsAgreed |
Yes/No- |
Terms Agreed Flag |
|
CuHoldMail |
Yes/No- |
Restrict Mail |
|
CuOnHold |
Yes/No- |
Account On Hold |
|
Credit Control - Credit Review: |
||
|
cuDateOpened |
Date |
Date Account Opened |
|
CuLastCreditReview |
Date |
Date Last Credit Review |
|
CuNextCreditReview |
Date |
Date Next Credit Review |
|
CuApplicationDate |
Date |
Date Credit Applied For |
|
CuCreditAppRecived |
Date |
Date Credit Application Recieved |
|
CuMemo |
Memo |
Customer Notes |
|
Sales: |
||
|
CuFirstINV |
Date |
First Invoice Date |
|
CuLastInvDate |
Date |
Last Invoice Date |
|
CuLastReceipt |
Date |
Last Payment Date |
|
CuYTD |
Currency |
Turnover Year Date |
|
CuLYTD |
Currency |
Prior YTD |
|
Bank: |
||
|
CuBankName |
Text 60 |
Bank Name |
|
CuBankAdd1 |
Text 60 |
Bank Address Line 1 |
|
CuBankAdd2 |
Text 60 |
Bank Address Line 2 |
|
CuBankAdd3 |
Text 60 |
Bank Address Line 3 |
|
CuBankAdd4 |
Text 60 |
Bank Address Line 4 |
|
CuBankPostcode^ |
Text 60 |
Bank Address Postcode. If Postcode Search is enabled in ‘Setup >> Lookup >> Address Lookup’ then enter Space,Space + Postcode to search for an address. |
|
CuBankAccName |
Text 60 |
Bank Account Name |
|
CuBankSort |
Text 10 |
Bank Sort Code |
|
CuBankNumber |
Text 60 |
Bank Account Number |
|
Payment Details.: |
||
|
CuBacRef |
Text 60 |
Reference for BACS Transfer |
|
CuBankIBAN |
Text 60 |
Bank IBAN Number |
|
CuBankSwift |
Text 60 |
Bank BIC/Swift |
|
CuBankRollNo |
Text 60 |
Bank Roll Number |
|
CuBankAddRef1 |
Text 60 |
Bank Additional Ref 1 |
|
CuBankAddRef2 |
Text 60 |
Bank Additional Ref 2 |
|
CuBankAddRef3 |
Text 60 |
Bank Additional Ref 3 |
|
CuPaymentMethod^ |
Text 2 |
Payment Type. If BACS then sets CuOnlineReceipts=YES, other wise need to set manually |
|
CuOnlineReceipts |
Yes/No- |
BACS Online Receipts Flag. If CuPaymentMethod=BACS set other wise needs setting manuyally |
|
Payment Details: |
||
|
CuManager |
Text 60 |
Name of Account Manager |
|
CuCompReg |
Text 16 |
CompReg |
|
CuType^ |
Integer |
Account Type |
|
Building Society: |
||
|
CuBankBuildSocRef |
Text 60 |
Reference for Building Society Transfer |
|
CuBankUseBuildingSoc |
Yes/No- |
Account uses Building Society |
|
Credit Card: |
||
|
CuCreditAppRecieved |
Yes/No- |
True if Credit Application Received |
|
CuCCNumber |
Text 30 |
Credit Card Number |
|
Charity Donor: |
||
|
CuDonTitle |
Text 4 |
Charity Donor Title |
|
CuDonForname |
Text 35 |
Charity Donor Forename |
|
CuDonSurname |
Text 35 |
Charity Donor Surname |
|
CuDonFund^ |
Integer |
Charity Donation Fund Number |
|
CuDonGiftAid |
Yes/No- |
Charity Donor Gift Aid is enabled |
|
CuDonDecFrom |
Date |
Donor Declaration Valid From |
|
CuDonTyDonor |
Yes/No- |
Charity Donor Type Donor Flag |
|
CuDonTyMember |
Yes/No- |
Charity Donor Type Member Flag |
|
CuDonTyCust |
Yes/No- |
Charity Donor Type Customer Flag |
|
Charity Membership Details: |
||
|
CuDonMemberSince |
Date |
Member Since |
|
CuDonReminderDate |
Date |
Member Renewal Date |
|
CuDonReminderDays |
Integer |
Member Reminder Date (days) |
|
Other: |
||
|
CuSalesRep |
Text 60 |
Name of Sales Representative |
|
CuEcCode |
Text 3 |
EC Member Code |
|
CuDUNSno |
Text 9 |
DUNS Number |
Req = Field is required EOF = End of file, Stop when no more values
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.
