Xero templates

Template examples that can be used as basis for your own

General settings

Template name *

xero

Datatype to export

Invoices

File name *

xero_{DATETIME}

File type

csv

Decimal separator

dot

Linebreak

Windows

Quotes

None

If empty field, use quotes?

No

Encoding

UTF-8

Fields marked with * can be changed to your own preference.

Content

Below are two examples for a an Xero export file. They differ in how the date is formatted, other than that it's the same.

The number of columns and order of columns can not be changed. These are according to the Xero template for file import.

UK Date format

ContactName,EmailAddress,POAddressLine1,POAddressLine2,POAddressLine3,POAddressLine4,POCity,PORegion,POPostalCode,POCountry,SAAddressLine1,SAAddressLine2,SAAddressLine3,SAAddressLine4,SACity,SARegion,SAPostalCode,SACountry,InvoiceNumber,Reference,InvoiceDate,DueDate,PlannedDate,Total,TaxTotal,InvoiceAmountPaid,InvoiceAmountDue,InventoryItemCode,Description,Quantity,UnitAmount,Discount,LineAmount,AccountCode,TaxType,TaxAmount,TrackingName1,TrackingOption1,TrackingName2,TrackingOption2,Currency,Type,Sent,Status
<#list invoices as i>
<#list i.invoiceLines as il>
#{i.customerName},#{i.supplierEmail},"#{i.customerAddress.addressLine1}","#{i.customerAddress.addressLine2}","#{i.customerAddress.addressLine3}",,"#{i.customerAddress.postalPlace}",,"#{i.customerAddress.postalCode}",#{i.customerAddress.countryCode},,,,,,,,,#{i.invoiceNumber},#{i.orderReference},#{i.issueDate?dd/MM/yyyy},#{i.dueDate?dd/MM/yyyy},,#{i.totalSumIncludingTaxAfterRounding},,,,,"#{il.itemName}",#{il.quantity},#{il.unitPrice},#{il.lineDiscount},#{il.sumNetAmount},#{il.financialAccount.accountNumber},${taxType(il.vatPercentage)},#{il.estimatedInvoiceLineVat},,,,,#{i.currencyCode},Sales Invoice,Sent,Awaiting Payment
</#list>
</#list>

<#function taxType t>
  <#if t == 0>
    <#return 'No VAT'>
  </#if>
  <#return t+'%'>
</#function>

US Date format

ContactName,EmailAddress,POAddressLine1,POAddressLine2,POAddressLine3,POAddressLine4,POCity,PORegion,POPostalCode,POCountry,SAAddressLine1,SAAddressLine2,SAAddressLine3,SAAddressLine4,SACity,SARegion,SAPostalCode,SACountry,InvoiceNumber,Reference,InvoiceDate,DueDate,PlannedDate,Total,TaxTotal,InvoiceAmountPaid,InvoiceAmountDue,InventoryItemCode,Description,Quantity,UnitAmount,Discount,LineAmount,AccountCode,TaxType,TaxAmount,TrackingName1,TrackingOption1,TrackingName2,TrackingOption2,Currency,Type,Sent,Status
<#list invoices as i>
<#list i.invoiceLines as il>
#{i.customerName},#{i.supplierEmail},"#{i.customerAddress.addressLine1}","#{i.customerAddress.addressLine2}","#{i.customerAddress.addressLine3}",,"#{i.customerAddress.postalPlace}",,"#{i.customerAddress.postalCode}",#{i.customerAddress.countryCode},,,,,,,,,#{i.invoiceNumber},"#{i.projectNumber} - #{i.projectName}",#{i.issueDate?MM/dd/yyyy},#{i.dueDate?MM/dd/yyyy},,#{i.totalSumIncludingTaxAfterRounding},,,,,"#{il.itemName}",#{il.quantity},#{il.unitPrice},#{il.lineDiscount},#{il.sumNetAmount},#{il.financialAccount.accountNumber},${taxType(il.vatPercentage)},#{il.estimatedInvoiceLineVat},,,,,#{i.currencyCode},Sales Invoice,Sent,Awaiting Payment
</#list>
</#list>

<#function taxType t>
  <#if t == 0>
    <#return 'No VAT'>
  </#if>
  <#return t+'%'>
</#function>

Last updated