Invoices


Overview

URL https://api.xero.com/api.xro/2.0/Invoices
Methods Supported GET, PUT, POST
Description Allows you to retrieve any invoices
Allows you to add or update draft or submitted invoices
Allows you to add approved invoices
Allows you to delete draft invoices
Allows you to void approved invoices
Allows you to attach files to invoices

Elements for Invoices

The following are required to create a draft invoice
<Type> See Invoice Types
<Contact> See Contacts
<LineItems> See LineItems
The following additional elements are recommended for a PUT / POST request
<Date> Date invoice was issued – YYYY-MM-DD. Learn more
<DueDate> Date invoice is due – YYYY-MM-DD
<LineAmountTypes> Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types
The following are optional for a PUT / POST request
<InvoiceNumber> ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings)
ACCPAY – non-unique alpha numeric code identifying invoice
<Reference> ACCREC only – additional reference number
<BrandingThemeID> See BrandingThemes
<Url> URL link to a source document – shown as "Go to [appName]" in the Xero app
<CurrencyCode> The currency that invoice has been raised in (see Currencies)
<CurrencyRate> The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used.
<Status> See Invoice Status Codes
<SentToContact> Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved
<ExpectedPaymentDate> Shown on sales invoices (Accounts Receivable) when this has been set
<PlannedPaymentDate> Shown on bills (Accounts Payable) when this has been set
<SubTotal> Total of invoice excluding taxes
<TotalTax> Total tax on invoice
<Total> Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts
The following are only returned on a GET request
<InvoiceID> Xero generated unique identifier for invoice
<HasAttachments> boolean to indicate if an invoice has an attachment
<Payments> See Payments
<AmountDue> Amount remaining to be paid on invoice
<AmountPaid> Sum of payments received for invoice
<AmountCredited> Sum of all credit notes, over-payments and pre-payments applied to invoice
<UpdatedDateUTC> Last modified date UTC format
<CreditNotes> Details of credit notes that have been applied to an invoice

Elements for Line Items

The <LineItems> element can contain any number of individual <LineItem> sub-elements. At least one is required to create a complete Invoice.

All of these elements are returned on a GET request.
The following element is required to create an approved invoice
<Description> Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character
The following are recommended for a PUT / POST request
<Description> LineItem Description
<Quantity> LineItem Quantity
<UnitAmount> Lineitem unit amount. By default, unit amount will be rounded to two decimal places. You can opt in to use four decimal places by adding the querystring parameter unitdp=4 to your query. See the Rounding in Xero guide for more information.
<ItemCode> See Items
<AccountCode> See Accounts
The following are optional for a PUT / POST request
<TaxType> Used as an override if the default Tax Code for the selected <AccountCode> is not correct – see TaxTypes.
<TaxAmount> The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct.
<LineAmount> If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100)
<Tracking> Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.
<DiscountRate> Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts

POST Invoices

Use this method to create or update an invoice with either a DRAFT, SUBMITTED or AUTHORISED status by specifying the Status element in your request.

Examples for POST Invoices

Example of a draft sales (ACCREC) invoice with enough detail to be approved once it’s been created.

<Invoice>
  <Type>ACCREC</Type>
  <Contact>
    <Name>ABC Limited</Name>
  </Contact>
  <Date>2009-08-30</Date>
  <DueDate>2009-09-20</DueDate>
  <LineAmountTypes>Exclusive</LineAmountTypes>
  <LineItems>
    <LineItem>
      <Description>Consulting services as agreed</Description>
      <Quantity>5.0000</Quantity>
      <UnitAmount>120.00</UnitAmount>
      <AccountCode>200</AccountCode> 
    </LineItem>
  </LineItems>
</Invoice>

Example of minimum elements required to add an approved sales (ACCREC) invoice to ABC Limited

<Invoice>
 <Type>ACCREC</Type>
 <Contact><Name>ABC Limited</Name></Contact>
 <DueDate>2011-07-20</DueDate>
 <LineItems>
 <LineItem>
  <Description>Services as agreed </Description><Quantity>4</Quantity><UnitAmount>100.00</UnitAmount><AccountCode>200</AccountCode>
 </LineItem>
</LineItems>
<Status>AUTHORISED</Status>
</Invoice>

Example of creating a draft sales (ACCREC) invoice with a 20% discount on a line item

<Invoice>
<Type>ACCREC</Type>
<Contact>
<Name>ABC Limited</Name>
</Contact>
<Date>2009-08-30</Date>
<DueDate>2009-09-20</DueDate>
<LineAmountTypes>Exclusive</LineAmountTypes>
<LineItems>
<LineItem>
<Description>Consulting services as agreed (20% off standard rate)</Description>
<Quantity>10</Quantity>
<UnitAmount>100.00</UnitAmount>
<AccountCode>200</AccountCode>
<DiscountRate>20</DiscountRate> 
</LineItem>
</LineItems>
</Invoice>

Once an invoice is approved you can add payments to the invoice. A fully paid invoice will have a Status of PAID.


Example of a sales (ACCREC) invoice inclusive of Tax in USD when the base currency of the org is NZD. This example also assigns a tracking category to a line item

<Invoice>
  <Type>ACCREC</Type>
  <CurrencyCode>USD</CurrencyCode>
  <Contact>
    <Name>ABC Limited</Name>
  </Contact>
  <Date>2009-08-30</Date>
  <DueDate>2009-09-20</DueDate>
  <LineAmountTypes>Inclusive</LineAmountTypes>
  <LineItems>
    <LineItem>
      <Description>Consulting services as agreed</Description>
      <Quantity>5.0000</Quantity>
      <UnitAmount>99</UnitAmount>
      <AccountCode>200</AccountCode> 
      <Tracking>
          <TrackingCategory>
            <Name>Activity/Workstream</Name>
            <Option>Onsite consultancy</Option>
          </TrackingCategory>
      </Tracking>
    </LineItem>
  </LineItems>
</Invoice>


Example of a draft sales (ACCREC) invoice using an item code of 2010-SWEATER-RED. NB The price and account code of the item are not given so the default sales price and account code on the item list will be used. If the UnitAmount and AccountCode element is specified then this will overide the UnitPrice value defined for the item in the item list.

<Invoice>
  <Type>ACCREC</Type>
  <Contact>
    <Name>ABC Limited</Name>
  </Contact>
  <Date>2009-08-30</Date>
  <DueDate>2009-09-20</DueDate>
  <LineAmountTypes>Exclusive</LineAmountTypes>
  <LineItems>
    <LineItem>
      <Description>Red Sweater</Description>
      <Quantity>5</Quantity>
      <ItemCode>2010-SWEATER-RED</ItemCode>
    </LineItem>
  </LineItems>
</Invoice>

Example of a sales (ACCREC) invoice with every single element being specified, including the full record to enabling update to Contact record with 1 single API request:

<Invoices>
  <Invoice>
    <Type>ACCREC</Type>
    <Contact>
      <ContactNumber>0006841301</ContactNumber>
      <Name>Ariki Properties</Name>
      <ContactStatus>ACTIVE</ContactStatus>
      <EmailAddress>emailaddress@yourdomain.com</EmailAddress>
      <SkypeUserName>Skype Name/Number</SkypeUserName>
      <BankAccountDetails>Bank Account Details</BankAccountDetails>
      <TaxNumber>Tax ID Number</TaxNumber>
      <AccountsReceivableTaxType>OUTPUT</AccountsReceivableTaxType>
      <AccountsPayableTaxType>INPUT</AccountsPayableTaxType>
      <FirstName>Simon</FirstName>
      <LastName>Greenville</LastName>
      <DefaultCurrency>USD</DefaultCurrency>
      <Addresses>
        <Address>
          <AddressType>POBOX</AddressType>
          <AttentionTo>Simon G.</AttentionTo>
          <AddressLine1>PO Box 10112</AddressLine1>
          <AddressLine2></AddressLine2>
          <AddressLine3></AddressLine3>
          <AddressLine4></AddressLine4>
          <City>New York</City>
          <Region>New York State</Region>
          <PostalCode>10112</PostalCode>
          <Country>USA</Country>
        </Address>
        <Address>
          <AddressType>STREET</AddressType>
          <AttentionTo>Simon G.</AttentionTo>
          <AddressLine1>Level 71</AddressLine1>
          <AddressLine2>30 Rockefeller plaza</AddressLine2>
          <AddressLine3></AddressLine3>
          <AddressLine4></AddressLine4>
          <City>New York</City>
          <Region>New York State</Region>
          <PostalCode>10112</PostalCode>
          <Country>USA</Country>
        </Address>
      </Addresses>
      <Phones>
        <Phone>
          <PhoneType>DEFAULT</PhoneType>
          <PhoneNumber>5996999</PhoneNumber>
          <PhoneAreaCode>877</PhoneAreaCode>
          <PhoneCountryCode>0001</PhoneCountryCode>
        </Phone>
        <Phone>
          <PhoneType>DDI</PhoneType>
          <PhoneNumber>1234567</PhoneNumber>
          <PhoneAreaCode>877</PhoneAreaCode>
          <PhoneCountryCode>0001</PhoneCountryCode>
        </Phone>
        <Phone>
          <PhoneType>FAX</PhoneType>
          <PhoneNumber>7654321</PhoneNumber>
          <PhoneAreaCode>877</PhoneAreaCode>
          <PhoneCountryCode>0001</PhoneCountryCode>
        </Phone>
        <Phone>
          <PhoneType>MOBILE</PhoneType>
          <PhoneNumber>5555555</PhoneNumber>
          <PhoneAreaCode>877</PhoneAreaCode>
          <PhoneCountryCode>0001</PhoneCountryCode>
        </Phone>
      </Phones>
    </Contact>
    <Date>2009-09-08T00:00:00</Date>
    <DueDate>2009-10-20T00:00:00</DueDate>
    <ExpectedPaymentDate>2009-10-20T00:00:00</ExpectedPaymentDate>
    <InvoiceNumber>OIT:01065</InvoiceNumber>
    <Reference>Ref:SMITHK</Reference>
    <BrandingThemeID>3b148ee0-adfa-442c-a98b-9059a73e8ef5</BrandingThemeID>
    <Url>http://www.accounting20.com</Url>
    <CurrencyCode>NZD</CurrencyCode>
    <Status>SUBMITTED</Status>
    <LineAmountTypes>Inclusive</LineAmountTypes>
    <SubTotal>87.11</SubTotal>
    <TotalTax>10.89</TotalTax>
    <Total>98.00</Total>
    <LineItems>
      <LineItem>
        <Description>3 copies of OS X 10.6 Snow Leopard</Description>
        <Quantity>3.0000</Quantity>
        <UnitAmount>59.00</UnitAmount>
        <TaxType>OUTPUT</TaxType>
        <TaxAmount>19.67</TaxAmount>
        <LineAmount>177.00</LineAmount>
        <AccountCode>200</AccountCode>
        <Tracking>
          <TrackingCategory>
            <TrackingCategoryID>e2f2f732-e92a-4f3a-9c4d-ee4da0182a13</TrackingCategoryID>
            <Name>Region</Name>
            <Option>North</Option>
          </TrackingCategory>
        </Tracking>
      </LineItem>
      <LineItem>
        <Description>Returned Apple Keyboard with Numeric Keypad (faulty)</Description>
        <Quantity>1.0000</Quantity>
        <UnitAmount>-79.00</UnitAmount>
        <TaxType>OUTPUT</TaxType>
        <TaxAmount>-8.78</TaxAmount>
        <LineAmount>-79.00</LineAmount>
        <AccountCode>200</AccountCode>
      </LineItem>
    </LineItems>
  </Invoice>
</Invoices>

If you are entering many invoices in a single API call then we recommend you utilise our new response format that shows validation errors for each invoice. The new response messages for validating bulk API calls would mean a breaking change so to utilise this functionality you’ll need to append ?SummarizeErrors=false to the end of your API calls e.g. POST /api.xro/2.0/Invoices?SummarizeErrors=false

Below is an example of the altered response format. Note that each Invoice is now returned with a status element which will either contain the value OK or ERROR. If an invoice has a error then one or more validation errors will be returned.

<Response>
  <Invoices>
    <Invoice status="OK">
      ...
    </Invoice>
    <Invoice status="ERROR">
      <ValidationErrors>
          <ValidationError>
              <Message>....</Message>
          </ValidationError>
          .....
     </ValidationErrors>
    </Invoice>
    <Invoice status="OK">
      ...
    </Invoice>
</Invoices>
</Response>

Uploading an Attachment

You can upload up to 10 attachments(each up to 3mb in size) per invoice, once the invoice has been created in Xero. To do this you’ll need to know the ID of the invoice which you’ll use to construct the URL when POST/PUTing a byte stream containing the attachment file. e.g. https://api.xero.com/api.xro/2.0/Invoices/f0ec0d8c-6fce-4330-bb3b-8306278c6fd8/Attachments/image.png. See the Attachments page for more details.

e.g.

POST /api.xro/2.0/Invoices/f0ec0d8c-4330-bb3b-83062c6fd8/Attachments/Image002932.png
Authorization: OAuth...
Content Type: image/png
Content-Length: 10293

{RAW-IMAGE-CONTENT}

Invoice Status Codes

When creating new invoices or modifying existing invoices you can optionally specify a “Status” element

New Invoices

New invoices can have either one of the following three status codes :

Status Description
DRAFT
  • The default status if this element is not provided with your API call
  • Can contain incomplete line items (e.g. missing account codes)
  • No journals are created so the details will not be used in any reports
SUBMITTED
  • Useful if there is an approval process required
  • No journals are created so the details will not be used in any reports
AUTHORISED
  • The “approved” state of an invoice ready for sending to a customer
  • Journals are created in Xero so all details will be used in reports
  • You can now apply payments to the invoice
  • Once an invoice is fully paid invoice the status will change to PAID

Existing Invoices

The tables below show the valid state changes for invoices.

Existing status New status
DRAFT DRAFT
DRAFT SUBMITTED
DRAFT AUTHORISED
DRAFT DELETED

Example of deleting a draft invoice.

<Invoice>
  <InvoiceNumber>INV-239</InvoiceNumber>
  <Status>DELETED</Status>
</Invoice>
Existing status New status
SUBMITTED SUBMITTED
SUBMITTED AUTHORISED
SUBMITTED DRAFT
SUBMITTED DELETED
Existing status New status
AUTHORISED AUTHORISED
AUTHORISED VOIDED

An authorised invoice can only be modified or voided via the Xero API if

  • it has no payments or credit notes applied to it
  • it is not in a locked period

Example of voiding an approved invoice that has no payments applied to it.

<Invoice>
  <InvoiceNumber>INV-123</InvoiceNumber>
  <Status>VOIDED</Status>
</Invoice>

Example of updating an invoice to mark it as sent

<Invoice>
<InvoiceID>8694c9c5-7097-4449-a708-b8c1982921a4</InvoiceID>
<SentToContact>true</SentToContact>
</Invoice>

PUT Invoices

The PUT method is similar to the POST Invoices method, however you can only create new invoices with this method.


GET Invoices

Use this method to retrieve either one or many invoices.

  • By default responses are formatted as XML. You can also retrieve responses in JSON format.
  • When you retrieve multiple invoices, only a summary of the contact is returned and no line details are returned – this is to keep the response more compact.
  • The line item details will be returned when you retrieve an individual invoice, either by specifying Invoice ID or Invoice Number or by using the optional paging parameter (below).
  • Individual invoices (e.g. Invoices/97c2dc5-cc47-4afd-8ec8-74990b8761e9) can also be returned as PDF’s see our HTTP GET documentation

Optional parameters

Record filter You can specify an individual record by appending the value to the endpoint, i.e.
GET https://…/Invoices/{identifier}
InvoiceID – The Xero identifier for an Invoice
e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
InvoiceNumber – The InvoiceNumber
e.g. INV-01514
Modified After The ModifiedAfter filter is actually an HTTP header: ‘If-Modified-Since‘.
A UTC timestamp (yyyy-mm-ddThh:mm:ss) . Only invoices created or modified since this timestamp will be returned e.g. 2009-11-12T00:00:00
Where Filter by an any element (see Filters)
order Order by any element returned (see Order By)
page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice

Paging invoices (recommended)

To utilise paging, append a page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned.

By using paging all the line item details for each invoice are returned which may avoid the need to retrieve each individual invoice

Examples for GET Invoices

Example 1. This is an example response when a filter has been applied to request just a single invoice. In this case the InvoiceNumber of OIT00546 was specified. NB The response format is more detailed compared with when multiple invoices are returned. This response includes full contact details and line items.

<Invoices>
  <Invoice>
    <Type>ACCREC</Type>
    <Contact>
      <ContactID>025867f1-d741-4d6b-b1af-9ac774b59ba7</ContactID>
      <ContactStatus>ACTIVE</ContactStatus>
      <Name>City Agency</Name>
      <Addresses>
        <Address>
          <AddressType>STREET</AddressType>
        </Address>
        <Address>
          <AddressType>POBOX</AddressType>
          <AddressLine1>L4, CA House</AddressLine1>
          <AddressLine2>14 Boulevard Quay</AddressLine2>
          <City>Wellington</City>
          <PostalCode>6012</PostalCode>
        </Address>
      </Addresses>
      <Phones>
        <Phone>
          <PhoneType>DEFAULT</PhoneType>
        </Phone>
        <Phone>
          <PhoneType>DDI</PhoneType>
        </Phone>
        <Phone>
          <PhoneType>MOBILE</PhoneType>
        </Phone>
        <Phone>
          <PhoneType>FAX</PhoneType>
        </Phone>
      </Phones>
      <UpdatedDateUTC>2009-08-15T00:18:43.473</UpdatedDateUTC>
      <IsSupplier>false</IsSupplier>
      <IsCustomer>true</IsCustomer>
    </Contact>
    <Date>2009-05-27T00:00:00</Date>
    <DueDate>2009-06-06T00:00:00</DueDate>
    <Status>AUTHORISED</Status>
    <LineAmountTypes>Exclusive</LineAmountTypes>
    <LineItems>
      <LineItem>
        <Description>Onsite project management </Description>
        <Quantity>1.0000</Quantity>
        <UnitAmount>1800.00</UnitAmount>
        <TaxType>OUTPUT</TaxType>
        <TaxAmount>225.00</TaxAmount>
        <LineAmount>1800.00</LineAmount>
        <AccountCode>200</AccountCode>
        <Tracking>
          <TrackingCategory>
            <TrackingCategoryID>e2f2f732-e92a-4f3a9c4d-ee4da0182a13</TrackingCategoryID>
            <Name>Activity/Workstream</Name>
            <Option>Onsite consultancy</Option>
          </TrackingCategory>
        </Tracking>
      </LineItem>
    </LineItems>
    <SubTotal>1800.00</SubTotal>
    <TotalTax>225.00</TotalTax>
    <Total>2025.00</Total>
    <UpdatedDateUTC>2009-08-15T00:18:43.457</UpdatedDateUTC>
    <CurrencyCode>NZD</CurrencyCode>
    <InvoiceID>243216c5-369e-4056-ac67-05388f86dc81</InvoiceID>
    <InvoiceNumber>OIT00546</InvoiceNumber>
    <Payments>
      <Payment>
        <Date>2009-09-01T00:00:00</Date>
        <Amount>1000.00</Amount>
        <PaymentID>0d666415-cf77-43fa-80c7-56775591d426</PaymentID>
      </Payment>
    </Payments>
    <AmountDue>1025.00</AmountDue>
    <AmountPaid>1000.00</AmountPaid>
    <AmountCredited>0.00</AmountCredited>
  </Invoice>
</Invoices>

Example 2. Notice the subtle differences from the example above. As many invoices are being returned only a summary of the contact is returned and no line details are returned – this is to keep the response more compact.

<Invoices>
  <Invoice>
    <Type>ACCREC</Type>
    <Contact>
      <ContactID>025867f1-d741-4d6b-b1af-9ac774b59ba7</ContactID>
        <Name>City Agency</Name>
    </Contact>
    <Date>2009-05-27T00:00:00</Date>
    <DueDate>2009-06-06T00:00:00</DueDate>
    <Status>AUTHORISED</Status>
    <LineAmountTypes>Exclusive</LineAmountTypes>
    <SubTotal>1800.00</SubTotal>
    <TotalTax>225.00</TotalTax>
    <Total>2025.00</Total>
    <UpdatedDateUTC>2009-08-15T00:18:43.457</UpdatedDateUTC>
    <CurrencyCode>NZD</CurrencyCode>
    <InvoiceID>243216c5-369e-4056-ac67-05388f86dc81</InvoiceID>
    <InvoiceNumber>OIT00546</InvoiceNumber>
    <AmountDue>2025.00</AmountDue>
    <AmountPaid>0.00</AmountPaid>
    <AmountCredited>0.00</AmountCredited>
  </Invoice>
  <Invoice>
    <Reference>RPT-DD</Reference>
    <Type>ACCREC</Type>
    <Contact>
      <ContactID>06638157-fdfa-47f4-91d0-875b5f5c18c6</ContactID>
      <Name>Marine Systems</Name>
    </Contact>
    <Date>2009-04-26T00:00:00</Date>
    <DueDate>2009-04-26T00:00:00</DueDate>
    <Status>AUTHORISED</Status>
    <LineAmountTypes>Exclusive</LineAmountTypes>
    <SubTotal>28.50</SubTotal>
    <TotalTax>3.56</TotalTax>
    <Total>32.06</Total>
    <UpdatedDateUTC>2009-08-14T21:04:58.09</UpdatedDateUTC>
    <CurrencyCode>NZD</CurrencyCode>
    <InvoiceID>03778e72-d541-404a-ab9b-2757aeda76a3</InvoiceID>
    <InvoiceNumber>OIT00542</InvoiceNumber>
    <AmountDue>32.06</AmountDue>
    <AmountPaid>0.00</AmountPaid>
    <AmountCredited>0.00</AmountCredited>
  </Invoice>
</Invoices>

Example 3. Using the paging feature we are able to get the line items returned for up to 100 invoice using a single GET request

<Invoices>
    <Invoice>
      <Contact>
        <ContactID>9b9ba9e5-e907-4b4e-8210-54d82b0aa479</ContactID>
        <Name>PowerDirect</Name>
      </Contact>
      <Date>2013-05-24T00:00:00</Date>
      <DueDate>2013-06-03T00:00:00</DueDate>
      <Status>VOIDED</Status>
      <LineAmountTypes>Inclusive</LineAmountTypes>
      <LineItems>
        <LineItem>
          <Description>Monthly electricity</Description>
          <UnitAmount>77.39</UnitAmount>
          <TaxType>INPUT2</TaxType>
          <TaxAmount>11.61</TaxAmount>
          <LineAmount>77.39</LineAmount>
          <AccountCode>445</AccountCode>
          <Quantity>1.0000</Quantity>
        </LineItem>
      </LineItems>
      <SubTotal>77.39</SubTotal>
      <TotalTax>11.61</TotalTax>
      <Total>89.00</Total>
      <UpdatedDateUTC>2010-11-12T12:55:16.347</UpdatedDateUTC>
      <CurrencyCode>NZD</CurrencyCode>
      <Type>ACCPAY</Type>
      <InvoiceID>22b3fab4-ef56-4d70-a110-a7cc3c1a26cd</InvoiceID>
      <InvoiceNumber>Elec.</InvoiceNumber>
      <AmountDue>0.00</AmountDue>
      <AmountPaid>0.00</AmountPaid>
      <AmountCredited>0.00</AmountCredited>
      <CurrencyRate>1.000000</CurrencyRate>
    </Invoice>
    <Invoice>
      <Contact>
        <ContactID>9b9ba9e5-e907-4b4e-8210-54d82b0aa479</ContactID>
        <Name>PowerDirect</Name>
      </Contact>
      <Date>2013-01-21T00:00:00</Date>
      <DueDate>2013-02-01T00:00:00</DueDate>
      <Status>PAID</Status>
      <LineAmountTypes>Inclusive</LineAmountTypes>
      <LineItems>
        <LineItem>
          <Description>Monthly electricity</Description>
          <UnitAmount>78.26</UnitAmount>
          <TaxType>INPUT2</TaxType>
          <TaxAmount>11.74</TaxAmount>
          <LineAmount>78.26</LineAmount>
          <AccountCode>445</AccountCode>
          <Quantity>1.0000</Quantity>
        </LineItem>
      </LineItems>
      <SubTotal>78.26</SubTotal>
      <TotalTax>11.74</TotalTax>
      <Total>90.00</Total>
      <UpdatedDateUTC>2010-11-12T14:28:14.303</UpdatedDateUTC>
      <CurrencyCode>NZD</CurrencyCode>
      <FullyPaidOnDate>2013-01-31T00:00:00</FullyPaidOnDate>
      <Type>ACCPAY</Type>
      <InvoiceID>96988e67-ecf9-466d-bfbf-0afa1725a649</InvoiceID>
      <InvoiceNumber>RPT445-1</InvoiceNumber>
      <Payments>
        <Payment>
          <PaymentID>0a0ef7ee-7b91-46fa-8136-c4cc6287273a</PaymentID>
          <Date>2013-01-31T00:00:00</Date>
          <Amount>90.00</Amount>
          <CurrencyRate>1.000000</CurrencyRate>
        </Payment>
      </Payments>
      <AmountDue>0.00</AmountDue>
      <AmountPaid>90.00</AmountPaid>
      <AmountCredited>0.00</AmountCredited>
      <CurrencyRate>1.000000</CurrencyRate>
    </Invoice>
...
</Invoices>