Accounting API

Accounting

createAccount

Allows you to create a new chart of accounts


/Accounts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts"
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
        Account account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" }; // Account | 
        try {
            Accounts result = apiInstance.createAccount(xeroTenantId, account);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createAccount");
            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
        Account account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" }; // Account | 
        try {
            Accounts result = apiInstance.createAccount(xeroTenantId, account);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createAccount");
            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)
Account *account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a new chart of accounts
[apiInstance createAccountWith:xeroTenantId
    account:account
              completionHandler: ^(Accounts 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 account:Account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" };  // {Account} 
try {
  const response: any = await xero.accountingApi.createAccount(xeroTenantId, account);
  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 createAccountExample
    {
        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 account = new Account(); // Account | 

            try
            {
                // Allows you to create a new chart of accounts
                Accounts result = apiInstance.createAccount(xeroTenantId, account);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createAccount: " + 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 { 
    $account = new XeroAPI\XeroPHP\Models\Accounting\Account;
    $account->setCode("987654321");
    $account->setName("FooBar");
    $account->setType("EXPENSE");
    $account->setDescription("Hello World");
    $result = $apiInstance->createAccount($xeroTenantId,$account);
} catch (Exception $e) {
    echo 'Exception when calling AccountingApi->createAccount: ', $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 $account = ::Object::Account->new(); # Account | 

eval { 
    my $result = $api_instance->createAccount(xeroTenantId => $xeroTenantId, account => $account);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createAccount: $@\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)
account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" } # Account | 

try: 
    # Allows you to create a new chart of accounts
    api_response = api_instance.create_account(xeroTenantId, account)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createAccount: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" }; // Account

    let mut context = AccountingApi::Context::default();
    let result = client.createAccount(xeroTenantId, account, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
account *
Account
Account object in body of request
Required

createAccountAttachmentByFileName

Allows you to create Attachment on Account


/Accounts/{AccountID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{FileName}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createAccountAttachmentByFileName");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createAccountAttachmentByFileName");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for Account object (default to null)
String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create Attachment on Account
[apiInstance createAccountAttachmentByFileNameWith:xeroTenantId
    accountID:accountID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Account object 
const fileName = "xero-dev.jpg";  // {String} Name of the attachment 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createAccountAttachmentByFileNameExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for Account object (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the attachment (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create Attachment on Account
                Attachments result = apiInstance.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createAccountAttachmentByFileName: " + 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->createAccountAttachmentByFileName: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Account object
my $fileName = xero-dev.jpg; # String | Name of the attachment
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createAccountAttachmentByFileName(xeroTenantId => $xeroTenantId, accountID => $accountID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createAccountAttachmentByFileName: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Account object (default to null)
fileName = xero-dev.jpg # String | Name of the attachment (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create Attachment on Account
    api_response = api_instance.create_account_attachment_by_file_name(xeroTenantId, accountID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createAccountAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for Account object
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createBankTransactionAttachmentByFileName

Allows you to createa an Attachment on BankTransaction by Filename


/BankTransactions/{BankTransactionID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{FileName}"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        String fileName = xero-dev.jpg; // String | The name of the file being attached
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactionAttachmentByFileName");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        String fileName = xero-dev.jpg; // String | The name of the file being attached
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactionAttachmentByFileName");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to createa an Attachment on BankTransaction by Filename
[apiInstance createBankTransactionAttachmentByFileNameWith:xeroTenantId
    bankTransactionID:bankTransactionID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createBankTransactionAttachmentByFileNameExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to createa an Attachment on BankTransaction by Filename
                Attachments result = apiInstance.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBankTransactionAttachmentByFileName: " + 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->createBankTransactionAttachmentByFileName: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
my $fileName = xero-dev.jpg; # String | The name of the file being attached
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createBankTransactionAttachmentByFileName(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBankTransactionAttachmentByFileName: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to createa an Attachment on BankTransaction by Filename
    api_response = api_instance.create_bank_transaction_attachment_by_file_name(xeroTenantId, bankTransactionID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBankTransactionAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
FileName*
String
The name of the file being attached
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createBankTransactionHistoryRecord

Allows you to create history record for a bank transactions


/BankTransactions/{BankTransactionID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/History"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactionHistoryRecord");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactionHistoryRecord");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create history record for a bank transactions
[apiInstance createBankTransactionHistoryRecordWith:xeroTenantId
    bankTransactionID:bankTransactionID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords);
  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 createBankTransactionHistoryRecordExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create history record for a bank transactions
                HistoryRecords result = apiInstance.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBankTransactionHistoryRecord: " + 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->createBankTransactionHistoryRecord: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createBankTransactionHistoryRecord(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBankTransactionHistoryRecord: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create history record for a bank transactions
    api_response = api_instance.create_bank_transaction_history_record(xeroTenantId, bankTransactionID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBankTransactionHistoryRecord: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBankTransactions

Allows you to create one or more spend or receive money transaction


/BankTransactions

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions?summarizeErrors=true&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
        BankTransactions bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // BankTransactions | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.createBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactions");
            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
        BankTransactions bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // BankTransactions | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.createBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactions");
            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)
BankTransactions *bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create one or more spend or receive money transaction
[apiInstance createBankTransactionsWith:xeroTenantId
    bankTransactions:bankTransactions
    summarizeErrors:summarizeErrors
    unitdp:unitdp
              completionHandler: ^(BankTransactions 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 bankTransactions:BankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] };  // {BankTransactions} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.createBankTransactions(xeroTenantId, bankTransactions,  summarizeErrors, 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 createBankTransactionsExample
    {
        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 bankTransactions = new BankTransactions(); // BankTransactions | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 create one or more spend or receive money transaction
                BankTransactions result = apiInstance.createBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBankTransactions: " + 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->createBankTransactions: ', $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 $bankTransactions = ::Object::BankTransactions->new(); # BankTransactions | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->createBankTransactions(xeroTenantId => $xeroTenantId, bankTransactions => $bankTransactions, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBankTransactions: $@\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)
bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create one or more spend or receive money transaction
    api_response = api_instance.create_bank_transactions(xeroTenantId, bankTransactions, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBankTransactions: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // BankTransactions
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.createBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
bankTransactions *
BankTransactions
BankTransactions with an array of BankTransaction objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createBankTransfer

Allows you to create a bank transfers


/BankTransfers

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers"
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
        BankTransfers bankTransfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] }; // BankTransfers | 
        try {
            BankTransfers result = apiInstance.createBankTransfer(xeroTenantId, bankTransfers);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransfer");
            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
        BankTransfers bankTransfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] }; // BankTransfers | 
        try {
            BankTransfers result = apiInstance.createBankTransfer(xeroTenantId, bankTransfers);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransfer");
            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)
BankTransfers *bankTransfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a bank transfers
[apiInstance createBankTransferWith:xeroTenantId
    bankTransfers:bankTransfers
              completionHandler: ^(BankTransfers 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 bankTransfers:BankTransfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] };  // {BankTransfers} 
try {
  const response: any = await xero.accountingApi.createBankTransfer(xeroTenantId, bankTransfers);
  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 createBankTransferExample
    {
        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 bankTransfers = new BankTransfers(); // BankTransfers | 

            try
            {
                // Allows you to create a bank transfers
                BankTransfers result = apiInstance.createBankTransfer(xeroTenantId, bankTransfers);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBankTransfer: " + 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->createBankTransfer: ', $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 $bankTransfers = ::Object::BankTransfers->new(); # BankTransfers | 

eval { 
    my $result = $api_instance->createBankTransfer(xeroTenantId => $xeroTenantId, bankTransfers => $bankTransfers);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBankTransfer: $@\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)
bankTransfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] } # BankTransfers | 

try: 
    # Allows you to create a bank transfers
    api_response = api_instance.create_bank_transfer(xeroTenantId, bankTransfers)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBankTransfer: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] }; // BankTransfers

    let mut context = AccountingApi::Context::default();
    let result = client.createBankTransfer(xeroTenantId, bankTransfers, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
bankTransfers *
BankTransfers
BankTransfers with array of BankTransfer objects in request body
Required

createBankTransferAttachmentByFileName


/BankTransfers/{BankTransferID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{FileName}"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransferAttachmentByFileName");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransferAttachmentByFileName");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a Bank Transfer (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance createBankTransferAttachmentByFileNameWith:xeroTenantId
    bankTransferID:bankTransferID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a Bank Transfer 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createBankTransferAttachmentByFileNameExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a Bank Transfer (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // 
                Attachments result = apiInstance.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBankTransferAttachmentByFileName: " + 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->createBankTransferAttachmentByFileName: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a Bank Transfer
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createBankTransferAttachmentByFileName(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBankTransferAttachmentByFileName: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a Bank Transfer (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # 
    api_response = api_instance.create_bank_transfer_attachment_by_file_name(xeroTenantId, bankTransferID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBankTransferAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
FileName*
String
The name of the file being attached to a Bank Transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createBankTransferHistoryRecord


/BankTransfers/{BankTransferID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/History"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransferHistoryRecord");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransferHistoryRecord");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance createBankTransferHistoryRecordWith:xeroTenantId
    bankTransferID:bankTransferID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords);
  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 createBankTransferHistoryRecordExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // 
                HistoryRecords result = apiInstance.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBankTransferHistoryRecord: " + 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->createBankTransferHistoryRecord: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createBankTransferHistoryRecord(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBankTransferHistoryRecord: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # 
    api_response = api_instance.create_bank_transfer_history_record(xeroTenantId, bankTransferID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBankTransferHistoryRecord: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBatchPayment

Create one or many BatchPayments for invoices


/BatchPayments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments?summarizeErrors=true"
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
        BatchPayments batchPayments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] }; // BatchPayments | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            BatchPayments result = apiInstance.createBatchPayment(xeroTenantId, batchPayments, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBatchPayment");
            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
        BatchPayments batchPayments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] }; // BatchPayments | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            BatchPayments result = apiInstance.createBatchPayment(xeroTenantId, batchPayments, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBatchPayment");
            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)
BatchPayments *batchPayments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Create one or many BatchPayments for invoices
[apiInstance createBatchPaymentWith:xeroTenantId
    batchPayments:batchPayments
    summarizeErrors:summarizeErrors
              completionHandler: ^(BatchPayments 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 batchPayments:BatchPayments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] };  // {BatchPayments} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createBatchPayment(xeroTenantId, batchPayments,  summarizeErrors);
  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 createBatchPaymentExample
    {
        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 batchPayments = new BatchPayments(); // BatchPayments | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Create one or many BatchPayments for invoices
                BatchPayments result = apiInstance.createBatchPayment(xeroTenantId, batchPayments, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBatchPayment: " + 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->createBatchPayment: ', $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 $batchPayments = ::Object::BatchPayments->new(); # BatchPayments | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createBatchPayment(xeroTenantId => $xeroTenantId, batchPayments => $batchPayments, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBatchPayment: $@\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)
batchPayments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] } # BatchPayments | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Create one or many BatchPayments for invoices
    api_response = api_instance.create_batch_payment(xeroTenantId, batchPayments, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBatchPayment: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let batchPayments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] }; // BatchPayments
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createBatchPayment(xeroTenantId, batchPayments, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
batchPayments *
BatchPayments
BatchPayments with an array of Payments in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createBatchPaymentHistoryRecord

Allows you to create a history record for a Batch Payment


/BatchPayments/{BatchPaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments/{BatchPaymentID}/History"
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
        UUID batchPaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for BatchPayment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBatchPaymentHistoryRecord");
            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
        UUID batchPaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for BatchPayment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBatchPaymentHistoryRecord");
            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)
UUID *batchPaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for BatchPayment (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a history record for a Batch Payment
[apiInstance createBatchPaymentHistoryRecordWith:xeroTenantId
    batchPaymentID:batchPaymentID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 batchPaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for BatchPayment 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords);
  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 createBatchPaymentHistoryRecordExample
    {
        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 batchPaymentID = new UUID(); // UUID | Unique identifier for BatchPayment (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create a history record for a Batch Payment
                HistoryRecords result = apiInstance.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBatchPaymentHistoryRecord: " + 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->createBatchPaymentHistoryRecord: ', $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 $batchPaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for BatchPayment
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createBatchPaymentHistoryRecord(xeroTenantId => $xeroTenantId, batchPaymentID => $batchPaymentID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBatchPaymentHistoryRecord: $@\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)
batchPaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for BatchPayment (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create a history record for a Batch Payment
    api_response = api_instance.create_batch_payment_history_record(xeroTenantId, batchPaymentID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBatchPaymentHistoryRecord: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let batchPaymentID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
BatchPaymentID*
UUID (uuid)
Unique identifier for BatchPayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBrandingThemePaymentServices

Allow for the creation of new custom payment service for specified Branding Theme


/BrandingThemes/{BrandingThemeID}/PaymentServices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes/{BrandingThemeID}/PaymentServices"
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
        UUID brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Branding Theme
        PaymentService paymentService = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" }; // PaymentService | 
        try {
            PaymentServices result = apiInstance.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBrandingThemePaymentServices");
            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
        UUID brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Branding Theme
        PaymentService paymentService = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" }; // PaymentService | 
        try {
            PaymentServices result = apiInstance.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createBrandingThemePaymentServices");
            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)
UUID *brandingThemeID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Branding Theme (default to null)
PaymentService *paymentService = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allow for the creation of new custom payment service for specified Branding Theme
[apiInstance createBrandingThemePaymentServicesWith:xeroTenantId
    brandingThemeID:brandingThemeID
    paymentService:paymentService
              completionHandler: ^(PaymentServices 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 brandingThemeID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Branding Theme 
const paymentService:PaymentService = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" };  // {PaymentService} 
try {
  const response: any = await xero.accountingApi.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService);
  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 createBrandingThemePaymentServicesExample
    {
        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 brandingThemeID = new UUID(); // UUID | Unique identifier for a Branding Theme (default to null)
            var paymentService = new PaymentService(); // PaymentService | 

            try
            {
                // Allow for the creation of new custom payment service for specified Branding Theme
                PaymentServices result = apiInstance.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createBrandingThemePaymentServices: " + 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->createBrandingThemePaymentServices: ', $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 $brandingThemeID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Branding Theme
my $paymentService = ::Object::PaymentService->new(); # PaymentService | 

eval { 
    my $result = $api_instance->createBrandingThemePaymentServices(xeroTenantId => $xeroTenantId, brandingThemeID => $brandingThemeID, paymentService => $paymentService);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createBrandingThemePaymentServices: $@\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)
brandingThemeID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Branding Theme (default to null)
paymentService = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" } # PaymentService | 

try: 
    # Allow for the creation of new custom payment service for specified Branding Theme
    api_response = api_instance.create_branding_theme_payment_services(xeroTenantId, brandingThemeID, paymentService)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createBrandingThemePaymentServices: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID
    let paymentService = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" }; // PaymentService

    let mut context = AccountingApi::Context::default();
    let result = client.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService, &context).wait();
    println!("{:?}", result);

}

Scopes

paymentservices Grant read-write access to payment services

Parameters

Path parameters
Name Description
BrandingThemeID*
UUID (uuid)
Unique identifier for a Branding Theme
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
paymentService *
PaymentService
PaymentService object in body of request
Required

createContactAttachmentByFileName


/Contacts/{ContactID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{FileName}"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactAttachmentByFileName");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactAttachmentByFileName");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
String *fileName = xero-dev.jpg; // Name for the file you are attaching (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance createContactAttachmentByFileNameWith:xeroTenantId
    contactID:contactID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact 
const fileName = "xero-dev.jpg";  // {String} Name for the file you are attaching 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createContactAttachmentByFileNameExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var fileName = xero-dev.jpg;  // String | Name for the file you are attaching (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // 
                Attachments result = apiInstance.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createContactAttachmentByFileName: " + 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->createContactAttachmentByFileName: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $fileName = xero-dev.jpg; # String | Name for the file you are attaching
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createContactAttachmentByFileName(xeroTenantId => $xeroTenantId, contactID => $contactID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createContactAttachmentByFileName: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
fileName = xero-dev.jpg # String | Name for the file you are attaching (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # 
    api_response = api_instance.create_contact_attachment_by_file_name(xeroTenantId, contactID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createContactAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
FileName*
String
Name for the file you are attaching
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createContactGroup

Allows you to create a contact group


/ContactGroups

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups"
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
        ContactGroups contactGroups = { contactGroups:[ { name:"VIPs" } ] }; // ContactGroups | 
        try {
            ContactGroups result = apiInstance.createContactGroup(xeroTenantId, contactGroups);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactGroup");
            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
        ContactGroups contactGroups = { contactGroups:[ { name:"VIPs" } ] }; // ContactGroups | 
        try {
            ContactGroups result = apiInstance.createContactGroup(xeroTenantId, contactGroups);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactGroup");
            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)
ContactGroups *contactGroups = { contactGroups:[ { name:"VIPs" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a contact group
[apiInstance createContactGroupWith:xeroTenantId
    contactGroups:contactGroups
              completionHandler: ^(ContactGroups 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 contactGroups:ContactGroups = { contactGroups:[ { name:"VIPs" } ] };  // {ContactGroups} 
try {
  const response: any = await xero.accountingApi.createContactGroup(xeroTenantId, contactGroups);
  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 createContactGroupExample
    {
        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 contactGroups = new ContactGroups(); // ContactGroups | 

            try
            {
                // Allows you to create a contact group
                ContactGroups result = apiInstance.createContactGroup(xeroTenantId, contactGroups);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createContactGroup: " + 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->createContactGroup: ', $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 $contactGroups = ::Object::ContactGroups->new(); # ContactGroups | 

eval { 
    my $result = $api_instance->createContactGroup(xeroTenantId => $xeroTenantId, contactGroups => $contactGroups);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createContactGroup: $@\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)
contactGroups = { contactGroups:[ { name:"VIPs" } ] } # ContactGroups | 

try: 
    # Allows you to create a contact group
    api_response = api_instance.create_contact_group(xeroTenantId, contactGroups)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createContactGroup: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactGroups = { contactGroups:[ { name:"VIPs" } ] }; // ContactGroups

    let mut context = AccountingApi::Context::default();
    let result = client.createContactGroup(xeroTenantId, contactGroups, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
contactGroups *
ContactGroups
ContactGroups with an array of names in request body
Required

createContactGroupContacts

Allows you to add Contacts to a Contact Group


/ContactGroups/{ContactGroupID}/Contacts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}/Contacts"
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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        Contacts contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] }; // Contacts | 
        try {
            Contacts result = apiInstance.createContactGroupContacts(xeroTenantId, contactGroupID, contacts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactGroupContacts");
            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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        Contacts contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] }; // Contacts | 
        try {
            Contacts result = apiInstance.createContactGroupContacts(xeroTenantId, contactGroupID, contacts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactGroupContacts");
            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)
UUID *contactGroupID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact Group (default to null)
Contacts *contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to add Contacts to a Contact Group
[apiInstance createContactGroupContactsWith:xeroTenantId
    contactGroupID:contactGroupID
    contacts:contacts
              completionHandler: ^(Contacts 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 contactGroupID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact Group 
const contacts:Contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] };  // {Contacts} 
try {
  const response: any = await xero.accountingApi.createContactGroupContacts(xeroTenantId, contactGroupID, contacts);
  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 createContactGroupContactsExample
    {
        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 contactGroupID = new UUID(); // UUID | Unique identifier for a Contact Group (default to null)
            var contacts = new Contacts(); // Contacts | 

            try
            {
                // Allows you to add Contacts to a Contact Group
                Contacts result = apiInstance.createContactGroupContacts(xeroTenantId, contactGroupID, contacts);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createContactGroupContacts: " + 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->createContactGroupContacts: ', $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 $contactGroupID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact Group
my $contacts = ::Object::Contacts->new(); # Contacts | 

eval { 
    my $result = $api_instance->createContactGroupContacts(xeroTenantId => $xeroTenantId, contactGroupID => $contactGroupID, contacts => $contacts);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createContactGroupContacts: $@\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)
contactGroupID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact Group (default to null)
contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] } # Contacts | 

try: 
    # Allows you to add Contacts to a Contact Group
    api_response = api_instance.create_contact_group_contacts(xeroTenantId, contactGroupID, contacts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createContactGroupContacts: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactGroupID = 00000000-0000-0000-000-000000000000; // UUID
    let contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] }; // Contacts

    let mut context = AccountingApi::Context::default();
    let result = client.createContactGroupContacts(xeroTenantId, contactGroupID, contacts, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
contacts *
Contacts
Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request
Required

createContactHistory

Allows you to retrieve a history records of an Contact


/Contacts/{ContactID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/History"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createContactHistory(xeroTenantId, contactID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactHistory");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createContactHistory(xeroTenantId, contactID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContactHistory");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an Contact
[apiInstance createContactHistoryWith:xeroTenantId
    contactID:contactID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createContactHistory(xeroTenantId, contactID, historyRecords);
  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 createContactHistoryExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to retrieve a history records of an Contact
                HistoryRecords result = apiInstance.createContactHistory(xeroTenantId, contactID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createContactHistory: " + 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->createContactHistory: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createContactHistory(xeroTenantId => $xeroTenantId, contactID => $contactID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createContactHistory: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to retrieve a history records of an Contact
    api_response = api_instance.create_contact_history(xeroTenantId, contactID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createContactHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createContactHistory(xeroTenantId, contactID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createContacts

Allows you to create a multiple contacts (bulk) in a Xero organisation


/Contacts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts?summarizeErrors=true"
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
        Contacts contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // Contacts | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Contacts result = apiInstance.createContacts(xeroTenantId, contacts, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContacts");
            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
        Contacts contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // Contacts | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Contacts result = apiInstance.createContacts(xeroTenantId, contacts, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createContacts");
            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)
Contacts *contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a multiple contacts (bulk) in a Xero organisation
[apiInstance createContactsWith:xeroTenantId
    contacts:contacts
    summarizeErrors:summarizeErrors
              completionHandler: ^(Contacts 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 contacts:Contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] };  // {Contacts} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createContacts(xeroTenantId, contacts,  summarizeErrors);
  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 createContactsExample
    {
        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 contacts = new Contacts(); // Contacts | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create a multiple contacts (bulk) in a Xero organisation
                Contacts result = apiInstance.createContacts(xeroTenantId, contacts, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createContacts: " + 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->createContacts: ', $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 $contacts = ::Object::Contacts->new(); # Contacts | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createContacts(xeroTenantId => $xeroTenantId, contacts => $contacts, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createContacts: $@\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)
contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create a multiple contacts (bulk) in a Xero organisation
    api_response = api_instance.create_contacts(xeroTenantId, contacts, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createContacts: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // Contacts
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createContacts(xeroTenantId, contacts, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
contacts *
Contacts
Contacts with an array of Contact objects to create in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createCreditNoteAllocation

Allows you to create Allocation on CreditNote


/CreditNotes/{CreditNoteID}/Allocations

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Allocations"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        Allocations allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] }; // Allocations | 
        try {
            Allocations result = apiInstance.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteAllocation");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        Allocations allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] }; // Allocations | 
        try {
            Allocations result = apiInstance.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteAllocation");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
Allocations *allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create Allocation on CreditNote
[apiInstance createCreditNoteAllocationWith:xeroTenantId
    creditNoteID:creditNoteID
    allocations:allocations
              completionHandler: ^(Allocations 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const allocations:Allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] };  // {Allocations} 
try {
  const response: any = await xero.accountingApi.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations);
  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 createCreditNoteAllocationExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var allocations = new Allocations(); // Allocations | 

            try
            {
                // Allows you to create Allocation on CreditNote
                Allocations result = apiInstance.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createCreditNoteAllocation: " + 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->createCreditNoteAllocation: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $allocations = ::Object::Allocations->new(); # Allocations | 

eval { 
    my $result = $api_instance->createCreditNoteAllocation(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, allocations => $allocations);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createCreditNoteAllocation: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] } # Allocations | 

try: 
    # Allows you to create Allocation on CreditNote
    api_response = api_instance.create_credit_note_allocation(xeroTenantId, creditNoteID, allocations)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createCreditNoteAllocation: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] }; // Allocations

    let mut context = AccountingApi::Context::default();
    let result = client.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
allocations *
Allocations
Allocations with array of Allocation object in body of request.
Required

createCreditNoteAttachmentByFileName

Allows you to create Attachments on CreditNote by file name


/CreditNotes/{CreditNoteID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{FileName}"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
        Boolean includeOnline = true; // Boolean | Set an attachment to be included with the invoice when viewed online (through Xero)
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, includeOnline, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteAttachmentByFileName");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
        Boolean includeOnline = true; // Boolean | Set an attachment to be included with the invoice when viewed online (through Xero)
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, includeOnline, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteAttachmentByFileName");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
String *fileName = xero-dev.jpg; // Name of the file you are attaching to Credit Note (default to null)
Boolean *includeOnline = true; // Set an attachment to be included with the invoice when viewed online (through Xero) (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create Attachments on CreditNote by file name
[apiInstance createCreditNoteAttachmentByFileNameWith:xeroTenantId
    creditNoteID:creditNoteID
    fileName:fileName
    includeOnline:includeOnline
    body:body
              completionHandler: ^(Attachments 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const fileName = "xero-dev.jpg";  // {String} Name of the file you are attaching to Credit Note 
const includeOnline = true;  // {Boolean} Set an attachment to be included with the invoice when viewed online (through Xero) 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, includeOnline, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createCreditNoteAttachmentByFileNameExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the file you are attaching to Credit Note (default to null)
            var includeOnline = true;  // Boolean | Set an attachment to be included with the invoice when viewed online (through Xero) (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create Attachments on CreditNote by file name
                Attachments result = apiInstance.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, includeOnline, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createCreditNoteAttachmentByFileName: " + 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->createCreditNoteAttachmentByFileName: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $fileName = xero-dev.jpg; # String | Name of the file you are attaching to Credit Note
my $includeOnline = true; # Boolean | Set an attachment to be included with the invoice when viewed online (through Xero)
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createCreditNoteAttachmentByFileName(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, fileName => $fileName, includeOnline => $includeOnline, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createCreditNoteAttachmentByFileName: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
fileName = xero-dev.jpg # String | Name of the file you are attaching to Credit Note (default to null)
includeOnline = true # Boolean | Set an attachment to be included with the invoice when viewed online (through Xero) (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create Attachments on CreditNote by file name
    api_response = api_instance.create_credit_note_attachment_by_file_name(xeroTenantId, creditNoteID, fileName, includeOnline, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createCreditNoteAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let includeOnline = true; // Boolean
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, includeOnline, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
FileName*
String
Name of the file you are attaching to Credit Note
Required
IncludeOnline*
Boolean
Set an attachment to be included with the invoice when viewed online (through Xero)
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createCreditNoteHistory

Allows you to retrieve a history records of an CreditNote


/CreditNotes/{CreditNoteID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/History"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteHistory");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteHistory");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an CreditNote
[apiInstance createCreditNoteHistoryWith:xeroTenantId
    creditNoteID:creditNoteID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords);
  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 createCreditNoteHistoryExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to retrieve a history records of an CreditNote
                HistoryRecords result = apiInstance.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createCreditNoteHistory: " + 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->createCreditNoteHistory: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createCreditNoteHistory(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createCreditNoteHistory: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to retrieve a history records of an CreditNote
    api_response = api_instance.create_credit_note_history(xeroTenantId, creditNoteID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createCreditNoteHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createCreditNotes

Allows you to create a credit note


/CreditNotes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?summarizeErrors=true&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
        CreditNotes creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // CreditNotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.createCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNotes");
            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
        CreditNotes creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // CreditNotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.createCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNotes");
            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)
CreditNotes *creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create a credit note
[apiInstance createCreditNotesWith:xeroTenantId
    creditNotes:creditNotes
    summarizeErrors:summarizeErrors
    unitdp:unitdp
              completionHandler: ^(CreditNotes 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 creditNotes:CreditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] };  // {CreditNotes} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.createCreditNotes(xeroTenantId, creditNotes,  summarizeErrors, 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 createCreditNotesExample
    {
        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 creditNotes = new CreditNotes(); // CreditNotes | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 create a credit note
                CreditNotes result = apiInstance.createCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createCreditNotes: " + 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->createCreditNotes: ', $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 $creditNotes = ::Object::CreditNotes->new(); # CreditNotes | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->createCreditNotes(xeroTenantId => $xeroTenantId, creditNotes => $creditNotes, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createCreditNotes: $@\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)
creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create a credit note
    api_response = api_instance.create_credit_notes(xeroTenantId, creditNotes, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createCreditNotes: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // CreditNotes
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.createCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
creditNotes *
CreditNotes
Credit Notes with array of CreditNote object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createCurrency


/Currencies

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Currencies"
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
        Currency currency = { code: CurrencyCode.USD, description:"United States Dollar" }; // Currency | 
        try {
            Currencies result = apiInstance.createCurrency(xeroTenantId, currency);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCurrency");
            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
        Currency currency = { code: CurrencyCode.USD, description:"United States Dollar" }; // Currency | 
        try {
            Currencies result = apiInstance.createCurrency(xeroTenantId, currency);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createCurrency");
            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)
Currency *currency = { code: CurrencyCode.USD, description:"United States Dollar" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance createCurrencyWith:xeroTenantId
    currency:currency
              completionHandler: ^(Currencies 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 currency:Currency = { code: CurrencyCode.USD, description:"United States Dollar" };  // {Currency} 
try {
  const response: any = await xero.accountingApi.createCurrency(xeroTenantId, currency);
  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 createCurrencyExample
    {
        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 currency = new Currency(); // Currency | 

            try
            {
                // 
                Currencies result = apiInstance.createCurrency(xeroTenantId, currency);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createCurrency: " + 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->createCurrency: ', $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 $currency = ::Object::Currency->new(); # Currency | 

eval { 
    my $result = $api_instance->createCurrency(xeroTenantId => $xeroTenantId, currency => $currency);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createCurrency: $@\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)
currency = { code: CurrencyCode.USD, description:"United States Dollar" } # Currency | 

try: 
    # 
    api_response = api_instance.create_currency(xeroTenantId, currency)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createCurrency: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let currency = { code: CurrencyCode.USD, description:"United States Dollar" }; // Currency

    let mut context = AccountingApi::Context::default();
    let result = client.createCurrency(xeroTenantId, currency, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
currency *
Currency
Currency obejct in the body of request
Required

createEmployees

Allows you to create new employees used in Xero payrun


/Employees

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Employees?summarizeErrors=true"
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
        Employees employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Employees result = apiInstance.createEmployees(xeroTenantId, employees, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createEmployees");
            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
        Employees employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Employees result = apiInstance.createEmployees(xeroTenantId, employees, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createEmployees");
            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)
Employees *employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create new employees used in Xero payrun
[apiInstance createEmployeesWith:xeroTenantId
    employees:employees
    summarizeErrors:summarizeErrors
              completionHandler: ^(Employees 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 employees:Employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] };  // {Employees} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createEmployees(xeroTenantId, employees,  summarizeErrors);
  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 createEmployeesExample
    {
        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 employees = new Employees(); // Employees | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create new employees used in Xero payrun
                Employees result = apiInstance.createEmployees(xeroTenantId, employees, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createEmployees: " + 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->createEmployees: ', $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 $employees = ::Object::Employees->new(); # Employees | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createEmployees(xeroTenantId => $xeroTenantId, employees => $employees, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createEmployees: $@\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)
employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create new employees used in Xero payrun
    api_response = api_instance.create_employees(xeroTenantId, employees, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createEmployees: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createEmployees(xeroTenantId, employees, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employees *
Employees
Employees with array of Employee object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createExpenseClaimHistory

Allows you to create a history records of an ExpenseClaim


/ExpenseClaims/{ExpenseClaimID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}/History"
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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createExpenseClaimHistory");
            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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createExpenseClaimHistory");
            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)
UUID *expenseClaimID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ExpenseClaim (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a history records of an ExpenseClaim
[apiInstance createExpenseClaimHistoryWith:xeroTenantId
    expenseClaimID:expenseClaimID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 expenseClaimID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ExpenseClaim 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords);
  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 createExpenseClaimHistoryExample
    {
        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 expenseClaimID = new UUID(); // UUID | Unique identifier for a ExpenseClaim (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create a history records of an ExpenseClaim
                HistoryRecords result = apiInstance.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createExpenseClaimHistory: " + 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->createExpenseClaimHistory: ', $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 $expenseClaimID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ExpenseClaim
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createExpenseClaimHistory(xeroTenantId => $xeroTenantId, expenseClaimID => $expenseClaimID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createExpenseClaimHistory: $@\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)
expenseClaimID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ExpenseClaim (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create a history records of an ExpenseClaim
    api_response = api_instance.create_expense_claim_history(xeroTenantId, expenseClaimID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createExpenseClaimHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
ExpenseClaimID*
UUID (uuid)
Unique identifier for a ExpenseClaim
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createExpenseClaims

Allows you to retrieve expense claims


/ExpenseClaims

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims"
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
        ExpenseClaims expenseClaims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] }; // ExpenseClaims | 
        try {
            ExpenseClaims result = apiInstance.createExpenseClaims(xeroTenantId, expenseClaims);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createExpenseClaims");
            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
        ExpenseClaims expenseClaims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] }; // ExpenseClaims | 
        try {
            ExpenseClaims result = apiInstance.createExpenseClaims(xeroTenantId, expenseClaims);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createExpenseClaims");
            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)
ExpenseClaims *expenseClaims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve expense claims
[apiInstance createExpenseClaimsWith:xeroTenantId
    expenseClaims:expenseClaims
              completionHandler: ^(ExpenseClaims 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 expenseClaims:ExpenseClaims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] };  // {ExpenseClaims} 
try {
  const response: any = await xero.accountingApi.createExpenseClaims(xeroTenantId, expenseClaims);
  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 createExpenseClaimsExample
    {
        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 expenseClaims = new ExpenseClaims(); // ExpenseClaims | 

            try
            {
                // Allows you to retrieve expense claims
                ExpenseClaims result = apiInstance.createExpenseClaims(xeroTenantId, expenseClaims);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createExpenseClaims: " + 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->createExpenseClaims: ', $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 $expenseClaims = ::Object::ExpenseClaims->new(); # ExpenseClaims | 

eval { 
    my $result = $api_instance->createExpenseClaims(xeroTenantId => $xeroTenantId, expenseClaims => $expenseClaims);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createExpenseClaims: $@\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)
expenseClaims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] } # ExpenseClaims | 

try: 
    # Allows you to retrieve expense claims
    api_response = api_instance.create_expense_claims(xeroTenantId, expenseClaims)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createExpenseClaims: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let expenseClaims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] }; // ExpenseClaims

    let mut context = AccountingApi::Context::default();
    let result = client.createExpenseClaims(xeroTenantId, expenseClaims, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
expenseClaims *
ExpenseClaims
ExpenseClaims with array of ExpenseClaim object in body of request
Required

createInvoiceAttachmentByFileName

Allows you to create an Attachment on invoices or purchase bills by it's filename


/Invoices/{InvoiceID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{FileName}"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
        Boolean includeOnline = true; // Boolean | Set an attachment to be included with the invoice when viewed online (through Xero)
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, includeOnline, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createInvoiceAttachmentByFileName");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
        Boolean includeOnline = true; // Boolean | Set an attachment to be included with the invoice when viewed online (through Xero)
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, includeOnline, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createInvoiceAttachmentByFileName");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
String *fileName = xero-dev.jpg; // Name of the file you are attaching (default to null)
Boolean *includeOnline = true; // Set an attachment to be included with the invoice when viewed online (through Xero) (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create an Attachment on invoices or purchase bills by it's filename
[apiInstance createInvoiceAttachmentByFileNameWith:xeroTenantId
    invoiceID:invoiceID
    fileName:fileName
    includeOnline:includeOnline
    body:body
              completionHandler: ^(Attachments 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const fileName = "xero-dev.jpg";  // {String} Name of the file you are attaching 
const includeOnline = true;  // {Boolean} Set an attachment to be included with the invoice when viewed online (through Xero) 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, includeOnline, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createInvoiceAttachmentByFileNameExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the file you are attaching (default to null)
            var includeOnline = true;  // Boolean | Set an attachment to be included with the invoice when viewed online (through Xero) (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create an Attachment on invoices or purchase bills by it's filename
                Attachments result = apiInstance.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, includeOnline, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createInvoiceAttachmentByFileName: " + 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->createInvoiceAttachmentByFileName: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $fileName = xero-dev.jpg; # String | Name of the file you are attaching
my $includeOnline = true; # Boolean | Set an attachment to be included with the invoice when viewed online (through Xero)
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, fileName => $fileName, includeOnline => $includeOnline, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createInvoiceAttachmentByFileName: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
fileName = xero-dev.jpg # String | Name of the file you are attaching (default to null)
includeOnline = true # Boolean | Set an attachment to be included with the invoice when viewed online (through Xero) (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create an Attachment on invoices or purchase bills by it's filename
    api_response = api_instance.create_invoice_attachment_by_file_name(xeroTenantId, invoiceID, fileName, includeOnline, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createInvoiceAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let includeOnline = true; // Boolean
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, includeOnline, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
FileName*
String
Name of the file you are attaching
Required
IncludeOnline*
Boolean
Set an attachment to be included with the invoice when viewed online (through Xero)
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createInvoiceHistory

Allows you to retrieve a history records of an invoice


/Invoices/{InvoiceID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/History"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createInvoiceHistory");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createInvoiceHistory");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an invoice
[apiInstance createInvoiceHistoryWith:xeroTenantId
    invoiceID:invoiceID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords);
  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 createInvoiceHistoryExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to retrieve a history records of an invoice
                HistoryRecords result = apiInstance.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createInvoiceHistory: " + 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->createInvoiceHistory: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createInvoiceHistory(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createInvoiceHistory: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to retrieve a history records of an invoice
    api_response = api_instance.create_invoice_history(xeroTenantId, invoiceID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createInvoiceHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createInvoices

Allows you to create one or more sales invoices or purchase bills


/Invoices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices?summarizeErrors=true&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
        Invoices invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] }; // Invoices | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        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.createInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createInvoices");
            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
        Invoices invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] }; // Invoices | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        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.createInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createInvoices");
            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)
Invoices *invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create one or more sales invoices or purchase bills
[apiInstance createInvoicesWith:xeroTenantId
    invoices:invoices
    summarizeErrors:summarizeErrors
    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 invoices:Invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] };  // {Invoices} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.createInvoices(xeroTenantId, invoices,  summarizeErrors, 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 createInvoicesExample
    {
        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 invoices = new Invoices(); // Invoices | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 create one or more sales invoices or purchase bills
                Invoices result = apiInstance.createInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createInvoices: " + 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->createInvoices: ', $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 $invoices = ::Object::Invoices->new(); # Invoices | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->createInvoices(xeroTenantId => $xeroTenantId, invoices => $invoices, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createInvoices: $@\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)
invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] } # Invoices | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create one or more sales invoices or purchase bills
    api_response = api_instance.create_invoices(xeroTenantId, invoices, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createInvoices: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] }; // Invoices
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.createInvoices(xeroTenantId, invoices, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
invoices *
Invoices
Invoices with an array of invoice objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createItemHistory

Allows you to create a history record for items


/Items/{ItemID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}/History"
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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createItemHistory(xeroTenantId, itemID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createItemHistory");
            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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createItemHistory(xeroTenantId, itemID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createItemHistory");
            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)
UUID *itemID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Item (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a history record for items
[apiInstance createItemHistoryWith:xeroTenantId
    itemID:itemID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 itemID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Item 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createItemHistory(xeroTenantId, itemID, historyRecords);
  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 createItemHistoryExample
    {
        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 itemID = new UUID(); // UUID | Unique identifier for an Item (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create a history record for items
                HistoryRecords result = apiInstance.createItemHistory(xeroTenantId, itemID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createItemHistory: " + 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->createItemHistory: ', $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 $itemID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Item
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createItemHistory(xeroTenantId => $xeroTenantId, itemID => $itemID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createItemHistory: $@\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)
itemID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Item (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create a history record for items
    api_response = api_instance.create_item_history(xeroTenantId, itemID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createItemHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let itemID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createItemHistory(xeroTenantId, itemID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createItems

Allows you to create one or more items


/Items

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items?summarizeErrors=true&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
        Items items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] }; // Items | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.createItems(xeroTenantId, items, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createItems");
            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
        Items items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] }; // Items | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.createItems(xeroTenantId, items, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createItems");
            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)
Items *items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create one or more items
[apiInstance createItemsWith:xeroTenantId
    items:items
    summarizeErrors:summarizeErrors
    unitdp:unitdp
              completionHandler: ^(Items 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 items:Items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] };  // {Items} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.createItems(xeroTenantId, items,  summarizeErrors, 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 createItemsExample
    {
        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 items = new Items(); // Items | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 create one or more items
                Items result = apiInstance.createItems(xeroTenantId, items, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createItems: " + 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->createItems: ', $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 $items = ::Object::Items->new(); # Items | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->createItems(xeroTenantId => $xeroTenantId, items => $items, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createItems: $@\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)
items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] } # Items | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 create one or more items
    api_response = api_instance.create_items(xeroTenantId, items, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createItems: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] }; // Items
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.createItems(xeroTenantId, items, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
items *
Items
Items with an array of Item objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createLinkedTransaction

Allows you to create linked transactions (billable expenses)


/LinkedTransactions

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions"
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
        LinkedTransaction linkedTransaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"}; // LinkedTransaction | 
        try {
            LinkedTransactions result = apiInstance.createLinkedTransaction(xeroTenantId, linkedTransaction);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createLinkedTransaction");
            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
        LinkedTransaction linkedTransaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"}; // LinkedTransaction | 
        try {
            LinkedTransactions result = apiInstance.createLinkedTransaction(xeroTenantId, linkedTransaction);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createLinkedTransaction");
            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)
LinkedTransaction *linkedTransaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"}; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create linked transactions (billable expenses)
[apiInstance createLinkedTransactionWith:xeroTenantId
    linkedTransaction:linkedTransaction
              completionHandler: ^(LinkedTransactions 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 linkedTransaction:LinkedTransaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"};  // {LinkedTransaction} 
try {
  const response: any = await xero.accountingApi.createLinkedTransaction(xeroTenantId, linkedTransaction);
  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 createLinkedTransactionExample
    {
        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 linkedTransaction = new LinkedTransaction(); // LinkedTransaction | 

            try
            {
                // Allows you to create linked transactions (billable expenses)
                LinkedTransactions result = apiInstance.createLinkedTransaction(xeroTenantId, linkedTransaction);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createLinkedTransaction: " + 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->createLinkedTransaction: ', $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 $linkedTransaction = ::Object::LinkedTransaction->new(); # LinkedTransaction | 

eval { 
    my $result = $api_instance->createLinkedTransaction(xeroTenantId => $xeroTenantId, linkedTransaction => $linkedTransaction);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createLinkedTransaction: $@\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)
linkedTransaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"} # LinkedTransaction | 

try: 
    # Allows you to create linked transactions (billable expenses)
    api_response = api_instance.create_linked_transaction(xeroTenantId, linkedTransaction)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createLinkedTransaction: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let linkedTransaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"}; // LinkedTransaction

    let mut context = AccountingApi::Context::default();
    let result = client.createLinkedTransaction(xeroTenantId, linkedTransaction, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
linkedTransaction *
LinkedTransaction
LinkedTransaction object in body of request
Required

createManualJournalAttachmentByFileName

Allows you to create a specified Attachment on ManualJournal by file name


/ManualJournals/{ManualJournalID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{FileName}"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournalAttachmentByFileName");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournalAttachmentByFileName");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a ManualJournal (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a specified Attachment on ManualJournal by file name
[apiInstance createManualJournalAttachmentByFileNameWith:xeroTenantId
    manualJournalID:manualJournalID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a ManualJournal 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createManualJournalAttachmentByFileNameExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a ManualJournal (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create a specified Attachment on ManualJournal by file name
                Attachments result = apiInstance.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createManualJournalAttachmentByFileName: " + 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->createManualJournalAttachmentByFileName: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a ManualJournal
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createManualJournalAttachmentByFileName(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createManualJournalAttachmentByFileName: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a ManualJournal (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create a specified Attachment on ManualJournal by file name
    api_response = api_instance.create_manual_journal_attachment_by_file_name(xeroTenantId, manualJournalID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createManualJournalAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
FileName*
String
The name of the file being attached to a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createManualJournals

Allows you to create one or more manual journals


/ManualJournals

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?summarizeErrors=true"
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
        ManualJournals manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // ManualJournals | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            ManualJournals result = apiInstance.createManualJournals(xeroTenantId, manualJournals, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournals");
            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
        ManualJournals manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // ManualJournals | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            ManualJournals result = apiInstance.createManualJournals(xeroTenantId, manualJournals, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournals");
            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)
ManualJournals *manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create one or more manual journals
[apiInstance createManualJournalsWith:xeroTenantId
    manualJournals:manualJournals
    summarizeErrors:summarizeErrors
              completionHandler: ^(ManualJournals 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 manualJournals:ManualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] };  // {ManualJournals} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createManualJournals(xeroTenantId, manualJournals,  summarizeErrors);
  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 createManualJournalsExample
    {
        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 manualJournals = new ManualJournals(); // ManualJournals | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create one or more manual journals
                ManualJournals result = apiInstance.createManualJournals(xeroTenantId, manualJournals, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createManualJournals: " + 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->createManualJournals: ', $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 $manualJournals = ::Object::ManualJournals->new(); # ManualJournals | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createManualJournals(xeroTenantId => $xeroTenantId, manualJournals => $manualJournals, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createManualJournals: $@\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)
manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create one or more manual journals
    api_response = api_instance.create_manual_journals(xeroTenantId, manualJournals, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createManualJournals: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // ManualJournals
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createManualJournals(xeroTenantId, manualJournals, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
manualJournals *
ManualJournals
ManualJournals array with ManualJournal object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createOverpaymentAllocations

Allows you to create a single allocation for an overpayment


/Overpayments/{OverpaymentID}/Allocations

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}/Allocations?summarizeErrors=true"
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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        Allocations allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] }; // Allocations | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Allocations result = apiInstance.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createOverpaymentAllocations");
            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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        Allocations allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] }; // Allocations | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Allocations result = apiInstance.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createOverpaymentAllocations");
            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)
UUID *overpaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Overpayment (default to null)
Allocations *allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a single allocation for an overpayment
[apiInstance createOverpaymentAllocationsWith:xeroTenantId
    overpaymentID:overpaymentID
    allocations:allocations
    summarizeErrors:summarizeErrors
              completionHandler: ^(Allocations 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 overpaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Overpayment 
const allocations:Allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] };  // {Allocations} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations,  summarizeErrors);
  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 createOverpaymentAllocationsExample
    {
        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 overpaymentID = new UUID(); // UUID | Unique identifier for a Overpayment (default to null)
            var allocations = new Allocations(); // Allocations | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create a single allocation for an overpayment
                Allocations result = apiInstance.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createOverpaymentAllocations: " + 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->createOverpaymentAllocations: ', $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 $overpaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Overpayment
my $allocations = ::Object::Allocations->new(); # Allocations | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createOverpaymentAllocations(xeroTenantId => $xeroTenantId, overpaymentID => $overpaymentID, allocations => $allocations, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createOverpaymentAllocations: $@\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)
overpaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Overpayment (default to null)
allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] } # Allocations | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create a single allocation for an overpayment
    api_response = api_instance.create_overpayment_allocations(xeroTenantId, overpaymentID, allocations, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createOverpaymentAllocations: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let overpaymentID = 00000000-0000-0000-000-000000000000; // UUID
    let allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] }; // Allocations
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
allocations *
Allocations
Allocations array with Allocation object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createOverpaymentHistory

Allows you to create history records of an Overpayment


/Overpayments/{OverpaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}/History"
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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createOverpaymentHistory");
            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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createOverpaymentHistory");
            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)
UUID *overpaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Overpayment (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create history records of an Overpayment
[apiInstance createOverpaymentHistoryWith:xeroTenantId
    overpaymentID:overpaymentID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 overpaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Overpayment 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords);
  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 createOverpaymentHistoryExample
    {
        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 overpaymentID = new UUID(); // UUID | Unique identifier for a Overpayment (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create history records of an Overpayment
                HistoryRecords result = apiInstance.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createOverpaymentHistory: " + 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->createOverpaymentHistory: ', $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 $overpaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Overpayment
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createOverpaymentHistory(xeroTenantId => $xeroTenantId, overpaymentID => $overpaymentID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createOverpaymentHistory: $@\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)
overpaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Overpayment (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create history records of an Overpayment
    api_response = api_instance.create_overpayment_history(xeroTenantId, overpaymentID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createOverpaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let overpaymentID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPayment

Allows you to create a single payment for invoices or credit notes


/Payments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments"
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
        Payment payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 }; // Payment | 
        try {
            Payments result = apiInstance.createPayment(xeroTenantId, payment);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPayment");
            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
        Payment payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 }; // Payment | 
        try {
            Payments result = apiInstance.createPayment(xeroTenantId, payment);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPayment");
            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)
Payment *payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a single payment for invoices or credit notes
[apiInstance createPaymentWith:xeroTenantId
    payment:payment
              completionHandler: ^(Payments 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 payment:Payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 };  // {Payment} 
try {
  const response: any = await xero.accountingApi.createPayment(xeroTenantId, payment);
  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 createPaymentExample
    {
        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 payment = new Payment(); // Payment | 

            try
            {
                // Allows you to create a single payment for invoices or credit notes
                Payments result = apiInstance.createPayment(xeroTenantId, payment);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPayment: " + 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->createPayment: ', $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 $payment = ::Object::Payment->new(); # Payment | 

eval { 
    my $result = $api_instance->createPayment(xeroTenantId => $xeroTenantId, payment => $payment);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPayment: $@\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)
payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } # Payment | 

try: 
    # Allows you to create a single payment for invoices or credit notes
    api_response = api_instance.create_payment(xeroTenantId, payment)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPayment: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 }; // Payment

    let mut context = AccountingApi::Context::default();
    let result = client.createPayment(xeroTenantId, payment, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payment *
Payment
Request body with a single Payment object
Required

createPaymentHistory

Allows you to create a history record for a payment


/Payments/{PaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}/History"
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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createPaymentHistory(xeroTenantId, paymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPaymentHistory");
            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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createPaymentHistory(xeroTenantId, paymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPaymentHistory");
            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)
UUID *paymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Payment (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a history record for a payment
[apiInstance createPaymentHistoryWith:xeroTenantId
    paymentID:paymentID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 paymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Payment 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createPaymentHistory(xeroTenantId, paymentID, historyRecords);
  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 createPaymentHistoryExample
    {
        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 paymentID = new UUID(); // UUID | Unique identifier for a Payment (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create a history record for a payment
                HistoryRecords result = apiInstance.createPaymentHistory(xeroTenantId, paymentID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPaymentHistory: " + 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->createPaymentHistory: ', $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 $paymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Payment
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createPaymentHistory(xeroTenantId => $xeroTenantId, paymentID => $paymentID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPaymentHistory: $@\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)
paymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Payment (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create a history record for a payment
    api_response = api_instance.create_payment_history(xeroTenantId, paymentID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let paymentID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createPaymentHistory(xeroTenantId, paymentID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
PaymentID*
UUID (uuid)
Unique identifier for a Payment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPaymentService

Allows you to create payment services


/PaymentServices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PaymentServices"
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
        PaymentServices paymentServices = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] }; // PaymentServices | 
        try {
            PaymentServices result = apiInstance.createPaymentService(xeroTenantId, paymentServices);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPaymentService");
            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
        PaymentServices paymentServices = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] }; // PaymentServices | 
        try {
            PaymentServices result = apiInstance.createPaymentService(xeroTenantId, paymentServices);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPaymentService");
            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)
PaymentServices *paymentServices = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create payment services
[apiInstance createPaymentServiceWith:xeroTenantId
    paymentServices:paymentServices
              completionHandler: ^(PaymentServices 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 paymentServices:PaymentServices = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] };  // {PaymentServices} 
try {
  const response: any = await xero.accountingApi.createPaymentService(xeroTenantId, paymentServices);
  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 createPaymentServiceExample
    {
        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 paymentServices = new PaymentServices(); // PaymentServices | 

            try
            {
                // Allows you to create payment services
                PaymentServices result = apiInstance.createPaymentService(xeroTenantId, paymentServices);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPaymentService: " + 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->createPaymentService: ', $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 $paymentServices = ::Object::PaymentServices->new(); # PaymentServices | 

eval { 
    my $result = $api_instance->createPaymentService(xeroTenantId => $xeroTenantId, paymentServices => $paymentServices);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPaymentService: $@\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)
paymentServices = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] } # PaymentServices | 

try: 
    # Allows you to create payment services
    api_response = api_instance.create_payment_service(xeroTenantId, paymentServices)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPaymentService: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let paymentServices = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] }; // PaymentServices

    let mut context = AccountingApi::Context::default();
    let result = client.createPaymentService(xeroTenantId, paymentServices, &context).wait();
    println!("{:?}", result);

}

Scopes

paymentservices Grant read-write access to payment services

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
paymentServices *
PaymentServices
PaymentServices array with PaymentService object in body of request
Required

createPayments

Allows you to create multiple payments for invoices or credit notes


/Payments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments"
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
        Payments payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] }; // Payments | 
        try {
            Payments result = apiInstance.createPayments(xeroTenantId, payments);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPayments");
            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
        Payments payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] }; // Payments | 
        try {
            Payments result = apiInstance.createPayments(xeroTenantId, payments);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPayments");
            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)
Payments *payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create multiple payments for invoices or credit notes
[apiInstance createPaymentsWith:xeroTenantId
    payments:payments
              completionHandler: ^(Payments 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 payments:Payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] };  // {Payments} 
try {
  const response: any = await xero.accountingApi.createPayments(xeroTenantId, payments);
  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 createPaymentsExample
    {
        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 payments = new Payments(); // Payments | 

            try
            {
                // Allows you to create multiple payments for invoices or credit notes
                Payments result = apiInstance.createPayments(xeroTenantId, payments);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPayments: " + 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->createPayments: ', $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 $payments = ::Object::Payments->new(); # Payments | 

eval { 
    my $result = $api_instance->createPayments(xeroTenantId => $xeroTenantId, payments => $payments);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPayments: $@\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)
payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] } # Payments | 

try: 
    # Allows you to create multiple payments for invoices or credit notes
    api_response = api_instance.create_payments(xeroTenantId, payments)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPayments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] }; // Payments

    let mut context = AccountingApi::Context::default();
    let result = client.createPayments(xeroTenantId, payments, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payments *
Payments
Payments array with Payment object in body of request
Required

createPrepaymentAllocations

Allows you to create an Allocation for prepayments


/Prepayments/{PrepaymentID}/Allocations

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}/Allocations?summarizeErrors=true"
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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Prepayment
        Allocations allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] }; // Allocations | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Allocations result = apiInstance.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPrepaymentAllocations");
            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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Prepayment
        Allocations allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] }; // Allocations | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Allocations result = apiInstance.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPrepaymentAllocations");
            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)
UUID *prepaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for Prepayment (default to null)
Allocations *allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create an Allocation for prepayments
[apiInstance createPrepaymentAllocationsWith:xeroTenantId
    prepaymentID:prepaymentID
    allocations:allocations
    summarizeErrors:summarizeErrors
              completionHandler: ^(Allocations 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 prepaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Prepayment 
const allocations:Allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] };  // {Allocations} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations,  summarizeErrors);
  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 createPrepaymentAllocationsExample
    {
        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 prepaymentID = new UUID(); // UUID | Unique identifier for Prepayment (default to null)
            var allocations = new Allocations(); // Allocations | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create an Allocation for prepayments
                Allocations result = apiInstance.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPrepaymentAllocations: " + 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->createPrepaymentAllocations: ', $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 $prepaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Prepayment
my $allocations = ::Object::Allocations->new(); # Allocations | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createPrepaymentAllocations(xeroTenantId => $xeroTenantId, prepaymentID => $prepaymentID, allocations => $allocations, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPrepaymentAllocations: $@\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)
prepaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Prepayment (default to null)
allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] } # Allocations | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create an Allocation for prepayments
    api_response = api_instance.create_prepayment_allocations(xeroTenantId, prepaymentID, allocations, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPrepaymentAllocations: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let prepaymentID = 00000000-0000-0000-000-000000000000; // UUID
    let allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] }; // Allocations
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for Prepayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
allocations *
Allocations
Allocations with an array of Allocation object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createPrepaymentHistory

Allows you to create a history record for an Prepayment


/Prepayments/{PrepaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}/History"
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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PrePayment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPrepaymentHistory");
            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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PrePayment
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPrepaymentHistory");
            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)
UUID *prepaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PrePayment (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a history record for an Prepayment
[apiInstance createPrepaymentHistoryWith:xeroTenantId
    prepaymentID:prepaymentID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 prepaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PrePayment 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords);
  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 createPrepaymentHistoryExample
    {
        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 prepaymentID = new UUID(); // UUID | Unique identifier for a PrePayment (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create a history record for an Prepayment
                HistoryRecords result = apiInstance.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPrepaymentHistory: " + 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->createPrepaymentHistory: ', $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 $prepaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PrePayment
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createPrepaymentHistory(xeroTenantId => $xeroTenantId, prepaymentID => $prepaymentID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPrepaymentHistory: $@\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)
prepaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PrePayment (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create a history record for an Prepayment
    api_response = api_instance.create_prepayment_history(xeroTenantId, prepaymentID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPrepaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let prepaymentID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for a PrePayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPurchaseOrderHistory

Allows you to create HistoryRecord for purchase orders


/PurchaseOrders/{PurchaseOrderID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/History"
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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrderHistory");
            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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrderHistory");
            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)
UUID *purchaseOrderID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PurchaseOrder (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create HistoryRecord for purchase orders
[apiInstance createPurchaseOrderHistoryWith:xeroTenantId
    purchaseOrderID:purchaseOrderID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 purchaseOrderID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PurchaseOrder 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords);
  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 createPurchaseOrderHistoryExample
    {
        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 purchaseOrderID = new UUID(); // UUID | Unique identifier for a PurchaseOrder (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create HistoryRecord for purchase orders
                HistoryRecords result = apiInstance.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPurchaseOrderHistory: " + 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->createPurchaseOrderHistory: ', $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 $purchaseOrderID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PurchaseOrder
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createPurchaseOrderHistory(xeroTenantId => $xeroTenantId, purchaseOrderID => $purchaseOrderID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPurchaseOrderHistory: $@\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)
purchaseOrderID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PurchaseOrder (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create HistoryRecord for purchase orders
    api_response = api_instance.create_purchase_order_history(xeroTenantId, purchaseOrderID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPurchaseOrderHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for a PurchaseOrder
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPurchaseOrders

Allows you to create one or more purchase orders


/PurchaseOrders

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?summarizeErrors=true"
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
        PurchaseOrders purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // PurchaseOrders | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            PurchaseOrders result = apiInstance.createPurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrders");
            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
        PurchaseOrders purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // PurchaseOrders | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            PurchaseOrders result = apiInstance.createPurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrders");
            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)
PurchaseOrders *purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create one or more purchase orders
[apiInstance createPurchaseOrdersWith:xeroTenantId
    purchaseOrders:purchaseOrders
    summarizeErrors:summarizeErrors
              completionHandler: ^(PurchaseOrders 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 purchaseOrders:PurchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] };  // {PurchaseOrders} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createPurchaseOrders(xeroTenantId, purchaseOrders,  summarizeErrors);
  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 createPurchaseOrdersExample
    {
        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 purchaseOrders = new PurchaseOrders(); // PurchaseOrders | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create one or more purchase orders
                PurchaseOrders result = apiInstance.createPurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createPurchaseOrders: " + 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->createPurchaseOrders: ', $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 $purchaseOrders = ::Object::PurchaseOrders->new(); # PurchaseOrders | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createPurchaseOrders(xeroTenantId => $xeroTenantId, purchaseOrders => $purchaseOrders, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createPurchaseOrders: $@\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)
purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create one or more purchase orders
    api_response = api_instance.create_purchase_orders(xeroTenantId, purchaseOrders, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createPurchaseOrders: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // PurchaseOrders
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createPurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
PurchaseOrders with an array of PurchaseOrder object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createQuoteAttachmentByFileName

Allows you to create Attachment on Quote


/Quotes/{QuoteID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createQuoteAttachmentByFileName");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createQuoteAttachmentByFileName");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for Quote object (default to null)
String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create Attachment on Quote
[apiInstance createQuoteAttachmentByFileNameWith:xeroTenantId
    quoteID:quoteID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Quote object 
const fileName = "xero-dev.jpg";  // {String} Name of the attachment 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createQuoteAttachmentByFileNameExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for Quote object (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the attachment (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create Attachment on Quote
                Attachments result = apiInstance.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createQuoteAttachmentByFileName: " + 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->createQuoteAttachmentByFileName: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Quote object
my $fileName = xero-dev.jpg; # String | Name of the attachment
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createQuoteAttachmentByFileName(xeroTenantId => $xeroTenantId, quoteID => $quoteID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createQuoteAttachmentByFileName: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Quote object (default to null)
fileName = xero-dev.jpg # String | Name of the attachment (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create Attachment on Quote
    api_response = api_instance.create_quote_attachment_by_file_name(xeroTenantId, quoteID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createQuoteAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for Quote object
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createQuoteHistory

Allows you to retrieve a history records of an quote


/Quotes/{QuoteID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/History"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createQuoteHistory(xeroTenantId, quoteID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createQuoteHistory");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createQuoteHistory(xeroTenantId, quoteID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createQuoteHistory");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Quote (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an quote
[apiInstance createQuoteHistoryWith:xeroTenantId
    quoteID:quoteID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Quote 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createQuoteHistory(xeroTenantId, quoteID, historyRecords);
  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 createQuoteHistoryExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for an Quote (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to retrieve a history records of an quote
                HistoryRecords result = apiInstance.createQuoteHistory(xeroTenantId, quoteID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createQuoteHistory: " + 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->createQuoteHistory: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Quote
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createQuoteHistory(xeroTenantId => $xeroTenantId, quoteID => $quoteID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createQuoteHistory: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Quote (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to retrieve a history records of an quote
    api_response = api_instance.create_quote_history(xeroTenantId, quoteID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createQuoteHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createQuoteHistory(xeroTenantId, quoteID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createQuotes

Allows you to create one or more quotes


/Quotes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes?summarizeErrors=true"
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
        Quotes quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // Quotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Quotes result = apiInstance.createQuotes(xeroTenantId, quotes, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createQuotes");
            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
        Quotes quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // Quotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Quotes result = apiInstance.createQuotes(xeroTenantId, quotes, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createQuotes");
            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)
Quotes *quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create one or more quotes
[apiInstance createQuotesWith:xeroTenantId
    quotes:quotes
    summarizeErrors:summarizeErrors
              completionHandler: ^(Quotes 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 quotes:Quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] };  // {Quotes} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.createQuotes(xeroTenantId, quotes,  summarizeErrors);
  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 createQuotesExample
    {
        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 quotes = new Quotes(); // Quotes | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create one or more quotes
                Quotes result = apiInstance.createQuotes(xeroTenantId, quotes, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createQuotes: " + 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->createQuotes: ', $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 $quotes = ::Object::Quotes->new(); # Quotes | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->createQuotes(xeroTenantId => $xeroTenantId, quotes => $quotes, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createQuotes: $@\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)
quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create one or more quotes
    api_response = api_instance.create_quotes(xeroTenantId, quotes, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createQuotes: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // Quotes
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.createQuotes(xeroTenantId, quotes, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
quotes *
Quotes
Quotes with an array of Quote object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

createReceipt

Allows you to create draft expense claim receipts for any user


/Receipts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts?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
        Receipts receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] }; // Receipts | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.createReceipt(xeroTenantId, receipts, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createReceipt");
            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
        Receipts receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] }; // Receipts | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.createReceipt(xeroTenantId, receipts, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createReceipt");
            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)
Receipts *receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: 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 create draft expense claim receipts for any user
[apiInstance createReceiptWith:xeroTenantId
    receipts:receipts
    unitdp:unitdp
              completionHandler: ^(Receipts 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 receipts:Receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] };  // {Receipts} 
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.createReceipt(xeroTenantId, receipts,  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 createReceiptExample
    {
        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 receipts = new Receipts(); // Receipts | 
            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 create draft expense claim receipts for any user
                Receipts result = apiInstance.createReceipt(xeroTenantId, receipts, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createReceipt: " + 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->createReceipt: ', $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 $receipts = ::Object::Receipts->new(); # Receipts | 
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->createReceipt(xeroTenantId => $xeroTenantId, receipts => $receipts, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createReceipt: $@\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)
receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] } # Receipts | 
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 create draft expense claim receipts for any user
    api_response = api_instance.create_receipt(xeroTenantId, receipts, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createReceipt: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] }; // Receipts
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.createReceipt(xeroTenantId, receipts, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
receipts *
Receipts
Receipts with an array of Receipt object in body of request
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createReceiptAttachmentByFileName

Allows you to create Attachment on expense claim receipts by file name


/Receipts/{ReceiptID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createReceiptAttachmentByFileName");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createReceiptAttachmentByFileName");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to the Receipt (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create Attachment on expense claim receipts by file name
[apiInstance createReceiptAttachmentByFileNameWith:xeroTenantId
    receiptID:receiptID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to the Receipt 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createReceiptAttachmentByFileNameExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to the Receipt (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create Attachment on expense claim receipts by file name
                Attachments result = apiInstance.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createReceiptAttachmentByFileName: " + 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->createReceiptAttachmentByFileName: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
my $fileName = xero-dev.jpg; # String | The name of the file being attached to the Receipt
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createReceiptAttachmentByFileName(xeroTenantId => $xeroTenantId, receiptID => $receiptID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createReceiptAttachmentByFileName: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to the Receipt (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create Attachment on expense claim receipts by file name
    api_response = api_instance.create_receipt_attachment_by_file_name(xeroTenantId, receiptID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createReceiptAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
FileName*
String
The name of the file being attached to the Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createReceiptHistory

Allows you to retrieve a history records of an Receipt


/Receipts/{ReceiptID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/History"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createReceiptHistory(xeroTenantId, receiptID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createReceiptHistory");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createReceiptHistory(xeroTenantId, receiptID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createReceiptHistory");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an Receipt
[apiInstance createReceiptHistoryWith:xeroTenantId
    receiptID:receiptID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createReceiptHistory(xeroTenantId, receiptID, historyRecords);
  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 createReceiptHistoryExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to retrieve a history records of an Receipt
                HistoryRecords result = apiInstance.createReceiptHistory(xeroTenantId, receiptID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createReceiptHistory: " + 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->createReceiptHistory: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createReceiptHistory(xeroTenantId => $xeroTenantId, receiptID => $receiptID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createReceiptHistory: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to retrieve a history records of an Receipt
    api_response = api_instance.create_receipt_history(xeroTenantId, receiptID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createReceiptHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createReceiptHistory(xeroTenantId, receiptID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createRepeatingInvoiceAttachmentByFileName

Allows you to create attachment on repeating invoices by file name


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceAttachmentByFileName");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceAttachmentByFileName");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a Repeating Invoice (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create attachment on repeating invoices by file name
[apiInstance createRepeatingInvoiceAttachmentByFileNameWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a Repeating Invoice 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 createRepeatingInvoiceAttachmentByFileNameExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a Repeating Invoice (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to create attachment on repeating invoices by file name
                Attachments result = apiInstance.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createRepeatingInvoiceAttachmentByFileName: " + 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->createRepeatingInvoiceAttachmentByFileName: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a Repeating Invoice
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->createRepeatingInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createRepeatingInvoiceAttachmentByFileName: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a Repeating Invoice (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to create attachment on repeating invoices by file name
    api_response = api_instance.create_repeating_invoice_attachment_by_file_name(xeroTenantId, repeatingInvoiceID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createRepeatingInvoiceAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
FileName*
String
The name of the file being attached to a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createRepeatingInvoiceHistory

Allows you to create history for a repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/History"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceHistory");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        HistoryRecords historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords | 
        try {
            HistoryRecords result = apiInstance.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceHistory");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)
HistoryRecords *historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create history for a repeating invoice
[apiInstance createRepeatingInvoiceHistoryWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
    historyRecords:historyRecords
              completionHandler: ^(HistoryRecords 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice 
const historyRecords:HistoryRecords = { historyRecords:[ { details :"Hello World" } ] };  // {HistoryRecords} 
try {
  const response: any = await xero.accountingApi.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords);
  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 createRepeatingInvoiceHistoryExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)
            var historyRecords = new HistoryRecords(); // HistoryRecords | 

            try
            {
                // Allows you to create history for a repeating invoice
                HistoryRecords result = apiInstance.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createRepeatingInvoiceHistory: " + 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->createRepeatingInvoiceHistory: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice
my $historyRecords = ::Object::HistoryRecords->new(); # HistoryRecords | 

eval { 
    my $result = $api_instance->createRepeatingInvoiceHistory(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID, historyRecords => $historyRecords);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createRepeatingInvoiceHistory: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)
historyRecords = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | 

try: 
    # Allows you to create history for a repeating invoice
    api_response = api_instance.create_repeating_invoice_history(xeroTenantId, repeatingInvoiceID, historyRecords)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createRepeatingInvoiceHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let historyRecords = { historyRecords:[ { details :"Hello World" } ] }; // HistoryRecords

    let mut context = AccountingApi::Context::default();
    let result = client.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createTaxRates

Allows you to create one or more Tax Rates


/TaxRates

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TaxRates"
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
        TaxRates taxRates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] }; // TaxRates | 
        try {
            TaxRates result = apiInstance.createTaxRates(xeroTenantId, taxRates);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createTaxRates");
            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
        TaxRates taxRates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] }; // TaxRates | 
        try {
            TaxRates result = apiInstance.createTaxRates(xeroTenantId, taxRates);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createTaxRates");
            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)
TaxRates *taxRates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create one or more Tax Rates
[apiInstance createTaxRatesWith:xeroTenantId
    taxRates:taxRates
              completionHandler: ^(TaxRates 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 taxRates:TaxRates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] };  // {TaxRates} 
try {
  const response: any = await xero.accountingApi.createTaxRates(xeroTenantId, taxRates);
  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 createTaxRatesExample
    {
        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 taxRates = new TaxRates(); // TaxRates | 

            try
            {
                // Allows you to create one or more Tax Rates
                TaxRates result = apiInstance.createTaxRates(xeroTenantId, taxRates);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createTaxRates: " + 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->createTaxRates: ', $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 $taxRates = ::Object::TaxRates->new(); # TaxRates | 

eval { 
    my $result = $api_instance->createTaxRates(xeroTenantId => $xeroTenantId, taxRates => $taxRates);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createTaxRates: $@\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)
taxRates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] } # TaxRates | 

try: 
    # Allows you to create one or more Tax Rates
    api_response = api_instance.create_tax_rates(xeroTenantId, taxRates)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createTaxRates: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let taxRates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] }; // TaxRates

    let mut context = AccountingApi::Context::default();
    let result = client.createTaxRates(xeroTenantId, taxRates, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
taxRates *
TaxRates
TaxRates array with TaxRate object in body of request
Required

createTrackingCategory

Allows you to create tracking categories


/TrackingCategories

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories"
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
        TrackingCategory trackingCategory = { name:"FooBar" }; // TrackingCategory | 
        try {
            TrackingCategories result = apiInstance.createTrackingCategory(xeroTenantId, trackingCategory);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createTrackingCategory");
            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
        TrackingCategory trackingCategory = { name:"FooBar" }; // TrackingCategory | 
        try {
            TrackingCategories result = apiInstance.createTrackingCategory(xeroTenantId, trackingCategory);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createTrackingCategory");
            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)
TrackingCategory *trackingCategory = { name:"FooBar" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create tracking categories
[apiInstance createTrackingCategoryWith:xeroTenantId
    trackingCategory:trackingCategory
              completionHandler: ^(TrackingCategories 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 trackingCategory:TrackingCategory = { name:"FooBar" };  // {TrackingCategory} 
try {
  const response: any = await xero.accountingApi.createTrackingCategory(xeroTenantId, trackingCategory);
  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 createTrackingCategoryExample
    {
        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 trackingCategory = new TrackingCategory(); // TrackingCategory | 

            try
            {
                // Allows you to create tracking categories
                TrackingCategories result = apiInstance.createTrackingCategory(xeroTenantId, trackingCategory);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createTrackingCategory: " + 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->createTrackingCategory: ', $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 $trackingCategory = ::Object::TrackingCategory->new(); # TrackingCategory | 

eval { 
    my $result = $api_instance->createTrackingCategory(xeroTenantId => $xeroTenantId, trackingCategory => $trackingCategory);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createTrackingCategory: $@\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)
trackingCategory = { name:"FooBar" } # TrackingCategory | 

try: 
    # Allows you to create tracking categories
    api_response = api_instance.create_tracking_category(xeroTenantId, trackingCategory)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createTrackingCategory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategory = { name:"FooBar" }; // TrackingCategory

    let mut context = AccountingApi::Context::default();
    let result = client.createTrackingCategory(xeroTenantId, trackingCategory, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
trackingCategory *
TrackingCategory
TrackingCategory object in body of request
Required

createTrackingOptions

Allows you to create options for a specified tracking category


/TrackingCategories/{TrackingCategoryID}/Options

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options"
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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        TrackingOption trackingOption = { name:"Bar" }; // TrackingOption | 
        try {
            TrackingOptions result = apiInstance.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createTrackingOptions");
            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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        TrackingOption trackingOption = { name:"Bar" }; // TrackingOption | 
        try {
            TrackingOptions result = apiInstance.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#createTrackingOptions");
            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)
UUID *trackingCategoryID = 00000000-0000-0000-000-000000000000; // Unique identifier for a TrackingCategory (default to null)
TrackingOption *trackingOption = { name:"Bar" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create options for a specified tracking category
[apiInstance createTrackingOptionsWith:xeroTenantId
    trackingCategoryID:trackingCategoryID
    trackingOption:trackingOption
              completionHandler: ^(TrackingOptions 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 trackingCategoryID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a TrackingCategory 
const trackingOption:TrackingOption = { name:"Bar" };  // {TrackingOption} 
try {
  const response: any = await xero.accountingApi.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption);
  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 createTrackingOptionsExample
    {
        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 trackingCategoryID = new UUID(); // UUID | Unique identifier for a TrackingCategory (default to null)
            var trackingOption = new TrackingOption(); // TrackingOption | 

            try
            {
                // Allows you to create options for a specified tracking category
                TrackingOptions result = apiInstance.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.createTrackingOptions: " + 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->createTrackingOptions: ', $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 $trackingCategoryID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a TrackingCategory
my $trackingOption = ::Object::TrackingOption->new(); # TrackingOption | 

eval { 
    my $result = $api_instance->createTrackingOptions(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID, trackingOption => $trackingOption);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->createTrackingOptions: $@\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)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a TrackingCategory (default to null)
trackingOption = { name:"Bar" } # TrackingOption | 

try: 
    # Allows you to create options for a specified tracking category
    api_response = api_instance.create_tracking_options(xeroTenantId, trackingCategoryID, trackingOption)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->createTrackingOptions: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID
    let trackingOption = { name:"Bar" }; // TrackingOption

    let mut context = AccountingApi::Context::default();
    let result = client.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
trackingOption *
TrackingOption
TrackingOption object in body of request
Required

deleteAccount

Allows you to delete a chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for retrieving single object
        try {
            Accounts result = apiInstance.deleteAccount(xeroTenantId, accountID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteAccount");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for retrieving single object
        try {
            Accounts result = apiInstance.deleteAccount(xeroTenantId, accountID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteAccount");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for retrieving single object (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete a chart of accounts
[apiInstance deleteAccountWith:xeroTenantId
    accountID:accountID
              completionHandler: ^(Accounts 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for retrieving single object
try {
  const response: any = await xero.accountingApi.deleteAccount(xeroTenantId, accountID);
  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 deleteAccountExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for retrieving single object (default to null)

            try
            {
                // Allows you to delete a chart of accounts
                Accounts result = apiInstance.deleteAccount(xeroTenantId, accountID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteAccount: " + 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->deleteAccount: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for retrieving single object

eval { 
    my $result = $api_instance->deleteAccount(xeroTenantId => $xeroTenantId, accountID => $accountID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteAccount: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for retrieving single object (default to null)

try: 
    # Allows you to delete a chart of accounts
    api_response = api_instance.delete_account(xeroTenantId, accountID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteAccount: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteAccount(xeroTenantId, accountID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for retrieving single object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteContactGroupContact

Allows you to delete a specific Contact from a Contact Group


/ContactGroups/{ContactGroupID}/Contacts/{ContactID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}/Contacts/{ContactID}"
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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            apiInstance.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteContactGroupContact");
            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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            apiInstance.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteContactGroupContact");
            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)
UUID *contactGroupID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact Group (default to null)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete a specific Contact from a Contact Group
[apiInstance deleteContactGroupContactWith:xeroTenantId
    contactGroupID:contactGroupID
    contactID:contactID
              completionHandler: ^(NSError* error) {
                            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 contactGroupID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact Group 
const contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
try {
  const response: any = await xero.accountingApi.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID);
  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 deleteContactGroupContactExample
    {
        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 contactGroupID = new UUID(); // UUID | Unique identifier for a Contact Group (default to null)
            var contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)

            try
            {
                // Allows you to delete a specific Contact from a Contact Group
                apiInstance.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteContactGroupContact: " + 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->deleteContactGroupContact: ', $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 $contactGroupID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact Group
my $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact

eval { 
    $api_instance->deleteContactGroupContact(xeroTenantId => $xeroTenantId, contactGroupID => $contactGroupID, contactID => $contactID);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteContactGroupContact: $@\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)
contactGroupID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact Group (default to null)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)

try: 
    # Allows you to delete a specific Contact from a Contact Group
    api_instance.delete_contact_group_contact(xeroTenantId, contactGroupID, contactID)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteContactGroupContact: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactGroupID = 00000000-0000-0000-000-000000000000; // UUID
    let contactID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteContactGroupContacts

Allows you to delete all Contacts from a Contact Group


/ContactGroups/{ContactGroupID}/Contacts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}/Contacts"
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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        try {
            apiInstance.deleteContactGroupContacts(xeroTenantId, contactGroupID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteContactGroupContacts");
            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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        try {
            apiInstance.deleteContactGroupContacts(xeroTenantId, contactGroupID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteContactGroupContacts");
            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)
UUID *contactGroupID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact Group (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete  all Contacts from a Contact Group
[apiInstance deleteContactGroupContactsWith:xeroTenantId
    contactGroupID:contactGroupID
              completionHandler: ^(NSError* error) {
                            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 contactGroupID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact Group
try {
  const response: any = await xero.accountingApi.deleteContactGroupContacts(xeroTenantId, contactGroupID);
  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 deleteContactGroupContactsExample
    {
        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 contactGroupID = new UUID(); // UUID | Unique identifier for a Contact Group (default to null)

            try
            {
                // Allows you to delete  all Contacts from a Contact Group
                apiInstance.deleteContactGroupContacts(xeroTenantId, contactGroupID);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteContactGroupContacts: " + 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->deleteContactGroupContacts: ', $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 $contactGroupID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact Group

eval { 
    $api_instance->deleteContactGroupContacts(xeroTenantId => $xeroTenantId, contactGroupID => $contactGroupID);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteContactGroupContacts: $@\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)
contactGroupID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact Group (default to null)

try: 
    # Allows you to delete  all Contacts from a Contact Group
    api_instance.delete_contact_group_contacts(xeroTenantId, contactGroupID)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteContactGroupContacts: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactGroupID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteContactGroupContacts(xeroTenantId, contactGroupID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteItem

Allows you to delete a specified item


/Items/{ItemID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}"
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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        try {
            apiInstance.deleteItem(xeroTenantId, itemID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteItem");
            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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        try {
            apiInstance.deleteItem(xeroTenantId, itemID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteItem");
            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)
UUID *itemID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Item (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete a specified item
[apiInstance deleteItemWith:xeroTenantId
    itemID:itemID
              completionHandler: ^(NSError* error) {
                            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 itemID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Item
try {
  const response: any = await xero.accountingApi.deleteItem(xeroTenantId, itemID);
  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 deleteItemExample
    {
        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 itemID = new UUID(); // UUID | Unique identifier for an Item (default to null)

            try
            {
                // Allows you to delete a specified item
                apiInstance.deleteItem(xeroTenantId, itemID);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteItem: " + 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->deleteItem: ', $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 $itemID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Item

eval { 
    $api_instance->deleteItem(xeroTenantId => $xeroTenantId, itemID => $itemID);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteItem: $@\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)
itemID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Item (default to null)

try: 
    # Allows you to delete a specified item
    api_instance.delete_item(xeroTenantId, itemID)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteItem: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let itemID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteItem(xeroTenantId, itemID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteLinkedTransaction

Allows you to delete a specified linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions/{LinkedTransactionID}"
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
        UUID linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a LinkedTransaction
        try {
            apiInstance.deleteLinkedTransaction(xeroTenantId, linkedTransactionID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteLinkedTransaction");
            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
        UUID linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a LinkedTransaction
        try {
            apiInstance.deleteLinkedTransaction(xeroTenantId, linkedTransactionID);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteLinkedTransaction");
            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)
UUID *linkedTransactionID = 00000000-0000-0000-000-000000000000; // Unique identifier for a LinkedTransaction (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete a specified linked transactions (billable expenses)
[apiInstance deleteLinkedTransactionWith:xeroTenantId
    linkedTransactionID:linkedTransactionID
              completionHandler: ^(NSError* error) {
                            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 linkedTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a LinkedTransaction
try {
  const response: any = await xero.accountingApi.deleteLinkedTransaction(xeroTenantId, linkedTransactionID);
  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 deleteLinkedTransactionExample
    {
        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 linkedTransactionID = new UUID(); // UUID | Unique identifier for a LinkedTransaction (default to null)

            try
            {
                // Allows you to delete a specified linked transactions (billable expenses)
                apiInstance.deleteLinkedTransaction(xeroTenantId, linkedTransactionID);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteLinkedTransaction: " + 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->deleteLinkedTransaction: ', $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 $linkedTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a LinkedTransaction

eval { 
    $api_instance->deleteLinkedTransaction(xeroTenantId => $xeroTenantId, linkedTransactionID => $linkedTransactionID);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteLinkedTransaction: $@\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)
linkedTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a LinkedTransaction (default to null)

try: 
    # Allows you to delete a specified linked transactions (billable expenses)
    api_instance.delete_linked_transaction(xeroTenantId, linkedTransactionID)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteLinkedTransaction: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteLinkedTransaction(xeroTenantId, linkedTransactionID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
LinkedTransactionID*
UUID (uuid)
Unique identifier for a LinkedTransaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deletePayment

Allows you to update a specified payment for invoices and credit notes


/Payments/{PaymentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}"
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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        Payments payments = { payments:[ { status:"DELETED" } ] }; // Payments | 
        try {
            Payments result = apiInstance.deletePayment(xeroTenantId, paymentID, payments);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deletePayment");
            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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        Payments payments = { payments:[ { status:"DELETED" } ] }; // Payments | 
        try {
            Payments result = apiInstance.deletePayment(xeroTenantId, paymentID, payments);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deletePayment");
            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)
UUID *paymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Payment (default to null)
Payments *payments = { payments:[ { status:"DELETED" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specified payment for invoices and credit notes
[apiInstance deletePaymentWith:xeroTenantId
    paymentID:paymentID
    payments:payments
              completionHandler: ^(Payments 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 paymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Payment 
const payments:Payments = { payments:[ { status:"DELETED" } ] };  // {Payments} 
try {
  const response: any = await xero.accountingApi.deletePayment(xeroTenantId, paymentID, payments);
  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 deletePaymentExample
    {
        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 paymentID = new UUID(); // UUID | Unique identifier for a Payment (default to null)
            var payments = new Payments(); // Payments | 

            try
            {
                // Allows you to update a specified payment for invoices and credit notes
                Payments result = apiInstance.deletePayment(xeroTenantId, paymentID, payments);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deletePayment: " + 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->deletePayment: ', $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 $paymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Payment
my $payments = ::Object::Payments->new(); # Payments | 

eval { 
    my $result = $api_instance->deletePayment(xeroTenantId => $xeroTenantId, paymentID => $paymentID, payments => $payments);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->deletePayment: $@\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)
paymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Payment (default to null)
payments = { payments:[ { status:"DELETED" } ] } # Payments | 

try: 
    # Allows you to update a specified payment for invoices and credit notes
    api_response = api_instance.delete_payment(xeroTenantId, paymentID, payments)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->deletePayment: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let paymentID = 00000000-0000-0000-000-000000000000; // UUID
    let payments = { payments:[ { status:"DELETED" } ] }; // Payments

    let mut context = AccountingApi::Context::default();
    let result = client.deletePayment(xeroTenantId, paymentID, payments, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
PaymentID*
UUID (uuid)
Unique identifier for a Payment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
payments *
Payments
Required

deleteTrackingCategory

Allows you to delete tracking categories


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        try {
            TrackingCategories result = apiInstance.deleteTrackingCategory(xeroTenantId, trackingCategoryID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteTrackingCategory");
            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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        try {
            TrackingCategories result = apiInstance.deleteTrackingCategory(xeroTenantId, trackingCategoryID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteTrackingCategory");
            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)
UUID *trackingCategoryID = 00000000-0000-0000-000-000000000000; // Unique identifier for a TrackingCategory (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete tracking categories
[apiInstance deleteTrackingCategoryWith:xeroTenantId
    trackingCategoryID:trackingCategoryID
              completionHandler: ^(TrackingCategories 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 trackingCategoryID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a TrackingCategory
try {
  const response: any = await xero.accountingApi.deleteTrackingCategory(xeroTenantId, trackingCategoryID);
  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 deleteTrackingCategoryExample
    {
        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 trackingCategoryID = new UUID(); // UUID | Unique identifier for a TrackingCategory (default to null)

            try
            {
                // Allows you to delete tracking categories
                TrackingCategories result = apiInstance.deleteTrackingCategory(xeroTenantId, trackingCategoryID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteTrackingCategory: " + 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->deleteTrackingCategory: ', $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 $trackingCategoryID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a TrackingCategory

eval { 
    my $result = $api_instance->deleteTrackingCategory(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteTrackingCategory: $@\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)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a TrackingCategory (default to null)

try: 
    # Allows you to delete tracking categories
    api_response = api_instance.delete_tracking_category(xeroTenantId, trackingCategoryID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteTrackingCategory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteTrackingCategory(xeroTenantId, trackingCategoryID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteTrackingOptions

Allows you to delete a specified option for a specified tracking category


/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"
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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        UUID trackingOptionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Tracking Option
        try {
            TrackingOptions result = apiInstance.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteTrackingOptions");
            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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        UUID trackingOptionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Tracking Option
        try {
            TrackingOptions result = apiInstance.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#deleteTrackingOptions");
            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)
UUID *trackingCategoryID = 00000000-0000-0000-000-000000000000; // Unique identifier for a TrackingCategory (default to null)
UUID *trackingOptionID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Tracking Option (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to delete a specified option for a specified tracking category
[apiInstance deleteTrackingOptionsWith:xeroTenantId
    trackingCategoryID:trackingCategoryID
    trackingOptionID:trackingOptionID
              completionHandler: ^(TrackingOptions 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 trackingCategoryID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a TrackingCategory 
const trackingOptionID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Tracking Option
try {
  const response: any = await xero.accountingApi.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID);
  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 deleteTrackingOptionsExample
    {
        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 trackingCategoryID = new UUID(); // UUID | Unique identifier for a TrackingCategory (default to null)
            var trackingOptionID = new UUID(); // UUID | Unique identifier for a Tracking Option (default to null)

            try
            {
                // Allows you to delete a specified option for a specified tracking category
                TrackingOptions result = apiInstance.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.deleteTrackingOptions: " + 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->deleteTrackingOptions: ', $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 $trackingCategoryID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a TrackingCategory
my $trackingOptionID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Tracking Option

eval { 
    my $result = $api_instance->deleteTrackingOptions(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID, trackingOptionID => $trackingOptionID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->deleteTrackingOptions: $@\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)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a TrackingCategory (default to null)
trackingOptionID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Tracking Option (default to null)

try: 
    # Allows you to delete a specified option for a specified tracking category
    api_response = api_instance.delete_tracking_options(xeroTenantId, trackingCategoryID, trackingOptionID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->deleteTrackingOptions: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID
    let trackingOptionID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
TrackingOptionID*
UUID (uuid)
Unique identifier for a Tracking Option
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

emailInvoice

Allows you to email a copy of invoice to related Contact


/Invoices/{InvoiceID}/Email

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Email"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        RequestEmpty requestEmpty = {}; // RequestEmpty | 
        try {
            apiInstance.emailInvoice(xeroTenantId, invoiceID, requestEmpty);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#emailInvoice");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        RequestEmpty requestEmpty = {}; // RequestEmpty | 
        try {
            apiInstance.emailInvoice(xeroTenantId, invoiceID, requestEmpty);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#emailInvoice");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
RequestEmpty *requestEmpty = {}; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to email a copy of invoice to related Contact
[apiInstance emailInvoiceWith:xeroTenantId
    invoiceID:invoiceID
    requestEmpty:requestEmpty
              completionHandler: ^(NSError* error) {
                            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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const requestEmpty:RequestEmpty = {};  // {RequestEmpty} 
try {
  const response: any = await xero.accountingApi.emailInvoice(xeroTenantId, invoiceID, requestEmpty);
  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 emailInvoiceExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var requestEmpty = new RequestEmpty(); // RequestEmpty | 

            try
            {
                // Allows you to email a copy of invoice to related Contact
                apiInstance.emailInvoice(xeroTenantId, invoiceID, requestEmpty);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.emailInvoice: " + 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->emailInvoice: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $requestEmpty = ::Object::RequestEmpty->new(); # RequestEmpty | 

eval { 
    $api_instance->emailInvoice(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, requestEmpty => $requestEmpty);
};
if ($@) {
    warn "Exception when calling AccountingApi->emailInvoice: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
requestEmpty = {} # RequestEmpty | 

try: 
    # Allows you to email a copy of invoice to related Contact
    api_instance.email_invoice(xeroTenantId, invoiceID, requestEmpty)
except ApiException as e:
    print("Exception when calling AccountingApi->emailInvoice: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let requestEmpty = {}; // RequestEmpty

    let mut context = AccountingApi::Context::default();
    let result = client.emailInvoice(xeroTenantId, invoiceID, requestEmpty, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
requestEmpty *
RequestEmpty
Required

getAccount

Allows you to retrieve a single chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for retrieving single object
        try {
            Accounts result = apiInstance.getAccount(xeroTenantId, accountID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccount");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for retrieving single object
        try {
            Accounts result = apiInstance.getAccount(xeroTenantId, accountID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccount");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for retrieving single object (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a single chart of accounts
[apiInstance getAccountWith:xeroTenantId
    accountID:accountID
              completionHandler: ^(Accounts 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for retrieving single object
try {
  const response: any = await xero.accountingApi.getAccount(xeroTenantId, accountID);
  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 getAccountExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for retrieving single object (default to null)

            try
            {
                // Allows you to retrieve a single chart of accounts
                Accounts result = apiInstance.getAccount(xeroTenantId, accountID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getAccount: " + 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->getAccount: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for retrieving single object

eval { 
    my $result = $api_instance->getAccount(xeroTenantId => $xeroTenantId, accountID => $accountID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getAccount: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for retrieving single object (default to null)

try: 
    # Allows you to retrieve a single chart of accounts
    api_response = api_instance.get_account(xeroTenantId, accountID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getAccount: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getAccount(xeroTenantId, accountID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for retrieving single object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getAccountAttachmentByFileName

Allows you to retrieve Attachment on Account by Filename


/Accounts/{AccountID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{FileName}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachmentByFileName");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachmentByFileName");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for Account object (default to null)
String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachment on Account by Filename
[apiInstance getAccountAttachmentByFileNameWith:xeroTenantId
    accountID:accountID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Account object 
const fileName = "xero-dev.jpg";  // {String} Name of the attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType);
  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 getAccountAttachmentByFileNameExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for Account object (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachment on Account by Filename
                File result = apiInstance.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getAccountAttachmentByFileName: " + 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->getAccountAttachmentByFileName: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Account object
my $fileName = xero-dev.jpg; # String | Name of the attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getAccountAttachmentByFileName(xeroTenantId => $xeroTenantId, accountID => $accountID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getAccountAttachmentByFileName: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Account object (default to null)
fileName = xero-dev.jpg # String | Name of the attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachment on Account by Filename
    api_response = api_instance.get_account_attachment_by_file_name(xeroTenantId, accountID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getAccountAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for Account object
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getAccountAttachmentById

Allows you to retrieve specific Attachment on Account


/Accounts/{AccountID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{AttachmentID}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Attachment object
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachmentById");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Attachment object
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachmentById");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for Account object (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for Attachment object (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve specific Attachment on Account
[apiInstance getAccountAttachmentByIdWith:xeroTenantId
    accountID:accountID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Account object 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Attachment object 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType);
  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 getAccountAttachmentByIdExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for Account object (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for Attachment object (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve specific Attachment on Account
                File result = apiInstance.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getAccountAttachmentById: " + 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->getAccountAttachmentById: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Account object
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Attachment object
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getAccountAttachmentById(xeroTenantId => $xeroTenantId, accountID => $accountID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getAccountAttachmentById: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Account object (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Attachment object (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve specific Attachment on Account
    api_response = api_instance.get_account_attachment_by_id(xeroTenantId, accountID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getAccountAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for Account object
Required
AttachmentID*
UUID (uuid)
Unique identifier for Attachment object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getAccountAttachments

Allows you to retrieve Attachments for accounts


/Accounts/{AccountID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        try {
            Attachments result = apiInstance.getAccountAttachments(xeroTenantId, accountID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachments");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        try {
            Attachments result = apiInstance.getAccountAttachments(xeroTenantId, accountID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachments");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for Account object (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments for accounts
[apiInstance getAccountAttachmentsWith:xeroTenantId
    accountID:accountID
              completionHandler: ^(Attachments 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Account object
try {
  const response: any = await xero.accountingApi.getAccountAttachments(xeroTenantId, accountID);
  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 getAccountAttachmentsExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for Account object (default to null)

            try
            {
                // Allows you to retrieve Attachments for accounts
                Attachments result = apiInstance.getAccountAttachments(xeroTenantId, accountID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getAccountAttachments: " + 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->getAccountAttachments: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Account object

eval { 
    my $result = $api_instance->getAccountAttachments(xeroTenantId => $xeroTenantId, accountID => $accountID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getAccountAttachments: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Account object (default to null)

try: 
    # Allows you to retrieve Attachments for accounts
    api_response = api_instance.get_account_attachments(xeroTenantId, accountID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getAccountAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getAccountAttachments(xeroTenantId, accountID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for Account object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getAccounts

Allows you to retrieve the full chart of accounts


/Accounts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts?where=Status=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"&order=Name ASC"
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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        try {
            Accounts result = apiInstance.getAccounts(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccounts");
            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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        try {
            Accounts result = apiInstance.getAccounts(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getAccounts");
            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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"; // Filter by an any element (optional) (default to null)
String *order = Name ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve the full chart of accounts
[apiInstance getAccountsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(Accounts 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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"';  // {String} Filter by an any element
const order =  'Name ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getAccounts(xeroTenantId, ifModifiedSince, where, order);
  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 getAccountsExample
    {
        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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Name ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve the full chart of accounts
                Accounts result = apiInstance.getAccounts(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getAccounts: " + 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->getAccounts: ', $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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"; # String | Filter by an any element
my $order = Name ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getAccounts(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getAccounts: $@\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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '" # String | Filter by an any element (optional) (default to null)
order = Name ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve the full chart of accounts
    api_response = api_instance.get_accounts(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getAccounts: %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=="' + Account.StatusEnum.ACTIVE + '" AND Type=="' + Account.BankAccountTypeEnum.BANK + '"; // String
    let order = Name ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getAccounts(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getBankTransaction

Allows you to retrieve a single spend or receive money transaction


/BankTransactions/{BankTransactionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}?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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.getBankTransaction(xeroTenantId, bankTransactionID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransaction");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.getBankTransaction(xeroTenantId, bankTransactionID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransaction");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (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 a single spend or receive money transaction
[apiInstance getBankTransactionWith:xeroTenantId
    bankTransactionID:bankTransactionID
    unitdp:unitdp
              completionHandler: ^(BankTransactions 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction
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.getBankTransaction(xeroTenantId, bankTransactionID,  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 getBankTransactionExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (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 a single spend or receive money transaction
                BankTransactions result = apiInstance.getBankTransaction(xeroTenantId, bankTransactionID, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransaction: " + 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->getBankTransaction: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
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->getBankTransaction(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransaction: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (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 a single spend or receive money transaction
    api_response = api_instance.get_bank_transaction(xeroTenantId, bankTransactionID, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransaction: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransaction(xeroTenantId, bankTransactionID, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getBankTransactionAttachmentByFileName

Allows you to retrieve Attachments on BankTransaction by Filename


/BankTransactions/{BankTransactionID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{FileName}"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        String fileName = xero-dev.jpg; // String | The name of the file being attached
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentByFileName");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        String fileName = xero-dev.jpg; // String | The name of the file being attached
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentByFileName");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on BankTransaction by Filename
[apiInstance getBankTransactionAttachmentByFileNameWith:xeroTenantId
    bankTransactionID:bankTransactionID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType);
  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 getBankTransactionAttachmentByFileNameExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on BankTransaction by Filename
                File result = apiInstance.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransactionAttachmentByFileName: " + 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->getBankTransactionAttachmentByFileName: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
my $fileName = xero-dev.jpg; # String | The name of the file being attached
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getBankTransactionAttachmentByFileName(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransactionAttachmentByFileName: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on BankTransaction by Filename
    api_response = api_instance.get_bank_transaction_attachment_by_file_name(xeroTenantId, bankTransactionID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransactionAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
FileName*
String
The name of the file being attached
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getBankTransactionAttachmentById

Allows you to retrieve Attachments on a specific BankTransaction


/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for an attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentById");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for an attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentById");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for an attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on a specific BankTransaction
[apiInstance getBankTransactionAttachmentByIdWith:xeroTenantId
    bankTransactionID:bankTransactionID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for an attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType);
  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 getBankTransactionAttachmentByIdExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)
            var attachmentID = new UUID(); // UUID | Xero generated unique identifier for an attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on a specific BankTransaction
                File result = apiInstance.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransactionAttachmentById: " + 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->getBankTransactionAttachmentById: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for an attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getBankTransactionAttachmentById(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransactionAttachmentById: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for an attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on a specific BankTransaction
    api_response = api_instance.get_bank_transaction_attachment_by_id(xeroTenantId, bankTransactionID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransactionAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
AttachmentID*
UUID (uuid)
Xero generated unique identifier for an attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getBankTransactionAttachments

Allows you to retrieve any attachments to bank transactions


/BankTransactions/{BankTransactionID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        try {
            Attachments result = apiInstance.getBankTransactionAttachments(xeroTenantId, bankTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachments");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        try {
            Attachments result = apiInstance.getBankTransactionAttachments(xeroTenantId, bankTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachments");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve any attachments to bank transactions
[apiInstance getBankTransactionAttachmentsWith:xeroTenantId
    bankTransactionID:bankTransactionID
              completionHandler: ^(Attachments 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction
try {
  const response: any = await xero.accountingApi.getBankTransactionAttachments(xeroTenantId, bankTransactionID);
  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 getBankTransactionAttachmentsExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)

            try
            {
                // Allows you to retrieve any attachments to bank transactions
                Attachments result = apiInstance.getBankTransactionAttachments(xeroTenantId, bankTransactionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransactionAttachments: " + 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->getBankTransactionAttachments: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction

eval { 
    my $result = $api_instance->getBankTransactionAttachments(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransactionAttachments: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)

try: 
    # Allows you to retrieve any attachments to bank transactions
    api_response = api_instance.get_bank_transaction_attachments(xeroTenantId, bankTransactionID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransactionAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransactionAttachments(xeroTenantId, bankTransactionID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBankTransactions

Allows you to retrieve any spend or receive money transactions


/BankTransactions

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions?where=Status=="' + BankTransaction.StatusEnum.ACTIVE + '"&order=Type ASC&page=1&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=="' + BankTransaction.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Type ASC; // String | Order by an any element
        Integer page = 1; // Integer | Up to 100 bank transactions will be returned in a single API call with line items details
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactions");
            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=="' + BankTransaction.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Type ASC; // String | Order by an any element
        Integer page = 1; // Integer | Up to 100 bank transactions will be returned in a single API call with line items details
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactions");
            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=="' + BankTransaction.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Type ASC; // Order by an any element (optional) (default to null)
Integer *page = 1; // Up to 100 bank transactions will be returned in a single API call with line items details (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 spend or receive money transactions
[apiInstance getBankTransactionsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    page:page
    unitdp:unitdp
              completionHandler: ^(BankTransactions 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=="' + BankTransaction.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Type ASC';  // {String} Order by an any element
const page =  1;  // {Integer} Up to 100 bank transactions will be returned in a single API call with line items details
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.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, 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 getBankTransactionsExample
    {
        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=="' + BankTransaction.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Type ASC;  // String | Order by an any element (optional)  (default to null)
            var page = 1;  // Integer | Up to 100 bank transactions will be returned in a single API call with line items details (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 spend or receive money transactions
                BankTransactions result = apiInstance.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransactions: " + 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->getBankTransactions: ', $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=="' + BankTransaction.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Type ASC; # String | Order by an any element
my $page = 1; # Integer | Up to 100 bank transactions will be returned in a single API call with line items details
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->getBankTransactions(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, page => $page, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransactions: $@\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=="' + BankTransaction.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Type ASC # String | Order by an any element (optional) (default to null)
page = 1 # Integer | Up to 100 bank transactions will be returned in a single API call with line items details (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 spend or receive money transactions
    api_response = api_instance.get_bank_transactions(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, page=page, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransactions: %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=="' + BankTransaction.StatusEnum.ACTIVE + '"; // String
    let order = Type ASC; // String
    let page = 1; // Integer
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
Up to 100 bank transactions will be returned in a single API call with line items details
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getBankTransactionsHistory

Allows you to retrieve history from a bank transactions


/BankTransactions/{BankTransactionID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/History"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        try {
            HistoryRecords result = apiInstance.getBankTransactionsHistory(xeroTenantId, bankTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionsHistory");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        try {
            HistoryRecords result = apiInstance.getBankTransactionsHistory(xeroTenantId, bankTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionsHistory");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history from a bank transactions
[apiInstance getBankTransactionsHistoryWith:xeroTenantId
    bankTransactionID:bankTransactionID
              completionHandler: ^(HistoryRecords 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction
try {
  const response: any = await xero.accountingApi.getBankTransactionsHistory(xeroTenantId, bankTransactionID);
  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 getBankTransactionsHistoryExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)

            try
            {
                // Allows you to retrieve history from a bank transactions
                HistoryRecords result = apiInstance.getBankTransactionsHistory(xeroTenantId, bankTransactionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransactionsHistory: " + 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->getBankTransactionsHistory: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction

eval { 
    my $result = $api_instance->getBankTransactionsHistory(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransactionsHistory: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)

try: 
    # Allows you to retrieve history from a bank transactions
    api_response = api_instance.get_bank_transactions_history(xeroTenantId, bankTransactionID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransactionsHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransactionsHistory(xeroTenantId, bankTransactionID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBankTransfer

Allows you to retrieve any bank transfers


/BankTransfers/{BankTransferID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        try {
            BankTransfers result = apiInstance.getBankTransfer(xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransfer");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        try {
            BankTransfers result = apiInstance.getBankTransfer(xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransfer");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve any bank transfers
[apiInstance getBankTransferWith:xeroTenantId
    bankTransferID:bankTransferID
              completionHandler: ^(BankTransfers 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer
try {
  const response: any = await xero.accountingApi.getBankTransfer(xeroTenantId, bankTransferID);
  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 getBankTransferExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)

            try
            {
                // Allows you to retrieve any bank transfers
                BankTransfers result = apiInstance.getBankTransfer(xeroTenantId, bankTransferID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransfer: " + 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->getBankTransfer: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer

eval { 
    my $result = $api_instance->getBankTransfer(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransfer: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)

try: 
    # Allows you to retrieve any bank transfers
    api_response = api_instance.get_bank_transfer(xeroTenantId, bankTransferID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransfer: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransfer(xeroTenantId, bankTransferID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBankTransferAttachmentByFileName

Allows you to retrieve Attachments on BankTransfer by file name


/BankTransfers/{BankTransferID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{FileName}"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentByFileName");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentByFileName");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a Bank Transfer (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on BankTransfer by file name
[apiInstance getBankTransferAttachmentByFileNameWith:xeroTenantId
    bankTransferID:bankTransferID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a Bank Transfer 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType);
  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 getBankTransferAttachmentByFileNameExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a Bank Transfer (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on BankTransfer by file name
                File result = apiInstance.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransferAttachmentByFileName: " + 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->getBankTransferAttachmentByFileName: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a Bank Transfer
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getBankTransferAttachmentByFileName(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransferAttachmentByFileName: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a Bank Transfer (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on BankTransfer by file name
    api_response = api_instance.get_bank_transfer_attachment_by_file_name(xeroTenantId, bankTransferID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransferAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
FileName*
String
The name of the file being attached to a Bank Transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getBankTransferAttachmentById

Allows you to retrieve Attachments on BankTransfer


/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for an Attachment to a bank transfer
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentById");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for an Attachment to a bank transfer
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentById");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for an Attachment to a bank transfer (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on BankTransfer
[apiInstance getBankTransferAttachmentByIdWith:xeroTenantId
    bankTransferID:bankTransferID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for an Attachment to a bank transfer 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType);
  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 getBankTransferAttachmentByIdExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)
            var attachmentID = new UUID(); // UUID | Xero generated unique identifier for an Attachment to a bank transfer (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on BankTransfer
                File result = apiInstance.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransferAttachmentById: " + 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->getBankTransferAttachmentById: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for an Attachment to a bank transfer
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getBankTransferAttachmentById(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransferAttachmentById: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for an Attachment to a bank transfer (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on BankTransfer
    api_response = api_instance.get_bank_transfer_attachment_by_id(xeroTenantId, bankTransferID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransferAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
AttachmentID*
UUID (uuid)
Xero generated unique identifier for an Attachment to a bank transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getBankTransferAttachments

Allows you to retrieve Attachments from bank transfers


/BankTransfers/{BankTransferID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        try {
            Attachments result = apiInstance.getBankTransferAttachments(xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachments");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        try {
            Attachments result = apiInstance.getBankTransferAttachments(xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachments");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments from  bank transfers
[apiInstance getBankTransferAttachmentsWith:xeroTenantId
    bankTransferID:bankTransferID
              completionHandler: ^(Attachments 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer
try {
  const response: any = await xero.accountingApi.getBankTransferAttachments(xeroTenantId, bankTransferID);
  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 getBankTransferAttachmentsExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)

            try
            {
                // Allows you to retrieve Attachments from  bank transfers
                Attachments result = apiInstance.getBankTransferAttachments(xeroTenantId, bankTransferID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransferAttachments: " + 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->getBankTransferAttachments: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer

eval { 
    my $result = $api_instance->getBankTransferAttachments(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransferAttachments: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)

try: 
    # Allows you to retrieve Attachments from  bank transfers
    api_response = api_instance.get_bank_transfer_attachments(xeroTenantId, bankTransferID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransferAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransferAttachments(xeroTenantId, bankTransferID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBankTransferHistory

Allows you to retrieve history from a bank transfers


/BankTransfers/{BankTransferID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/History"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        try {
            HistoryRecords result = apiInstance.getBankTransferHistory(xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferHistory");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        try {
            HistoryRecords result = apiInstance.getBankTransferHistory(xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferHistory");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history from a bank transfers
[apiInstance getBankTransferHistoryWith:xeroTenantId
    bankTransferID:bankTransferID
              completionHandler: ^(HistoryRecords 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer
try {
  const response: any = await xero.accountingApi.getBankTransferHistory(xeroTenantId, bankTransferID);
  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 getBankTransferHistoryExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)

            try
            {
                // Allows you to retrieve history from a bank transfers
                HistoryRecords result = apiInstance.getBankTransferHistory(xeroTenantId, bankTransferID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransferHistory: " + 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->getBankTransferHistory: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer

eval { 
    my $result = $api_instance->getBankTransferHistory(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransferHistory: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)

try: 
    # Allows you to retrieve history from a bank transfers
    api_response = api_instance.get_bank_transfer_history(xeroTenantId, bankTransferID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransferHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransferHistory(xeroTenantId, bankTransferID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBankTransfers

Allows you to retrieve all bank transfers


/BankTransfers

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers?where=Status=="' + BankTransfer.StatusEnum.ACTIVE + '"&order=Amount ASC"
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=="' + BankTransfer.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Amount ASC; // String | Order by an any element
        try {
            BankTransfers result = apiInstance.getBankTransfers(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransfers");
            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=="' + BankTransfer.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Amount ASC; // String | Order by an any element
        try {
            BankTransfers result = apiInstance.getBankTransfers(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransfers");
            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=="' + BankTransfer.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Amount ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve all bank transfers
[apiInstance getBankTransfersWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(BankTransfers 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=="' + BankTransfer.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Amount ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getBankTransfers(xeroTenantId, ifModifiedSince, where, order);
  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 getBankTransfersExample
    {
        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=="' + BankTransfer.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Amount ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve all bank transfers
                BankTransfers result = apiInstance.getBankTransfers(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBankTransfers: " + 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->getBankTransfers: ', $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=="' + BankTransfer.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Amount ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getBankTransfers(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBankTransfers: $@\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=="' + BankTransfer.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Amount ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve all bank transfers
    api_response = api_instance.get_bank_transfers(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBankTransfers: %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=="' + BankTransfer.StatusEnum.ACTIVE + '"; // String
    let order = Amount ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBankTransfers(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getBatchPaymentHistory

Allows you to retrieve history from a Batch Payment


/BatchPayments/{BatchPaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments/{BatchPaymentID}/History"
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
        UUID batchPaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for BatchPayment
        try {
            HistoryRecords result = apiInstance.getBatchPaymentHistory(xeroTenantId, batchPaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPaymentHistory");
            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
        UUID batchPaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for BatchPayment
        try {
            HistoryRecords result = apiInstance.getBatchPaymentHistory(xeroTenantId, batchPaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPaymentHistory");
            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)
UUID *batchPaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for BatchPayment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history from a Batch Payment
[apiInstance getBatchPaymentHistoryWith:xeroTenantId
    batchPaymentID:batchPaymentID
              completionHandler: ^(HistoryRecords 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 batchPaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for BatchPayment
try {
  const response: any = await xero.accountingApi.getBatchPaymentHistory(xeroTenantId, batchPaymentID);
  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 getBatchPaymentHistoryExample
    {
        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 batchPaymentID = new UUID(); // UUID | Unique identifier for BatchPayment (default to null)

            try
            {
                // Allows you to retrieve history from a Batch Payment
                HistoryRecords result = apiInstance.getBatchPaymentHistory(xeroTenantId, batchPaymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBatchPaymentHistory: " + 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->getBatchPaymentHistory: ', $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 $batchPaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for BatchPayment

eval { 
    my $result = $api_instance->getBatchPaymentHistory(xeroTenantId => $xeroTenantId, batchPaymentID => $batchPaymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBatchPaymentHistory: $@\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)
batchPaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for BatchPayment (default to null)

try: 
    # Allows you to retrieve history from a Batch Payment
    api_response = api_instance.get_batch_payment_history(xeroTenantId, batchPaymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBatchPaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let batchPaymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBatchPaymentHistory(xeroTenantId, batchPaymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
BatchPaymentID*
UUID (uuid)
Unique identifier for BatchPayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBatchPayments

Retrieve either one or many BatchPayments for invoices


/BatchPayments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments?where=Status=="' + BatchPayment.StatusEnum.ACTIVE + '"&order=Date ASC"
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=="' + BatchPayment.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Date ASC; // String | Order by an any element
        try {
            BatchPayments result = apiInstance.getBatchPayments(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPayments");
            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=="' + BatchPayment.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Date ASC; // String | Order by an any element
        try {
            BatchPayments result = apiInstance.getBatchPayments(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPayments");
            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=="' + BatchPayment.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Date ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Retrieve either one or many BatchPayments for invoices
[apiInstance getBatchPaymentsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(BatchPayments 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=="' + BatchPayment.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Date ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getBatchPayments(xeroTenantId, ifModifiedSince, where, order);
  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 getBatchPaymentsExample
    {
        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=="' + BatchPayment.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Date ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Retrieve either one or many BatchPayments for invoices
                BatchPayments result = apiInstance.getBatchPayments(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBatchPayments: " + 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->getBatchPayments: ', $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=="' + BatchPayment.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Date ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getBatchPayments(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBatchPayments: $@\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=="' + BatchPayment.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Date ASC # String | Order by an any element (optional) (default to null)

try: 
    # Retrieve either one or many BatchPayments for invoices
    api_response = api_instance.get_batch_payments(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBatchPayments: %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=="' + BatchPayment.StatusEnum.ACTIVE + '"; // String
    let order = Date ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBatchPayments(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getBrandingTheme

Allows you to retrieve a specific BrandingThemes


/BrandingThemes/{BrandingThemeID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes/{BrandingThemeID}"
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
        UUID brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Branding Theme
        try {
            BrandingThemes result = apiInstance.getBrandingTheme(xeroTenantId, brandingThemeID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingTheme");
            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
        UUID brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Branding Theme
        try {
            BrandingThemes result = apiInstance.getBrandingTheme(xeroTenantId, brandingThemeID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingTheme");
            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)
UUID *brandingThemeID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Branding Theme (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specific BrandingThemes
[apiInstance getBrandingThemeWith:xeroTenantId
    brandingThemeID:brandingThemeID
              completionHandler: ^(BrandingThemes 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 brandingThemeID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Branding Theme
try {
  const response: any = await xero.accountingApi.getBrandingTheme(xeroTenantId, brandingThemeID);
  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 getBrandingThemeExample
    {
        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 brandingThemeID = new UUID(); // UUID | Unique identifier for a Branding Theme (default to null)

            try
            {
                // Allows you to retrieve a specific BrandingThemes
                BrandingThemes result = apiInstance.getBrandingTheme(xeroTenantId, brandingThemeID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBrandingTheme: " + 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->getBrandingTheme: ', $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 $brandingThemeID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Branding Theme

eval { 
    my $result = $api_instance->getBrandingTheme(xeroTenantId => $xeroTenantId, brandingThemeID => $brandingThemeID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBrandingTheme: $@\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)
brandingThemeID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Branding Theme (default to null)

try: 
    # Allows you to retrieve a specific BrandingThemes
    api_response = api_instance.get_branding_theme(xeroTenantId, brandingThemeID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBrandingTheme: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBrandingTheme(xeroTenantId, brandingThemeID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
BrandingThemeID*
UUID (uuid)
Unique identifier for a Branding Theme
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBrandingThemePaymentServices

Allows you to retrieve the Payment services for a Branding Theme


/BrandingThemes/{BrandingThemeID}/PaymentServices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes/{BrandingThemeID}/PaymentServices"
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
        UUID brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Branding Theme
        try {
            PaymentServices result = apiInstance.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingThemePaymentServices");
            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
        UUID brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Branding Theme
        try {
            PaymentServices result = apiInstance.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingThemePaymentServices");
            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)
UUID *brandingThemeID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Branding Theme (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve the Payment services for a Branding Theme
[apiInstance getBrandingThemePaymentServicesWith:xeroTenantId
    brandingThemeID:brandingThemeID
              completionHandler: ^(PaymentServices 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 brandingThemeID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Branding Theme
try {
  const response: any = await xero.accountingApi.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID);
  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 getBrandingThemePaymentServicesExample
    {
        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 brandingThemeID = new UUID(); // UUID | Unique identifier for a Branding Theme (default to null)

            try
            {
                // Allows you to retrieve the Payment services for a Branding Theme
                PaymentServices result = apiInstance.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBrandingThemePaymentServices: " + 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->getBrandingThemePaymentServices: ', $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 $brandingThemeID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Branding Theme

eval { 
    my $result = $api_instance->getBrandingThemePaymentServices(xeroTenantId => $xeroTenantId, brandingThemeID => $brandingThemeID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBrandingThemePaymentServices: $@\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)
brandingThemeID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Branding Theme (default to null)

try: 
    # Allows you to retrieve the Payment services for a Branding Theme
    api_response = api_instance.get_branding_theme_payment_services(xeroTenantId, brandingThemeID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBrandingThemePaymentServices: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let brandingThemeID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID, &context).wait();
    println!("{:?}", result);

}

Scopes

paymentservices Grant read-write access to payment services

Parameters

Path parameters
Name Description
BrandingThemeID*
UUID (uuid)
Unique identifier for a Branding Theme
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBrandingThemes

Allows you to retrieve all the BrandingThemes


/BrandingThemes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes"
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
        try {
            BrandingThemes result = apiInstance.getBrandingThemes(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingThemes");
            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
        try {
            BrandingThemes result = apiInstance.getBrandingThemes(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingThemes");
            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)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve all the BrandingThemes
[apiInstance getBrandingThemesWith:xeroTenantId
              completionHandler: ^(BrandingThemes 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
try {
  const response: any = await xero.accountingApi.getBrandingThemes(xeroTenantId);
  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 getBrandingThemesExample
    {
        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)

            try
            {
                // Allows you to retrieve all the BrandingThemes
                BrandingThemes result = apiInstance.getBrandingThemes(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getBrandingThemes: " + 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->getBrandingThemes: ', $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

eval { 
    my $result = $api_instance->getBrandingThemes(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getBrandingThemes: $@\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)

try: 
    # Allows you to retrieve all the BrandingThemes
    api_response = api_instance.get_branding_themes(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getBrandingThemes: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getBrandingThemes(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContact

Allows you to retrieve, add and update contacts in a Xero organisation


/Contacts/{ContactID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            Contacts result = apiInstance.getContact(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContact");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            Contacts result = apiInstance.getContact(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContact");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve, add and update contacts in a Xero organisation
[apiInstance getContactWith:xeroTenantId
    contactID:contactID
              completionHandler: ^(Contacts 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
try {
  const response: any = await xero.accountingApi.getContact(xeroTenantId, contactID);
  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 getContactExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)

            try
            {
                // Allows you to retrieve, add and update contacts in a Xero organisation
                Contacts result = apiInstance.getContact(xeroTenantId, contactID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContact: " + 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->getContact: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact

eval { 
    my $result = $api_instance->getContact(xeroTenantId => $xeroTenantId, contactID => $contactID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContact: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)

try: 
    # Allows you to retrieve, add and update contacts in a Xero organisation
    api_response = api_instance.get_contact(xeroTenantId, contactID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContact: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getContact(xeroTenantId, contactID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts.read Grant read-only access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContactAttachmentByFileName

Allows you to retrieve Attachments on Contacts by file name


/Contacts/{ContactID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{FileName}"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachmentByFileName");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachmentByFileName");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
String *fileName = xero-dev.jpg; // Name for the file you are attaching (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on Contacts by file name
[apiInstance getContactAttachmentByFileNameWith:xeroTenantId
    contactID:contactID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact 
const fileName = "xero-dev.jpg";  // {String} Name for the file you are attaching 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType);
  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 getContactAttachmentByFileNameExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var fileName = xero-dev.jpg;  // String | Name for the file you are attaching (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on Contacts by file name
                File result = apiInstance.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactAttachmentByFileName: " + 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->getContactAttachmentByFileName: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $fileName = xero-dev.jpg; # String | Name for the file you are attaching
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getContactAttachmentByFileName(xeroTenantId => $xeroTenantId, contactID => $contactID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactAttachmentByFileName: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
fileName = xero-dev.jpg # String | Name for the file you are attaching (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on Contacts by file name
    api_response = api_instance.get_contact_attachment_by_file_name(xeroTenantId, contactID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
FileName*
String
Name for the file you are attaching
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getContactAttachmentById

Allows you to retrieve Attachments on Contacts


/Contacts/{ContactID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{AttachmentID}"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachmentById");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachmentById");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on Contacts
[apiInstance getContactAttachmentByIdWith:xeroTenantId
    contactID:contactID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType);
  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 getContactAttachmentByIdExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for a Attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on Contacts
                File result = apiInstance.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactAttachmentById: " + 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->getContactAttachmentById: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getContactAttachmentById(xeroTenantId => $xeroTenantId, contactID => $contactID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactAttachmentById: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on Contacts
    api_response = api_instance.get_contact_attachment_by_id(xeroTenantId, contactID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
AttachmentID*
UUID (uuid)
Unique identifier for a Attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getContactAttachments

Allows you to retrieve, add and update contacts in a Xero organisation


/Contacts/{ContactID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            Attachments result = apiInstance.getContactAttachments(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachments");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            Attachments result = apiInstance.getContactAttachments(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachments");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve, add and update contacts in a Xero organisation
[apiInstance getContactAttachmentsWith:xeroTenantId
    contactID:contactID
              completionHandler: ^(Attachments 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
try {
  const response: any = await xero.accountingApi.getContactAttachments(xeroTenantId, contactID);
  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 getContactAttachmentsExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)

            try
            {
                // Allows you to retrieve, add and update contacts in a Xero organisation
                Attachments result = apiInstance.getContactAttachments(xeroTenantId, contactID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactAttachments: " + 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->getContactAttachments: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact

eval { 
    my $result = $api_instance->getContactAttachments(xeroTenantId => $xeroTenantId, contactID => $contactID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactAttachments: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)

try: 
    # Allows you to retrieve, add and update contacts in a Xero organisation
    api_response = api_instance.get_contact_attachments(xeroTenantId, contactID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getContactAttachments(xeroTenantId, contactID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContactCISSettings

Allows you to retrieve CISSettings for a contact in a Xero organisation


/Contacts/{ContactID}/CISSettings

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/CISSettings"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            CISSettings result = apiInstance.getContactCISSettings(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactCISSettings");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            CISSettings result = apiInstance.getContactCISSettings(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactCISSettings");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve CISSettings for a contact in a Xero organisation
[apiInstance getContactCISSettingsWith:xeroTenantId
    contactID:contactID
              completionHandler: ^(CISSettings 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
try {
  const response: any = await xero.accountingApi.getContactCISSettings(xeroTenantId, contactID);
  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 getContactCISSettingsExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)

            try
            {
                // Allows you to retrieve CISSettings for a contact in a Xero organisation
                CISSettings result = apiInstance.getContactCISSettings(xeroTenantId, contactID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactCISSettings: " + 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->getContactCISSettings: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact

eval { 
    my $result = $api_instance->getContactCISSettings(xeroTenantId => $xeroTenantId, contactID => $contactID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactCISSettings: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)

try: 
    # Allows you to retrieve CISSettings for a contact in a Xero organisation
    api_response = api_instance.get_contact_cis_settings(xeroTenantId, contactID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactCISSettings: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getContactCISSettings(xeroTenantId, contactID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts.read Grant read-only access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContactGroup

Allows you to retrieve a unique Contact Group by ID


/ContactGroups/{ContactGroupID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}"
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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        try {
            ContactGroups result = apiInstance.getContactGroup(xeroTenantId, contactGroupID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactGroup");
            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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        try {
            ContactGroups result = apiInstance.getContactGroup(xeroTenantId, contactGroupID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactGroup");
            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)
UUID *contactGroupID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact Group (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a unique Contact Group by ID
[apiInstance getContactGroupWith:xeroTenantId
    contactGroupID:contactGroupID
              completionHandler: ^(ContactGroups 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 contactGroupID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact Group
try {
  const response: any = await xero.accountingApi.getContactGroup(xeroTenantId, contactGroupID);
  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 getContactGroupExample
    {
        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 contactGroupID = new UUID(); // UUID | Unique identifier for a Contact Group (default to null)

            try
            {
                // Allows you to retrieve a unique Contact Group by ID
                ContactGroups result = apiInstance.getContactGroup(xeroTenantId, contactGroupID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactGroup: " + 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->getContactGroup: ', $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 $contactGroupID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact Group

eval { 
    my $result = $api_instance->getContactGroup(xeroTenantId => $xeroTenantId, contactGroupID => $contactGroupID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactGroup: $@\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)
contactGroupID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact Group (default to null)

try: 
    # Allows you to retrieve a unique Contact Group by ID
    api_response = api_instance.get_contact_group(xeroTenantId, contactGroupID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactGroup: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactGroupID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getContactGroup(xeroTenantId, contactGroupID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts.read Grant read-only access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContactGroups

Allows you to retrieve the ContactID and Name of all the contacts in a contact group


/ContactGroups

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups?where=Status=="' + ContactGroup.StatusEnum.ACTIVE + '"&order=Name ASC"
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
        String where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        try {
            ContactGroups result = apiInstance.getContactGroups(xeroTenantId, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactGroups");
            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
        String where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        try {
            ContactGroups result = apiInstance.getContactGroups(xeroTenantId, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactGroups");
            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)
String *where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Name ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve the ContactID and Name of all the contacts in a contact group
[apiInstance getContactGroupsWith:xeroTenantId
    where:where
    order:order
              completionHandler: ^(ContactGroups 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 where =  'Status=="' + ContactGroup.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Name ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getContactGroups(xeroTenantId,  where, order);
  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 getContactGroupsExample
    {
        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 where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Name ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve the ContactID and Name of all the contacts in a contact group
                ContactGroups result = apiInstance.getContactGroups(xeroTenantId, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactGroups: " + 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->getContactGroups: ', $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 $where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Name ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getContactGroups(xeroTenantId => $xeroTenantId, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactGroups: $@\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)
where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Name ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve the ContactID and Name of all the contacts in a contact group
    api_response = api_instance.get_contact_groups(xeroTenantId, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactGroups: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let where = Status=="' + ContactGroup.StatusEnum.ACTIVE + '"; // String
    let order = Name ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getContactGroups(xeroTenantId, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts.read Grant read-only access to contacts and contact groups

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getContactHistory

Allows you to retrieve a history records of an Contact


/Contacts/{ContactID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/History"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            HistoryRecords result = apiInstance.getContactHistory(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactHistory");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        try {
            HistoryRecords result = apiInstance.getContactHistory(xeroTenantId, contactID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContactHistory");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an Contact
[apiInstance getContactHistoryWith:xeroTenantId
    contactID:contactID
              completionHandler: ^(HistoryRecords 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
try {
  const response: any = await xero.accountingApi.getContactHistory(xeroTenantId, contactID);
  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 getContactHistoryExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)

            try
            {
                // Allows you to retrieve a history records of an Contact
                HistoryRecords result = apiInstance.getContactHistory(xeroTenantId, contactID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContactHistory: " + 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->getContactHistory: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact

eval { 
    my $result = $api_instance->getContactHistory(xeroTenantId => $xeroTenantId, contactID => $contactID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContactHistory: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)

try: 
    # Allows you to retrieve a history records of an Contact
    api_response = api_instance.get_contact_history(xeroTenantId, contactID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContactHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getContactHistory(xeroTenantId, contactID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts.read Grant read-only access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContacts

Allows you to retrieve, add and update contacts in a Xero organisation


/Contacts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts?where=Status=="' + Contact.ContactStatusEnum.ACTIVE + '"&order=Name ASC&IDs=00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000&page=1&includeArchived=true"
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=="' + Contact.ContactStatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
        Integer page = 1; // Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call.
        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
        try {
            Contacts result = apiInstance.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContacts");
            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=="' + Contact.ContactStatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
        Integer page = 1; // Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call.
        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
        try {
            Contacts result = apiInstance.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getContacts");
            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=="' + Contact.ContactStatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call. (optional) (default to null)
Integer *page = 1; // e.g. page=1 - Up to 100 contacts will be returned in a single API call. (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)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve, add and update contacts in a Xero organisation
[apiInstance getContactsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    iDs:iDs
    page:page
    includeArchived:includeArchived
              completionHandler: ^(Contacts 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=="' + Contact.ContactStatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
const page =  1;  // {Integer} e.g. page=1 - Up to 100 contacts will be returned in a single API call.
const includeArchived =  true;  // {Boolean} e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response

try {
  const response: any = await xero.accountingApi.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived);
  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 getContactsExample
    {
        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=="' + Contact.ContactStatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call. (optional)  (default to null)
            var page = 1;  // Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call. (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)

            try
            {
                // Allows you to retrieve, add and update contacts in a Xero organisation
                Contacts result = apiInstance.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getContacts: " + 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->getContacts: ', $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=="' + Contact.ContactStatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
my $page = 1; # Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call.
my $includeArchived = true; # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response

eval { 
    my $result = $api_instance->getContacts(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, iDs => $iDs, page => $page, includeArchived => $includeArchived);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getContacts: $@\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=="' + Contact.ContactStatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Name 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 ContactIDs. Allows you to retrieve a specific set of contacts in a single call. (optional) (default to null)
page = 1 # Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call. (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)

try: 
    # Allows you to retrieve, add and update contacts in a Xero organisation
    api_response = api_instance.get_contacts(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, iDs=iDs, page=page, includeArchived=includeArchived)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getContacts: %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=="' + Contact.ContactStatusEnum.ACTIVE + '"; // String
    let order = Name ASC; // String
    let iDs = 00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000; // array[UUID]
    let page = 1; // Integer
    let includeArchived = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts.read Grant read-only access to contacts and contact groups

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
IDs
array[UUID] (uuid)
Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
page
Integer
e.g. page=1 - Up to 100 contacts will be returned in a single API call.
includeArchived
Boolean
e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response

getCreditNote

Allows you to retrieve a specific credit note


/CreditNotes/{CreditNoteID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}?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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.getCreditNote(xeroTenantId, creditNoteID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNote");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.getCreditNote(xeroTenantId, creditNoteID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNote");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (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 a specific credit note
[apiInstance getCreditNoteWith:xeroTenantId
    creditNoteID:creditNoteID
    unitdp:unitdp
              completionHandler: ^(CreditNotes 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note
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.getCreditNote(xeroTenantId, creditNoteID,  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 getCreditNoteExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (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 a specific credit note
                CreditNotes result = apiInstance.getCreditNote(xeroTenantId, creditNoteID, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNote: " + 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->getCreditNote: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
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->getCreditNote(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNote: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (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 a specific credit note
    api_response = api_instance.get_credit_note(xeroTenantId, creditNoteID, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNote: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNote(xeroTenantId, creditNoteID, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getCreditNoteAsPdf

Allows you to retrieve Credit Note as PDF files


/CreditNotes/{CreditNoteID}/pdf

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/pdf"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        try {
            File result = apiInstance.getCreditNoteAsPdf(xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAsPdf");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        try {
            File result = apiInstance.getCreditNoteAsPdf(xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAsPdf");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Credit Note as PDF files
[apiInstance getCreditNoteAsPdfWith:xeroTenantId
    creditNoteID:creditNoteID
              completionHandler: ^(File 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note
try {
  const response: any = await xero.accountingApi.getCreditNoteAsPdf(xeroTenantId, creditNoteID);
  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 getCreditNoteAsPdfExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)

            try
            {
                // Allows you to retrieve Credit Note as PDF files
                File result = apiInstance.getCreditNoteAsPdf(xeroTenantId, creditNoteID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNoteAsPdf: " + 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->getCreditNoteAsPdf: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note

eval { 
    my $result = $api_instance->getCreditNoteAsPdf(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNoteAsPdf: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)

try: 
    # Allows you to retrieve Credit Note as PDF files
    api_response = api_instance.get_credit_note_as_pdf(xeroTenantId, creditNoteID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNoteAsPdf: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNoteAsPdf(xeroTenantId, creditNoteID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getCreditNoteAttachmentByFileName

Allows you to retrieve Attachments on CreditNote by file name


/CreditNotes/{CreditNoteID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{FileName}"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentByFileName");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentByFileName");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
String *fileName = xero-dev.jpg; // Name of the file you are attaching to Credit Note (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on CreditNote by file name
[apiInstance getCreditNoteAttachmentByFileNameWith:xeroTenantId
    creditNoteID:creditNoteID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const fileName = "xero-dev.jpg";  // {String} Name of the file you are attaching to Credit Note 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType);
  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 getCreditNoteAttachmentByFileNameExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the file you are attaching to Credit Note (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on CreditNote by file name
                File result = apiInstance.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNoteAttachmentByFileName: " + 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->getCreditNoteAttachmentByFileName: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $fileName = xero-dev.jpg; # String | Name of the file you are attaching to Credit Note
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getCreditNoteAttachmentByFileName(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNoteAttachmentByFileName: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
fileName = xero-dev.jpg # String | Name of the file you are attaching to Credit Note (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on CreditNote by file name
    api_response = api_instance.get_credit_note_attachment_by_file_name(xeroTenantId, creditNoteID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNoteAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
FileName*
String
Name of the file you are attaching to Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getCreditNoteAttachmentById

Allows you to retrieve Attachments on CreditNote


/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentById");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentById");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on CreditNote
[apiInstance getCreditNoteAttachmentByIdWith:xeroTenantId
    creditNoteID:creditNoteID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType);
  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 getCreditNoteAttachmentByIdExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for a Attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on CreditNote
                File result = apiInstance.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNoteAttachmentById: " + 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->getCreditNoteAttachmentById: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getCreditNoteAttachmentById(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNoteAttachmentById: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on CreditNote
    api_response = api_instance.get_credit_note_attachment_by_id(xeroTenantId, creditNoteID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNoteAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
AttachmentID*
UUID (uuid)
Unique identifier for a Attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getCreditNoteAttachments

Allows you to retrieve Attachments for credit notes


/CreditNotes/{CreditNoteID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        try {
            Attachments result = apiInstance.getCreditNoteAttachments(xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachments");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        try {
            Attachments result = apiInstance.getCreditNoteAttachments(xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachments");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments for credit notes
[apiInstance getCreditNoteAttachmentsWith:xeroTenantId
    creditNoteID:creditNoteID
              completionHandler: ^(Attachments 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note
try {
  const response: any = await xero.accountingApi.getCreditNoteAttachments(xeroTenantId, creditNoteID);
  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 getCreditNoteAttachmentsExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)

            try
            {
                // Allows you to retrieve Attachments for credit notes
                Attachments result = apiInstance.getCreditNoteAttachments(xeroTenantId, creditNoteID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNoteAttachments: " + 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->getCreditNoteAttachments: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note

eval { 
    my $result = $api_instance->getCreditNoteAttachments(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNoteAttachments: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)

try: 
    # Allows you to retrieve Attachments for credit notes
    api_response = api_instance.get_credit_note_attachments(xeroTenantId, creditNoteID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNoteAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNoteAttachments(xeroTenantId, creditNoteID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getCreditNoteHistory

Allows you to retrieve a history records of an CreditNote


/CreditNotes/{CreditNoteID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/History"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        try {
            HistoryRecords result = apiInstance.getCreditNoteHistory(xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteHistory");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        try {
            HistoryRecords result = apiInstance.getCreditNoteHistory(xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteHistory");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an CreditNote
[apiInstance getCreditNoteHistoryWith:xeroTenantId
    creditNoteID:creditNoteID
              completionHandler: ^(HistoryRecords 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note
try {
  const response: any = await xero.accountingApi.getCreditNoteHistory(xeroTenantId, creditNoteID);
  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 getCreditNoteHistoryExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)

            try
            {
                // Allows you to retrieve a history records of an CreditNote
                HistoryRecords result = apiInstance.getCreditNoteHistory(xeroTenantId, creditNoteID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNoteHistory: " + 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->getCreditNoteHistory: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note

eval { 
    my $result = $api_instance->getCreditNoteHistory(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNoteHistory: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)

try: 
    # Allows you to retrieve a history records of an CreditNote
    api_response = api_instance.get_credit_note_history(xeroTenantId, creditNoteID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNoteHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNoteHistory(xeroTenantId, creditNoteID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getCreditNotes

Allows you to retrieve any credit notes


/CreditNotes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?where=Status=="' + CreditNote.StatusEnum.DRAFT + '"&order=CreditNoteNumber ASC&page=1&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=="' + CreditNote.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = CreditNoteNumber ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNotes");
            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=="' + CreditNote.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = CreditNoteNumber ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNotes");
            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=="' + CreditNote.StatusEnum.DRAFT + '"; // Filter by an any element (optional) (default to null)
String *order = CreditNoteNumber ASC; // Order by an any element (optional) (default to null)
Integer *page = 1; // e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (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 credit notes
[apiInstance getCreditNotesWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    page:page
    unitdp:unitdp
              completionHandler: ^(CreditNotes 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=="' + CreditNote.StatusEnum.DRAFT + '"';  // {String} Filter by an any element
const order =  'CreditNoteNumber ASC';  // {String} Order by an any element
const page =  1;  // {Integer} e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
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.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, 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 getCreditNotesExample
    {
        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=="' + CreditNote.StatusEnum.DRAFT + '";  // String | Filter by an any element (optional)  (default to null)
            var order = CreditNoteNumber ASC;  // String | Order by an any element (optional)  (default to null)
            var page = 1;  // Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (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 credit notes
                CreditNotes result = apiInstance.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCreditNotes: " + 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->getCreditNotes: ', $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=="' + CreditNote.StatusEnum.DRAFT + '"; # String | Filter by an any element
my $order = CreditNoteNumber ASC; # String | Order by an any element
my $page = 1; # Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
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->getCreditNotes(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, page => $page, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCreditNotes: $@\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=="' + CreditNote.StatusEnum.DRAFT + '" # String | Filter by an any element (optional) (default to null)
order = CreditNoteNumber ASC # String | Order by an any element (optional) (default to null)
page = 1 # Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (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 credit notes
    api_response = api_instance.get_credit_notes(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, page=page, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCreditNotes: %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=="' + CreditNote.StatusEnum.DRAFT + '"; // String
    let order = CreditNoteNumber ASC; // String
    let page = 1; // Integer
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getCurrencies

Allows you to retrieve currencies for your organisation


/Currencies

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Currencies?where=Status=="' + Currency.StatusEnum.ACTIVE + '"&order=Code ASC"
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
        String where = Status=="' + Currency.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Code ASC; // String | Order by an any element
        try {
            Currencies result = apiInstance.getCurrencies(xeroTenantId, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCurrencies");
            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
        String where = Status=="' + Currency.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Code ASC; // String | Order by an any element
        try {
            Currencies result = apiInstance.getCurrencies(xeroTenantId, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getCurrencies");
            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)
String *where = Status=="' + Currency.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Code ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve currencies for your organisation
[apiInstance getCurrenciesWith:xeroTenantId
    where:where
    order:order
              completionHandler: ^(Currencies 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 where =  'Status=="' + Currency.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Code ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getCurrencies(xeroTenantId,  where, order);
  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 getCurrenciesExample
    {
        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 where = Status=="' + Currency.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Code ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve currencies for your organisation
                Currencies result = apiInstance.getCurrencies(xeroTenantId, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getCurrencies: " + 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->getCurrencies: ', $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 $where = Status=="' + Currency.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Code ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getCurrencies(xeroTenantId => $xeroTenantId, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getCurrencies: $@\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)
where = Status=="' + Currency.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Code ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve currencies for your organisation
    api_response = api_instance.get_currencies(xeroTenantId, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getCurrencies: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let where = Status=="' + Currency.StatusEnum.ACTIVE + '"; // String
    let order = Code ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getCurrencies(xeroTenantId, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getEmployee

Allows you to retrieve a specific employee used in Xero payrun


/Employees/{EmployeeID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Employees/{EmployeeID}"
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
        UUID employeeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Employee
        try {
            Employees result = apiInstance.getEmployee(xeroTenantId, employeeID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getEmployee");
            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
        UUID employeeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Employee
        try {
            Employees result = apiInstance.getEmployee(xeroTenantId, employeeID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getEmployee");
            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)
UUID *employeeID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Employee (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specific employee used in Xero payrun
[apiInstance getEmployeeWith:xeroTenantId
    employeeID:employeeID
              completionHandler: ^(Employees 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 employeeID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Employee
try {
  const response: any = await xero.accountingApi.getEmployee(xeroTenantId, employeeID);
  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 getEmployeeExample
    {
        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 employeeID = new UUID(); // UUID | Unique identifier for a Employee (default to null)

            try
            {
                // Allows you to retrieve a specific employee used in Xero payrun
                Employees result = apiInstance.getEmployee(xeroTenantId, employeeID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getEmployee: " + 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->getEmployee: ', $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 $employeeID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Employee

eval { 
    my $result = $api_instance->getEmployee(xeroTenantId => $xeroTenantId, employeeID => $employeeID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getEmployee: $@\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)
employeeID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Employee (default to null)

try: 
    # Allows you to retrieve a specific employee used in Xero payrun
    api_response = api_instance.get_employee(xeroTenantId, employeeID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getEmployee: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let employeeID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getEmployee(xeroTenantId, employeeID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Unique identifier for a Employee
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getEmployees

Allows you to retrieve employees used in Xero payrun


/Employees

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Employees?where=Status=="' + Employee.StatusEnum.ACTIVE + '"&order=ASC"
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=="' + Employee.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = ASC; // String | Order by an any element
        try {
            Employees result = apiInstance.getEmployees(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getEmployees");
            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=="' + Employee.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = ASC; // String | Order by an any element
        try {
            Employees result = apiInstance.getEmployees(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getEmployees");
            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=="' + Employee.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve employees used in Xero payrun
[apiInstance getEmployeesWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(Employees 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=="' + Employee.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getEmployees(xeroTenantId, ifModifiedSince, where, order);
  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 getEmployeesExample
    {
        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=="' + Employee.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve employees used in Xero payrun
                Employees result = apiInstance.getEmployees(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getEmployees: " + 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->getEmployees: ', $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=="' + Employee.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getEmployees(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getEmployees: $@\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=="' + Employee.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve employees used in Xero payrun
    api_response = api_instance.get_employees(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getEmployees: %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=="' + Employee.StatusEnum.ACTIVE + '"; // String
    let order = ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getEmployees(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getExpenseClaim

Allows you to retrieve a specified expense claim


/ExpenseClaims/{ExpenseClaimID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}"
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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        try {
            ExpenseClaims result = apiInstance.getExpenseClaim(xeroTenantId, expenseClaimID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaim");
            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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        try {
            ExpenseClaims result = apiInstance.getExpenseClaim(xeroTenantId, expenseClaimID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaim");
            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)
UUID *expenseClaimID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ExpenseClaim (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified expense claim
[apiInstance getExpenseClaimWith:xeroTenantId
    expenseClaimID:expenseClaimID
              completionHandler: ^(ExpenseClaims 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 expenseClaimID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ExpenseClaim
try {
  const response: any = await xero.accountingApi.getExpenseClaim(xeroTenantId, expenseClaimID);
  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 getExpenseClaimExample
    {
        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 expenseClaimID = new UUID(); // UUID | Unique identifier for a ExpenseClaim (default to null)

            try
            {
                // Allows you to retrieve a specified expense claim
                ExpenseClaims result = apiInstance.getExpenseClaim(xeroTenantId, expenseClaimID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getExpenseClaim: " + 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->getExpenseClaim: ', $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 $expenseClaimID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ExpenseClaim

eval { 
    my $result = $api_instance->getExpenseClaim(xeroTenantId => $xeroTenantId, expenseClaimID => $expenseClaimID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getExpenseClaim: $@\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)
expenseClaimID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ExpenseClaim (default to null)

try: 
    # Allows you to retrieve a specified expense claim
    api_response = api_instance.get_expense_claim(xeroTenantId, expenseClaimID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getExpenseClaim: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getExpenseClaim(xeroTenantId, expenseClaimID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
ExpenseClaimID*
UUID (uuid)
Unique identifier for a ExpenseClaim
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getExpenseClaimHistory

Allows you to retrieve a history records of an ExpenseClaim


/ExpenseClaims/{ExpenseClaimID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}/History"
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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        try {
            HistoryRecords result = apiInstance.getExpenseClaimHistory(xeroTenantId, expenseClaimID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaimHistory");
            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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        try {
            HistoryRecords result = apiInstance.getExpenseClaimHistory(xeroTenantId, expenseClaimID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaimHistory");
            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)
UUID *expenseClaimID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ExpenseClaim (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an ExpenseClaim
[apiInstance getExpenseClaimHistoryWith:xeroTenantId
    expenseClaimID:expenseClaimID
              completionHandler: ^(HistoryRecords 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 expenseClaimID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ExpenseClaim
try {
  const response: any = await xero.accountingApi.getExpenseClaimHistory(xeroTenantId, expenseClaimID);
  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 getExpenseClaimHistoryExample
    {
        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 expenseClaimID = new UUID(); // UUID | Unique identifier for a ExpenseClaim (default to null)

            try
            {
                // Allows you to retrieve a history records of an ExpenseClaim
                HistoryRecords result = apiInstance.getExpenseClaimHistory(xeroTenantId, expenseClaimID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getExpenseClaimHistory: " + 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->getExpenseClaimHistory: ', $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 $expenseClaimID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ExpenseClaim

eval { 
    my $result = $api_instance->getExpenseClaimHistory(xeroTenantId => $xeroTenantId, expenseClaimID => $expenseClaimID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getExpenseClaimHistory: $@\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)
expenseClaimID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ExpenseClaim (default to null)

try: 
    # Allows you to retrieve a history records of an ExpenseClaim
    api_response = api_instance.get_expense_claim_history(xeroTenantId, expenseClaimID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getExpenseClaimHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getExpenseClaimHistory(xeroTenantId, expenseClaimID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
ExpenseClaimID*
UUID (uuid)
Unique identifier for a ExpenseClaim
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getExpenseClaims

Allows you to retrieve expense claims


/ExpenseClaims

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims?where=Status=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"&order=Status ASC"
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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"; // String | Filter by an any element
        String order = Status ASC; // String | Order by an any element
        try {
            ExpenseClaims result = apiInstance.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaims");
            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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"; // String | Filter by an any element
        String order = Status ASC; // String | Order by an any element
        try {
            ExpenseClaims result = apiInstance.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaims");
            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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"; // Filter by an any element (optional) (default to null)
String *order = Status ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve expense claims
[apiInstance getExpenseClaimsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(ExpenseClaims 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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"';  // {String} Filter by an any element
const order =  'Status ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order);
  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 getExpenseClaimsExample
    {
        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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Status ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve expense claims
                ExpenseClaims result = apiInstance.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getExpenseClaims: " + 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->getExpenseClaims: ', $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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"; # String | Filter by an any element
my $order = Status ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getExpenseClaims(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getExpenseClaims: $@\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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '" # String | Filter by an any element (optional) (default to null)
order = Status ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve expense claims
    api_response = api_instance.get_expense_claims(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getExpenseClaims: %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=="' + ExpenseClaim.StatusEnum.SUBMITTED + '"; // String
    let order = Status ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getInvoice

Allows you to retrieve a specified sales invoice or purchase bill


/Invoices/{InvoiceID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}?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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        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.getInvoice(xeroTenantId, invoiceID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoice");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        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.getInvoice(xeroTenantId, invoiceID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoice");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (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 a specified sales invoice or purchase bill
[apiInstance getInvoiceWith:xeroTenantId
    invoiceID:invoiceID
    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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice
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.getInvoice(xeroTenantId, invoiceID,  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 getInvoiceExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (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 a specified sales invoice or purchase bill
                Invoices result = apiInstance.getInvoice(xeroTenantId, invoiceID, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoice: " + 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->getInvoice: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
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->getInvoice(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoice: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (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 a specified sales invoice or purchase bill
    api_response = api_instance.get_invoice(xeroTenantId, invoiceID, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoice: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoice(xeroTenantId, invoiceID, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getInvoiceAsPdf

Allows you to retrieve invoices or purchase bills as PDF files


/Invoices/{InvoiceID}/pdf

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/pdf"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            File result = apiInstance.getInvoiceAsPdf(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAsPdf");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            File result = apiInstance.getInvoiceAsPdf(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAsPdf");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve invoices or purchase bills as PDF files
[apiInstance getInvoiceAsPdfWith:xeroTenantId
    invoiceID:invoiceID
              completionHandler: ^(File 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice
try {
  const response: any = await xero.accountingApi.getInvoiceAsPdf(xeroTenantId, invoiceID);
  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 getInvoiceAsPdfExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)

            try
            {
                // Allows you to retrieve invoices or purchase bills as PDF files
                File result = apiInstance.getInvoiceAsPdf(xeroTenantId, invoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoiceAsPdf: " + 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->getInvoiceAsPdf: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice

eval { 
    my $result = $api_instance->getInvoiceAsPdf(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoiceAsPdf: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)

try: 
    # Allows you to retrieve invoices or purchase bills as PDF files
    api_response = api_instance.get_invoice_as_pdf(xeroTenantId, invoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoiceAsPdf: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoiceAsPdf(xeroTenantId, invoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getInvoiceAttachmentByFileName

Allows you to retrieve Attachment on invoices or purchase bills by it's filename


/Invoices/{InvoiceID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{FileName}"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentByFileName");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentByFileName");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
String *fileName = xero-dev.jpg; // Name of the file you are attaching (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachment on invoices or purchase bills by it's filename
[apiInstance getInvoiceAttachmentByFileNameWith:xeroTenantId
    invoiceID:invoiceID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const fileName = "xero-dev.jpg";  // {String} Name of the file you are attaching 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType);
  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 getInvoiceAttachmentByFileNameExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the file you are attaching (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachment on invoices or purchase bills by it's filename
                File result = apiInstance.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoiceAttachmentByFileName: " + 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->getInvoiceAttachmentByFileName: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $fileName = xero-dev.jpg; # String | Name of the file you are attaching
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoiceAttachmentByFileName: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
fileName = xero-dev.jpg # String | Name of the file you are attaching (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachment on invoices or purchase bills by it's filename
    api_response = api_instance.get_invoice_attachment_by_file_name(xeroTenantId, invoiceID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoiceAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
FileName*
String
Name of the file you are attaching
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getInvoiceAttachmentById

Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID


/Invoices/{InvoiceID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{AttachmentID}"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentById");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentById");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID
[apiInstance getInvoiceAttachmentByIdWith:xeroTenantId
    invoiceID:invoiceID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType);
  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 getInvoiceAttachmentByIdExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for an Attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID
                File result = apiInstance.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoiceAttachmentById: " + 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->getInvoiceAttachmentById: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getInvoiceAttachmentById(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoiceAttachmentById: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID
    api_response = api_instance.get_invoice_attachment_by_id(xeroTenantId, invoiceID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoiceAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
AttachmentID*
UUID (uuid)
Unique identifier for an Attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getInvoiceAttachments

Allows you to retrieve Attachments on invoices or purchase bills


/Invoices/{InvoiceID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            Attachments result = apiInstance.getInvoiceAttachments(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachments");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            Attachments result = apiInstance.getInvoiceAttachments(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachments");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on invoices or purchase bills
[apiInstance getInvoiceAttachmentsWith:xeroTenantId
    invoiceID:invoiceID
              completionHandler: ^(Attachments 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice
try {
  const response: any = await xero.accountingApi.getInvoiceAttachments(xeroTenantId, invoiceID);
  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 getInvoiceAttachmentsExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)

            try
            {
                // Allows you to retrieve Attachments on invoices or purchase bills
                Attachments result = apiInstance.getInvoiceAttachments(xeroTenantId, invoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoiceAttachments: " + 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->getInvoiceAttachments: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice

eval { 
    my $result = $api_instance->getInvoiceAttachments(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoiceAttachments: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)

try: 
    # Allows you to retrieve Attachments on invoices or purchase bills
    api_response = api_instance.get_invoice_attachments(xeroTenantId, invoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoiceAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoiceAttachments(xeroTenantId, invoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getInvoiceHistory

Allows you to retrieve a history records of an invoice


/Invoices/{InvoiceID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/History"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            HistoryRecords result = apiInstance.getInvoiceHistory(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceHistory");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            HistoryRecords result = apiInstance.getInvoiceHistory(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceHistory");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an invoice
[apiInstance getInvoiceHistoryWith:xeroTenantId
    invoiceID:invoiceID
              completionHandler: ^(HistoryRecords 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice
try {
  const response: any = await xero.accountingApi.getInvoiceHistory(xeroTenantId, invoiceID);
  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 getInvoiceHistoryExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)

            try
            {
                // Allows you to retrieve a history records of an invoice
                HistoryRecords result = apiInstance.getInvoiceHistory(xeroTenantId, invoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoiceHistory: " + 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->getInvoiceHistory: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice

eval { 
    my $result = $api_instance->getInvoiceHistory(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoiceHistory: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)

try: 
    # Allows you to retrieve a history records of an invoice
    api_response = api_instance.get_invoice_history(xeroTenantId, invoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoiceHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoiceHistory(xeroTenantId, invoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getInvoiceReminders

Allows you to retrieve invoice reminder settings


/InvoiceReminders/Settings

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/InvoiceReminders/Settings"
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
        try {
            InvoiceReminders result = apiInstance.getInvoiceReminders(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceReminders");
            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
        try {
            InvoiceReminders result = apiInstance.getInvoiceReminders(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceReminders");
            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)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve invoice reminder settings
[apiInstance getInvoiceRemindersWith:xeroTenantId
              completionHandler: ^(InvoiceReminders 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
try {
  const response: any = await xero.accountingApi.getInvoiceReminders(xeroTenantId);
  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 getInvoiceRemindersExample
    {
        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)

            try
            {
                // Allows you to retrieve invoice reminder settings
                InvoiceReminders result = apiInstance.getInvoiceReminders(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getInvoiceReminders: " + 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->getInvoiceReminders: ', $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

eval { 
    my $result = $api_instance->getInvoiceReminders(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getInvoiceReminders: $@\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)

try: 
    # Allows you to retrieve invoice reminder settings
    api_response = api_instance.get_invoice_reminders(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getInvoiceReminders: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getInvoiceReminders(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getInvoices

Allows you to retrieve any sales invoices or purchase bills


/Invoices

Usage and SDK Samples

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);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
IDs
array[UUID] (uuid)
Filter by a comma-separated list of InvoicesIDs.
InvoiceNumbers
array[String]
Filter by a comma-separated list of InvoiceNumbers.
ContactIDs
array[UUID] (uuid)
Filter by a comma-separated list of ContactIDs.
Statuses
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.
page
Integer
e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
includeArchived
Boolean
e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
createdByMyApp
Boolean
When set to true you'll only retrieve Invoices created by your app
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getItem

Allows you to retrieve a specified item


/Items/{ItemID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}?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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.getItem(xeroTenantId, itemID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getItem");
            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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.getItem(xeroTenantId, itemID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getItem");
            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)
UUID *itemID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Item (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 a specified item
[apiInstance getItemWith:xeroTenantId
    itemID:itemID
    unitdp:unitdp
              completionHandler: ^(Items 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 itemID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Item
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.getItem(xeroTenantId, itemID,  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 getItemExample
    {
        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 itemID = new UUID(); // UUID | Unique identifier for an Item (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 a specified item
                Items result = apiInstance.getItem(xeroTenantId, itemID, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getItem: " + 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->getItem: ', $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 $itemID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Item
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->getItem(xeroTenantId => $xeroTenantId, itemID => $itemID, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getItem: $@\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)
itemID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Item (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 a specified item
    api_response = api_instance.get_item(xeroTenantId, itemID, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getItem: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let itemID = 00000000-0000-0000-000-000000000000; // UUID
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getItem(xeroTenantId, itemID, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getItemHistory

Allows you to retrieve history for items


/Items/{ItemID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}/History"
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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        try {
            HistoryRecords result = apiInstance.getItemHistory(xeroTenantId, itemID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getItemHistory");
            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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        try {
            HistoryRecords result = apiInstance.getItemHistory(xeroTenantId, itemID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getItemHistory");
            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)
UUID *itemID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Item (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history for items
[apiInstance getItemHistoryWith:xeroTenantId
    itemID:itemID
              completionHandler: ^(HistoryRecords 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 itemID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Item
try {
  const response: any = await xero.accountingApi.getItemHistory(xeroTenantId, itemID);
  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 getItemHistoryExample
    {
        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 itemID = new UUID(); // UUID | Unique identifier for an Item (default to null)

            try
            {
                // Allows you to retrieve history for items
                HistoryRecords result = apiInstance.getItemHistory(xeroTenantId, itemID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getItemHistory: " + 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->getItemHistory: ', $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 $itemID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Item

eval { 
    my $result = $api_instance->getItemHistory(xeroTenantId => $xeroTenantId, itemID => $itemID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getItemHistory: $@\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)
itemID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Item (default to null)

try: 
    # Allows you to retrieve history for items
    api_response = api_instance.get_item_history(xeroTenantId, itemID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getItemHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let itemID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getItemHistory(xeroTenantId, itemID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getItems

Allows you to retrieve any items


/Items

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items?where=IsSold==true&order=Code ASC&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 = IsSold==true; // String | Filter by an any element
        String order = Code ASC; // String | Order by an any element
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.getItems(xeroTenantId, ifModifiedSince, where, order, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getItems");
            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 = IsSold==true; // String | Filter by an any element
        String order = Code ASC; // String | Order by an any element
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.getItems(xeroTenantId, ifModifiedSince, where, order, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getItems");
            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 = IsSold==true; // Filter by an any element (optional) (default to null)
String *order = Code ASC; // Order by an any element (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 items
[apiInstance getItemsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    unitdp:unitdp
              completionHandler: ^(Items 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 =  'IsSold==true';  // {String} Filter by an any element
const order =  'Code ASC';  // {String} Order by an any element
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.getItems(xeroTenantId, ifModifiedSince, where, order, 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 getItemsExample
    {
        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 = IsSold==true;  // String | Filter by an any element (optional)  (default to null)
            var order = Code ASC;  // String | Order by an any element (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 items
                Items result = apiInstance.getItems(xeroTenantId, ifModifiedSince, where, order, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getItems: " + 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->getItems: ', $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 = IsSold==true; # String | Filter by an any element
my $order = Code ASC; # String | Order by an any element
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->getItems(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getItems: $@\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 = IsSold==true # String | Filter by an any element (optional) (default to null)
order = Code ASC # String | Order by an any element (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 items
    api_response = api_instance.get_items(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getItems: %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 = IsSold==true; // String
    let order = Code ASC; // String
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getItems(xeroTenantId, ifModifiedSince, where, order, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getJournal

Allows you to retrieve a specified journals.


/Journals/{JournalID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Journals/{JournalID}"
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
        UUID journalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Journal
        try {
            Journals result = apiInstance.getJournal(xeroTenantId, journalID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getJournal");
            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
        UUID journalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Journal
        try {
            Journals result = apiInstance.getJournal(xeroTenantId, journalID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getJournal");
            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)
UUID *journalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Journal (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified journals.
[apiInstance getJournalWith:xeroTenantId
    journalID:journalID
              completionHandler: ^(Journals 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 journalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Journal
try {
  const response: any = await xero.accountingApi.getJournal(xeroTenantId, journalID);
  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 getJournalExample
    {
        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 journalID = new UUID(); // UUID | Unique identifier for a Journal (default to null)

            try
            {
                // Allows you to retrieve a specified journals.
                Journals result = apiInstance.getJournal(xeroTenantId, journalID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getJournal: " + 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->getJournal: ', $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 $journalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Journal

eval { 
    my $result = $api_instance->getJournal(xeroTenantId => $xeroTenantId, journalID => $journalID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getJournal: $@\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)
journalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Journal (default to null)

try: 
    # Allows you to retrieve a specified journals.
    api_response = api_instance.get_journal(xeroTenantId, journalID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getJournal: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let journalID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getJournal(xeroTenantId, journalID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.journals.read Grant read-only access to journals

Parameters

Path parameters
Name Description
JournalID*
UUID (uuid)
Unique identifier for a Journal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getJournals

Allows you to retrieve any journals.


/Journals

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Journals?offset=10&paymentsOnly=true"
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
        Integer offset = 10; // Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
        Boolean paymentsOnly = true; // Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.
        try {
            Journals result = apiInstance.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getJournals");
            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
        Integer offset = 10; // Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
        Boolean paymentsOnly = true; // Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.
        try {
            Journals result = apiInstance.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getJournals");
            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)
Integer *offset = 10; // Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned (optional) (default to null)
Boolean *paymentsOnly = true; // Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve any journals.
[apiInstance getJournalsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    offset:offset
    paymentsOnly:paymentsOnly
              completionHandler: ^(Journals 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 offset =  10;  // {Integer} Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
const paymentsOnly =  true;  // {Boolean} Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.

try {
  const response: any = await xero.accountingApi.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly);
  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 getJournalsExample
    {
        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 offset = 10;  // Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned (optional)  (default to null)
            var paymentsOnly = true;  // Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. (optional)  (default to null)

            try
            {
                // Allows you to retrieve any journals.
                Journals result = apiInstance.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getJournals: " + 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->getJournals: ', $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 $offset = 10; # Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
my $paymentsOnly = true; # Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.

eval { 
    my $result = $api_instance->getJournals(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, offset => $offset, paymentsOnly => $paymentsOnly);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getJournals: $@\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)
offset = 10 # Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned (optional) (default to null)
paymentsOnly = true # Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. (optional) (default to null)

try: 
    # Allows you to retrieve any journals.
    api_response = api_instance.get_journals(xeroTenantId, ifModifiedSince=ifModifiedSince, offset=offset, paymentsOnly=paymentsOnly)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getJournals: %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 offset = 10; // Integer
    let paymentsOnly = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.journals.read Grant read-only access to journals

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
offset
Integer
Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
paymentsOnly
Boolean
Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.

getLinkedTransaction

Allows you to retrieve a specified linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions/{LinkedTransactionID}"
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
        UUID linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a LinkedTransaction
        try {
            LinkedTransactions result = apiInstance.getLinkedTransaction(xeroTenantId, linkedTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getLinkedTransaction");
            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
        UUID linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a LinkedTransaction
        try {
            LinkedTransactions result = apiInstance.getLinkedTransaction(xeroTenantId, linkedTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getLinkedTransaction");
            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)
UUID *linkedTransactionID = 00000000-0000-0000-000-000000000000; // Unique identifier for a LinkedTransaction (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified linked transactions (billable expenses)
[apiInstance getLinkedTransactionWith:xeroTenantId
    linkedTransactionID:linkedTransactionID
              completionHandler: ^(LinkedTransactions 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 linkedTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a LinkedTransaction
try {
  const response: any = await xero.accountingApi.getLinkedTransaction(xeroTenantId, linkedTransactionID);
  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 getLinkedTransactionExample
    {
        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 linkedTransactionID = new UUID(); // UUID | Unique identifier for a LinkedTransaction (default to null)

            try
            {
                // Allows you to retrieve a specified linked transactions (billable expenses)
                LinkedTransactions result = apiInstance.getLinkedTransaction(xeroTenantId, linkedTransactionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getLinkedTransaction: " + 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->getLinkedTransaction: ', $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 $linkedTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a LinkedTransaction

eval { 
    my $result = $api_instance->getLinkedTransaction(xeroTenantId => $xeroTenantId, linkedTransactionID => $linkedTransactionID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getLinkedTransaction: $@\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)
linkedTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a LinkedTransaction (default to null)

try: 
    # Allows you to retrieve a specified linked transactions (billable expenses)
    api_response = api_instance.get_linked_transaction(xeroTenantId, linkedTransactionID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getLinkedTransaction: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getLinkedTransaction(xeroTenantId, linkedTransactionID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
LinkedTransactionID*
UUID (uuid)
Unique identifier for a LinkedTransaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getLinkedTransactions

Retrieve linked transactions (billable expenses)


/LinkedTransactions

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions?page=1&LinkedTransactionID=00000000-0000-0000-000-000000000000&SourceTransactionID=00000000-0000-0000-000-000000000000&ContactID=00000000-0000-0000-000-000000000000&Status=APPROVED&TargetTransactionID=00000000-0000-0000-000-000000000000"
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
        Integer page = 1; // Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
        String linkedTransactionID = 00000000-0000-0000-000-000000000000; // String | The Xero identifier for an Linked Transaction
        String sourceTransactionID = 00000000-0000-0000-000-000000000000; // String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
        String contactID = 00000000-0000-0000-000-000000000000; // String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
        String status = APPROVED; // String | Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status
        String targetTransactionID = 00000000-0000-0000-000-000000000000; // String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
        try {
            LinkedTransactions result = apiInstance.getLinkedTransactions(xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getLinkedTransactions");
            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
        Integer page = 1; // Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
        String linkedTransactionID = 00000000-0000-0000-000-000000000000; // String | The Xero identifier for an Linked Transaction
        String sourceTransactionID = 00000000-0000-0000-000-000000000000; // String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
        String contactID = 00000000-0000-0000-000-000000000000; // String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
        String status = APPROVED; // String | Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status
        String targetTransactionID = 00000000-0000-0000-000-000000000000; // String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
        try {
            LinkedTransactions result = apiInstance.getLinkedTransactions(xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getLinkedTransactions");
            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)
Integer *page = 1; // Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. (optional) (default to null)
String *linkedTransactionID = 00000000-0000-0000-000-000000000000; // The Xero identifier for an Linked Transaction (optional) (default to null)
String *sourceTransactionID = 00000000-0000-0000-000-000000000000; // Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice (optional) (default to null)
String *contactID = 00000000-0000-0000-000-000000000000; // Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. (optional) (default to null)
String *status = APPROVED; // Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status (optional) (default to null)
String *targetTransactionID = 00000000-0000-0000-000-000000000000; // Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Retrieve linked transactions (billable expenses)
[apiInstance getLinkedTransactionsWith:xeroTenantId
    page:page
    linkedTransactionID:linkedTransactionID
    sourceTransactionID:sourceTransactionID
    contactID:contactID
    status:status
    targetTransactionID:targetTransactionID
              completionHandler: ^(LinkedTransactions 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 page =  1;  // {Integer} Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
const linkedTransactionID =  '00000000-0000-0000-000-000000000000';  // {String} The Xero identifier for an Linked Transaction
const sourceTransactionID =  '00000000-0000-0000-000-000000000000';  // {String} Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
const contactID =  '00000000-0000-0000-000-000000000000';  // {String} Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
const status =  'APPROVED';  // {String} Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status
const targetTransactionID =  '00000000-0000-0000-000-000000000000';  // {String} Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice

try {
  const response: any = await xero.accountingApi.getLinkedTransactions(xeroTenantId,  page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
  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 getLinkedTransactionsExample
    {
        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 page = 1;  // Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. (optional)  (default to null)
            var linkedTransactionID = 00000000-0000-0000-000-000000000000;  // String | The Xero identifier for an Linked Transaction (optional)  (default to null)
            var sourceTransactionID = 00000000-0000-0000-000-000000000000;  // String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice (optional)  (default to null)
            var contactID = 00000000-0000-0000-000-000000000000;  // String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. (optional)  (default to null)
            var status = APPROVED;  // String | Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status (optional)  (default to null)
            var targetTransactionID = 00000000-0000-0000-000-000000000000;  // String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice (optional)  (default to null)

            try
            {
                // Retrieve linked transactions (billable expenses)
                LinkedTransactions result = apiInstance.getLinkedTransactions(xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getLinkedTransactions: " + 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->getLinkedTransactions: ', $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 $page = 1; # Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
my $linkedTransactionID = 00000000-0000-0000-000-000000000000; # String | The Xero identifier for an Linked Transaction
my $sourceTransactionID = 00000000-0000-0000-000-000000000000; # String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
my $contactID = 00000000-0000-0000-000-000000000000; # String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
my $status = APPROVED; # String | Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status
my $targetTransactionID = 00000000-0000-0000-000-000000000000; # String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice

eval { 
    my $result = $api_instance->getLinkedTransactions(xeroTenantId => $xeroTenantId, page => $page, linkedTransactionID => $linkedTransactionID, sourceTransactionID => $sourceTransactionID, contactID => $contactID, status => $status, targetTransactionID => $targetTransactionID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getLinkedTransactions: $@\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)
page = 1 # Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. (optional) (default to null)
linkedTransactionID = 00000000-0000-0000-000-000000000000 # String | The Xero identifier for an Linked Transaction (optional) (default to null)
sourceTransactionID = 00000000-0000-0000-000-000000000000 # String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice (optional) (default to null)
contactID = 00000000-0000-0000-000-000000000000 # String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. (optional) (default to null)
status = APPROVED # String | Filter by the combination of ContactID and Status. Get  the linked transactions associaed to a  customer and with a status (optional) (default to null)
targetTransactionID = 00000000-0000-0000-000-000000000000 # String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice (optional) (default to null)

try: 
    # Retrieve linked transactions (billable expenses)
    api_response = api_instance.get_linked_transactions(xeroTenantId, page=page, linkedTransactionID=linkedTransactionID, sourceTransactionID=sourceTransactionID, contactID=contactID, status=status, targetTransactionID=targetTransactionID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getLinkedTransactions: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let page = 1; // Integer
    let linkedTransactionID = 00000000-0000-0000-000-000000000000; // String
    let sourceTransactionID = 00000000-0000-0000-000-000000000000; // String
    let contactID = 00000000-0000-0000-000-000000000000; // String
    let status = APPROVED; // String
    let targetTransactionID = 00000000-0000-0000-000-000000000000; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getLinkedTransactions(xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
page
Integer
Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
LinkedTransactionID
String
The Xero identifier for an Linked Transaction
SourceTransactionID
String
Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
ContactID
String
Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
Status
String
Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status
TargetTransactionID
String
Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice

getManualJournal

Allows you to retrieve a specified manual journals


/ManualJournals/{ManualJournalID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        try {
            ManualJournals result = apiInstance.getManualJournal(xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournal");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        try {
            ManualJournals result = apiInstance.getManualJournal(xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournal");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified manual journals
[apiInstance getManualJournalWith:xeroTenantId
    manualJournalID:manualJournalID
              completionHandler: ^(ManualJournals 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal
try {
  const response: any = await xero.accountingApi.getManualJournal(xeroTenantId, manualJournalID);
  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 getManualJournalExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)

            try
            {
                // Allows you to retrieve a specified manual journals
                ManualJournals result = apiInstance.getManualJournal(xeroTenantId, manualJournalID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getManualJournal: " + 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->getManualJournal: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal

eval { 
    my $result = $api_instance->getManualJournal(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getManualJournal: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)

try: 
    # Allows you to retrieve a specified manual journals
    api_response = api_instance.get_manual_journal(xeroTenantId, manualJournalID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getManualJournal: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getManualJournal(xeroTenantId, manualJournalID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getManualJournalAttachmentByFileName

Allows you to retrieve specified Attachment on ManualJournal by file name


/ManualJournals/{ManualJournalID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{FileName}"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentByFileName");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentByFileName");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a ManualJournal (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve specified Attachment on ManualJournal by file name
[apiInstance getManualJournalAttachmentByFileNameWith:xeroTenantId
    manualJournalID:manualJournalID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a ManualJournal 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType);
  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 getManualJournalAttachmentByFileNameExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a ManualJournal (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve specified Attachment on ManualJournal by file name
                File result = apiInstance.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getManualJournalAttachmentByFileName: " + 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->getManualJournalAttachmentByFileName: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a ManualJournal
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getManualJournalAttachmentByFileName(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getManualJournalAttachmentByFileName: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a ManualJournal (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve specified Attachment on ManualJournal by file name
    api_response = api_instance.get_manual_journal_attachment_by_file_name(xeroTenantId, manualJournalID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getManualJournalAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
FileName*
String
The name of the file being attached to a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getManualJournalAttachmentById

Allows you to retrieve specified Attachment on ManualJournals


/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentById");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentById");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve specified Attachment on ManualJournals
[apiInstance getManualJournalAttachmentByIdWith:xeroTenantId
    manualJournalID:manualJournalID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType);
  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 getManualJournalAttachmentByIdExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for a Attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve specified Attachment on ManualJournals
                File result = apiInstance.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getManualJournalAttachmentById: " + 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->getManualJournalAttachmentById: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getManualJournalAttachmentById(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getManualJournalAttachmentById: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve specified Attachment on ManualJournals
    api_response = api_instance.get_manual_journal_attachment_by_id(xeroTenantId, manualJournalID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getManualJournalAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
AttachmentID*
UUID (uuid)
Unique identifier for a Attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getManualJournalAttachments

Allows you to retrieve Attachment for manual journals


/ManualJournals/{ManualJournalID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        try {
            Attachments result = apiInstance.getManualJournalAttachments(xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachments");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        try {
            Attachments result = apiInstance.getManualJournalAttachments(xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachments");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachment for manual journals
[apiInstance getManualJournalAttachmentsWith:xeroTenantId
    manualJournalID:manualJournalID
              completionHandler: ^(Attachments 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal
try {
  const response: any = await xero.accountingApi.getManualJournalAttachments(xeroTenantId, manualJournalID);
  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 getManualJournalAttachmentsExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)

            try
            {
                // Allows you to retrieve Attachment for manual journals
                Attachments result = apiInstance.getManualJournalAttachments(xeroTenantId, manualJournalID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getManualJournalAttachments: " + 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->getManualJournalAttachments: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal

eval { 
    my $result = $api_instance->getManualJournalAttachments(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getManualJournalAttachments: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)

try: 
    # Allows you to retrieve Attachment for manual journals
    api_response = api_instance.get_manual_journal_attachments(xeroTenantId, manualJournalID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getManualJournalAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getManualJournalAttachments(xeroTenantId, manualJournalID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getManualJournals

Allows you to retrieve any manual journals


/ManualJournals

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?where=Status=="' + ManualJournal.StatusEnum.DRAFT + '"&order=Date ASC&page=1"
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=="' + ManualJournal.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = Date ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment
        try {
            ManualJournals result = apiInstance.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournals");
            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=="' + ManualJournal.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = Date ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment
        try {
            ManualJournals result = apiInstance.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournals");
            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=="' + ManualJournal.StatusEnum.DRAFT + '"; // Filter by an any element (optional) (default to null)
String *order = Date ASC; // Order by an any element (optional) (default to null)
Integer *page = 1; // e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve any manual journals
[apiInstance getManualJournalsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    page:page
              completionHandler: ^(ManualJournals 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=="' + ManualJournal.StatusEnum.DRAFT + '"';  // {String} Filter by an any element
const order =  'Date ASC';  // {String} Order by an any element
const page =  1;  // {Integer} e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment

try {
  const response: any = await xero.accountingApi.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page);
  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 getManualJournalsExample
    {
        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=="' + ManualJournal.StatusEnum.DRAFT + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Date ASC;  // String | Order by an any element (optional)  (default to null)
            var page = 1;  // Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional)  (default to null)

            try
            {
                // Allows you to retrieve any manual journals
                ManualJournals result = apiInstance.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getManualJournals: " + 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->getManualJournals: ', $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=="' + ManualJournal.StatusEnum.DRAFT + '"; # String | Filter by an any element
my $order = Date ASC; # String | Order by an any element
my $page = 1; # Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment

eval { 
    my $result = $api_instance->getManualJournals(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, page => $page);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getManualJournals: $@\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=="' + ManualJournal.StatusEnum.DRAFT + '" # String | Filter by an any element (optional) (default to null)
order = Date ASC # String | Order by an any element (optional) (default to null)
page = 1 # Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) (default to null)

try: 
    # Allows you to retrieve any manual journals
    api_response = api_instance.get_manual_journals(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getManualJournals: %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=="' + ManualJournal.StatusEnum.DRAFT + '"; // String
    let order = Date ASC; // String
    let page = 1; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment

getOnlineInvoice

Allows you to retrieve a URL to an online invoice


/Invoices/{InvoiceID}/OnlineInvoice

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/OnlineInvoice"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            OnlineInvoices result = apiInstance.getOnlineInvoice(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOnlineInvoice");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        try {
            OnlineInvoices result = apiInstance.getOnlineInvoice(xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOnlineInvoice");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a URL to an online invoice
[apiInstance getOnlineInvoiceWith:xeroTenantId
    invoiceID:invoiceID
              completionHandler: ^(OnlineInvoices 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice
try {
  const response: any = await xero.accountingApi.getOnlineInvoice(xeroTenantId, invoiceID);
  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 getOnlineInvoiceExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)

            try
            {
                // Allows you to retrieve a URL to an online invoice
                OnlineInvoices result = apiInstance.getOnlineInvoice(xeroTenantId, invoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getOnlineInvoice: " + 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->getOnlineInvoice: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice

eval { 
    my $result = $api_instance->getOnlineInvoice(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getOnlineInvoice: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)

try: 
    # Allows you to retrieve a URL to an online invoice
    api_response = api_instance.get_online_invoice(xeroTenantId, invoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getOnlineInvoice: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getOnlineInvoice(xeroTenantId, invoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOrganisationCISSettings

Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion.


/Organisation/{OrganisationID}/CISSettings

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Organisation/{OrganisationID}/CISSettings"
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
        UUID organisationID = 00000000-0000-0000-000-000000000000; // UUID | The unique Xero identifier for an organisation
        try {
            CISOrgSetting result = apiInstance.getOrganisationCISSettings(xeroTenantId, organisationID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisationCISSettings");
            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
        UUID organisationID = 00000000-0000-0000-000-000000000000; // UUID | The unique Xero identifier for an organisation
        try {
            CISOrgSetting result = apiInstance.getOrganisationCISSettings(xeroTenantId, organisationID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisationCISSettings");
            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)
UUID *organisationID = 00000000-0000-0000-000-000000000000; // The unique Xero identifier for an organisation (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion.
[apiInstance getOrganisationCISSettingsWith:xeroTenantId
    organisationID:organisationID
              completionHandler: ^(CISOrgSetting 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 organisationID = "00000000-0000-0000-000-000000000000";  // {UUID} The unique Xero identifier for an organisation
try {
  const response: any = await xero.accountingApi.getOrganisationCISSettings(xeroTenantId, organisationID);
  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 getOrganisationCISSettingsExample
    {
        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 organisationID = new UUID(); // UUID | The unique Xero identifier for an organisation (default to null)

            try
            {
                // Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion.
                CISOrgSetting result = apiInstance.getOrganisationCISSettings(xeroTenantId, organisationID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getOrganisationCISSettings: " + 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->getOrganisationCISSettings: ', $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 $organisationID = 00000000-0000-0000-000-000000000000; # UUID | The unique Xero identifier for an organisation

eval { 
    my $result = $api_instance->getOrganisationCISSettings(xeroTenantId => $xeroTenantId, organisationID => $organisationID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getOrganisationCISSettings: $@\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)
organisationID = 00000000-0000-0000-000-000000000000 # UUID | The unique Xero identifier for an organisation (default to null)

try: 
    # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion.
    api_response = api_instance.get_organisation_cis_settings(xeroTenantId, organisationID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getOrganisationCISSettings: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let organisationID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getOrganisationCISSettings(xeroTenantId, organisationID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
OrganisationID*
UUID (uuid)
The unique Xero identifier for an organisation
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOrganisations

Allows you to retrieve Organisation details


/Organisation

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Organisation"
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
        try {
            Organisations result = apiInstance.getOrganisations(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisations");
            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
        try {
            Organisations result = apiInstance.getOrganisations(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisations");
            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)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Organisation details
[apiInstance getOrganisationsWith:xeroTenantId
              completionHandler: ^(Organisations 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
try {
  const response: any = await xero.accountingApi.getOrganisations(xeroTenantId);
  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 getOrganisationsExample
    {
        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)

            try
            {
                // Allows you to retrieve Organisation details
                Organisations result = apiInstance.getOrganisations(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getOrganisations: " + 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->getOrganisations: ', $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

eval { 
    my $result = $api_instance->getOrganisations(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getOrganisations: $@\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)

try: 
    # Allows you to retrieve Organisation details
    api_response = api_instance.get_organisations(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getOrganisations: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getOrganisations(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOverpayment

Allows you to retrieve a specified overpayments


/Overpayments/{OverpaymentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}"
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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        try {
            Overpayments result = apiInstance.getOverpayment(xeroTenantId, overpaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOverpayment");
            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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        try {
            Overpayments result = apiInstance.getOverpayment(xeroTenantId, overpaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOverpayment");
            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)
UUID *overpaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Overpayment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified overpayments
[apiInstance getOverpaymentWith:xeroTenantId
    overpaymentID:overpaymentID
              completionHandler: ^(Overpayments 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 overpaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Overpayment
try {
  const response: any = await xero.accountingApi.getOverpayment(xeroTenantId, overpaymentID);
  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 getOverpaymentExample
    {
        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 overpaymentID = new UUID(); // UUID | Unique identifier for a Overpayment (default to null)

            try
            {
                // Allows you to retrieve a specified overpayments
                Overpayments result = apiInstance.getOverpayment(xeroTenantId, overpaymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getOverpayment: " + 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->getOverpayment: ', $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 $overpaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Overpayment

eval { 
    my $result = $api_instance->getOverpayment(xeroTenantId => $xeroTenantId, overpaymentID => $overpaymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getOverpayment: $@\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)
overpaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Overpayment (default to null)

try: 
    # Allows you to retrieve a specified overpayments
    api_response = api_instance.get_overpayment(xeroTenantId, overpaymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getOverpayment: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let overpaymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getOverpayment(xeroTenantId, overpaymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOverpaymentHistory

Allows you to retrieve a history records of an Overpayment


/Overpayments/{OverpaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}/History"
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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        try {
            HistoryRecords result = apiInstance.getOverpaymentHistory(xeroTenantId, overpaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOverpaymentHistory");
            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
        UUID overpaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Overpayment
        try {
            HistoryRecords result = apiInstance.getOverpaymentHistory(xeroTenantId, overpaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOverpaymentHistory");
            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)
UUID *overpaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Overpayment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an Overpayment
[apiInstance getOverpaymentHistoryWith:xeroTenantId
    overpaymentID:overpaymentID
              completionHandler: ^(HistoryRecords 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 overpaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Overpayment
try {
  const response: any = await xero.accountingApi.getOverpaymentHistory(xeroTenantId, overpaymentID);
  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 getOverpaymentHistoryExample
    {
        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 overpaymentID = new UUID(); // UUID | Unique identifier for a Overpayment (default to null)

            try
            {
                // Allows you to retrieve a history records of an Overpayment
                HistoryRecords result = apiInstance.getOverpaymentHistory(xeroTenantId, overpaymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getOverpaymentHistory: " + 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->getOverpaymentHistory: ', $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 $overpaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Overpayment

eval { 
    my $result = $api_instance->getOverpaymentHistory(xeroTenantId => $xeroTenantId, overpaymentID => $overpaymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getOverpaymentHistory: $@\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)
overpaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Overpayment (default to null)

try: 
    # Allows you to retrieve a history records of an Overpayment
    api_response = api_instance.get_overpayment_history(xeroTenantId, overpaymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getOverpaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let overpaymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getOverpaymentHistory(xeroTenantId, overpaymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOverpayments

Allows you to retrieve overpayments


/Overpayments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Overpayments?where=Status=="' + Overpayment.StatusEnum.AUTHORISED + '"&order=RemainingCredit ASC&page=1&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=="' + Overpayment.StatusEnum.AUTHORISED + '"; // String | Filter by an any element
        String order = RemainingCredit ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Overpayments result = apiInstance.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOverpayments");
            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=="' + Overpayment.StatusEnum.AUTHORISED + '"; // String | Filter by an any element
        String order = RemainingCredit ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Overpayments result = apiInstance.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getOverpayments");
            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=="' + Overpayment.StatusEnum.AUTHORISED + '"; // Filter by an any element (optional) (default to null)
String *order = RemainingCredit ASC; // Order by an any element (optional) (default to null)
Integer *page = 1; // e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (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 overpayments
[apiInstance getOverpaymentsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    page:page
    unitdp:unitdp
              completionHandler: ^(Overpayments 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=="' + Overpayment.StatusEnum.AUTHORISED + '"';  // {String} Filter by an any element
const order =  'RemainingCredit ASC';  // {String} Order by an any element
const page =  1;  // {Integer} e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
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.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, 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 getOverpaymentsExample
    {
        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=="' + Overpayment.StatusEnum.AUTHORISED + '";  // String | Filter by an any element (optional)  (default to null)
            var order = RemainingCredit ASC;  // String | Order by an any element (optional)  (default to null)
            var page = 1;  // Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (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 overpayments
                Overpayments result = apiInstance.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getOverpayments: " + 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->getOverpayments: ', $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=="' + Overpayment.StatusEnum.AUTHORISED + '"; # String | Filter by an any element
my $order = RemainingCredit ASC; # String | Order by an any element
my $page = 1; # Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
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->getOverpayments(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, page => $page, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getOverpayments: $@\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=="' + Overpayment.StatusEnum.AUTHORISED + '" # String | Filter by an any element (optional) (default to null)
order = RemainingCredit ASC # String | Order by an any element (optional) (default to null)
page = 1 # Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (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 overpayments
    api_response = api_instance.get_overpayments(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, page=page, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getOverpayments: %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=="' + Overpayment.StatusEnum.AUTHORISED + '"; // String
    let order = RemainingCredit ASC; // String
    let page = 1; // Integer
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getPayment

Allows you to retrieve a specified payment for invoices and credit notes


/Payments/{PaymentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}"
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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        try {
            Payments result = apiInstance.getPayment(xeroTenantId, paymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPayment");
            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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        try {
            Payments result = apiInstance.getPayment(xeroTenantId, paymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPayment");
            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)
UUID *paymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Payment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified payment for invoices and credit notes
[apiInstance getPaymentWith:xeroTenantId
    paymentID:paymentID
              completionHandler: ^(Payments 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 paymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Payment
try {
  const response: any = await xero.accountingApi.getPayment(xeroTenantId, paymentID);
  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 getPaymentExample
    {
        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 paymentID = new UUID(); // UUID | Unique identifier for a Payment (default to null)

            try
            {
                // Allows you to retrieve a specified payment for invoices and credit notes
                Payments result = apiInstance.getPayment(xeroTenantId, paymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPayment: " + 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->getPayment: ', $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 $paymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Payment

eval { 
    my $result = $api_instance->getPayment(xeroTenantId => $xeroTenantId, paymentID => $paymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPayment: $@\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)
paymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Payment (default to null)

try: 
    # Allows you to retrieve a specified payment for invoices and credit notes
    api_response = api_instance.get_payment(xeroTenantId, paymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPayment: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let paymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getPayment(xeroTenantId, paymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
PaymentID*
UUID (uuid)
Unique identifier for a Payment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPaymentHistory

Allows you to retrieve history records of a payment


/Payments/{PaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}/History"
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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        try {
            HistoryRecords result = apiInstance.getPaymentHistory(xeroTenantId, paymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPaymentHistory");
            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
        UUID paymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Payment
        try {
            HistoryRecords result = apiInstance.getPaymentHistory(xeroTenantId, paymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPaymentHistory");
            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)
UUID *paymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Payment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history records of a payment
[apiInstance getPaymentHistoryWith:xeroTenantId
    paymentID:paymentID
              completionHandler: ^(HistoryRecords 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 paymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Payment
try {
  const response: any = await xero.accountingApi.getPaymentHistory(xeroTenantId, paymentID);
  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 getPaymentHistoryExample
    {
        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 paymentID = new UUID(); // UUID | Unique identifier for a Payment (default to null)

            try
            {
                // Allows you to retrieve history records of a payment
                HistoryRecords result = apiInstance.getPaymentHistory(xeroTenantId, paymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPaymentHistory: " + 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->getPaymentHistory: ', $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 $paymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Payment

eval { 
    my $result = $api_instance->getPaymentHistory(xeroTenantId => $xeroTenantId, paymentID => $paymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPaymentHistory: $@\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)
paymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Payment (default to null)

try: 
    # Allows you to retrieve history records of a payment
    api_response = api_instance.get_payment_history(xeroTenantId, paymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let paymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getPaymentHistory(xeroTenantId, paymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
PaymentID*
UUID (uuid)
Unique identifier for a Payment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPaymentServices

Allows you to retrieve payment services


/PaymentServices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PaymentServices"
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
        try {
            PaymentServices result = apiInstance.getPaymentServices(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPaymentServices");
            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
        try {
            PaymentServices result = apiInstance.getPaymentServices(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPaymentServices");
            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)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve payment services
[apiInstance getPaymentServicesWith:xeroTenantId
              completionHandler: ^(PaymentServices 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
try {
  const response: any = await xero.accountingApi.getPaymentServices(xeroTenantId);
  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 getPaymentServicesExample
    {
        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)

            try
            {
                // Allows you to retrieve payment services
                PaymentServices result = apiInstance.getPaymentServices(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPaymentServices: " + 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->getPaymentServices: ', $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

eval { 
    my $result = $api_instance->getPaymentServices(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPaymentServices: $@\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)

try: 
    # Allows you to retrieve payment services
    api_response = api_instance.get_payment_services(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPaymentServices: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getPaymentServices(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

paymentservices Grant read-write access to payment services

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPayments

Allows you to retrieve payments for invoices and credit notes


/Payments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Payments?where=Status=="' + Payment.StatusEnum.AUTHORISED + '"&order=Amount ASC"
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=="' + Payment.StatusEnum.AUTHORISED + '"; // String | Filter by an any element
        String order = Amount ASC; // String | Order by an any element
        try {
            Payments result = apiInstance.getPayments(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPayments");
            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=="' + Payment.StatusEnum.AUTHORISED + '"; // String | Filter by an any element
        String order = Amount ASC; // String | Order by an any element
        try {
            Payments result = apiInstance.getPayments(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPayments");
            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=="' + Payment.StatusEnum.AUTHORISED + '"; // Filter by an any element (optional) (default to null)
String *order = Amount ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve payments for invoices and credit notes
[apiInstance getPaymentsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(Payments 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=="' + Payment.StatusEnum.AUTHORISED + '"';  // {String} Filter by an any element
const order =  'Amount ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getPayments(xeroTenantId, ifModifiedSince, where, order);
  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 getPaymentsExample
    {
        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=="' + Payment.StatusEnum.AUTHORISED + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Amount ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve payments for invoices and credit notes
                Payments result = apiInstance.getPayments(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPayments: " + 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->getPayments: ', $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=="' + Payment.StatusEnum.AUTHORISED + '"; # String | Filter by an any element
my $order = Amount ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getPayments(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPayments: $@\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=="' + Payment.StatusEnum.AUTHORISED + '" # String | Filter by an any element (optional) (default to null)
order = Amount ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve payments for invoices and credit notes
    api_response = api_instance.get_payments(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPayments: %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=="' + Payment.StatusEnum.AUTHORISED + '"; // String
    let order = Amount ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getPayments(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getPrepayment

Allows you to retrieve a specified prepayments


/Prepayments/{PrepaymentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}"
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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PrePayment
        try {
            Prepayments result = apiInstance.getPrepayment(xeroTenantId, prepaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPrepayment");
            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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PrePayment
        try {
            Prepayments result = apiInstance.getPrepayment(xeroTenantId, prepaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPrepayment");
            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)
UUID *prepaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PrePayment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified prepayments
[apiInstance getPrepaymentWith:xeroTenantId
    prepaymentID:prepaymentID
              completionHandler: ^(Prepayments 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 prepaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PrePayment
try {
  const response: any = await xero.accountingApi.getPrepayment(xeroTenantId, prepaymentID);
  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 getPrepaymentExample
    {
        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 prepaymentID = new UUID(); // UUID | Unique identifier for a PrePayment (default to null)

            try
            {
                // Allows you to retrieve a specified prepayments
                Prepayments result = apiInstance.getPrepayment(xeroTenantId, prepaymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPrepayment: " + 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->getPrepayment: ', $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 $prepaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PrePayment

eval { 
    my $result = $api_instance->getPrepayment(xeroTenantId => $xeroTenantId, prepaymentID => $prepaymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPrepayment: $@\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)
prepaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PrePayment (default to null)

try: 
    # Allows you to retrieve a specified prepayments
    api_response = api_instance.get_prepayment(xeroTenantId, prepaymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPrepayment: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let prepaymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getPrepayment(xeroTenantId, prepaymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for a PrePayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPrepaymentHistory

Allows you to retrieve a history records of an Prepayment


/Prepayments/{PrepaymentID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}/History"
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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PrePayment
        try {
            HistoryRecords result = apiInstance.getPrepaymentHistory(xeroTenantId, prepaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPrepaymentHistory");
            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
        UUID prepaymentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PrePayment
        try {
            HistoryRecords result = apiInstance.getPrepaymentHistory(xeroTenantId, prepaymentID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPrepaymentHistory");
            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)
UUID *prepaymentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PrePayment (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an Prepayment
[apiInstance getPrepaymentHistoryWith:xeroTenantId
    prepaymentID:prepaymentID
              completionHandler: ^(HistoryRecords 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 prepaymentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PrePayment
try {
  const response: any = await xero.accountingApi.getPrepaymentHistory(xeroTenantId, prepaymentID);
  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 getPrepaymentHistoryExample
    {
        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 prepaymentID = new UUID(); // UUID | Unique identifier for a PrePayment (default to null)

            try
            {
                // Allows you to retrieve a history records of an Prepayment
                HistoryRecords result = apiInstance.getPrepaymentHistory(xeroTenantId, prepaymentID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPrepaymentHistory: " + 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->getPrepaymentHistory: ', $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 $prepaymentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PrePayment

eval { 
    my $result = $api_instance->getPrepaymentHistory(xeroTenantId => $xeroTenantId, prepaymentID => $prepaymentID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPrepaymentHistory: $@\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)
prepaymentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PrePayment (default to null)

try: 
    # Allows you to retrieve a history records of an Prepayment
    api_response = api_instance.get_prepayment_history(xeroTenantId, prepaymentID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPrepaymentHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let prepaymentID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getPrepaymentHistory(xeroTenantId, prepaymentID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for a PrePayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPrepayments

Allows you to retrieve prepayments


/Prepayments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Prepayments?where=Status=="' + Prepayment.StatusEnum.AUTHORISED + '"&order=Reference ASC&page=1&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=="' + Prepayment.StatusEnum.AUTHORISED + '"; // String | Filter by an any element
        String order = Reference ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Prepayments result = apiInstance.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPrepayments");
            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=="' + Prepayment.StatusEnum.AUTHORISED + '"; // String | Filter by an any element
        String order = Reference ASC; // String | Order by an any element
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Prepayments result = apiInstance.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPrepayments");
            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=="' + Prepayment.StatusEnum.AUTHORISED + '"; // Filter by an any element (optional) (default to null)
String *order = Reference ASC; // Order by an any element (optional) (default to null)
Integer *page = 1; // e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (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 prepayments
[apiInstance getPrepaymentsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    page:page
    unitdp:unitdp
              completionHandler: ^(Prepayments 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=="' + Prepayment.StatusEnum.AUTHORISED + '"';  // {String} Filter by an any element
const order =  'Reference ASC';  // {String} Order by an any element
const page =  1;  // {Integer} e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
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.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, 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 getPrepaymentsExample
    {
        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=="' + Prepayment.StatusEnum.AUTHORISED + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Reference ASC;  // String | Order by an any element (optional)  (default to null)
            var page = 1;  // Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (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 prepayments
                Prepayments result = apiInstance.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPrepayments: " + 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->getPrepayments: ', $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=="' + Prepayment.StatusEnum.AUTHORISED + '"; # String | Filter by an any element
my $order = Reference ASC; # String | Order by an any element
my $page = 1; # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
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->getPrepayments(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, page => $page, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPrepayments: $@\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=="' + Prepayment.StatusEnum.AUTHORISED + '" # String | Filter by an any element (optional) (default to null)
order = Reference ASC # String | Order by an any element (optional) (default to null)
page = 1 # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (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 prepayments
    api_response = api_instance.get_prepayments(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, page=page, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPrepayments: %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=="' + Prepayment.StatusEnum.AUTHORISED + '"; // String
    let order = Reference ASC; // String
    let page = 1; // Integer
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getPurchaseOrder

Allows you to retrieve a specified purchase orders


/PurchaseOrders/{PurchaseOrderID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}"
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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        try {
            PurchaseOrders result = apiInstance.getPurchaseOrder(xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrder");
            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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        try {
            PurchaseOrders result = apiInstance.getPurchaseOrder(xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrder");
            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)
UUID *purchaseOrderID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PurchaseOrder (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified purchase orders
[apiInstance getPurchaseOrderWith:xeroTenantId
    purchaseOrderID:purchaseOrderID
              completionHandler: ^(PurchaseOrders 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 purchaseOrderID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PurchaseOrder
try {
  const response: any = await xero.accountingApi.getPurchaseOrder(xeroTenantId, purchaseOrderID);
  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 getPurchaseOrderExample
    {
        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 purchaseOrderID = new UUID(); // UUID | Unique identifier for a PurchaseOrder (default to null)

            try
            {
                // Allows you to retrieve a specified purchase orders
                PurchaseOrders result = apiInstance.getPurchaseOrder(xeroTenantId, purchaseOrderID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPurchaseOrder: " + 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->getPurchaseOrder: ', $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 $purchaseOrderID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PurchaseOrder

eval { 
    my $result = $api_instance->getPurchaseOrder(xeroTenantId => $xeroTenantId, purchaseOrderID => $purchaseOrderID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPurchaseOrder: $@\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)
purchaseOrderID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PurchaseOrder (default to null)

try: 
    # Allows you to retrieve a specified purchase orders
    api_response = api_instance.get_purchase_order(xeroTenantId, purchaseOrderID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPurchaseOrder: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getPurchaseOrder(xeroTenantId, purchaseOrderID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for a PurchaseOrder
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPurchaseOrderHistory

Allows you to retrieve history for PurchaseOrder


/PurchaseOrders/{PurchaseOrderID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/History"
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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        try {
            HistoryRecords result = apiInstance.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderHistory");
            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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        try {
            HistoryRecords result = apiInstance.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderHistory");
            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)
UUID *purchaseOrderID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PurchaseOrder (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history for PurchaseOrder
[apiInstance getPurchaseOrderHistoryWith:xeroTenantId
    purchaseOrderID:purchaseOrderID
              completionHandler: ^(HistoryRecords 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 purchaseOrderID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PurchaseOrder
try {
  const response: any = await xero.accountingApi.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID);
  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 getPurchaseOrderHistoryExample
    {
        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 purchaseOrderID = new UUID(); // UUID | Unique identifier for a PurchaseOrder (default to null)

            try
            {
                // Allows you to retrieve history for PurchaseOrder
                HistoryRecords result = apiInstance.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPurchaseOrderHistory: " + 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->getPurchaseOrderHistory: ', $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 $purchaseOrderID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PurchaseOrder

eval { 
    my $result = $api_instance->getPurchaseOrderHistory(xeroTenantId => $xeroTenantId, purchaseOrderID => $purchaseOrderID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPurchaseOrderHistory: $@\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)
purchaseOrderID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PurchaseOrder (default to null)

try: 
    # Allows you to retrieve history for PurchaseOrder
    api_response = api_instance.get_purchase_order_history(xeroTenantId, purchaseOrderID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPurchaseOrderHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for a PurchaseOrder
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPurchaseOrders

Allows you to retrieve purchase orders


/PurchaseOrders

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?Status=SUBMITTED&DateFrom=2019-12-01&DateTo=2019-12-31&order=PurchaseOrderNumber ASC&page=1"
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 status = SUBMITTED; // String | Filter by purchase order status
        String dateFrom = 2019-12-01; // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
        String dateTo = 2019-12-31; // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
        String order = PurchaseOrderNumber ASC; // String | Order by an any element
        Integer page = 1; // Integer | To specify a page, append the 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.
        try {
            PurchaseOrders result = apiInstance.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrders");
            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 status = SUBMITTED; // String | Filter by purchase order status
        String dateFrom = 2019-12-01; // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
        String dateTo = 2019-12-31; // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
        String order = PurchaseOrderNumber ASC; // String | Order by an any element
        Integer page = 1; // Integer | To specify a page, append the 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.
        try {
            PurchaseOrders result = apiInstance.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrders");
            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 *status = SUBMITTED; // Filter by purchase order status (optional) (default to null)
String *dateFrom = 2019-12-01; // Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) (default to null)
String *dateTo = 2019-12-31; // Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) (default to null)
String *order = PurchaseOrderNumber ASC; // Order by an any element (optional) (default to null)
Integer *page = 1; // To specify a page, append the 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. (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve purchase orders
[apiInstance getPurchaseOrdersWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    status:status
    dateFrom:dateFrom
    dateTo:dateTo
    order:order
    page:page
              completionHandler: ^(PurchaseOrders 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 status =  'SUBMITTED';  // {String} Filter by purchase order status
const dateFrom =  '2019-12-01';  // {String} Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
const dateTo =  '2019-12-31';  // {String} Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
const order =  'PurchaseOrderNumber ASC';  // {String} Order by an any element
const page =  1;  // {Integer} To specify a page, append the 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.

try {
  const response: any = await xero.accountingApi.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page);
  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 getPurchaseOrdersExample
    {
        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 status = SUBMITTED;  // String | Filter by purchase order status (optional)  (default to null)
            var dateFrom = 2019-12-01;  // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional)  (default to null)
            var dateTo = 2019-12-31;  // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional)  (default to null)
            var order = PurchaseOrderNumber ASC;  // String | Order by an any element (optional)  (default to null)
            var page = 1;  // Integer | To specify a page, append the 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. (optional)  (default to null)

            try
            {
                // Allows you to retrieve purchase orders
                PurchaseOrders result = apiInstance.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getPurchaseOrders: " + 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->getPurchaseOrders: ', $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 $status = SUBMITTED; # String | Filter by purchase order status
my $dateFrom = 2019-12-01; # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
my $dateTo = 2019-12-31; # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
my $order = PurchaseOrderNumber ASC; # String | Order by an any element
my $page = 1; # Integer | To specify a page, append the 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.

eval { 
    my $result = $api_instance->getPurchaseOrders(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, status => $status, dateFrom => $dateFrom, dateTo => $dateTo, order => $order, page => $page);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getPurchaseOrders: $@\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)
status = SUBMITTED # String | Filter by purchase order status (optional) (default to null)
dateFrom = 2019-12-01 # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) (default to null)
dateTo = 2019-12-31 # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) (default to null)
order = PurchaseOrderNumber ASC # String | Order by an any element (optional) (default to null)
page = 1 # Integer | To specify a page, append the 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. (optional) (default to null)

try: 
    # Allows you to retrieve purchase orders
    api_response = api_instance.get_purchase_orders(xeroTenantId, ifModifiedSince=ifModifiedSince, status=status, dateFrom=dateFrom, dateTo=dateTo, order=order, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getPurchaseOrders: %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 status = SUBMITTED; // String
    let dateFrom = 2019-12-01; // String
    let dateTo = 2019-12-31; // String
    let order = PurchaseOrderNumber ASC; // String
    let page = 1; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
Status
String
Filter by purchase order status
DateFrom
String
Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
DateTo
String
Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
order
String
Order by an any element
page
Integer
To specify a page, append the 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.

getQuote

Allows you to retrieve a specified quote


/Quotes/{QuoteID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        try {
            Quotes result = apiInstance.getQuote(xeroTenantId, quoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuote");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        try {
            Quotes result = apiInstance.getQuote(xeroTenantId, quoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuote");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Quote (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified quote
[apiInstance getQuoteWith:xeroTenantId
    quoteID:quoteID
              completionHandler: ^(Quotes 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Quote
try {
  const response: any = await xero.accountingApi.getQuote(xeroTenantId, quoteID);
  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 getQuoteExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for an Quote (default to null)

            try
            {
                // Allows you to retrieve a specified quote
                Quotes result = apiInstance.getQuote(xeroTenantId, quoteID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getQuote: " + 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->getQuote: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Quote

eval { 
    my $result = $api_instance->getQuote(xeroTenantId => $xeroTenantId, quoteID => $quoteID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getQuote: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Quote (default to null)

try: 
    # Allows you to retrieve a specified quote
    api_response = api_instance.get_quote(xeroTenantId, quoteID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getQuote: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getQuote(xeroTenantId, quoteID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getQuoteAttachmentByFileName

Allows you to retrieve Attachment on Quote by Filename


/Quotes/{QuoteID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachmentByFileName");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachmentByFileName");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for Quote object (default to null)
String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachment on Quote by Filename
[apiInstance getQuoteAttachmentByFileNameWith:xeroTenantId
    quoteID:quoteID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Quote object 
const fileName = "xero-dev.jpg";  // {String} Name of the attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType);
  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 getQuoteAttachmentByFileNameExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for Quote object (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachment on Quote by Filename
                File result = apiInstance.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getQuoteAttachmentByFileName: " + 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->getQuoteAttachmentByFileName: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Quote object
my $fileName = xero-dev.jpg; # String | Name of the attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getQuoteAttachmentByFileName(xeroTenantId => $xeroTenantId, quoteID => $quoteID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getQuoteAttachmentByFileName: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Quote object (default to null)
fileName = xero-dev.jpg # String | Name of the attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachment on Quote by Filename
    api_response = api_instance.get_quote_attachment_by_file_name(xeroTenantId, quoteID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getQuoteAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for Quote object
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getQuoteAttachmentById

Allows you to retrieve specific Attachment on Quote


/Quotes/{QuoteID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{AttachmentID}"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Attachment object
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachmentById");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Attachment object
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachmentById");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for Quote object (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for Attachment object (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve specific Attachment on Quote
[apiInstance getQuoteAttachmentByIdWith:xeroTenantId
    quoteID:quoteID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Quote object 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Attachment object 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType);
  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 getQuoteAttachmentByIdExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for Quote object (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for Attachment object (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve specific Attachment on Quote
                File result = apiInstance.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getQuoteAttachmentById: " + 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->getQuoteAttachmentById: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Quote object
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Attachment object
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getQuoteAttachmentById(xeroTenantId => $xeroTenantId, quoteID => $quoteID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getQuoteAttachmentById: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Quote object (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Attachment object (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve specific Attachment on Quote
    api_response = api_instance.get_quote_attachment_by_id(xeroTenantId, quoteID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getQuoteAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for Quote object
Required
AttachmentID*
UUID (uuid)
Unique identifier for Attachment object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getQuoteAttachments

Allows you to retrieve Attachments for Quotes


/Quotes/{QuoteID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        try {
            Attachments result = apiInstance.getQuoteAttachments(xeroTenantId, quoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachments");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        try {
            Attachments result = apiInstance.getQuoteAttachments(xeroTenantId, quoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachments");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for Quote object (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments for Quotes
[apiInstance getQuoteAttachmentsWith:xeroTenantId
    quoteID:quoteID
              completionHandler: ^(Attachments 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Quote object
try {
  const response: any = await xero.accountingApi.getQuoteAttachments(xeroTenantId, quoteID);
  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 getQuoteAttachmentsExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for Quote object (default to null)

            try
            {
                // Allows you to retrieve Attachments for Quotes
                Attachments result = apiInstance.getQuoteAttachments(xeroTenantId, quoteID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getQuoteAttachments: " + 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->getQuoteAttachments: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Quote object

eval { 
    my $result = $api_instance->getQuoteAttachments(xeroTenantId => $xeroTenantId, quoteID => $quoteID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getQuoteAttachments: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Quote object (default to null)

try: 
    # Allows you to retrieve Attachments for Quotes
    api_response = api_instance.get_quote_attachments(xeroTenantId, quoteID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getQuoteAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getQuoteAttachments(xeroTenantId, quoteID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for Quote object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getQuoteHistory

Allows you to retrieve a history records of an quote


/Quotes/{QuoteID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/History"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        try {
            HistoryRecords result = apiInstance.getQuoteHistory(xeroTenantId, quoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteHistory");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        try {
            HistoryRecords result = apiInstance.getQuoteHistory(xeroTenantId, quoteID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteHistory");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Quote (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an quote
[apiInstance getQuoteHistoryWith:xeroTenantId
    quoteID:quoteID
              completionHandler: ^(HistoryRecords 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Quote
try {
  const response: any = await xero.accountingApi.getQuoteHistory(xeroTenantId, quoteID);
  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 getQuoteHistoryExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for an Quote (default to null)

            try
            {
                // Allows you to retrieve a history records of an quote
                HistoryRecords result = apiInstance.getQuoteHistory(xeroTenantId, quoteID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getQuoteHistory: " + 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->getQuoteHistory: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Quote

eval { 
    my $result = $api_instance->getQuoteHistory(xeroTenantId => $xeroTenantId, quoteID => $quoteID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getQuoteHistory: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Quote (default to null)

try: 
    # Allows you to retrieve a history records of an quote
    api_response = api_instance.get_quote_history(xeroTenantId, quoteID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getQuoteHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getQuoteHistory(xeroTenantId, quoteID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getQuotes

Allows you to retrieve any sales quotes


/Quotes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes?DateFrom=2013-10-20&DateTo=2013-10-20&ExpiryDateFrom=2013-10-20&ExpiryDateTo=2013-10-20&ContactID=00000000-0000-0000-000-000000000000&Status=status_example&page=1&order=ASC"
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
        date dateFrom = 2013-10-20; // date | Filter for quotes after a particular date
        date dateTo = 2013-10-20; // date | Filter for quotes before a particular date
        date expiryDateFrom = 2013-10-20; // date | Filter for quotes expiring after a particular date
        date expiryDateTo = 2013-10-20; // date | Filter for quotes before a particular date
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Filter for quotes belonging to a particular contact
        String status = status_example; // String | Filter for quotes of a particular Status
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
        String order = ASC; // String | Order by an any element
        try {
            Quotes result = apiInstance.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuotes");
            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
        date dateFrom = 2013-10-20; // date | Filter for quotes after a particular date
        date dateTo = 2013-10-20; // date | Filter for quotes before a particular date
        date expiryDateFrom = 2013-10-20; // date | Filter for quotes expiring after a particular date
        date expiryDateTo = 2013-10-20; // date | Filter for quotes before a particular date
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Filter for quotes belonging to a particular contact
        String status = status_example; // String | Filter for quotes of a particular Status
        Integer page = 1; // Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
        String order = ASC; // String | Order by an any element
        try {
            Quotes result = apiInstance.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getQuotes");
            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)
date *dateFrom = 2013-10-20; // Filter for quotes after a particular date (optional) (default to null)
date *dateTo = 2013-10-20; // Filter for quotes before a particular date (optional) (default to null)
date *expiryDateFrom = 2013-10-20; // Filter for quotes expiring after a particular date (optional) (default to null)
date *expiryDateTo = 2013-10-20; // Filter for quotes before a particular date (optional) (default to null)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Filter for quotes belonging to a particular contact (optional) (default to null)
String *status = status_example; // Filter for quotes of a particular Status (optional) (default to null)
Integer *page = 1; // e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote (optional) (default to null)
String *order = ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve any sales quotes
[apiInstance getQuotesWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    dateFrom:dateFrom
    dateTo:dateTo
    expiryDateFrom:expiryDateFrom
    expiryDateTo:expiryDateTo
    contactID:contactID
    status:status
    page:page
    order:order
              completionHandler: ^(Quotes 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 dateFrom:Date =  new Date("2013-10-20");  // {date} Filter for quotes after a particular date
const dateTo:Date =  new Date("2013-10-20");  // {date} Filter for quotes before a particular date
const expiryDateFrom:Date =  new Date("2013-10-20");  // {date} Filter for quotes expiring after a particular date
const expiryDateTo:Date =  new Date("2013-10-20");  // {date} Filter for quotes before a particular date
const contactID =  '00000000-0000-0000-000-000000000000';  // {UUID} Filter for quotes belonging to a particular contact
const status =  'status_example';  // {String} Filter for quotes of a particular Status
const page =  1;  // {Integer} e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
const order =  'ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order);
  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 getQuotesExample
    {
        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 dateFrom = 2013-10-20;  // date | Filter for quotes after a particular date (optional)  (default to null)
            var dateTo = 2013-10-20;  // date | Filter for quotes before a particular date (optional)  (default to null)
            var expiryDateFrom = 2013-10-20;  // date | Filter for quotes expiring after a particular date (optional)  (default to null)
            var expiryDateTo = 2013-10-20;  // date | Filter for quotes before a particular date (optional)  (default to null)
            var contactID = new UUID(); // UUID | Filter for quotes belonging to a particular contact (optional)  (default to null)
            var status = status_example;  // String | Filter for quotes of a particular Status (optional)  (default to null)
            var page = 1;  // Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote (optional)  (default to null)
            var order = ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve any sales quotes
                Quotes result = apiInstance.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getQuotes: " + 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->getQuotes: ', $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 $dateFrom = 2013-10-20; # date | Filter for quotes after a particular date
my $dateTo = 2013-10-20; # date | Filter for quotes before a particular date
my $expiryDateFrom = 2013-10-20; # date | Filter for quotes expiring after a particular date
my $expiryDateTo = 2013-10-20; # date | Filter for quotes before a particular date
my $contactID = 00000000-0000-0000-000-000000000000; # UUID | Filter for quotes belonging to a particular contact
my $status = status_example; # String | Filter for quotes of a particular Status
my $page = 1; # Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
my $order = ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getQuotes(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, dateFrom => $dateFrom, dateTo => $dateTo, expiryDateFrom => $expiryDateFrom, expiryDateTo => $expiryDateTo, contactID => $contactID, status => $status, page => $page, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getQuotes: $@\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)
dateFrom = 2013-10-20 # date | Filter for quotes after a particular date (optional) (default to null)
dateTo = 2013-10-20 # date | Filter for quotes before a particular date (optional) (default to null)
expiryDateFrom = 2013-10-20 # date | Filter for quotes expiring after a particular date (optional) (default to null)
expiryDateTo = 2013-10-20 # date | Filter for quotes before a particular date (optional) (default to null)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Filter for quotes belonging to a particular contact (optional) (default to null)
status = status_example # String | Filter for quotes of a particular Status (optional) (default to null)
page = 1 # Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote (optional) (default to null)
order = ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve any sales quotes
    api_response = api_instance.get_quotes(xeroTenantId, ifModifiedSince=ifModifiedSince, dateFrom=dateFrom, dateTo=dateTo, expiryDateFrom=expiryDateFrom, expiryDateTo=expiryDateTo, contactID=contactID, status=status, page=page, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getQuotes: %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 dateFrom = 2013-10-20; // date
    let dateTo = 2013-10-20; // date
    let expiryDateFrom = 2013-10-20; // date
    let expiryDateTo = 2013-10-20; // date
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let status = status_example; // String
    let page = 1; // Integer
    let order = ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
DateFrom
date (date)
Filter for quotes after a particular date
DateTo
date (date)
Filter for quotes before a particular date
ExpiryDateFrom
date (date)
Filter for quotes expiring after a particular date
ExpiryDateTo
date (date)
Filter for quotes before a particular date
ContactID
UUID (uuid)
Filter for quotes belonging to a particular contact
Status
String
Filter for quotes of a particular Status
page
Integer
e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
order
String
Order by an any element

getReceipt

Allows you to retrieve a specified draft expense claim receipts


/Receipts/{ReceiptID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}?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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.getReceipt(xeroTenantId, receiptID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceipt");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.getReceipt(xeroTenantId, receiptID, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceipt");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (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 a specified draft expense claim receipts
[apiInstance getReceiptWith:xeroTenantId
    receiptID:receiptID
    unitdp:unitdp
              completionHandler: ^(Receipts 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt
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.getReceipt(xeroTenantId, receiptID,  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 getReceiptExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (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 a specified draft expense claim receipts
                Receipts result = apiInstance.getReceipt(xeroTenantId, receiptID, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReceipt: " + 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->getReceipt: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
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->getReceipt(xeroTenantId => $xeroTenantId, receiptID => $receiptID, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReceipt: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (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 a specified draft expense claim receipts
    api_response = api_instance.get_receipt(xeroTenantId, receiptID, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReceipt: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getReceipt(xeroTenantId, receiptID, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getReceiptAttachmentByFileName

Allows you to retrieve Attachments on expense claim receipts by file name


/Receipts/{ReceiptID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachmentByFileName");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachmentByFileName");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to the Receipt (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on expense claim receipts by file name
[apiInstance getReceiptAttachmentByFileNameWith:xeroTenantId
    receiptID:receiptID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to the Receipt 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType);
  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 getReceiptAttachmentByFileNameExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to the Receipt (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on expense claim receipts by file name
                File result = apiInstance.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReceiptAttachmentByFileName: " + 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->getReceiptAttachmentByFileName: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
my $fileName = xero-dev.jpg; # String | The name of the file being attached to the Receipt
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getReceiptAttachmentByFileName(xeroTenantId => $xeroTenantId, receiptID => $receiptID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReceiptAttachmentByFileName: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to the Receipt (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on expense claim receipts by file name
    api_response = api_instance.get_receipt_attachment_by_file_name(xeroTenantId, receiptID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReceiptAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
FileName*
String
The name of the file being attached to the Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getReceiptAttachmentById

Allows you to retrieve Attachments on expense claim receipts by ID


/Receipts/{ReceiptID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{AttachmentID}"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachmentById");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachmentById");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on expense claim receipts by ID
[apiInstance getReceiptAttachmentByIdWith:xeroTenantId
    receiptID:receiptID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType);
  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 getReceiptAttachmentByIdExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for a Attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve Attachments on expense claim receipts by ID
                File result = apiInstance.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReceiptAttachmentById: " + 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->getReceiptAttachmentById: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getReceiptAttachmentById(xeroTenantId => $xeroTenantId, receiptID => $receiptID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReceiptAttachmentById: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve Attachments on expense claim receipts by ID
    api_response = api_instance.get_receipt_attachment_by_id(xeroTenantId, receiptID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReceiptAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
AttachmentID*
UUID (uuid)
Unique identifier for a Attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getReceiptAttachments

Allows you to retrieve Attachments for expense claim receipts


/Receipts/{ReceiptID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        try {
            Attachments result = apiInstance.getReceiptAttachments(xeroTenantId, receiptID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachments");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        try {
            Attachments result = apiInstance.getReceiptAttachments(xeroTenantId, receiptID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachments");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments for expense claim receipts
[apiInstance getReceiptAttachmentsWith:xeroTenantId
    receiptID:receiptID
              completionHandler: ^(Attachments 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt
try {
  const response: any = await xero.accountingApi.getReceiptAttachments(xeroTenantId, receiptID);
  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 getReceiptAttachmentsExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)

            try
            {
                // Allows you to retrieve Attachments for expense claim receipts
                Attachments result = apiInstance.getReceiptAttachments(xeroTenantId, receiptID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReceiptAttachments: " + 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->getReceiptAttachments: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt

eval { 
    my $result = $api_instance->getReceiptAttachments(xeroTenantId => $xeroTenantId, receiptID => $receiptID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReceiptAttachments: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)

try: 
    # Allows you to retrieve Attachments for expense claim receipts
    api_response = api_instance.get_receipt_attachments(xeroTenantId, receiptID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReceiptAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getReceiptAttachments(xeroTenantId, receiptID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getReceiptHistory

Allows you to retrieve a history records of an Receipt


/Receipts/{ReceiptID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/History"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        try {
            HistoryRecords result = apiInstance.getReceiptHistory(xeroTenantId, receiptID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptHistory");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        try {
            HistoryRecords result = apiInstance.getReceiptHistory(xeroTenantId, receiptID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptHistory");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a history records of an Receipt
[apiInstance getReceiptHistoryWith:xeroTenantId
    receiptID:receiptID
              completionHandler: ^(HistoryRecords 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt
try {
  const response: any = await xero.accountingApi.getReceiptHistory(xeroTenantId, receiptID);
  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 getReceiptHistoryExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)

            try
            {
                // Allows you to retrieve a history records of an Receipt
                HistoryRecords result = apiInstance.getReceiptHistory(xeroTenantId, receiptID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReceiptHistory: " + 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->getReceiptHistory: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt

eval { 
    my $result = $api_instance->getReceiptHistory(xeroTenantId => $xeroTenantId, receiptID => $receiptID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReceiptHistory: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)

try: 
    # Allows you to retrieve a history records of an Receipt
    api_response = api_instance.get_receipt_history(xeroTenantId, receiptID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReceiptHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getReceiptHistory(xeroTenantId, receiptID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getReceipts

Allows you to retrieve draft expense claim receipts for any user


/Receipts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts?where=Status=="' + Receipt.StatusEnum.DRAFT + '"&order=ReceiptNumber ASC&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=="' + Receipt.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = ReceiptNumber ASC; // String | Order by an any element
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.getReceipts(xeroTenantId, ifModifiedSince, where, order, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceipts");
            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=="' + Receipt.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = ReceiptNumber ASC; // String | Order by an any element
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.getReceipts(xeroTenantId, ifModifiedSince, where, order, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReceipts");
            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=="' + Receipt.StatusEnum.DRAFT + '"; // Filter by an any element (optional) (default to null)
String *order = ReceiptNumber ASC; // Order by an any element (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 draft expense claim receipts for any user
[apiInstance getReceiptsWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
    unitdp:unitdp
              completionHandler: ^(Receipts 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=="' + Receipt.StatusEnum.DRAFT + '"';  // {String} Filter by an any element
const order =  'ReceiptNumber ASC';  // {String} Order by an any element
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.getReceipts(xeroTenantId, ifModifiedSince, where, order, 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 getReceiptsExample
    {
        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=="' + Receipt.StatusEnum.DRAFT + '";  // String | Filter by an any element (optional)  (default to null)
            var order = ReceiptNumber ASC;  // String | Order by an any element (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 draft expense claim receipts for any user
                Receipts result = apiInstance.getReceipts(xeroTenantId, ifModifiedSince, where, order, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReceipts: " + 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->getReceipts: ', $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=="' + Receipt.StatusEnum.DRAFT + '"; # String | Filter by an any element
my $order = ReceiptNumber ASC; # String | Order by an any element
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->getReceipts(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReceipts: $@\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=="' + Receipt.StatusEnum.DRAFT + '" # String | Filter by an any element (optional) (default to null)
order = ReceiptNumber ASC # String | Order by an any element (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 draft expense claim receipts for any user
    api_response = api_instance.get_receipts(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReceipts: %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=="' + Receipt.StatusEnum.DRAFT + '"; // String
    let order = ReceiptNumber ASC; // String
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getReceipts(xeroTenantId, ifModifiedSince, where, order, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

getRepeatingInvoice

Allows you to retrieve a specified repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        try {
            RepeatingInvoices result = apiInstance.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoice");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        try {
            RepeatingInvoices result = apiInstance.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoice");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified repeating invoice
[apiInstance getRepeatingInvoiceWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
              completionHandler: ^(RepeatingInvoices 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice
try {
  const response: any = await xero.accountingApi.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID);
  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 getRepeatingInvoiceExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)

            try
            {
                // Allows you to retrieve a specified repeating invoice
                RepeatingInvoices result = apiInstance.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getRepeatingInvoice: " + 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->getRepeatingInvoice: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice

eval { 
    my $result = $api_instance->getRepeatingInvoice(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getRepeatingInvoice: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)

try: 
    # Allows you to retrieve a specified repeating invoice
    api_response = api_instance.get_repeating_invoice(xeroTenantId, repeatingInvoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getRepeatingInvoice: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getRepeatingInvoiceAttachmentByFileName

Allows you to retrieve specified attachment on repeating invoices by file name


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentByFileName");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentByFileName");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a Repeating Invoice (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve specified attachment on repeating invoices by file name
[apiInstance getRepeatingInvoiceAttachmentByFileNameWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
    fileName:fileName
    contentType:contentType
              completionHandler: ^(File 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a Repeating Invoice 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType);
  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 getRepeatingInvoiceAttachmentByFileNameExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a Repeating Invoice (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve specified attachment on repeating invoices by file name
                File result = apiInstance.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getRepeatingInvoiceAttachmentByFileName: " + 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->getRepeatingInvoiceAttachmentByFileName: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a Repeating Invoice
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getRepeatingInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID, fileName => $fileName, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getRepeatingInvoiceAttachmentByFileName: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a Repeating Invoice (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve specified attachment on repeating invoices by file name
    api_response = api_instance.get_repeating_invoice_attachment_by_file_name(xeroTenantId, repeatingInvoiceID, fileName, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getRepeatingInvoiceAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
FileName*
String
The name of the file being attached to a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getRepeatingInvoiceAttachmentById

Allows you to retrieve a specified Attachments on repeating invoices


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentById");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        UUID attachmentID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Attachment
        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
        try {
            File result = apiInstance.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentById");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)
UUID *attachmentID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Attachment (default to null)
String *contentType = image/jpg; // The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified Attachments on repeating invoices
[apiInstance getRepeatingInvoiceAttachmentByIdWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
    attachmentID:attachmentID
    contentType:contentType
              completionHandler: ^(File 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice 
const attachmentID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Attachment 
const contentType = "image/jpg";  // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
try {
  const response: any = await xero.accountingApi.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
  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 getRepeatingInvoiceAttachmentByIdExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)
            var attachmentID = new UUID(); // UUID | Unique identifier for a Attachment (default to null)
            var contentType = image/jpg;  // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

            try
            {
                // Allows you to retrieve a specified Attachments on repeating invoices
                File result = apiInstance.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getRepeatingInvoiceAttachmentById: " + 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->getRepeatingInvoiceAttachmentById: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice
my $attachmentID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Attachment
my $contentType = image/jpg; # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf

eval { 
    my $result = $api_instance->getRepeatingInvoiceAttachmentById(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID, attachmentID => $attachmentID, contentType => $contentType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getRepeatingInvoiceAttachmentById: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)
attachmentID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Attachment (default to null)
contentType = image/jpg # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (default to null)

try: 
    # Allows you to retrieve a specified Attachments on repeating invoices
    api_response = api_instance.get_repeating_invoice_attachment_by_id(xeroTenantId, repeatingInvoiceID, attachmentID, contentType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getRepeatingInvoiceAttachmentById: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let attachmentID = 00000000-0000-0000-000-000000000000; // UUID
    let contentType = image/jpg; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
AttachmentID*
UUID (uuid)
Unique identifier for a Attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
contentType*
String
The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
Required

getRepeatingInvoiceAttachments

Allows you to retrieve Attachments on repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        try {
            Attachments result = apiInstance.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachments");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        try {
            Attachments result = apiInstance.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachments");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Attachments on repeating invoice
[apiInstance getRepeatingInvoiceAttachmentsWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
              completionHandler: ^(Attachments 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice
try {
  const response: any = await xero.accountingApi.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID);
  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 getRepeatingInvoiceAttachmentsExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)

            try
            {
                // Allows you to retrieve Attachments on repeating invoice
                Attachments result = apiInstance.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getRepeatingInvoiceAttachments: " + 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->getRepeatingInvoiceAttachments: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice

eval { 
    my $result = $api_instance->getRepeatingInvoiceAttachments(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getRepeatingInvoiceAttachments: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)

try: 
    # Allows you to retrieve Attachments on repeating invoice
    api_response = api_instance.get_repeating_invoice_attachments(xeroTenantId, repeatingInvoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getRepeatingInvoiceAttachments: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments.read Grant read-only access to attachments

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getRepeatingInvoiceHistory

Allows you to retrieve history for a repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/History

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/History"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        try {
            HistoryRecords result = apiInstance.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceHistory");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        try {
            HistoryRecords result = apiInstance.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceHistory");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve history for a repeating invoice
[apiInstance getRepeatingInvoiceHistoryWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
              completionHandler: ^(HistoryRecords 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice
try {
  const response: any = await xero.accountingApi.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID);
  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 getRepeatingInvoiceHistoryExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)

            try
            {
                // Allows you to retrieve history for a repeating invoice
                HistoryRecords result = apiInstance.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getRepeatingInvoiceHistory: " + 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->getRepeatingInvoiceHistory: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice

eval { 
    my $result = $api_instance->getRepeatingInvoiceHistory(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getRepeatingInvoiceHistory: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)

try: 
    # Allows you to retrieve history for a repeating invoice
    api_response = api_instance.get_repeating_invoice_history(xeroTenantId, repeatingInvoiceID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getRepeatingInvoiceHistory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getRepeatingInvoices

Allows you to retrieve any repeating invoices


/RepeatingInvoices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices?where=Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"&order=Total ASC"
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
        String where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = Total ASC; // String | Order by an any element
        try {
            RepeatingInvoices result = apiInstance.getRepeatingInvoices(xeroTenantId, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoices");
            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
        String where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"; // String | Filter by an any element
        String order = Total ASC; // String | Order by an any element
        try {
            RepeatingInvoices result = apiInstance.getRepeatingInvoices(xeroTenantId, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoices");
            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)
String *where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"; // Filter by an any element (optional) (default to null)
String *order = Total ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve any repeating invoices
[apiInstance getRepeatingInvoicesWith:xeroTenantId
    where:where
    order:order
              completionHandler: ^(RepeatingInvoices 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 where =  'Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"';  // {String} Filter by an any element
const order =  'Total ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getRepeatingInvoices(xeroTenantId,  where, order);
  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 getRepeatingInvoicesExample
    {
        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 where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Total ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve any repeating invoices
                RepeatingInvoices result = apiInstance.getRepeatingInvoices(xeroTenantId, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getRepeatingInvoices: " + 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->getRepeatingInvoices: ', $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 $where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"; # String | Filter by an any element
my $order = Total ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getRepeatingInvoices(xeroTenantId => $xeroTenantId, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getRepeatingInvoices: $@\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)
where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '" # String | Filter by an any element (optional) (default to null)
order = Total ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve any repeating invoices
    api_response = api_instance.get_repeating_invoices(xeroTenantId, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getRepeatingInvoices: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let where = Status=="' + RepeatingInvoice.StatusEnum.DRAFT + '"; // String
    let order = Total ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getRepeatingInvoices(xeroTenantId, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions.read Grant read-only access to invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getReportAgedPayablesByContact

Allows you to retrieve report for AgedPayablesByContact


/Reports/AgedPayablesByContact

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/AgedPayablesByContact?contactId=00000000-0000-0000-000-000000000000&date=2013-10-20&fromDate=2013-10-20&toDate=2013-10-20"
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
        UUID contactId = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        date date = 2013-10-20; // date | The date of the Aged Payables By Contact report
        date fromDate = 2013-10-20; // date | The from date of the Aged Payables By Contact report
        date toDate = 2013-10-20; // date | The to date of the Aged Payables By Contact report
        try {
            ReportWithRows result = apiInstance.getReportAgedPayablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportAgedPayablesByContact");
            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
        UUID contactId = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        date date = 2013-10-20; // date | The date of the Aged Payables By Contact report
        date fromDate = 2013-10-20; // date | The from date of the Aged Payables By Contact report
        date toDate = 2013-10-20; // date | The to date of the Aged Payables By Contact report
        try {
            ReportWithRows result = apiInstance.getReportAgedPayablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportAgedPayablesByContact");
            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)
UUID *contactId = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
date *date = 2013-10-20; // The date of the Aged Payables By Contact report (optional) (default to null)
date *fromDate = 2013-10-20; // The from date of the Aged Payables By Contact report (optional) (default to null)
date *toDate = 2013-10-20; // The to date of the Aged Payables By Contact report (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for AgedPayablesByContact
[apiInstance getReportAgedPayablesByContactWith:xeroTenantId
    contactId:contactId
    date:date
    fromDate:fromDate
    toDate:toDate
              completionHandler: ^(ReportWithRows 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 contactId = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
const date:Date =  new Date("2013-10-20");  // {date} The date of the Aged Payables By Contact report
const fromDate:Date =  new Date("2013-10-20");  // {date} The from date of the Aged Payables By Contact report
const toDate:Date =  new Date("2013-10-20");  // {date} The to date of the Aged Payables By Contact report

try {
  const response: any = await xero.accountingApi.getReportAgedPayablesByContact(xeroTenantId, contactId,  date, fromDate, toDate);
  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 getReportAgedPayablesByContactExample
    {
        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 contactId = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var date = 2013-10-20;  // date | The date of the Aged Payables By Contact report (optional)  (default to null)
            var fromDate = 2013-10-20;  // date | The from date of the Aged Payables By Contact report (optional)  (default to null)
            var toDate = 2013-10-20;  // date | The to date of the Aged Payables By Contact report (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for AgedPayablesByContact
                ReportWithRows result = apiInstance.getReportAgedPayablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportAgedPayablesByContact: " + 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->getReportAgedPayablesByContact: ', $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 $contactId = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $date = 2013-10-20; # date | The date of the Aged Payables By Contact report
my $fromDate = 2013-10-20; # date | The from date of the Aged Payables By Contact report
my $toDate = 2013-10-20; # date | The to date of the Aged Payables By Contact report

eval { 
    my $result = $api_instance->getReportAgedPayablesByContact(xeroTenantId => $xeroTenantId, contactId => $contactId, date => $date, fromDate => $fromDate, toDate => $toDate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportAgedPayablesByContact: $@\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)
contactId = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
date = 2013-10-20 # date | The date of the Aged Payables By Contact report (optional) (default to null)
fromDate = 2013-10-20 # date | The from date of the Aged Payables By Contact report (optional) (default to null)
toDate = 2013-10-20 # date | The to date of the Aged Payables By Contact report (optional) (default to null)

try: 
    # Allows you to retrieve report for AgedPayablesByContact
    api_response = api_instance.get_report_aged_payables_by_contact(xeroTenantId, contactId, date=date, fromDate=fromDate, toDate=toDate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportAgedPayablesByContact: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactId = 00000000-0000-0000-000-000000000000; // UUID
    let date = 2013-10-20; // date
    let fromDate = 2013-10-20; // date
    let toDate = 2013-10-20; // date

    let mut context = AccountingApi::Context::default();
    let result = client.getReportAgedPayablesByContact(xeroTenantId, contactId, date, fromDate, toDate, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
contactId*
UUID (uuid)
Unique identifier for a Contact
Required
date
date (date)
The date of the Aged Payables By Contact report
fromDate
date (date)
The from date of the Aged Payables By Contact report
toDate
date (date)
The to date of the Aged Payables By Contact report

getReportAgedReceivablesByContact

Allows you to retrieve report for AgedReceivablesByContact


/Reports/AgedReceivablesByContact

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/AgedReceivablesByContact?contactId=00000000-0000-0000-000-000000000000&date=2013-10-20&fromDate=2013-10-20&toDate=2013-10-20"
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
        UUID contactId = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        date date = 2013-10-20; // date | The date of the Aged Receivables By Contact report
        date fromDate = 2013-10-20; // date | The from date of the Aged Receivables By Contact report
        date toDate = 2013-10-20; // date | The to date of the Aged Receivables By Contact report
        try {
            ReportWithRows result = apiInstance.getReportAgedReceivablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportAgedReceivablesByContact");
            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
        UUID contactId = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        date date = 2013-10-20; // date | The date of the Aged Receivables By Contact report
        date fromDate = 2013-10-20; // date | The from date of the Aged Receivables By Contact report
        date toDate = 2013-10-20; // date | The to date of the Aged Receivables By Contact report
        try {
            ReportWithRows result = apiInstance.getReportAgedReceivablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportAgedReceivablesByContact");
            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)
UUID *contactId = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
date *date = 2013-10-20; // The date of the Aged Receivables By Contact report (optional) (default to null)
date *fromDate = 2013-10-20; // The from date of the Aged Receivables By Contact report (optional) (default to null)
date *toDate = 2013-10-20; // The to date of the Aged Receivables By Contact report (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for AgedReceivablesByContact
[apiInstance getReportAgedReceivablesByContactWith:xeroTenantId
    contactId:contactId
    date:date
    fromDate:fromDate
    toDate:toDate
              completionHandler: ^(ReportWithRows 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 contactId = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact
const date:Date =  new Date("2013-10-20");  // {date} The date of the Aged Receivables By Contact report
const fromDate:Date =  new Date("2013-10-20");  // {date} The from date of the Aged Receivables By Contact report
const toDate:Date =  new Date("2013-10-20");  // {date} The to date of the Aged Receivables By Contact report

try {
  const response: any = await xero.accountingApi.getReportAgedReceivablesByContact(xeroTenantId, contactId,  date, fromDate, toDate);
  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 getReportAgedReceivablesByContactExample
    {
        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 contactId = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var date = 2013-10-20;  // date | The date of the Aged Receivables By Contact report (optional)  (default to null)
            var fromDate = 2013-10-20;  // date | The from date of the Aged Receivables By Contact report (optional)  (default to null)
            var toDate = 2013-10-20;  // date | The to date of the Aged Receivables By Contact report (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for AgedReceivablesByContact
                ReportWithRows result = apiInstance.getReportAgedReceivablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportAgedReceivablesByContact: " + 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->getReportAgedReceivablesByContact: ', $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 $contactId = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $date = 2013-10-20; # date | The date of the Aged Receivables By Contact report
my $fromDate = 2013-10-20; # date | The from date of the Aged Receivables By Contact report
my $toDate = 2013-10-20; # date | The to date of the Aged Receivables By Contact report

eval { 
    my $result = $api_instance->getReportAgedReceivablesByContact(xeroTenantId => $xeroTenantId, contactId => $contactId, date => $date, fromDate => $fromDate, toDate => $toDate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportAgedReceivablesByContact: $@\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)
contactId = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
date = 2013-10-20 # date | The date of the Aged Receivables By Contact report (optional) (default to null)
fromDate = 2013-10-20 # date | The from date of the Aged Receivables By Contact report (optional) (default to null)
toDate = 2013-10-20 # date | The to date of the Aged Receivables By Contact report (optional) (default to null)

try: 
    # Allows you to retrieve report for AgedReceivablesByContact
    api_response = api_instance.get_report_aged_receivables_by_contact(xeroTenantId, contactId, date=date, fromDate=fromDate, toDate=toDate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportAgedReceivablesByContact: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactId = 00000000-0000-0000-000-000000000000; // UUID
    let date = 2013-10-20; // date
    let fromDate = 2013-10-20; // date
    let toDate = 2013-10-20; // date

    let mut context = AccountingApi::Context::default();
    let result = client.getReportAgedReceivablesByContact(xeroTenantId, contactId, date, fromDate, toDate, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
contactId*
UUID (uuid)
Unique identifier for a Contact
Required
date
date (date)
The date of the Aged Receivables By Contact report
fromDate
date (date)
The from date of the Aged Receivables By Contact report
toDate
date (date)
The to date of the Aged Receivables By Contact report

getReportBASorGST

Allows you to retrieve report for BAS only valid for AU orgs


/Reports/{ReportID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/{ReportID}"
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
        String reportID = 00000000-0000-0000-000-000000000000; // String | Unique identifier for a Report
        try {
            ReportWithRows result = apiInstance.getReportBASorGST(xeroTenantId, reportID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBASorGST");
            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
        String reportID = 00000000-0000-0000-000-000000000000; // String | Unique identifier for a Report
        try {
            ReportWithRows result = apiInstance.getReportBASorGST(xeroTenantId, reportID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBASorGST");
            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)
String *reportID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Report (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for BAS only valid for AU orgs
[apiInstance getReportBASorGSTWith:xeroTenantId
    reportID:reportID
              completionHandler: ^(ReportWithRows 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 reportID = "00000000-0000-0000-000-000000000000";  // {String} Unique identifier for a Report
try {
  const response: any = await xero.accountingApi.getReportBASorGST(xeroTenantId, reportID);
  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 getReportBASorGSTExample
    {
        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 reportID = 00000000-0000-0000-000-000000000000;  // String | Unique identifier for a Report (default to null)

            try
            {
                // Allows you to retrieve report for BAS only valid for AU orgs
                ReportWithRows result = apiInstance.getReportBASorGST(xeroTenantId, reportID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportBASorGST: " + 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->getReportBASorGST: ', $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 $reportID = 00000000-0000-0000-000-000000000000; # String | Unique identifier for a Report

eval { 
    my $result = $api_instance->getReportBASorGST(xeroTenantId => $xeroTenantId, reportID => $reportID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportBASorGST: $@\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)
reportID = 00000000-0000-0000-000-000000000000 # String | Unique identifier for a Report (default to null)

try: 
    # Allows you to retrieve report for BAS only valid for AU orgs
    api_response = api_instance.get_report_ba_sor_gst(xeroTenantId, reportID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportBASorGST: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let reportID = 00000000-0000-0000-000-000000000000; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getReportBASorGST(xeroTenantId, reportID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Path parameters
Name Description
ReportID*
String
Unique identifier for a Report
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getReportBASorGSTList

Allows you to retrieve report for BAS only valid for AU orgs


/Reports

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports"
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
        try {
            ReportWithRows result = apiInstance.getReportBASorGSTList(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBASorGSTList");
            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
        try {
            ReportWithRows result = apiInstance.getReportBASorGSTList(xeroTenantId);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBASorGSTList");
            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)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for BAS only valid for AU orgs
[apiInstance getReportBASorGSTListWith:xeroTenantId
              completionHandler: ^(ReportWithRows 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
try {
  const response: any = await xero.accountingApi.getReportBASorGSTList(xeroTenantId);
  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 getReportBASorGSTListExample
    {
        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)

            try
            {
                // Allows you to retrieve report for BAS only valid for AU orgs
                ReportWithRows result = apiInstance.getReportBASorGSTList(xeroTenantId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportBASorGSTList: " + 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->getReportBASorGSTList: ', $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

eval { 
    my $result = $api_instance->getReportBASorGSTList(xeroTenantId => $xeroTenantId);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportBASorGSTList: $@\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)

try: 
    # Allows you to retrieve report for BAS only valid for AU orgs
    api_response = api_instance.get_report_ba_sor_gst_list(xeroTenantId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportBASorGSTList: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getReportBASorGSTList(xeroTenantId, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getReportBalanceSheet

Allows you to retrieve report for BalanceSheet


/Reports/BalanceSheet

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/BalanceSheet?date=2019-11-01&periods=3&timeframe=MONTH&trackingOptionID1=00000000-0000-0000-000-000000000000&trackingOptionID2=00000000-0000-0000-000-000000000000&standardLayout=true&paymentsOnly=false"
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
        String date = 2019-11-01; // String | The date of the Balance Sheet report
        Integer periods = 3; // Integer | The number of periods for the Balance Sheet report
        String timeframe = MONTH; // String | The period size to compare to (MONTH, QUARTER, YEAR)
        String trackingOptionID1 = 00000000-0000-0000-000-000000000000; // String | The tracking option 1 for the Balance Sheet report
        String trackingOptionID2 = 00000000-0000-0000-000-000000000000; // String | The tracking option 2 for the Balance Sheet report
        Boolean standardLayout = true; // Boolean | The standard layout boolean for the Balance Sheet report
        Boolean paymentsOnly = false; // Boolean | return a cash basis for the Balance Sheet report
        try {
            ReportWithRows result = apiInstance.getReportBalanceSheet(xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBalanceSheet");
            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
        String date = 2019-11-01; // String | The date of the Balance Sheet report
        Integer periods = 3; // Integer | The number of periods for the Balance Sheet report
        String timeframe = MONTH; // String | The period size to compare to (MONTH, QUARTER, YEAR)
        String trackingOptionID1 = 00000000-0000-0000-000-000000000000; // String | The tracking option 1 for the Balance Sheet report
        String trackingOptionID2 = 00000000-0000-0000-000-000000000000; // String | The tracking option 2 for the Balance Sheet report
        Boolean standardLayout = true; // Boolean | The standard layout boolean for the Balance Sheet report
        Boolean paymentsOnly = false; // Boolean | return a cash basis for the Balance Sheet report
        try {
            ReportWithRows result = apiInstance.getReportBalanceSheet(xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBalanceSheet");
            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)
String *date = 2019-11-01; // The date of the Balance Sheet report (optional) (default to null)
Integer *periods = 3; // The number of periods for the Balance Sheet report (optional) (default to null)
String *timeframe = MONTH; // The period size to compare to (MONTH, QUARTER, YEAR) (optional) (default to null)
String *trackingOptionID1 = 00000000-0000-0000-000-000000000000; // The tracking option 1 for the Balance Sheet report (optional) (default to null)
String *trackingOptionID2 = 00000000-0000-0000-000-000000000000; // The tracking option 2 for the Balance Sheet report (optional) (default to null)
Boolean *standardLayout = true; // The standard layout boolean for the Balance Sheet report (optional) (default to null)
Boolean *paymentsOnly = false; // return a cash basis for the Balance Sheet report (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for BalanceSheet
[apiInstance getReportBalanceSheetWith:xeroTenantId
    date:date
    periods:periods
    timeframe:timeframe
    trackingOptionID1:trackingOptionID1
    trackingOptionID2:trackingOptionID2
    standardLayout:standardLayout
    paymentsOnly:paymentsOnly
              completionHandler: ^(ReportWithRows 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 date =  '2019-11-01';  // {String} The date of the Balance Sheet report
const periods =  3;  // {Integer} The number of periods for the Balance Sheet report
const timeframe =  'MONTH';  // {String} The period size to compare to (MONTH, QUARTER, YEAR)
const trackingOptionID1 =  '00000000-0000-0000-000-000000000000';  // {String} The tracking option 1 for the Balance Sheet report
const trackingOptionID2 =  '00000000-0000-0000-000-000000000000';  // {String} The tracking option 2 for the Balance Sheet report
const standardLayout =  true;  // {Boolean} The standard layout boolean for the Balance Sheet report
const paymentsOnly =  false;  // {Boolean} return a cash basis for the Balance Sheet report

try {
  const response: any = await xero.accountingApi.getReportBalanceSheet(xeroTenantId,  date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
  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 getReportBalanceSheetExample
    {
        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 date = 2019-11-01;  // String | The date of the Balance Sheet report (optional)  (default to null)
            var periods = 3;  // Integer | The number of periods for the Balance Sheet report (optional)  (default to null)
            var timeframe = MONTH;  // String | The period size to compare to (MONTH, QUARTER, YEAR) (optional)  (default to null)
            var trackingOptionID1 = 00000000-0000-0000-000-000000000000;  // String | The tracking option 1 for the Balance Sheet report (optional)  (default to null)
            var trackingOptionID2 = 00000000-0000-0000-000-000000000000;  // String | The tracking option 2 for the Balance Sheet report (optional)  (default to null)
            var standardLayout = true;  // Boolean | The standard layout boolean for the Balance Sheet report (optional)  (default to null)
            var paymentsOnly = false;  // Boolean | return a cash basis for the Balance Sheet report (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for BalanceSheet
                ReportWithRows result = apiInstance.getReportBalanceSheet(xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportBalanceSheet: " + 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->getReportBalanceSheet: ', $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 $date = 2019-11-01; # String | The date of the Balance Sheet report
my $periods = 3; # Integer | The number of periods for the Balance Sheet report
my $timeframe = MONTH; # String | The period size to compare to (MONTH, QUARTER, YEAR)
my $trackingOptionID1 = 00000000-0000-0000-000-000000000000; # String | The tracking option 1 for the Balance Sheet report
my $trackingOptionID2 = 00000000-0000-0000-000-000000000000; # String | The tracking option 2 for the Balance Sheet report
my $standardLayout = true; # Boolean | The standard layout boolean for the Balance Sheet report
my $paymentsOnly = false; # Boolean | return a cash basis for the Balance Sheet report

eval { 
    my $result = $api_instance->getReportBalanceSheet(xeroTenantId => $xeroTenantId, date => $date, periods => $periods, timeframe => $timeframe, trackingOptionID1 => $trackingOptionID1, trackingOptionID2 => $trackingOptionID2, standardLayout => $standardLayout, paymentsOnly => $paymentsOnly);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportBalanceSheet: $@\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)
date = 2019-11-01 # String | The date of the Balance Sheet report (optional) (default to null)
periods = 3 # Integer | The number of periods for the Balance Sheet report (optional) (default to null)
timeframe = MONTH # String | The period size to compare to (MONTH, QUARTER, YEAR) (optional) (default to null)
trackingOptionID1 = 00000000-0000-0000-000-000000000000 # String | The tracking option 1 for the Balance Sheet report (optional) (default to null)
trackingOptionID2 = 00000000-0000-0000-000-000000000000 # String | The tracking option 2 for the Balance Sheet report (optional) (default to null)
standardLayout = true # Boolean | The standard layout boolean for the Balance Sheet report (optional) (default to null)
paymentsOnly = false # Boolean | return a cash basis for the Balance Sheet report (optional) (default to null)

try: 
    # Allows you to retrieve report for BalanceSheet
    api_response = api_instance.get_report_balance_sheet(xeroTenantId, date=date, periods=periods, timeframe=timeframe, trackingOptionID1=trackingOptionID1, trackingOptionID2=trackingOptionID2, standardLayout=standardLayout, paymentsOnly=paymentsOnly)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportBalanceSheet: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let date = 2019-11-01; // String
    let periods = 3; // Integer
    let timeframe = MONTH; // String
    let trackingOptionID1 = 00000000-0000-0000-000-000000000000; // String
    let trackingOptionID2 = 00000000-0000-0000-000-000000000000; // String
    let standardLayout = true; // Boolean
    let paymentsOnly = false; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.getReportBalanceSheet(xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
String
The date of the Balance Sheet report
periods
Integer
The number of periods for the Balance Sheet report
timeframe
String
The period size to compare to (MONTH, QUARTER, YEAR)
trackingOptionID1
String
The tracking option 1 for the Balance Sheet report
trackingOptionID2
String
The tracking option 2 for the Balance Sheet report
standardLayout
Boolean
The standard layout boolean for the Balance Sheet report
paymentsOnly
Boolean
return a cash basis for the Balance Sheet report

getReportBankSummary

Allows you to retrieve report for BankSummary


/Reports/BankSummary

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/BankSummary?fromDate=2019-11-01&toDate=2019-11-30"
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 fromDate = 2019-11-01; // date | The from date for the Bank Summary report e.g. 2018-03-31
        date toDate = 2019-11-30; // date | The to date for the Bank Summary report e.g. 2018-03-31
        try {
            ReportWithRows result = apiInstance.getReportBankSummary(xeroTenantId, fromDate, toDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBankSummary");
            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 fromDate = 2019-11-01; // date | The from date for the Bank Summary report e.g. 2018-03-31
        date toDate = 2019-11-30; // date | The to date for the Bank Summary report e.g. 2018-03-31
        try {
            ReportWithRows result = apiInstance.getReportBankSummary(xeroTenantId, fromDate, toDate);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBankSummary");
            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 *fromDate = 2019-11-01; // The from date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)
date *toDate = 2019-11-30; // The to date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for BankSummary
[apiInstance getReportBankSummaryWith:xeroTenantId
    fromDate:fromDate
    toDate:toDate
              completionHandler: ^(ReportWithRows 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 fromDate:Date =  new Date("2019-11-01");  // {date} The from date for the Bank Summary report e.g. 2018-03-31
const toDate:Date =  new Date("2019-11-30");  // {date} The to date for the Bank Summary report e.g. 2018-03-31

try {
  const response: any = await xero.accountingApi.getReportBankSummary(xeroTenantId,  fromDate, toDate);
  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 getReportBankSummaryExample
    {
        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 fromDate = 2019-11-01;  // date | The from date for the Bank Summary report e.g. 2018-03-31 (optional)  (default to null)
            var toDate = 2019-11-30;  // date | The to date for the Bank Summary report e.g. 2018-03-31 (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for BankSummary
                ReportWithRows result = apiInstance.getReportBankSummary(xeroTenantId, fromDate, toDate);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportBankSummary: " + 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->getReportBankSummary: ', $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 $fromDate = 2019-11-01; # date | The from date for the Bank Summary report e.g. 2018-03-31
my $toDate = 2019-11-30; # date | The to date for the Bank Summary report e.g. 2018-03-31

eval { 
    my $result = $api_instance->getReportBankSummary(xeroTenantId => $xeroTenantId, fromDate => $fromDate, toDate => $toDate);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportBankSummary: $@\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)
fromDate = 2019-11-01 # date | The from date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)
toDate = 2019-11-30 # date | The to date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)

try: 
    # Allows you to retrieve report for BankSummary
    api_response = api_instance.get_report_bank_summary(xeroTenantId, fromDate=fromDate, toDate=toDate)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportBankSummary: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let fromDate = 2019-11-01; // date
    let toDate = 2019-11-30; // date

    let mut context = AccountingApi::Context::default();
    let result = client.getReportBankSummary(xeroTenantId, fromDate, toDate, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
fromDate
date (date)
The from date for the Bank Summary report e.g. 2018-03-31
toDate
date (date)
The to date for the Bank Summary report e.g. 2018-03-31

getReportBudgetSummary

Allows you to retrieve report for Budget Summary


/Reports/BudgetSummary

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/BudgetSummary?date=2019-03-31&period=2&timeframe=3"
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 date = 2019-03-31; // date | The date for the Bank Summary report e.g. 2018-03-31
        Integer period = 2; // Integer | The number of periods to compare (integer between 1 and 12)
        Integer timeframe = 3; // Integer | The period size to compare to (1=month, 3=quarter, 12=year)
        try {
            ReportWithRows result = apiInstance.getReportBudgetSummary(xeroTenantId, date, period, timeframe);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBudgetSummary");
            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 date = 2019-03-31; // date | The date for the Bank Summary report e.g. 2018-03-31
        Integer period = 2; // Integer | The number of periods to compare (integer between 1 and 12)
        Integer timeframe = 3; // Integer | The period size to compare to (1=month, 3=quarter, 12=year)
        try {
            ReportWithRows result = apiInstance.getReportBudgetSummary(xeroTenantId, date, period, timeframe);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportBudgetSummary");
            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 *date = 2019-03-31; // The date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)
Integer *period = 2; // The number of periods to compare (integer between 1 and 12) (optional) (default to null)
Integer *timeframe = 3; // The period size to compare to (1=month, 3=quarter, 12=year) (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for Budget Summary
[apiInstance getReportBudgetSummaryWith:xeroTenantId
    date:date
    period:period
    timeframe:timeframe
              completionHandler: ^(ReportWithRows 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 date:Date =  new Date("2019-03-31");  // {date} The date for the Bank Summary report e.g. 2018-03-31
const period =  2;  // {Integer} The number of periods to compare (integer between 1 and 12)
const timeframe =  3;  // {Integer} The period size to compare to (1=month, 3=quarter, 12=year)

try {
  const response: any = await xero.accountingApi.getReportBudgetSummary(xeroTenantId,  date, period, timeframe);
  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 getReportBudgetSummaryExample
    {
        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 date = 2019-03-31;  // date | The date for the Bank Summary report e.g. 2018-03-31 (optional)  (default to null)
            var period = 2;  // Integer | The number of periods to compare (integer between 1 and 12) (optional)  (default to null)
            var timeframe = 3;  // Integer | The period size to compare to (1=month, 3=quarter, 12=year) (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for Budget Summary
                ReportWithRows result = apiInstance.getReportBudgetSummary(xeroTenantId, date, period, timeframe);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportBudgetSummary: " + 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->getReportBudgetSummary: ', $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 $date = 2019-03-31; # date | The date for the Bank Summary report e.g. 2018-03-31
my $period = 2; # Integer | The number of periods to compare (integer between 1 and 12)
my $timeframe = 3; # Integer | The period size to compare to (1=month, 3=quarter, 12=year)

eval { 
    my $result = $api_instance->getReportBudgetSummary(xeroTenantId => $xeroTenantId, date => $date, period => $period, timeframe => $timeframe);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportBudgetSummary: $@\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)
date = 2019-03-31 # date | The date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)
period = 2 # Integer | The number of periods to compare (integer between 1 and 12) (optional) (default to null)
timeframe = 3 # Integer | The period size to compare to (1=month, 3=quarter, 12=year) (optional) (default to null)

try: 
    # Allows you to retrieve report for Budget Summary
    api_response = api_instance.get_report_budget_summary(xeroTenantId, date=date, period=period, timeframe=timeframe)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportBudgetSummary: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let date = 2019-03-31; // date
    let period = 2; // Integer
    let timeframe = 3; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.getReportBudgetSummary(xeroTenantId, date, period, timeframe, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date for the Bank Summary report e.g. 2018-03-31
period
Integer
The number of periods to compare (integer between 1 and 12)
timeframe
Integer
The period size to compare to (1=month, 3=quarter, 12=year)

getReportExecutiveSummary

Allows you to retrieve report for ExecutiveSummary


/Reports/ExecutiveSummary

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/ExecutiveSummary?date=2019-03-31"
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 date = 2019-03-31; // date | The date for the Bank Summary report e.g. 2018-03-31
        try {
            ReportWithRows result = apiInstance.getReportExecutiveSummary(xeroTenantId, date);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportExecutiveSummary");
            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 date = 2019-03-31; // date | The date for the Bank Summary report e.g. 2018-03-31
        try {
            ReportWithRows result = apiInstance.getReportExecutiveSummary(xeroTenantId, date);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportExecutiveSummary");
            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 *date = 2019-03-31; // The date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for ExecutiveSummary
[apiInstance getReportExecutiveSummaryWith:xeroTenantId
    date:date
              completionHandler: ^(ReportWithRows 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 date:Date =  new Date("2019-03-31");  // {date} The date for the Bank Summary report e.g. 2018-03-31

try {
  const response: any = await xero.accountingApi.getReportExecutiveSummary(xeroTenantId,  date);
  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 getReportExecutiveSummaryExample
    {
        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 date = 2019-03-31;  // date | The date for the Bank Summary report e.g. 2018-03-31 (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for ExecutiveSummary
                ReportWithRows result = apiInstance.getReportExecutiveSummary(xeroTenantId, date);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportExecutiveSummary: " + 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->getReportExecutiveSummary: ', $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 $date = 2019-03-31; # date | The date for the Bank Summary report e.g. 2018-03-31

eval { 
    my $result = $api_instance->getReportExecutiveSummary(xeroTenantId => $xeroTenantId, date => $date);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportExecutiveSummary: $@\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)
date = 2019-03-31 # date | The date for the Bank Summary report e.g. 2018-03-31 (optional) (default to null)

try: 
    # Allows you to retrieve report for ExecutiveSummary
    api_response = api_instance.get_report_executive_summary(xeroTenantId, date=date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportExecutiveSummary: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let date = 2019-03-31; // date

    let mut context = AccountingApi::Context::default();
    let result = client.getReportExecutiveSummary(xeroTenantId, date, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date for the Bank Summary report e.g. 2018-03-31

getReportProfitAndLoss

Allows you to retrieve report for ProfitAndLoss


/Reports/ProfitAndLoss

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=2019-03-01&toDate=2019-03-31&periods=3&timeframe=MONTH&trackingCategoryID=00000000-0000-0000-000-000000000000&trackingCategoryID2=00000000-0000-0000-000-000000000000&trackingOptionID=00000000-0000-0000-000-000000000000&trackingOptionID2=00000000-0000-0000-000-000000000000&standardLayout=true&paymentsOnly=false"
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 fromDate = 2019-03-01; // date | The from date for the ProfitAndLoss report e.g. 2018-03-31
        date toDate = 2019-03-31; // date | The to date for the ProfitAndLoss report e.g. 2018-03-31
        Integer periods = 3; // Integer | The number of periods to compare (integer between 1 and 12)
        String timeframe = MONTH; // String | The period size to compare to (MONTH, QUARTER, YEAR)
        String trackingCategoryID = 00000000-0000-0000-000-000000000000; // String | The trackingCategory 1 for the ProfitAndLoss report
        String trackingCategoryID2 = 00000000-0000-0000-000-000000000000; // String | The trackingCategory 2 for the ProfitAndLoss report
        String trackingOptionID = 00000000-0000-0000-000-000000000000; // String | The tracking option 1 for the ProfitAndLoss report
        String trackingOptionID2 = 00000000-0000-0000-000-000000000000; // String | The tracking option 2 for the ProfitAndLoss report
        Boolean standardLayout = true; // Boolean | Return the standard layout for the ProfitAndLoss report
        Boolean paymentsOnly = false; // Boolean | Return cash only basis for the ProfitAndLoss report
        try {
            ReportWithRows result = apiInstance.getReportProfitAndLoss(xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportProfitAndLoss");
            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 fromDate = 2019-03-01; // date | The from date for the ProfitAndLoss report e.g. 2018-03-31
        date toDate = 2019-03-31; // date | The to date for the ProfitAndLoss report e.g. 2018-03-31
        Integer periods = 3; // Integer | The number of periods to compare (integer between 1 and 12)
        String timeframe = MONTH; // String | The period size to compare to (MONTH, QUARTER, YEAR)
        String trackingCategoryID = 00000000-0000-0000-000-000000000000; // String | The trackingCategory 1 for the ProfitAndLoss report
        String trackingCategoryID2 = 00000000-0000-0000-000-000000000000; // String | The trackingCategory 2 for the ProfitAndLoss report
        String trackingOptionID = 00000000-0000-0000-000-000000000000; // String | The tracking option 1 for the ProfitAndLoss report
        String trackingOptionID2 = 00000000-0000-0000-000-000000000000; // String | The tracking option 2 for the ProfitAndLoss report
        Boolean standardLayout = true; // Boolean | Return the standard layout for the ProfitAndLoss report
        Boolean paymentsOnly = false; // Boolean | Return cash only basis for the ProfitAndLoss report
        try {
            ReportWithRows result = apiInstance.getReportProfitAndLoss(xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportProfitAndLoss");
            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 *fromDate = 2019-03-01; // The from date for the ProfitAndLoss report e.g. 2018-03-31 (optional) (default to null)
date *toDate = 2019-03-31; // The to date for the ProfitAndLoss report e.g. 2018-03-31 (optional) (default to null)
Integer *periods = 3; // The number of periods to compare (integer between 1 and 12) (optional) (default to null)
String *timeframe = MONTH; // The period size to compare to (MONTH, QUARTER, YEAR) (optional) (default to null)
String *trackingCategoryID = 00000000-0000-0000-000-000000000000; // The trackingCategory 1 for the ProfitAndLoss report (optional) (default to null)
String *trackingCategoryID2 = 00000000-0000-0000-000-000000000000; // The trackingCategory 2 for the ProfitAndLoss report (optional) (default to null)
String *trackingOptionID = 00000000-0000-0000-000-000000000000; // The tracking option 1 for the ProfitAndLoss report (optional) (default to null)
String *trackingOptionID2 = 00000000-0000-0000-000-000000000000; // The tracking option 2 for the ProfitAndLoss report (optional) (default to null)
Boolean *standardLayout = true; // Return the standard layout for the ProfitAndLoss report (optional) (default to null)
Boolean *paymentsOnly = false; // Return cash only basis for the ProfitAndLoss report (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for ProfitAndLoss
[apiInstance getReportProfitAndLossWith:xeroTenantId
    fromDate:fromDate
    toDate:toDate
    periods:periods
    timeframe:timeframe
    trackingCategoryID:trackingCategoryID
    trackingCategoryID2:trackingCategoryID2
    trackingOptionID:trackingOptionID
    trackingOptionID2:trackingOptionID2
    standardLayout:standardLayout
    paymentsOnly:paymentsOnly
              completionHandler: ^(ReportWithRows 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 fromDate:Date =  new Date("2019-03-01");  // {date} The from date for the ProfitAndLoss report e.g. 2018-03-31
const toDate:Date =  new Date("2019-03-31");  // {date} The to date for the ProfitAndLoss report e.g. 2018-03-31
const periods =  3;  // {Integer} The number of periods to compare (integer between 1 and 12)
const timeframe =  'MONTH';  // {String} The period size to compare to (MONTH, QUARTER, YEAR)
const trackingCategoryID =  '00000000-0000-0000-000-000000000000';  // {String} The trackingCategory 1 for the ProfitAndLoss report
const trackingCategoryID2 =  '00000000-0000-0000-000-000000000000';  // {String} The trackingCategory 2 for the ProfitAndLoss report
const trackingOptionID =  '00000000-0000-0000-000-000000000000';  // {String} The tracking option 1 for the ProfitAndLoss report
const trackingOptionID2 =  '00000000-0000-0000-000-000000000000';  // {String} The tracking option 2 for the ProfitAndLoss report
const standardLayout =  true;  // {Boolean} Return the standard layout for the ProfitAndLoss report
const paymentsOnly =  false;  // {Boolean} Return cash only basis for the ProfitAndLoss report

try {
  const response: any = await xero.accountingApi.getReportProfitAndLoss(xeroTenantId,  fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
  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 getReportProfitAndLossExample
    {
        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 fromDate = 2019-03-01;  // date | The from date for the ProfitAndLoss report e.g. 2018-03-31 (optional)  (default to null)
            var toDate = 2019-03-31;  // date | The to date for the ProfitAndLoss report e.g. 2018-03-31 (optional)  (default to null)
            var periods = 3;  // Integer | The number of periods to compare (integer between 1 and 12) (optional)  (default to null)
            var timeframe = MONTH;  // String | The period size to compare to (MONTH, QUARTER, YEAR) (optional)  (default to null)
            var trackingCategoryID = 00000000-0000-0000-000-000000000000;  // String | The trackingCategory 1 for the ProfitAndLoss report (optional)  (default to null)
            var trackingCategoryID2 = 00000000-0000-0000-000-000000000000;  // String | The trackingCategory 2 for the ProfitAndLoss report (optional)  (default to null)
            var trackingOptionID = 00000000-0000-0000-000-000000000000;  // String | The tracking option 1 for the ProfitAndLoss report (optional)  (default to null)
            var trackingOptionID2 = 00000000-0000-0000-000-000000000000;  // String | The tracking option 2 for the ProfitAndLoss report (optional)  (default to null)
            var standardLayout = true;  // Boolean | Return the standard layout for the ProfitAndLoss report (optional)  (default to null)
            var paymentsOnly = false;  // Boolean | Return cash only basis for the ProfitAndLoss report (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for ProfitAndLoss
                ReportWithRows result = apiInstance.getReportProfitAndLoss(xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportProfitAndLoss: " + 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->getReportProfitAndLoss: ', $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 $fromDate = 2019-03-01; # date | The from date for the ProfitAndLoss report e.g. 2018-03-31
my $toDate = 2019-03-31; # date | The to date for the ProfitAndLoss report e.g. 2018-03-31
my $periods = 3; # Integer | The number of periods to compare (integer between 1 and 12)
my $timeframe = MONTH; # String | The period size to compare to (MONTH, QUARTER, YEAR)
my $trackingCategoryID = 00000000-0000-0000-000-000000000000; # String | The trackingCategory 1 for the ProfitAndLoss report
my $trackingCategoryID2 = 00000000-0000-0000-000-000000000000; # String | The trackingCategory 2 for the ProfitAndLoss report
my $trackingOptionID = 00000000-0000-0000-000-000000000000; # String | The tracking option 1 for the ProfitAndLoss report
my $trackingOptionID2 = 00000000-0000-0000-000-000000000000; # String | The tracking option 2 for the ProfitAndLoss report
my $standardLayout = true; # Boolean | Return the standard layout for the ProfitAndLoss report
my $paymentsOnly = false; # Boolean | Return cash only basis for the ProfitAndLoss report

eval { 
    my $result = $api_instance->getReportProfitAndLoss(xeroTenantId => $xeroTenantId, fromDate => $fromDate, toDate => $toDate, periods => $periods, timeframe => $timeframe, trackingCategoryID => $trackingCategoryID, trackingCategoryID2 => $trackingCategoryID2, trackingOptionID => $trackingOptionID, trackingOptionID2 => $trackingOptionID2, standardLayout => $standardLayout, paymentsOnly => $paymentsOnly);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportProfitAndLoss: $@\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)
fromDate = 2019-03-01 # date | The from date for the ProfitAndLoss report e.g. 2018-03-31 (optional) (default to null)
toDate = 2019-03-31 # date | The to date for the ProfitAndLoss report e.g. 2018-03-31 (optional) (default to null)
periods = 3 # Integer | The number of periods to compare (integer between 1 and 12) (optional) (default to null)
timeframe = MONTH # String | The period size to compare to (MONTH, QUARTER, YEAR) (optional) (default to null)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # String | The trackingCategory 1 for the ProfitAndLoss report (optional) (default to null)
trackingCategoryID2 = 00000000-0000-0000-000-000000000000 # String | The trackingCategory 2 for the ProfitAndLoss report (optional) (default to null)
trackingOptionID = 00000000-0000-0000-000-000000000000 # String | The tracking option 1 for the ProfitAndLoss report (optional) (default to null)
trackingOptionID2 = 00000000-0000-0000-000-000000000000 # String | The tracking option 2 for the ProfitAndLoss report (optional) (default to null)
standardLayout = true # Boolean | Return the standard layout for the ProfitAndLoss report (optional) (default to null)
paymentsOnly = false # Boolean | Return cash only basis for the ProfitAndLoss report (optional) (default to null)

try: 
    # Allows you to retrieve report for ProfitAndLoss
    api_response = api_instance.get_report_profit_and_loss(xeroTenantId, fromDate=fromDate, toDate=toDate, periods=periods, timeframe=timeframe, trackingCategoryID=trackingCategoryID, trackingCategoryID2=trackingCategoryID2, trackingOptionID=trackingOptionID, trackingOptionID2=trackingOptionID2, standardLayout=standardLayout, paymentsOnly=paymentsOnly)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportProfitAndLoss: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let fromDate = 2019-03-01; // date
    let toDate = 2019-03-31; // date
    let periods = 3; // Integer
    let timeframe = MONTH; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // String
    let trackingCategoryID2 = 00000000-0000-0000-000-000000000000; // String
    let trackingOptionID = 00000000-0000-0000-000-000000000000; // String
    let trackingOptionID2 = 00000000-0000-0000-000-000000000000; // String
    let standardLayout = true; // Boolean
    let paymentsOnly = false; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.getReportProfitAndLoss(xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
fromDate
date (date)
The from date for the ProfitAndLoss report e.g. 2018-03-31
toDate
date (date)
The to date for the ProfitAndLoss report e.g. 2018-03-31
periods
Integer
The number of periods to compare (integer between 1 and 12)
timeframe
String
The period size to compare to (MONTH, QUARTER, YEAR)
trackingCategoryID
String
The trackingCategory 1 for the ProfitAndLoss report
trackingCategoryID2
String
The trackingCategory 2 for the ProfitAndLoss report
trackingOptionID
String
The tracking option 1 for the ProfitAndLoss report
trackingOptionID2
String
The tracking option 2 for the ProfitAndLoss report
standardLayout
Boolean
Return the standard layout for the ProfitAndLoss report
paymentsOnly
Boolean
Return cash only basis for the ProfitAndLoss report

getReportTenNinetyNine

Allows you to retrieve report for TenNinetyNine


/Reports/TenNinetyNine

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/TenNinetyNine?reportYear=2019"
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
        String reportYear = 2019; // String | The year of the 1099 report
        try {
            Reports result = apiInstance.getReportTenNinetyNine(xeroTenantId, reportYear);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportTenNinetyNine");
            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
        String reportYear = 2019; // String | The year of the 1099 report
        try {
            Reports result = apiInstance.getReportTenNinetyNine(xeroTenantId, reportYear);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportTenNinetyNine");
            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)
String *reportYear = 2019; // The year of the 1099 report (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for TenNinetyNine
[apiInstance getReportTenNinetyNineWith:xeroTenantId
    reportYear:reportYear
              completionHandler: ^(Reports 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 reportYear =  '2019';  // {String} The year of the 1099 report

try {
  const response: any = await xero.accountingApi.getReportTenNinetyNine(xeroTenantId,  reportYear);
  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 getReportTenNinetyNineExample
    {
        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 reportYear = 2019;  // String | The year of the 1099 report (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for TenNinetyNine
                Reports result = apiInstance.getReportTenNinetyNine(xeroTenantId, reportYear);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportTenNinetyNine: " + 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->getReportTenNinetyNine: ', $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 $reportYear = 2019; # String | The year of the 1099 report

eval { 
    my $result = $api_instance->getReportTenNinetyNine(xeroTenantId => $xeroTenantId, reportYear => $reportYear);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportTenNinetyNine: $@\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)
reportYear = 2019 # String | The year of the 1099 report (optional) (default to null)

try: 
    # Allows you to retrieve report for TenNinetyNine
    api_response = api_instance.get_report_ten_ninety_nine(xeroTenantId, reportYear=reportYear)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportTenNinetyNine: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let reportYear = 2019; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getReportTenNinetyNine(xeroTenantId, reportYear, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
reportYear
String
The year of the 1099 report

getReportTrialBalance

Allows you to retrieve report for TrialBalance


/Reports/TrialBalance

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Reports/TrialBalance?date=2019-10-31&paymentsOnly=true"
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 date = 2019-10-31; // date | The date for the Trial Balance report e.g. 2018-03-31
        Boolean paymentsOnly = true; // Boolean | Return cash only basis for the Trial Balance report
        try {
            ReportWithRows result = apiInstance.getReportTrialBalance(xeroTenantId, date, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportTrialBalance");
            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 date = 2019-10-31; // date | The date for the Trial Balance report e.g. 2018-03-31
        Boolean paymentsOnly = true; // Boolean | Return cash only basis for the Trial Balance report
        try {
            ReportWithRows result = apiInstance.getReportTrialBalance(xeroTenantId, date, paymentsOnly);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getReportTrialBalance");
            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 *date = 2019-10-31; // The date for the Trial Balance report e.g. 2018-03-31 (optional) (default to null)
Boolean *paymentsOnly = true; // Return cash only basis for the Trial Balance report (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve report for TrialBalance
[apiInstance getReportTrialBalanceWith:xeroTenantId
    date:date
    paymentsOnly:paymentsOnly
              completionHandler: ^(ReportWithRows 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 date:Date =  new Date("2019-10-31");  // {date} The date for the Trial Balance report e.g. 2018-03-31
const paymentsOnly =  true;  // {Boolean} Return cash only basis for the Trial Balance report

try {
  const response: any = await xero.accountingApi.getReportTrialBalance(xeroTenantId,  date, paymentsOnly);
  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 getReportTrialBalanceExample
    {
        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 date = 2019-10-31;  // date | The date for the Trial Balance report e.g. 2018-03-31 (optional)  (default to null)
            var paymentsOnly = true;  // Boolean | Return cash only basis for the Trial Balance report (optional)  (default to null)

            try
            {
                // Allows you to retrieve report for TrialBalance
                ReportWithRows result = apiInstance.getReportTrialBalance(xeroTenantId, date, paymentsOnly);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getReportTrialBalance: " + 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->getReportTrialBalance: ', $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 $date = 2019-10-31; # date | The date for the Trial Balance report e.g. 2018-03-31
my $paymentsOnly = true; # Boolean | Return cash only basis for the Trial Balance report

eval { 
    my $result = $api_instance->getReportTrialBalance(xeroTenantId => $xeroTenantId, date => $date, paymentsOnly => $paymentsOnly);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getReportTrialBalance: $@\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)
date = 2019-10-31 # date | The date for the Trial Balance report e.g. 2018-03-31 (optional) (default to null)
paymentsOnly = true # Boolean | Return cash only basis for the Trial Balance report (optional) (default to null)

try: 
    # Allows you to retrieve report for TrialBalance
    api_response = api_instance.get_report_trial_balance(xeroTenantId, date=date, paymentsOnly=paymentsOnly)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getReportTrialBalance: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let date = 2019-10-31; // date
    let paymentsOnly = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.getReportTrialBalance(xeroTenantId, date, paymentsOnly, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.reports.read Grant read-only access to accounting reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date for the Trial Balance report e.g. 2018-03-31
paymentsOnly
Boolean
Return cash only basis for the Trial Balance report

getTaxRates

Allows you to retrieve Tax Rates


/TaxRates

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TaxRates?where=Status=="' + TaxRate.StatusEnum.ACTIVE + '"&order=Name ASC&TaxType=INPUT"
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
        String where = Status=="' + TaxRate.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        String taxType = INPUT; // String | Filter by tax type
        try {
            TaxRates result = apiInstance.getTaxRates(xeroTenantId, where, order, taxType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getTaxRates");
            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
        String where = Status=="' + TaxRate.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        String taxType = INPUT; // String | Filter by tax type
        try {
            TaxRates result = apiInstance.getTaxRates(xeroTenantId, where, order, taxType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getTaxRates");
            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)
String *where = Status=="' + TaxRate.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Name ASC; // Order by an any element (optional) (default to null)
String *taxType = INPUT; // Filter by tax type (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve Tax Rates
[apiInstance getTaxRatesWith:xeroTenantId
    where:where
    order:order
    taxType:taxType
              completionHandler: ^(TaxRates 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 where =  'Status=="' + TaxRate.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Name ASC';  // {String} Order by an any element
const taxType =  'INPUT';  // {String} Filter by tax type

try {
  const response: any = await xero.accountingApi.getTaxRates(xeroTenantId,  where, order, taxType);
  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 getTaxRatesExample
    {
        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 where = Status=="' + TaxRate.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Name ASC;  // String | Order by an any element (optional)  (default to null)
            var taxType = INPUT;  // String | Filter by tax type (optional)  (default to null)

            try
            {
                // Allows you to retrieve Tax Rates
                TaxRates result = apiInstance.getTaxRates(xeroTenantId, where, order, taxType);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getTaxRates: " + 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->getTaxRates: ', $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 $where = Status=="' + TaxRate.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Name ASC; # String | Order by an any element
my $taxType = INPUT; # String | Filter by tax type

eval { 
    my $result = $api_instance->getTaxRates(xeroTenantId => $xeroTenantId, where => $where, order => $order, taxType => $taxType);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getTaxRates: $@\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)
where = Status=="' + TaxRate.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Name ASC # String | Order by an any element (optional) (default to null)
taxType = INPUT # String | Filter by tax type (optional) (default to null)

try: 
    # Allows you to retrieve Tax Rates
    api_response = api_instance.get_tax_rates(xeroTenantId, where=where, order=order, taxType=taxType)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getTaxRates: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let where = Status=="' + TaxRate.StatusEnum.ACTIVE + '"; // String
    let order = Name ASC; // String
    let taxType = INPUT; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getTaxRates(xeroTenantId, where, order, taxType, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
TaxType
String
Filter by tax type

getTrackingCategories

Allows you to retrieve tracking categories and options


/TrackingCategories

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories?where=Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"&order=Name ASC&includeArchived=true"
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
        String where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response
        try {
            TrackingCategories result = apiInstance.getTrackingCategories(xeroTenantId, where, order, includeArchived);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getTrackingCategories");
            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
        String where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"; // String | Filter by an any element
        String order = Name ASC; // String | Order by an any element
        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response
        try {
            TrackingCategories result = apiInstance.getTrackingCategories(xeroTenantId, where, order, includeArchived);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getTrackingCategories");
            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)
String *where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"; // Filter by an any element (optional) (default to null)
String *order = Name ASC; // Order by an any element (optional) (default to null)
Boolean *includeArchived = true; // e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve tracking categories and options
[apiInstance getTrackingCategoriesWith:xeroTenantId
    where:where
    order:order
    includeArchived:includeArchived
              completionHandler: ^(TrackingCategories 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 where =  'Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"';  // {String} Filter by an any element
const order =  'Name ASC';  // {String} Order by an any element
const includeArchived =  true;  // {Boolean} e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response

try {
  const response: any = await xero.accountingApi.getTrackingCategories(xeroTenantId,  where, order, includeArchived);
  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 getTrackingCategoriesExample
    {
        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 where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '";  // String | Filter by an any element (optional)  (default to null)
            var order = Name ASC;  // String | Order by an any element (optional)  (default to null)
            var includeArchived = true;  // Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response (optional)  (default to null)

            try
            {
                // Allows you to retrieve tracking categories and options
                TrackingCategories result = apiInstance.getTrackingCategories(xeroTenantId, where, order, includeArchived);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getTrackingCategories: " + 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->getTrackingCategories: ', $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 $where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"; # String | Filter by an any element
my $order = Name ASC; # String | Order by an any element
my $includeArchived = true; # Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response

eval { 
    my $result = $api_instance->getTrackingCategories(xeroTenantId => $xeroTenantId, where => $where, order => $order, includeArchived => $includeArchived);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getTrackingCategories: $@\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)
where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '" # String | Filter by an any element (optional) (default to null)
order = Name ASC # String | Order by an any element (optional) (default to null)
includeArchived = true # Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response (optional) (default to null)

try: 
    # Allows you to retrieve tracking categories and options
    api_response = api_instance.get_tracking_categories(xeroTenantId, where=where, order=order, includeArchived=includeArchived)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getTrackingCategories: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let where = Status=="' + TrackingCategory.StatusEnum.ACTIVE + '"; // String
    let order = Name ASC; // String
    let includeArchived = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.getTrackingCategories(xeroTenantId, where, order, includeArchived, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
includeArchived
Boolean
e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response

getTrackingCategory

Allows you to retrieve tracking categories and options for specified category


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        try {
            TrackingCategories result = apiInstance.getTrackingCategory(xeroTenantId, trackingCategoryID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getTrackingCategory");
            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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        try {
            TrackingCategories result = apiInstance.getTrackingCategory(xeroTenantId, trackingCategoryID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getTrackingCategory");
            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)
UUID *trackingCategoryID = 00000000-0000-0000-000-000000000000; // Unique identifier for a TrackingCategory (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve tracking categories and options for specified category
[apiInstance getTrackingCategoryWith:xeroTenantId
    trackingCategoryID:trackingCategoryID
              completionHandler: ^(TrackingCategories 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 trackingCategoryID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a TrackingCategory
try {
  const response: any = await xero.accountingApi.getTrackingCategory(xeroTenantId, trackingCategoryID);
  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 getTrackingCategoryExample
    {
        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 trackingCategoryID = new UUID(); // UUID | Unique identifier for a TrackingCategory (default to null)

            try
            {
                // Allows you to retrieve tracking categories and options for specified category
                TrackingCategories result = apiInstance.getTrackingCategory(xeroTenantId, trackingCategoryID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getTrackingCategory: " + 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->getTrackingCategory: ', $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 $trackingCategoryID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a TrackingCategory

eval { 
    my $result = $api_instance->getTrackingCategory(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getTrackingCategory: $@\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)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a TrackingCategory (default to null)

try: 
    # Allows you to retrieve tracking categories and options for specified category
    api_response = api_instance.get_tracking_category(xeroTenantId, trackingCategoryID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getTrackingCategory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getTrackingCategory(xeroTenantId, trackingCategoryID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getUser

Allows you to retrieve a specified user


/Users/{UserID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Users/{UserID}"
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
        UUID userID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a User
        try {
            Users result = apiInstance.getUser(xeroTenantId, userID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getUser");
            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
        UUID userID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a User
        try {
            Users result = apiInstance.getUser(xeroTenantId, userID);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getUser");
            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)
UUID *userID = 00000000-0000-0000-000-000000000000; // Unique identifier for a User (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve a specified user
[apiInstance getUserWith:xeroTenantId
    userID:userID
              completionHandler: ^(Users 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 userID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a User
try {
  const response: any = await xero.accountingApi.getUser(xeroTenantId, userID);
  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 getUserExample
    {
        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 userID = new UUID(); // UUID | Unique identifier for a User (default to null)

            try
            {
                // Allows you to retrieve a specified user
                Users result = apiInstance.getUser(xeroTenantId, userID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getUser: " + 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->getUser: ', $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 $userID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a User

eval { 
    my $result = $api_instance->getUser(xeroTenantId => $xeroTenantId, userID => $userID);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getUser: $@\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)
userID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a User (default to null)

try: 
    # Allows you to retrieve a specified user
    api_response = api_instance.get_user(xeroTenantId, userID)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getUser: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let userID = 00000000-0000-0000-000-000000000000; // UUID

    let mut context = AccountingApi::Context::default();
    let result = client.getUser(xeroTenantId, userID, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Path parameters
Name Description
UserID*
UUID (uuid)
Unique identifier for a User
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getUsers

Allows you to retrieve users


/Users

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Users?where=IsSubscriber==true&order=LastName ASC"
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 = IsSubscriber==true; // String | Filter by an any element
        String order = LastName ASC; // String | Order by an any element
        try {
            Users result = apiInstance.getUsers(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getUsers");
            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 = IsSubscriber==true; // String | Filter by an any element
        String order = LastName ASC; // String | Order by an any element
        try {
            Users result = apiInstance.getUsers(xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#getUsers");
            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 = IsSubscriber==true; // Filter by an any element (optional) (default to null)
String *order = LastName ASC; // Order by an any element (optional) (default to null)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to retrieve users
[apiInstance getUsersWith:xeroTenantId
    ifModifiedSince:ifModifiedSince
    where:where
    order:order
              completionHandler: ^(Users 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 =  'IsSubscriber==true';  // {String} Filter by an any element
const order =  'LastName ASC';  // {String} Order by an any element

try {
  const response: any = await xero.accountingApi.getUsers(xeroTenantId, ifModifiedSince, where, order);
  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 getUsersExample
    {
        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 = IsSubscriber==true;  // String | Filter by an any element (optional)  (default to null)
            var order = LastName ASC;  // String | Order by an any element (optional)  (default to null)

            try
            {
                // Allows you to retrieve users
                Users result = apiInstance.getUsers(xeroTenantId, ifModifiedSince, where, order);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.getUsers: " + 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->getUsers: ', $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 = IsSubscriber==true; # String | Filter by an any element
my $order = LastName ASC; # String | Order by an any element

eval { 
    my $result = $api_instance->getUsers(xeroTenantId => $xeroTenantId, ifModifiedSince => $ifModifiedSince, where => $where, order => $order);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->getUsers: $@\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 = IsSubscriber==true # String | Filter by an any element (optional) (default to null)
order = LastName ASC # String | Order by an any element (optional) (default to null)

try: 
    # Allows you to retrieve users
    api_response = api_instance.get_users(xeroTenantId, ifModifiedSince=ifModifiedSince, where=where, order=order)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->getUsers: %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 = IsSubscriber==true; // String
    let order = LastName ASC; // String

    let mut context = AccountingApi::Context::default();
    let result = client.getUsers(xeroTenantId, ifModifiedSince, where, order, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings.read Grant read-only access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

updateAccount

Allows you to update a chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for retrieving single object
        Accounts accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] }; // Accounts | 
        try {
            Accounts result = apiInstance.updateAccount(xeroTenantId, accountID, accounts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateAccount");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for retrieving single object
        Accounts accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] }; // Accounts | 
        try {
            Accounts result = apiInstance.updateAccount(xeroTenantId, accountID, accounts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateAccount");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for retrieving single object (default to null)
Accounts *accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a chart of accounts
[apiInstance updateAccountWith:xeroTenantId
    accountID:accountID
    accounts:accounts
              completionHandler: ^(Accounts 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for retrieving single object 
const accounts:Accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] };  // {Accounts} 
try {
  const response: any = await xero.accountingApi.updateAccount(xeroTenantId, accountID, accounts);
  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 updateAccountExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for retrieving single object (default to null)
            var accounts = new Accounts(); // Accounts | 

            try
            {
                // Allows you to update a chart of accounts
                Accounts result = apiInstance.updateAccount(xeroTenantId, accountID, accounts);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateAccount: " + 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->updateAccount: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for retrieving single object
my $accounts = ::Object::Accounts->new(); # Accounts | 

eval { 
    my $result = $api_instance->updateAccount(xeroTenantId => $xeroTenantId, accountID => $accountID, accounts => $accounts);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateAccount: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for retrieving single object (default to null)
accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] } # Accounts | 

try: 
    # Allows you to update a chart of accounts
    api_response = api_instance.update_account(xeroTenantId, accountID, accounts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateAccount: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID
    let accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] }; // Accounts

    let mut context = AccountingApi::Context::default();
    let result = client.updateAccount(xeroTenantId, accountID, accounts, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for retrieving single object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
accounts *
Accounts
Request of type Accounts array with one Account
Required

updateAccountAttachmentByFileName

Allows you to update Attachment on Account by Filename


/Accounts/{AccountID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{FileName}"
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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateAccountAttachmentByFileName");
            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
        UUID accountID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Account object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateAccountAttachmentByFileName");
            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)
UUID *accountID = 00000000-0000-0000-000-000000000000; // Unique identifier for Account object (default to null)
String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update Attachment on Account by Filename
[apiInstance updateAccountAttachmentByFileNameWith:xeroTenantId
    accountID:accountID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 accountID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Account object 
const fileName = "xero-dev.jpg";  // {String} Name of the attachment 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateAccountAttachmentByFileNameExample
    {
        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 accountID = new UUID(); // UUID | Unique identifier for Account object (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the attachment (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update Attachment on Account by Filename
                Attachments result = apiInstance.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateAccountAttachmentByFileName: " + 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->updateAccountAttachmentByFileName: ', $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 $accountID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Account object
my $fileName = xero-dev.jpg; # String | Name of the attachment
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateAccountAttachmentByFileName(xeroTenantId => $xeroTenantId, accountID => $accountID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateAccountAttachmentByFileName: $@\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)
accountID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Account object (default to null)
fileName = xero-dev.jpg # String | Name of the attachment (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update Attachment on Account by Filename
    api_response = api_instance.update_account_attachment_by_file_name(xeroTenantId, accountID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateAccountAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let accountID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for Account object
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateBankTransaction

Allows you to update a single spend or receive money transaction


/BankTransactions/{BankTransactionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}?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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        BankTransactions bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] }; // BankTransactions | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransaction");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        BankTransactions bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] }; // BankTransactions | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransaction");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)
BankTransactions *bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] }; // 
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 update a single spend or receive money transaction
[apiInstance updateBankTransactionWith:xeroTenantId
    bankTransactionID:bankTransactionID
    bankTransactions:bankTransactions
    unitdp:unitdp
              completionHandler: ^(BankTransactions 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction 
const bankTransactions:BankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] };  // {BankTransactions} 
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.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions,  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 updateBankTransactionExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)
            var bankTransactions = new BankTransactions(); // BankTransactions | 
            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 update a single spend or receive money transaction
                BankTransactions result = apiInstance.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateBankTransaction: " + 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->updateBankTransaction: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
my $bankTransactions = ::Object::BankTransactions->new(); # BankTransactions | 
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->updateBankTransaction(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, bankTransactions => $bankTransactions, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateBankTransaction: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)
bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] } # BankTransactions | 
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 update a single spend or receive money transaction
    api_response = api_instance.update_bank_transaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateBankTransaction: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] }; // BankTransactions
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
bankTransactions *
BankTransactions
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateBankTransactionAttachmentByFileName

Allows you to update an Attachment on BankTransaction by Filename


/BankTransactions/{BankTransactionID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{FileName}"
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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        String fileName = xero-dev.jpg; // String | The name of the file being attached
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransactionAttachmentByFileName");
            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
        UUID bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
        String fileName = xero-dev.jpg; // String | The name of the file being attached
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransactionAttachmentByFileName");
            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)
UUID *bankTransactionID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transaction (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update an Attachment on BankTransaction by Filename
[apiInstance updateBankTransactionAttachmentByFileNameWith:xeroTenantId
    bankTransactionID:bankTransactionID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 bankTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transaction 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateBankTransactionAttachmentByFileNameExample
    {
        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 bankTransactionID = new UUID(); // UUID | Xero generated unique identifier for a bank transaction (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update an Attachment on BankTransaction by Filename
                Attachments result = apiInstance.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateBankTransactionAttachmentByFileName: " + 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->updateBankTransactionAttachmentByFileName: ', $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 $bankTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transaction
my $fileName = xero-dev.jpg; # String | The name of the file being attached
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateBankTransactionAttachmentByFileName(xeroTenantId => $xeroTenantId, bankTransactionID => $bankTransactionID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateBankTransactionAttachmentByFileName: $@\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)
bankTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transaction (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update an Attachment on BankTransaction by Filename
    api_response = api_instance.update_bank_transaction_attachment_by_file_name(xeroTenantId, bankTransactionID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateBankTransactionAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
FileName*
String
The name of the file being attached
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateBankTransferAttachmentByFileName


/BankTransfers/{BankTransferID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{FileName}"
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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransferAttachmentByFileName");
            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
        UUID bankTransferID = 00000000-0000-0000-000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransferAttachmentByFileName");
            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)
UUID *bankTransferID = 00000000-0000-0000-000-000000000000; // Xero generated unique identifier for a bank transfer (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a Bank Transfer (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance updateBankTransferAttachmentByFileNameWith:xeroTenantId
    bankTransferID:bankTransferID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 bankTransferID = "00000000-0000-0000-000-000000000000";  // {UUID} Xero generated unique identifier for a bank transfer 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a Bank Transfer 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateBankTransferAttachmentByFileNameExample
    {
        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 bankTransferID = new UUID(); // UUID | Xero generated unique identifier for a bank transfer (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a Bank Transfer (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // 
                Attachments result = apiInstance.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateBankTransferAttachmentByFileName: " + 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->updateBankTransferAttachmentByFileName: ', $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 $bankTransferID = 00000000-0000-0000-000-000000000000; # UUID | Xero generated unique identifier for a bank transfer
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a Bank Transfer
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateBankTransferAttachmentByFileName(xeroTenantId => $xeroTenantId, bankTransferID => $bankTransferID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateBankTransferAttachmentByFileName: $@\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)
bankTransferID = 00000000-0000-0000-000-000000000000 # UUID | Xero generated unique identifier for a bank transfer (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a Bank Transfer (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # 
    api_response = api_instance.update_bank_transfer_attachment_by_file_name(xeroTenantId, bankTransferID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateBankTransferAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransferID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
FileName*
String
The name of the file being attached to a Bank Transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateContact


/Contacts/{ContactID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        Contacts contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] }; // Contacts | 
        try {
            Contacts result = apiInstance.updateContact(xeroTenantId, contactID, contacts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateContact");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        Contacts contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] }; // Contacts | 
        try {
            Contacts result = apiInstance.updateContact(xeroTenantId, contactID, contacts);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateContact");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
Contacts *contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance updateContactWith:xeroTenantId
    contactID:contactID
    contacts:contacts
              completionHandler: ^(Contacts 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact 
const contacts:Contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] };  // {Contacts} 
try {
  const response: any = await xero.accountingApi.updateContact(xeroTenantId, contactID, contacts);
  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 updateContactExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var contacts = new Contacts(); // Contacts | 

            try
            {
                // 
                Contacts result = apiInstance.updateContact(xeroTenantId, contactID, contacts);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateContact: " + 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->updateContact: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $contacts = ::Object::Contacts->new(); # Contacts | 

eval { 
    my $result = $api_instance->updateContact(xeroTenantId => $xeroTenantId, contactID => $contactID, contacts => $contacts);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateContact: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] } # Contacts | 

try: 
    # 
    api_response = api_instance.update_contact(xeroTenantId, contactID, contacts)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateContact: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] }; // Contacts

    let mut context = AccountingApi::Context::default();
    let result = client.updateContact(xeroTenantId, contactID, contacts, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
contacts *
Contacts
an array of Contacts containing single Contact object with properties to update
Required

updateContactAttachmentByFileName


/Contacts/{ContactID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{FileName}"
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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateContactAttachmentByFileName");
            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
        UUID contactID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact
        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateContactAttachmentByFileName");
            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)
UUID *contactID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact (default to null)
String *fileName = xero-dev.jpg; // Name for the file you are attaching (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// 
[apiInstance updateContactAttachmentByFileNameWith:xeroTenantId
    contactID:contactID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 contactID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact 
const fileName = "xero-dev.jpg";  // {String} Name for the file you are attaching 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateContactAttachmentByFileNameExample
    {
        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 contactID = new UUID(); // UUID | Unique identifier for a Contact (default to null)
            var fileName = xero-dev.jpg;  // String | Name for the file you are attaching (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // 
                Attachments result = apiInstance.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateContactAttachmentByFileName: " + 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->updateContactAttachmentByFileName: ', $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 $contactID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact
my $fileName = xero-dev.jpg; # String | Name for the file you are attaching
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateContactAttachmentByFileName(xeroTenantId => $xeroTenantId, contactID => $contactID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateContactAttachmentByFileName: $@\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)
contactID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact (default to null)
fileName = xero-dev.jpg # String | Name for the file you are attaching (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # 
    api_response = api_instance.update_contact_attachment_by_file_name(xeroTenantId, contactID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateContactAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
FileName*
String
Name for the file you are attaching
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateContactGroup

Allows you to update a Contact Group


/ContactGroups/{ContactGroupID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}"
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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        ContactGroups contactGroups = { contactGroups:[ { name:"Vendor" } ] }; // ContactGroups | 
        try {
            ContactGroups result = apiInstance.updateContactGroup(xeroTenantId, contactGroupID, contactGroups);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateContactGroup");
            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
        UUID contactGroupID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Contact Group
        ContactGroups contactGroups = { contactGroups:[ { name:"Vendor" } ] }; // ContactGroups | 
        try {
            ContactGroups result = apiInstance.updateContactGroup(xeroTenantId, contactGroupID, contactGroups);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateContactGroup");
            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)
UUID *contactGroupID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Contact Group (default to null)
ContactGroups *contactGroups = { contactGroups:[ { name:"Vendor" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a Contact Group
[apiInstance updateContactGroupWith:xeroTenantId
    contactGroupID:contactGroupID
    contactGroups:contactGroups
              completionHandler: ^(ContactGroups 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 contactGroupID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Contact Group 
const contactGroups:ContactGroups = { contactGroups:[ { name:"Vendor" } ] };  // {ContactGroups} 
try {
  const response: any = await xero.accountingApi.updateContactGroup(xeroTenantId, contactGroupID, contactGroups);
  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 updateContactGroupExample
    {
        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 contactGroupID = new UUID(); // UUID | Unique identifier for a Contact Group (default to null)
            var contactGroups = new ContactGroups(); // ContactGroups | 

            try
            {
                // Allows you to update a Contact Group
                ContactGroups result = apiInstance.updateContactGroup(xeroTenantId, contactGroupID, contactGroups);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateContactGroup: " + 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->updateContactGroup: ', $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 $contactGroupID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Contact Group
my $contactGroups = ::Object::ContactGroups->new(); # ContactGroups | 

eval { 
    my $result = $api_instance->updateContactGroup(xeroTenantId => $xeroTenantId, contactGroupID => $contactGroupID, contactGroups => $contactGroups);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateContactGroup: $@\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)
contactGroupID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Contact Group (default to null)
contactGroups = { contactGroups:[ { name:"Vendor" } ] } # ContactGroups | 

try: 
    # Allows you to update a Contact Group
    api_response = api_instance.update_contact_group(xeroTenantId, contactGroupID, contactGroups)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateContactGroup: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contactGroupID = 00000000-0000-0000-000-000000000000; // UUID
    let contactGroups = { contactGroups:[ { name:"Vendor" } ] }; // ContactGroups

    let mut context = AccountingApi::Context::default();
    let result = client.updateContactGroup(xeroTenantId, contactGroupID, contactGroups, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
contactGroups *
ContactGroups
an array of Contact groups with Name of specific group to update
Required

updateCreditNote

Allows you to update a specific credit note


/CreditNotes/{CreditNoteID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}?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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        CreditNotes creditNotes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] }; // CreditNotes | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.updateCreditNote(xeroTenantId, creditNoteID, creditNotes, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateCreditNote");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        CreditNotes creditNotes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] }; // CreditNotes | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.updateCreditNote(xeroTenantId, creditNoteID, creditNotes, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateCreditNote");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
CreditNotes *creditNotes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] }; // 
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 update a specific credit note
[apiInstance updateCreditNoteWith:xeroTenantId
    creditNoteID:creditNoteID
    creditNotes:creditNotes
    unitdp:unitdp
              completionHandler: ^(CreditNotes 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const creditNotes:CreditNotes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] };  // {CreditNotes} 
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.updateCreditNote(xeroTenantId, creditNoteID, creditNotes,  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 updateCreditNoteExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var creditNotes = new CreditNotes(); // CreditNotes | 
            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 update a specific credit note
                CreditNotes result = apiInstance.updateCreditNote(xeroTenantId, creditNoteID, creditNotes, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateCreditNote: " + 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->updateCreditNote: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $creditNotes = ::Object::CreditNotes->new(); # CreditNotes | 
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->updateCreditNote(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, creditNotes => $creditNotes, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateCreditNote: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
creditNotes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] } # CreditNotes | 
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 update a specific credit note
    api_response = api_instance.update_credit_note(xeroTenantId, creditNoteID, creditNotes, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateCreditNote: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let creditNotes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] }; // CreditNotes
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateCreditNote(xeroTenantId, creditNoteID, creditNotes, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
creditNotes *
CreditNotes
an array of Credit Notes containing credit note details to update
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateCreditNoteAttachmentByFileName

Allows you to update Attachments on CreditNote by file name


/CreditNotes/{CreditNoteID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{FileName}"
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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateCreditNoteAttachmentByFileName");
            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
        UUID creditNoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Credit Note
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateCreditNoteAttachmentByFileName");
            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)
UUID *creditNoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Credit Note (default to null)
String *fileName = xero-dev.jpg; // Name of the file you are attaching to Credit Note (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update Attachments on CreditNote by file name
[apiInstance updateCreditNoteAttachmentByFileNameWith:xeroTenantId
    creditNoteID:creditNoteID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 creditNoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Credit Note 
const fileName = "xero-dev.jpg";  // {String} Name of the file you are attaching to Credit Note 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateCreditNoteAttachmentByFileNameExample
    {
        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 creditNoteID = new UUID(); // UUID | Unique identifier for a Credit Note (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the file you are attaching to Credit Note (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update Attachments on CreditNote by file name
                Attachments result = apiInstance.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateCreditNoteAttachmentByFileName: " + 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->updateCreditNoteAttachmentByFileName: ', $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 $creditNoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Credit Note
my $fileName = xero-dev.jpg; # String | Name of the file you are attaching to Credit Note
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateCreditNoteAttachmentByFileName(xeroTenantId => $xeroTenantId, creditNoteID => $creditNoteID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateCreditNoteAttachmentByFileName: $@\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)
creditNoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Credit Note (default to null)
fileName = xero-dev.jpg # String | Name of the file you are attaching to Credit Note (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update Attachments on CreditNote by file name
    api_response = api_instance.update_credit_note_attachment_by_file_name(xeroTenantId, creditNoteID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateCreditNoteAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNoteID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
FileName*
String
Name of the file you are attaching to Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateEmployee

Allows you to update a specific employee used in Xero payrun


/Employees/{EmployeeID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Employees/{EmployeeID}"
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
        UUID employeeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Employee
        Employees employees = { employees:[ { employeeID:"00000000-0000-0000-000-000000000000", firstName:"Natasha", lastName:"Romanoff" } ] }; // Employees | 
        try {
            Employees result = apiInstance.updateEmployee(xeroTenantId, employeeID, employees);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateEmployee");
            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
        UUID employeeID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Employee
        Employees employees = { employees:[ { employeeID:"00000000-0000-0000-000-000000000000", firstName:"Natasha", lastName:"Romanoff" } ] }; // Employees | 
        try {
            Employees result = apiInstance.updateEmployee(xeroTenantId, employeeID, employees);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateEmployee");
            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)
UUID *employeeID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Employee (default to null)
Employees *employees = { employees:[ { employeeID:"00000000-0000-0000-000-000000000000", firstName:"Natasha", lastName:"Romanoff" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specific employee used in Xero payrun
[apiInstance updateEmployeeWith:xeroTenantId
    employeeID:employeeID
    employees:employees
              completionHandler: ^(Employees 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 employeeID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Employee 
const employees:Employees = { employees:[ { employeeID:"00000000-0000-0000-000-000000000000", firstName:"Natasha", lastName:"Romanoff" } ] };  // {Employees} 
try {
  const response: any = await xero.accountingApi.updateEmployee(xeroTenantId, employeeID, employees);
  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 updateEmployeeExample
    {
        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 employeeID = new UUID(); // UUID | Unique identifier for a Employee (default to null)
            var employees = new Employees(); // Employees | 

            try
            {
                // Allows you to update a specific employee used in Xero payrun
                Employees result = apiInstance.updateEmployee(xeroTenantId, employeeID, employees);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateEmployee: " + 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->updateEmployee: ', $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 $employeeID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Employee
my $employees = ::Object::Employees->new(); # Employees | 

eval { 
    my $result = $api_instance->updateEmployee(xeroTenantId => $xeroTenantId, employeeID => $employeeID, employees => $employees);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateEmployee: $@\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)
employeeID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Employee (default to null)
employees = { employees:[ { employeeID:"00000000-0000-0000-000-000000000000", firstName:"Natasha", lastName:"Romanoff" } ] } # Employees | 

try: 
    # Allows you to update a specific employee used in Xero payrun
    api_response = api_instance.update_employee(xeroTenantId, employeeID, employees)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateEmployee: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let employeeID = 00000000-0000-0000-000-000000000000; // UUID
    let employees = { employees:[ { employeeID:"00000000-0000-0000-000-000000000000", firstName:"Natasha", lastName:"Romanoff" } ] }; // Employees

    let mut context = AccountingApi::Context::default();
    let result = client.updateEmployee(xeroTenantId, employeeID, employees, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
EmployeeID*
UUID (uuid)
Unique identifier for a Employee
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employees *
Employees
Required

updateExpenseClaim

Allows you to update specified expense claims


/ExpenseClaims/{ExpenseClaimID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}"
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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        ExpenseClaims expenseClaims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] }; // ExpenseClaims | 
        try {
            ExpenseClaims result = apiInstance.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateExpenseClaim");
            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
        UUID expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ExpenseClaim
        ExpenseClaims expenseClaims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] }; // ExpenseClaims | 
        try {
            ExpenseClaims result = apiInstance.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateExpenseClaim");
            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)
UUID *expenseClaimID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ExpenseClaim (default to null)
ExpenseClaims *expenseClaims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update specified expense claims
[apiInstance updateExpenseClaimWith:xeroTenantId
    expenseClaimID:expenseClaimID
    expenseClaims:expenseClaims
              completionHandler: ^(ExpenseClaims 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 expenseClaimID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ExpenseClaim 
const expenseClaims:ExpenseClaims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] };  // {ExpenseClaims} 
try {
  const response: any = await xero.accountingApi.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims);
  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 updateExpenseClaimExample
    {
        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 expenseClaimID = new UUID(); // UUID | Unique identifier for a ExpenseClaim (default to null)
            var expenseClaims = new ExpenseClaims(); // ExpenseClaims | 

            try
            {
                // Allows you to update specified expense claims
                ExpenseClaims result = apiInstance.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateExpenseClaim: " + 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->updateExpenseClaim: ', $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 $expenseClaimID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ExpenseClaim
my $expenseClaims = ::Object::ExpenseClaims->new(); # ExpenseClaims | 

eval { 
    my $result = $api_instance->updateExpenseClaim(xeroTenantId => $xeroTenantId, expenseClaimID => $expenseClaimID, expenseClaims => $expenseClaims);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateExpenseClaim: $@\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)
expenseClaimID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ExpenseClaim (default to null)
expenseClaims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] } # ExpenseClaims | 

try: 
    # Allows you to update specified expense claims
    api_response = api_instance.update_expense_claim(xeroTenantId, expenseClaimID, expenseClaims)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateExpenseClaim: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let expenseClaimID = 00000000-0000-0000-000-000000000000; // UUID
    let expenseClaims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] }; // ExpenseClaims

    let mut context = AccountingApi::Context::default();
    let result = client.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
ExpenseClaimID*
UUID (uuid)
Unique identifier for a ExpenseClaim
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
expenseClaims *
ExpenseClaims
Required

updateInvoice

Allows you to update a specified sales invoices or purchase bills


/Invoices/{InvoiceID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}?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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        Invoices invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] }; // Invoices | 
        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.updateInvoice(xeroTenantId, invoiceID, invoices, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateInvoice");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        Invoices invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] }; // Invoices | 
        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.updateInvoice(xeroTenantId, invoiceID, invoices, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateInvoice");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
Invoices *invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] }; // 
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 update a specified sales invoices or purchase bills
[apiInstance updateInvoiceWith:xeroTenantId
    invoiceID:invoiceID
    invoices:invoices
    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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const invoices:Invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] };  // {Invoices} 
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.updateInvoice(xeroTenantId, invoiceID, invoices,  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 updateInvoiceExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var invoices = new Invoices(); // Invoices | 
            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 update a specified sales invoices or purchase bills
                Invoices result = apiInstance.updateInvoice(xeroTenantId, invoiceID, invoices, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateInvoice: " + 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->updateInvoice: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $invoices = ::Object::Invoices->new(); # Invoices | 
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->updateInvoice(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, invoices => $invoices, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateInvoice: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] } # Invoices | 
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 update a specified sales invoices or purchase bills
    api_response = api_instance.update_invoice(xeroTenantId, invoiceID, invoices, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateInvoice: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] }; // Invoices
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateInvoice(xeroTenantId, invoiceID, invoices, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
invoices *
Invoices
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateInvoiceAttachmentByFileName

Allows you to update Attachment on invoices or purchase bills by it's filename


/Invoices/{InvoiceID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{FileName}"
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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateInvoiceAttachmentByFileName");
            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
        UUID invoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Invoice
        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateInvoiceAttachmentByFileName");
            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)
UUID *invoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Invoice (default to null)
String *fileName = xero-dev.jpg; // Name of the file you are attaching (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update Attachment on invoices or purchase bills by it's filename
[apiInstance updateInvoiceAttachmentByFileNameWith:xeroTenantId
    invoiceID:invoiceID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 invoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Invoice 
const fileName = "xero-dev.jpg";  // {String} Name of the file you are attaching 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateInvoiceAttachmentByFileNameExample
    {
        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 invoiceID = new UUID(); // UUID | Unique identifier for an Invoice (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the file you are attaching (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update Attachment on invoices or purchase bills by it's filename
                Attachments result = apiInstance.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateInvoiceAttachmentByFileName: " + 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->updateInvoiceAttachmentByFileName: ', $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 $invoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Invoice
my $fileName = xero-dev.jpg; # String | Name of the file you are attaching
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, invoiceID => $invoiceID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateInvoiceAttachmentByFileName: $@\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)
invoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Invoice (default to null)
fileName = xero-dev.jpg # String | Name of the file you are attaching (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update Attachment on invoices or purchase bills by it's filename
    api_response = api_instance.update_invoice_attachment_by_file_name(xeroTenantId, invoiceID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateInvoiceAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
FileName*
String
Name of the file you are attaching
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateItem

Allows you to update a specified item


/Items/{ItemID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}?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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        Items items = { items:[ { code:"abc123", description:"Hello Xero" } ] }; // Items | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.updateItem(xeroTenantId, itemID, items, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateItem");
            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
        UUID itemID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Item
        Items items = { items:[ { code:"abc123", description:"Hello Xero" } ] }; // Items | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.updateItem(xeroTenantId, itemID, items, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateItem");
            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)
UUID *itemID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Item (default to null)
Items *items = { items:[ { code:"abc123", description:"Hello Xero" } ] }; // 
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 update a specified item
[apiInstance updateItemWith:xeroTenantId
    itemID:itemID
    items:items
    unitdp:unitdp
              completionHandler: ^(Items 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 itemID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Item 
const items:Items = { items:[ { code:"abc123", description:"Hello Xero" } ] };  // {Items} 
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.updateItem(xeroTenantId, itemID, items,  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 updateItemExample
    {
        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 itemID = new UUID(); // UUID | Unique identifier for an Item (default to null)
            var items = new Items(); // Items | 
            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 update a specified item
                Items result = apiInstance.updateItem(xeroTenantId, itemID, items, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateItem: " + 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->updateItem: ', $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 $itemID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Item
my $items = ::Object::Items->new(); # Items | 
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->updateItem(xeroTenantId => $xeroTenantId, itemID => $itemID, items => $items, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateItem: $@\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)
itemID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Item (default to null)
items = { items:[ { code:"abc123", description:"Hello Xero" } ] } # Items | 
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 update a specified item
    api_response = api_instance.update_item(xeroTenantId, itemID, items, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateItem: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let itemID = 00000000-0000-0000-000-000000000000; // UUID
    let items = { items:[ { code:"abc123", description:"Hello Xero" } ] }; // Items
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateItem(xeroTenantId, itemID, items, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
items *
Items
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateLinkedTransaction

Allows you to update a specified linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions/{LinkedTransactionID}"
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
        UUID linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a LinkedTransaction
        LinkedTransactions linkedTransactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] }; // LinkedTransactions | 
        try {
            LinkedTransactions result = apiInstance.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateLinkedTransaction");
            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
        UUID linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a LinkedTransaction
        LinkedTransactions linkedTransactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] }; // LinkedTransactions | 
        try {
            LinkedTransactions result = apiInstance.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateLinkedTransaction");
            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)
UUID *linkedTransactionID = 00000000-0000-0000-000-000000000000; // Unique identifier for a LinkedTransaction (default to null)
LinkedTransactions *linkedTransactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specified linked transactions (billable expenses)
[apiInstance updateLinkedTransactionWith:xeroTenantId
    linkedTransactionID:linkedTransactionID
    linkedTransactions:linkedTransactions
              completionHandler: ^(LinkedTransactions 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 linkedTransactionID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a LinkedTransaction 
const linkedTransactions:LinkedTransactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] };  // {LinkedTransactions} 
try {
  const response: any = await xero.accountingApi.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions);
  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 updateLinkedTransactionExample
    {
        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 linkedTransactionID = new UUID(); // UUID | Unique identifier for a LinkedTransaction (default to null)
            var linkedTransactions = new LinkedTransactions(); // LinkedTransactions | 

            try
            {
                // Allows you to update a specified linked transactions (billable expenses)
                LinkedTransactions result = apiInstance.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateLinkedTransaction: " + 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->updateLinkedTransaction: ', $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 $linkedTransactionID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a LinkedTransaction
my $linkedTransactions = ::Object::LinkedTransactions->new(); # LinkedTransactions | 

eval { 
    my $result = $api_instance->updateLinkedTransaction(xeroTenantId => $xeroTenantId, linkedTransactionID => $linkedTransactionID, linkedTransactions => $linkedTransactions);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateLinkedTransaction: $@\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)
linkedTransactionID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a LinkedTransaction (default to null)
linkedTransactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] } # LinkedTransactions | 

try: 
    # Allows you to update a specified linked transactions (billable expenses)
    api_response = api_instance.update_linked_transaction(xeroTenantId, linkedTransactionID, linkedTransactions)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateLinkedTransaction: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let linkedTransactionID = 00000000-0000-0000-000-000000000000; // UUID
    let linkedTransactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] }; // LinkedTransactions

    let mut context = AccountingApi::Context::default();
    let result = client.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
LinkedTransactionID*
UUID (uuid)
Unique identifier for a LinkedTransaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
linkedTransactions *
LinkedTransactions
Required

updateManualJournal

Allows you to update a specified manual journal


/ManualJournals/{ManualJournalID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        ManualJournals manualJournals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] }; // ManualJournals | 
        try {
            ManualJournals result = apiInstance.updateManualJournal(xeroTenantId, manualJournalID, manualJournals);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateManualJournal");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        ManualJournals manualJournals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] }; // ManualJournals | 
        try {
            ManualJournals result = apiInstance.updateManualJournal(xeroTenantId, manualJournalID, manualJournals);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateManualJournal");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)
ManualJournals *manualJournals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specified manual journal
[apiInstance updateManualJournalWith:xeroTenantId
    manualJournalID:manualJournalID
    manualJournals:manualJournals
              completionHandler: ^(ManualJournals 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal 
const manualJournals:ManualJournals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] };  // {ManualJournals} 
try {
  const response: any = await xero.accountingApi.updateManualJournal(xeroTenantId, manualJournalID, manualJournals);
  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 updateManualJournalExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)
            var manualJournals = new ManualJournals(); // ManualJournals | 

            try
            {
                // Allows you to update a specified manual journal
                ManualJournals result = apiInstance.updateManualJournal(xeroTenantId, manualJournalID, manualJournals);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateManualJournal: " + 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->updateManualJournal: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal
my $manualJournals = ::Object::ManualJournals->new(); # ManualJournals | 

eval { 
    my $result = $api_instance->updateManualJournal(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID, manualJournals => $manualJournals);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateManualJournal: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)
manualJournals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] } # ManualJournals | 

try: 
    # Allows you to update a specified manual journal
    api_response = api_instance.update_manual_journal(xeroTenantId, manualJournalID, manualJournals)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateManualJournal: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID
    let manualJournals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] }; // ManualJournals

    let mut context = AccountingApi::Context::default();
    let result = client.updateManualJournal(xeroTenantId, manualJournalID, manualJournals, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
manualJournals *
ManualJournals
Required

updateManualJournalAttachmentByFileName

Allows you to update a specified Attachment on ManualJournal by file name


/ManualJournals/{ManualJournalID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{FileName}"
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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateManualJournalAttachmentByFileName");
            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
        UUID manualJournalID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a ManualJournal
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateManualJournalAttachmentByFileName");
            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)
UUID *manualJournalID = 00000000-0000-0000-000-000000000000; // Unique identifier for a ManualJournal (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a ManualJournal (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specified Attachment on ManualJournal by file name
[apiInstance updateManualJournalAttachmentByFileNameWith:xeroTenantId
    manualJournalID:manualJournalID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 manualJournalID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a ManualJournal 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a ManualJournal 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateManualJournalAttachmentByFileNameExample
    {
        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 manualJournalID = new UUID(); // UUID | Unique identifier for a ManualJournal (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a ManualJournal (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update a specified Attachment on ManualJournal by file name
                Attachments result = apiInstance.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateManualJournalAttachmentByFileName: " + 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->updateManualJournalAttachmentByFileName: ', $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 $manualJournalID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a ManualJournal
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a ManualJournal
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateManualJournalAttachmentByFileName(xeroTenantId => $xeroTenantId, manualJournalID => $manualJournalID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateManualJournalAttachmentByFileName: $@\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)
manualJournalID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a ManualJournal (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a ManualJournal (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update a specified Attachment on ManualJournal by file name
    api_response = api_instance.update_manual_journal_attachment_by_file_name(xeroTenantId, manualJournalID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateManualJournalAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournalID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
FileName*
String
The name of the file being attached to a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateOrCreateBankTransactions

Allows you to update or create one or more spend or receive money transaction


/BankTransactions

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions?summarizeErrors=true&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
        BankTransactions bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // BankTransactions | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.updateOrCreateBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateBankTransactions");
            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
        BankTransactions bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // BankTransactions | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            BankTransactions result = apiInstance.updateOrCreateBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateBankTransactions");
            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)
BankTransactions *bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update or create one or more spend or receive money transaction
[apiInstance updateOrCreateBankTransactionsWith:xeroTenantId
    bankTransactions:bankTransactions
    summarizeErrors:summarizeErrors
    unitdp:unitdp
              completionHandler: ^(BankTransactions 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 bankTransactions:BankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] };  // {BankTransactions} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.updateOrCreateBankTransactions(xeroTenantId, bankTransactions,  summarizeErrors, 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 updateOrCreateBankTransactionsExample
    {
        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 bankTransactions = new BankTransactions(); // BankTransactions | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 update or create one or more spend or receive money transaction
                BankTransactions result = apiInstance.updateOrCreateBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateBankTransactions: " + 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->updateOrCreateBankTransactions: ', $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 $bankTransactions = ::Object::BankTransactions->new(); # BankTransactions | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->updateOrCreateBankTransactions(xeroTenantId => $xeroTenantId, bankTransactions => $bankTransactions, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateBankTransactions: $@\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)
bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update or create one or more spend or receive money transaction
    api_response = api_instance.update_or_create_bank_transactions(xeroTenantId, bankTransactions, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateBankTransactions: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let bankTransactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] }; // BankTransactions
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
bankTransactions *
BankTransactions
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateContacts

Allows you to update OR create one or more contacts in a Xero organisation


/Contacts

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Contacts?summarizeErrors=true"
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
        Contacts contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // Contacts | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Contacts result = apiInstance.updateOrCreateContacts(xeroTenantId, contacts, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateContacts");
            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
        Contacts contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // Contacts | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Contacts result = apiInstance.updateOrCreateContacts(xeroTenantId, contacts, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateContacts");
            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)
Contacts *contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update OR create one or more contacts in a Xero organisation
[apiInstance updateOrCreateContactsWith:xeroTenantId
    contacts:contacts
    summarizeErrors:summarizeErrors
              completionHandler: ^(Contacts 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 contacts:Contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] };  // {Contacts} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.updateOrCreateContacts(xeroTenantId, contacts,  summarizeErrors);
  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 updateOrCreateContactsExample
    {
        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 contacts = new Contacts(); // Contacts | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to update OR create one or more contacts in a Xero organisation
                Contacts result = apiInstance.updateOrCreateContacts(xeroTenantId, contacts, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateContacts: " + 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->updateOrCreateContacts: ', $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 $contacts = ::Object::Contacts->new(); # Contacts | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->updateOrCreateContacts(xeroTenantId => $xeroTenantId, contacts => $contacts, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateContacts: $@\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)
contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to update OR create one or more contacts in a Xero organisation
    api_response = api_instance.update_or_create_contacts(xeroTenantId, contacts, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateContacts: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] }; // Contacts
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateContacts(xeroTenantId, contacts, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
contacts *
Contacts
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

updateOrCreateCreditNotes

Allows you to update OR create one or more credit notes


/CreditNotes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?summarizeErrors=true&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
        CreditNotes creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // CreditNotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.updateOrCreateCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateCreditNotes");
            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
        CreditNotes creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // CreditNotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            CreditNotes result = apiInstance.updateOrCreateCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateCreditNotes");
            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)
CreditNotes *creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update OR create one or more credit notes
[apiInstance updateOrCreateCreditNotesWith:xeroTenantId
    creditNotes:creditNotes
    summarizeErrors:summarizeErrors
    unitdp:unitdp
              completionHandler: ^(CreditNotes 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 creditNotes:CreditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] };  // {CreditNotes} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.updateOrCreateCreditNotes(xeroTenantId, creditNotes,  summarizeErrors, 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 updateOrCreateCreditNotesExample
    {
        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 creditNotes = new CreditNotes(); // CreditNotes | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 update OR create one or more credit notes
                CreditNotes result = apiInstance.updateOrCreateCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateCreditNotes: " + 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->updateOrCreateCreditNotes: ', $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 $creditNotes = ::Object::CreditNotes->new(); # CreditNotes | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->updateOrCreateCreditNotes(xeroTenantId => $xeroTenantId, creditNotes => $creditNotes, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateCreditNotes: $@\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)
creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update OR create one or more credit notes
    api_response = api_instance.update_or_create_credit_notes(xeroTenantId, creditNotes, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateCreditNotes: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let creditNotes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] }; // CreditNotes
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
creditNotes *
CreditNotes
an array of Credit Notes with a single CreditNote object.
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateEmployees

Allows you to create a single new employees used in Xero payrun


/Employees

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Employees?summarizeErrors=true"
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
        Employees employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Employees result = apiInstance.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateEmployees");
            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
        Employees employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Employees result = apiInstance.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateEmployees");
            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)
Employees *employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a single new employees used in Xero payrun
[apiInstance updateOrCreateEmployeesWith:xeroTenantId
    employees:employees
    summarizeErrors:summarizeErrors
              completionHandler: ^(Employees 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 employees:Employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] };  // {Employees} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.updateOrCreateEmployees(xeroTenantId, employees,  summarizeErrors);
  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 updateOrCreateEmployeesExample
    {
        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 employees = new Employees(); // Employees | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create a single new employees used in Xero payrun
                Employees result = apiInstance.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateEmployees: " + 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->updateOrCreateEmployees: ', $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 $employees = ::Object::Employees->new(); # Employees | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->updateOrCreateEmployees(xeroTenantId => $xeroTenantId, employees => $employees, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateEmployees: $@\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)
employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create a single new employees used in Xero payrun
    api_response = api_instance.update_or_create_employees(xeroTenantId, employees, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateEmployees: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
employees *
Employees
Employees with array of Employee object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

updateOrCreateInvoices

Allows you to update OR create one or more sales invoices or purchase bills


/Invoices

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Invoices?summarizeErrors=true&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
        Invoices invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] }; // Invoices | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        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.updateOrCreateInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateInvoices");
            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
        Invoices invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] }; // Invoices | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        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.updateOrCreateInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateInvoices");
            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)
Invoices *invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update OR create one or more sales invoices or purchase bills
[apiInstance updateOrCreateInvoicesWith:xeroTenantId
    invoices:invoices
    summarizeErrors:summarizeErrors
    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 invoices:Invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] };  // {Invoices} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.updateOrCreateInvoices(xeroTenantId, invoices,  summarizeErrors, 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 updateOrCreateInvoicesExample
    {
        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 invoices = new Invoices(); // Invoices | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 update OR create one or more sales invoices or purchase bills
                Invoices result = apiInstance.updateOrCreateInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateInvoices: " + 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->updateOrCreateInvoices: ', $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 $invoices = ::Object::Invoices->new(); # Invoices | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->updateOrCreateInvoices(xeroTenantId => $xeroTenantId, invoices => $invoices, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateInvoices: $@\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)
invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] } # Invoices | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update OR create one or more sales invoices or purchase bills
    api_response = api_instance.update_or_create_invoices(xeroTenantId, invoices, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateInvoices: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] }; // Invoices
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateInvoices(xeroTenantId, invoices, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
invoices *
Invoices
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateItems

Allows you to update or create one or more items


/Items

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Items?summarizeErrors=true&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
        Items items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] }; // Items | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.updateOrCreateItems(xeroTenantId, items, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateItems");
            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
        Items items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] }; // Items | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Items result = apiInstance.updateOrCreateItems(xeroTenantId, items, summarizeErrors, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateItems");
            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)
Items *items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update or create one or more items
[apiInstance updateOrCreateItemsWith:xeroTenantId
    items:items
    summarizeErrors:summarizeErrors
    unitdp:unitdp
              completionHandler: ^(Items 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 items:Items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] };  // {Items} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors
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.updateOrCreateItems(xeroTenantId, items,  summarizeErrors, 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 updateOrCreateItemsExample
    {
        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 items = new Items(); // Items | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)
            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 update or create one or more items
                Items result = apiInstance.updateOrCreateItems(xeroTenantId, items, summarizeErrors, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateItems: " + 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->updateOrCreateItems: ', $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 $items = ::Object::Items->new(); # Items | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
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->updateOrCreateItems(xeroTenantId => $xeroTenantId, items => $items, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateItems: $@\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)
items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] } # Items | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)
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 update or create one or more items
    api_response = api_instance.update_or_create_items(xeroTenantId, items, summarizeErrors=summarizeErrors, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateItems: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] }; // Items
    let summarizeErrors = true; // Boolean
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateItems(xeroTenantId, items, summarizeErrors, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
items *
Items
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateManualJournals

Allows you to create a single manual journal


/ManualJournals

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?summarizeErrors=true"
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
        ManualJournals manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // ManualJournals | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            ManualJournals result = apiInstance.updateOrCreateManualJournals(xeroTenantId, manualJournals, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateManualJournals");
            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
        ManualJournals manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // ManualJournals | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            ManualJournals result = apiInstance.updateOrCreateManualJournals(xeroTenantId, manualJournals, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateManualJournals");
            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)
ManualJournals *manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to create a single manual journal
[apiInstance updateOrCreateManualJournalsWith:xeroTenantId
    manualJournals:manualJournals
    summarizeErrors:summarizeErrors
              completionHandler: ^(ManualJournals 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 manualJournals:ManualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] };  // {ManualJournals} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.updateOrCreateManualJournals(xeroTenantId, manualJournals,  summarizeErrors);
  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 updateOrCreateManualJournalsExample
    {
        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 manualJournals = new ManualJournals(); // ManualJournals | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to create a single manual journal
                ManualJournals result = apiInstance.updateOrCreateManualJournals(xeroTenantId, manualJournals, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateManualJournals: " + 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->updateOrCreateManualJournals: ', $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 $manualJournals = ::Object::ManualJournals->new(); # ManualJournals | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->updateOrCreateManualJournals(xeroTenantId => $xeroTenantId, manualJournals => $manualJournals, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateManualJournals: $@\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)
manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to create a single manual journal
    api_response = api_instance.update_or_create_manual_journals(xeroTenantId, manualJournals, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateManualJournals: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let manualJournals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] }; // ManualJournals
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateManualJournals(xeroTenantId, manualJournals, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
manualJournals *
ManualJournals
ManualJournals array with ManualJournal object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

updateOrCreatePurchaseOrders

Allows you to update or create one or more purchase orders


/PurchaseOrders

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?summarizeErrors=true"
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
        PurchaseOrders purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // PurchaseOrders | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreatePurchaseOrders");
            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
        PurchaseOrders purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // PurchaseOrders | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreatePurchaseOrders");
            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)
PurchaseOrders *purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update or create one or more purchase orders
[apiInstance updateOrCreatePurchaseOrdersWith:xeroTenantId
    purchaseOrders:purchaseOrders
    summarizeErrors:summarizeErrors
              completionHandler: ^(PurchaseOrders 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 purchaseOrders:PurchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] };  // {PurchaseOrders} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders,  summarizeErrors);
  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 updateOrCreatePurchaseOrdersExample
    {
        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 purchaseOrders = new PurchaseOrders(); // PurchaseOrders | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to update or create one or more purchase orders
                PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreatePurchaseOrders: " + 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->updateOrCreatePurchaseOrders: ', $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 $purchaseOrders = ::Object::PurchaseOrders->new(); # PurchaseOrders | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->updateOrCreatePurchaseOrders(xeroTenantId => $xeroTenantId, purchaseOrders => $purchaseOrders, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreatePurchaseOrders: $@\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)
purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to update or create one or more purchase orders
    api_response = api_instance.update_or_create_purchase_orders(xeroTenantId, purchaseOrders, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreatePurchaseOrders: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let purchaseOrders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] }; // PurchaseOrders
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

updateOrCreateQuotes

Allows you to update OR create one or more quotes


/Quotes

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes?summarizeErrors=true"
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
        Quotes quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // Quotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Quotes result = apiInstance.updateOrCreateQuotes(xeroTenantId, quotes, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateQuotes");
            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
        Quotes quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // Quotes | 
        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors
        try {
            Quotes result = apiInstance.updateOrCreateQuotes(xeroTenantId, quotes, summarizeErrors);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateQuotes");
            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)
Quotes *quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // 
Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update OR create one or more quotes
[apiInstance updateOrCreateQuotesWith:xeroTenantId
    quotes:quotes
    summarizeErrors:summarizeErrors
              completionHandler: ^(Quotes 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 quotes:Quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] };  // {Quotes} 
const summarizeErrors =  true;  // {Boolean} If false return 200 OK and mix of successfully created obejcts and any with validation errors

try {
  const response: any = await xero.accountingApi.updateOrCreateQuotes(xeroTenantId, quotes,  summarizeErrors);
  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 updateOrCreateQuotesExample
    {
        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 quotes = new Quotes(); // Quotes | 
            var summarizeErrors = true;  // Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional)  (default to false)

            try
            {
                // Allows you to update OR create one or more quotes
                Quotes result = apiInstance.updateOrCreateQuotes(xeroTenantId, quotes, summarizeErrors);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateOrCreateQuotes: " + 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->updateOrCreateQuotes: ', $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 $quotes = ::Object::Quotes->new(); # Quotes | 
my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors

eval { 
    my $result = $api_instance->updateOrCreateQuotes(xeroTenantId => $xeroTenantId, quotes => $quotes, summarizeErrors => $summarizeErrors);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateOrCreateQuotes: $@\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)
quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | 
summarizeErrors = true # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors (optional) (default to false)

try: 
    # Allows you to update OR create one or more quotes
    api_response = api_instance.update_or_create_quotes(xeroTenantId, quotes, summarizeErrors=summarizeErrors)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateOrCreateQuotes: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] }; // Quotes
    let summarizeErrors = true; // Boolean

    let mut context = AccountingApi::Context::default();
    let result = client.updateOrCreateQuotes(xeroTenantId, quotes, summarizeErrors, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
quotes *
Quotes
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created obejcts and any with validation errors

updatePurchaseOrder

Allows you to update a specified purchase order


/PurchaseOrders/{PurchaseOrderID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}"
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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        PurchaseOrders purchaseOrders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] }; // PurchaseOrders | 
        try {
            PurchaseOrders result = apiInstance.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updatePurchaseOrder");
            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
        UUID purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a PurchaseOrder
        PurchaseOrders purchaseOrders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] }; // PurchaseOrders | 
        try {
            PurchaseOrders result = apiInstance.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updatePurchaseOrder");
            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)
UUID *purchaseOrderID = 00000000-0000-0000-000-000000000000; // Unique identifier for a PurchaseOrder (default to null)
PurchaseOrders *purchaseOrders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specified purchase order
[apiInstance updatePurchaseOrderWith:xeroTenantId
    purchaseOrderID:purchaseOrderID
    purchaseOrders:purchaseOrders
              completionHandler: ^(PurchaseOrders 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 purchaseOrderID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a PurchaseOrder 
const purchaseOrders:PurchaseOrders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] };  // {PurchaseOrders} 
try {
  const response: any = await xero.accountingApi.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders);
  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 updatePurchaseOrderExample
    {
        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 purchaseOrderID = new UUID(); // UUID | Unique identifier for a PurchaseOrder (default to null)
            var purchaseOrders = new PurchaseOrders(); // PurchaseOrders | 

            try
            {
                // Allows you to update a specified purchase order
                PurchaseOrders result = apiInstance.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updatePurchaseOrder: " + 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->updatePurchaseOrder: ', $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 $purchaseOrderID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a PurchaseOrder
my $purchaseOrders = ::Object::PurchaseOrders->new(); # PurchaseOrders | 

eval { 
    my $result = $api_instance->updatePurchaseOrder(xeroTenantId => $xeroTenantId, purchaseOrderID => $purchaseOrderID, purchaseOrders => $purchaseOrders);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updatePurchaseOrder: $@\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)
purchaseOrderID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a PurchaseOrder (default to null)
purchaseOrders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] } # PurchaseOrders | 

try: 
    # Allows you to update a specified purchase order
    api_response = api_instance.update_purchase_order(xeroTenantId, purchaseOrderID, purchaseOrders)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updatePurchaseOrder: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let purchaseOrderID = 00000000-0000-0000-000-000000000000; // UUID
    let purchaseOrders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] }; // PurchaseOrders

    let mut context = AccountingApi::Context::default();
    let result = client.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for a PurchaseOrder
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
Required

updateQuote

Allows you to update a specified quote


/Quotes/{QuoteID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        Quotes quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]}; // Quotes | 
        try {
            Quotes result = apiInstance.updateQuote(xeroTenantId, quoteID, quotes);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateQuote");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for an Quote
        Quotes quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]}; // Quotes | 
        try {
            Quotes result = apiInstance.updateQuote(xeroTenantId, quoteID, quotes);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateQuote");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for an Quote (default to null)
Quotes *quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]}; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update a specified quote
[apiInstance updateQuoteWith:xeroTenantId
    quoteID:quoteID
    quotes:quotes
              completionHandler: ^(Quotes 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for an Quote 
const quotes:Quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]};  // {Quotes} 
try {
  const response: any = await xero.accountingApi.updateQuote(xeroTenantId, quoteID, quotes);
  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 updateQuoteExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for an Quote (default to null)
            var quotes = new Quotes(); // Quotes | 

            try
            {
                // Allows you to update a specified quote
                Quotes result = apiInstance.updateQuote(xeroTenantId, quoteID, quotes);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateQuote: " + 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->updateQuote: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for an Quote
my $quotes = ::Object::Quotes->new(); # Quotes | 

eval { 
    my $result = $api_instance->updateQuote(xeroTenantId => $xeroTenantId, quoteID => $quoteID, quotes => $quotes);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateQuote: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for an Quote (default to null)
quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]} # Quotes | 

try: 
    # Allows you to update a specified quote
    api_response = api_instance.update_quote(xeroTenantId, quoteID, quotes)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateQuote: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID
    let quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]}; // Quotes

    let mut context = AccountingApi::Context::default();
    let result = client.updateQuote(xeroTenantId, quoteID, quotes, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
quotes *
Quotes
Required

updateQuoteAttachmentByFileName

Allows you to update Attachment on Quote by Filename


/Quotes/{QuoteID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateQuoteAttachmentByFileName");
            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
        UUID quoteID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for Quote object
        String fileName = xero-dev.jpg; // String | Name of the attachment
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateQuoteAttachmentByFileName");
            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)
UUID *quoteID = 00000000-0000-0000-000-000000000000; // Unique identifier for Quote object (default to null)
String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update Attachment on Quote by Filename
[apiInstance updateQuoteAttachmentByFileNameWith:xeroTenantId
    quoteID:quoteID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 quoteID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for Quote object 
const fileName = "xero-dev.jpg";  // {String} Name of the attachment 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateQuoteAttachmentByFileNameExample
    {
        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 quoteID = new UUID(); // UUID | Unique identifier for Quote object (default to null)
            var fileName = xero-dev.jpg;  // String | Name of the attachment (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update Attachment on Quote by Filename
                Attachments result = apiInstance.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateQuoteAttachmentByFileName: " + 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->updateQuoteAttachmentByFileName: ', $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 $quoteID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for Quote object
my $fileName = xero-dev.jpg; # String | Name of the attachment
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateQuoteAttachmentByFileName(xeroTenantId => $xeroTenantId, quoteID => $quoteID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateQuoteAttachmentByFileName: $@\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)
quoteID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for Quote object (default to null)
fileName = xero-dev.jpg # String | Name of the attachment (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update Attachment on Quote by Filename
    api_response = api_instance.update_quote_attachment_by_file_name(xeroTenantId, quoteID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateQuoteAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let quoteID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for Quote object
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateReceipt

Allows you to retrieve a specified draft expense claim receipts


/Receipts/{ReceiptID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}?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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        Receipts receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] }; // Receipts | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.updateReceipt(xeroTenantId, receiptID, receipts, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateReceipt");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        Receipts receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] }; // Receipts | 
        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
        try {
            Receipts result = apiInstance.updateReceipt(xeroTenantId, receiptID, receipts, unitdp);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateReceipt");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)
Receipts *receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] }; // 
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 a specified draft expense claim receipts
[apiInstance updateReceiptWith:xeroTenantId
    receiptID:receiptID
    receipts:receipts
    unitdp:unitdp
              completionHandler: ^(Receipts 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt 
const receipts:Receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] };  // {Receipts} 
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.updateReceipt(xeroTenantId, receiptID, receipts,  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 updateReceiptExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)
            var receipts = new Receipts(); // Receipts | 
            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 a specified draft expense claim receipts
                Receipts result = apiInstance.updateReceipt(xeroTenantId, receiptID, receipts, unitdp);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateReceipt: " + 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->updateReceipt: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
my $receipts = ::Object::Receipts->new(); # Receipts | 
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->updateReceipt(xeroTenantId => $xeroTenantId, receiptID => $receiptID, receipts => $receipts, unitdp => $unitdp);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateReceipt: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)
receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] } # Receipts | 
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 a specified draft expense claim receipts
    api_response = api_instance.update_receipt(xeroTenantId, receiptID, receipts, unitdp=unitdp)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateReceipt: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] }; // Receipts
    let unitdp = 4; // Integer

    let mut context = AccountingApi::Context::default();
    let result = client.updateReceipt(xeroTenantId, receiptID, receipts, unitdp, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
receipts *
Receipts
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateReceiptAttachmentByFileName

Allows you to update Attachment on expense claim receipts by file name


/Receipts/{ReceiptID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateReceiptAttachmentByFileName");
            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
        UUID receiptID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Receipt
        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateReceiptAttachmentByFileName");
            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)
UUID *receiptID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Receipt (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to the Receipt (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update Attachment on expense claim receipts by file name
[apiInstance updateReceiptAttachmentByFileNameWith:xeroTenantId
    receiptID:receiptID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 receiptID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Receipt 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to the Receipt 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateReceiptAttachmentByFileNameExample
    {
        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 receiptID = new UUID(); // UUID | Unique identifier for a Receipt (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to the Receipt (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update Attachment on expense claim receipts by file name
                Attachments result = apiInstance.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateReceiptAttachmentByFileName: " + 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->updateReceiptAttachmentByFileName: ', $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 $receiptID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Receipt
my $fileName = xero-dev.jpg; # String | The name of the file being attached to the Receipt
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateReceiptAttachmentByFileName(xeroTenantId => $xeroTenantId, receiptID => $receiptID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateReceiptAttachmentByFileName: $@\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)
receiptID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Receipt (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to the Receipt (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update Attachment on expense claim receipts by file name
    api_response = api_instance.update_receipt_attachment_by_file_name(xeroTenantId, receiptID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateReceiptAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let receiptID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
FileName*
String
The name of the file being attached to the Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateRepeatingInvoiceAttachmentByFileName

Allows you to update specified attachment on repeating invoices by file name


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateRepeatingInvoiceAttachmentByFileName");
            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
        UUID repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Repeating Invoice
        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
        try {
            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateRepeatingInvoiceAttachmentByFileName");
            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)
UUID *repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Repeating Invoice (default to null)
String *fileName = xero-dev.jpg; // The name of the file being attached to a Repeating Invoice (default to null)
byte[] *body = BYTE_ARRAY_DATA_HERE; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update specified attachment on repeating invoices by file name
[apiInstance updateRepeatingInvoiceAttachmentByFileNameWith:xeroTenantId
    repeatingInvoiceID:repeatingInvoiceID
    fileName:fileName
    body:body
              completionHandler: ^(Attachments 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 repeatingInvoiceID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Repeating Invoice 
const fileName = "xero-dev.jpg";  // {String} The name of the file being attached to a Repeating Invoice 
const path = require("path");
const mime = require("mime-types");
const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file

// You'll need to add the import below to read your file
// import * as fs from "fs";
const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
const contentType = mime.lookup(fileName);
try {
  const response: any = await xero.accountingApi.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, {
    headers: {
      "Content-Type": contentType,
    }
  });
  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 updateRepeatingInvoiceAttachmentByFileNameExample
    {
        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 repeatingInvoiceID = new UUID(); // UUID | Unique identifier for a Repeating Invoice (default to null)
            var fileName = xero-dev.jpg;  // String | The name of the file being attached to a Repeating Invoice (default to null)
            var body = BYTE_ARRAY_DATA_HERE;  // byte[] | 

            try
            {
                // Allows you to update specified attachment on repeating invoices by file name
                Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateRepeatingInvoiceAttachmentByFileName: " + 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->updateRepeatingInvoiceAttachmentByFileName: ', $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 $repeatingInvoiceID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Repeating Invoice
my $fileName = xero-dev.jpg; # String | The name of the file being attached to a Repeating Invoice
my $body = ::Object::byte[]->new(); # byte[] | 

eval { 
    my $result = $api_instance->updateRepeatingInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID, fileName => $fileName, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateRepeatingInvoiceAttachmentByFileName: $@\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)
repeatingInvoiceID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Repeating Invoice (default to null)
fileName = xero-dev.jpg # String | The name of the file being attached to a Repeating Invoice (default to null)
body = BYTE_ARRAY_DATA_HERE # byte[] | 

try: 
    # Allows you to update specified attachment on repeating invoices by file name
    api_response = api_instance.update_repeating_invoice_attachment_by_file_name(xeroTenantId, repeatingInvoiceID, fileName, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateRepeatingInvoiceAttachmentByFileName: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let repeatingInvoiceID = 00000000-0000-0000-000-000000000000; // UUID
    let fileName = xero-dev.jpg; // String
    let body = BYTE_ARRAY_DATA_HERE; // byte[]

    let mut context = AccountingApi::Context::default();
    let result = client.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
FileName*
String
The name of the file being attached to a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateTaxRate

Allows you to update Tax Rates


/TaxRates

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TaxRates"
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
        TaxRates taxRates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] }; // TaxRates | 
        try {
            TaxRates result = apiInstance.updateTaxRate(xeroTenantId, taxRates);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateTaxRate");
            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
        TaxRates taxRates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] }; // TaxRates | 
        try {
            TaxRates result = apiInstance.updateTaxRate(xeroTenantId, taxRates);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateTaxRate");
            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)
TaxRates *taxRates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update Tax Rates
[apiInstance updateTaxRateWith:xeroTenantId
    taxRates:taxRates
              completionHandler: ^(TaxRates 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 taxRates:TaxRates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] };  // {TaxRates} 
try {
  const response: any = await xero.accountingApi.updateTaxRate(xeroTenantId, taxRates);
  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 updateTaxRateExample
    {
        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 taxRates = new TaxRates(); // TaxRates | 

            try
            {
                // Allows you to update Tax Rates
                TaxRates result = apiInstance.updateTaxRate(xeroTenantId, taxRates);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateTaxRate: " + 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->updateTaxRate: ', $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 $taxRates = ::Object::TaxRates->new(); # TaxRates | 

eval { 
    my $result = $api_instance->updateTaxRate(xeroTenantId => $xeroTenantId, taxRates => $taxRates);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateTaxRate: $@\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)
taxRates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] } # TaxRates | 

try: 
    # Allows you to update Tax Rates
    api_response = api_instance.update_tax_rate(xeroTenantId, taxRates)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateTaxRate: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let taxRates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] }; // TaxRates

    let mut context = AccountingApi::Context::default();
    let result = client.updateTaxRate(xeroTenantId, taxRates, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
taxRates *
TaxRates
Required

updateTrackingCategory

Allows you to update tracking categories


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        TrackingCategory trackingCategory = { name:"Avengers" }; // TrackingCategory | 
        try {
            TrackingCategories result = apiInstance.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateTrackingCategory");
            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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        TrackingCategory trackingCategory = { name:"Avengers" }; // TrackingCategory | 
        try {
            TrackingCategories result = apiInstance.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateTrackingCategory");
            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)
UUID *trackingCategoryID = 00000000-0000-0000-000-000000000000; // Unique identifier for a TrackingCategory (default to null)
TrackingCategory *trackingCategory = { name:"Avengers" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update tracking categories
[apiInstance updateTrackingCategoryWith:xeroTenantId
    trackingCategoryID:trackingCategoryID
    trackingCategory:trackingCategory
              completionHandler: ^(TrackingCategories 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 trackingCategoryID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a TrackingCategory 
const trackingCategory:TrackingCategory = { name:"Avengers" };  // {TrackingCategory} 
try {
  const response: any = await xero.accountingApi.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory);
  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 updateTrackingCategoryExample
    {
        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 trackingCategoryID = new UUID(); // UUID | Unique identifier for a TrackingCategory (default to null)
            var trackingCategory = new TrackingCategory(); // TrackingCategory | 

            try
            {
                // Allows you to update tracking categories
                TrackingCategories result = apiInstance.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateTrackingCategory: " + 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->updateTrackingCategory: ', $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 $trackingCategoryID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a TrackingCategory
my $trackingCategory = ::Object::TrackingCategory->new(); # TrackingCategory | 

eval { 
    my $result = $api_instance->updateTrackingCategory(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID, trackingCategory => $trackingCategory);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateTrackingCategory: $@\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)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a TrackingCategory (default to null)
trackingCategory = { name:"Avengers" } # TrackingCategory | 

try: 
    # Allows you to update tracking categories
    api_response = api_instance.update_tracking_category(xeroTenantId, trackingCategoryID, trackingCategory)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateTrackingCategory: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID
    let trackingCategory = { name:"Avengers" }; // TrackingCategory

    let mut context = AccountingApi::Context::default();
    let result = client.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
trackingCategory *
TrackingCategory
Required

updateTrackingOptions

Allows you to update options for a specified tracking category


/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}

Usage and SDK Samples

curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"
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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        UUID trackingOptionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Tracking Option
        TrackingOption trackingOption = { name:"Vision" }; // TrackingOption | 
        try {
            TrackingOptions result = apiInstance.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateTrackingOptions");
            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
        UUID trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a TrackingCategory
        UUID trackingOptionID = 00000000-0000-0000-000-000000000000; // UUID | Unique identifier for a Tracking Option
        TrackingOption trackingOption = { name:"Vision" }; // TrackingOption | 
        try {
            TrackingOptions result = apiInstance.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountingApi#updateTrackingOptions");
            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)
UUID *trackingCategoryID = 00000000-0000-0000-000-000000000000; // Unique identifier for a TrackingCategory (default to null)
UUID *trackingOptionID = 00000000-0000-0000-000-000000000000; // Unique identifier for a Tracking Option (default to null)
TrackingOption *trackingOption = { name:"Vision" }; // 

AccountingApi *apiInstance = [[AccountingApi alloc] init];

// Allows you to update options for a specified tracking category
[apiInstance updateTrackingOptionsWith:xeroTenantId
    trackingCategoryID:trackingCategoryID
    trackingOptionID:trackingOptionID
    trackingOption:trackingOption
              completionHandler: ^(TrackingOptions 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 trackingCategoryID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a TrackingCategory 
const trackingOptionID = "00000000-0000-0000-000-000000000000";  // {UUID} Unique identifier for a Tracking Option 
const trackingOption:TrackingOption = { name:"Vision" };  // {TrackingOption} 
try {
  const response: any = await xero.accountingApi.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
  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 updateTrackingOptionsExample
    {
        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 trackingCategoryID = new UUID(); // UUID | Unique identifier for a TrackingCategory (default to null)
            var trackingOptionID = new UUID(); // UUID | Unique identifier for a Tracking Option (default to null)
            var trackingOption = new TrackingOption(); // TrackingOption | 

            try
            {
                // Allows you to update options for a specified tracking category
                TrackingOptions result = apiInstance.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountingApi.updateTrackingOptions: " + 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->updateTrackingOptions: ', $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 $trackingCategoryID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a TrackingCategory
my $trackingOptionID = 00000000-0000-0000-000-000000000000; # UUID | Unique identifier for a Tracking Option
my $trackingOption = ::Object::TrackingOption->new(); # TrackingOption | 

eval { 
    my $result = $api_instance->updateTrackingOptions(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID, trackingOptionID => $trackingOptionID, trackingOption => $trackingOption);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AccountingApi->updateTrackingOptions: $@\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)
trackingCategoryID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a TrackingCategory (default to null)
trackingOptionID = 00000000-0000-0000-000-000000000000 # UUID | Unique identifier for a Tracking Option (default to null)
trackingOption = { name:"Vision" } # TrackingOption | 

try: 
    # Allows you to update options for a specified tracking category
    api_response = api_instance.update_tracking_options(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AccountingApi->updateTrackingOptions: %s\n" % e)
extern crate AccountingApi;

pub fn main() {
    let xeroTenantId = YOUR_XERO_TENANT_ID; // String
    let trackingCategoryID = 00000000-0000-0000-000-000000000000; // UUID
    let trackingOptionID = 00000000-0000-0000-000-000000000000; // UUID
    let trackingOption = { name:"Vision" }; // TrackingOption

    let mut context = AccountingApi::Context::default();
    let result = client.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption, &context).wait();
    println!("{:?}", result);

}

Scopes

accounting.settings Grant read-write access to organisation and account settings

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
TrackingOptionID*
UUID (uuid)
Unique identifier for a Tracking Option
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Body parameters
Name Description
trackingOption *
TrackingOption
Required