Sage 200 Online Sales Invoice XML
Sales Invoices are used to raise invoices against a customer's account. Uploading a sales invoice will create a posted transaction, to download sales invoices see Sage 200 Online Sales Transaction XML format. Further information can be found on the Sage 200 Online Sales Invoices API Documentation.
Tasks
Identifiers
external_id
Optional (recommended)
To prevent duplicate sales invoices being imported into Sage 200 we would recommend to always set the external_id field to a unique id from the source system. When the field is provided it will be stored within Zynk's internal database along with the URN assigned by Sage 200.
Type | Example | XML |
---|---|---|
string(255) | 12345 | <external_id>12345</external_id> |
Fields for Download and Upload
customer_id
Dependant (see customer)
Customer record Id, can also be set using customer reference, see customer.
Type | Example | XML |
---|---|---|
integer(int64) | 27006 | <customer_id>27006</customer_id> |
transaction_date
Optional
Transaction date.
Type | Example | XML |
---|---|---|
datetime | 2017-06-02T00:00:00 | <transaction_date>2017-06-02T00:00:00</transaction_date> |
due_date
Optional
Date the invoice is due to be paid.
Type | Example | XML |
---|---|---|
datetime | 2017-06-07T00:00:00 | <due_date>2017-07-02T00:00:00</due_date> |
exchange_rate
Optional
Exchange rate for the invoice.
Type | Example | XML |
---|---|---|
number(decimal 6dp) | 1.000000 | <exchange_rate>1.000000</exchange_rate> |
reference
Optional
Invoice reference.
Type | Example | XML |
---|---|---|
string(20) | PO 523452 | <reference>PO 523452</reference> |
second_reference
Optional
Invoice second reference.
Type | Example | XML |
---|---|---|
string(20) | Order #12345 | <second_reference>Order #12345</second_reference> |
settled_immediately
Optional
When set to 'true' this indicates that the invoice has been paid and any settlement discount has been applied.
Type | Example | XML |
---|---|---|
boolean() | false | <settled_immediately>false</settled_immediately> |
document_goods_value
Required
Value of goods.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 120 | <document_goods_value>100</document_goods_value> |
document_tax_value
Required
Tax value.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 120 | <document_tax_value>20</document_tax_value> |
document_discount_value
Required
Value of goods.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 120 | <document_discount_value>0</document_discount_value> |
document_tax_discount_value
Required
Amount VAT is discounted when a settlement discount is applied.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 120 | <document_tax_discount_value>0</document_tax_discount_value> |
discount_percent
Required
Percentage discount.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 0 | <discount_percent>0</discount_percent> |
discount_days
Required
Number of days to pay to qualify for the settlement discount.
Type | Example | XML |
---|---|---|
integer(int16) | 30 | <discount_days>30</discount_days> |
triangular_transaction
Optional
Indicates whether the transaction is triangulated.
Type | Example | XML |
---|---|---|
boolean() | false | <triangular_transaction>false</triangular_transaction> |
tax_analysis_items
Optional
Tax analysis lines. The <tax_analysis_items>
node is a collection of <tax_analysis_item>
nodes that allow you analyse the value of the sales invoice to specific tax codes. See full example XML below.
id
Dependant
Tax code record Id. Can be also looked us via the tax_code
node, see below.
Type | Example | XML |
---|---|---|
integer(int64) | 1 | <id>1</id> |
tax_code
Dependant
Tax code record Id.
Type | Example | XML |
---|---|---|
integer(int16) | 1 | <tax_code><code>1</code></tax_code> |
goods_amount
Optional
Goods amount. Must add up to the headline value set on the invoice.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 100 | <goods_amount>100</goods_amount> |
discount_amount
Optional
Discount amount. Must add up to the headline value set on the invoice.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 0 | <discount_amount>0</discount_amount> |
tax_amount
Optional
Tax amount. Must add up to the headline value set on the invoice.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 20 | <tax_amount>20</tax_amount> |
tax_discount_amount
Optional
Tax discount amount. Must add up to the headline value set on the invoice.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 0 | <tax_discount_amount>0</tax_discount_amount> |
nominal_analysis_items
Optional
Nominal analysis lines. The <nominal_analysis_items>
node is a collection of <nominal_analysis_item>
nodes that allow you analyse the value of the sales invoice to specific nominal codes. See full example XML below.
code
Required
Nominal account code.
Type | Example | XML |
---|---|---|
string(8) | 4000 | <code>4000</code> |
cost_centre
Optional
Cost centre. If specified must correspond to the code.
Type | Example | XML |
---|---|---|
string(3) | 020 | <cost_centre>020</cost_centre> |
department
Optional
Department. If specified must correspond to the code.
Type | Example | XML |
---|---|---|
string(3) | SAL | <department>SAL</department> |
value
Optional
Value to post to the nominal account.
Type | Example | XML |
---|---|---|
number(decimal 2dp) | 120 | <value>120</value> |
Expandable Fields
Related information linked to sales invoices are also included in the downloaded XML, these can also be used to set certain fields on sales invoice uploads using lookups rather than needing to know the internal id of the related record.
customer
Dependant (see customer_id)
The sales invoice customer. On an upload you can set the reference of the customer to use for the sales invoice and Zynk will lookup the correct internal id from Sage.
Upload example using the reference
<customer>
<reference>ZYNK001</reference>
</customer>
Example XML
Minimal Example
<?xml version="1.0" encoding="utf-8"?>
<SalesInvoices
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SalesInvoice>
<document_goods_value>100</document_goods_value>
<customer>
<reference>ZYNK001</reference>
</customer>
</SalesInvoice>
</SalesInvoices>
Full Example
<?xml version="1.0" encoding="utf-8"?>
<SalesInvoices
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SalesInvoice>
<external_id>12345</external_id>
<customer_id>27006</customer_id>
<transaction_date>2017-06-02T00:00:00</transaction_date>
<due_date>2017-07-02T00:00:00</due_date>
<exchange_rate>1.000000</exchange_rate>
<reference>PO 523452</reference>
<second_reference>Order #12345</second_reference>
<settled_immediately>false</settled_immediately>
<document_goods_value>100</document_goods_value>
<document_tax_value>20</document_tax_value>
<document_discount_value>0</document_discount_value>
<document_tax_discount_value>0</document_tax_discount_value>
<discount_percent>0</discount_percent>
<discount_days>30</discount_days>
<triangular_transaction>true</triangular_transaction>
<customer>
<reference>ZYNK001</reference>
</customer>
<tax_analysis_items>
<tax_analysis_item>
<id>1</id>
<tax_code>
<code>1</code>
</tax_code>
<goods_amount>100</goods_amount>
<discount_amount>0</discount_amount>
<tax_amount>20</tax_amount>
<tax_discount_amount>0</tax_discount_amount>
</tax_analysis_item>
</tax_analysis_items>
<nominal_analysis_items>
<nominal_analysis_item>
<code>5000</code>
<cost_centre>020</cost_centre>
<department>SAL</department>
<value>120</value>
</nominal_analysis_item>
</nominal_analysis_items>
</SalesInvoice>
</SalesInvoices>