Skip to content

Sage 200 Online Purchase Payment XML

Purchase Payments are used to record a payment sent to a supplier against their account. Uploading a purchase payment will create a posted transaction, to download purchase payments see Sage 200 Online Purchase Transaction XML format. Further information can be found on the Sage 200 Online Purchase Payments API Documentation.

Tasks

Identifiers

external_id

Optional (recommended)
To prevent duplicate purchase payments 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

supplier_id

Dependant (see supplier)
Supplier record Id, can also be set using supplier reference, see supplier.

Type Example XML
integer(int64) 27006 <supplier_id>27006</supplier_id>

bank_id

Dependant (see bank)
Bank record Id, can also be set using bank code, see bank.

Type Example XML
integer(int64) 1 <bank_id>1</bank_id>

cheque_value

Required
Value of the receipt.

Type Example XML
number(decimal 2dp) 120 <cheque_value>120</cheque_value>

cheque_currency_id

Optional (see cheque_currency)
Receipt currency record Id, can also be set using cheque currency code, see cheque_currency.

Type Example XML
integer(int64) 1 <cheque_currency_id>1</cheque_currency_id>

supplier_cheque_value

Optional
Value to post to the supplier account.

Type Example XML
number(decimal 2dp) 120 <supplier_cheque_value>120</supplier_cheque_value>

transaction_date

Optional
Transaction date.

Type Example XML
datetime 2017-06-02T00:00:00 <transaction_date>2017-06-02T00:00:00</transaction_date>

exchange_rate

Optional
Exchange rate for the receipt.

Type Example XML
number(decimal 6dp) 1.000000 <exchange_rate>1.000000</exchange_rate>

bank_exchange_rate

Optional
Exchange rate for the supplier to the bank currency.

Type Example XML
number(decimal 6dp) 1.000000 <bank_exchange_rate>1.000000</bank_exchange_rate>

cheque_exchange_rate

Optional
Exchange rate for the supplier to the cheque currency.

Type Example XML
number(decimal 6dp) 1.000000 <cheque_exchange_rate>1.000000</cheque_exchange_rate>

settlement_discount_value

Optional
Settlement discount value.

Type Example XML
number(decimal 2dp) 0 <settlement_discount_value>0</settlement_discount_value>

reference

Optional
Receipt reference.

Type Example XML
string(20) PO 391823 <reference>PO 391823</reference>

second_reference

Optional
Receipt second reference.

Type Example XML
string(20) Order #12345 <second_reference>Order #12345</second_reference>

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 purchase receipt 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 purchase receipts are also included in the downloaded XML, these can also be used to set certain fields on purchase receipt uploads using lookups rather than needing to know the internal id of the related record.

supplier

Dependant (see supplier_id)
The purchase payment supplier. On an upload you can set the reference of the supplier to use for the purchase payment and Zynk will lookup the correct internal id from Sage.

Upload example using the reference

<supplier>
    <reference>ZYNK001</reference>
</supplier>

bank

Dependant (see bank_id)
The purchase receipts bank. On an upload you can set the code of the bank to use for the purchase receipt and Zynk will lookup the correct internal id from Sage.

Upload example using the code

<bank>
    <code>DEFAULT</code>
</bank>

cheque_currency

Optional (see cheque_currency_id)
The cheque currency of the receipt. On an upload you can set the code of the currency to use for the purchase receipt and Zynk will lookup the correct internal id from Sage.

Upload example using the code

<cheque_currency>
    <code>GBP</code>
</cheque_currency>

Example XML

Minimal Example

<?xml version="1.0" encoding="utf-8"?>
<PurchasePayments
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <PurchasePayment>
        <cheque_value>120</cheque_value>
        <bank>
            <code>1200</code>
        </bank>
        <supplier>
            <reference>ZYNK001</reference>
        </supplier>
    </PurchasePayment>
</PurchasePayments>

Full Example

<?xml version="1.0" encoding="utf-8"?>
<PurchasePayments
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <PurchasePayment>
        <external_id>12345</external_id>
        <supplier_id>27006</supplier_id>
        <cheque_value>120</cheque_value>
        <cheque_currency_id>1</cheque_currency_id>
        <customer_cheque_value>120</customer_cheque_value>
        <transaction_date>2017-06-02T00:00:00</transaction_date>
        <exchange_rate>1.000000</exchange_rate>
        <bank_exchange_rate>1.000000</bank_exchange_rate>
        <cheque_exchange_rate>1.000000</cheque_exchange_rate>
        <settlement_discount_value>0</settlement_discount_value>
        <reference>PO 391823</reference>
        <second_reference>Order #12345</second_reference>
        <bank>
            <code>1200</code>
        </bank>
        <supplier>
            <reference>ZYNK001</reference>
        </supplier>
        <cheque_currency>
            <code>GBP</code>
        </cheque_currency>
        <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>
    </PurchasePayment>
</PurchasePayments>