Xero Accounting API

Accounting

createAccount

Creates a new chart of accounts


/Accounts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        Account account = new Account();
        account.setCode("123456");
        account.setName("FooBar");
        account.setType(com.xero.models.accounting.AccountType.EXPENSE);
        account.setDescription("Hello World");

        try {
            Accounts result = apiInstance.createAccount(accessToken, xeroTenantId, account, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createAccount");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
account *
Account
Account object in body of request
Required

createAccountAttachmentByFileName

Creates an attachment on a specific account


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createAccountAttachmentByFileName(accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createAccountAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createBankTransactionAttachmentByFileName

Creates an attachment for a specific bank transaction by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createBankTransactionAttachmentByFileName(accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactionAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createBankTransactionHistoryRecord

Creates a history record for a specific bank transactions


/BankTransactions/{BankTransactionID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createBankTransactionHistoryRecord(accessToken, xeroTenantId, bankTransactionID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactionHistoryRecord");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBankTransactions

Creates one or more spent or received money transaction


/BankTransactions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Account bankAccount = new Account();
        bankAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        BankTransaction bankTransaction = new BankTransaction();
        bankTransaction.setType(com.xero.models.accounting.BankTransaction.TypeEnum.RECEIVE);
        bankTransaction.setContact(contact);
        bankTransaction.setLineItems(lineItems);
        bankTransaction.setBankAccount(bankAccount);
        
        BankTransactions bankTransactions = new BankTransactions();
        bankTransactions.addBankTransactionsItem(bankTransaction);

        try {
            BankTransactions result = apiInstance.createBankTransactions(accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransactions");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects 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

Creates a bank transfer


/BankTransfers

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        Account fromBankAccount = new Account();
        fromBankAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Account toBankAccount = new Account();
        toBankAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        BankTransfer bankTransfer = new BankTransfer();
        bankTransfer.setFromBankAccount(fromBankAccount);
        bankTransfer.setToBankAccount(toBankAccount);
        bankTransfer.setAmount(1.0);
        
        BankTransfers bankTransfers = new BankTransfers();
        bankTransfers.addBankTransfersItem(bankTransfer);

        try {
            BankTransfers result = apiInstance.createBankTransfer(accessToken, xeroTenantId, bankTransfers, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransfer");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createBankTransferAttachmentByFileName(accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransferAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createBankTransferHistoryRecord

Creates a history record for a specific bank transfer


/BankTransfers/{BankTransferID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createBankTransferHistoryRecord(accessToken, xeroTenantId, bankTransferID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBankTransferHistoryRecord");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBatchPayment

Creates one or many batch payments for invoices


/BatchPayments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Account paymentAccount = new Account();
        paymentAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Account bankAccount = new Account();
        bankAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Invoice invoice = new Invoice();
        invoice.setInvoiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Payment payment = new Payment();
        payment.setAccount(bankAccount);
        payment.setDate(currDate);
        payment.setAmount(1.0);
        payment.setInvoice(invoice);

        List<Payment> payments = new ArrayList<Payment>();
        payments.add(payment);
        
        BatchPayment batchPayment = new BatchPayment();
        batchPayment.setAccount(paymentAccount);
        batchPayment.setReference("hello foobar");
        batchPayment.setDate(currDate);
        batchPayment.setPayments(payments);
        
        BatchPayments batchPayments = new BatchPayments();
        batchPayments.addBatchPaymentsItem(batchPayment);

        try {
            BatchPayments result = apiInstance.createBatchPayment(accessToken, xeroTenantId, batchPayments, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBatchPayment");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createBatchPaymentHistoryRecord

Creates a history record for a specific batch payment


/BatchPayments/{BatchPaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID batchPaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID batchPaymentID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createBatchPaymentHistoryRecord(accessToken, xeroTenantId, batchPaymentID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBatchPaymentHistoryRecord");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBrandingThemePaymentServices

Creates a new custom payment service for a specific branding theme


/BrandingThemes/{BrandingThemeID}/PaymentServices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID brandingThemeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID brandingThemeID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        PaymentService paymentService = new PaymentService();
        paymentService.setPaymentServiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        paymentService.setPaymentServiceName("ACME Payments");
        paymentService.setPaymentServiceUrl("https://www.payupnow.com/");
        paymentService.setPayNowText("Pay Now");
        
        PaymentServices paymentServices = new PaymentServices();
        paymentServices.addPaymentServicesItem(paymentService);

        try {
            PaymentServices result = apiInstance.createBrandingThemePaymentServices(accessToken, xeroTenantId, brandingThemeID, paymentServices, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createBrandingThemePaymentServices");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
paymentServices *
PaymentServices
PaymentServices array with PaymentService object in body of request
Required

createContactAttachmentByFileName


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createContactAttachmentByFileName(accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createContactAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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 of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createContactGroup

Creates a contact group


/ContactGroups

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        ContactGroup contactGroup = new ContactGroup();
        contactGroup.setName("VIPs");
        
        ContactGroups contactGroups = new ContactGroups();
        contactGroups.addContactGroupsItem(contactGroup);

        try {
            ContactGroups result = apiInstance.createContactGroup(accessToken, xeroTenantId, contactGroups, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createContactGroup");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contactGroups *
ContactGroups
ContactGroups with an array of names in request body
Required

createContactGroupContacts

Creates contacts to a specific contact group


/ContactGroups/{ContactGroupID}/Contacts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactGroupID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Contacts contacts = new Contacts();
        contacts.addContactsItem(contact);

        try {
            Contacts result = apiInstance.createContactGroupContacts(accessToken, xeroTenantId, contactGroupID, contacts, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createContactGroupContacts");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contacts *
Contacts
Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request
Required

createContactHistory

Creates a new history record for a specific contact


/Contacts/{ContactID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createContactHistory(accessToken, xeroTenantId, contactID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createContactHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createContacts

Creates multiple contacts (bulk) in a Xero organisation


/Contacts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        
        Phone phone = new Phone();
        phone.setPhoneNumber("555-1212");
        phone.setPhoneType(com.xero.models.accounting.Phone.PhoneTypeEnum.MOBILE);

        List<Phone> phones = new ArrayList<Phone>();
        phones.add(phone);
        
        Contact contact = new Contact();
        contact.setName("Bruce Banner");
        contact.setEmailAddress("hulk@avengers.com");
        contact.setPhones(phones);
        
        Contacts contacts = new Contacts();
        contacts.addContactsItem(contact);

        try {
            Contacts result = apiInstance.createContacts(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createContacts");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createCreditNoteAllocation

Creates allocation for a specific credit note


/CreditNotes/{CreditNoteID}/Allocations

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Invoice invoice = new Invoice();
        invoice.setInvoiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Allocation allocation = new Allocation();
        allocation.setAmount(1.0);
        allocation.setDate(currDate);
        allocation.setInvoice(invoice);
        
        Allocations allocations = new Allocations();
        allocations.addAllocationsItem(allocation);

        try {
            Allocations result = apiInstance.createCreditNoteAllocation(accessToken, xeroTenantId, creditNoteID, allocations, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteAllocation");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
allocations *
Allocations
Allocations with 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 objects and any with validation errors

createCreditNoteAttachmentByFileName

Creates an attachment for a specific credit note


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        Boolean includeOnline = true;
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createCreditNoteAttachmentByFileName(accessToken, xeroTenantId, creditNoteID, fileName, body, includeOnline, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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 attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required
Query parameters
Name Description
IncludeOnline
Boolean
Allows an attachment to be seen by the end customer within their online invoice

createCreditNoteHistory

Retrieves history records of a specific credit note


/CreditNotes/{CreditNoteID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createCreditNoteHistory(accessToken, xeroTenantId, creditNoteID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNoteHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createCreditNotes

Creates a new credit note


/CreditNotes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        CreditNote creditNote = new CreditNote();
        creditNote.setType(com.xero.models.accounting.CreditNote.TypeEnum.ACCPAYCREDIT);
        creditNote.setContact(contact);
        creditNote.setDate(currDate);
        creditNote.setLineItems(lineItems);
        
        CreditNotes creditNotes = new CreditNotes();
        creditNotes.addCreditNotesItem(creditNote);

        try {
            CreditNotes result = apiInstance.createCreditNotes(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createCreditNotes");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects 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

Create a new currency for a Xero organisation


/Currencies

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        Currency currency = new Currency();
        currency.setCode(com.xero.models.accounting.CurrencyCode.USD);
        currency.setDescription("United States Dollar");

        try {
            Currencies result = apiInstance.createCurrency(accessToken, xeroTenantId, currency, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createCurrency");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
currency *
Currency
Currency object in the body of request
Required

createEmployees

Creates new employees used in Xero payrun


/Employees

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        
        Employee employee = new Employee();
        employee.setFirstName("Nick");
        employee.setLastName("Fury");
        
        Employees employees = new Employees();
        employees.addEmployeesItem(employee);

        try {
            Employees result = apiInstance.createEmployees(accessToken, xeroTenantId, employees, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createEmployees");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createExpenseClaimHistory

Creates a history record for a specific expense claim


/ExpenseClaims/{ExpenseClaimID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID expenseClaimID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createExpenseClaimHistory(accessToken, xeroTenantId, expenseClaimID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createExpenseClaimHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createExpenseClaims

Creates expense claims


/ExpenseClaims

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        User user = new User();
        user.setUserID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Receipt receipt = new Receipt();
        receipt.setReceiptID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        receipt.setDate(currDate);

        List<Receipt> receipts = new ArrayList<Receipt>();
        receipts.add(receipt);
        
        ExpenseClaim expenseClaim = new ExpenseClaim();
        expenseClaim.setStatus(com.xero.models.accounting.ExpenseClaim.StatusEnum.SUBMITTED);
        expenseClaim.setUser(user);
        expenseClaim.setReceipts(receipts);
        
        ExpenseClaims expenseClaims = new ExpenseClaims();
        expenseClaims.addExpenseClaimsItem(expenseClaim);

        try {
            ExpenseClaims result = apiInstance.createExpenseClaims(accessToken, xeroTenantId, expenseClaims, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createExpenseClaims");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
expenseClaims *
ExpenseClaims
ExpenseClaims with array of ExpenseClaim object in body of request
Required

createInvoiceAttachmentByFileName

Creates an attachment for a specific invoice or purchase bill by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        Boolean includeOnline = true;
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createInvoiceAttachmentByFileName(accessToken, xeroTenantId, invoiceID, fileName, body, includeOnline, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createInvoiceAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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 attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required
Query parameters
Name Description
IncludeOnline
Boolean
Allows an attachment to be seen by the end customer within their online invoice

createInvoiceHistory

Creates a history record for a specific invoice


/Invoices/{InvoiceID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createInvoiceHistory(accessToken, xeroTenantId, invoiceID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createInvoiceHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createInvoices

Creates one or more sales invoices or purchase bills


/Invoices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        LocalDate dueDateValue = LocalDate.of(2020, Month.OCTOBER, 28);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItemTracking lineItemTracking = new LineItemTracking();
        lineItemTracking.setTrackingCategoryID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        lineItemTracking.setTrackingOptionID(UUID.fromString("00000000-0000-0000-0000-000000000000"));

        List<LineItemTracking> lineItemTrackings = new ArrayList<LineItemTracking>();
        lineItemTrackings.add(lineItemTracking);
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");
        lineItem.setTracking(lineItemTrackings);

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Invoice invoice = new Invoice();
        invoice.setType(com.xero.models.accounting.Invoice.TypeEnum.ACCREC);
        invoice.setContact(contact);
        invoice.setDate(dateValue);
        invoice.setDueDate(dueDateValue);
        invoice.setLineItems(lineItems);
        invoice.setReference("Website Design");
        invoice.setStatus(com.xero.models.accounting.Invoice.StatusEnum.DRAFT);
        
        Invoices invoices = new Invoices();
        invoices.addInvoicesItem(invoice);

        try {
            Invoices result = apiInstance.createInvoices(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createInvoices");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects 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

Creates a history record for a specific item


/Items/{ItemID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID itemID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createItemHistory(accessToken, xeroTenantId, itemID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createItemHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createItems

Creates one or more items


/Items

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Purchase purchaseDetails = new Purchase();
        purchaseDetails.setCoGSAccountCode("500");
        
        Item item = new Item();
        item.setCode("abcXYZ123");
        item.setName("HelloWorld");
        item.setDescription("Foobar");
        item.setInventoryAssetAccountCode("140");
        item.setPurchaseDetails(purchaseDetails);
        
        Items items = new Items();
        items.addItemsItem(item);

        try {
            Items result = apiInstance.createItems(accessToken, xeroTenantId, items, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createItems");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects 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

Creates linked transactions (billable expenses)


/LinkedTransactions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        LinkedTransaction linkedTransaction = new LinkedTransaction();
        linkedTransaction.setSourceTransactionID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        linkedTransaction.setSourceLineItemID(UUID.fromString("00000000-0000-0000-0000-000000000000"));

        try {
            LinkedTransactions result = apiInstance.createLinkedTransaction(accessToken, xeroTenantId, linkedTransaction, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createLinkedTransaction");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
linkedTransaction *
LinkedTransaction
LinkedTransaction object in body of request
Required

createManualJournalAttachmentByFileName

Creates a specific attachment for a specific manual journal by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createManualJournalAttachmentByFileName(accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournalAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createManualJournalHistoryRecord

Creates a history record for a specific manual journal


/ManualJournals/{ManualJournalID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createManualJournalHistoryRecord(accessToken, xeroTenantId, manualJournalID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournalHistoryRecord");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createManualJournals

Creates one or more manual journals


/ManualJournals

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);

        List<ManualJournalLine> manualJournalLines = new ArrayList<ManualJournalLine>();
        
        ManualJournalLine credit = new ManualJournalLine();
        credit.setLineAmount(-100.0);
        credit.setAccountCode("400");
        credit.setDescription("Hello there");
        manualJournalLines.add(credit);
        
        ManualJournalLine debit = new ManualJournalLine();
        debit.setLineAmount(100.0);
        debit.setAccountCode("120");
        debit.setDescription("Hello there");
        manualJournalLines.add(debit);
        
        ManualJournal manualJournal = new ManualJournal();
        manualJournal.setNarration("Foobar");
        manualJournal.setDate(dateValue);
        manualJournal.setJournalLines(manualJournalLines);
        
        ManualJournals manualJournals = new ManualJournals();
        manualJournals.addManualJournalsItem(manualJournal);

        try {
            ManualJournals result = apiInstance.createManualJournals(accessToken, xeroTenantId, manualJournals, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createManualJournals");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createOverpaymentAllocations

Creates a single allocation for a specific overpayment


/Overpayments/{OverpaymentID}/Allocations

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID overpaymentID = '00000000-0000-0000-0000-000000000000';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Invoice invoice = new Invoice();
        invoice.setInvoiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Allocation allocation = new Allocation();
        allocation.setAmount(1.0);
        allocation.setDate(currDate);
        allocation.setInvoice(invoice);
        
        Allocations allocations = new Allocations();
        allocations.addAllocationsItem(allocation);

        try {
            Allocations result = apiInstance.createOverpaymentAllocations(accessToken, xeroTenantId, overpaymentID, allocations, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createOverpaymentAllocations");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createOverpaymentHistory

Creates a history record for a specific overpayment


/Overpayments/{OverpaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID overpaymentID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createOverpaymentHistory(accessToken, xeroTenantId, overpaymentID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createOverpaymentHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPayment

Creates a single payment for invoice or credit notes


/Payments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Invoice invoice = new Invoice();
        invoice.setInvoiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Account account = new Account();
        account.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Payment payment = new Payment();
        payment.setInvoice(invoice);
        payment.setAccount(account);
        payment.setAmount(1.0);
        payment.setDate(dateValue);
        
        Payments payments = new Payments();
        payments.addPaymentsItem(payment);

        try {
            Payments result = apiInstance.createPayment(accessToken, xeroTenantId, payment, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPayment");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payment *
Payment
Request body with a single Payment object
Required

createPaymentHistory

Creates a history record for a specific payment


/Payments/{PaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID paymentID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createPaymentHistory(accessToken, xeroTenantId, paymentID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPaymentHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPaymentService

Creates a payment service


/PaymentServices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        PaymentService paymentService = new PaymentService();
        paymentService.setPaymentServiceName("ACME Payments");
        paymentService.setPaymentServiceUrl("https://www.payupnow.com/");
        paymentService.setPayNowText("Pay Now");
        
        PaymentServices paymentServices = new PaymentServices();
        paymentServices.addPaymentServicesItem(paymentService);

        try {
            PaymentServices result = apiInstance.createPaymentService(accessToken, xeroTenantId, paymentServices, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPaymentService");
            e.printStackTrace();
        }
    }
}

Scopes

paymentservices Grant read-write access to payment services

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
paymentServices *
PaymentServices
PaymentServices array with PaymentService object in body of request
Required

createPayments

Creates multiple payments for invoices or credit notes


/Payments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Invoice invoice = new Invoice();
        invoice.setInvoiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Account account = new Account();
        account.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Payment payment = new Payment();
        payment.setInvoice(invoice);
        payment.setAccount(account);
        payment.setAmount(1.0);
        payment.setDate(dateValue);
        
        Payments payments = new Payments();
        payments.addPaymentsItem(payment);

        try {
            Payments result = apiInstance.createPayments(accessToken, xeroTenantId, payments, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPayments");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payments *
Payments
Payments array with Payment object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createPrepaymentAllocations

Allows you to create an Allocation for prepayments


/Prepayments/{PrepaymentID}/Allocations

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID prepaymentID = '00000000-0000-0000-0000-000000000000';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Invoice invoice = new Invoice();
        invoice.setInvoiceID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Allocation allocation = new Allocation();
        allocation.setInvoice(invoice);
        allocation.setAmount(1.0);
        allocation.setDate(currDate);
        
        Allocations allocations = new Allocations();
        allocations.addAllocationsItem(allocation);

        try {
            Allocations result = apiInstance.createPrepaymentAllocations(accessToken, xeroTenantId, prepaymentID, allocations, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPrepaymentAllocations");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createPrepaymentHistory

Creates a history record for a specific prepayment


/Prepayments/{PrepaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID prepaymentID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createPrepaymentHistory(accessToken, xeroTenantId, prepaymentID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPrepaymentHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPurchaseOrderAttachmentByFileName

Creates attachment for a specific purchase order


/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createPurchaseOrderAttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrderAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for an Purchase Order
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createPurchaseOrderHistory

Creates a history record for a specific purchase orders


/PurchaseOrders/{PurchaseOrderID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createPurchaseOrderHistory(accessToken, xeroTenantId, purchaseOrderID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrderHistory");
            e.printStackTrace();
        }
    }
}

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 an Purchase Order
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPurchaseOrders

Creates one or more purchase orders


/PurchaseOrders

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        PurchaseOrder purchaseOrder = new PurchaseOrder();
        purchaseOrder.setContact(contact);
        purchaseOrder.setLineItems(lineItems);
        purchaseOrder.setDate(dateValue);
        
        PurchaseOrders purchaseOrders = new PurchaseOrders();
        purchaseOrders.addPurchaseOrdersItem(purchaseOrder);

        try {
            PurchaseOrders result = apiInstance.createPurchaseOrders(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createPurchaseOrders");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createQuoteAttachmentByFileName

Creates attachment for a specific quote


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createQuoteAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createQuoteHistory

Creates a history record for a specific quote


/Quotes/{QuoteID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createQuoteHistory(accessToken, xeroTenantId, quoteID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createQuoteHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createQuotes

Create one or more quotes


/Quotes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Quote quote = new Quote();
        quote.setContact(contact);
        quote.setLineItems(lineItems);
        quote.setDate(dateValue);
        
        Quotes quotes = new Quotes();
        quotes.addQuotesItem(quote);

        try {
            Quotes result = apiInstance.createQuotes(accessToken, xeroTenantId, quotes, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createQuotes");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

createReceipt

Creates draft expense claim receipts for any user


/Receipts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        User user = new User();
        user.setUserID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Receipt receipt = new Receipt();
        receipt.setContact(contact);
        receipt.setUser(user);
        receipt.setLineItems(lineItems);
        receipt.setLineAmountTypes(com.xero.models.accounting.LineAmountTypes.INCLUSIVE);
        receipt.setStatus(com.xero.models.accounting.Receipt.StatusEnum.DRAFT);
        
        Receipts receipts = new Receipts();
        receipts.addReceiptsItem(receipt);

        try {
            Receipts result = apiInstance.createReceipt(accessToken, xeroTenantId, receipts, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createReceipt");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

Creates an attachment on a specific expense claim receipts by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createReceiptAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createReceiptHistory

Creates a history record for a specific receipt


/Receipts/{ReceiptID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createReceiptHistory(accessToken, xeroTenantId, receiptID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createReceiptHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createRepeatingInvoiceAttachmentByFileName

Creates an attachment from a specific repeating invoices by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.createRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

createRepeatingInvoiceHistory

Creates a history record for a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        HistoryRecord historyRecord = new HistoryRecord();
        historyRecord.setDetails("Hello World");
        
        HistoryRecords historyRecords = new HistoryRecords();
        historyRecords.addHistoryRecordsItem(historyRecord);

        try {
            HistoryRecords result = apiInstance.createRepeatingInvoiceHistory(accessToken, xeroTenantId, repeatingInvoiceID, historyRecords, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceHistory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createRepeatingInvoices

Creates one or more repeating invoice templates


/RepeatingInvoices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';

        try {
            RepeatingInvoices result = apiInstance.createRepeatingInvoices(accessToken, xeroTenantId, repeatingInvoices, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createRepeatingInvoices");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
repeatingInvoices *
RepeatingInvoices
RepeatingInvoices with an array of repeating invoice objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createTaxRates

Creates one or more tax rates


/TaxRates

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        TaxComponent taxComponent = new TaxComponent();
        taxComponent.setName("State Tax");
        taxComponent.setRate(2.25);

        List<TaxComponent> taxComponent = new ArrayList<TaxComponent>();
        taxComponents.add(taxComponent);
        
        TaxRate taxRate = new TaxRate();
        taxRate.setName("CA State Tax");
        taxRate.setTaxComponents(taxComponents);
        
        TaxRates taxRates = new TaxRates();
        taxRates.addTaxRatesItem(taxRate);

        try {
            TaxRates result = apiInstance.createTaxRates(accessToken, xeroTenantId, taxRates, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createTaxRates");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
taxRates *
TaxRates
TaxRates array with TaxRate object in body of request
Required

createTrackingCategory

Create tracking categories


/TrackingCategories

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        TrackingCategory trackingCategory = new TrackingCategory();
        trackingCategory.setName("Foobar");

        try {
            TrackingCategories result = apiInstance.createTrackingCategory(accessToken, xeroTenantId, trackingCategory, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createTrackingCategory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingCategory *
TrackingCategory
TrackingCategory object in body of request
Required

createTrackingOptions

Creates options for a specific tracking category


/TrackingCategories/{TrackingCategoryID}/Options

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingCategoryID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        TrackingOption trackingOption = new TrackingOption();
        trackingOption.setName("Foobar");

        try {
            TrackingOptions result = apiInstance.createTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOption, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#createTrackingOptions");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingOption *
TrackingOption
TrackingOption object in body of request
Required

deleteAccount

Deletes a chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';

        try {
            Accounts result = apiInstance.deleteAccount(accessToken, xeroTenantId, accountID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteAccount");
            e.printStackTrace();
        }
    }
}

Scopes

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

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

deleteBatchPayment

Updates a specific batch payment for invoices and credit notes


/BatchPayments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        BatchPaymentDelete batchPaymentDelete = new BatchPaymentDelete();
        batchPaymentDelete.setStatus("DELETED");
        batchPaymentDelete.setBatchPaymentID(UUID.fromString("00000000-0000-0000-0000-000000000000"));

        try {
            BatchPayments result = apiInstance.deleteBatchPayment(accessToken, xeroTenantId, batchPaymentDelete, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteBatchPayment");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
batchPaymentDelete *
BatchPaymentDelete
Required

deleteBatchPaymentByUrlParam

Updates a specific batch payment for invoices and credit notes


/BatchPayments/{BatchPaymentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID batchPaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID batchPaymentID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';

        try {
            BatchPayments result = apiInstance.deleteBatchPaymentByUrlParam(accessToken, xeroTenantId, batchPaymentID, batchPaymentDeleteByUrlParam, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteBatchPaymentByUrlParam");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
batchPaymentDeleteByUrlParam *
BatchPaymentDeleteByUrlParam
Required

deleteContactGroupContact

Deletes a specific contact from a contact group using a unique contact Id


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactGroupID = '00000000-0000-0000-0000-000000000000';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';

        try {
             result = apiInstance.deleteContactGroupContact(accessToken, xeroTenantId, contactGroupID, contactID);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteContactGroupContact");
            e.printStackTrace();
        }
    }
}

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

Deletes all contacts from a specific contact group


/ContactGroups/{ContactGroupID}/Contacts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactGroupID = '00000000-0000-0000-0000-000000000000';

        try {
             result = apiInstance.deleteContactGroupContacts(accessToken, xeroTenantId, contactGroupID);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteContactGroupContacts");
            e.printStackTrace();
        }
    }
}

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

deleteCreditNoteAllocations

Deletes an Allocation from a Credit Note


/CreditNotes/{CreditNoteID}/Allocations/{AllocationID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        UUID allocationID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID allocationID = '00000000-0000-0000-0000-000000000000';

        try {
            Allocation result = apiInstance.deleteCreditNoteAllocations(accessToken, xeroTenantId, creditNoteID, allocationID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteCreditNoteAllocations");
            e.printStackTrace();
        }
    }
}

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
AllocationID*
UUID (uuid)
Unique identifier for Allocation object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteItem

Deletes a specific item


/Items/{ItemID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID itemID = '00000000-0000-0000-0000-000000000000';

        try {
             result = apiInstance.deleteItem(accessToken, xeroTenantId, itemID);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteItem");
            e.printStackTrace();
        }
    }
}

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

Deletes a specific linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID linkedTransactionID = '00000000-0000-0000-0000-000000000000';

        try {
             result = apiInstance.deleteLinkedTransaction(accessToken, xeroTenantId, linkedTransactionID);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteLinkedTransaction");
            e.printStackTrace();
        }
    }
}

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

deleteOverpaymentAllocations

Deletes an Allocation from an overpayment


/Overpayments/{OverpaymentID}/Allocations/{AllocationID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID overpaymentID = '00000000-0000-0000-0000-000000000000';
        UUID allocationID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID allocationID = '00000000-0000-0000-0000-000000000000';

        try {
            Allocation result = apiInstance.deleteOverpaymentAllocations(accessToken, xeroTenantId, overpaymentID, allocationID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteOverpaymentAllocations");
            e.printStackTrace();
        }
    }
}

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
AllocationID*
UUID (uuid)
Unique identifier for Allocation object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deletePayment

Updates a specific payment for invoices and credit notes


/Payments/{PaymentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID paymentID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        PaymentDelete paymentDelete = new PaymentDelete();
        paymentDelete.setStatus("DELETED");

        try {
            Payments result = apiInstance.deletePayment(accessToken, xeroTenantId, paymentID, paymentDelete, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deletePayment");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
paymentDelete *
PaymentDelete
Required

deletePrepaymentAllocations

Deletes an Allocation from a Prepayment


/Prepayments/{PrepaymentID}/Allocations/{AllocationID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID prepaymentID = '00000000-0000-0000-0000-000000000000';
        UUID allocationID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID allocationID = '00000000-0000-0000-0000-000000000000';

        try {
            Allocation result = apiInstance.deletePrepaymentAllocations(accessToken, xeroTenantId, prepaymentID, allocationID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deletePrepaymentAllocations");
            e.printStackTrace();
        }
    }
}

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
AllocationID*
UUID (uuid)
Unique identifier for Allocation object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteTrackingCategory

Deletes a specific tracking category


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingCategoryID = '00000000-0000-0000-0000-000000000000';

        try {
            TrackingCategories result = apiInstance.deleteTrackingCategory(accessToken, xeroTenantId, trackingCategoryID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteTrackingCategory");
            e.printStackTrace();
        }
    }
}

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

Deletes a specific option for a specific tracking category


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingCategoryID = '00000000-0000-0000-0000-000000000000';
        UUID trackingOptionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingOptionID = '00000000-0000-0000-0000-000000000000';

        try {
            TrackingOptions result = apiInstance.deleteTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#deleteTrackingOptions");
            e.printStackTrace();
        }
    }
}

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

Sends a copy of a specific invoice to related contact via email


/Invoices/{InvoiceID}/Email

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        RequestEmpty requestEmpty = new RequestEmpty();

        try {
             result = apiInstance.emailInvoice(accessToken, xeroTenantId, invoiceID, requestEmpty, idempotencyKey);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#emailInvoice");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
requestEmpty *
RequestEmpty
Required

getAccount

Retrieves a single chart of accounts by using a unique account Id


/Accounts/{AccountID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';

        try {
            Accounts result = apiInstance.getAccount(accessToken, xeroTenantId, accountID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getAccount");
            e.printStackTrace();
        }
    }
}

Scopes

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

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

getAccountAttachmentByFileName

Retrieves an attachment for a specific account by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getAccountAttachmentByFileName(accessToken, xeroTenantId, accountID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves a specific attachment from a specific account using a unique attachment Id


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getAccountAttachmentById(accessToken, xeroTenantId, accountID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves attachments for a specific accounts by using a unique account Id


/Accounts/{AccountID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getAccountAttachments(accessToken, xeroTenantId, accountID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getAccountAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves the full chart of accounts


/Accounts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="ACTIVE" AND Type=="BANK"';
        String order = 'Name ASC';

        try {
            Accounts result = apiInstance.getAccounts(accessToken, xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getAccounts");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

getBankTransaction

Retrieves a single spent or received money transaction by using a unique bank transaction Id


/BankTransactions/{BankTransactionID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;

        try {
            BankTransactions result = apiInstance.getBankTransaction(accessToken, xeroTenantId, bankTransactionID, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransaction");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific attachment from a specific bank transaction by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getBankTransactionAttachmentByFileName(accessToken, xeroTenantId, bankTransactionID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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
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

getBankTransactionAttachmentById

Retrieves specific attachments from a specific BankTransaction using a unique attachment Id


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getBankTransactionAttachmentById(accessToken, xeroTenantId, bankTransactionID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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)
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

getBankTransactionAttachments

Retrieves any attachments from a specific bank transactions


/BankTransactions/{BankTransactionID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getBankTransactionAttachments(accessToken, xeroTenantId, bankTransactionID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves any spent or received money transactions


/BankTransactions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="AUTHORISED"';
        String order = 'Type ASC';
        Integer page = 1;
        Integer unitdp = 4;
        Integer pageSize = 100;

        try {
            BankTransactions result = apiInstance.getBankTransactions(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactions");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
pageSize
Integer
Number of records to retrieve per page

getBankTransactionsHistory

Retrieves history from a specific bank transaction using a unique bank transaction Id


/BankTransactions/{BankTransactionID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getBankTransactionsHistory(accessToken, xeroTenantId, bankTransactionID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransactionsHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves specific bank transfers by using a unique bank transfer Id


/BankTransfers/{BankTransferID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';

        try {
            BankTransfers result = apiInstance.getBankTransfer(accessToken, xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransfer");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific attachment on a specific bank transfer by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getBankTransferAttachmentByFileName(accessToken, xeroTenantId, bankTransferID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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
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

getBankTransferAttachmentById

Retrieves a specific attachment from a specific bank transfer using a unique attachment ID


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getBankTransferAttachmentById(accessToken, xeroTenantId, bankTransferID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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)
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

getBankTransferAttachments

Retrieves attachments from a specific bank transfer


/BankTransfers/{BankTransferID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getBankTransferAttachments(accessToken, xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves history from a specific bank transfer using a unique bank transfer Id


/BankTransfers/{BankTransferID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getBankTransferHistory(accessToken, xeroTenantId, bankTransferID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransferHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves all bank transfers


/BankTransfers

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'HasAttachments==true';
        String order = 'Amount ASC';

        try {
            BankTransfers result = apiInstance.getBankTransfers(accessToken, xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBankTransfers");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

getBatchPayment

Retrieves a specific batch payment using a unique batch payment Id


/BatchPayments/{BatchPaymentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID batchPaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID batchPaymentID = '00000000-0000-0000-0000-000000000000';

        try {
            BatchPayments result = apiInstance.getBatchPayment(accessToken, xeroTenantId, batchPaymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPayment");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

getBatchPaymentHistory

Retrieves history from a specific batch payment


/BatchPayments/{BatchPaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID batchPaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID batchPaymentID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getBatchPaymentHistory(accessToken, xeroTenantId, batchPaymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPaymentHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves either one or many batch payments for invoices


/BatchPayments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="AUTHORISED"';
        String order = 'Date ASC';

        try {
            BatchPayments result = apiInstance.getBatchPayments(accessToken, xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBatchPayments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific branding theme using a unique branding theme Id


/BrandingThemes/{BrandingThemeID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID brandingThemeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID brandingThemeID = '00000000-0000-0000-0000-000000000000';

        try {
            BrandingThemes result = apiInstance.getBrandingTheme(accessToken, xeroTenantId, brandingThemeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingTheme");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves the payment services for a specific branding theme


/BrandingThemes/{BrandingThemeID}/PaymentServices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID brandingThemeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID brandingThemeID = '00000000-0000-0000-0000-000000000000';

        try {
            PaymentServices result = apiInstance.getBrandingThemePaymentServices(accessToken, xeroTenantId, brandingThemeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingThemePaymentServices");
            e.printStackTrace();
        }
    }
}

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

Retrieves all the branding themes


/BrandingThemes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        try {
            BrandingThemes result = apiInstance.getBrandingThemes(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBrandingThemes");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

getBudget

Retrieves a specific budget, which includes budget lines


/Budgets/{BudgetID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID budgetID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID budgetID = '00000000-0000-0000-0000-000000000000';
        date dateTo = 2019-10-31;
        date dateFrom = 2019-10-31;

        try {
            Budgets result = apiInstance.getBudget(accessToken, xeroTenantId, budgetID, dateTo, dateFrom);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBudget");
            e.printStackTrace();
        }
    }
}

Scopes

Parameters

Path parameters
Name Description
BudgetID*
UUID (uuid)
Unique identifier for Budgets
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
DateTo
date (date)
Filter by start date
DateFrom
date (date)
Filter by end date

getBudgets

Retrieve a list of budgets


/Budgets

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        array[UUID] iDs = "00000000-0000-0000-0000-000000000000";
        date dateTo = 2019-10-31;
        date dateFrom = 2019-10-31;

        try {
            Budgets result = apiInstance.getBudgets(accessToken, xeroTenantId, iDs, dateTo, dateFrom);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getBudgets");
            e.printStackTrace();
        }
    }
}

Scopes

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
IDs
array[UUID] (uuid)
Filter by BudgetID. Allows you to retrieve a specific individual budget.
DateTo
date (date)
Filter by start date
DateFrom
date (date)
Filter by end date

getContact

Retrieves a specific contacts in a Xero organisation using a unique contact Id


/Contacts/{ContactID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';

        try {
            Contacts result = apiInstance.getContact(accessToken, xeroTenantId, contactID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContact");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups
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

Retrieves a specific attachment from a specific contact by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getContactAttachmentByFileName(accessToken, xeroTenantId, contactID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getContactAttachmentById

Retrieves a specific attachment from a specific contact using a unique attachment Id


/Contacts/{ContactID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getContactAttachmentById(accessToken, xeroTenantId, contactID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getContactAttachments

Retrieves attachments for a specific contact in a Xero organisation


/Contacts/{ContactID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getContactAttachments(accessToken, xeroTenantId, contactID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

getContactByContactNumber

Retrieves a specific contact by contact number in a Xero organisation


/Contacts/{ContactNumber}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String contactNumber = 'SB2';

        try {
            Contacts result = apiInstance.getContactByContactNumber(accessToken, xeroTenantId, contactNumber);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactByContactNumber");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
ContactNumber*
String
This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getContactCISSettings

Retrieves CIS settings for a specific contact in a Xero organisation


/Contacts/{ContactID}/CISSettings

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';

        try {
            CISSettings result = apiInstance.getContactCISSettings(accessToken, xeroTenantId, contactID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactCISSettings");
            e.printStackTrace();
        }
    }
}

Scopes

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

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

Retrieves a specific contact group by using a unique contact group Id


/ContactGroups/{ContactGroupID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactGroupID = '00000000-0000-0000-0000-000000000000';

        try {
            ContactGroups result = apiInstance.getContactGroup(accessToken, xeroTenantId, contactGroupID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactGroup");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups
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

Retrieves the contact Id and name of each contact group


/ContactGroups

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String where = 'Status=="ACTIVE"';
        String order = 'Name ASC';

        try {
            ContactGroups result = apiInstance.getContactGroups(accessToken, xeroTenantId, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactGroups");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups
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

Retrieves history records for a specific contact


/Contacts/{ContactID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getContactHistory(accessToken, xeroTenantId, contactID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContactHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups
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

Retrieves all contacts in a Xero organisation


/Contacts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'ContactStatus=="ACTIVE"';
        String order = 'Name ASC';
        array[UUID] iDs = "00000000-0000-0000-0000-000000000000";
        Integer page = 1;
        Boolean includeArchived = true;
        Boolean summaryOnly = true;
        String searchTerm = 'Joe Bloggs';
        Integer pageSize = 100;

        try {
            Contacts result = apiInstance.getContacts(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived, summaryOnly, searchTerm, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getContacts");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.contacts Grant read-write access to contacts and contact groups
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
summaryOnly
Boolean
Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
searchTerm
String
Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields.
pageSize
Integer
Number of records to retrieve per page

getCreditNote

Retrieves a specific credit note using a unique credit note Id


/CreditNotes/{CreditNoteID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;

        try {
            CreditNotes result = apiInstance.getCreditNote(accessToken, xeroTenantId, creditNoteID, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNote");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves credit notes as PDF files


/CreditNotes/{CreditNoteID}/pdf

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';

        try {
            ByteArrayInputStream result = apiInstance.getCreditNoteAsPdf(accessToken, xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAsPdf");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

getCreditNoteAttachmentByFileName

Retrieves a specific attachment on a specific credit note by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getCreditNoteAttachmentByFileName(accessToken, xeroTenantId, creditNoteID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getCreditNoteAttachmentById

Retrieves a specific attachment from a specific credit note using a unique attachment Id


/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getCreditNoteAttachmentById(accessToken, xeroTenantId, creditNoteID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getCreditNoteAttachments

Retrieves attachments for a specific credit notes


/CreditNotes/{CreditNoteID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getCreditNoteAttachments(accessToken, xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves history records of a specific credit note


/CreditNotes/{CreditNoteID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getCreditNoteHistory(accessToken, xeroTenantId, creditNoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNoteHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves any credit notes


/CreditNotes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="DRAFT"';
        String order = 'CreditNoteNumber ASC';
        Integer page = 1;
        Integer unitdp = 4;
        Integer pageSize = 100;

        try {
            CreditNotes result = apiInstance.getCreditNotes(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCreditNotes");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
pageSize
Integer
Number of records to retrieve per page

getCurrencies

Retrieves currencies for your Xero organisation


/Currencies

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String where = 'Code=="USD"';
        String order = 'Code ASC';

        try {
            Currencies result = apiInstance.getCurrencies(accessToken, xeroTenantId, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getCurrencies");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves a specific employee used in Xero payrun using a unique employee Id


/Employees/{EmployeeID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID employeeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID employeeID = '00000000-0000-0000-0000-000000000000';

        try {
            Employees result = apiInstance.getEmployee(accessToken, xeroTenantId, employeeID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getEmployee");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves employees used in Xero payrun


/Employees

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="ACTIVE"';
        String order = 'LastName ASC';

        try {
            Employees result = apiInstance.getEmployees(accessToken, xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getEmployees");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves a specific expense claim using a unique expense claim Id


/ExpenseClaims/{ExpenseClaimID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID expenseClaimID = '00000000-0000-0000-0000-000000000000';

        try {
            ExpenseClaims result = apiInstance.getExpenseClaim(accessToken, xeroTenantId, expenseClaimID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaim");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves history records of a specific expense claim


/ExpenseClaims/{ExpenseClaimID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID expenseClaimID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getExpenseClaimHistory(accessToken, xeroTenantId, expenseClaimID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaimHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves expense claims


/ExpenseClaims

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="SUBMITTED"';
        String order = 'Status ASC';

        try {
            ExpenseClaims result = apiInstance.getExpenseClaims(accessToken, xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getExpenseClaims");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific sales invoice or purchase bill using a unique invoice Id


/Invoices/{InvoiceID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;

        try {
            Invoices result = apiInstance.getInvoice(accessToken, xeroTenantId, invoiceID, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoice");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves invoices or purchase bills as PDF files


/Invoices/{InvoiceID}/pdf

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            ByteArrayInputStream result = apiInstance.getInvoiceAsPdf(accessToken, xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAsPdf");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves an attachment from a specific invoice or purchase bill by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getInvoiceAttachmentByFileName(accessToken, xeroTenantId, invoiceID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getInvoiceAttachmentById

Retrieves a specific attachment from a specific invoices or purchase bills by using a unique attachment Id


/Invoices/{InvoiceID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getInvoiceAttachmentById(accessToken, xeroTenantId, invoiceID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getInvoiceAttachments

Retrieves attachments for a specific invoice or purchase bill


/Invoices/{InvoiceID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getInvoiceAttachments(accessToken, xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves history records for a specific invoice


/Invoices/{InvoiceID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getInvoiceHistory(accessToken, xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves invoice reminder settings


/InvoiceReminders/Settings

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        try {
            InvoiceReminders result = apiInstance.getInvoiceReminders(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoiceReminders");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

getInvoices

Retrieves sales invoices or purchase bills


/Invoices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="DRAFT"';
        String order = 'InvoiceNumber ASC';
        array[UUID] iDs = "00000000-0000-0000-0000-000000000000";
        array[String] invoiceNumbers = "INV-001", "INV-002";
        array[UUID] contactIDs = "00000000-0000-0000-0000-000000000000";
        array[String] statuses = "DRAFT", "SUBMITTED";
        Integer page = 1;
        Boolean includeArchived = true;
        Boolean createdByMyApp = false;
        Integer unitdp = 4;
        Boolean summaryOnly = true;
        Integer pageSize = 100;
        String searchTerm = 'SearchTerm=REF12';

        try {
            Invoices result = apiInstance.getInvoices(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp, summaryOnly, pageSize, searchTerm);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getInvoices");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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 - Invoices 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
summaryOnly
Boolean
Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
pageSize
Integer
Number of records to retrieve per page
searchTerm
String
Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference.

getItem

Retrieves a specific item using a unique item Id


/Items/{ItemID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID itemID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;

        try {
            Items result = apiInstance.getItem(accessToken, xeroTenantId, itemID, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getItem");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves history for a specific item


/Items/{ItemID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID itemID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getItemHistory(accessToken, xeroTenantId, itemID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getItemHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves items


/Items

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'IsSold==true';
        String order = 'Code ASC';
        Integer unitdp = 4;

        try {
            Items result = apiInstance.getItems(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getItems");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves a specific journal using a unique journal Id.


/Journals/{JournalID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID journalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID journalID = '00000000-0000-0000-0000-000000000000';

        try {
            Journals result = apiInstance.getJournal(accessToken, xeroTenantId, journalID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getJournal");
            e.printStackTrace();
        }
    }
}

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

getJournalByNumber

Retrieves a specific journal using a unique journal number.


/Journals/{JournalNumber}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Integer journalNumber = 1000;

        try {
            Journals result = apiInstance.getJournalByNumber(accessToken, xeroTenantId, journalNumber);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getJournalByNumber");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
JournalNumber*
Integer
Number of a Journal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getJournals

Retrieves journals


/Journals

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        Integer offset = 10;
        Boolean paymentsOnly = true;

        try {
            Journals result = apiInstance.getJournals(accessToken, xeroTenantId, ifModifiedSince, offset, paymentsOnly);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getJournals");
            e.printStackTrace();
        }
    }
}

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

Retrieves a specific linked transaction (billable expenses) using a unique linked transaction Id


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID linkedTransactionID = '00000000-0000-0000-0000-000000000000';

        try {
            LinkedTransactions result = apiInstance.getLinkedTransaction(accessToken, xeroTenantId, linkedTransactionID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getLinkedTransaction");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves linked transactions (billable expenses)


/LinkedTransactions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Integer page = 1;
        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID linkedTransactionID = '00000000-0000-0000-0000-000000000000';
        UUID sourceTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID sourceTransactionID = '00000000-0000-0000-0000-000000000000';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String status = 'APPROVED';
        UUID targetTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID targetTransactionID = '00000000-0000-0000-0000-000000000000';

        try {
            LinkedTransactions result = apiInstance.getLinkedTransactions(accessToken, xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getLinkedTransactions");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
UUID (uuid)
The Xero identifier for an Linked Transaction
SourceTransactionID
UUID (uuid)
Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
ContactID
UUID (uuid)
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 associated to a customer and with a status
TargetTransactionID
UUID (uuid)
Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice

getManualJournal

Retrieves a specific manual journal


/ManualJournals/{ManualJournalID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';

        try {
            ManualJournals result = apiInstance.getManualJournal(accessToken, xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournal");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific attachment from a specific manual journal by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getManualJournalAttachmentByFileName(accessToken, xeroTenantId, manualJournalID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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
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

getManualJournalAttachmentById

Allows you to retrieve a specific attachment from a specific manual journal using a unique attachment Id


/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getManualJournalAttachmentById(accessToken, xeroTenantId, manualJournalID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getManualJournalAttachments

Retrieves attachment for a specific manual journal


/ManualJournals/{ManualJournalID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getManualJournalAttachments(accessToken, xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves manual journals


/ManualJournals

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="DRAFT"';
        String order = 'Date ASC';
        Integer page = 1;
        Integer pageSize = 100;

        try {
            ManualJournals result = apiInstance.getManualJournals(accessToken, xeroTenantId, ifModifiedSince, where, order, page, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournals");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
pageSize
Integer
Number of records to retrieve per page

getManualJournalsHistory

Retrieves history for a specific manual journal


/ManualJournals/{ManualJournalID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getManualJournalsHistory(accessToken, xeroTenantId, manualJournalID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getManualJournalsHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

getOnlineInvoice

Retrieves a URL to an online invoice


/Invoices/{InvoiceID}/OnlineInvoice

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            OnlineInvoices result = apiInstance.getOnlineInvoice(accessToken, xeroTenantId, invoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOnlineInvoice");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

getOrganisationActions

Retrieves a list of the key actions your app has permission to perform in the connected Xero organisation.


/Organisation/Actions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        try {
            Actions result = apiInstance.getOrganisationActions(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisationActions");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

getOrganisationCISSettings

Retrieves the CIS settings for the Xero organistaion.


/Organisation/{OrganisationID}/CISSettings

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID organisationID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID organisationID = '00000000-0000-0000-0000-000000000000';

        try {
            CISOrgSettings result = apiInstance.getOrganisationCISSettings(accessToken, xeroTenantId, organisationID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisationCISSettings");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves Xero organisation details


/Organisation

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        try {
            Organisations result = apiInstance.getOrganisations(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOrganisations");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves a specific overpayment using a unique overpayment Id


/Overpayments/{OverpaymentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID overpaymentID = '00000000-0000-0000-0000-000000000000';

        try {
            Overpayments result = apiInstance.getOverpayment(accessToken, xeroTenantId, overpaymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOverpayment");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves history records of a specific overpayment


/Overpayments/{OverpaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID overpaymentID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getOverpaymentHistory(accessToken, xeroTenantId, overpaymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOverpaymentHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves overpayments


/Overpayments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="AUTHORISED"';
        String order = 'Status ASC';
        Integer page = 1;
        Integer unitdp = 4;
        Integer pageSize = 100;

        try {
            Overpayments result = apiInstance.getOverpayments(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getOverpayments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
pageSize
Integer
Number of records to retrieve per page

getPayment

Retrieves a specific payment for invoices and credit notes using a unique payment Id


/Payments/{PaymentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID paymentID = '00000000-0000-0000-0000-000000000000';

        try {
            Payments result = apiInstance.getPayment(accessToken, xeroTenantId, paymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPayment");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves history records of a specific payment


/Payments/{PaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID paymentID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getPaymentHistory(accessToken, xeroTenantId, paymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPaymentHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves payment services


/PaymentServices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        try {
            PaymentServices result = apiInstance.getPaymentServices(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPaymentServices");
            e.printStackTrace();
        }
    }
}

Scopes

paymentservices Grant read-write access to payment services

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPayments

Retrieves payments for invoices and credit notes


/Payments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="AUTHORISED"';
        String order = 'Amount ASC';
        Integer page = 1;
        Integer pageSize = 100;

        try {
            Payments result = apiInstance.getPayments(accessToken, xeroTenantId, ifModifiedSince, where, order, page, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPayments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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 payments will be returned in a single API call
pageSize
Integer
Number of records to retrieve per page

getPrepayment

Allows you to retrieve a specified prepayments


/Prepayments/{PrepaymentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID prepaymentID = '00000000-0000-0000-0000-000000000000';

        try {
            Prepayments result = apiInstance.getPrepayment(accessToken, xeroTenantId, prepaymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPrepayment");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves history record for a specific prepayment


/Prepayments/{PrepaymentID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID prepaymentID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getPrepaymentHistory(accessToken, xeroTenantId, prepaymentID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPrepaymentHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves prepayments


/Prepayments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="AUTHORISED"';
        String order = 'Reference ASC';
        Integer page = 1;
        Integer unitdp = 4;
        Integer pageSize = 100;

        try {
            Prepayments result = apiInstance.getPrepayments(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPrepayments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
pageSize
Integer
Number of records to retrieve per page

getPurchaseOrder

Retrieves a specific purchase order using a unique purchase order Id


/PurchaseOrders/{PurchaseOrderID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';

        try {
            PurchaseOrders result = apiInstance.getPurchaseOrder(accessToken, xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrder");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

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

getPurchaseOrderAsPdf

Retrieves specific purchase order as PDF files using a unique purchase order Id


/PurchaseOrders/{PurchaseOrderID}/pdf

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';

        try {
            ByteArrayInputStream result = apiInstance.getPurchaseOrderAsPdf(accessToken, xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderAsPdf");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

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

getPurchaseOrderAttachmentByFileName

Retrieves a specific attachment for a specific purchase order by filename


/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getPurchaseOrderAttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for an Purchase Order
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

getPurchaseOrderAttachmentById

Retrieves specific attachment for a specific purchase order using a unique attachment Id


/PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getPurchaseOrderAttachmentById(accessToken, xeroTenantId, purchaseOrderID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for an Purchase Order
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

getPurchaseOrderAttachments

Retrieves attachments for a specific purchase order


/PurchaseOrders/{PurchaseOrderID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getPurchaseOrderAttachments(accessToken, xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

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

getPurchaseOrderByNumber

Retrieves a specific purchase order using purchase order number


/PurchaseOrders/{PurchaseOrderNumber}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String purchaseOrderNumber = 'PO1234';

        try {
            PurchaseOrders result = apiInstance.getPurchaseOrderByNumber(accessToken, xeroTenantId, purchaseOrderNumber);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderByNumber");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
PurchaseOrderNumber*
String
Unique identifier for a PurchaseOrder
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPurchaseOrderHistory

Retrieves history for a specific purchase order


/PurchaseOrders/{PurchaseOrderID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getPurchaseOrderHistory(accessToken, xeroTenantId, purchaseOrderID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrderHistory");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

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

getPurchaseOrders

Retrieves purchase orders


/PurchaseOrders

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String status = 'SUBMITTED';
        String dateFrom = '2019-12-01';
        String dateTo = '2019-12-31';
        String order = 'PurchaseOrderNumber ASC';
        Integer page = 1;
        Integer pageSize = 100;

        try {
            PurchaseOrders result = apiInstance.getPurchaseOrders(accessToken, xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page, pageSize);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getPurchaseOrders");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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.
pageSize
Integer
Number of records to retrieve per page

getQuote

Retrieves a specific quote using a unique quote Id


/Quotes/{QuoteID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';

        try {
            Quotes result = apiInstance.getQuote(accessToken, xeroTenantId, quoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuote");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

getQuoteAsPdf

Retrieves a specific quote as a PDF file using a unique quote Id


/Quotes/{QuoteID}/pdf

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';

        try {
            ByteArrayInputStream result = apiInstance.getQuoteAsPdf(accessToken, xeroTenantId, quoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAsPdf");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific attachment from a specific quote by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
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

Retrieves a specific attachment from a specific quote using a unique attachment Id


/Quotes/{QuoteID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getQuoteAttachmentById(accessToken, xeroTenantId, quoteID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
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

Retrieves attachments for a specific quote


/Quotes/{QuoteID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getQuoteAttachments(accessToken, xeroTenantId, quoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

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

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

getQuoteHistory

Retrieves history records of a specific quote


/Quotes/{QuoteID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getQuoteHistory(accessToken, xeroTenantId, quoteID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuoteHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves sales quotes


/Quotes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        date dateFrom = 2019-10-31;
        date dateTo = 2019-10-31;
        date expiryDateFrom = 2019-10-31;
        date expiryDateTo = 2019-10-31;
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String status = 'DRAFT';
        Integer page = 1;
        String order = 'Status ASC';
        String quoteNumber = 'QU-0001';

        try {
            Quotes result = apiInstance.getQuotes(accessToken, xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order, quoteNumber);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getQuotes");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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
QuoteNumber
String
Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001)

getReceipt

Retrieves a specific draft expense claim receipt by using a unique receipt Id


/Receipts/{ReceiptID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;

        try {
            Receipts result = apiInstance.getReceipt(accessToken, xeroTenantId, receiptID, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReceipt");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific attachment from a specific expense claim receipts by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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
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

getReceiptAttachmentById

Retrieves a specific attachments from a specific expense claim receipts by using a unique attachment Id


/Receipts/{ReceiptID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getReceiptAttachmentById(accessToken, xeroTenantId, receiptID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getReceiptAttachments

Retrieves attachments for a specific expense claim receipt


/Receipts/{ReceiptID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getReceiptAttachments(accessToken, xeroTenantId, receiptID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves a history record for a specific receipt


/Receipts/{ReceiptID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getReceiptHistory(accessToken, xeroTenantId, receiptID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReceiptHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves draft expense claim receipts for any user


/Receipts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'Status=="DRAFT"';
        String order = 'ReceiptNumber ASC';
        Integer unitdp = 4;

        try {
            Receipts result = apiInstance.getReceipts(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReceipts");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific repeating invoice by using a unique repeating invoice Id


/RepeatingInvoices/{RepeatingInvoiceID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            RepeatingInvoices result = apiInstance.getRepeatingInvoice(accessToken, xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoice");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves a specific attachment from a specific repeating invoices by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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
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

getRepeatingInvoiceAttachmentById

Retrieves a specific attachment from a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';
        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID attachmentID = '00000000-0000-0000-0000-000000000000';
        String contentType = 'image/jpg';

        try {
            ByteArrayInputStream result = apiInstance.getRepeatingInvoiceAttachmentById(accessToken, xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentById");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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 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

getRepeatingInvoiceAttachments

Retrieves attachments from a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            Attachments result = apiInstance.getRepeatingInvoiceAttachments(accessToken, xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachments");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments
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

Retrieves history record for a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/History

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';

        try {
            HistoryRecords result = apiInstance.getRepeatingInvoiceHistory(accessToken, xeroTenantId, repeatingInvoiceID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceHistory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves repeating invoices


/RepeatingInvoices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String where = 'Status=="DRAFT"';
        String order = 'Total ASC';

        try {
            RepeatingInvoices result = apiInstance.getRepeatingInvoices(accessToken, xeroTenantId, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getRepeatingInvoices");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.transactions Grant read-write access to bank transactions, credit notes, invoices, repeating invoices
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

Retrieves report for aged payables by contact


/Reports/AgedPayablesByContact

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactId = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactId = '00000000-0000-0000-0000-000000000000';
        date date = 2019-10-31;
        date fromDate = 2019-10-31;
        date toDate = 2019-10-31;

        try {
            ReportWithRows result = apiInstance.getReportAgedPayablesByContact(accessToken, xeroTenantId, contactId, date, fromDate, toDate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportAgedPayablesByContact");
            e.printStackTrace();
        }
    }
}

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)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28

getReportAgedReceivablesByContact

Retrieves report for aged receivables by contact


/Reports/AgedReceivablesByContact

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactId = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactId = '00000000-0000-0000-0000-000000000000';
        date date = 2019-10-31;
        date fromDate = 2019-10-31;
        date toDate = 2019-10-31;

        try {
            ReportWithRows result = apiInstance.getReportAgedReceivablesByContact(accessToken, xeroTenantId, contactId, date, fromDate, toDate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportAgedReceivablesByContact");
            e.printStackTrace();
        }
    }
}

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)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28

getReportBalanceSheet

Retrieves report for balancesheet


/Reports/BalanceSheet

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        date date = 2019-11-01;
        Integer periods = 3;
        String timeframe = 'MONTH';
        String trackingOptionID1 = '00000000-0000-0000-0000-000000000000';
        String trackingOptionID2 = '00000000-0000-0000-0000-000000000000';
        Boolean standardLayout = true;
        Boolean paymentsOnly = false;

        try {
            ReportWithRows result = apiInstance.getReportBalanceSheet(accessToken, xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportBalanceSheet");
            e.printStackTrace();
        }
    }
}

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 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

Retrieves report for bank summary


/Reports/BankSummary

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        date fromDate = 2019-10-31;
        date toDate = 2019-10-31;

        try {
            ReportWithRows result = apiInstance.getReportBankSummary(accessToken, xeroTenantId, fromDate, toDate);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportBankSummary");
            e.printStackTrace();
        }
    }
}

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)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28

getReportBudgetSummary

Retrieves report for budget summary


/Reports/BudgetSummary

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        date date = 2019-03-31;
        Integer periods = 2;
        Integer timeframe = 3;

        try {
            ReportWithRows result = apiInstance.getReportBudgetSummary(accessToken, xeroTenantId, date, periods, timeframe);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportBudgetSummary");
            e.printStackTrace();
        }
    }
}

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
periods
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

Retrieves report for executive summary


/Reports/ExecutiveSummary

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        date date = 2019-03-31;

        try {
            ReportWithRows result = apiInstance.getReportExecutiveSummary(accessToken, xeroTenantId, date);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportExecutiveSummary");
            e.printStackTrace();
        }
    }
}

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

getReportFromId

Retrieves a specific report using a unique ReportID


/Reports/{ReportID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String reportID = '00000000-0000-0000-0000-000000000000';

        try {
            ReportWithRows result = apiInstance.getReportFromId(accessToken, xeroTenantId, reportID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportFromId");
            e.printStackTrace();
        }
    }
}

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

getReportProfitAndLoss

Retrieves report for profit and loss


/Reports/ProfitAndLoss

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        date fromDate = 2019-10-31;
        date toDate = 2019-10-31;
        Integer periods = 3;
        String timeframe = 'MONTH';
        String trackingCategoryID = '00000000-0000-0000-0000-000000000000';
        String trackingCategoryID2 = '00000000-0000-0000-0000-000000000000';
        String trackingOptionID = '00000000-0000-0000-0000-000000000000';
        String trackingOptionID2 = '00000000-0000-0000-0000-000000000000';
        Boolean standardLayout = true;
        Boolean paymentsOnly = false;

        try {
            ReportWithRows result = apiInstance.getReportProfitAndLoss(accessToken, xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportProfitAndLoss");
            e.printStackTrace();
        }
    }
}

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)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28
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

Retrieve reports for 1099


/Reports/TenNinetyNine

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String reportYear = '2019';

        try {
            Reports result = apiInstance.getReportTenNinetyNine(accessToken, xeroTenantId, reportYear);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportTenNinetyNine");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.reports.read Grant read-only access to accounting reports
accounting.reports.tenninetynine.read Grant read-only access to 1099 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

Retrieves report for trial balance


/Reports/TrialBalance

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        date date = 2019-10-31;
        Boolean paymentsOnly = true;

        try {
            ReportWithRows result = apiInstance.getReportTrialBalance(accessToken, xeroTenantId, date, paymentsOnly);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportTrialBalance");
            e.printStackTrace();
        }
    }
}

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

getReportsList

Retrieves a list of the organistaions unique reports that require a uuid to fetch


/Reports

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        try {
            ReportWithRows result = apiInstance.getReportsList(accessToken, xeroTenantId);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getReportsList");
            e.printStackTrace();
        }
    }
}

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

getTaxRateByTaxType

Retrieves a specific tax rate according to given TaxType code


/TaxRates/{TaxType}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String taxType = 'INPUT2';

        try {
            TaxRates result = apiInstance.getTaxRateByTaxType(accessToken, xeroTenantId, taxType);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getTaxRateByTaxType");
            e.printStackTrace();
        }
    }
}

Scopes

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

Parameters

Path parameters
Name Description
TaxType*
String
A valid TaxType code
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getTaxRates

Retrieves tax rates


/TaxRates

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String where = 'Status=="ACTIVE"';
        String order = 'Name ASC';

        try {
            TaxRates result = apiInstance.getTaxRates(accessToken, xeroTenantId, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getTaxRates");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

getTrackingCategories

Retrieves tracking categories and options


/TrackingCategories

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String where = 'Status=="ACTIVE"';
        String order = 'Name ASC';
        Boolean includeArchived = true;

        try {
            TrackingCategories result = apiInstance.getTrackingCategories(accessToken, xeroTenantId, where, order, includeArchived);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getTrackingCategories");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves specific tracking categories and options using a unique tracking category Id


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingCategoryID = '00000000-0000-0000-0000-000000000000';

        try {
            TrackingCategories result = apiInstance.getTrackingCategory(accessToken, xeroTenantId, trackingCategoryID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getTrackingCategory");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves a specific user


/Users/{UserID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID userID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID userID = '00000000-0000-0000-0000-000000000000';

        try {
            Users result = apiInstance.getUser(accessToken, xeroTenantId, userID);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getUser");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

Retrieves users


/Users

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';

        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
        String where = 'IsSubscriber==true';
        String order = 'LastName ASC';

        try {
            Users result = apiInstance.getUsers(accessToken, xeroTenantId, ifModifiedSince, where, order);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#getUsers");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.settings Grant read-write access to organisation and account settings
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

postSetup

Sets the chart of accounts, the conversion date and conversion balances


/Setup

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        Account account = new Account();
        account.setCode("123");
        account.setName("Business supplies");
        account.setType(com.xero.models.accounting.AccountType.EXPENSE);

        List<Account> accounts = new ArrayList<Account>();
        accounts.add(account);
        
        ConversionDate conversionDate = new ConversionDate();
        conversionDate.setMonth(10);
        conversionDate.setYear(2020);

        List<ConversionBalances> conversionBalances = new ArrayList<ConversionBalances>();
        
        Setup setup = new Setup();
        setup.setAccounts(accounts);
        setup.setConversionDate(conversionDate);
        setup.setConversionBalances(conversionBalances);

        try {
            ImportSummaryObject result = apiInstance.postSetup(accessToken, xeroTenantId, setup, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#postSetup");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
setup *
Setup
Object including an accounts array, a conversion balances array and a conversion date object in body of request
Required

updateAccount

Updates a chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        Account account = new Account();
        account.setCode("123456");
        account.setName("BarFoo");
        account.setType(com.xero.models.accounting.AccountType.EXPENSE);
        account.setDescription("Hello World");
        account.setTaxType("NONE");
        
        Accounts accounts = new Accounts();
        accounts.addAccountsItem(account);

        try {
            Accounts result = apiInstance.updateAccount(accessToken, xeroTenantId, accountID, accounts, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateAccount");
            e.printStackTrace();
        }
    }
}

Scopes

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

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
accounts *
Accounts
Request of type Accounts array with one Account
Required

updateAccountAttachmentByFileName

Updates attachment on a specific account by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID accountID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateAccountAttachmentByFileName(accessToken, xeroTenantId, accountID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateAccountAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateBankTransaction

Updates a single spent or received money transaction


/BankTransactions/{BankTransactionID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Account bankAccount = new Account();
        bankAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        BankTransaction bankTransaction = new BankTransaction();
        bankTransaction.setReference("You just updated");
        bankTransaction.setType(com.xero.models.accounting.BankTransaction.TypeEnum.RECEIVE);
        bankTransaction.setContact(contact);
        bankTransaction.setLineItems(lineItems);
        bankTransaction.setBankAccount(bankAccount);
        
        BankTransactions bankTransactions = new BankTransactions();
        bankTransactions.addBankTransactionsItem(bankTransaction);

        try {
            BankTransactions result = apiInstance.updateBankTransaction(accessToken, xeroTenantId, bankTransactionID, bankTransactions, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransaction");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

Updates a specific attachment from a specific bank transaction by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransactionID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateBankTransactionAttachmentByFileName(accessToken, xeroTenantId, bankTransactionID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransactionAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateBankTransferAttachmentByFileName


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID bankTransferID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateBankTransferAttachmentByFileName(accessToken, xeroTenantId, bankTransferID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateBankTransferAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateContact

Updates a specific contact in a Xero organisation


/Contacts/{ContactID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        Contact contact = new Contact();
        contact.setName("Thanos");
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Contacts contacts = new Contacts();
        contacts.addContactsItem(contact);

        try {
            Contacts result = apiInstance.updateContact(accessToken, xeroTenantId, contactID, contacts, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateContact");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateContactAttachmentByFileName(accessToken, xeroTenantId, contactID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateContactAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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 of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateContactGroup

Updates a specific contact group


/ContactGroups/{ContactGroupID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID contactGroupID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        ContactGroup contactGroup = new ContactGroup();
        contactGroup.setName("Vendor");
        
        ContactGroups contactGroups = new ContactGroups();
        contactGroups.addContactGroupsItem(contactGroup);

        try {
            ContactGroups result = apiInstance.updateContactGroup(accessToken, xeroTenantId, contactGroupID, contactGroups, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateContactGroup");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contactGroups *
ContactGroups
an array of Contact groups with Name of specific group to update
Required

updateCreditNote

Updates a specific credit note


/CreditNotes/{CreditNoteID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        CreditNote creditNote = new CreditNote();
        creditNote.setType(com.xero.models.accounting.CreditNote.TypeEnum.ACCPAYCREDIT);
        creditNote.setStatus(com.xero.models.accounting.CreditNote.StatusEnum.AUTHORISED);
        creditNote.setReference("My ref.");
        creditNote.setContact(contact);
        creditNote.setDate(currDate);
        creditNote.setLineItems(lineItems);
        
        CreditNotes creditNotes = new CreditNotes();
        creditNotes.addCreditNotesItem(creditNote);

        try {
            CreditNotes result = apiInstance.updateCreditNote(accessToken, xeroTenantId, creditNoteID, creditNotes, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateCreditNote");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

Updates attachments on a specific credit note by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID creditNoteID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateCreditNoteAttachmentByFileName(accessToken, xeroTenantId, creditNoteID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateCreditNoteAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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 attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateExpenseClaim

Updates a specific expense claims


/ExpenseClaims/{ExpenseClaimID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID expenseClaimID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        User user = new User();
        user.setUserID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Receipt receipt = new Receipt();
        receipt.setReceiptID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        receipt.setDate(currDate);

        List<Receipt> receipts = new ArrayList<Receipt>();
        receipts.add(receipt);
        
        ExpenseClaim expenseClaim = new ExpenseClaim();
        expenseClaim.setStatus(com.xero.models.accounting.ExpenseClaim.StatusEnum.SUBMITTED);
        expenseClaim.setUser(user);
        expenseClaim.setReceipts(receipts);
        
        ExpenseClaims expenseClaims = new ExpenseClaims();
        expenseClaims.addExpenseClaimsItem(expenseClaim);

        try {
            ExpenseClaims result = apiInstance.updateExpenseClaim(accessToken, xeroTenantId, expenseClaimID, expenseClaims, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateExpenseClaim");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
expenseClaims *
ExpenseClaims
Required

updateInvoice

Updates a specific sales invoices or purchase bills


/Invoices/{InvoiceID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Invoice invoice = new Invoice();
        invoice.setReference("I am Iron man");
        
        Invoices invoices = new Invoices();
        invoices.addInvoicesItem(invoice);

        try {
            Invoices result = apiInstance.updateInvoice(accessToken, xeroTenantId, invoiceID, invoices, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateInvoice");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

Updates an attachment from a specific invoices or purchase bill by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID invoiceID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateInvoiceAttachmentByFileName(accessToken, xeroTenantId, invoiceID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateInvoiceAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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 attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateItem

Updates a specific item


/Items/{ItemID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID itemID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Item item = new Item();
        item.setCode("ItemCode123");
        item.setDescription("Goodbye");
        
        Items items = new Items();
        items.addItemsItem(item);

        try {
            Items result = apiInstance.updateItem(accessToken, xeroTenantId, itemID, items, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateItem");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

Updates a specific linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID linkedTransactionID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        LinkedTransaction linkedTransaction = new LinkedTransaction();
        linkedTransaction.setSourceLineItemID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        linkedTransaction.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LinkedTransactions linkedTransactions = new LinkedTransactions();
        linkedTransactions.addLinkedTransactionsItem(linkedTransaction);

        try {
            LinkedTransactions result = apiInstance.updateLinkedTransaction(accessToken, xeroTenantId, linkedTransactionID, linkedTransactions, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateLinkedTransaction");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
linkedTransactions *
LinkedTransactions
Required

updateManualJournal

Updates a specific manual journal


/ManualJournals/{ManualJournalID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);

        List<ManualJournalLine> manualJournalLines = new ArrayList<ManualJournalLine>();
        
        ManualJournalLine credit = new ManualJournalLine();
        credit.setLineAmount(-100.0);
        credit.setAccountCode("400");
        credit.setDescription("Hello there");
        manualJournalLines.add(credit);
        
        ManualJournalLine debit = new ManualJournalLine();
        debit.setLineAmount(100.0);
        debit.setAccountCode("120");
        debit.setDescription("Hello there");
        manualJournalLines.add(debit);
        
        ManualJournal manualJournal = new ManualJournal();
        manualJournal.setNarration("Foobar");
        manualJournal.setDate(dateValue);
        manualJournal.setJournalLines(manualJournalLines);
        
        ManualJournals manualJournals = new ManualJournals();
        manualJournals.addManualJournalsItem(manualJournal);

        try {
            ManualJournals result = apiInstance.updateManualJournal(accessToken, xeroTenantId, manualJournalID, manualJournals, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateManualJournal");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
manualJournals *
ManualJournals
Required

updateManualJournalAttachmentByFileName

Updates a specific attachment from a specific manual journal by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID manualJournalID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateManualJournalAttachmentByFileName(accessToken, xeroTenantId, manualJournalID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateManualJournalAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateOrCreateBankTransactions

Updates or creates one or more spent or received money transaction


/BankTransactions

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Account bankAccount = new Account();
        bankAccount.setAccountID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        BankTransaction bankTransaction = new BankTransaction();
        bankTransaction.setType(com.xero.models.accounting.BankTransaction.TypeEnum.RECEIVE);
        bankTransaction.setContact(contact);
        bankTransaction.setLineItems(lineItems);
        bankTransaction.setBankAccount(bankAccount);
        
        BankTransactions bankTransactions = new BankTransactions();
        bankTransactions.addBankTransactionsItem(bankTransaction);

        try {
            BankTransactions result = apiInstance.updateOrCreateBankTransactions(accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateBankTransactions");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
bankTransactions *
BankTransactions
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects 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

Updates or creates one or more contacts in a Xero organisation


/Contacts

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        
        Phone phone = new Phone();
        phone.setPhoneNumber("555-1212");
        phone.setPhoneType(com.xero.models.accounting.Phone.PhoneTypeEnum.MOBILE);

        List<Phone> phones = new ArrayList<Phone>();
        phones.add(phone);
        
        Contact contact = new Contact();
        contact.setName("Bruce Banner");
        contact.setEmailAddress("hulk@avengers.com");
        contact.setPhones(phones);
        
        Contacts contacts = new Contacts();
        contacts.addContactsItem(contact);

        try {
            Contacts result = apiInstance.updateOrCreateContacts(accessToken, xeroTenantId, contacts, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateContacts");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contacts *
Contacts
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateCreditNotes

Updates or creates one or more credit notes


/CreditNotes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate currDate = LocalDate.now();
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        CreditNote creditNote = new CreditNote();
        creditNote.setType(com.xero.models.accounting.CreditNote.TypeEnum.ACCPAYCREDIT);
        creditNote.setContact(contact);
        creditNote.setDate(currDate);
        creditNote.setLineItems(lineItems);
        
        CreditNotes creditNotes = new CreditNotes();
        creditNotes.addCreditNotesItem(creditNote);

        try {
            CreditNotes result = apiInstance.updateOrCreateCreditNotes(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateCreditNotes");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects 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

Creates a single new employees used in Xero payrun


/Employees

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        
        Employee employee = new Employee();
        employee.setFirstName("Nick");
        employee.setLastName("Fury");
        
        Employees employees = new Employees();
        employees.addEmployeesItem(employee);

        try {
            Employees result = apiInstance.updateOrCreateEmployees(accessToken, xeroTenantId, employees, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateEmployees");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

updateOrCreateInvoices

Updates or creates one or more sales invoices or purchase bills


/Invoices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        LocalDate dueDateValue = LocalDate.of(2020, Month.OCTOBER, 28);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Invoice invoice = new Invoice();
        invoice.setType(com.xero.models.accounting.Invoice.TypeEnum.ACCREC);
        invoice.setContact(contact);
        invoice.setDate(dateValue);
        invoice.setDate(dueDateValue);
        invoice.setLineItems(lineItems);
        invoice.setReference("Website Design");
        invoice.setStatus(com.xero.models.accounting.Invoice.StatusEnum.DRAFT);
        
        Invoices invoices = new Invoices();
        invoices.addInvoicesItem(invoice);

        try {
            Invoices result = apiInstance.updateOrCreateInvoices(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateInvoices");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
invoices *
Invoices
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects 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

Updates or creates one or more items


/Items

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        
        Item item = new Item();
        item.setCode("abcXYZ123");
        item.setName("HelloWorld");
        item.setDescription("Foobar");
        
        Items items = new Items();
        items.addItemsItem(item);

        try {
            Items result = apiInstance.updateOrCreateItems(accessToken, xeroTenantId, items, summarizeErrors, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateItems");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
items *
Items
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects 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

Updates or creates a single manual journal


/ManualJournals

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);

        List<ManualJournalLine> manualJournalLines = new ArrayList<ManualJournalLine>();
        
        ManualJournalLine credit = new ManualJournalLine();
        credit.setLineAmount(-100.0);
        credit.setAccountCode("400");
        credit.setDescription("Hello there");
        manualJournalLines.add(credit);
        
        ManualJournalLine debit = new ManualJournalLine();
        debit.setLineAmount(100.0);
        debit.setAccountCode("120");
        debit.setDescription("Hello there");
        manualJournalLines.add(debit);
        
        ManualJournal manualJournal = new ManualJournal();
        manualJournal.setNarration("Foobar");
        manualJournal.setDate(dateValue);
        manualJournal.setJournalLines(manualJournalLines);
        
        ManualJournals manualJournals = new ManualJournals();
        manualJournals.addManualJournalsItem(manualJournal);

        try {
            ManualJournals result = apiInstance.updateOrCreateManualJournals(accessToken, xeroTenantId, manualJournals, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateManualJournals");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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 objects and any with validation errors

updateOrCreatePurchaseOrders

Updates or creates one or more purchase orders


/PurchaseOrders

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        PurchaseOrder purchaseOrder = new PurchaseOrder();
        purchaseOrder.setContact(contact);
        purchaseOrder.setLineItems(lineItems);
        purchaseOrder.setDate(dateValue);
        
        PurchaseOrders purchaseOrders = new PurchaseOrders();
        purchaseOrders.addPurchaseOrdersItem(purchaseOrder);

        try {
            PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(accessToken, xeroTenantId, purchaseOrders, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreatePurchaseOrders");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateQuotes

Updates or creates one or more quotes


/Quotes

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        LineItem lineItem = new LineItem();
        lineItem.setDescription("Foobar");
        lineItem.setQuantity(1.0);
        lineItem.setUnitAmount(20.0);
        lineItem.setAccountCode("000");

        List<LineItem> lineItems = new ArrayList<LineItem>();
        lineItems.add(lineItem);
        
        Quote quote = new Quote();
        quote.setContact(contact);
        quote.setLineItems(lineItems);
        quote.setDate(dateValue);
        
        Quotes quotes = new Quotes();
        quotes.addQuotesItem(quote);

        try {
            Quotes result = apiInstance.updateOrCreateQuotes(accessToken, xeroTenantId, quotes, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateQuotes");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
quotes *
Quotes
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateRepeatingInvoices

Creates or deletes one or more repeating invoice templates


/RepeatingInvoices

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        Boolean summarizeErrors = true;
        String idempotencyKey = 'KEY_VALUE';

        try {
            RepeatingInvoices result = apiInstance.updateOrCreateRepeatingInvoices(accessToken, xeroTenantId, repeatingInvoices, summarizeErrors, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateOrCreateRepeatingInvoices");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
repeatingInvoices *
RepeatingInvoices
RepeatingInvoices with an array of repeating invoice objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updatePurchaseOrder

Updates a specific purchase order


/PurchaseOrders/{PurchaseOrderID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        PurchaseOrder purchaseOrder = new PurchaseOrder();
        purchaseOrder.setAttentionTo("Peter Parker");
        
        PurchaseOrders purchaseOrders = new PurchaseOrders();
        purchaseOrders.addPurchaseOrdersItem(purchaseOrder);

        try {
            PurchaseOrders result = apiInstance.updatePurchaseOrder(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updatePurchaseOrder");
            e.printStackTrace();
        }
    }
}

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 an Purchase Order
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
Required

updatePurchaseOrderAttachmentByFileName

Updates a specific attachment for a specific purchase order by filename


/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID purchaseOrderID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updatePurchaseOrderAttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updatePurchaseOrderAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
PurchaseOrderID*
UUID (uuid)
Unique identifier for an Purchase Order
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateQuote

Updates a specific quote


/Quotes/{QuoteID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        Contact contact = new Contact();
        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Quote quote = new Quote();
        quote.setReference("I am an update");
        quote.setContact(contact);
        quote.setDate(dateValue);
        
        Quotes quotes = new Quotes();
        quotes.addQuotesItem(quote);

        try {
            Quotes result = apiInstance.updateQuote(accessToken, xeroTenantId, quoteID, quotes, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateQuote");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
quotes *
Quotes
Required

updateQuoteAttachmentByFileName

Updates a specific attachment from a specific quote by filename


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID quoteID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateQuoteAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
QuoteID*
UUID (uuid)
Unique identifier for an Quote
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateReceipt

Updates a specific draft expense claim receipts


/Receipts/{ReceiptID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        Integer unitdp = 4;
        String idempotencyKey = 'KEY_VALUE';
        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
        
        User user = new User();
        user.setUserID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
        
        Receipt receipt = new Receipt();
        receipt.setUser(user);
        receipt.setReference("Foobar");
        receipt.setDate(dateValue);
        
        Receipts receipts = new Receipts();
        receipts.addReceiptsItem(receipt);

        try {
            Receipts result = apiInstance.updateReceipt(accessToken, xeroTenantId, receiptID, receipts, unitdp, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateReceipt");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
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

Updates a specific attachment on a specific expense claim receipts by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID receiptID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateReceiptAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateRepeatingInvoice

Deletes a specific repeating invoice template


/RepeatingInvoices/{RepeatingInvoiceID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';

        try {
            RepeatingInvoices result = apiInstance.updateRepeatingInvoice(accessToken, xeroTenantId, repeatingInvoiceID, repeatingInvoices, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateRepeatingInvoice");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
repeatingInvoices *
RepeatingInvoices
Required

updateRepeatingInvoiceAttachmentByFileName

Updates a specific attachment from a specific repeating invoices by file name


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID repeatingInvoiceID = '00000000-0000-0000-0000-000000000000';
        String fileName = 'xero-dev.jpg';
        String idempotencyKey = 'KEY_VALUE';

        try {
            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateRepeatingInvoiceAttachmentByFileName");
            e.printStackTrace();
        }
    }
}

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
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
File
Byte array of file in body of request
Required

updateTaxRate

Updates tax rates


/TaxRates

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        String idempotencyKey = 'KEY_VALUE';
        
        TaxComponent taxComponent = new TaxComponent();
        taxComponent.setName("State Tax");
        taxComponent.setRate(2.25);

        List<TaxComponents> taxComponents = new ArrayList<TaxComponents>();
        taxComponents.add(taxComponent);
        
        TaxRate taxRate = new TaxRate();
        taxRate.setName("CA State Tax");
        taxRate.setTaxComponents(taxComponents);
        
        TaxRates taxRates = new TaxRates();
        taxRates.addTaxRatesItem(taxRate);

        try {
            TaxRates result = apiInstance.updateTaxRate(accessToken, xeroTenantId, taxRates, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateTaxRate");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
taxRates *
TaxRates
Required

updateTrackingCategory

Updates a specific tracking category


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingCategoryID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        TrackingCategory trackingCategory = new TrackingCategory();
        trackingCategory.setName("Foobar");

        try {
            TrackingCategories result = apiInstance.updateTrackingCategory(accessToken, xeroTenantId, trackingCategoryID, trackingCategory, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateTrackingCategory");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingCategory *
TrackingCategory
Required

updateTrackingOptions

Updates a specific option for a specific tracking category


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

Usage and SDK Samples

import org.openapitools.client.api.*;
import org.openapitools.client.api.client.AccountingApi;
import org.openapitools.client.models.accounting.*;

import java.io.File;
import java.util.*;

public class AccountingApiExample {
    private AccountingApi apiInstance;
    
    public static void main(String[] args) {
        String accessToken = "YOUR_ACCESS_TOKEN";
        ApiClient defaultClient = new ApiClient();

        apiInstance = AccountingApi.getInstance(defaultClient);
        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingCategoryID = '00000000-0000-0000-0000-000000000000';
        UUID trackingOptionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID trackingOptionID = '00000000-0000-0000-0000-000000000000';
        String idempotencyKey = 'KEY_VALUE';
        
        TrackingOption trackingOption = new TrackingOption();
        trackingOption.setName("Foobar");

        try {
            TrackingOptions result = apiInstance.updateTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption, idempotencyKey);
            System.out.println(result);
        } catch (XeroException e) {
            System.err.println("Exception when calling AccountingApi#updateTrackingOptions");
            e.printStackTrace();
        }
    }
}

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
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingOption *
TrackingOption
Required