Skip to content

Sage Accounting Purchase Credit Note XML

Tasks

XML

Any Sage Accounting fields not documented below are not supported with our uploads.

A complete example of the XML is shown below. This represents the minimum information required to create a purchase credit note record in Sage Accounting:

<?xml version="1.0" encoding="utf-8"?>
<sage_one_company xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <purchase_credit_notes>
    <purchase_credit_note>
      <contact>
        <reference>ZYNK0001</reference>
      </contact>
      <date>2024-01-08T00:00:00</date>
      <credit_note_lines>
        <credit_note_line>
          <description>Free text item</description>
          <ledger_account>
            <nominal_code>5000</nominal_code>
          </ledger_account>
          <quantity>1</quantity>
          <unit_price>10</unit_price>
          <tax_rate>
            <id>GB_STANDARD</id>
          </tax_rate>
        </credit_note_line>
      </credit_note_lines>
    </purchase_credit_note>
  </purchase_credit_notes>
</sage_one_company>

Credit Note Identification

The following fields are use to identify the purchase credit note to create/update. If neither are provided, a new credit note will always be created.

Sage Field XML Field Example Field Type Input Notes
- id be4eca91e41411e7aa730a57719b2edb GUID Optional Sage's unique invoice ID.
- external_id inv-0001 string Optional The ID of this record from the source data. Will be stored in Zynk's truth table.
<?xml version="1.0" encoding="utf-8"?>
<sage_one_company
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <purchase_credit_notes>
    <purchase_credit_note>
      <id>be4eca91e41411e7aa730a57719b2edb</id>
      <external_id>inv-0001</external_id>
    </purchase_credit_note>
  </purchase_credit_notes>
</sage_one_company>

Supplier Selection

Each credit note must be assigned to an existing supplier in Sage. At least one of following fields must be provided to identify the supplier to assign the credit note to. If more than one is provided, Zynk will look for a match based on each field in turn, in the order they are listed below.

Sage Field XML Field Example Field Type Input Notes
Reference contact/reference ZYNK0001 string Optional
- contact/id 8a9b4b1f174c11e691e20a5d7cf84c3e GUID Optional Sage's unique supplier ID.
- contact/external_id 1234567 string Optional The ID of the supplier from the source data. Will only work if the supplier was imported into Sage via Zynk, and the same external_id was provided.
Company / Name contact/name Zynk Software string Optional
Main Contact > Email contact/email [email protected] string Optional
<?xml version="1.0" encoding="utf-8"?>
<sage_one_company
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <purchase_credit_notes>
    <purchase_credit_note>
      <contact>
        <reference>ZYNK0001</reference>
        <id>8a9b4b1f174c11e691e20a5d7cf84c3e</id>
        <external_id>1234567</external_id>
        <name>Zynk Software</name>
        <email>[email protected]</email>
      </contact>
    </purchase_credit_note>
  </purchase_credit_notes>
</sage_one_company>

Credit Note Details

The information below is in relation to the main credit note details.

Sage Field XML Field Example Field Type Input Notes
Credit Date date 2024-01-08 string Optional Will be set to today's date if not specified.
Supplier Reference vendor_reference 46261 string Required
Reference reference 12345 string Optional
Notes notes Leave at reception string Optional
- currency_id GBP string Optional Will default to the supplier's currency if not specified.
- exchange_rate 1.0 string Optional
<?xml version="1.0" encoding="utf-8"?>
<sage_one_company
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <purchase_credit_notes>
    <purchase_credit_note>
      <date>2024-01-08T00:00:00</date>
      <vendor_reference>46261</vendor_reference>
      <reference>12345</reference>
      <notes>Leave at reception</notes>
      <currency_id>GBP</currency_id>
      <exchange_rate>1.0</exchange_rate>
    </purchase_credit_note>
  </purchase_credit_notes>
</sage_one_company>

Item Details

The below information is in relation to the item line details. If a product item code is specified, a product line will be added to the credit note. If a service item code is specified, a service line will be added to the credit note. If no item code is specified, a free text line will be added.

Sage Field XML Field Example Field Type Input Notes
Product/Service product/item_code PENCIL-50 string Dependant Required to add a product line to the credit note
Product/Service service/item_code LABOUR string Dependant Required to add a service line to the credit note
Description description Colouring Pencils - 50pk string Required
Ledger Account ledger_account/nominal_code 5000 string Dependant Either the ledger account name, display name or nominal code must be provided
Ledger Account ledger_account/name Cost of sales - goods string Dependant Either the ledger account name, display name or nominal code must be provided
Ledger Account ledger_account/display_name Cost of sales - goods (5000) string Dependant Either the ledger account name, display name or nominal code must be provided
Qty/Hrs quantity 2 double Required
Price/Rate unit_price 8.33 double Required
VAT Rate tax_rate/id GB_STANDARD string Dependant Either the tax rate ID or name must be provided
VAT Rate tax_rate/name Standard 20.00% string Dependant Either the tax rate ID or name must be provided
<?xml version="1.0" encoding="utf-8"?>
<sage_one_company
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <purchase_credit_notes>
    <purchase_credit_note>
      <credit_note_lines>
        <!-- Product line -->
        <credit_note_line>
          <product>
            <item_code>PENCIL-50</item_code>
          </product>
          <description>Colouring Pencils - 50pk</description>
          <ledger_account>
            <nominal_code>5000</nominal_code>
            <name>Cost of sales - goods</name>
            <display_name>Cost of sales - goods (5000)</display_name>
          </ledger_account>
          <quantity>1</quantity>
          <unit_price>10</unit_price>
          <tax_rate>
            <id>GB_STANDARD</id>
            <name>Standard 20.00%</name>
          </tax_rate>
        </credit_note_line>
        <!-- Service line -->
        <credit_note_line>
          <service>
            <item_code>LABOUR</item_code>
          </service>
          <description>Labour</description>
          <ledger_account>
            <nominal_code>5000</nominal_code>
          </ledger_account>
          <quantity>6.5</quantity>
          <unit_price>10</unit_price>
          <tax_rate>
            <id>GB_STANDARD</id>
          </tax_rate>
        </credit_note_line>
        <!-- Free text line -->
        <credit_note_line>
          <description>Colouring Pencils - 50pk</description>
          <ledger_account>
            <nominal_code>5000</nominal_code>
          </ledger_account>
          <quantity>1</quantity>
          <unit_price>10</unit_price>
          <tax_rate>
            <id>GB_STANDARD</id>
          </tax_rate>
        </credit_note_line>
      </credit_note_lines>
    </purchase_credit_note>
  </purchase_credit_notes>
</sage_one_company>