curl -X "https://api.xero.com/api.xro/2.0/Invoices?where=Status=="' + Invoice.StatusEnum.DRAFT + '"&order=InvoiceNumber ASC&IDs=00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000&InvoiceNumbers=null&ContactIDs=00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000&Statuses=null&page=1&includeArchived=true&createdByMyApp=false&unitdp=4"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AccountingApi;
import java.io.File;
import java.util.*;
public class AccountingApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
AccountingApi apiInstance = new AccountingApi();
String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
String where = Status=="' + Invoice.StatusEnum.DRAFT + '"; // String | Filter by an any element
String order = InvoiceNumber ASC; // String | Order by an any element
array[UUID] iDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID] | Filter by a comma-separated list of InvoicesIDs.
array[String] invoiceNumbers = null; // array[String] | Filter by a comma-separated list of InvoiceNumbers.
array[UUID] contactIDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID] | Filter by a comma-separated list of ContactIDs.
array[String] statuses = null; // array[String] | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
Integer page = 1; // Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
Boolean createdByMyApp = false; // Boolean | When set to true you'll only retrieve Invoices created by your app
Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
try {
Invoices result = apiInstance.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountingApi#getInvoices");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.AccountingApi;
public class AccountingApiExample {
public static void main(String[] args) {
AccountingApi apiInstance = new AccountingApi();
String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
String where = Status=="' + Invoice.StatusEnum.DRAFT + '"; // String | Filter by an any element
String order = InvoiceNumber ASC; // String | Order by an any element
array[UUID] iDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID] | Filter by a comma-separated list of InvoicesIDs.
array[String] invoiceNumbers = null; // array[String] | Filter by a comma-separated list of InvoiceNumbers.
array[UUID] contactIDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID] | Filter by a comma-separated list of ContactIDs.
array[String] statuses = null; // array[String] | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
Integer page = 1; // Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
Boolean createdByMyApp = false; // Boolean | When set to true you'll only retrieve Invoices created by your app
Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
try {
Invoices result = apiInstance.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountingApi#getInvoices");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
Date *ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Only records created or modified since this timestamp will be returned (optional) (default to null)
String *where = Status=="' + Invoice.StatusEnum.DRAFT + '"; // Filter by an any element (optional) (default to null)
String *order = InvoiceNumber ASC; // Order by an any element (optional) (default to null)
array[UUID] *iDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // Filter by a comma-separated list of InvoicesIDs. (optional) (default to null)
array[String] *invoiceNumbers = null; // Filter by a comma-separated list of InvoiceNumbers. (optional) (default to null)
array[UUID] *contactIDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // Filter by a comma-separated list of ContactIDs. (optional) (default to null)
array[String] *statuses = null; // Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. (optional) (default to null)
Integer *page = 1; // e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice (optional) (default to null)
Boolean *includeArchived = true; // e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) (default to null)
Boolean *createdByMyApp = false; // When set to true you'll only retrieve Invoices created by your app (optional) (default to null)
Integer *unitdp = 4; // e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
AccountingApi *apiInstance = [[AccountingApi alloc] init];
// Allows you to retrieve any sales invoices or purchase bills
[apiInstance getInvoicesWith:xeroTenantId
ifModifiedSince:ifModifiedSince
where:where
order:order
iDs:iDs
invoiceNumbers:invoiceNumbers
contactIDs:contactIDs
statuses:statuses
page:page
includeArchived:includeArchived
createdByMyApp:createdByMyApp
unitdp:unitdp
completionHandler: ^(Invoices output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
const tokenSet: TokenSet = {
id_token: 'xxx',
access_token: 'yyy',
expires_at: 1582308862,
token_type: 'Bearer',
refresh_token: 'zzz',
session_state: 'xxx'
}
await xero.setTokenSet(tokenSet);
const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant
const ifModifiedSince:Date = new Date("2020-02-06T12:17:43.202-08:00");
const where = 'Status=="' + Invoice.StatusEnum.DRAFT + '"'; // {String} Filter by an any element
const order = 'InvoiceNumber ASC'; // {String} Order by an any element
const iDs = ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000']; // {array[UUID]} Filter by a comma-separated list of InvoicesIDs.
const invoiceNumbers = ['null']; // {array[String]} Filter by a comma-separated list of InvoiceNumbers.
const contactIDs = ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000']; // {array[UUID]} Filter by a comma-separated list of ContactIDs.
const statuses = ['null']; // {array[String]} Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
const page = 1; // {Integer} e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
const includeArchived = true; // {Boolean} e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
const createdByMyApp = false; // {Boolean} When set to true you'll only retrieve Invoices created by your app
const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
try {
const response: any = await xero.accountingApi.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp);
console.log(response.body || response.response.statusCode)
} catch (err) {
console.log(`There was an ERROR! \n Status Code: ${err.response.statusCode}.`);
console.log(`ERROR: \n ${JSON.stringify(err.response.body, null, 2)}`);
}
using System;
using System.Diagnostics;
using .Api;
using .Client;
using .Model;
namespace Example
{
public class getInvoicesExample
{
public void main()
{
// Configure OAuth2 access token for authorization: OAuth2
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new AccountingApi();
var xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant (default to null)
var ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned (optional) (default to null)
var where = Status=="' + Invoice.StatusEnum.DRAFT + '"; // String | Filter by an any element (optional) (default to null)
var order = InvoiceNumber ASC; // String | Order by an any element (optional) (default to null)
var iDs = new array[UUID](); // array[UUID] | Filter by a comma-separated list of InvoicesIDs. (optional) (default to null)
var invoiceNumbers = new array[String](); // array[String] | Filter by a comma-separated list of InvoiceNumbers. (optional) (default to null)
var contactIDs = new array[UUID](); // array[UUID] | Filter by a comma-separated list of ContactIDs. (optional) (default to null)
var statuses = new array[String](); // array[String] | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. (optional) (default to null)
var page = 1; // Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice (optional) (default to null)
var includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) (default to null)
var createdByMyApp = false; // Boolean | When set to true you'll only retrieve Invoices created by your app (optional) (default to null)
var unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
try
{
// Allows you to retrieve any sales invoices or purchase bills
Invoices result = apiInstance.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccountingApi.getInvoices: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$config->setHost("https://api.xero.com/api.xro/2.0");
$xeroTenantId = 'YOUR_XERO_TENANT_ID'; // String | Xero identifier for Tenant
$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
new GuzzleHttp\Client(),
$config
);
try {
} catch (Exception $e) {
echo 'Exception when calling AccountingApi->getInvoices: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use ::Configuration;
use ::AccountingApi;
# Configure OAuth2 access token for authorization: OAuth2
$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = ::AccountingApi->new();
my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
my $ifModifiedSince = 2020-02-06T12:17:43.202-08:00; # Date | Only records created or modified since this timestamp will be returned
my $where = Status=="' + Invoice.StatusEnum.DRAFT + '"; # String | Filter by an any element
my $order = InvoiceNumber ASC; # String | Order by an any element
my $iDs = [00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000]; # array[UUID] | Filter by a comma-separated list of InvoicesIDs.
my $invoiceNumbers = [null]; # array[String] | Filter by a comma-separated list of InvoiceNumbers.
my $contactIDs = [00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000]; # array[UUID] | Filter by a comma-separated list of ContactIDs.
my $statuses = [null]; # array[String] | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
my $page = 1; # Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
my $includeArchived = true; # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
my $createdByMyApp = false; # Boolean | When set to true you'll only retrieve Invoices created by your app
my $unitdp = 4; # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
eval {
my $result = $api_instance->getInvoices(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, iDs => $iDs, invoiceNumbers => $invoiceNumbers, contactIDs => $contactIDs, statuses => $statuses, page => $page, includeArchived => $includeArchived, createdByMyApp => $createdByMyApp, unitdp => $unitdp);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AccountingApi->getInvoices: $@\n";
}
from __future__ import print_statement
import time
import
from .rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: OAuth2
.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = .AccountingApi()
xeroTenantId = YOUR_XERO_TENANT_ID # String | Xero identifier for Tenant (default to null)
ifModifiedSince = 2020-02-06T12:17:43.202-08:00 # Date | Only records created or modified since this timestamp will be returned (optional) (default to null)
where = Status=="' + Invoice.StatusEnum.DRAFT + '" # String | Filter by an any element (optional) (default to null)
order = InvoiceNumber ASC # String | Order by an any element (optional) (default to null)
iDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000 # array[UUID] | Filter by a comma-separated list of InvoicesIDs. (optional) (default to null)
invoiceNumbers = null # array[String] | Filter by a comma-separated list of InvoiceNumbers. (optional) (default to null)
contactIDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000 # array[UUID] | Filter by a comma-separated list of ContactIDs. (optional) (default to null)
statuses = null # array[String] | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. (optional) (default to null)
page = 1 # Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice (optional) (default to null)
includeArchived = true # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) (default to null)
createdByMyApp = false # Boolean | When set to true you'll only retrieve Invoices created by your app (optional) (default to null)
unitdp = 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
try:
# Allows you to retrieve any sales invoices or purchase bills
api_response = api_instance.get_invoices(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, iDs=iDs, invoiceNumbers=invoiceNumbers, contactIDs=contactIDs, statuses=statuses, page=page, includeArchived=includeArchived, createdByMyApp=createdByMyApp, unitdp=unitdp)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountingApi->getInvoices: %s\n" % e)
extern crate AccountingApi;
pub fn main() {
let xeroTenantId = YOUR_XERO_TENANT_ID; // String
let ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date
let where = Status=="' + Invoice.StatusEnum.DRAFT + '"; // String
let order = InvoiceNumber ASC; // String
let iDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID]
let invoiceNumbers = null; // array[String]
let contactIDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID]
let statuses = null; // array[String]
let page = 1; // Integer
let includeArchived = true; // Boolean
let createdByMyApp = false; // Boolean
let unitdp = 4; // Integer
let mut context = AccountingApi::Context::default();
let result = client.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, &context).wait();
println!("{:?}", result);
}