XML API for Sage 50 Product Record
The PostTrans XML API for Sage 50 provides to ability to update, or create Product Record details in Sage 50, from a simple to understand XML file, which can be combined to update Product details before importing and Sales Order, Invoice, Credit, Product Adjustment etc.
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 Product 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 - 80 Product.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings 50_XML_API_mappings.xml
</mappings>
</settings>
<!-- see https://www.posttrans.co.uk/XML-API/XML-API-for-Sage-50/Product-Record -->
<Product>
<PrCode>TEST03</PrCode>
<PrDesc>Test product</PrDesc>
<PrCategory>1</PrCategory> <!-- Must be valid 1-999 -->
<PrCountryOrigin>GB</PrCountryOrigin>
<PrLocation>Under the shelf</PrLocation>
<PrSalesNom>4000</PrSalesNom> <!-- Must be valid -->
<PrPurchaseNom>5000</PrPurchaseNom> <!-- Must be valid -->
<PrTaxCode>1</PrTaxCode> <!-- Sage 50 0=0%,1=Standard Rate, etc.-->
<PrPartNo>2636fjje</PrPartNo> <!-- Supplier Part NO -->
<PrSuppAccount>NEW001</PrSuppAccount> <!-- Supplier account code -->
<PrDept>1</PrDept> <!-- Must be valid 1-99 -->
<PrSalesPrice>100</PrSalesPrice> <!-- Normal Sales Price -->
<PrLastCost>50</PrLastCost>
<PrLastCostDisc>48</PrLastCostDisc>
<PrCust1>User 1</PrCust1>
<PrCust2>User 2</PrCust2>
<PrCust3>User 3</PrCust3>
</Product>
</sage50Data>XML API Tags for Sage 50 'Product Record'
|
Tag Name |
Data Type |
Description |
|---|---|---|
|
PrCode |
Text 30 |
Stock Code |
|
PrType^ |
Text 1 |
Item Type |
|
PrDesc |
Text 60 |
Description (120 chars in 2023 onwards) |
|
PrCategory^ |
Integer |
Stock Category Number |
|
Product Details: | ||
|
PrCountryOrigin^ |
Text 2 |
Country code of origin. Irish data sets only. |
|
PrComCodeDesc |
Text 30 |
Com. Code Description |
|
PrIntrastatComCode |
Text 8 |
Intrastat Commodity Code |
|
PrIntrastatImportDutyCode |
Text 8 |
Intrastat Import Duty code |
|
PrSuppUnitQty |
Double |
Supplementary Unit Quantity |
|
PrWeight |
Double |
Unit of Weight |
|
PrBarCode |
Text 60 |
BarCode |
|
PrInactive |
Yes/No- |
Inactive Flag - yes/No |
|
PrLocation |
Text 16 |
Location |
|
Defaults: | ||
|
PrSalesNom^ |
Text 8 |
Nominal Code |
|
PrTaxCode^ |
Integer |
Tax Code (0 to 99) |
|
PrPurchaseNom^ |
Text 8 |
Purchase Nominal Code |
|
PrPartNo |
Text 16 |
Supplier`s Part Number |
|
PrSuppAccount^ |
Text 8 |
Supplier`s Account Reference |
|
PrDept^ |
Integer |
Department No |
|
PrLastPurPrice |
Currency |
Last Purchase Price |
|
PrLastCostDisc |
Currency |
Last Cost Discounted Price |
|
PrLastCost |
Currency |
Last Cost Price |
|
Sales Price: | ||
|
PrSalesPrice |
Currency |
Sale Price |
|
PrUnitOfSale |
Text 8 |
Unit of Sale |
|
Web: | ||
|
PrWebDescription |
Text 60 |
Web Description |
|
PrWebLongDesc |
Text 1023 |
Web Long Description |
|
PrWebPublish |
Yes/No- |
Web Publish Flag |
|
PrWebSpecialOffer |
Yes/No- |
Web Special Offer |
|
PrWebImage |
Text 60 |
Web Image Filename of the image which should be copied to the \ACCDATA\IMAGES sub folder of your data |
|
Custom Fields: | ||
|
PrCust1 |
Text 60 |
Custom Field 1 |
|
PrCust2 |
Text 60 |
Custom Field 2 |
|
PrCust3 |
Text 60 |
Custom Field 3 |
|
Memo: | ||
|
PrMemo |
Memo |
Stock Record Memo |
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.