Skip to content
 


GET /api.xro/1.0/invoices

Gets all invoice records for a particular Xero customer.

Request

Parameter Description
apiKey(Required) Your partner API Key.
xeroKey(Required) The Xero Customer Key generated by the Xero customer and provided to you to access their organisation data.
modifiedSince DateTime to filter invoices by. If specified only invoices with an UpdatedDateUTC greater than the date time specified will be returned, assumed to be in Coordinated Universal Time

Example

To get all invoices for a Xero organisation that have been updated since midnight on 20 Nov 2008 UTC time perform the following HTTP request:

GET https://networktest.xero.com/api.xro/1.0/invoices?apiKey=[Your API Key]&xeroKey=[The Xero Customer Key]&modifiedSince=2008-11-20

<Response>
	<ID>fdc02dd7-46b1-4d1b-9c55-caf893b7e5a7</ID>
	<Status>OK</Status>
	<ProviderName>XeroTest</ProviderName>
	<DateTimeUTC>2008-04-20T20:37:03.4191485Z</DateTimeUTC>
	<Invoices>
		<Invoice>
			<InvoiceType>ACCREC</InvoiceType>
			<InvoiceID>2c372729-88ba-4468-976b-f37df81a5887</InvoiceID>
			<Contact>
				<Addresses />
				<Phones />
				<Phone>
			</Contact>
			<InvoiceDate>2008-02-25T00:00:00</InvoiceDate>
			<DueDate>2008-02-15T00:00:00</DueDate>
			<InvoiceNumber>OIT00535</InvoiceNumber>
			<Reference />
			<IncludesTax>true</IncludesTax>
			<SubTotal>379.5300</SubTotal>
			<TotalTax>47.4400</TotalTax>
			<Total>426.9700</Total>
			<InvoiceStatus>AUTHORISED</InvoiceStatus>
			<LineItems>
				<LineItem>
					<LineItemID>2bbde84b-a8bf-4b32-a723-df094d795c0b</LineItemID>
					<Description>Copies of Windows for Mother</Description>
					<Quantity>10.0000</Quantity>
					<UnitAmount>39.9500</UnitAmount>
					<TaxType>OUTPUT</TaxType>
					<TaxAmount>49.9400</TaxAmount>
					<LineAmount>399.5000</LineAmount>
					<Tracking>
						<TrackingCategory>
							<Name>Activity/Workstream</Name>
							<Option>Publications</Option>
						</TrackingCategory>
					</Tracking>
				</LineItem>
				<LineItem>
					<LineItemID>06e2b5aa-5a8f-4de3-8e48-aa7ea1e38ef2</LineItemID>
					<Description>Discount on order of 10</Description>
					<Quantity>1.0000</Quantity>
					<UnitAmount>-19.9700</UnitAmount>
					<TaxType>OUTPUT</TaxType>
					<TaxAmount>-2.5000</TaxAmount>
					<LineAmount>-19.9700</LineAmount>
					<Tracking>
						<TrackingCategory>
							<Name>Activity/Workstream</Name>
							<Option>Publications</Option>
						</TrackingCategory>
					</Tracking>
				</LineItem>
			</LineItems>
			<Payments>
				<Payment>
					<Date>2008-10-01T00:00:00</Date>
					<Amount>5.0000</Amount>
				</Payment>
				<Payment>
					<Date>2008-10-29T00:00:00</Date>
					<Amount>411.0000</Amount>
				</Payment>
			</Payments>
			<FullyPaidOnDate>2008-10-29T00:00:00</FullyPaidOnDate>
			<AmountDue>0</AmountDue>
			<AmountPaid>426.0000</AmountPaid>
			<AmountCredited>10.000</AmountCredited>
		</Invoice>
	</Invoices>
</Response>

Response Xml Schema

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified"
	elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="Invoices">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Invoice">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="InvoiceType" type="xs:string" />
							<xs:element minOccurs="0" name="InvoiceID" type="xs:string" />
							<xs:element name="Contact">
								<xs:complexType>
									<xs:sequence>
										<xs:element minOccurs="0" name="ContactID" type="xs:string" />
										<xs:element name="Name" type="xs:string" />
										<xs:element minOccurs="0" name="EmailAddress" type="xs:string" />
										<xs:element minOccurs="0" name="Addresses">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="Address">
														<xs:complexType>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element minOccurs="0" name="Phones">
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="InvoiceDate" type="xs:dateTime" />
				<xs:element minOccurs="0" name="DueDate" type="xs:dateTime" />
				<xs:element name="InvoiceNumber" type="xs:string" />
				<xs:element minOccurs="0" name="Reference" type="xs:string" />
				<xs:element minOccurs="0" name="IncludesTax" type="xs:boolean" />
				<xs:element minOccurs="0" name="SubTotal" type="xs:decimal" />
				<xs:element minOccurs="0" name="TotalTax" type="xs:decimal" />
				<xs:element minOccurs="0" name="Total" type="xs:decimal" />
				<xs:element name="LineItems">
					<xs:complexType>
						<xs:sequence>
							<xs:element maxOccurs="unbounded" name="LineItem">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Description" type="xs:string" />
										<xs:element minOccurs="0" name="Quantity" type="xs:decimal" />
										<xs:element name="UnitAmount" type="xs:decimal" />
										<xs:element minOccurs="0" name="TaxType" type="xs:string" />
										<xs:element name="TaxAmount" type="xs:decimal" />
										<xs:element name="LineAmount" type="xs:decimal" />
										<xs:element minOccurs="0" name="Tracking">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="TrackingCategory">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="Name" type="xs:string" />
																<xs:element name="Option" type="xs:string" />
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="Payments">
					<xs:complexType>
						<xs:sequence>
							<xs:element maxOccurs="unbounded" name="Payment">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Date" type="xs:dateTime" />
										<xs:element name="Amount" type="xs:decimal" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="FullyPaidOnDate" type="xs:dateTime" />
				<xs:element name="AmountDue" type="xs:decimal" />
				<xs:element name="AmountPaid" type="xs:decimal" />
				<xs:element name="AmountCredited" type="xs:decimal" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:sequence>
	</xs:complexType>
	</xs:element>
</xs:schema>

5 comments

[...] registration application queries Xero using GET Invoices to see which invoices have been [...]

Jeremy
18 August 2009 #

I found that the xml schema has an extra

on the bottom that makes it not well formed.

Once removed the XSD tool would parse the data

Jeremy
18 August 2009 #

xs:element
xs:sequence
xs:complexType

oops that previous comment was meant to contain the above.

Dwayne
25 August 2009 #

Is there any reason that the Contact information isn’t set when the collection of invoices is returned? I need to filter invoices for a particular contact, which will be achievable if the Contact ID and Contact Number are returned with the list of invoices.

Add your comment





We welcome all feedback but prefer a real name and email address.