Repeating Invoices


Overview

URL https://api.xero.com/api.xro/2.0/RepeatingInvoices
Methods Supported GET
Description Allows you to retrieve any repeating invoice templates

Elements for Invoices

<Type> See Invoice Types
<Contact> See Contacts
<Schedule> See Schedule
<LineItems> See LineItems
<LineAmountTypes> Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types
<Reference> ACCREC only – additional reference number
<BrandingThemeID> See BrandingThemes
<CurrencyCode> The currency that invoice has been raised in (see Currencies)
<Status> One of the following : DRAFT or AUTHORISED – See Invoice Status Codes
<SubTotal> Total of invoice excluding taxes
<TotalTax> Total tax on invoice
<Total> Total of Invoice tax inclusive (i.e. SubTotal + TotalTax)
<RepeatingInvoiceID> Xero generated unique identifier for repeating invoice template
<HasAttachments> boolean to indicate if an invoice has an attachment

Elements for Schedule

<Period> Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months)
<Unit> One of the following : WEEKLY or MONTHLY
<DueDate> Integer used with due date type e.g 20 (of following month), 31 (of current month)
<DueDateType> See Payment Terms
<StartDate> Invoice date the first invoice in the repeating schedule
<NextScheduledDate> The calendar date of the next invoice in the schedule to be generated
<EndDate> Invoice end date – only returned if the template has an end date set

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.

<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
<Quantity> LineItem Quantity
<UnitAmount> LineItem Unit Amount
<ItemCode> See Items
<AccountCode> See Accounts
<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

GET RepeatingInvoices

Use this method to retrieve either one or many repeating invoices.

  • By default responses are formatted as XML. You can also retrieve responses in JSON format.

Optional parameters

Record filter You can specify an individual record by appending the value to the endpoint, i.e.
GET https://…/RepeatingInvoices/{identifier}
RepeatingInvoiceID The Xero identifier for a Repeating Invoice
e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
Where Filter by an any element (see Filters)
order Order by any element returned (see Order By)

Examples for GET RepeatingInvoices

Example 1. Repeating invoices are returned with their line items details.

<RepeatingInvoices>
    <RepeatingInvoice>
      <Contact>
        <ContactID>9b9ba9e5-e907-4b4e-8210-54d82b0aa479</ContactID>
        <Name>PowerDirect</Name>
      </Contact>
      <Status>DRAFT</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>
      <CurrencyCode>NZD</CurrencyCode>
      <Schedule>
        <Period>1</Period>
        <Unit>MONTHLY</Unit>
        <DueDate>10</DueDate>
        <DueDateType>OFFOLLOWINGMONTH</DueDateType>
        <StartDate>2013-01-21T00:00:00</StartDate>
        <NextScheduledDate>2014-03-23T00:00:00</NextScheduledDate>
      </Schedule>
      <RepeatingInvoiceID>ad3550bc-1ae0-45c0-a782-48c6d2061127</RepeatingInvoiceID>
      <Type>ACCPAY</Type>
      <Reference>RPT445-1</Reference>
      <HasAttachments>false</HasAttachments>
    </RepeatingInvoice>
    .....
</RepeatingInvoices>