PostTrans XML API for Sage 50 - Transactions
The PostTrans XML API for Sage 50 will import many kinds of transactions using a common format for all Sage 50 Transaction types, which is we hope easy to understand. The PostTrans XML API will lookup and missing data, such default nominals, Prices, etc if not given similar to entering a transaction in Sage 50.
For example, each transaction has a <THTransType> tag which denoted the type of transaction. “SI” is a Sales invoice, “PO” Purchase Order, “SO” Sales Order, “SIAT” is an Sales Invoice which posts to Sage 50 Audit Trail. Thus any of the examples below can be simply edited from say a Sales invoice, to a Purchase invoice. Note some fields are applicable to Sales and Purchase orders (and Sales Invoice module) these are listed in the table at the bottom of the page.
List of Tags/Entities for mapping are at bottom of page.
Click here for an overview of the XML API for Sage 50
Demo Video of Transaction Import
| 0:00 | Where everything is | |
| 0:45 | Explanation of XML | |
| 3:30 | If they Fail to Import |
Transaction Types:
- SQ,Sales Quote
- SO,Sales Order
- SI,Sales Invoice
- SSC,Sales Service Credit Note,
- SA,Payment on Account
- PO,Purchase Order
- PIA,Purchase Inv + Adj IN
- PC,Purchase Credit
- CP,Cash Payment
- CR,Cash Receipt
- SIAT,Sales Invoice Audit Trail
- SCAT,Sales Credit Audit Trail
- SSI,Sales Service Invoice,
- SC,Sales Credit Note
- PI,Purchase Batch Inv
- PR,Purchase Receipt
- BP,Bank Payment
- BR,Bank Receipt
- VP,Visa Credit Payment
- VR,Visa Credit Receipts
Sage 50 API Validation
After creating a Sage 50 Transaction, the XML file is moved to a processed folder. Or it could have been downloaded from an SFTP site or IMAPI e-mail address. If the process fails validation, then the error/errors are appended to the top of the file, and the file is moved to a Failed folder. A user can then easily edit the Transaction XML file and resubmit to PostTrans XML API for Sage 50.
Rounding
Rounding can often be a problem with importing from an external system, since the external system may not be rounding up the VAT the same as Sage 50. Below are a few examples of how you can either import a Net figure plus VAT amount from the external system or using Inclusive of VAT. Inclusive of VAT does not currently work with Sales/Purchase Orders and the Invoice Module.
List of Examples
Example - 100 SI Net Value.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_TLReadStockDescriptionFromXML=1 //If off all descriptions relating to stock come from stock record
SW_UpdateLedgerOnInvoices=0 // Post to ledger automatically (If update cannot be edited)
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>SI</THTransType>
<!-- Sage 50 Sales Invoice, SO would give Sales Order, SC Credit note, SIAT invoice to audit trail -->
<!-- Could also be PI, PO, PC -->
<THAccCode>TEST02</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- ===== Header Delivery ==== -->
<THDelName>My House</THDelName> <!-- Text 60 - Delivery Address Name. Double click to change delivery address -->
<THDelAdd1>23 Long Rd</THDelAdd1> <!-- Text 60 - Delivery Address Line 1. Double click to change delivery address -->
<THDelAdd2>Top of the hill</THDelAdd2> <!-- Text 60 - Delivery Address Line 2. Double click to change delivery address -->
<THDelAdd3>Willberry</THDelAdd3> <!-- Text 60 - Delivery Address Line 3. Double click to change delivery address -->
<THDelAdd4></THDelAdd4> <!-- Text 60 - Delivery Address Line 4. Double click to change delivery address -->
<THDelPostcode>PE13 2TY</THDelPostcode>
<THNotes1>More instructions</THNotes1> <!-- Text 60 - Notes 1 -->
<THNotes2></THNotes2> <!-- Text 60 - Notes 2 -->
<THNotes3></THNotes3>
<!-- Sage 50 allows the follwoing line types for Sales Orders and Invoice sent to Invoice module -->
<!-- manual VAT and Nominal overides not allowed for these types -->
<TransactionLine> <!-- Comment Line -->
<TLDesc>Please find invoice for 3 items and work done. Thanks :</TLDesc>
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Product Line -->
<TLProduct>CALC001</TLProduct>
<TLQty>1</TLQty>
<TLUnitPrice>250</TLUnitPrice> <!-- Tax will be added to this based on account defaults -->
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLQty>7</TLQty>
<TLUnitPrice>60</TLUnitPrice>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLProduct>CARRIAGE</TLProduct>
<TLDesc>Delivery to your door</TLDesc>
<TLUnitPrice>14.95</TLUnitPrice>
</TransactionLine>
<TransactionLine> <!-- Sage 50 Comment Line -->
<TLDesc>Please pay soon!!!</TLDesc>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example - 105 SC Credit note.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_TLReadStockDescriptionFromXML=1 //If off all descriptions relating to stock come from stock record
SW_UpdateLedgerOnInvoices=0 // Post to ledger automatically
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>SC</THTransType>
<!-- Sage 50 Sales Invoice, SO would give Sales Order, SC Credit note, SIAT invoice to audit trail -->
<!-- Could also be PI, PO, PC -->
<THAccCode>TEST02</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- ===== Header Delivery ==== -->
<THDelName>My House</THDelName> <!-- Text 60 - Delivery Address Name. Double click to change delivery address -->
<THDelAdd1>23 Long Rd</THDelAdd1> <!-- Text 60 - Delivery Address Line 1. Double click to change delivery address -->
<THDelAdd2>Top of the hill</THDelAdd2> <!-- Text 60 - Delivery Address Line 2. Double click to change delivery address -->
<THDelAdd3>Willberry</THDelAdd3> <!-- Text 60 - Delivery Address Line 3. Double click to change delivery address -->
<THDelAdd4></THDelAdd4> <!-- Text 60 - Delivery Address Line 4. Double click to change delivery address -->
<THDelPostcode>PE13 2TY</THDelPostcode>
<THNotes1>More instructions</THNotes1> <!-- Text 60 - Notes 1 -->
<THNotes2></THNotes2> <!-- Text 60 - Notes 2 -->
<THNotes3></THNotes3>
<!-- Sage 50 allows the follwoing line types for Sales Orders and Invoice sent to Invoice module -->
<!-- manual VAT and Nominal overides not allowed for these types -->
<TransactionLine> <!-- Comment Line -->
<TLDesc>Please a Credit for the goods returned</TLDesc>
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Product Line -->
<TLProduct>CALC001</TLProduct>
<TLQty>1</TLQty>
<TLUnitPrice>250</TLUnitPrice> <!-- Tax will be added to this based on account defaults -->
</TransactionLine>
<TransactionLine> <!-- Sage 50 Comment Line -->
<TLDesc>Thanks for your custom</TLDesc>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example - 110 SI Inclusive of VAT.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_TLReadStockDescriptionFromXML=1 //If off all descriptions relating to stock come from stock record
SW_UpdateLedgerOnInvoices=0 // Post to ledger automatically
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>SI</THTransType>
<!-- Sage 50 Sales Invoice, SO would give Sales Order, SC Credit note, SIAT invoice to audit trail -->
<!-- Could also be PI, PO, PC -->
<THAccCode>TEST02</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- ===== Header Delivery ==== -->
<THDelName>My House</THDelName> <!-- Text 60 - Delivery Address Name. Double click to change delivery address -->
<THDelAdd1>23 Long Rd</THDelAdd1> <!-- Text 60 - Delivery Address Line 1. Double click to change delivery address -->
<THDelAdd2>Top of the hill</THDelAdd2> <!-- Text 60 - Delivery Address Line 2. Double click to change delivery address -->
<THDelAdd3>Willberry</THDelAdd3> <!-- Text 60 - Delivery Address Line 3. Double click to change delivery address -->
<THDelAdd4></THDelAdd4> <!-- Text 60 - Delivery Address Line 4. Double click to change delivery address -->
<THDelPostcode>PE13 2TY</THDelPostcode>
<THNotes1>More instructions</THNotes1> <!-- Text 60 - Notes 1 -->
<THNotes2></THNotes2> <!-- Text 60 - Notes 2 -->
<THNotes3></THNotes3>
<!-- Sage 50 allows the follwoing line types for Sales Orders and Invoice sent to Invoice module -->
<!-- manual VAT and Nominal overides not allowed for these types -->
<TransactionLine> <!-- Comment Line -->
<TLDesc>Please find invoice for 3 items and work done. Thanks :</TLDesc>
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Product Line -->
<TLProduct>CALC001</TLProduct>
<TLQty>1</TLQty>
<TLTotIncluOfTax>300</TLTotIncluOfTax> <!-- Tax will be added to this based on account defaults -->
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLQty>7</TLQty>
<TLTotIncluOfTax>60</TLTotIncluOfTax>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLProduct>CARRIAGE</TLProduct>
<TLDesc>Delivery to your door</TLDesc>
<TLTotIncluOfTax>14.95</TLTotIncluOfTax>
</TransactionLine>
<TransactionLine> <!-- Sage 50 Comment Line -->
<TLDesc>Please pay soon!!!</TLDesc>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example - 160 SIAT Audit Trial Net.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>SIAT</THTransType>
<!-- Sage 50 Sales Invoice to Audit Trail -->
<THAccCode>ABS001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- Sage 50 Purchase Invoice to Audit Trail, these are quite simple and do note
have qty or products -->
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLUnitPrice>60</TLUnitPrice>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLDesc>Delivery to your door</TLDesc>
<TLUnitPrice>10</TLUnitPrice>
<TLOrdRefTxt>sam</TLOrdRefTxt> <!-- External Ref on each line -->
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example - 165 SIAT Audit Trial Inclusive of VAT.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>SIAT</THTransType>
<!-- Sage 50 Sales Invoice to Audit Trail, these are quite simple and do note
have qty or products -->
<THAccCode>ABS001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<THOrderNo>888347</THOrderNo>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Something</TLDesc>
<TLTotIncluOfTax>300</TLTotIncluOfTax> <!-- Tax will be added to this based on account defaults -->
<TLOrdRefTxt>sam</TLOrdRefTxt> <!-- Exteranle Ref on each line -->
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLTotIncluOfTax>60</TLTotIncluOfTax>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLDesc>Delivery to your door</TLDesc>
<TLTotIncluOfTax>14.95</TLTotIncluOfTax>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example – 170 PI Inclusive of VAT.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>PIA</THTransType>
<!-- Sage 50 Purchase Invoice to Audit Trail -->
<THAccCode>MCN001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- Sage 50 Purchase Invoice to Audit Trail, these are quite simple and do note
have qty or products -->
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLUnitPrice>60</TLUnitPrice>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLDesc>Delivery to your door</TLDesc>
<TLUnitPrice>10</TLUnitPrice>
<TLOrdRefTxt>sam</TLOrdRefTxt> <!-- External Ref on each line -->
</TransactionLine>
</TransactionHeader>
</sage50Data>
Example – 173 PIA Audit Trial Net.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>PIA</THTransType>
<!-- Sage 50 Purchase Invoice to Audit Trail -->
<THAccCode>MCN001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- Sage 50 Purchase Invoice to Audit Trail, these are quite simple and do note
have qty or products -->
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLUnitPrice>60</TLUnitPrice>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLDesc>Delivery to your door</TLDesc>
<TLUnitPrice>10</TLUnitPrice>
<TLOrdRefTxt>sam</TLOrdRefTxt> <!-- External Ref on each line -->
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example – 175 PIA Audit Trial Inclusive of VAT.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>PIA</THTransType>
<!-- Sage 50 Purchase Invoice to Audit Trail, these are quite simple and do note
have qty or products -->
<THAccCode>MCN001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<THOrderNo>888347</THOrderNo>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Something</TLDesc>
<TLTotIncluOfTax>300</TLTotIncluOfTax> <!-- Tax will be added to this based on account defaults -->
<TLOrdRefTxt>sam</TLOrdRefTxt> <!-- External Ref on each line -->
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLTotIncluOfTax>60</TLTotIncluOfTax>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLDesc>Delivery to your door</TLDesc>
<TLTotIncluOfTax>14.95</TLTotIncluOfTax>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example – 180 PO Net Value.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_TLReadStockDescriptionFromXML=1 //If off all descriptions relating to stock come from stock record
SW_UpdateLedgerOnInvoices=0 // Post to ledger automatically
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>PO</THTransType>
<!-- Sage 50 Purcahse Order, SO would give Sales Order, SC Credit note, SIAT invoice to audit trail -->
<!-- Could also be PI, PO, PC -->
<THAccCode>MCN001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- ===== Header Delivery ==== -->
<THDelName>My House</THDelName> <!-- Text 60 - Delivery Address Name. Double click to change delivery address -->
<THDelAdd1>23 Long Rd</THDelAdd1> <!-- Text 60 - Delivery Address Line 1. Double click to change delivery address -->
<THDelAdd2>Top of the hill</THDelAdd2> <!-- Text 60 - Delivery Address Line 2. Double click to change delivery address -->
<THDelAdd3>Willberry</THDelAdd3> <!-- Text 60 - Delivery Address Line 3. Double click to change delivery address -->
<THDelAdd4></THDelAdd4> <!-- Text 60 - Delivery Address Line 4. Double click to change delivery address -->
<THDelPostcode>PE13 2TY</THDelPostcode>
<THNotes1>More instructions</THNotes1> <!-- Text 60 - Notes 1 -->
<THNotes2></THNotes2> <!-- Text 60 - Notes 2 -->
<THNotes3></THNotes3>
<!-- Sage 50 allows the follwoing line types for Sales Orders and Invoice sent to Invoice module -->
<!-- manual VAT and Nominal overides not allowed for these types -->
<TransactionLine> <!-- Comment Line -->
<TLDesc>Please find invoice for 3 items and work done. Thanks :</TLDesc>
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Product Line -->
<TLProduct>CALC001</TLProduct>
<TLQty>1</TLQty>
<TLUnitPrice>250</TLUnitPrice> <!-- Tax will be added to this based on account defaults -->
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLQty>7</TLQty>
<TLUnitPrice>60</TLUnitPrice>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLProduct>CARRIAGE</TLProduct>
<TLDesc>Delivery to your door</TLDesc>
<TLUnitPrice>14.95</TLUnitPrice>
</TransactionLine>
<TransactionLine> <!-- Sage 50 Comment Line -->
<TLDesc>Please pay soon!!!</TLDesc>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example – 185 PO Inclusive of VAT.xml
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_TLReadStockDescriptionFromXML=1 //If off all descriptions relating to stock come from stock record
SW_UpdateLedgerOnInvoices=0 // Post to ledger automatically
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>PO</THTransType>
<!-- Sage 50 Purcahse Order, SO would give Sales Order, SC Credit note, SIAT invoice to audit trail -->
<!-- Could also be PI, PO, PC -->
<THAccCode>MCN001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- ===== Header Delivery ==== -->
<THDelName>My House</THDelName> <!-- Text 60 - Delivery Address Name. Double click to change delivery address -->
<THDelAdd1>23 Long Rd</THDelAdd1> <!-- Text 60 - Delivery Address Line 1. Double click to change delivery address -->
<THDelAdd2>Top of the hill</THDelAdd2> <!-- Text 60 - Delivery Address Line 2. Double click to change delivery address -->
<THDelAdd3>Willberry</THDelAdd3> <!-- Text 60 - Delivery Address Line 3. Double click to change delivery address -->
<THDelAdd4></THDelAdd4> <!-- Text 60 - Delivery Address Line 4. Double click to change delivery address -->
<THDelPostcode>PE13 2TY</THDelPostcode>
<THNotes1>More instructions</THNotes1> <!-- Text 60 - Notes 1 -->
<THNotes2></THNotes2> <!-- Text 60 - Notes 2 -->
<THNotes3></THNotes3>
<!-- Sage 50 allows the follwoing line types for Sales Orders and Invoice sent to Invoice module -->
<!-- manual VAT and Nominal overides not allowed for these types -->
<TransactionLine> <!-- Comment Line -->
<TLDesc>Please find invoice for 3 items and work done. Thanks :</TLDesc>
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Product Line -->
<TLProduct>CALC001</TLProduct>
<TLQty>1</TLQty>
<TLTotIncluOfTax>300</TLTotIncluOfTax> <!-- Tax will be added to this based on account defaults -->
</TransactionLine>
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLQty>7</TLQty>
<TLTotIncluOfTax>60</TLTotIncluOfTax>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLProduct>CARRIAGE</TLProduct>
<TLDesc>Delivery to your door</TLDesc>
<TLTotIncluOfTax>14.95</TLTotIncluOfTax>
</TransactionLine>
<TransactionLine> <!-- Sage 50 Comment Line -->
<TLDesc>Please pay soon!!!</TLDesc>
</TransactionLine>
</TransactionHeader>
</sage50Data>

Example – 195 SIAT Audit Trial + Seperate Payment SR + Allocation
First we post a SIAT to Audit Trial transaction for 'ABS001' with ref '8888'
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
<mappings>
mappingReset // Clear all settings XML_API_mappings.xml
SW_UseSystemExhangeRate=1 //Transaction will be un account currancy
</mappings>
</settings>
<TransactionHeader>
<THTransType>SIAT</THTransType>
<!-- Sage 50 Sales Invoice to Audit Trail -->
<THAccCode>ABS001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<THCustRef>8888</THCustRef>
<!-- Sage 50 Purchase Invoice to Audit Trail, these are quite simple and do note
have qty or products -->
<TransactionLine>
<!-- Sage 50 Service Line -->
<TLDesc>Reading 7hrs</TLDesc>
<TLNomCode>4001</TLNomCode> <!-- Nominal Account, defult overidden -->
<TLUnitPrice>60</TLUnitPrice>
</TransactionLine>
<TransactionLine>
<!-- Apply an additional charge -->
<TLDesc>Delivery to your door</TLDesc>
<TLUnitPrice>10</TLUnitPrice>
<TLOrdRefTxt>sam</TLOrdRefTxt> <!-- External Ref on each line -->
</TransactionLine>
</TransactionHeader>
</sage50Data>
Now we are allocate £10 by matching the account code 'ABS001' with the customer reference '8888'. Every 10 minutes, the PostTrans XML will rescan the debtor's list before importing this type of transaction, allowing it to match and allocate any outstanding amounts.
<?xml version="1.0" ?>
<sage50Data>
<settings> <!-- Optional overide settings/mappings -->
<companyCode>DEMO01</companyCode>
</settings>
<TransactionHeader>
<THTransType>SR</THTransType>
<!-- SR Sales Receipt -->
<THAccCode>MCN001</THAccCode> <!-- Currency and Tax will be set by account -->
<THTransDate>2017-02-20</THTransDate> <!-- Due date will be set automatically -->
<!-- And Match by either value below if given -->
<THCustRef>8888</THCustRef>
<THOrderNo></THOrderNo>
<!-- Pay with ref 12345677 £10 to bank 1200 -->
<THPayRef>12345677</THPayRef>
<THPayAmt>10</THPayAmt>
<THPayNom>1200</THPayNom>
<TransactionLine> <!-- Description in Payment -->
<TLDesc>Payment for XXX</TLDesc>
</TransactionLine>
</TransactionHeader>
</sage50Data>

XML API Tags for Sage 50 Entity 'TransactionHeader'
|
Tag Name |
Data Type |
Description |
|
Important Fields: |
||
|
TLProduct^ |
Text 30 |
Product code. Not used on Service Type Transactions. |
|
TLDesc |
Text 60 |
Product Description. PostTrans stops importing after finding 5 consecutive blank cells. |
|
TLQty^ |
Double |
Quantity, if Service Transaction then can be omitted, and lines with TLNett will have Qty 1. PRO – For Product Transactions - If switch 'ignore ZERO qty' 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 |
|
TLUnitPrice^ |
Currency |
Unit Price for each item. If cell is blank then PostTrans will lookup customer price on change of Qty, or adding a product. If option is on to override the price, in System setup >> Lookups >> Switches, then the customers price will overwrite any value already in cell, on change of Qty. Price will be after customer discount. PRO - If multi-currency is ON will be in account currency. |
|
TLDueDate |
Date |
Due Date for Invoice, Delivery Date on Order, Expire Date on Quote. Overides the date set on Header in THDueDate |
|
TLNomCode^ |
Text 8 |
Nominal Code, if not specified then uses default |
|
TLDepartment^ |
Integer |
Department, if not specified then uses default. Make sure the format of the cell is “General” else search may not work properly |
|
TLDiscValue^ |
Double |
Sales:Additional Discount Value to be applied to TLUnitPrice, Value should be specified in TLDiscValue OR TLDiscTotValue OR TLDiscPerc but not both cells. Note TLUnitPrice has already had any system discount applied on account record. |
|
TLDiscTotValue^ |
Double |
Sales:Additional Discount Value to be applied to Line, Value should be specified in TLDiscValue OR TLDiscTotValue OR TLDiscPerc but not both cells. Note TLUnitPrice has already had any system discount applied on account record. |
|
TLDiscPerc^ |
Double |
Sales:Additional Discount Percent to be applied to TLUnitPrice, Value should be specified in TLDiscValue OR TLDiscTotValue OR TLDiscPerc but not both cells. Note TLUnitPrice has already had any system discount applied on account record. |
|
TLTotIncluOfTax |
Currency |
Line Total inclusive of Tax. PostTrans will calculate Tax and Unit Price back from Inclusive Tax Total for Line given Qty and overcome rounding problems. Use THNetDiscount to account for discount. Best choice when importing data as reduces rounding problems |
|
Text: |
||
|
TLComment1 |
Text 60 |
Comment1 on line. If system settings ‘Large Product Description word wrap in Comment1/2’ is ON and ‘Read Product description from spreadsheet’ then will word wrap Description into these fields |
|
TLComment2 |
Text 60 |
Comment2 |
|
TLJobRef |
Text 60 |
Project Ref |
|
TLOrdRefTxt |
Text 30 |
Line Order Ref Text (only visible on SI/SO), ExtRef on PI/PC/SIAT/SA/SR/PR |
|
TLLineInfo |
Text 60 |
Line Information, N/A for PI/PC |
|
TLOrdRefNo |
Integer |
Line Order Ref Number (only visible on SI/SO) |
|
Tax: |
||
|
TLTaxManAmount |
Currency |
TTax Amount, per item, if calculated manually. Use with Caution as you are responsible for calculating Tax correctly. |
|
TLTaxManTotAmount |
Currency |
Tax Amount if calculated manually. Use with Caution as you are responsible for calculating Tax correctly. |
|
TLTaxCode^ |
Integer |
Tax Code. Will fill in default if blank. Make sure the format of the cell is “General” else search may not work properly |
|
Transaction Header: |
||
|
THTransType^ |
Text 2 Head |
Transaction Type. Make sure the format of the cell is “General” else search may not work properly. Must be specified on each line. |
|
THAccCode^ |
Text 8 Head |
Transaction Account Code. Customer or Supplier depending on Transaction Type. |
|
THTransDate |
Date Head |
Transaction Date |
|
THDueDate |
Date Head |
Due Date for Delivery Date on Order, Expire Date on Quote. SO/PO only |
|
THAccName |
Text 60 Head |
Customer Account Name |
|
THAdd1 |
Text 60 Head |
Customer Address 1 |
|
THAdd2 |
Text 60 Head |
Customer Address 2 |
|
THAdd3 |
Text 60 Head |
Customer Address 3 |
|
THAdd4 |
Text 60 Head |
Customer Address 4 |
|
THAddPostcode^ |
Text 60 Head |
Customer Postcode. If Postcode Search is enabled in ‘Setup >> Lookup >> Address Lookup’ then enter Space or Space + Postcode to search for an address. |
|
THContact |
Text 30 Head |
Customer Contact Name |
|
THPhone |
Text 30 Head |
Customer/Supplier Telephone Number SO/PO only |
|
Currency: |
||
|
THCurrency^ |
Integer Head |
Currency, will be set after selecting an account, any prices then altered will be in that currency. |
|
THCurExch |
Double Head |
Use System Exchange Rate, unless option changed in PostTrans system settins |
|
Carriage: |
||
|
THCarrCourierNo^ |
Integer HeadOnly |
Carriage Courier Number. Make sure the format of the cell is “General” else search may not work properly |
|
THCarrConsNo |
Text 30 HeadOnly |
Consign Number |
|
THCarrNet^ |
Currency HeadOnly |
Carriage Net Amount, else value in Sage Line 50 SOP Settings |
|
THCarrTaxCode^ |
Integer HeadOnly |
Carriage Tax Code, else uses Account Default. Make sure the format of the cell is “General” else search may not work properly |
|
THCarrDepartment^ |
Integer HeadOnly |
Carriage Department, else value in Sage Line 50 SOP Settingst. Make sure the format of the cell is “General” else search may not work properly |
|
THCarrNomCode^ |
Text 8 HeadOnly |
Carriage Nominal Code, else value in Sage Line 50 SOP Settings |
|
Footer: |
||
|
THGlobalNomCode^ |
Text 8 Head |
Footer - Global Overide Nominal Code |
|
THGlobalDep^ |
Integer Head |
Footer - Overide Department |
|
THGlobalDetails |
Text 60 Head |
Footer - Overide Details |
|
THGlobalTaxCode^ |
Integer Head |
Footer - Overide Tax Code. |
|
Header Delivery: |
||
|
THDelName |
Text 60 Head |
Delivery Address Name. Double click to change delivery address |
|
THDelAdd1 |
Text 60 Head |
Delivery Address Line 1. Double click to change delivery address |
|
THDelAdd2 |
Text 60 Head |
Delivery Address Line 2. Double click to change delivery address |
|
THDelAdd3 |
Text 60 Head |
Delivery Address Line 3. Double click to change delivery address |
|
THDelAdd4 |
Text 60 Head |
Delivery Address Line 4. Double click to change delivery address |
|
THDelPostcode^ |
Text 60 Head |
Delivery Postcode. PRO -If Postcode Search is enabled in ‘Setup >> Lookup >> Address Lookup’ then enter Space or Space + Postcode to search for an address. |
|
Project (Pro): |
||
|
TLProject^ |
Text 12 |
Project code where appropriate |
|
THProject^ |
Text 12 HeadOnly |
Project code where appropriate |
|
TLCostCode^ |
Text 8 |
Cost Code on Transaction line |
|
THCostCode^ |
Text 8 HeadOnly |
Cost Code on Transaction line, but default can be set on header for greater flexability, where appropriate |
|
Header Text: |
||
|
THCustRef |
Text 30 Head |
Customer`s Order Number |
|
THOrderNo |
Text 7 Head |
Order Number can be set on SI |
|
THDetails |
Text 60 Head |
Details on PI |
|
THDUNSRef |
Text 9 Head |
DUNS credit reference number |
|
THNotes1 |
Text 60 Head |
Notes 1 |
|
THNotes2 |
Text 60 Head |
Notes 2 |
|
THNotes3 |
Text 60 Head |
Notes 3 |
|
THPracSolRef |
Text 60 Head |
Sage Practice Solutions Reference |
|
THTakenBy |
Text 60 Head |
Order Taken By |
|
Header Discount: |
||
|
THNetDiscount |
Currency Head |
Net Discount Value applied to whole transaction, as shown at the bottom of Sage Line 50 Order. |
|
THNetDiscDesc |
Text 60 HeadOnly |
Net Discount Description. If used in lines then is the sum of values |
|
Header Payment: |
||
|
THPayAmt |
Double Head |
Amount Prepaid. Option in 'Setup >> Switches’, can stop posting if UNDER or OVER paid. If used in lines, then posts sum of all lines |
|
THPayRef |
Text 30 Head |
Payment Reference |
|
THPayType^ |
Text 2 Head |
Payment Type (PAR/SR/SA). SI or SO should be SA, Post as Type SIAT (SI to Audit Trail) fro SR allocation |
|
THPayNom^ |
Integer Head |
Payment Bank Nominal |
|
Analysis: |
||
|
THAnal1 |
Text Head |
Transaction Analysis 1 |
|
THAnal2 |
Text Head |
Transaction Analysis 2 |
|
THAnal3 |
Text Head |
Transaction Analysis 3 |
|
TLDonFund^ |
Integer |
Charity Fund Number |
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.
