From 7041360fadde7c1a11e59983825caad128943834 Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Mon, 15 Mar 2021 11:23:17 -0600 Subject: [PATCH] refactors use of params and check for csrf --- docs/v4/accounting/index.html | 32899 ++++++++++++++++++-------------- docs/v4/assets/index.html | 2 +- docs/v4/bankfeeds/index.html | 2 +- docs/v4/files/index.html | 2 +- docs/v4/payroll-au/index.html | 2 +- docs/v4/payroll-uk/index.html | 2 +- docs/v4/projects/index.html | 2 +- package-lock.json | 4 +- package.json | 2 +- src/XeroClient.ts | 2 +- src/gen/api/accountingApi.ts | 2 +- src/gen/api/assetApi.ts | 2 +- src/gen/api/bankfeedsApi.ts | 2 +- src/gen/api/filesApi.ts | 2 +- src/gen/api/payrollAUApi.ts | 2 +- src/gen/api/payrollNZApi.ts | 2 +- src/gen/api/payrollUKApi.ts | 2 +- src/gen/api/projectApi.ts | 2 +- 18 files changed, 18887 insertions(+), 14048 deletions(-) diff --git a/docs/v4/accounting/index.html b/docs/v4/accounting/index.html index af217e41..6a6e3e38 100644 --- a/docs/v4/accounting/index.html +++ b/docs/v4/accounting/index.html @@ -2677,47 +2677,47 @@ "type" : "object", "properties" : { "Total" : { - "type" : "number", + "type" : "integer", "description" : "The total number of accounts in the org", - "format" : "integer" + "format" : "int32" }, "New" : { - "type" : "number", + "type" : "integer", "description" : "The number of new accounts created", - "format" : "integer" + "format" : "int32" }, "Updated" : { - "type" : "number", + "type" : "integer", "description" : "The number of accounts updated", - "format" : "integer" + "format" : "int32" }, "Deleted" : { - "type" : "number", + "type" : "integer", "description" : "The number of accounts deleted", - "format" : "integer" + "format" : "int32" }, "Locked" : { - "type" : "number", + "type" : "integer", "description" : "The number of locked accounts", - "format" : "integer" + "format" : "int32" }, "System" : { - "type" : "number", + "type" : "integer", "description" : "The number of system accounts", - "format" : "integer" + "format" : "int32" }, "Errored" : { - "type" : "number", + "type" : "integer", "description" : "The number of accounts that had an error", - "format" : "integer" + "format" : "int32" }, "Present" : { "type" : "boolean" }, "NewOrUpdated" : { - "type" : "number", + "type" : "integer", "description" : "The number of new or updated accounts", - "format" : "integer" + "format" : "int32" } }, "description" : "A summary of the accounts changes" @@ -6391,7 +6391,7 @@

Xero Accounting API

API and SDK Documentation

Version: 1.0.0
-
  • NodeJS
  • +
  • Node
  • - + @@ -6438,30 +6438,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Account account = new Account();
    +        account.setCode("123456");
    +        account.setName("FooBar");
    +        account.setType(com.xero.models.accounting.AccountType.EXPENSE);
    +        account.setDescription("Hello World");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Account account = { "Code":"123456", "Name":"Foobar", "Type":"EXPENSE", "Description":"Hello World" }; // Account | 
             try {
    -            Accounts result = apiInstance.createAccount(xeroTenantId, account);
    +            Accounts result = apiInstance.createAccount(accessToken, xeroTenantId, account);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createAccount");
                 e.printStackTrace();
             }
    @@ -6528,8 +6531,13 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const account: Account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const account: Account = { + code: "123456", + name: "FooBar", + type: AccountType.EXPENSE, + description: "Hello World" }; try { const response = await xero.accountingApi.createAccount(xeroTenantId, account); @@ -6537,8 +6545,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -6950,32 +6976,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Account object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
    +            Attachments result = apiInstance.createAccountAttachmentByFileName(accessToken, xeroTenantId, accountID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createAccountAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -7048,13 +7076,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Account object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -7068,8 +7095,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -7545,32 +7586,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
    +            Attachments result = apiInstance.createBankTransactionAttachmentByFileName(accessToken, xeroTenantId, bankTransactionID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBankTransactionAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -7643,13 +7686,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -7663,8 +7705,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -8140,31 +8196,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords);
    +            HistoryRecords result = apiInstance.createBankTransactionHistoryRecord(accessToken, xeroTenantId, bankTransactionID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBankTransactionHistoryRecord");
                 e.printStackTrace();
             }
    @@ -8233,10 +8291,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createBankTransactionHistoryRecord(xeroTenantId, bankTransactionID, historyRecords); @@ -8244,8 +8307,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -8693,32 +8777,46 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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");
    +        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);
    +        lineItems.addLineItemsItem(lineItem);
    +        bankTransaction.setBankAccount(bankAccount);
    +        BankTransactions bankTransactions = new BankTransactions();
    +        bankTransactions.addBankTransactionsItem(bankTransaction);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        BankTransactions bankTransactions = { bankTransactions: [{ type: BankTransaction.TypeEnum.SPEND, contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "000" } ], bankAccount: { code: "000" }}]}; // BankTransactions | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            BankTransactions result = apiInstance.createBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
    +            BankTransactions result = apiInstance.createBankTransactions(accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBankTransactions");
                 e.printStackTrace();
             }
    @@ -8791,13 +8889,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors +const bankAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const bankTransactions: BankTransactions = { bankTransactions: [{ type: BankTransaction.TypeEnum.SPEND, contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "000" } ], bankAccount: { code: "000" }}]} +const bankTransaction: BankTransaction = { + type: BankTransaction.TypeEnum.RECEIVE, + contact: contact, + lineItems: [lineItem], + bankAccount: bankAccount }; + +const bankTransactions: BankTransactions = { + bankTransactions: [bankTransaction] }; try { const response = await xero.accountingApi.createBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp); @@ -8805,8 +8920,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -9272,30 +9453,38 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        BankTransfers bankTransfers = { "BankTransfers": [ { "FromBankAccount": { "Code": "090", "Name": "My Savings", "AccountID": "00000000-0000-0000-0000-000000000000", "Type": "BANK", "BankAccountNumber": "123455", "Status": "ACTIVE", "BankAccountType": "BANK", "CurrencyCode": "USD", "TaxType": "NONE", "EnablePaymentsToAccount": false, "ShowInExpenseClaims": false, "Class": "ASSET", "ReportingCode": "ASS", "ReportingCodeName": "Assets", "HasAttachments": false, "UpdatedDateUTC": "2016-10-17T13:45:33.993-07:00" }, "ToBankAccount": { "Code": "088", "Name": "Business Wells Fargo", "AccountID": "00000000-0000-0000-0000-000000000000", "Type": "BANK", "BankAccountNumber": "123455", "Status": "ACTIVE", "BankAccountType": "BANK", "CurrencyCode": "USD", "TaxType": "NONE", "EnablePaymentsToAccount": false, "ShowInExpenseClaims": false, "Class": "ASSET", "ReportingCode": "ASS", "ReportingCodeName": "Assets", "HasAttachments": false, "UpdatedDateUTC": "2016-06-03T08:31:14.517-07:00" }, "Amount": "50.00" } ] }; // BankTransfers | 
             try {
    -            BankTransfers result = apiInstance.createBankTransfer(xeroTenantId, bankTransfers);
    +            BankTransfers result = apiInstance.createBankTransfer(accessToken, xeroTenantId, bankTransfers);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBankTransfer");
                 e.printStackTrace();
             }
    @@ -9362,8 +9551,21 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransfers: BankTransfers = { bankTransfers: [{ fromBankAccount: { code: "000", accountID: "00000000-0000-0000-0000-000000000000" }, toBankAccount: { code: "001", accountID: "00000000-0000-0000-0000-000000000000" }, amount: "50.00" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const fromBankAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; + +const toBankAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; + +const bankTransfer: BankTransfer = { + fromBankAccount: fromBankAccount, + toBankAccount: toBankAccount, + amount: 1.0 }; + +const bankTransfers: BankTransfers = { + bankTransfers: [bankTransfer] }; try { const response = await xero.accountingApi.createBankTransfer(xeroTenantId, bankTransfers); @@ -9371,8 +9573,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -9783,32 +10026,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
    +            Attachments result = apiInstance.createBankTransferAttachmentByFileName(accessToken, xeroTenantId, bankTransferID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBankTransferAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -9881,13 +10126,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a Bank Transfer +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -9901,8 +10145,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -10378,31 +10636,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords);
    +            HistoryRecords result = apiInstance.createBankTransferHistoryRecord(accessToken, xeroTenantId, bankTransferID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBankTransferHistoryRecord");
                 e.printStackTrace();
             }
    @@ -10471,10 +10731,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createBankTransferHistoryRecord(xeroTenantId, bankTransferID, historyRecords); @@ -10482,8 +10747,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -10931,31 +11217,51 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        BatchPayments batchPayments = { "BatchPayments": [ { "Account": { "AccountID": "00000000-0000-0000-0000-000000000000" }, "Reference": "ref", "Date": "2018-08-01", "Payments": [ { "Account": { "Code": "001" }, "Date": "2019-12-31", "Amount": 500, "Invoice": { "InvoiceID": "00000000-0000-0000-0000-000000000000", "LineItems": [], "Contact": {}, "Type": "ACCPAY" } } ] } ] }; // BatchPayments | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            BatchPayments result = apiInstance.createBatchPayment(xeroTenantId, batchPayments, summarizeErrors);
    +            BatchPayments result = apiInstance.createBatchPayment(accessToken, xeroTenantId, batchPayments, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBatchPayment");
                 e.printStackTrace();
             }
    @@ -11025,11 +11331,35 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const currDate = '2020-12-10' + +const paymentAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; + +const bankAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; + +const invoice: Invoice = { + invoiceID: "00000000-0000-0000-0000-000000000000" }; + +const payment: Payment = { + account: bankAccount, + date: currDate, + amount: 1.0, + invoice: invoice }; +const payments = []; +payments.push(payment) +const batchPayment: BatchPayment = { + account: paymentAccount, + reference: "hello foobar", + date: currDate, + payments: payments }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const batchPayments: BatchPayments = { batchPayments: [{ account: { accountId: "00000000-0000-0000-0000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [{ account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceId: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY }}]}]} +const batchPayments: BatchPayments = { + batchPayments: [batchPayment] }; try { const response = await xero.accountingApi.createBatchPayment(xeroTenantId, batchPayments, summarizeErrors); @@ -11037,8 +11367,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -11480,31 +11891,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments/{BatchPaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID batchPaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID batchPaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for BatchPayment
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords);
    +            HistoryRecords result = apiInstance.createBatchPaymentHistoryRecord(accessToken, xeroTenantId, batchPaymentID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBatchPaymentHistoryRecord");
                 e.printStackTrace();
             }
    @@ -11573,10 +11986,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const batchPaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for BatchPayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const batchPaymentID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createBatchPaymentHistoryRecord(xeroTenantId, batchPaymentID, historyRecords); @@ -11584,8 +12002,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -12033,31 +12472,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes/{BrandingThemeID}/PaymentServices"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID brandingThemeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        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");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID brandingThemeID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Branding Theme
    -        PaymentService paymentService = { "PaymentServiceID": "00000000-0000-0000-0000-000000000000", "PaymentServiceName": "ACME Payments", "PaymentServiceUrl": "https://www.payupnow.com/", "PayNowText": "Pay Now" }; // PaymentService | 
             try {
    -            PaymentServices result = apiInstance.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService);
    +            PaymentServices result = apiInstance.createBrandingThemePaymentServices(accessToken, xeroTenantId, brandingThemeID, paymentService);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createBrandingThemePaymentServices");
                 e.printStackTrace();
             }
    @@ -12127,9 +12569,14 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const brandingThemeID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Branding Theme -const paymentService: PaymentService = { paymentServiceID: "00000000-0000-0000-0000-000000000000", paymentServiceName: "ACME Payments", paymentServiceUrl: "https://www.payupnow.com/", payNowText: "Pay Now" } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const brandingThemeID = '00000000-0000-0000-0000-000000000000'; + +const paymentService: PaymentService = { + paymentServiceID: "00000000-0000-0000-0000-000000000000", + paymentServiceName: "ACME Payments", + paymentServiceUrl: "https://www.payupnow.com/", + payNowText: "Pay Now" }; try { const response = await xero.accountingApi.createBrandingThemePaymentServices(xeroTenantId, brandingThemeID, paymentService); @@ -12137,8 +12584,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -12586,32 +13053,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
    +            Attachments result = apiInstance.createContactAttachmentByFileName(accessToken, xeroTenantId, contactID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createContactAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -12684,13 +13153,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact -const fileName = "xero-dev.jpg"; // {String} Name for the file you are attaching +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -12704,8 +13172,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -13181,30 +13663,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        ContactGroup contactGroup = new ContactGroup();
    +        contactGroup.setName("VIPs");
    +        ContactGroups contactGroups = new ContactGroups();
    +        contactGroups.addContactGroupsItem(contactGroup);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        ContactGroups contactGroups = { "ContactGroups": [{ "Name": "VIPs" }]}; // ContactGroups | 
             try {
    -            ContactGroups result = apiInstance.createContactGroup(xeroTenantId, contactGroups);
    +            ContactGroups result = apiInstance.createContactGroup(accessToken, xeroTenantId, contactGroups);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createContactGroup");
                 e.printStackTrace();
             }
    @@ -13271,8 +13755,13 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactGroups: ContactGroups = { contactGroups: [{ name: "VIPs" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const contactGroup: ContactGroup = { + name: "VIPs" }; + +const contactGroups: ContactGroups = { + contactGroups: [contactGroup] }; try { const response = await xero.accountingApi.createContactGroup(xeroTenantId, contactGroups); @@ -13280,8 +13769,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -13693,31 +14201,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}/Contacts"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Contact contact = new Contact();
    +        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
    +        Contacts contacts = new Contacts();
    +        contacts.addContactsItem(contact);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactGroupID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact Group
    -        Contacts contacts = { "Contacts": [ { "ContactID": "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { "ContactID": "4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] }; // Contacts | 
             try {
    -            Contacts result = apiInstance.createContactGroupContacts(xeroTenantId, contactGroupID, contacts);
    +            Contacts result = apiInstance.createContactGroupContacts(accessToken, xeroTenantId, contactGroupID, contacts);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createContactGroupContacts");
                 e.printStackTrace();
             }
    @@ -13787,9 +14297,14 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactGroupID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact Group -const contacts: Contacts = { contacts: [{ contactID: "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID: "4e1753b9-018a-4775-b6aa-1bc7871cfee3" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactGroupID = '00000000-0000-0000-0000-000000000000'; + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const contacts: Contacts = { + contacts: [contact] }; try { const response = await xero.accountingApi.createContactGroupContacts(xeroTenantId, contactGroupID, contacts); @@ -13797,8 +14312,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -14246,31 +14782,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createContactHistory(xeroTenantId, contactID, historyRecords);
    +            HistoryRecords result = apiInstance.createContactHistory(accessToken, xeroTenantId, contactID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createContactHistory");
                 e.printStackTrace();
             }
    @@ -14339,10 +14877,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createContactHistory(xeroTenantId, contactID, historyRecords); @@ -14350,8 +14893,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -14799,31 +15363,41 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Contacts contacts = { "Id": "e997d6d7-6dad-4458-beb8-d9c1bf7f2edf", "Status": "OK", "ProviderName": "Xero API Partner", "DateTimeUTC": "/Date(1551399321121)/", "Contacts": [ { "ContactID": "3ff6d40c-af9a-40a3-89ce-3c1556a25591", "ContactStatus": "ACTIVE", "Name": "Foo9987", "EmailAddress": "sid32476@blah.com", "BankAccountDetails": "", "Addresses": [ { "AddressType": "STREET", "City": "", "Region": "", "PostalCode": "", "Country": "" }, { "AddressType": "POBOX", "City": "", "Region": "", "PostalCode": "", "Country": "" } ], "Phones": [ { "PhoneType": "DEFAULT", "PhoneNumber": "", "PhoneAreaCode": "", "PhoneCountryCode": "" }, { "PhoneType": "DDI", "PhoneNumber": "", "PhoneAreaCode": "", "PhoneCountryCode": "" }, { "PhoneType": "FAX", "PhoneNumber": "", "PhoneAreaCode": "", "PhoneCountryCode": "" }, { "PhoneType": "MOBILE", "PhoneNumber": "555-1212", "PhoneAreaCode": "415", "PhoneCountryCode": "" } ], "UpdatedDateUTC": "/Date(1551399321043+0000)/", "ContactGroups": [], "IsSupplier": false, "IsCustomer": false, "SalesTrackingCategories": [], "PurchasesTrackingCategories": [], "PaymentTerms": { "Bills": { "Day": 15, "Type": "OFCURRENTMONTH" }, "Sales": { "Day": 10, "Type": "DAYSAFTERBILLMONTH" } }, "ContactPersons": [], "HasValidationErrors": false } ] }; // Contacts | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Contacts result = apiInstance.createContacts(xeroTenantId, contacts, summarizeErrors);
    +            Contacts result = apiInstance.createContacts(accessToken, xeroTenantId, contacts, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createContacts");
                 e.printStackTrace();
             }
    @@ -14893,11 +15467,22 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; + +const phone: Phone = { + phoneNumber: "555-1212", + phoneType: Phone.PhoneTypeEnum.MOBILE }; +const phones = []; +phones.push(phone) +const contact: Contact = { + name: "Bruce Banner", + emailAddress: "hulk@avengers.com", + phones: phones }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const contacts: Contacts = { contacts: [{ name: "Bruce Banner", emailAddress: "hulk@avengers.com", phones: [{ phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber: "555-1212", phoneAreaCode: "415" }], paymentTerms: { bills: { day: 15, type: PaymentTermType.OFCURRENTMONTH }, sales: { day: 10, type: PaymentTermType.DAYSAFTERBILLMONTH }}}]} +const contacts: Contacts = { + contacts: [contact] }; try { const response = await xero.accountingApi.createContacts(xeroTenantId, contacts, summarizeErrors); @@ -14905,8 +15490,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -15349,32 +15979,39 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Allocations?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        Allocations allocations = { "Allocations": [ { "Invoice": { "LineItems": [], "InvoiceID": "c45720a1-ade3-4a38-a064-d15489be6841" }, "Amount": 1, "Date": "2019-03-05" } ] }; // Allocations | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Allocations result = apiInstance.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations, summarizeErrors);
    +            Allocations result = apiInstance.createCreditNoteAllocation(accessToken, xeroTenantId, creditNoteID, allocations, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createCreditNoteAllocation");
                 e.printStackTrace();
             }
    @@ -15447,12 +16084,21 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const summarizeErrors = true; +const currDate = '2020-12-10' +const invoice: Invoice = { + invoiceID: "00000000-0000-0000-0000-000000000000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const allocations: Allocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoiceID: "c45720a1-ade3-4a38-a064-d15489be6841", lineItems: [], type: Invoice.TypeEnum.ACCPAY, contact: {} }}]} +const allocation: Allocation = { + amount: 1.0, + date: currDate, + invoice: invoice }; + +const allocations: Allocations = { + allocations: [allocation] }; try { const response = await xero.accountingApi.createCreditNoteAllocation(xeroTenantId, creditNoteID, allocations, summarizeErrors); @@ -15460,8 +16106,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -15940,33 +16626,35 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{FileName}?IncludeOnline=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        Boolean includeOnline = true;
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
    -        Boolean includeOnline = true; // Boolean | Allows an attachment to be seen by the end customer within their online invoice
             try {
    -            Attachments result = apiInstance.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, includeOnline);
    +            Attachments result = apiInstance.createCreditNoteAttachmentByFileName(accessToken, xeroTenantId, creditNoteID, fileName, body, includeOnline, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createCreditNoteAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -16042,19 +16730,16 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note -const fileName = "xero-dev.jpg"; // {String} Name of the file you are attaching to Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const includeOnline = true; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); -const includeOnline = true; // {Boolean} Allows an attachment to be seen by the end customer within their online invoice - - try { const response = await xero.accountingApi.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, includeOnline, { headers: { @@ -16065,8 +16750,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -16573,31 +17274,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords);
    +            HistoryRecords result = apiInstance.createCreditNoteHistory(accessToken, xeroTenantId, creditNoteID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createCreditNoteHistory");
                 e.printStackTrace();
             }
    @@ -16666,10 +17369,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createCreditNoteHistory(xeroTenantId, creditNoteID, historyRecords); @@ -16677,8 +17385,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -17126,32 +17855,48 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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<LineItems> lineItems = new ArrayList<LineItems>();
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        CreditNotes creditNotes = { "CreditNotes":[ { "Type":"ACCPAYCREDIT", "Contact":{ "ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8" }, "Date":"2019-01-05", "LineItems":[ { "Description":"Foobar", "Quantity":2.0, "UnitAmount":20.0, "AccountCode":"400" } ] } ] }; // CreditNotes | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            CreditNotes result = apiInstance.createCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
    +            CreditNotes result = apiInstance.createCreditNotes(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createCreditNotes");
                 e.printStackTrace();
             }
    @@ -17224,13 +17969,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; +const currDate = '2020-12-10' +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const creditNotes: CreditNotes = { creditNotes: [{ type: CreditNote.TypeEnum.ACCPAYCREDIT, contact: { contactID: "430fa14a-f945-44d3-9f97-5df5e28441b8" }, date: "2019-01-05", lineItems: [{ description: "Foobar", quantity: 2.0, unitAmount: 20.0, accountCode: "400" }]}]} +const creditNote: CreditNote = { + type: CreditNote.TypeEnum.ACCPAYCREDIT, + contact: contact, + date: currDate, + lineItems: lineItems }; + +const creditNotes: CreditNotes = { + creditNotes: [creditNote] }; try { const response = await xero.accountingApi.createCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp); @@ -17238,8 +18000,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -17705,30 +18533,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Currencies"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Currency currency = new Currency();
    +        currency.setCode(com.xero.models.accounting.CurrencyCode.USD);
    +        currency.setDescription("United States Dollar");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Currency currency = { "Code": "USD", "Description": "United States Dollar" }; // Currency | 
             try {
    -            Currencies result = apiInstance.createCurrency(xeroTenantId, currency);
    +            Currencies result = apiInstance.createCurrency(accessToken, xeroTenantId, currency);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createCurrency");
                 e.printStackTrace();
             }
    @@ -17795,8 +18624,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const currency: Currency = { code: CurrencyCode.USD, description: "United States Dollar" } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const currency: Currency = { + code: CurrencyCode.USD, + description: "United States Dollar" }; try { const response = await xero.accountingApi.createCurrency(xeroTenantId, currency); @@ -17804,8 +18636,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -18146,31 +18990,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Employees?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Employee employee = new Employee();
    +        employee.setFirstName("Nick");
    +        employee.setLastName("Fury");
    +        Employees employees = new Employees();
    +        employees.addEmployeesItem(employee);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Employees employees = { "Employees": [ { "FirstName": "Nick", "LastName": "Fury", "ExternalLink": { "Url": "http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Employees result = apiInstance.createEmployees(xeroTenantId, employees, summarizeErrors);
    +            Employees result = apiInstance.createEmployees(accessToken, xeroTenantId, employees, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createEmployees");
                 e.printStackTrace();
             }
    @@ -18240,11 +19087,15 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const employee: Employee = { + firstName: "Nick", + lastName: "Fury" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const employees: Employees = { employees: [{ firstName: "Nick", lastName: "Fury", externalLink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} +const employees: Employees = { + employees: [employee] }; try { const response = await xero.accountingApi.createEmployees(xeroTenantId, employees, summarizeErrors); @@ -18252,8 +19103,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -18695,31 +19570,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID expenseClaimID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ExpenseClaim
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords);
    +            HistoryRecords result = apiInstance.createExpenseClaimHistory(accessToken, xeroTenantId, expenseClaimID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createExpenseClaimHistory");
                 e.printStackTrace();
             }
    @@ -18788,10 +19665,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const expenseClaimID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ExpenseClaim +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const expenseClaimID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createExpenseClaimHistory(xeroTenantId, expenseClaimID, historyRecords); @@ -18799,8 +19681,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -19179,30 +20082,43 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        ExpenseClaims expenseClaims = { "ExpenseClaims": [ { "Status": "SUBMITTED", "User": { "UserID": "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, "Receipts": [ { "Lineitems": [], "ReceiptID": "dc1c7f6d-0a4c-402f-acac-551d62ce5816" } ] } ] }; // ExpenseClaims | 
             try {
    -            ExpenseClaims result = apiInstance.createExpenseClaims(xeroTenantId, expenseClaims);
    +            ExpenseClaims result = apiInstance.createExpenseClaims(accessToken, xeroTenantId, expenseClaims);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createExpenseClaims");
                 e.printStackTrace();
             }
    @@ -19269,8 +20185,25 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const expenseClaims: ExpenseClaims = { expenseClaims: [{ status: ExpenseClaim.StatusEnum.SUBMITTED, user: { userID: "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts: [{ receiptID: "dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems: [], contact: {}, user: {}, date: "2018-01-01" }]}]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const currDate = '2020-12-10' + +const user: User = { + userID: "00000000-0000-0000-0000-000000000000" }; + +const receipt: Receipt = { + receiptID: "00000000-0000-0000-0000-000000000000", + date: currDate }; +const receipts = []; +receipts.push(receipt) + +const expenseClaim: ExpenseClaim = { + status: ExpenseClaim.StatusEnum.SUBMITTED, + user: user, + receipts: receipts }; + +const expenseClaims: ExpenseClaims = { + expenseClaims: [expenseClaim] }; try { const response = await xero.accountingApi.createExpenseClaims(xeroTenantId, expenseClaims); @@ -19278,8 +20211,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -19690,33 +20677,35 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{FileName}?IncludeOnline=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        Boolean includeOnline = true;
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
    -        Boolean includeOnline = true; // Boolean | Allows an attachment to be seen by the end customer within their online invoice
             try {
    -            Attachments result = apiInstance.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, includeOnline);
    +            Attachments result = apiInstance.createInvoiceAttachmentByFileName(accessToken, xeroTenantId, invoiceID, fileName, body, includeOnline, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createInvoiceAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -19792,19 +20781,16 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice -const fileName = "xero-dev.jpg"; // {String} Name of the file you are attaching +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const includeOnline = true; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); -const includeOnline = true; // {Boolean} Allows an attachment to be seen by the end customer within their online invoice - - try { const response = await xero.accountingApi.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, includeOnline, { headers: { @@ -19815,8 +20801,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -20323,31 +21325,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords);
    +            HistoryRecords result = apiInstance.createInvoiceHistory(accessToken, xeroTenantId, invoiceID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createInvoiceHistory");
                 e.printStackTrace();
             }
    @@ -20416,10 +21420,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createInvoiceHistory(xeroTenantId, invoiceID, historyRecords); @@ -20427,8 +21436,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -20876,32 +21906,59 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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.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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Invoices invoices = { "Invoices": [ { "Type": "ACCREC", "Contact": { "ContactID": "430fa14a-f945-44d3-9f97-5df5e28441b8" }, "LineItems": [ { "Description": "Acme Tires", "Quantity": 2, "UnitAmount": 20, "AccountCode": "200", "TaxType": "NONE", "LineAmount": 40 } ], "Date": "2019-03-11", "DueDate": "2018-12-10", "Reference": "Website Design", "Status": "AUTHORISED" } ] }; // Invoices | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Invoices result = apiInstance.createInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
    +            Invoices result = apiInstance.createInvoices(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createInvoices");
                 e.printStackTrace();
             }
    @@ -20974,13 +22031,41 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - - -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const invoices: Invoices = { invoices: [{ type: Invoice.TypeEnum.ACCREC, contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Acme Tires", quantity: 2.0, unitAmount: 20.0, accountCode: "000", taxType: TaxType.NONE, lineAmount: 40.0 }], date: "2019-03-11", dueDate: "2018-12-10", reference: "Website Design", status: Invoice.StatusEnum.DRAFT }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; +const dateValue = '2020-10-10' +const dueDateValue = '2020-10-28' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItemTracking: LineItemTracking = { + trackingCategoryID: "00000000-0000-0000-0000-000000000000", + trackingOptionID: "00000000-0000-0000-0000-000000000000" }; +const lineItemTrackings = []; +lineItemTrackings.push(lineItemTracking) + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000", + tracking: lineItemTrackings }; +const lineItems = []; +lineItems.push(lineItem) + +const invoice: Invoice = { + type: Invoice.TypeEnum.ACCREC, + contact: contact, + date: dateValue, + dueDate: dueDateValue, + lineItems: lineItems, + reference: "Website Design", + status: Invoice.StatusEnum.DRAFT }; + +const invoices: Invoices = { + invoices: [invoice] }; try { const response = await xero.accountingApi.createInvoices(xeroTenantId, invoices, summarizeErrors, unitdp); @@ -20988,8 +22073,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -21455,31 +22639,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID itemID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Item
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createItemHistory(xeroTenantId, itemID, historyRecords);
    +            HistoryRecords result = apiInstance.createItemHistory(accessToken, xeroTenantId, itemID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createItemHistory");
                 e.printStackTrace();
             }
    @@ -21548,10 +22734,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const itemID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Item +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const itemID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createItemHistory(xeroTenantId, itemID, historyRecords); @@ -21559,8 +22750,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -21939,32 +23151,40 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Items items = { "Items": [ { "Code": "code123", "Name": "Item Name XYZ", "Description": "Foobar", "InventoryAssetAccountCode": "140", "PurchaseDetails": { "COGSAccountCode": "500" } } ] }; // Items | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Items result = apiInstance.createItems(xeroTenantId, items, summarizeErrors, unitdp);
    +            Items result = apiInstance.createItems(accessToken, xeroTenantId, items, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createItems");
                 e.printStackTrace();
             }
    @@ -22037,13 +23257,22 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; +const purchaseDetails: Purchase = { + cOGSAccountCode: "500" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors +const item: Item = { + code: "abcXYZ123", + name: "HelloWorld", + description: "Foobar", + inventoryAssetAccountCode: "140", + purchaseDetails: purchaseDetails }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const items: Items = { items: [{ code: "abcXYZ123", name: "HelloWorld11", description: "Foobar", inventoryAssetAccountCode: "140", purchaseDetails: { cOGSAccountCode: "500" }}]} +const items: Items = { + items: [item] }; try { const response = await xero.accountingApi.createItems(xeroTenantId, items, summarizeErrors, unitdp); @@ -22051,8 +23280,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -22518,30 +23789,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        LinkedTransaction linkedTransaction = new LinkedTransaction();
    +        linkedTransaction.setSourceTransactionID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
    +        linkedTransaction.setSourceLineItemID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        LinkedTransaction linkedTransaction = { "LinkedTransactions": [ { "SourceTransactionID": "a848644a-f20f-4630-98c3-386bd7505631", "SourceLineItemID": "b0df260d-3cc8-4ced-9bd6-41924f624ed3" } ] }; // LinkedTransaction | 
             try {
    -            LinkedTransactions result = apiInstance.createLinkedTransaction(xeroTenantId, linkedTransaction);
    +            LinkedTransactions result = apiInstance.createLinkedTransaction(accessToken, xeroTenantId, linkedTransaction);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createLinkedTransaction");
                 e.printStackTrace();
             }
    @@ -22608,8 +23880,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const linkedTransaction: LinkedTransaction = { sourceTransactionID: "00000000-0000-0000-0000-000000000000", sourceLineItemID: "00000000-0000-0000-0000-000000000000" } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const linkedTransaction: LinkedTransaction = { + sourceTransactionID: "00000000-0000-0000-0000-000000000000", + sourceLineItemID: "00000000-0000-0000-0000-000000000000" }; try { const response = await xero.accountingApi.createLinkedTransaction(xeroTenantId, linkedTransaction); @@ -22617,8 +23892,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -23029,32 +24316,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
    +            Attachments result = apiInstance.createManualJournalAttachmentByFileName(accessToken, xeroTenantId, manualJournalID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createManualJournalAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -23127,13 +24416,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a ManualJournal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -23147,8 +24435,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -23624,31 +24926,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a manual journal
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createManualJournalHistoryRecord(xeroTenantId, manualJournalID, historyRecords);
    +            HistoryRecords result = apiInstance.createManualJournalHistoryRecord(accessToken, xeroTenantId, manualJournalID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createManualJournalHistoryRecord");
                 e.printStackTrace();
             }
    @@ -23717,10 +25021,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a manual journal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createManualJournalHistoryRecord(xeroTenantId, manualJournalID, historyRecords); @@ -23728,8 +25037,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -24177,31 +25507,48 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        ManualJournals manualJournals = { "ManualJournals": [ { "Narration": "Journal Desc", "JournalLines": [ { "LineAmount": 100, "AccountCode": "400", "Description": "Money Movement" }, { "LineAmount": -100, "AccountCode": "400", "Description": "Prepayment of things", "Tracking": [ { "Name": "North", "Option": "Region" } ] } ], "Date": "2019-03-14" } ] }; // ManualJournals | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            ManualJournals result = apiInstance.createManualJournals(xeroTenantId, manualJournals, summarizeErrors);
    +            ManualJournals result = apiInstance.createManualJournals(accessToken, xeroTenantId, manualJournals, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createManualJournals");
                 e.printStackTrace();
             }
    @@ -24271,11 +25618,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' +const manualJournalLines = []; + +const credit: ManualJournalLine = { + lineAmount: 100.0, + accountCode: "400", + description: "Hello there" }; +manualJournalLines.push(credit) + +const debit: ManualJournalLine = { + lineAmount: -100.0, + accountCode: "120", + description: "Hello there" }; +manualJournalLines.push(debit) +const manualJournal: ManualJournal = { + narration: "Foobar", + date: dateValue, + journalLines: manualJournalLines }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const manualJournals: ManualJournals = { manualJournals: [{ narration: "Foo bar", date: "2019-03-14", journalLines: [{ lineAmount: 100.0, accountCode: "400", description: "Hello there" }, { lineAmount: -100.0, accountCode: "400", description: "Goodbye", tracking: [{ name: "Simpson", option: "Bart" }] }]}]} +const manualJournals: ManualJournals = { + manualJournals: [manualJournal] }; try { const response = await xero.accountingApi.createManualJournals(xeroTenantId, manualJournals, summarizeErrors); @@ -24283,8 +25649,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -24726,32 +26160,39 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}/Allocations?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID overpaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Overpayment
    -        Allocations allocations = { "Allocations": [ { "Invoice": { "InvoiceID": "00000000-0000-0000-0000-000000000000", "LineItems": [], "Contact": {}, "Type": "ACCPAY" }, "Amount": 10.00, "Date": "2019-03-12" } ] }; // Allocations | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Allocations result = apiInstance.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations, summarizeErrors);
    +            Allocations result = apiInstance.createOverpaymentAllocations(accessToken, xeroTenantId, overpaymentID, allocations, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createOverpaymentAllocations");
                 e.printStackTrace();
             }
    @@ -24824,12 +26265,21 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const overpaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Overpayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const overpaymentID = '00000000-0000-0000-0000-000000000000'; +const summarizeErrors = true; +const currDate = '2020-12-10' +const invoice: Invoice = { + invoiceID: "00000000-0000-0000-0000-000000000000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const allocations: Allocations = { allocations: [{ invoice: { invoiceID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount: 10.0, date: "2019-03-12" }]} +const allocation: Allocation = { + amount: 1.0, + date: currDate, + invoice: invoice }; + +const allocations: Allocations = { + allocations: [allocation] }; try { const response = await xero.accountingApi.createOverpaymentAllocations(xeroTenantId, overpaymentID, allocations, summarizeErrors); @@ -24837,8 +26287,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -25317,31 +26807,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID overpaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Overpayment
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords);
    +            HistoryRecords result = apiInstance.createOverpaymentHistory(accessToken, xeroTenantId, overpaymentID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createOverpaymentHistory");
                 e.printStackTrace();
             }
    @@ -25410,10 +26902,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const overpaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Overpayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const overpaymentID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createOverpaymentHistory(xeroTenantId, overpaymentID, historyRecords); @@ -25421,8 +26918,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -25871,30 +27389,40 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        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("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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Payment payment = { "Payments": [ { "Invoice": { "LineItems": [], "InvoiceID": "00000000-0000-0000-0000-000000000000" }, "Account": { "Code": "970" }, "Date": "2019-03-12", "Amount": 1 } ] }; // Payment | 
             try {
    -            Payments result = apiInstance.createPayment(xeroTenantId, payment);
    +            Payments result = apiInstance.createPayment(accessToken, xeroTenantId, payment);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPayment");
                 e.printStackTrace();
             }
    @@ -25961,8 +27489,23 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const payment: Payment = { invoice: { invoiceID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const dateValue = '2020-10-10' + +const invoice: Invoice = { + invoiceID: "00000000-0000-0000-0000-000000000000" }; + +const account: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; + +const payment: Payment = { + invoice: invoice, + account: account, + amount: 1.0, + date: dateValue }; + +const payments: Payments = { + payments: [payment] }; try { const response = await xero.accountingApi.createPayment(xeroTenantId, payment); @@ -25970,8 +27513,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -26382,31 +27972,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID paymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Payment
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createPaymentHistory(xeroTenantId, paymentID, historyRecords);
    +            HistoryRecords result = apiInstance.createPaymentHistory(accessToken, xeroTenantId, paymentID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPaymentHistory");
                 e.printStackTrace();
             }
    @@ -26475,10 +28067,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const paymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Payment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const paymentID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createPaymentHistory(xeroTenantId, paymentID, historyRecords); @@ -26486,8 +28083,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -26936,30 +28554,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PaymentServices"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        PaymentServices paymentServices = { "PaymentServices": [ { "PaymentServiceName": "PayUpNow", "PaymentServiceUrl": "https://www.payupnow.com/", "PayNowText": "Time To Pay" } ] }; // PaymentServices | 
             try {
    -            PaymentServices result = apiInstance.createPaymentService(xeroTenantId, paymentServices);
    +            PaymentServices result = apiInstance.createPaymentService(accessToken, xeroTenantId, paymentServices);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPaymentService");
                 e.printStackTrace();
             }
    @@ -27026,8 +28648,15 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const paymentServices: PaymentServices = { paymentServices: [{ paymentServiceName: "PayUpNow", paymentServiceUrl: "https://www.payupnow.com/", payNowText: "Time To Pay" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const paymentService: PaymentService = { + paymentServiceName: "ACME Payments", + paymentServiceUrl: "https://www.payupnow.com/", + payNowText: "Pay Now" }; + +const paymentServices: PaymentServices = { + paymentServices: [paymentService] }; try { const response = await xero.accountingApi.createPaymentService(xeroTenantId, paymentServices); @@ -27035,8 +28664,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -27447,31 +29101,41 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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("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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Payments payments = { "Payments": [ { "Invoice": { "LineItems": [], "InvoiceID": "00000000-0000-0000-0000-000000000000" }, "Account": { "Code": "970" }, "Date": "2019-03-12", "Amount": 1 } ] }; // Payments | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Payments result = apiInstance.createPayments(xeroTenantId, payments, summarizeErrors);
    +            Payments result = apiInstance.createPayments(accessToken, xeroTenantId, payments, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPayments");
                 e.printStackTrace();
             }
    @@ -27541,11 +29205,24 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' + +const invoice: Invoice = { + invoiceID: "00000000-0000-0000-0000-000000000000" }; + +const account: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; +const payment: Payment = { + invoice: invoice, + account: account, + amount: 1.0, + date: dateValue }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const payments: Payments = { payments: [{ invoice: { invoiceID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 }]} +const payments: Payments = { + payments: [payment] }; try { const response = await xero.accountingApi.createPayments(xeroTenantId, payments, summarizeErrors); @@ -27553,8 +29230,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -27996,32 +29722,39 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}/Allocations?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID prepaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Prepayment
    -        Allocations allocations = { "Allocations": [ { "Invoice": { "LineItems": [], "InvoiceID": "00000000-0000-0000-0000-000000000000" }, "Amount": 1, "Date": "2019-01-10" } ] }; // Allocations | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Allocations result = apiInstance.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations, summarizeErrors);
    +            Allocations result = apiInstance.createPrepaymentAllocations(accessToken, xeroTenantId, prepaymentID, allocations, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPrepaymentAllocations");
                 e.printStackTrace();
             }
    @@ -28094,12 +29827,21 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const prepaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Prepayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const prepaymentID = '00000000-0000-0000-0000-000000000000'; +const summarizeErrors = true; +const currDate = '2020-12-10' +const invoice: Invoice = { + invoiceID: "00000000-0000-0000-0000-000000000000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const allocations: Allocations = { allocations: [{ invoice: { invoiceID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, type: null }, amount: 1.0, date: "2019-03-13" }]} +const allocation: Allocation = { + invoice: invoice, + amount: 1.0, + date: currDate }; + +const allocations: Allocations = { + allocations: [allocation] }; try { const response = await xero.accountingApi.createPrepaymentAllocations(xeroTenantId, prepaymentID, allocations, summarizeErrors); @@ -28107,8 +29849,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -28587,31 +30369,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID prepaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PrePayment
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords);
    +            HistoryRecords result = apiInstance.createPrepaymentHistory(accessToken, xeroTenantId, prepaymentID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPrepaymentHistory");
                 e.printStackTrace();
             }
    @@ -28680,10 +30464,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const prepaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PrePayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const prepaymentID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createPrepaymentHistory(xeroTenantId, prepaymentID, historyRecords); @@ -28691,8 +30480,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -29141,32 +30951,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.png';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Purchase Order object
    -        String fileName = xero-dev.png; // String | Name of the attachment
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createPurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body);
    +            Attachments result = apiInstance.createPurchaseOrderAttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPurchaseOrderAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -29239,13 +31051,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Purchase Order object -const fileName = "xero-dev.png"; // {String} Name of the attachment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.png'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -29259,8 +31070,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -29736,31 +31561,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PurchaseOrder
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords);
    +            HistoryRecords result = apiInstance.createPurchaseOrderHistory(accessToken, xeroTenantId, purchaseOrderID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPurchaseOrderHistory");
                 e.printStackTrace();
             }
    @@ -29829,10 +31656,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PurchaseOrder +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createPurchaseOrderHistory(xeroTenantId, purchaseOrderID, historyRecords); @@ -29840,8 +31672,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -30289,31 +32142,46 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        PurchaseOrders purchaseOrders = { "PurchaseOrders": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "710" } ], "Date": "2019-03-13" } ] }; // PurchaseOrders | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            PurchaseOrders result = apiInstance.createPurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
    +            PurchaseOrders result = apiInstance.createPurchaseOrders(accessToken, xeroTenantId, purchaseOrders, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createPurchaseOrders");
                 e.printStackTrace();
             }
    @@ -30383,11 +32251,28 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) +const purchaseOrder: PurchaseOrder = { + contact: contact, + lineItems: lineItems, + date: dateValue }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const purchaseOrders: PurchaseOrders = { purchaseOrders: [{ contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} +const purchaseOrders: PurchaseOrders = { + purchaseOrders: [purchaseOrder] }; try { const response = await xero.accountingApi.createPurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors); @@ -30395,8 +32280,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -30838,32 +32785,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Quote object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
    +            Attachments result = apiInstance.createQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createQuoteAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -30936,13 +32885,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Quote object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -30956,8 +32904,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -31433,31 +33395,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Quote
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createQuoteHistory(xeroTenantId, quoteID, historyRecords);
    +            HistoryRecords result = apiInstance.createQuoteHistory(accessToken, xeroTenantId, quoteID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createQuoteHistory");
                 e.printStackTrace();
             }
    @@ -31526,10 +33490,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Quote +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createQuoteHistory(xeroTenantId, quoteID, historyRecords); @@ -31537,8 +33506,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -31986,31 +33976,46 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Quotes quotes = { "Quotes": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "12775" } ], "Date": "2020-02-01" } ] }; // Quotes | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Quotes result = apiInstance.createQuotes(xeroTenantId, quotes, summarizeErrors);
    +            Quotes result = apiInstance.createQuotes(accessToken, xeroTenantId, quotes, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createQuotes");
                 e.printStackTrace();
             }
    @@ -32080,11 +34085,28 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const quotes: Quotes = { quotes: [{ contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "12775" }], date: "2020-02-01" }]} +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) + +const quote: Quote = { + contact: contact, + lineItems: lineItems, + date: dateValue }; + +const quotes: Quotes = { + quotes: [quote] }; try { const response = await xero.accountingApi.createQuotes(xeroTenantId, quotes, summarizeErrors); @@ -32092,8 +34114,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -32535,31 +34619,49 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Integer unitdp = 4;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Receipts receipts = { "Receipts": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "Lineitems": [ { "Description": "Foobar", "Quantity": 2, "UnitAmount": 20, "AccountCode": "400", "TaxType": "NONE", "LineAmount": 40 } ], "User": { "UserID": "00000000-0000-0000-0000-000000000000" }, "LineAmountTypes": "NoTax", "Status": "DRAFT" } ] }; // Receipts | 
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Receipts result = apiInstance.createReceipt(xeroTenantId, receipts, unitdp);
    +            Receipts result = apiInstance.createReceipt(accessToken, xeroTenantId, receipts, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createReceipt");
                 e.printStackTrace();
             }
    @@ -32629,11 +34731,32 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const unitdp = 4; + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const user: User = { + userID: "00000000-0000-0000-0000-000000000000" }; +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const receipts: Receipts = { receipts: [{ contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 2.0, unitAmount: 20.0, accountCode: "400", taxType: TaxType.NONE, lineAmount: 40.0 }], user: { userID: "00000000-0000-0000-0000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT, date: null} ] } +const receipt: Receipt = { + contact: contact, + user: user, + lineItems: lineItems, + lineAmountTypes: LineAmountTypes.Inclusive, + status: Receipt.StatusEnum.DRAFT }; + +const receipts: Receipts = { + receipts: [receipt] }; try { const response = await xero.accountingApi.createReceipt(xeroTenantId, receipts, unitdp); @@ -32641,8 +34764,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -33084,32 +35279,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
    +            Attachments result = apiInstance.createReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createReceiptAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -33182,13 +35379,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to the Receipt +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -33202,8 +35398,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -33679,31 +35889,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createReceiptHistory(xeroTenantId, receiptID, historyRecords);
    +            HistoryRecords result = apiInstance.createReceiptHistory(accessToken, xeroTenantId, receiptID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createReceiptHistory");
                 e.printStackTrace();
             }
    @@ -33772,10 +35984,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createReceiptHistory(xeroTenantId, receiptID, historyRecords); @@ -33783,8 +36000,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -34233,32 +36471,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
    +            Attachments result = apiInstance.createRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -34331,13 +36571,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a Repeating Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -34351,8 +36590,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -34828,31 +37081,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        HistoryRecord historyRecord = new HistoryRecord();
    +        historyRecord.setDetails("Hello World");
    +        HistoryRecords historyRecords = new HistoryRecords();
    +        historyRecords.addHistoryRecordsItem(historyRecord);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
    -        HistoryRecords historyRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // HistoryRecords | 
             try {
    -            HistoryRecords result = apiInstance.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords);
    +            HistoryRecords result = apiInstance.createRepeatingInvoiceHistory(accessToken, xeroTenantId, repeatingInvoiceID, historyRecords);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createRepeatingInvoiceHistory");
                 e.printStackTrace();
             }
    @@ -34921,10 +37176,15 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const historyRecords: HistoryRecords = { "HistoryRecords": [ { "Details": "Hello World" } ] }; // {HistoryRecords} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; + +const historyRecord: HistoryRecord = { + details: "Hello World" }; + +const historyRecords: HistoryRecords = { + historyRecords: [historyRecord] }; try { const response = await xero.accountingApi.createRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID, historyRecords); @@ -34932,8 +37192,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -35381,30 +37662,36 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TaxRates"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        TaxComponent taxComponent = new TaxComponent();
    +        taxComponent.setName("State Tax");
    +        taxComponent.setRate(2.25);
    +        TaxRate taxRate = new TaxRate();
    +        taxRate.setName("CA State Tax");
    +        taxRate.addTaxComponentsItem(taxComponent);
    +        TaxRates taxRates = new TaxRates();
    +        taxRates.addTaxRatesItem(taxRate);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        TaxRates taxRates = { "TaxRates": [ { "Name": "CA State Tax", "TaxComponents": [ { "Name": "State Tax", "Rate": 2.25 } ] } ] }; // TaxRates | 
             try {
    -            TaxRates result = apiInstance.createTaxRates(xeroTenantId, taxRates);
    +            TaxRates result = apiInstance.createTaxRates(accessToken, xeroTenantId, taxRates);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createTaxRates");
                 e.printStackTrace();
             }
    @@ -35471,8 +37758,18 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const taxRates: TaxRates = { taxRates: [{ name: "CA State Tax", taxComponents: [{ name: "State Tax", rate: 2.25 }]}]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const taxComponent: TaxComponent = { + name: "State Tax", + rate: 2.25 }; + +const taxRate: TaxRate = { + name: "CA State Tax", + taxRate: [taxComponent] }; + +const taxRates: TaxRates = { + taxRates: [taxRate] }; try { const response = await xero.accountingApi.createTaxRates(xeroTenantId, taxRates); @@ -35480,8 +37777,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -35892,30 +38224,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        TrackingCategory trackingCategory = new TrackingCategory();
    +        trackingCategory.setName("Foobar");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        TrackingCategory trackingCategory = { name: "FooBar" }; // TrackingCategory | 
             try {
    -            TrackingCategories result = apiInstance.createTrackingCategory(xeroTenantId, trackingCategory);
    +            TrackingCategories result = apiInstance.createTrackingCategory(accessToken, xeroTenantId, trackingCategory);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createTrackingCategory");
                 e.printStackTrace();
             }
    @@ -35981,9 +38313,11 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const trackingCategory: TrackingCategory = { name: "FooBar" }; // {TrackingCategory} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const trackingCategory: TrackingCategory = { + name: "Foobar" }; try { const response = await xero.accountingApi.createTrackingCategory(xeroTenantId, trackingCategory); @@ -35991,8 +38325,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -36403,31 +38746,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        TrackingOption trackingOption = new TrackingOption();
    +        trackingOption.setName("Foobar");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
    -        TrackingOption trackingOption = { name: " Bar" }; // TrackingOption | 
             try {
    -            TrackingOptions result = apiInstance.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption);
    +            TrackingOptions result = apiInstance.createTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOption);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#createTrackingOptions");
                 e.printStackTrace();
             }
    @@ -36496,10 +38839,12 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const trackingOption: TrackingOption = { name: " Bar" }; // {TrackingOption} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const trackingCategoryID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a TrackingCategory +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; + +const trackingOption: TrackingOption = { + name: "Foobar" }; try { const response = await xero.accountingApi.createTrackingOptions(xeroTenantId, trackingCategoryID, trackingOption); @@ -36507,8 +38852,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -36956,30 +39312,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for retrieving single object
             try {
    -            Accounts result = apiInstance.deleteAccount(xeroTenantId, accountID);
    +            Accounts result = apiInstance.deleteAccount(accessToken, xeroTenantId, accountID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteAccount");
                 e.printStackTrace();
             }
    @@ -37046,8 +39401,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for retrieving single object +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteAccount(xeroTenantId, accountID); @@ -37055,8 +39410,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -37443,30 +39803,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}/Contacts/{ContactID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactGroupID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact Group
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
             try {
    -            apiInstance.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID);
    -        } catch (ApiException e) {
    +             result = apiInstance.deleteContactGroupContact(accessToken, xeroTenantId, contactGroupID, contactID);
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteContactGroupContact");
                 e.printStackTrace();
             }
    @@ -37532,9 +39891,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactGroupID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact Group -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactGroupID = '00000000-0000-0000-0000-000000000000'; +const contactID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteContactGroupContact(xeroTenantId, contactGroupID, contactID); @@ -37542,8 +39901,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -37910,29 +40276,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}/Contacts"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactGroupID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact Group
             try {
    -            apiInstance.deleteContactGroupContacts(xeroTenantId, contactGroupID);
    -        } catch (ApiException e) {
    +             result = apiInstance.deleteContactGroupContacts(accessToken, xeroTenantId, contactGroupID);
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteContactGroupContacts");
                 e.printStackTrace();
             }
    @@ -37995,8 +40360,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactGroupID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact Group +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactGroupID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteContactGroupContacts(xeroTenantId, contactGroupID); @@ -38004,8 +40369,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -38273,29 +40643,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID itemID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Item
             try {
    -            apiInstance.deleteItem(xeroTenantId, itemID);
    -        } catch (ApiException e) {
    +             result = apiInstance.deleteItem(accessToken, xeroTenantId, itemID);
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteItem");
                 e.printStackTrace();
             }
    @@ -38358,8 +40727,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const itemID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Item +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const itemID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteItem(xeroTenantId, itemID); @@ -38367,8 +40736,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -38705,29 +41079,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions/{LinkedTransactionID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID linkedTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a LinkedTransaction
             try {
    -            apiInstance.deleteLinkedTransaction(xeroTenantId, linkedTransactionID);
    -        } catch (ApiException e) {
    +             result = apiInstance.deleteLinkedTransaction(accessToken, xeroTenantId, linkedTransactionID);
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteLinkedTransaction");
                 e.printStackTrace();
             }
    @@ -38790,8 +41163,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const linkedTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a LinkedTransaction +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const linkedTransactionID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteLinkedTransaction(xeroTenantId, linkedTransactionID); @@ -38799,8 +41172,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -39137,31 +41515,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        PaymentDelete paymentDelete = new PaymentDelete();
    +        paymentDelete.setStatus("DELETED");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID paymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Payment
    -        PaymentDelete paymentDelete = { "Payments":[ { "Status":"DELETED" } ] }; // PaymentDelete | 
             try {
    -            Payments result = apiInstance.deletePayment(xeroTenantId, paymentID, paymentDelete);
    +            Payments result = apiInstance.deletePayment(accessToken, xeroTenantId, paymentID, paymentDelete);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deletePayment");
                 e.printStackTrace();
             }
    @@ -39231,9 +41609,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const paymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Payment -const paymentDelete: PaymentDelete = { status: "DELETED" } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const paymentID = '00000000-0000-0000-0000-000000000000'; + +const paymentDelete: PaymentDelete = { + status: "DELETED" }; try { const response = await xero.accountingApi.deletePayment(xeroTenantId, paymentID, paymentDelete); @@ -39241,8 +41621,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -39689,30 +42080,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
             try {
    -            TrackingCategories result = apiInstance.deleteTrackingCategory(xeroTenantId, trackingCategoryID);
    +            TrackingCategories result = apiInstance.deleteTrackingCategory(accessToken, xeroTenantId, trackingCategoryID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteTrackingCategory");
                 e.printStackTrace();
             }
    @@ -39779,8 +42169,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const trackingCategoryID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a TrackingCategory +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteTrackingCategory(xeroTenantId, trackingCategoryID); @@ -39788,8 +42178,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -40175,31 +42570,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID trackingOptionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
    -        UUID trackingOptionID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Tracking Option
             try {
    -            TrackingOptions result = apiInstance.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID);
    +            TrackingOptions result = apiInstance.deleteTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#deleteTrackingOptions");
                 e.printStackTrace();
             }
    @@ -40269,9 +42663,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const trackingCategoryID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a TrackingCategory -const trackingOptionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Tracking Option +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; +const trackingOptionID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.deleteTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID); @@ -40279,8 +42673,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -40696,30 +43097,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Email"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        RequestEmpty requestEmpty = new RequestEmpty();
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        RequestEmpty requestEmpty = {}; // RequestEmpty | 
             try {
    -            apiInstance.emailInvoice(xeroTenantId, invoiceID, requestEmpty);
    -        } catch (ApiException e) {
    +             result = apiInstance.emailInvoice(accessToken, xeroTenantId, invoiceID, requestEmpty);
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#emailInvoice");
                 e.printStackTrace();
             }
    @@ -40784,10 +43184,11 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const requestEmpty: RequestEmpty = {}; // {RequestEmpty} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; + +const requestEmpty: RequestEmpty = { }; try { const response = await xero.accountingApi.emailInvoice(xeroTenantId, invoiceID, requestEmpty); @@ -40795,8 +43196,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -41194,30 +43603,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for retrieving single object
             try {
    -            Accounts result = apiInstance.getAccount(xeroTenantId, accountID);
    +            Accounts result = apiInstance.getAccount(accessToken, xeroTenantId, accountID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getAccount");
                 e.printStackTrace();
             }
    @@ -41284,8 +43692,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for retrieving single object +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getAccount(xeroTenantId, accountID); @@ -41293,8 +43701,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -41611,32 +44024,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Account object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getAccountAttachmentByFileName(accessToken, xeroTenantId, accountID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getAccountAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -41709,10 +44121,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Account object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getAccountAttachmentByFileName(xeroTenantId, accountID, fileName, contentType); @@ -41720,8 +44132,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -42092,32 +44513,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Account object
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Attachment object
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getAccountAttachmentById(accessToken, xeroTenantId, accountID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getAccountAttachmentById");
                 e.printStackTrace();
             }
    @@ -42190,10 +44610,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Account object -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Attachment object -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getAccountAttachmentById(xeroTenantId, accountID, attachmentID, contentType); @@ -42201,8 +44621,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -42576,30 +45005,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Account object
             try {
    -            Attachments result = apiInstance.getAccountAttachments(xeroTenantId, accountID);
    +            Attachments result = apiInstance.getAccountAttachments(accessToken, xeroTenantId, accountID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getAccountAttachments");
                 e.printStackTrace();
             }
    @@ -42666,8 +45094,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Account object +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getAccountAttachments(xeroTenantId, accountID); @@ -42675,8 +45103,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -42994,32 +45427,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts?where=Status=="ACTIVE" AND Type=="BANK"&order=Name ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="ACTIVE" AND Type=="BANK"; // String | Filter by an any element
    -        String order = Name ASC; // String | Order by an any element
             try {
    -            Accounts result = apiInstance.getAccounts(xeroTenantId, ifModifiedSince, where, order);
    +            Accounts result = apiInstance.getAccounts(accessToken, xeroTenantId, ifModifiedSince, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getAccounts");
                 e.printStackTrace();
             }
    @@ -43092,13 +45525,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="ACTIVE" AND Type=="BANK"'; // {String} Filter by an any element - -const order = 'Name ASC'; // {String} Order by an any element - +const where = 'Status=="ACTIVE" AND Type=="BANK"'; +const order = 'Name ASC'; try { const response = await xero.accountingApi.getAccounts(xeroTenantId, ifModifiedSince, where, order); @@ -43106,8 +45536,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -43469,31 +45908,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            BankTransactions result = apiInstance.getBankTransaction(xeroTenantId, bankTransactionID, unitdp);
    +            BankTransactions result = apiInstance.getBankTransaction(accessToken, xeroTenantId, bankTransactionID, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransaction");
                 e.printStackTrace();
             }
    @@ -43563,11 +46001,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; try { const response = await xero.accountingApi.getBankTransaction(xeroTenantId, bankTransactionID, unitdp); @@ -43575,8 +46011,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -43924,32 +46366,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getBankTransactionAttachmentByFileName(accessToken, xeroTenantId, bankTransactionID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -44022,10 +46463,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, contentType); @@ -44033,8 +46474,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -44405,32 +46855,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for an attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getBankTransactionAttachmentById(accessToken, xeroTenantId, bankTransactionID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransactionAttachmentById");
                 e.printStackTrace();
             }
    @@ -44503,10 +46952,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for an attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getBankTransactionAttachmentById(xeroTenantId, bankTransactionID, attachmentID, contentType); @@ -44514,8 +46963,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -44889,30 +47347,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
             try {
    -            Attachments result = apiInstance.getBankTransactionAttachments(xeroTenantId, bankTransactionID);
    +            Attachments result = apiInstance.getBankTransactionAttachments(accessToken, xeroTenantId, bankTransactionID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransactionAttachments");
                 e.printStackTrace();
             }
    @@ -44979,8 +47436,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBankTransactionAttachments(xeroTenantId, bankTransactionID); @@ -44988,8 +47445,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -45307,34 +47769,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions?where=Status=="AUTHORISED"&order=Type ASC&page=1&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="AUTHORISED"; // String | Filter by an any element
    -        String order = Type ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | Up to 100 bank transactions will be returned in a single API call with line items details
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            BankTransactions result = apiInstance.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
    +            BankTransactions result = apiInstance.getBankTransactions(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransactions");
                 e.printStackTrace();
             }
    @@ -45413,17 +47875,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="AUTHORISED"'; // {String} Filter by an any element - -const order = 'Type ASC'; // {String} Order by an any element - -const page = 1; // {Integer} Up to 100 bank transactions will be returned in a single API call with line items details - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'Status=="AUTHORISED"'; +const order = 'Type ASC'; +const page = 1; +const unitdp = 4; try { const response = await xero.accountingApi.getBankTransactions(xeroTenantId, ifModifiedSince, where, order, page, unitdp); @@ -45431,8 +47888,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -45842,30 +48310,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
             try {
    -            HistoryRecords result = apiInstance.getBankTransactionsHistory(xeroTenantId, bankTransactionID);
    +            HistoryRecords result = apiInstance.getBankTransactionsHistory(accessToken, xeroTenantId, bankTransactionID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransactionsHistory");
                 e.printStackTrace();
             }
    @@ -45932,8 +48399,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBankTransactionsHistory(xeroTenantId, bankTransactionID); @@ -45941,8 +48408,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -46259,30 +48731,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
             try {
    -            BankTransfers result = apiInstance.getBankTransfer(xeroTenantId, bankTransferID);
    +            BankTransfers result = apiInstance.getBankTransfer(accessToken, xeroTenantId, bankTransferID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransfer");
                 e.printStackTrace();
             }
    @@ -46349,8 +48820,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBankTransfer(xeroTenantId, bankTransferID); @@ -46358,8 +48829,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -46676,32 +49152,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getBankTransferAttachmentByFileName(accessToken, xeroTenantId, bankTransferID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -46774,10 +49249,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a Bank Transfer -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, contentType); @@ -46785,8 +49260,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -47157,32 +49641,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for an Attachment to a bank transfer
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getBankTransferAttachmentById(accessToken, xeroTenantId, bankTransferID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransferAttachmentById");
                 e.printStackTrace();
             }
    @@ -47255,10 +49738,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for an Attachment to a bank transfer -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getBankTransferAttachmentById(xeroTenantId, bankTransferID, attachmentID, contentType); @@ -47266,8 +49749,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -47641,30 +50133,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
             try {
    -            Attachments result = apiInstance.getBankTransferAttachments(xeroTenantId, bankTransferID);
    +            Attachments result = apiInstance.getBankTransferAttachments(accessToken, xeroTenantId, bankTransferID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransferAttachments");
                 e.printStackTrace();
             }
    @@ -47731,8 +50222,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBankTransferAttachments(xeroTenantId, bankTransferID); @@ -47740,8 +50231,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -48059,30 +50555,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
             try {
    -            HistoryRecords result = apiInstance.getBankTransferHistory(xeroTenantId, bankTransferID);
    +            HistoryRecords result = apiInstance.getBankTransferHistory(accessToken, xeroTenantId, bankTransferID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransferHistory");
                 e.printStackTrace();
             }
    @@ -48149,8 +50644,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBankTransferHistory(xeroTenantId, bankTransferID); @@ -48158,8 +50653,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -48476,32 +50976,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers?where=HasAttachments==true&order=Amount ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = HasAttachments==true; // String | Filter by an any element
    -        String order = Amount ASC; // String | Order by an any element
             try {
    -            BankTransfers result = apiInstance.getBankTransfers(xeroTenantId, ifModifiedSince, where, order);
    +            BankTransfers result = apiInstance.getBankTransfers(accessToken, xeroTenantId, ifModifiedSince, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBankTransfers");
                 e.printStackTrace();
             }
    @@ -48574,13 +51074,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'HasAttachments==true'; // {String} Filter by an any element - -const order = 'Amount ASC'; // {String} Order by an any element - +const where = 'HasAttachments==true'; +const order = 'Amount ASC'; try { const response = await xero.accountingApi.getBankTransfers(xeroTenantId, ifModifiedSince, where, order); @@ -48588,8 +51085,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -48951,30 +51457,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments/{BatchPaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID batchPaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID batchPaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for BatchPayment
             try {
    -            HistoryRecords result = apiInstance.getBatchPaymentHistory(xeroTenantId, batchPaymentID);
    +            HistoryRecords result = apiInstance.getBatchPaymentHistory(accessToken, xeroTenantId, batchPaymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBatchPaymentHistory");
                 e.printStackTrace();
             }
    @@ -49041,8 +51546,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const batchPaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for BatchPayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const batchPaymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBatchPaymentHistory(xeroTenantId, batchPaymentID); @@ -49050,8 +51555,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -49368,32 +51878,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BatchPayments?where=Status=="AUTHORISED"&order=Date ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="AUTHORISED"; // String | Filter by an any element
    -        String order = Date ASC; // String | Order by an any element
             try {
    -            BatchPayments result = apiInstance.getBatchPayments(xeroTenantId, ifModifiedSince, where, order);
    +            BatchPayments result = apiInstance.getBatchPayments(accessToken, xeroTenantId, ifModifiedSince, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBatchPayments");
                 e.printStackTrace();
             }
    @@ -49466,13 +51976,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="AUTHORISED"'; // {String} Filter by an any element - -const order = 'Date ASC'; // {String} Order by an any element - +const where = 'Status=="AUTHORISED"'; +const order = 'Date ASC'; try { const response = await xero.accountingApi.getBatchPayments(xeroTenantId, ifModifiedSince, where, order); @@ -49480,8 +51987,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -49843,30 +52359,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes/{BrandingThemeID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID brandingThemeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID brandingThemeID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Branding Theme
             try {
    -            BrandingThemes result = apiInstance.getBrandingTheme(xeroTenantId, brandingThemeID);
    +            BrandingThemes result = apiInstance.getBrandingTheme(accessToken, xeroTenantId, brandingThemeID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBrandingTheme");
                 e.printStackTrace();
             }
    @@ -49933,8 +52448,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const brandingThemeID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Branding Theme +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const brandingThemeID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBrandingTheme(xeroTenantId, brandingThemeID); @@ -49942,8 +52457,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -50260,30 +52780,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes/{BrandingThemeID}/PaymentServices"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID brandingThemeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID brandingThemeID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Branding Theme
             try {
    -            PaymentServices result = apiInstance.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID);
    +            PaymentServices result = apiInstance.getBrandingThemePaymentServices(accessToken, xeroTenantId, brandingThemeID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBrandingThemePaymentServices");
                 e.printStackTrace();
             }
    @@ -50350,8 +52869,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const brandingThemeID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Branding Theme +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const brandingThemeID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getBrandingThemePaymentServices(xeroTenantId, brandingThemeID); @@ -50359,8 +52878,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -50677,29 +53201,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BrandingThemes"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
             try {
    -            BrandingThemes result = apiInstance.getBrandingThemes(xeroTenantId);
    +            BrandingThemes result = apiInstance.getBrandingThemes(accessToken, xeroTenantId);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getBrandingThemes");
                 e.printStackTrace();
             }
    @@ -50763,7 +53286,7 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; try { const response = await xero.accountingApi.getBrandingThemes(xeroTenantId); @@ -50771,8 +53294,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -51052,30 +53578,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
             try {
    -            Contacts result = apiInstance.getContact(xeroTenantId, contactID);
    +            Contacts result = apiInstance.getContact(accessToken, xeroTenantId, contactID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContact");
                 e.printStackTrace();
             }
    @@ -51142,8 +53667,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getContact(xeroTenantId, contactID); @@ -51151,8 +53676,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -51469,32 +53999,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getContactAttachmentByFileName(accessToken, xeroTenantId, contactID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -51567,10 +54096,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact -const fileName = "xero-dev.jpg"; // {String} Name for the file you are attaching -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getContactAttachmentByFileName(xeroTenantId, contactID, fileName, contentType); @@ -51578,8 +54107,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -51950,32 +54488,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getContactAttachmentById(accessToken, xeroTenantId, contactID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactAttachmentById");
                 e.printStackTrace();
             }
    @@ -52048,10 +54585,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getContactAttachmentById(xeroTenantId, contactID, attachmentID, contentType); @@ -52059,8 +54596,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -52434,30 +54980,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
             try {
    -            Attachments result = apiInstance.getContactAttachments(xeroTenantId, contactID);
    +            Attachments result = apiInstance.getContactAttachments(accessToken, xeroTenantId, contactID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactAttachments");
                 e.printStackTrace();
             }
    @@ -52524,8 +55069,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getContactAttachments(xeroTenantId, contactID); @@ -52533,8 +55078,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -52852,30 +55402,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactNumber}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String contactNumber = 'SB2';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String contactNumber = SB2; // String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).
             try {
    -            Contacts result = apiInstance.getContactByContactNumber(xeroTenantId, contactNumber);
    +            Contacts result = apiInstance.getContactByContactNumber(accessToken, xeroTenantId, contactNumber);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactByContactNumber");
                 e.printStackTrace();
             }
    @@ -52942,8 +55491,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactNumber = "SB2"; // {String} This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactNumber = 'SB2'; try { const response = await xero.accountingApi.getContactByContactNumber(xeroTenantId, contactNumber); @@ -52951,8 +55500,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -53266,30 +55820,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/CISSettings"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
             try {
    -            CISSettings result = apiInstance.getContactCISSettings(xeroTenantId, contactID);
    +            CISSettings result = apiInstance.getContactCISSettings(accessToken, xeroTenantId, contactID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactCISSettings");
                 e.printStackTrace();
             }
    @@ -53356,8 +55909,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getContactCISSettings(xeroTenantId, contactID); @@ -53365,8 +55918,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -53682,30 +56240,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactGroupID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact Group
             try {
    -            ContactGroups result = apiInstance.getContactGroup(xeroTenantId, contactGroupID);
    +            ContactGroups result = apiInstance.getContactGroup(accessToken, xeroTenantId, contactGroupID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactGroup");
                 e.printStackTrace();
             }
    @@ -53772,8 +56329,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactGroupID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact Group +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactGroupID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getContactGroup(xeroTenantId, contactGroupID); @@ -53781,8 +56338,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -54099,31 +56661,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups?where=Status=="ACTIVE"&order=Name ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String where = 'Status=="ACTIVE"';
    +        String order = 'Name ASC';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String where = Status=="ACTIVE"; // String | Filter by an any element
    -        String order = Name ASC; // String | Order by an any element
             try {
    -            ContactGroups result = apiInstance.getContactGroups(xeroTenantId, where, order);
    +            ContactGroups result = apiInstance.getContactGroups(accessToken, xeroTenantId, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactGroups");
                 e.printStackTrace();
             }
    @@ -54193,12 +56754,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const where = 'Status=="ACTIVE"'; // {String} Filter by an any element - -const order = 'Name ASC'; // {String} Order by an any element - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const where = 'Status=="ACTIVE"'; +const order = 'Name ASC'; try { const response = await xero.accountingApi.getContactGroups(xeroTenantId, where, order); @@ -54206,8 +56764,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -54542,30 +57107,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
             try {
    -            HistoryRecords result = apiInstance.getContactHistory(xeroTenantId, contactID);
    +            HistoryRecords result = apiInstance.getContactHistory(accessToken, xeroTenantId, contactID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContactHistory");
                 e.printStackTrace();
             }
    @@ -54632,8 +57196,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getContactHistory(xeroTenantId, contactID); @@ -54641,8 +57205,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -54959,35 +57528,35 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts?where=ContactStatus=="ACTIVE"&order=Name ASC&IDs="00000000-0000-0000-0000-000000000000"&page=1&includeArchived=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = ContactStatus=="ACTIVE"; // String | Filter by an any element
    -        String order = Name ASC; // String | Order by an any element
    -        array[UUID] iDs = "00000000-0000-0000-0000-000000000000"; // array[UUID] | Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
    -        Integer page = 1; // Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call.
    -        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
             try {
    -            Contacts result = apiInstance.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived);
    +            Contacts result = apiInstance.getContacts(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getContacts");
                 e.printStackTrace();
             }
    @@ -55069,19 +57638,13 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'ContactStatus=="ACTIVE"'; // {String} Filter by an any element - -const order = 'Name ASC'; // {String} Order by an any element - -const iDs = ['"00000000-0000-0000-0000-000000000000"']; // {array[UUID]} Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. - -const page = 1; // {Integer} e.g. page=1 - Up to 100 contacts will be returned in a single API call. - -const includeArchived = true; // {Boolean} e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - +const where = 'ContactStatus=="ACTIVE"'; +const order = 'Name ASC'; +const iDs = ["00000000-0000-0000-0000-000000000000"]; +const page = 1; +const includeArchived = true; try { const response = await xero.accountingApi.getContacts(xeroTenantId, ifModifiedSince, where, order, iDs, page, includeArchived); @@ -55089,8 +57652,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -55527,31 +58104,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            CreditNotes result = apiInstance.getCreditNote(xeroTenantId, creditNoteID, unitdp);
    +            CreditNotes result = apiInstance.getCreditNote(accessToken, xeroTenantId, creditNoteID, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNote");
                 e.printStackTrace();
             }
    @@ -55621,11 +58197,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; try { const response = await xero.accountingApi.getCreditNote(xeroTenantId, creditNoteID, unitdp); @@ -55633,8 +58207,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -55982,30 +58562,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/pdf"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
             try {
    -            File result = apiInstance.getCreditNoteAsPdf(xeroTenantId, creditNoteID);
    +            ByteArrayInputStream result = apiInstance.getCreditNoteAsPdf(accessToken, xeroTenantId, creditNoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNoteAsPdf");
                 e.printStackTrace();
             }
    @@ -56072,8 +58651,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getCreditNoteAsPdf(xeroTenantId, creditNoteID); @@ -56081,8 +58660,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -56399,32 +58983,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getCreditNoteAttachmentByFileName(accessToken, xeroTenantId, creditNoteID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -56497,10 +59080,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note -const fileName = "xero-dev.jpg"; // {String} Name of the file you are attaching to Credit Note -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, contentType); @@ -56508,8 +59091,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -56880,32 +59472,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getCreditNoteAttachmentById(accessToken, xeroTenantId, creditNoteID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNoteAttachmentById");
                 e.printStackTrace();
             }
    @@ -56978,10 +59569,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getCreditNoteAttachmentById(xeroTenantId, creditNoteID, attachmentID, contentType); @@ -56989,8 +59580,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -57364,30 +59964,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
             try {
    -            Attachments result = apiInstance.getCreditNoteAttachments(xeroTenantId, creditNoteID);
    +            Attachments result = apiInstance.getCreditNoteAttachments(accessToken, xeroTenantId, creditNoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNoteAttachments");
                 e.printStackTrace();
             }
    @@ -57454,8 +60053,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getCreditNoteAttachments(xeroTenantId, creditNoteID); @@ -57463,8 +60062,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -57782,30 +60386,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
             try {
    -            HistoryRecords result = apiInstance.getCreditNoteHistory(xeroTenantId, creditNoteID);
    +            HistoryRecords result = apiInstance.getCreditNoteHistory(accessToken, xeroTenantId, creditNoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNoteHistory");
                 e.printStackTrace();
             }
    @@ -57872,8 +60475,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getCreditNoteHistory(xeroTenantId, creditNoteID); @@ -57881,8 +60484,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -58199,34 +60807,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?where=Status=="DRAFT"&order=CreditNoteNumber ASC&page=1&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="DRAFT"; // String | Filter by an any element
    -        String order = CreditNoteNumber ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            CreditNotes result = apiInstance.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
    +            CreditNotes result = apiInstance.getCreditNotes(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCreditNotes");
                 e.printStackTrace();
             }
    @@ -58305,17 +60913,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="DRAFT"'; // {String} Filter by an any element - -const order = 'CreditNoteNumber ASC'; // {String} Order by an any element - -const page = 1; // {Integer} e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'Status=="DRAFT"'; +const order = 'CreditNoteNumber ASC'; +const page = 1; +const unitdp = 4; try { const response = await xero.accountingApi.getCreditNotes(xeroTenantId, ifModifiedSince, where, order, page, unitdp); @@ -58323,8 +60926,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -58734,31 +61348,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Currencies?where=Code=="USD"&order=Code ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String where = 'Code=="USD"';
    +        String order = 'Code ASC';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String where = Code=="USD"; // String | Filter by an any element
    -        String order = Code ASC; // String | Order by an any element
             try {
    -            Currencies result = apiInstance.getCurrencies(xeroTenantId, where, order);
    +            Currencies result = apiInstance.getCurrencies(accessToken, xeroTenantId, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getCurrencies");
                 e.printStackTrace();
             }
    @@ -58828,12 +61441,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const where = 'Code=="USD"'; // {String} Filter by an any element - -const order = 'Code ASC'; // {String} Order by an any element - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const where = 'Code=="USD"'; +const order = 'Code ASC'; try { const response = await xero.accountingApi.getCurrencies(xeroTenantId, where, order); @@ -58841,8 +61451,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -59177,30 +61794,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Employees/{EmployeeID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID employeeID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID employeeID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Employee
             try {
    -            Employees result = apiInstance.getEmployee(xeroTenantId, employeeID);
    +            Employees result = apiInstance.getEmployee(accessToken, xeroTenantId, employeeID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getEmployee");
                 e.printStackTrace();
             }
    @@ -59267,8 +61883,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const employeeID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Employee +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const employeeID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getEmployee(xeroTenantId, employeeID); @@ -59276,8 +61892,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -59594,32 +62215,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Employees?where=Status=="ACTIVE"&order=LastName ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="ACTIVE"; // String | Filter by an any element
    -        String order = LastName ASC; // String | Order by an any element
             try {
    -            Employees result = apiInstance.getEmployees(xeroTenantId, ifModifiedSince, where, order);
    +            Employees result = apiInstance.getEmployees(accessToken, xeroTenantId, ifModifiedSince, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getEmployees");
                 e.printStackTrace();
             }
    @@ -59692,13 +62313,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="ACTIVE"'; // {String} Filter by an any element - -const order = 'LastName ASC'; // {String} Order by an any element - +const where = 'Status=="ACTIVE"'; +const order = 'LastName ASC'; try { const response = await xero.accountingApi.getEmployees(xeroTenantId, ifModifiedSince, where, order); @@ -59706,8 +62324,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -60069,30 +62696,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID expenseClaimID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ExpenseClaim
             try {
    -            ExpenseClaims result = apiInstance.getExpenseClaim(xeroTenantId, expenseClaimID);
    +            ExpenseClaims result = apiInstance.getExpenseClaim(accessToken, xeroTenantId, expenseClaimID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getExpenseClaim");
                 e.printStackTrace();
             }
    @@ -60159,8 +62785,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const expenseClaimID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ExpenseClaim +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const expenseClaimID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getExpenseClaim(xeroTenantId, expenseClaimID); @@ -60168,8 +62794,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -60486,30 +63117,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID expenseClaimID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ExpenseClaim
             try {
    -            HistoryRecords result = apiInstance.getExpenseClaimHistory(xeroTenantId, expenseClaimID);
    +            HistoryRecords result = apiInstance.getExpenseClaimHistory(accessToken, xeroTenantId, expenseClaimID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getExpenseClaimHistory");
                 e.printStackTrace();
             }
    @@ -60576,8 +63206,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const expenseClaimID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ExpenseClaim +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const expenseClaimID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getExpenseClaimHistory(xeroTenantId, expenseClaimID); @@ -60585,8 +63215,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -60903,32 +63538,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims?where=Status=="SUBMITTED"&order=Status ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="SUBMITTED"; // String | Filter by an any element
    -        String order = Status ASC; // String | Order by an any element
             try {
    -            ExpenseClaims result = apiInstance.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order);
    +            ExpenseClaims result = apiInstance.getExpenseClaims(accessToken, xeroTenantId, ifModifiedSince, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getExpenseClaims");
                 e.printStackTrace();
             }
    @@ -61001,13 +63636,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="SUBMITTED"'; // {String} Filter by an any element - -const order = 'Status ASC'; // {String} Order by an any element - +const where = 'Status=="SUBMITTED"'; +const order = 'Status ASC'; try { const response = await xero.accountingApi.getExpenseClaims(xeroTenantId, ifModifiedSince, where, order); @@ -61015,8 +63647,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -61378,31 +64019,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Invoices result = apiInstance.getInvoice(xeroTenantId, invoiceID, unitdp);
    +            Invoices result = apiInstance.getInvoice(accessToken, xeroTenantId, invoiceID, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoice");
                 e.printStackTrace();
             }
    @@ -61472,11 +64112,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; try { const response = await xero.accountingApi.getInvoice(xeroTenantId, invoiceID, unitdp); @@ -61484,8 +64122,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -61833,30 +64477,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/pdf"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
             try {
    -            File result = apiInstance.getInvoiceAsPdf(xeroTenantId, invoiceID);
    +            ByteArrayInputStream result = apiInstance.getInvoiceAsPdf(accessToken, xeroTenantId, invoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoiceAsPdf");
                 e.printStackTrace();
             }
    @@ -61923,8 +64566,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getInvoiceAsPdf(xeroTenantId, invoiceID); @@ -61932,8 +64575,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -62250,32 +64898,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getInvoiceAttachmentByFileName(accessToken, xeroTenantId, invoiceID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -62348,10 +64995,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice -const fileName = "xero-dev.jpg"; // {String} Name of the file you are attaching -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, contentType); @@ -62359,8 +65006,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -62731,32 +65387,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getInvoiceAttachmentById(accessToken, xeroTenantId, invoiceID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoiceAttachmentById");
                 e.printStackTrace();
             }
    @@ -62829,10 +65484,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getInvoiceAttachmentById(xeroTenantId, invoiceID, attachmentID, contentType); @@ -62840,8 +65495,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -63215,30 +65879,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
             try {
    -            Attachments result = apiInstance.getInvoiceAttachments(xeroTenantId, invoiceID);
    +            Attachments result = apiInstance.getInvoiceAttachments(accessToken, xeroTenantId, invoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoiceAttachments");
                 e.printStackTrace();
             }
    @@ -63305,8 +65968,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getInvoiceAttachments(xeroTenantId, invoiceID); @@ -63314,8 +65977,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -63633,30 +66301,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
             try {
    -            HistoryRecords result = apiInstance.getInvoiceHistory(xeroTenantId, invoiceID);
    +            HistoryRecords result = apiInstance.getInvoiceHistory(accessToken, xeroTenantId, invoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoiceHistory");
                 e.printStackTrace();
             }
    @@ -63723,8 +66390,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getInvoiceHistory(xeroTenantId, invoiceID); @@ -63732,8 +66399,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -64050,29 +66722,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/InvoiceReminders/Settings"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
             try {
    -            InvoiceReminders result = apiInstance.getInvoiceReminders(xeroTenantId);
    +            InvoiceReminders result = apiInstance.getInvoiceReminders(accessToken, xeroTenantId);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoiceReminders");
                 e.printStackTrace();
             }
    @@ -64136,7 +66807,7 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; try { const response = await xero.accountingApi.getInvoiceReminders(xeroTenantId); @@ -64144,8 +66815,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -64425,40 +67099,40 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices?where=Status=="DRAFT"&order=InvoiceNumber ASC&IDs="00000000-0000-0000-0000-000000000000"&InvoiceNumbers="INV-001", "INV-002"&ContactIDs="00000000-0000-0000-0000-000000000000"&Statuses="DRAFT", "SUBMITTED"&page=1&includeArchived=true&createdByMyApp=false&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="DRAFT"; // String | Filter by an any element
    -        String order = InvoiceNumber ASC; // String | Order by an any element
    -        array[UUID] iDs = "00000000-0000-0000-0000-000000000000"; // array[UUID] | Filter by a comma-separated list of InvoicesIDs.
    -        array[String] invoiceNumbers = "INV-001", "INV-002"; // array[String] | Filter by a comma-separated list of InvoiceNumbers.
    -        array[UUID] contactIDs = "00000000-0000-0000-0000-000000000000"; // array[UUID] | Filter by a comma-separated list of ContactIDs.
    -        array[String] statuses = "DRAFT", "SUBMITTED"; // array[String] | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
    -        Integer page = 1; // Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
    -        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
    -        Boolean createdByMyApp = false; // Boolean | When set to true you'll only retrieve Invoices created by your app
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Invoices result = apiInstance.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp);
    +            Invoices result = apiInstance.getInvoices(accessToken, xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getInvoices");
                 e.printStackTrace();
             }
    @@ -64555,29 +67229,18 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="DRAFT"'; // {String} Filter by an any element - -const order = 'InvoiceNumber ASC'; // {String} Order by an any element - -const iDs = ['"00000000-0000-0000-0000-000000000000"']; // {array[UUID]} Filter by a comma-separated list of InvoicesIDs. - -const invoiceNumbers = ['"INV-001", "INV-002"']; // {array[String]} Filter by a comma-separated list of InvoiceNumbers. - -const contactIDs = ['"00000000-0000-0000-0000-000000000000"']; // {array[UUID]} Filter by a comma-separated list of ContactIDs. - -const statuses = ['"DRAFT", "SUBMITTED"']; // {array[String]} Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. - -const page = 1; // {Integer} e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice - -const includeArchived = true; // {Boolean} e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - -const createdByMyApp = false; // {Boolean} When set to true you'll only retrieve Invoices created by your app - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'Status=="DRAFT"'; +const order = 'InvoiceNumber ASC'; +const iDs = ["00000000-0000-0000-0000-000000000000"]; +const invoiceNumbers = ["INV-001", "INV-002"]; +const contactIDs = ["00000000-0000-0000-0000-000000000000"]; +const statuses = ["DRAFT", "SUBMITTED"]; +const page = 1; +const includeArchived = true; +const createdByMyApp = false; +const unitdp = 4; try { const response = await xero.accountingApi.getInvoices(xeroTenantId, ifModifiedSince, where, order, iDs, invoiceNumbers, contactIDs, statuses, page, includeArchived, createdByMyApp, unitdp); @@ -64585,8 +67248,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -65146,31 +67832,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID itemID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Item
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Items result = apiInstance.getItem(xeroTenantId, itemID, unitdp);
    +            Items result = apiInstance.getItem(accessToken, xeroTenantId, itemID, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getItem");
                 e.printStackTrace();
             }
    @@ -65240,11 +67925,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const itemID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Item - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const itemID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; try { const response = await xero.accountingApi.getItem(xeroTenantId, itemID, unitdp); @@ -65252,8 +67935,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -65601,30 +68290,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID itemID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Item
             try {
    -            HistoryRecords result = apiInstance.getItemHistory(xeroTenantId, itemID);
    +            HistoryRecords result = apiInstance.getItemHistory(accessToken, xeroTenantId, itemID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getItemHistory");
                 e.printStackTrace();
             }
    @@ -65691,8 +68379,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const itemID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Item +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const itemID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getItemHistory(xeroTenantId, itemID); @@ -65700,8 +68388,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -66018,33 +68711,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items?where=IsSold==true&order=Code ASC&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = IsSold==true; // String | Filter by an any element
    -        String order = Code ASC; // String | Order by an any element
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Items result = apiInstance.getItems(xeroTenantId, ifModifiedSince, where, order, unitdp);
    +            Items result = apiInstance.getItems(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getItems");
                 e.printStackTrace();
             }
    @@ -66120,15 +68813,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'IsSold==true'; // {String} Filter by an any element - -const order = 'Code ASC'; // {String} Order by an any element - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'IsSold==true'; +const order = 'Code ASC'; +const unitdp = 4; try { const response = await xero.accountingApi.getItems(xeroTenantId, ifModifiedSince, where, order, unitdp); @@ -66136,8 +68825,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -66523,30 +69222,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Journals/{JournalID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID journalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID journalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Journal
             try {
    -            Journals result = apiInstance.getJournal(xeroTenantId, journalID);
    +            Journals result = apiInstance.getJournal(accessToken, xeroTenantId, journalID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getJournal");
                 e.printStackTrace();
             }
    @@ -66613,8 +69311,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const journalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Journal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const journalID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getJournal(xeroTenantId, journalID); @@ -66622,8 +69320,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -66940,32 +69643,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Journals?offset=10&paymentsOnly=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        Integer offset = 10; // Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
    -        Boolean paymentsOnly = true; // Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.
             try {
    -            Journals result = apiInstance.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly);
    +            Journals result = apiInstance.getJournals(accessToken, xeroTenantId, ifModifiedSince, offset, paymentsOnly);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getJournals");
                 e.printStackTrace();
             }
    @@ -67038,13 +69741,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const offset = 10; // {Integer} Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned - -const paymentsOnly = true; // {Boolean} Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. - +const offset = 10; +const paymentsOnly = true; try { const response = await xero.accountingApi.getJournals(xeroTenantId, ifModifiedSince, offset, paymentsOnly); @@ -67052,8 +69752,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -67415,30 +70123,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions/{LinkedTransactionID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID linkedTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a LinkedTransaction
             try {
    -            LinkedTransactions result = apiInstance.getLinkedTransaction(xeroTenantId, linkedTransactionID);
    +            LinkedTransactions result = apiInstance.getLinkedTransaction(accessToken, xeroTenantId, linkedTransactionID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getLinkedTransaction");
                 e.printStackTrace();
             }
    @@ -67505,8 +70212,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const linkedTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a LinkedTransaction +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const linkedTransactionID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getLinkedTransaction(xeroTenantId, linkedTransactionID); @@ -67514,8 +70221,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -67832,35 +70544,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions?page=1&LinkedTransactionID=00000000-0000-0000-0000-000000000000&SourceTransactionID=00000000-0000-0000-0000-000000000000&ContactID=00000000-0000-0000-0000-000000000000&Status=APPROVED&TargetTransactionID=00000000-0000-0000-0000-000000000000"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Integer page = 1;
    +        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID sourceTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String status = 'APPROVED';
    +        UUID targetTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Integer page = 1; // Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
    -        UUID linkedTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | The Xero identifier for an Linked Transaction
    -        UUID sourceTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
    -        String status = APPROVED; // String | Filter by the combination of ContactID and Status. Get  the linked transactions associated to a  customer and with a status
    -        UUID targetTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
             try {
    -            LinkedTransactions result = apiInstance.getLinkedTransactions(xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
    +            LinkedTransactions result = apiInstance.getLinkedTransactions(accessToken, xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getLinkedTransactions");
                 e.printStackTrace();
             }
    @@ -67942,20 +70653,13 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const page = 1; // {Integer} Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. - -const linkedTransactionID = '00000000-0000-0000-0000-000000000000'; // {UUID} The Xero identifier for an Linked Transaction - -const sourceTransactionID = '00000000-0000-0000-0000-000000000000'; // {UUID} Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice - -const contactID = '00000000-0000-0000-0000-000000000000'; // {UUID} Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. - -const status = 'APPROVED'; // {String} Filter by the combination of ContactID and Status. Get the linked transactions associated to a customer and with a status - -const targetTransactionID = '00000000-0000-0000-0000-000000000000'; // {UUID} Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const page = 1; +const linkedTransactionID = '00000000-0000-0000-0000-000000000000'; +const sourceTransactionID = '00000000-0000-0000-0000-000000000000'; +const contactID = '00000000-0000-0000-0000-000000000000'; +const status = 'APPROVED'; +const targetTransactionID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getLinkedTransactions(xeroTenantId, page, linkedTransactionID, sourceTransactionID, contactID, status, targetTransactionID); @@ -67963,8 +70667,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -68407,30 +71125,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
             try {
    -            ManualJournals result = apiInstance.getManualJournal(xeroTenantId, manualJournalID);
    +            ManualJournals result = apiInstance.getManualJournal(accessToken, xeroTenantId, manualJournalID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getManualJournal");
                 e.printStackTrace();
             }
    @@ -68497,8 +71214,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getManualJournal(xeroTenantId, manualJournalID); @@ -68506,8 +71223,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -68824,32 +71546,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getManualJournalAttachmentByFileName(accessToken, xeroTenantId, manualJournalID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -68922,10 +71643,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a ManualJournal -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, contentType); @@ -68933,8 +71654,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -69305,32 +72035,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getManualJournalAttachmentById(accessToken, xeroTenantId, manualJournalID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getManualJournalAttachmentById");
                 e.printStackTrace();
             }
    @@ -69403,10 +72132,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getManualJournalAttachmentById(xeroTenantId, manualJournalID, attachmentID, contentType); @@ -69414,8 +72143,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -69789,30 +72527,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
             try {
    -            Attachments result = apiInstance.getManualJournalAttachments(xeroTenantId, manualJournalID);
    +            Attachments result = apiInstance.getManualJournalAttachments(accessToken, xeroTenantId, manualJournalID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getManualJournalAttachments");
                 e.printStackTrace();
             }
    @@ -69879,8 +72616,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getManualJournalAttachments(xeroTenantId, manualJournalID); @@ -69888,8 +72625,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -70207,33 +72949,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?where=Status=="DRAFT"&order=Date ASC&page=1"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="DRAFT"; // String | Filter by an any element
    -        String order = Date ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment
             try {
    -            ManualJournals result = apiInstance.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page);
    +            ManualJournals result = apiInstance.getManualJournals(accessToken, xeroTenantId, ifModifiedSince, where, order, page);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getManualJournals");
                 e.printStackTrace();
             }
    @@ -70309,15 +73051,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="DRAFT"'; // {String} Filter by an any element - -const order = 'Date ASC'; // {String} Order by an any element - -const page = 1; // {Integer} e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment - +const where = 'Status=="DRAFT"'; +const order = 'Date ASC'; +const page = 1; try { const response = await xero.accountingApi.getManualJournals(xeroTenantId, ifModifiedSince, where, order, page); @@ -70325,8 +73063,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -70712,30 +73460,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a manual journal
             try {
    -            HistoryRecords result = apiInstance.getManualJournalsHistory(xeroTenantId, manualJournalID);
    +            HistoryRecords result = apiInstance.getManualJournalsHistory(accessToken, xeroTenantId, manualJournalID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getManualJournalsHistory");
                 e.printStackTrace();
             }
    @@ -70802,8 +73549,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a manual journal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getManualJournalsHistory(xeroTenantId, manualJournalID); @@ -70811,8 +73558,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -71129,30 +73881,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/OnlineInvoice"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
             try {
    -            OnlineInvoices result = apiInstance.getOnlineInvoice(xeroTenantId, invoiceID);
    +            OnlineInvoices result = apiInstance.getOnlineInvoice(accessToken, xeroTenantId, invoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOnlineInvoice");
                 e.printStackTrace();
             }
    @@ -71219,8 +73970,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getOnlineInvoice(xeroTenantId, invoiceID); @@ -71228,8 +73979,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -71546,29 +74302,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Organisation/Actions"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
             try {
    -            Actions result = apiInstance.getOrganisationActions(xeroTenantId);
    +            Actions result = apiInstance.getOrganisationActions(accessToken, xeroTenantId);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOrganisationActions");
                 e.printStackTrace();
             }
    @@ -71632,7 +74387,7 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; try { const response = await xero.accountingApi.getOrganisationActions(xeroTenantId); @@ -71640,8 +74395,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -71921,30 +74679,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Organisation/{OrganisationID}/CISSettings"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID organisationID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID organisationID = 00000000-0000-0000-0000-000000000000; // UUID | The unique Xero identifier for an organisation
             try {
    -            CISOrgSettings result = apiInstance.getOrganisationCISSettings(xeroTenantId, organisationID);
    +            CISOrgSettings result = apiInstance.getOrganisationCISSettings(accessToken, xeroTenantId, organisationID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOrganisationCISSettings");
                 e.printStackTrace();
             }
    @@ -72011,8 +74768,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const organisationID = "00000000-0000-0000-0000-000000000000"; // {UUID} The unique Xero identifier for an organisation +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const organisationID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getOrganisationCISSettings(xeroTenantId, organisationID); @@ -72020,8 +74777,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -72337,29 +75099,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Organisation"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
             try {
    -            Organisations result = apiInstance.getOrganisations(xeroTenantId);
    +            Organisations result = apiInstance.getOrganisations(accessToken, xeroTenantId);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOrganisations");
                 e.printStackTrace();
             }
    @@ -72423,7 +75184,7 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; try { const response = await xero.accountingApi.getOrganisations(xeroTenantId); @@ -72431,8 +75192,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -72712,30 +75476,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID overpaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Overpayment
             try {
    -            Overpayments result = apiInstance.getOverpayment(xeroTenantId, overpaymentID);
    +            Overpayments result = apiInstance.getOverpayment(accessToken, xeroTenantId, overpaymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOverpayment");
                 e.printStackTrace();
             }
    @@ -72802,8 +75565,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const overpaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Overpayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const overpaymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getOverpayment(xeroTenantId, overpaymentID); @@ -72811,8 +75574,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -73129,30 +75897,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Overpayments/{OverpaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID overpaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID overpaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Overpayment
             try {
    -            HistoryRecords result = apiInstance.getOverpaymentHistory(xeroTenantId, overpaymentID);
    +            HistoryRecords result = apiInstance.getOverpaymentHistory(accessToken, xeroTenantId, overpaymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOverpaymentHistory");
                 e.printStackTrace();
             }
    @@ -73219,8 +75986,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const overpaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Overpayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const overpaymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getOverpaymentHistory(xeroTenantId, overpaymentID); @@ -73228,8 +75995,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -73546,34 +76318,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Overpayments?where=Status=="AUTHORISED"&order=Status ASC&page=1&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="AUTHORISED"; // String | Filter by an any element
    -        String order = Status ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Overpayments result = apiInstance.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
    +            Overpayments result = apiInstance.getOverpayments(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getOverpayments");
                 e.printStackTrace();
             }
    @@ -73652,17 +76424,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="AUTHORISED"'; // {String} Filter by an any element - -const order = 'Status ASC'; // {String} Order by an any element - -const page = 1; // {Integer} e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'Status=="AUTHORISED"'; +const order = 'Status ASC'; +const page = 1; +const unitdp = 4; try { const response = await xero.accountingApi.getOverpayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp); @@ -73670,8 +76437,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -74081,30 +76859,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID paymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Payment
             try {
    -            Payments result = apiInstance.getPayment(xeroTenantId, paymentID);
    +            Payments result = apiInstance.getPayment(accessToken, xeroTenantId, paymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPayment");
                 e.printStackTrace();
             }
    @@ -74171,8 +76948,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const paymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Payment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const paymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPayment(xeroTenantId, paymentID); @@ -74180,8 +76957,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -74498,30 +77280,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments/{PaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID paymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID paymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Payment
             try {
    -            HistoryRecords result = apiInstance.getPaymentHistory(xeroTenantId, paymentID);
    +            HistoryRecords result = apiInstance.getPaymentHistory(accessToken, xeroTenantId, paymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPaymentHistory");
                 e.printStackTrace();
             }
    @@ -74588,8 +77369,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const paymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Payment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const paymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPaymentHistory(xeroTenantId, paymentID); @@ -74597,8 +77378,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -74915,29 +77701,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PaymentServices"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
             try {
    -            PaymentServices result = apiInstance.getPaymentServices(xeroTenantId);
    +            PaymentServices result = apiInstance.getPaymentServices(accessToken, xeroTenantId);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPaymentServices");
                 e.printStackTrace();
             }
    @@ -75001,7 +77786,7 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; try { const response = await xero.accountingApi.getPaymentServices(xeroTenantId); @@ -75009,8 +77794,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -75290,33 +78078,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Payments?where=Status=="AUTHORISED"&order=Amount ASC&page=1"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="AUTHORISED"; // String | Filter by an any element
    -        String order = Amount ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | Up to 100 payments will be returned in a single API call
             try {
    -            Payments result = apiInstance.getPayments(xeroTenantId, ifModifiedSince, where, order, page);
    +            Payments result = apiInstance.getPayments(accessToken, xeroTenantId, ifModifiedSince, where, order, page);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPayments");
                 e.printStackTrace();
             }
    @@ -75392,15 +78180,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="AUTHORISED"'; // {String} Filter by an any element - -const order = 'Amount ASC'; // {String} Order by an any element - -const page = 1; // {Integer} Up to 100 payments will be returned in a single API call - +const where = 'Status=="AUTHORISED"'; +const order = 'Amount ASC'; +const page = 1; try { const response = await xero.accountingApi.getPayments(xeroTenantId, ifModifiedSince, where, order, page); @@ -75408,8 +78192,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -75795,30 +78589,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID prepaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PrePayment
             try {
    -            Prepayments result = apiInstance.getPrepayment(xeroTenantId, prepaymentID);
    +            Prepayments result = apiInstance.getPrepayment(accessToken, xeroTenantId, prepaymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPrepayment");
                 e.printStackTrace();
             }
    @@ -75885,8 +78678,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const prepaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PrePayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const prepaymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPrepayment(xeroTenantId, prepaymentID); @@ -75894,8 +78687,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -76212,30 +79010,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Prepayments/{PrepaymentID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID prepaymentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID prepaymentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PrePayment
             try {
    -            HistoryRecords result = apiInstance.getPrepaymentHistory(xeroTenantId, prepaymentID);
    +            HistoryRecords result = apiInstance.getPrepaymentHistory(accessToken, xeroTenantId, prepaymentID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPrepaymentHistory");
                 e.printStackTrace();
             }
    @@ -76302,8 +79099,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const prepaymentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PrePayment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const prepaymentID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPrepaymentHistory(xeroTenantId, prepaymentID); @@ -76311,8 +79108,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -76629,34 +79431,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Prepayments?where=Status=="AUTHORISED"&order=Reference ASC&page=1&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="AUTHORISED"; // String | Filter by an any element
    -        String order = Reference ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Prepayments result = apiInstance.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp);
    +            Prepayments result = apiInstance.getPrepayments(accessToken, xeroTenantId, ifModifiedSince, where, order, page, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPrepayments");
                 e.printStackTrace();
             }
    @@ -76735,17 +79537,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="AUTHORISED"'; // {String} Filter by an any element - -const order = 'Reference ASC'; // {String} Order by an any element - -const page = 1; // {Integer} e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'Status=="AUTHORISED"'; +const order = 'Reference ASC'; +const page = 1; +const unitdp = 4; try { const response = await xero.accountingApi.getPrepayments(xeroTenantId, ifModifiedSince, where, order, page, unitdp); @@ -76753,8 +79550,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -77164,30 +79972,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PurchaseOrder
             try {
    -            PurchaseOrders result = apiInstance.getPurchaseOrder(xeroTenantId, purchaseOrderID);
    +            PurchaseOrders result = apiInstance.getPurchaseOrder(accessToken, xeroTenantId, purchaseOrderID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrder");
                 e.printStackTrace();
             }
    @@ -77254,8 +80061,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PurchaseOrder +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPurchaseOrder(xeroTenantId, purchaseOrderID); @@ -77263,8 +80070,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -77581,30 +80393,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/pdf"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Purchase Order
             try {
    -            File result = apiInstance.getPurchaseOrderAsPdf(xeroTenantId, purchaseOrderID);
    +            ByteArrayInputStream result = apiInstance.getPurchaseOrderAsPdf(accessToken, xeroTenantId, purchaseOrderID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrderAsPdf");
                 e.printStackTrace();
             }
    @@ -77671,8 +80482,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Purchase Order +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPurchaseOrderAsPdf(xeroTenantId, purchaseOrderID); @@ -77680,8 +80491,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -77998,32 +80814,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Purchase Order object
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Attachment object
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getPurchaseOrderAttachmentById(xeroTenantId, purchaseOrderID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getPurchaseOrderAttachmentById(accessToken, xeroTenantId, purchaseOrderID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrderAttachmentById");
                 e.printStackTrace();
             }
    @@ -78096,10 +80911,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Purchase Order object -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Attachment object -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getPurchaseOrderAttachmentById(xeroTenantId, purchaseOrderID, attachmentID, contentType); @@ -78107,8 +80922,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -78482,30 +81306,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Purchase Orders object
             try {
    -            Attachments result = apiInstance.getPurchaseOrderAttachments(xeroTenantId, purchaseOrderID);
    +            Attachments result = apiInstance.getPurchaseOrderAttachments(accessToken, xeroTenantId, purchaseOrderID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrderAttachments");
                 e.printStackTrace();
             }
    @@ -78572,8 +81395,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Purchase Orders object +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPurchaseOrderAttachments(xeroTenantId, purchaseOrderID); @@ -78581,8 +81404,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -78900,30 +81728,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderNumber}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String purchaseOrderNumber = 'PO1234';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String purchaseOrderNumber = PO1234; // String | Unique identifier for a PurchaseOrder
             try {
    -            PurchaseOrders result = apiInstance.getPurchaseOrderByNumber(xeroTenantId, purchaseOrderNumber);
    +            PurchaseOrders result = apiInstance.getPurchaseOrderByNumber(accessToken, xeroTenantId, purchaseOrderNumber);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrderByNumber");
                 e.printStackTrace();
             }
    @@ -78990,8 +81817,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderNumber = "PO1234"; // {String} Unique identifier for a PurchaseOrder +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderNumber = 'PO1234'; try { const response = await xero.accountingApi.getPurchaseOrderByNumber(xeroTenantId, purchaseOrderNumber); @@ -78999,8 +81826,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -79314,30 +82146,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PurchaseOrder
             try {
    -            HistoryRecords result = apiInstance.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID);
    +            HistoryRecords result = apiInstance.getPurchaseOrderHistory(accessToken, xeroTenantId, purchaseOrderID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrderHistory");
                 e.printStackTrace();
             }
    @@ -79404,8 +82235,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PurchaseOrder +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getPurchaseOrderHistory(xeroTenantId, purchaseOrderID); @@ -79413,8 +82244,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -79731,35 +82567,35 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?Status=SUBMITTED&DateFrom=2019-12-01&DateTo=2019-12-31&order=PurchaseOrderNumber ASC&page=1"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String status = SUBMITTED; // String | Filter by purchase order status
    -        String dateFrom = 2019-12-01; // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
    -        String dateTo = 2019-12-31; // String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
    -        String order = PurchaseOrderNumber ASC; // String | Order by an any element
    -        Integer page = 1; // Integer | To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned.
             try {
    -            PurchaseOrders result = apiInstance.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page);
    +            PurchaseOrders result = apiInstance.getPurchaseOrders(accessToken, xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrders");
                 e.printStackTrace();
             }
    @@ -79841,19 +82677,13 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const status = 'SUBMITTED'; // {String} Filter by purchase order status - -const dateFrom = '2019-12-01'; // {String} Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - -const dateTo = '2019-12-31'; // {String} Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - -const order = 'PurchaseOrderNumber ASC'; // {String} Order by an any element - -const page = 1; // {Integer} To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. - +const status = 'SUBMITTED'; +const dateFrom = '2019-12-01'; +const dateTo = '2019-12-31'; +const order = 'PurchaseOrderNumber ASC'; +const page = 1; try { const response = await xero.accountingApi.getPurchaseOrders(xeroTenantId, ifModifiedSince, status, dateFrom, dateTo, order, page); @@ -79861,8 +82691,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -80296,32 +83140,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Purchase Order object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getPurchaseOrder≠AttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getPurchaseOrder≠AttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getPurchaseOrder≠AttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -80394,10 +83237,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Purchase Order object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getPurchaseOrder≠AttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, contentType); @@ -80405,8 +83248,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -80777,30 +83629,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Quote
             try {
    -            Quotes result = apiInstance.getQuote(xeroTenantId, quoteID);
    +            Quotes result = apiInstance.getQuote(accessToken, xeroTenantId, quoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuote");
                 e.printStackTrace();
             }
    @@ -80867,8 +83718,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Quote +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getQuote(xeroTenantId, quoteID); @@ -80876,8 +83727,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -81194,30 +84050,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/pdf"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Quote
             try {
    -            File result = apiInstance.getQuoteAsPdf(xeroTenantId, quoteID);
    +            ByteArrayInputStream result = apiInstance.getQuoteAsPdf(accessToken, xeroTenantId, quoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuoteAsPdf");
                 e.printStackTrace();
             }
    @@ -81284,8 +84139,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Quote +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getQuoteAsPdf(xeroTenantId, quoteID); @@ -81293,8 +84148,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -81611,32 +84471,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Quote object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuoteAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -81709,10 +84568,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Quote object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, contentType); @@ -81720,8 +84579,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -82092,32 +84960,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Quote object
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Attachment object
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getQuoteAttachmentById(accessToken, xeroTenantId, quoteID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuoteAttachmentById");
                 e.printStackTrace();
             }
    @@ -82190,10 +85057,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Quote object -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Attachment object -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getQuoteAttachmentById(xeroTenantId, quoteID, attachmentID, contentType); @@ -82201,8 +85068,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -82576,30 +85452,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Quote object
             try {
    -            Attachments result = apiInstance.getQuoteAttachments(xeroTenantId, quoteID);
    +            Attachments result = apiInstance.getQuoteAttachments(accessToken, xeroTenantId, quoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuoteAttachments");
                 e.printStackTrace();
             }
    @@ -82666,8 +85541,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Quote object +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getQuoteAttachments(xeroTenantId, quoteID); @@ -82675,8 +85550,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -82994,30 +85874,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Quote
             try {
    -            HistoryRecords result = apiInstance.getQuoteHistory(xeroTenantId, quoteID);
    +            HistoryRecords result = apiInstance.getQuoteHistory(accessToken, xeroTenantId, quoteID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuoteHistory");
                 e.printStackTrace();
             }
    @@ -83084,8 +85963,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Quote +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getQuoteHistory(xeroTenantId, quoteID); @@ -83093,8 +85972,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -83411,39 +86295,39 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes?DateFrom=2013-10-20&DateTo=2013-10-20&ExpiryDateFrom=2013-10-20&ExpiryDateTo=2013-10-20&ContactID=00000000-0000-0000-0000-000000000000&Status=DRAFT&page=1&order=Status ASC&QuoteNumber=QU-0001"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +
    +        OffsetDateTime ifModifiedSince = OffsetDateTime.parse("2020-02-06T12:17:43.202-08:00");
    +        date dateFrom = 2013-10-20;
    +        date dateTo = 2013-10-20;
    +        date expiryDateFrom = 2013-10-20;
    +        date expiryDateTo = 2013-10-20;
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String status = 'DRAFT';
    +        Integer page = 1;
    +        String order = 'Status ASC';
    +        String quoteNumber = 'QU-0001';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        date dateFrom = 2013-10-20; // date | Filter for quotes after a particular date
    -        date dateTo = 2013-10-20; // date | Filter for quotes before a particular date
    -        date expiryDateFrom = 2013-10-20; // date | Filter for quotes expiring after a particular date
    -        date expiryDateTo = 2013-10-20; // date | Filter for quotes before a particular date
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Filter for quotes belonging to a particular contact
    -        String status = DRAFT; // String | Filter for quotes of a particular Status
    -        Integer page = 1; // Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
    -        String order = Status ASC; // String | Order by an any element
    -        String quoteNumber = QU-0001; // String | Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001)
             try {
    -            Quotes result = apiInstance.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order, quoteNumber);
    +            Quotes result = apiInstance.getQuotes(accessToken, xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order, quoteNumber);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getQuotes");
                 e.printStackTrace();
             }
    @@ -83537,27 +86421,17 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const dateFrom = new Date("2013-10-20"); // {date} Filter for quotes after a particular date - -const dateTo = new Date("2013-10-20"); // {date} Filter for quotes before a particular date - -const expiryDateFrom = new Date("2013-10-20"); // {date} Filter for quotes expiring after a particular date - -const expiryDateTo = new Date("2013-10-20"); // {date} Filter for quotes before a particular date - -const contactID = '00000000-0000-0000-0000-000000000000'; // {UUID} Filter for quotes belonging to a particular contact - -const status = 'DRAFT'; // {String} Filter for quotes of a particular Status - -const page = 1; // {Integer} e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote - -const order = 'Status ASC'; // {String} Order by an any element - -const quoteNumber = 'QU-0001'; // {String} Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001) - +const dateFrom: Date = new Date("2013-10-20"); +const dateTo: Date = new Date("2013-10-20"); +const expiryDateFrom: Date = new Date("2013-10-20"); +const expiryDateTo: Date = new Date("2013-10-20"); +const contactID = '00000000-0000-0000-0000-000000000000'; +const status = 'DRAFT'; +const page = 1; +const order = 'Status ASC'; +const quoteNumber = 'QU-0001'; try { const response = await xero.accountingApi.getQuotes(xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order, quoteNumber); @@ -83565,8 +86439,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -84111,31 +87007,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Receipts result = apiInstance.getReceipt(xeroTenantId, receiptID, unitdp);
    +            Receipts result = apiInstance.getReceipt(accessToken, xeroTenantId, receiptID, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReceipt");
                 e.printStackTrace();
             }
    @@ -84205,11 +87100,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; try { const response = await xero.accountingApi.getReceipt(xeroTenantId, receiptID, unitdp); @@ -84217,8 +87110,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -84566,32 +87465,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReceiptAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -84664,10 +87562,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to the Receipt -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, contentType); @@ -84675,8 +87573,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -85047,32 +87954,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getReceiptAttachmentById(accessToken, xeroTenantId, receiptID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReceiptAttachmentById");
                 e.printStackTrace();
             }
    @@ -85145,10 +88051,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getReceiptAttachmentById(xeroTenantId, receiptID, attachmentID, contentType); @@ -85156,8 +88062,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -85531,30 +88446,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
             try {
    -            Attachments result = apiInstance.getReceiptAttachments(xeroTenantId, receiptID);
    +            Attachments result = apiInstance.getReceiptAttachments(accessToken, xeroTenantId, receiptID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReceiptAttachments");
                 e.printStackTrace();
             }
    @@ -85621,8 +88535,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getReceiptAttachments(xeroTenantId, receiptID); @@ -85630,8 +88544,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -85949,30 +88868,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
             try {
    -            HistoryRecords result = apiInstance.getReceiptHistory(xeroTenantId, receiptID);
    +            HistoryRecords result = apiInstance.getReceiptHistory(accessToken, xeroTenantId, receiptID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReceiptHistory");
                 e.printStackTrace();
             }
    @@ -86039,8 +88957,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getReceiptHistory(xeroTenantId, receiptID); @@ -86048,8 +88966,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -86366,33 +89289,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts?where=Status=="DRAFT"&order=ReceiptNumber ASC&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = Status=="DRAFT"; // String | Filter by an any element
    -        String order = ReceiptNumber ASC; // String | Order by an any element
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Receipts result = apiInstance.getReceipts(xeroTenantId, ifModifiedSince, where, order, unitdp);
    +            Receipts result = apiInstance.getReceipts(accessToken, xeroTenantId, ifModifiedSince, where, order, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReceipts");
                 e.printStackTrace();
             }
    @@ -86468,15 +89391,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'Status=="DRAFT"'; // {String} Filter by an any element - -const order = 'ReceiptNumber ASC'; // {String} Order by an any element - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - +const where = 'Status=="DRAFT"'; +const order = 'ReceiptNumber ASC'; +const unitdp = 4; try { const response = await xero.accountingApi.getReceipts(xeroTenantId, ifModifiedSince, where, order, unitdp); @@ -86484,8 +89403,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -86871,30 +89800,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
             try {
    -            RepeatingInvoices result = apiInstance.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID);
    +            RepeatingInvoices result = apiInstance.getRepeatingInvoice(accessToken, xeroTenantId, repeatingInvoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getRepeatingInvoice");
                 e.printStackTrace();
             }
    @@ -86961,8 +89889,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getRepeatingInvoice(xeroTenantId, repeatingInvoiceID); @@ -86970,8 +89898,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -87288,32 +90221,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType);
    +            ByteArrayInputStream result = apiInstance.getRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -87386,10 +90318,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a Repeating Invoice -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, contentType); @@ -87397,8 +90329,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -87769,32 +90710,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID attachmentID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String contentType = 'image/jpg';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
    -        UUID attachmentID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Attachment
    -        String contentType = image/jpg; // String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf
             try {
    -            File result = apiInstance.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
    +            ByteArrayInputStream result = apiInstance.getRepeatingInvoiceAttachmentById(accessToken, xeroTenantId, repeatingInvoiceID, attachmentID, contentType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachmentById");
                 e.printStackTrace();
             }
    @@ -87867,10 +90807,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice -const attachmentID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Attachment -const contentType = "image/jpg"; // {String} The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; +const attachmentID = '00000000-0000-0000-0000-000000000000'; +const contentType = 'image/jpg'; try { const response = await xero.accountingApi.getRepeatingInvoiceAttachmentById(xeroTenantId, repeatingInvoiceID, attachmentID, contentType); @@ -87878,8 +90818,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -88253,30 +91202,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
             try {
    -            Attachments result = apiInstance.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID);
    +            Attachments result = apiInstance.getRepeatingInvoiceAttachments(accessToken, xeroTenantId, repeatingInvoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceAttachments");
                 e.printStackTrace();
             }
    @@ -88343,8 +91291,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getRepeatingInvoiceAttachments(xeroTenantId, repeatingInvoiceID); @@ -88352,8 +91300,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -88671,30 +91624,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/History"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
             try {
    -            HistoryRecords result = apiInstance.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID);
    +            HistoryRecords result = apiInstance.getRepeatingInvoiceHistory(accessToken, xeroTenantId, repeatingInvoiceID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getRepeatingInvoiceHistory");
                 e.printStackTrace();
             }
    @@ -88761,8 +91713,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getRepeatingInvoiceHistory(xeroTenantId, repeatingInvoiceID); @@ -88770,8 +91722,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -89088,31 +92045,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices?where=Status=="DRAFT"&order=Total ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String where = 'Status=="DRAFT"';
    +        String order = 'Total ASC';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String where = Status=="DRAFT"; // String | Filter by an any element
    -        String order = Total ASC; // String | Order by an any element
             try {
    -            RepeatingInvoices result = apiInstance.getRepeatingInvoices(xeroTenantId, where, order);
    +            RepeatingInvoices result = apiInstance.getRepeatingInvoices(accessToken, xeroTenantId, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getRepeatingInvoices");
                 e.printStackTrace();
             }
    @@ -89182,12 +92138,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const where = 'Status=="DRAFT"'; // {String} Filter by an any element - -const order = 'Total ASC'; // {String} Order by an any element - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const where = 'Status=="DRAFT"'; +const order = 'Total ASC'; try { const response = await xero.accountingApi.getRepeatingInvoices(xeroTenantId, where, order); @@ -89195,8 +92148,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -89531,33 +92491,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/AgedPayablesByContact?contactId=00000000-0000-0000-0000-000000000000&date=2013-10-20&fromDate=2013-10-20&toDate=2013-10-20"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactId = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        date date = 2013-10-20;
    +        date fromDate = 2013-10-20;
    +        date toDate = 2013-10-20;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactId = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        date date = 2013-10-20; // date | The date of the Aged Payables By Contact report
    -        date fromDate = 2013-10-20; // date | The from date of the Aged Payables By Contact report
    -        date toDate = 2013-10-20; // date | The to date of the Aged Payables By Contact report
             try {
    -            ReportWithRows result = apiInstance.getReportAgedPayablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
    +            ReportWithRows result = apiInstance.getReportAgedPayablesByContact(accessToken, xeroTenantId, contactId, date, fromDate, toDate);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportAgedPayablesByContact");
                 e.printStackTrace();
             }
    @@ -89633,15 +92592,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactId = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact - -const date = new Date("2013-10-20"); // {date} The date of the Aged Payables By Contact report - -const fromDate = new Date("2013-10-20"); // {date} The from date of the Aged Payables By Contact report - -const toDate = new Date("2013-10-20"); // {date} The to date of the Aged Payables By Contact report - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactId = '00000000-0000-0000-0000-000000000000'; +const date: Date = new Date("2013-10-20"); +const fromDate: Date = new Date("2013-10-20"); +const toDate: Date = new Date("2013-10-20"); try { const response = await xero.accountingApi.getReportAgedPayablesByContact(xeroTenantId, contactId, date, fromDate, toDate); @@ -89649,8 +92604,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -90048,33 +93014,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/AgedReceivablesByContact?contactId=00000000-0000-0000-0000-000000000000&date=2013-10-20&fromDate=2013-10-20&toDate=2013-10-20"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactId = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        date date = 2013-10-20;
    +        date fromDate = 2013-10-20;
    +        date toDate = 2013-10-20;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactId = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        date date = 2013-10-20; // date | The date of the Aged Receivables By Contact report
    -        date fromDate = 2013-10-20; // date | The from date of the Aged Receivables By Contact report
    -        date toDate = 2013-10-20; // date | The to date of the Aged Receivables By Contact report
             try {
    -            ReportWithRows result = apiInstance.getReportAgedReceivablesByContact(xeroTenantId, contactId, date, fromDate, toDate);
    +            ReportWithRows result = apiInstance.getReportAgedReceivablesByContact(accessToken, xeroTenantId, contactId, date, fromDate, toDate);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportAgedReceivablesByContact");
                 e.printStackTrace();
             }
    @@ -90150,15 +93115,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactId = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact - -const date = new Date("2013-10-20"); // {date} The date of the Aged Receivables By Contact report - -const fromDate = new Date("2013-10-20"); // {date} The from date of the Aged Receivables By Contact report - -const toDate = new Date("2013-10-20"); // {date} The to date of the Aged Receivables By Contact report - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactId = '00000000-0000-0000-0000-000000000000'; +const date: Date = new Date("2013-10-20"); +const fromDate: Date = new Date("2013-10-20"); +const toDate: Date = new Date("2013-10-20"); try { const response = await xero.accountingApi.getReportAgedReceivablesByContact(xeroTenantId, contactId, date, fromDate, toDate); @@ -90166,8 +93127,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -90565,30 +93537,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/{ReportID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String reportID = '00000000-0000-0000-0000-000000000000';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String reportID = 00000000-0000-0000-0000-000000000000; // String | Unique identifier for a Report
             try {
    -            ReportWithRows result = apiInstance.getReportBASorGST(xeroTenantId, reportID);
    +            ReportWithRows result = apiInstance.getReportBASorGST(accessToken, xeroTenantId, reportID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportBASorGST");
                 e.printStackTrace();
             }
    @@ -90655,8 +93626,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const reportID = "00000000-0000-0000-0000-000000000000"; // {String} Unique identifier for a Report +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const reportID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getReportBASorGST(xeroTenantId, reportID); @@ -90664,8 +93635,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -90978,29 +93954,28 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
             try {
    -            ReportWithRows result = apiInstance.getReportBASorGSTList(xeroTenantId);
    +            ReportWithRows result = apiInstance.getReportBASorGSTList(accessToken, xeroTenantId);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportBASorGSTList");
                 e.printStackTrace();
             }
    @@ -91064,7 +94039,7 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; try { const response = await xero.accountingApi.getReportBASorGSTList(xeroTenantId); @@ -91072,8 +94047,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -91352,36 +94330,35 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/BalanceSheet?date=2019-11-01&periods=3&timeframe=MONTH&trackingOptionID1=00000000-0000-0000-0000-000000000000&trackingOptionID2=00000000-0000-0000-0000-000000000000&standardLayout=true&paymentsOnly=false"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        date date = 2019-11-01; // date | The date of the Balance Sheet report
    -        Integer periods = 3; // Integer | The number of periods for the Balance Sheet report
    -        String timeframe = MONTH; // String | The period size to compare to (MONTH, QUARTER, YEAR)
    -        String trackingOptionID1 = 00000000-0000-0000-0000-000000000000; // String | The tracking option 1 for the Balance Sheet report
    -        String trackingOptionID2 = 00000000-0000-0000-0000-000000000000; // String | The tracking option 2 for the Balance Sheet report
    -        Boolean standardLayout = true; // Boolean | The standard layout boolean for the Balance Sheet report
    -        Boolean paymentsOnly = false; // Boolean | return a cash basis for the Balance Sheet report
             try {
    -            ReportWithRows result = apiInstance.getReportBalanceSheet(xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
    +            ReportWithRows result = apiInstance.getReportBalanceSheet(accessToken, xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportBalanceSheet");
                 e.printStackTrace();
             }
    @@ -91466,22 +94443,14 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const date = new Date("2019-11-01"); // {date} The date of the Balance Sheet report - -const periods = 3; // {Integer} The number of periods for the Balance Sheet report - -const timeframe = 'MONTH'; // {String} The period size to compare to (MONTH, QUARTER, YEAR) - -const trackingOptionID1 = '00000000-0000-0000-0000-000000000000'; // {String} The tracking option 1 for the Balance Sheet report - -const trackingOptionID2 = '00000000-0000-0000-0000-000000000000'; // {String} The tracking option 2 for the Balance Sheet report - -const standardLayout = true; // {Boolean} The standard layout boolean for the Balance Sheet report - -const paymentsOnly = false; // {Boolean} return a cash basis for the Balance Sheet report - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const date: Date = new Date("2019-11-01"); +const periods = 3; +const timeframe = 'MONTH'; +const trackingOptionID1 = '00000000-0000-0000-0000-000000000000'; +const trackingOptionID2 = '00000000-0000-0000-0000-000000000000'; +const standardLayout = true; +const paymentsOnly = false; try { const response = await xero.accountingApi.getReportBalanceSheet(xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly); @@ -91489,8 +94458,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -91948,31 +94933,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/BankSummary?fromDate=2019-11-01&toDate=2019-11-30"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        date fromDate = 2019-11-01;
    +        date toDate = 2019-11-30;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        date fromDate = 2019-11-01; // date | The from date for the Bank Summary report e.g. 2018-03-31
    -        date toDate = 2019-11-30; // date | The to date for the Bank Summary report e.g. 2018-03-31
             try {
    -            ReportWithRows result = apiInstance.getReportBankSummary(xeroTenantId, fromDate, toDate);
    +            ReportWithRows result = apiInstance.getReportBankSummary(accessToken, xeroTenantId, fromDate, toDate);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportBankSummary");
                 e.printStackTrace();
             }
    @@ -92042,12 +95026,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const fromDate = new Date("2019-11-01"); // {date} The from date for the Bank Summary report e.g. 2018-03-31 - -const toDate = new Date("2019-11-30"); // {date} The to date for the Bank Summary report e.g. 2018-03-31 - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const fromDate: Date = new Date("2019-11-01"); +const toDate: Date = new Date("2019-11-30"); try { const response = await xero.accountingApi.getReportBankSummary(xeroTenantId, fromDate, toDate); @@ -92055,8 +95036,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -92397,32 +95385,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/BudgetSummary?date=2019-03-31&period=2&timeframe=3"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        date date = 2019-03-31;
    +        Integer period = 2;
    +        Integer timeframe = 3;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        date date = 2019-03-31; // date | The date for the Bank Summary report e.g. 2018-03-31
    -        Integer period = 2; // Integer | The number of periods to compare (integer between 1 and 12)
    -        Integer timeframe = 3; // Integer | The period size to compare to (1=month, 3=quarter, 12=year)
             try {
    -            ReportWithRows result = apiInstance.getReportBudgetSummary(xeroTenantId, date, period, timeframe);
    +            ReportWithRows result = apiInstance.getReportBudgetSummary(accessToken, xeroTenantId, date, period, timeframe);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportBudgetSummary");
                 e.printStackTrace();
             }
    @@ -92495,14 +95482,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const date = new Date("2019-03-31"); // {date} The date for the Bank Summary report e.g. 2018-03-31 - -const period = 2; // {Integer} The number of periods to compare (integer between 1 and 12) - -const timeframe = 3; // {Integer} The period size to compare to (1=month, 3=quarter, 12=year) - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const date: Date = new Date("2019-03-31"); +const period = 2; +const timeframe = 3; try { const response = await xero.accountingApi.getReportBudgetSummary(xeroTenantId, date, period, timeframe); @@ -92510,8 +95493,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -92873,30 +95863,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/ExecutiveSummary?date=2019-03-31"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        date date = 2019-03-31;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        date date = 2019-03-31; // date | The date for the Bank Summary report e.g. 2018-03-31
             try {
    -            ReportWithRows result = apiInstance.getReportExecutiveSummary(xeroTenantId, date);
    +            ReportWithRows result = apiInstance.getReportExecutiveSummary(accessToken, xeroTenantId, date);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportExecutiveSummary");
                 e.printStackTrace();
             }
    @@ -92963,10 +95952,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const date = new Date("2019-03-31"); // {date} The date for the Bank Summary report e.g. 2018-03-31 - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const date: Date = new Date("2019-03-31"); try { const response = await xero.accountingApi.getReportExecutiveSummary(xeroTenantId, date); @@ -92974,8 +95961,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -93289,39 +96281,38 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=2019-03-01&toDate=2019-03-31&periods=3&timeframe=MONTH&trackingCategoryID=00000000-0000-0000-0000-000000000000&trackingCategoryID2=00000000-0000-0000-0000-000000000000&trackingOptionID=00000000-0000-0000-0000-000000000000&trackingOptionID2=00000000-0000-0000-0000-000000000000&standardLayout=true&paymentsOnly=false"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        date fromDate = 2019-03-01;
    +        date toDate = 2019-03-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;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        date fromDate = 2019-03-01; // date | The from date for the ProfitAndLoss report e.g. 2018-03-31
    -        date toDate = 2019-03-31; // date | The to date for the ProfitAndLoss report e.g. 2018-03-31
    -        Integer periods = 3; // Integer | The number of periods to compare (integer between 1 and 12)
    -        String timeframe = MONTH; // String | The period size to compare to (MONTH, QUARTER, YEAR)
    -        String trackingCategoryID = 00000000-0000-0000-0000-000000000000; // String | The trackingCategory 1 for the ProfitAndLoss report
    -        String trackingCategoryID2 = 00000000-0000-0000-0000-000000000000; // String | The trackingCategory 2 for the ProfitAndLoss report
    -        String trackingOptionID = 00000000-0000-0000-0000-000000000000; // String | The tracking option 1 for the ProfitAndLoss report
    -        String trackingOptionID2 = 00000000-0000-0000-0000-000000000000; // String | The tracking option 2 for the ProfitAndLoss report
    -        Boolean standardLayout = true; // Boolean | Return the standard layout for the ProfitAndLoss report
    -        Boolean paymentsOnly = false; // Boolean | Return cash only basis for the ProfitAndLoss report
             try {
    -            ReportWithRows result = apiInstance.getReportProfitAndLoss(xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
    +            ReportWithRows result = apiInstance.getReportProfitAndLoss(accessToken, xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportProfitAndLoss");
                 e.printStackTrace();
             }
    @@ -93415,28 +96406,17 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const fromDate = new Date("2019-03-01"); // {date} The from date for the ProfitAndLoss report e.g. 2018-03-31 - -const toDate = new Date("2019-03-31"); // {date} The to date for the ProfitAndLoss report e.g. 2018-03-31 - -const periods = 3; // {Integer} The number of periods to compare (integer between 1 and 12) - -const timeframe = 'MONTH'; // {String} The period size to compare to (MONTH, QUARTER, YEAR) - -const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; // {String} The trackingCategory 1 for the ProfitAndLoss report - -const trackingCategoryID2 = '00000000-0000-0000-0000-000000000000'; // {String} The trackingCategory 2 for the ProfitAndLoss report - -const trackingOptionID = '00000000-0000-0000-0000-000000000000'; // {String} The tracking option 1 for the ProfitAndLoss report - -const trackingOptionID2 = '00000000-0000-0000-0000-000000000000'; // {String} The tracking option 2 for the ProfitAndLoss report - -const standardLayout = true; // {Boolean} Return the standard layout for the ProfitAndLoss report - -const paymentsOnly = false; // {Boolean} Return cash only basis for the ProfitAndLoss report - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const fromDate: Date = new Date("2019-03-01"); +const toDate: Date = new Date("2019-03-31"); +const periods = 3; +const timeframe = 'MONTH'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; +const trackingCategoryID2 = '00000000-0000-0000-0000-000000000000'; +const trackingOptionID = '00000000-0000-0000-0000-000000000000'; +const trackingOptionID2 = '00000000-0000-0000-0000-000000000000'; +const standardLayout = true; +const paymentsOnly = false; try { const response = await xero.accountingApi.getReportProfitAndLoss(xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly); @@ -93444,8 +96424,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -93977,30 +96979,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/TenNinetyNine?reportYear=2019"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String reportYear = '2019';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String reportYear = 2019; // String | The year of the 1099 report
             try {
    -            Reports result = apiInstance.getReportTenNinetyNine(xeroTenantId, reportYear);
    +            Reports result = apiInstance.getReportTenNinetyNine(accessToken, xeroTenantId, reportYear);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportTenNinetyNine");
                 e.printStackTrace();
             }
    @@ -94067,10 +97068,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const reportYear = '2019'; // {String} The year of the 1099 report - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const reportYear = '2019'; try { const response = await xero.accountingApi.getReportTenNinetyNine(xeroTenantId, reportYear); @@ -94078,8 +97077,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -94390,31 +97394,30 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Reports/TrialBalance?date=2019-10-31&paymentsOnly=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        date date = 2019-10-31;
    +        Boolean paymentsOnly = true;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        date date = 2019-10-31; // date | The date for the Trial Balance report e.g. 2018-03-31
    -        Boolean paymentsOnly = true; // Boolean | Return cash only basis for the Trial Balance report
             try {
    -            ReportWithRows result = apiInstance.getReportTrialBalance(xeroTenantId, date, paymentsOnly);
    +            ReportWithRows result = apiInstance.getReportTrialBalance(accessToken, xeroTenantId, date, paymentsOnly);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getReportTrialBalance");
                 e.printStackTrace();
             }
    @@ -94484,12 +97487,9 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const date = new Date("2019-10-31"); // {date} The date for the Trial Balance report e.g. 2018-03-31 - -const paymentsOnly = true; // {Boolean} Return cash only basis for the Trial Balance report - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const date: Date = new Date("2019-10-31"); +const paymentsOnly = true; try { const response = await xero.accountingApi.getReportTrialBalance(xeroTenantId, date, paymentsOnly); @@ -94497,8 +97497,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -94836,32 +97843,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TaxRates?where=Status=="ACTIVE"&order=Name ASC&TaxType=INPUT"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String where = 'Status=="ACTIVE"';
    +        String order = 'Name ASC';
    +        String taxType = 'INPUT';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String where = Status=="ACTIVE"; // String | Filter by an any element
    -        String order = Name ASC; // String | Order by an any element
    -        String taxType = INPUT; // String | Filter by tax type
             try {
    -            TaxRates result = apiInstance.getTaxRates(xeroTenantId, where, order, taxType);
    +            TaxRates result = apiInstance.getTaxRates(accessToken, xeroTenantId, where, order, taxType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getTaxRates");
                 e.printStackTrace();
             }
    @@ -94934,14 +97940,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const where = 'Status=="ACTIVE"'; // {String} Filter by an any element - -const order = 'Name ASC'; // {String} Order by an any element - -const taxType = 'INPUT'; // {String} Filter by tax type - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const where = 'Status=="ACTIVE"'; +const order = 'Name ASC'; +const taxType = 'INPUT'; try { const response = await xero.accountingApi.getTaxRates(xeroTenantId, where, order, taxType); @@ -94949,8 +97951,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -95309,32 +98320,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories?where=Status=="ACTIVE"&order=Name ASC&includeArchived=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        String where = 'Status=="ACTIVE"';
    +        String order = 'Name ASC';
    +        Boolean includeArchived = true;
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        String where = Status=="ACTIVE"; // String | Filter by an any element
    -        String order = Name ASC; // String | Order by an any element
    -        Boolean includeArchived = true; // Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response
             try {
    -            TrackingCategories result = apiInstance.getTrackingCategories(xeroTenantId, where, order, includeArchived);
    +            TrackingCategories result = apiInstance.getTrackingCategories(accessToken, xeroTenantId, where, order, includeArchived);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getTrackingCategories");
                 e.printStackTrace();
             }
    @@ -95407,14 +98417,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - -const where = 'Status=="ACTIVE"'; // {String} Filter by an any element - -const order = 'Name ASC'; // {String} Order by an any element - -const includeArchived = true; // {Boolean} e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const where = 'Status=="ACTIVE"'; +const order = 'Name ASC'; +const includeArchived = true; try { const response = await xero.accountingApi.getTrackingCategories(xeroTenantId, where, order, includeArchived); @@ -95422,8 +98428,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -95782,30 +98797,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
             try {
    -            TrackingCategories result = apiInstance.getTrackingCategory(xeroTenantId, trackingCategoryID);
    +            TrackingCategories result = apiInstance.getTrackingCategory(accessToken, xeroTenantId, trackingCategoryID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getTrackingCategory");
                 e.printStackTrace();
             }
    @@ -95872,8 +98886,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const trackingCategoryID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a TrackingCategory +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getTrackingCategory(xeroTenantId, trackingCategoryID); @@ -95881,8 +98895,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -96199,30 +99218,29 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Users/{UserID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID userID = UUID.fromString("00000000-0000-0000-0000-000000000000");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID userID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a User
             try {
    -            Users result = apiInstance.getUser(xeroTenantId, userID);
    +            Users result = apiInstance.getUser(accessToken, xeroTenantId, userID);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getUser");
                 e.printStackTrace();
             }
    @@ -96289,8 +99307,8 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const userID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a User +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const userID = '00000000-0000-0000-0000-000000000000'; try { const response = await xero.accountingApi.getUser(xeroTenantId, userID); @@ -96298,8 +99316,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -96616,32 +99639,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Users?where=IsSubscriber==true&order=LastName ASC"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        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';
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Date ifModifiedSince = 2020-02-06T12:17:43.202-08:00; // Date | Only records created or modified since this timestamp will be returned
    -        String where = IsSubscriber==true; // String | Filter by an any element
    -        String order = LastName ASC; // String | Order by an any element
             try {
    -            Users result = apiInstance.getUsers(xeroTenantId, ifModifiedSince, where, order);
    +            Users result = apiInstance.getUsers(accessToken, xeroTenantId, ifModifiedSince, where, order);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#getUsers");
                 e.printStackTrace();
             }
    @@ -96714,13 +99737,10 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; const ifModifiedSince: Date = new Date("2020-02-06T12:17:43.202-08:00"); -const where = 'IsSubscriber==true'; // {String} Filter by an any element - -const order = 'LastName ASC'; // {String} Order by an any element - +const where = 'IsSubscriber==true'; +const order = 'LastName ASC'; try { const response = await xero.accountingApi.getUsers(xeroTenantId, ifModifiedSince, where, order); @@ -96728,8 +99748,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -97091,30 +100120,44 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Setup"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Setup setup = { "ConversionDate": {}, "ConversionBalances": [], "Accounts": [ { "Code": "200", "Name": "Sales", "Type": "SALES", "ReportingCode": "REV.TRA.GOO" }, { "Code": "400", "Name": "Advertising", "Type": "OVERHEADS", "ReportingCode": "EXP" }, { "Code": "610", "Name": "Accounts Receivable", "Type": "CURRENT", "SystemAccount": "DEBTORS", "ReportingCode": "ASS.CUR.REC.TRA" }, { "Code": "800", "Name": "Accounts Payable", "Type": "CURRLIAB", "SystemAccount": "CREDITORS", "ReportingCode": "LIA.CUR.PAY" } ] }; // Setup | 
             try {
    -            ImportSummaryObject result = apiInstance.postSetup(xeroTenantId, setup);
    +            ImportSummaryObject result = apiInstance.postSetup(accessToken, xeroTenantId, setup);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#postSetup");
                 e.printStackTrace();
             }
    @@ -97180,9 +100223,25 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const setup: Setup = { "ConversionDate": {}, "ConversionBalances": [], "Accounts": [ { "Code": "200", "Name": "Sales", "Type": "SALES", "ReportingCode": "REV.TRA.GOO" }, { "Code": "400", "Name": "Advertising", "Type": "OVERHEADS", "ReportingCode": "EXP" }, { "Code": "610", "Name": "Accounts Receivable", "Type": "CURRENT", "SystemAccount": "DEBTORS", "ReportingCode": "ASS.CUR.REC.TRA" }, { "Code": "800", "Name": "Accounts Payable", "Type": "CURRLIAB", "SystemAccount": "CREDITORS", "ReportingCode": "LIA.CUR.PAY" } ] }; // {Setup} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const account: Account = { + code: "123", + name: "Business supplies", + type: AccountType.EXPENSE }; +const accounts = []; +accounts.push(account) + +const conversionDate: ConversionDate = { + month: 10, + year: 2020 }; +const conversionBalances = []; + +const setup: Setup = { + accounts: accounts, + conversionDate: conversionDate, + conversionBalances: conversionBalances }; try { const response = await xero.accountingApi.postSetup(xeroTenantId, setup); @@ -97190,8 +100249,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -97533,31 +100643,37 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for retrieving single object
    -        Accounts accounts = { "Accounts":[ { "Code":"123456", "Name":"BarFoo", "AccountID":"99ce6032-0678-4aa0-8148-240c75fee33a", "Type":"EXPENSE", "Description":"GoodBye World", "TaxType":"INPUT", "EnablePaymentsToAccount":false, "ShowInExpenseClaims":false, "Class":"EXPENSE", "ReportingCode":"EXP", "ReportingCodeName":"Expense", "UpdatedDateUTC":"2019-02-21T16:29:47.96-08:00" } ] }; // Accounts | 
             try {
    -            Accounts result = apiInstance.updateAccount(xeroTenantId, accountID, accounts);
    +            Accounts result = apiInstance.updateAccount(accessToken, xeroTenantId, accountID, accounts);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateAccount");
                 e.printStackTrace();
             }
    @@ -97627,9 +100743,18 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for retrieving single object -const accounts: Accounts = { accounts: [{ code: "123456", name: "BarFoo", accountID: "00000000-0000-0000-0000-000000000000", type: AccountType.EXPENSE, description: "GoodBye World", taxType: TaxType.INPUT }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; + +const account: Account = { + code: "123456", + name: "BarFoo", + type: AccountType.EXPENSE, + description: "Hello World", + taxType: "NONE" }; + +const accounts: Accounts = { + accounts: [account] }; try { const response = await xero.accountingApi.updateAccount(xeroTenantId, accountID, accounts); @@ -97637,8 +100762,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -98087,32 +101245,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Accounts/{AccountID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID accountID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID accountID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Account object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body);
    +            Attachments result = apiInstance.updateAccountAttachmentByFileName(accessToken, xeroTenantId, accountID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateAccountAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -98185,13 +101345,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const accountID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Account object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const accountID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -98205,8 +101364,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -98682,32 +101855,47 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
    +        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");
    +        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);
    +        lineItems.addLineItemsItem(lineItem);
    +        bankTransaction.setBankAccount(bankAccount);
    +        BankTransactions bankTransactions = new BankTransactions();
    +        bankTransactions.addBankTransactionsItem(bankTransaction);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        BankTransactions bankTransactions = { "BankTransactions": [ { "Type": "SPEND", "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000", "ContactStatus": "ACTIVE", "Name": "Buzz Lightyear", "FirstName": "Buzz", "LastName": "Lightyear", "EmailAddress": "buzz.Lightyear@email.com", "ContactPersons": [], "BankAccountDetails": "", "Addresses": [ { "AddressType": "STREET", "City": "", "Region": "", "PostalCode": "", "Country": "" }, { "AddressType": "POBOX", "AddressLine1": "", "AddressLine2": "", "AddressLine3": "", "AddressLine4": "", "City": "Palo Alto", "Region": "CA", "PostalCode": "94020", "Country": "United States" } ], "Phones": [ { "PhoneType": "DEFAULT", "PhoneNumber": "847-1294", "PhoneAreaCode": "(626)", "PhoneCountryCode": "" }, { "PhoneType": "DDI", "PhoneNumber": "", "PhoneAreaCode": "", "PhoneCountryCode": "" }, { "PhoneType": "FAX", "PhoneNumber": "", "PhoneAreaCode": "", "PhoneCountryCode": "" }, { "PhoneType": "MOBILE", "PhoneNumber": "", "PhoneAreaCode": "", "PhoneCountryCode": "" } ], "UpdatedDateUTC": "2017-08-21T13:49:04.227-07:00", "ContactGroups": [] }, "Lineitems": [], "BankAccount": { "Code": "088", "Name": "Business Wells Fargo", "AccountID": "00000000-0000-0000-0000-000000000000" }, "IsReconciled": false, "Date": "2019-02-25", "Reference": "You just updated", "CurrencyCode": "USD", "CurrencyRate": 1, "Status": "AUTHORISED", "LineAmountTypes": "Inclusive", "TotalTax": 1.74, "BankTransactionID": "00000000-0000-0000-0000-000000000000", "UpdatedDateUTC": "2019-02-26T12:39:27.813-08:00" } ] }; // BankTransactions | 
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            BankTransactions result = apiInstance.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp);
    +            BankTransactions result = apiInstance.updateBankTransaction(accessToken, xeroTenantId, bankTransactionID, bankTransactions, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateBankTransaction");
                 e.printStackTrace();
             }
    @@ -98780,12 +101968,31 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; + +const bankAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; +const bankTransaction: BankTransaction = { + reference: "You just updated", + type: BankTransaction.TypeEnum.RECEIVE, + contact: contact, + lineItems: [lineItem], + bankAccount: bankAccount }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const bankTransactions: BankTransactions = { bankTransactions: [{ type: BankTransaction.TypeEnum.SPEND, date: "2019-02-25", reference: "You just updated", status: BankTransaction.StatusEnum.AUTHORISED, bankTransactionID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, bankAccount: { accountID: "00000000-0000-0000-0000-000000000000" }}]} +const bankTransactions: BankTransactions = { + bankTransactions: [bankTransaction] }; try { const response = await xero.accountingApi.updateBankTransaction(xeroTenantId, bankTransactionID, bankTransactions, unitdp); @@ -98793,8 +102000,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -99272,32 +102548,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions/{BankTransactionID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transaction
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body);
    +            Attachments result = apiInstance.updateBankTransactionAttachmentByFileName(accessToken, xeroTenantId, bankTransactionID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateBankTransactionAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -99370,13 +102648,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transaction -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransactionID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -99390,8 +102667,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -99867,32 +103158,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransfers/{BankTransferID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID bankTransferID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID bankTransferID = 00000000-0000-0000-0000-000000000000; // UUID | Xero generated unique identifier for a bank transfer
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Bank Transfer
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body);
    +            Attachments result = apiInstance.updateBankTransferAttachmentByFileName(accessToken, xeroTenantId, bankTransferID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateBankTransferAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -99965,13 +103258,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const bankTransferID = "00000000-0000-0000-0000-000000000000"; // {UUID} Xero generated unique identifier for a bank transfer -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a Bank Transfer +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const bankTransferID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -99985,8 +103277,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -100462,31 +103768,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Contact contact = new Contact();
    +        contact.setName("Thanos");
    +        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
    +        Contacts contacts = new Contacts();
    +        contacts.addContactsItem(contact);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        Contacts contacts = { "Contacts": [{ "ContactID": "00000000-0000-0000-0000-000000000000", "Name": "Thanos" }]}; // Contacts | 
             try {
    -            Contacts result = apiInstance.updateContact(xeroTenantId, contactID, contacts);
    +            Contacts result = apiInstance.updateContact(accessToken, xeroTenantId, contactID, contacts);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateContact");
                 e.printStackTrace();
             }
    @@ -100556,9 +103865,15 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact -const contacts: Contacts = { contacts: [{ contactID: "00000000-0000-0000-0000-000000000000", name: "Thanos" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; + +const contact: Contact = { + name: "Thanos", + contactID: "00000000-0000-0000-0000-000000000000" }; + +const contacts: Contacts = { + contacts: [contact] }; try { const response = await xero.accountingApi.updateContact(xeroTenantId, contactID, contacts); @@ -100566,8 +103881,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -101015,32 +104354,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts/{ContactID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact
    -        String fileName = xero-dev.jpg; // String | Name for the file you are attaching
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body);
    +            Attachments result = apiInstance.updateContactAttachmentByFileName(accessToken, xeroTenantId, contactID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateContactAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -101113,13 +104454,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact -const fileName = "xero-dev.jpg"; // {String} Name for the file you are attaching +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -101133,8 +104473,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -101610,31 +104964,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ContactGroups/{ContactGroupID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID contactGroupID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        ContactGroup contactGroup = new ContactGroup();
    +        contactGroup.setName("Vendor");
    +        ContactGroups contactGroups = new ContactGroups();
    +        contactGroups.addContactGroupsItem(contactGroup);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID contactGroupID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Contact Group
    -        ContactGroups contactGroups = { "ContactGroups":[ { "Name":"Suppliers" } ] }; // ContactGroups | 
             try {
    -            ContactGroups result = apiInstance.updateContactGroup(xeroTenantId, contactGroupID, contactGroups);
    +            ContactGroups result = apiInstance.updateContactGroup(accessToken, xeroTenantId, contactGroupID, contactGroups);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateContactGroup");
                 e.printStackTrace();
             }
    @@ -101704,9 +105060,14 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const contactGroupID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Contact Group -const contactGroups: ContactGroups = { contactGroups: [{ name: "Vendor" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const contactGroupID = '00000000-0000-0000-0000-000000000000'; + +const contactGroup: ContactGroup = { + name: "Vendor" }; + +const contactGroups: ContactGroups = { + contactGroups: [contactGroup] }; try { const response = await xero.accountingApi.updateContactGroup(xeroTenantId, contactGroupID, contactGroups); @@ -101714,8 +105075,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -102163,32 +105545,50 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
    +        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<LineItems> lineItems = new ArrayList<LineItems>();
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        CreditNotes creditNotes = { "CreditNotes": [ { "Type": "ACCPAYCREDIT", "Contact": { "ContactID": "430fa14a-f945-44d3-9f97-5df5e28441b8" }, "Date": "2019-01-05", "Status": "AUTHORISED", "Reference": "HelloWorld", "LineItems": [ { "Description": "Foobar", "Quantity": 2, "UnitAmount": 20, "AccountCode": "400" } ] } ] }; // CreditNotes | 
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            CreditNotes result = apiInstance.updateCreditNote(xeroTenantId, creditNoteID, creditNotes, unitdp);
    +            CreditNotes result = apiInstance.updateCreditNote(accessToken, xeroTenantId, creditNoteID, creditNotes, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateCreditNote");
                 e.printStackTrace();
             }
    @@ -102261,12 +105661,32 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note - - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const creditNotes: CreditNotes = { creditNotes: [{ type: CreditNote.TypeEnum.ACCPAYCREDIT, contact: { contactID: "00000000-0000-0000-0000-000000000000" }, date: "2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems: [{ description: "Infinity Stones", quantity: 1.0, unitAmount: 100.0, accountCode: "400" } ]}]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; +const currDate = '2020-12-10' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) + +const creditNote: CreditNote = { + type: CreditNote.TypeEnum.ACCPAYCREDIT, + status: CreditNote.StatusEnum.AUTHORISED, + reference: "My ref.", + contact: contact, + date: currDate, + lineItems: lineItems }; + +const creditNotes: CreditNotes = { + creditNotes: [creditNote] }; try { const response = await xero.accountingApi.updateCreditNote(xeroTenantId, creditNoteID, creditNotes, unitdp); @@ -102274,8 +105694,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -102754,32 +106246,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes/{CreditNoteID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID creditNoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID creditNoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Credit Note
    -        String fileName = xero-dev.jpg; // String | Name of the file you are attaching to Credit Note
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body);
    +            Attachments result = apiInstance.updateCreditNoteAttachmentByFileName(accessToken, xeroTenantId, creditNoteID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateCreditNoteAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -102852,13 +106346,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const creditNoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Credit Note -const fileName = "xero-dev.jpg"; // {String} Name of the file you are attaching to Credit Note +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const creditNoteID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -102872,8 +106365,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -103349,31 +106856,44 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ExpenseClaims/{ExpenseClaimID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID expenseClaimID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID expenseClaimID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ExpenseClaim
    -        ExpenseClaims expenseClaims = { "ExpenseClaims": [ { "Status": "SUBMITTED", "User": { "UserID": "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, "Receipts": [ { "Lineitems": [], "ReceiptID": "dc1c7f6d-0a4c-402f-acac-551d62ce5816" } ] } ] }; // ExpenseClaims | 
             try {
    -            ExpenseClaims result = apiInstance.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims);
    +            ExpenseClaims result = apiInstance.updateExpenseClaim(accessToken, xeroTenantId, expenseClaimID, expenseClaims);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateExpenseClaim");
                 e.printStackTrace();
             }
    @@ -103443,9 +106963,26 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const expenseClaimID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ExpenseClaim -const expenseClaims: ExpenseClaims = { expenseClaims: [{ status: ExpenseClaim.StatusEnum.AUTHORISED, user: { userID: "00000000-0000-0000-0000-000000000000" }, receipts: [{ receiptID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, date: "2020-01-01", user: {} }]}]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const expenseClaimID = '00000000-0000-0000-0000-000000000000'; +const currDate = '2020-12-10' + +const user: User = { + userID: "00000000-0000-0000-0000-000000000000" }; + +const receipt: Receipt = { + receiptID: "00000000-0000-0000-0000-000000000000", + date: currDate }; +const receipts = []; +receipts.push(receipt) + +const expenseClaim: ExpenseClaim = { + status: ExpenseClaim.StatusEnum.SUBMITTED, + user: user, + receipts: receipts }; + +const expenseClaims: ExpenseClaims = { + expenseClaims: [expenseClaim] }; try { const response = await xero.accountingApi.updateExpenseClaim(xeroTenantId, expenseClaimID, expenseClaims); @@ -103453,8 +106990,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -103901,32 +107494,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
    +        Invoice invoice = new Invoice();
    +        invoice.setReference("I am Iron man");
    +        Invoices invoices = new Invoices();
    +        invoices.addInvoicesItem(invoice);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        Invoices invoices = { "Invoices": [{ Reference: "May the force be with you", "InvoiceID": "00000000-0000-0000-0000-000000000000", "LineItems": [], "Contact": {}, "Type": "ACCPAY" }]}; // Invoices | 
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Invoices result = apiInstance.updateInvoice(xeroTenantId, invoiceID, invoices, unitdp);
    +            Invoices result = apiInstance.updateInvoice(accessToken, xeroTenantId, invoiceID, invoices, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateInvoice");
                 e.printStackTrace();
             }
    @@ -103999,12 +107594,15 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; +const invoice: Invoice = { + reference: "I am Iron man" }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const invoices: Invoices = { invoices: [{ reference: "I am Iron Man", invoiceID: "00000000-0000-0000-0000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY }]} +const invoices: Invoices = { + invoices: [invoice] }; try { const response = await xero.accountingApi.updateInvoice(xeroTenantId, invoiceID, invoices, unitdp); @@ -104012,8 +107610,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -104491,32 +108111,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices/{InvoiceID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID invoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID invoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Invoice
    -        String fileName = xero-dev.jpg; // String | Name of the file you are attaching
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body);
    +            Attachments result = apiInstance.updateInvoiceAttachmentByFileName(accessToken, xeroTenantId, invoiceID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateInvoiceAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -104589,13 +108211,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const invoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Invoice -const fileName = "xero-dev.jpg"; // {String} Name of the file you are attaching +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const invoiceID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -104609,8 +108230,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -105086,32 +108721,35 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items/{ItemID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID itemID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
    +        Item item = new Item();
    +        item.setCode("ItemCode123");
    +        item.setDescription("Goodbye");
    +        Items items = new Items();
    +        items.addItemsItem(item);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID itemID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Item
    -        Items items = { "Items": [ { "Code": "ItemCode123", "Description": "Description 123" } ] }; // Items | 
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Items result = apiInstance.updateItem(xeroTenantId, itemID, items, unitdp);
    +            Items result = apiInstance.updateItem(accessToken, xeroTenantId, itemID, items, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateItem");
                 e.printStackTrace();
             }
    @@ -105184,12 +108822,16 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const itemID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Item +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const itemID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; +const item: Item = { + code: "ItemCode123", + description: "Goodbye" }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const items: Items = { items: [{ code: "ItemCode123", description: "Description 123" }]} +const items: Items = { + items: [item] }; try { const response = await xero.accountingApi.updateItem(xeroTenantId, itemID, items, unitdp); @@ -105197,8 +108839,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -105676,31 +109343,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/LinkedTransactions/{LinkedTransactionID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID linkedTransactionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID linkedTransactionID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a LinkedTransaction
    -        LinkedTransactions linkedTransactions = { "LinkedTransactions": [ { "SourceTransactionID": "00000000-0000-0000-0000-000000000000", "SourceLineItemID": "00000000-0000-0000-0000-000000000000" } ] }; // LinkedTransactions | 
             try {
    -            LinkedTransactions result = apiInstance.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions);
    +            LinkedTransactions result = apiInstance.updateLinkedTransaction(accessToken, xeroTenantId, linkedTransactionID, linkedTransactions);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateLinkedTransaction");
                 e.printStackTrace();
             }
    @@ -105770,9 +109440,15 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const linkedTransactionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a LinkedTransaction -const linkedTransactions: LinkedTransactions = { linkedTransactions: [{ sourceLineItemID: "00000000-0000-0000-0000-000000000000", contactID: "00000000-0000-0000-0000-000000000000" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const linkedTransactionID = '00000000-0000-0000-0000-000000000000'; + +const linkedTransaction: LinkedTransaction = { + sourceLineItemID: "00000000-0000-0000-0000-000000000000", + contactID: "00000000-0000-0000-0000-000000000000" }; + +const linkedTransactions: LinkedTransactions = { + linkedTransactions: [linkedTransaction] }; try { const response = await xero.accountingApi.updateLinkedTransaction(xeroTenantId, linkedTransactionID, linkedTransactions); @@ -105780,8 +109456,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -106229,31 +109929,48 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
    -        ManualJournals manualJournals = { "ManualJournals": [ { "Narration": "Hello Xero", "ManualJournalID": "00000000-0000-0000-0000-000000000000", "JournalLines": [] } ] }; // ManualJournals | 
             try {
    -            ManualJournals result = apiInstance.updateManualJournal(xeroTenantId, manualJournalID, manualJournals);
    +            ManualJournals result = apiInstance.updateManualJournal(accessToken, xeroTenantId, manualJournalID, manualJournals);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateManualJournal");
                 e.printStackTrace();
             }
    @@ -106323,9 +110040,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal -const manualJournals: ManualJournals = { manualJournals: [{ narration: "Hello Xero", manualJournalId: "00000000-0000-0000-0000-000000000000", journalLines: [] }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; +const dateValue = '2020-10-10' +const manualJournalLines = []; + +const credit: ManualJournalLine = { + lineAmount: 100.0, + accountCode: "400", + description: "Hello there" }; +manualJournalLines.push(credit) + +const debit: ManualJournalLine = { + lineAmount: -100.0, + accountCode: "120", + description: "Hello there" }; +manualJournalLines.push(debit) + +const manualJournal: ManualJournal = { + narration: "Foobar", + date: dateValue, + journalLines: manualJournalLines }; + +const manualJournals: ManualJournals = { + manualJournals: [manualJournal] }; try { const response = await xero.accountingApi.updateManualJournal(xeroTenantId, manualJournalID, manualJournals); @@ -106333,8 +110071,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -106781,32 +110587,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals/{ManualJournalID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID manualJournalID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID manualJournalID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a ManualJournal
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a ManualJournal
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body);
    +            Attachments result = apiInstance.updateManualJournalAttachmentByFileName(accessToken, xeroTenantId, manualJournalID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateManualJournalAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -106879,13 +110687,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const manualJournalID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a ManualJournal -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a ManualJournal +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const manualJournalID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -106899,8 +110706,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -107376,32 +111197,46 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/BankTransactions?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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");
    +        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);
    +        lineItems.addLineItemsItem(lineItem);
    +        bankTransaction.setBankAccount(bankAccount);
    +        BankTransactions bankTransactions = new BankTransactions();
    +        bankTransactions.addBankTransactionsItem(bankTransaction);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        BankTransactions bankTransactions = { "BankTransactions": [ { "Type": "SPEND", "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "Lineitems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "400" } ], "BankAccount": { "Code": "088" } } ] }; // BankTransactions | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            BankTransactions result = apiInstance.updateOrCreateBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp);
    +            BankTransactions result = apiInstance.updateOrCreateBankTransactions(accessToken, xeroTenantId, bankTransactions, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateBankTransactions");
                 e.printStackTrace();
             }
    @@ -107474,13 +111309,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors +const bankAccount: Account = { + accountID: "00000000-0000-0000-0000-000000000000" }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const bankTransactions: BankTransactions = { bankTransactions: [{ type: BankTransaction.TypeEnum.SPEND, contact: { contactId: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "000" }], bankAccount: { code: "000" }}]} +const bankTransaction: BankTransaction = { + type: BankTransaction.TypeEnum.RECEIVE, + contact: contact, + lineItems: [lineItem], + bankAccount: bankAccount }; + +const bankTransactions: BankTransactions = { + bankTransactions: [bankTransaction] }; try { const response = await xero.accountingApi.updateOrCreateBankTransactions(xeroTenantId, bankTransactions, summarizeErrors, unitdp); @@ -107488,8 +111340,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -107954,31 +111872,41 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Contacts?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Contacts contacts = { "Contacts": [ { "Name": "Bruce Banner", "EmailAddress": "hulk@avengers.com", "Phones": [ { "PhoneType": "MOBILE", "PhoneNumber": "555-1212", "PhoneAreaCode": "415" } ], "PaymentTerms": { "Bills": { "Day": 15, "Type": "OFCURRENTMONTH" }, "Sales": { "Day": 10, "Type": "DAYSAFTERBILLMONTH" } } } ] }; // Contacts | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Contacts result = apiInstance.updateOrCreateContacts(xeroTenantId, contacts, summarizeErrors);
    +            Contacts result = apiInstance.updateOrCreateContacts(accessToken, xeroTenantId, contacts, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateContacts");
                 e.printStackTrace();
             }
    @@ -108048,11 +111976,22 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; + +const phone: Phone = { + phoneNumber: "555-1212", + phoneType: Phone.PhoneTypeEnum.MOBILE }; +const phones = []; +phones.push(phone) +const contact: Contact = { + name: "Bruce Banner", + emailAddress: "hulk@avengers.com", + phones: phones }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const contacts: Contacts = { contacts: [{ name: "Bruce Banner", emailAddress: "hulk@avengers.com", phones: [{ phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber: "555-1212", phoneAreaCode: "415" }], paymentTerms: { bills: { day: 15, type: PaymentTermType.OFCURRENTMONTH }, sales: { day: 10, type: PaymentTermType.DAYSAFTERBILLMONTH }}}]} +const contacts: Contacts = { + contacts: [contact] }; try { const response = await xero.accountingApi.updateOrCreateContacts(xeroTenantId, contacts, summarizeErrors); @@ -108060,8 +111999,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -108503,32 +112487,48 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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<LineItems> lineItems = new ArrayList<LineItems>();
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        CreditNotes creditNotes = { "CreditNotes":[ { "Type":"ACCPAYCREDIT", "Contact":{ "ContactID":"430fa14a-f945-44d3-9f97-5df5e28441b8" }, "Date":"2019-01-05", "Status":"AUTHORISED", "Reference": "HelloWorld", "LineItems":[ { "Description":"Foobar", "Quantity":2.0, "UnitAmount":20.0, "AccountCode":"400" } ] } ] }; // CreditNotes | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            CreditNotes result = apiInstance.updateOrCreateCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp);
    +            CreditNotes result = apiInstance.updateOrCreateCreditNotes(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateCreditNotes");
                 e.printStackTrace();
             }
    @@ -108601,13 +112601,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; +const currDate = '2020-12-10' +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const creditNotes: CreditNotes = { creditNotes: [{ type: CreditNote.TypeEnum.ACCPAYCREDIT, contact: { contactID: "00000000-0000-0000-0000-000000000000" }, date: "2019-01-05", lineItems: [{ description: "Foobar", quantity: 2.0, unitAmount: 20.0, accountCode: "400" }]}]} +const creditNote: CreditNote = { + type: CreditNote.TypeEnum.ACCPAYCREDIT, + contact: contact, + date: currDate, + lineItems: lineItems }; + +const creditNotes: CreditNotes = { + creditNotes: [creditNote] }; try { const response = await xero.accountingApi.updateOrCreateCreditNotes(xeroTenantId, creditNotes, summarizeErrors, unitdp); @@ -108615,8 +112632,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -109082,31 +113165,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Employees?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Employee employee = new Employee();
    +        employee.setFirstName("Nick");
    +        employee.setLastName("Fury");
    +        Employees employees = new Employees();
    +        employees.addEmployeesItem(employee);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Employees employees = { "Employees": [ { "FirstName": "Nick", "LastName": "Fury", "ExternalLink": { "Url": "http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Employees result = apiInstance.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors);
    +            Employees result = apiInstance.updateOrCreateEmployees(accessToken, xeroTenantId, employees, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateEmployees");
                 e.printStackTrace();
             }
    @@ -109176,11 +113262,15 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const employee: Employee = { + firstName: "Nick", + lastName: "Fury" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const employees: Employees = { employees: [{ firstName: "Nick", lastName: "Fury", externalLink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} +const employees: Employees = { + employees: [employee] }; try { const response = await xero.accountingApi.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors); @@ -109188,8 +113278,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -109631,32 +113745,52 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Invoices?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Invoices invoices = { "Invoices": [ { "Type": "ACCREC", "Contact": { "ContactID": "430fa14a-f945-44d3-9f97-5df5e28441b8" }, "LineItems": [ { "Description": "Acme Tires", "Quantity": 2, "UnitAmount": 20, "AccountCode": "200", "TaxType": "NONE", "LineAmount": 40 } ], "Date": "2019-03-11", "DueDate": "2018-12-10", "Reference": "Website Design", "Status": "AUTHORISED" } ] }; // Invoices | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Invoices result = apiInstance.updateOrCreateInvoices(xeroTenantId, invoices, summarizeErrors, unitdp);
    +            Invoices result = apiInstance.updateOrCreateInvoices(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateInvoices");
                 e.printStackTrace();
             }
    @@ -109729,13 +113863,34 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant - - -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const invoices: Invoices = { invoices: [{ type: Invoice.TypeEnum.ACCREC, contact: { contactID:"00000000-0000-0000-0000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date: "2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; +const dateValue = '2020-10-10' +const dueDateValue = '2020-10-28' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) + +const invoice: Invoice = { + type: Invoice.TypeEnum.ACCREC, + contact: contact, + date: dateValue, + dueDate: dueDateValue, + lineItems: lineItems, + reference: "Website Design", + status: Invoice.StatusEnum.DRAFT }; + +const invoices: Invoices = { + invoices: [invoice] }; try { const response = await xero.accountingApi.updateOrCreateInvoices(xeroTenantId, invoices, summarizeErrors, unitdp); @@ -109743,8 +113898,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -110209,32 +114442,36 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Items?summarizeErrors=true&unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        Integer unitdp = 4;
    +        Item item = new Item();
    +        item.setCode("abcXYZ123");
    +        item.setName("HelloWorld");
    +        item.setDescription("Foobar");
    +        Items items = new Items();
    +        items.addItemsItem(item);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Items items = { "Items": [ { "Code": "ItemCode123", "Name": "ItemName XYZ", "Description": "Item Description ABC" } ] }; // Items | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Items result = apiInstance.updateOrCreateItems(xeroTenantId, items, summarizeErrors, unitdp);
    +            Items result = apiInstance.updateOrCreateItems(accessToken, xeroTenantId, items, summarizeErrors, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateItems");
                 e.printStackTrace();
             }
    @@ -110307,13 +114544,17 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const unitdp = 4; +const item: Item = { + code: "abcXYZ123", + name: "HelloWorld", + description: "Foobar" }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors - -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const items: Items = { items: [{ code: "ItemCode123", name: "ItemName XYZ", description: "Item Description ABC" }]} +const items: Items = { + items: [item] }; try { const response = await xero.accountingApi.updateOrCreateItems(xeroTenantId, items, summarizeErrors, unitdp); @@ -110321,8 +114562,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -110787,31 +115056,48 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        ManualJournals manualJournals = { "ManualJournals": [ { "Narration": "Journal Desc", "JournalLines": [ { "LineAmount": 100, "AccountCode": "400", "Description": "Money Movement" }, { "LineAmount": -100, "AccountCode": "400", "Description": "Prepayment of things", "Tracking": [ { "Name": "North", "Option": "Region" } ] } ], "Date": "2019-03-14" } ] }; // ManualJournals | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            ManualJournals result = apiInstance.updateOrCreateManualJournals(xeroTenantId, manualJournals, summarizeErrors);
    +            ManualJournals result = apiInstance.updateOrCreateManualJournals(accessToken, xeroTenantId, manualJournals, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateManualJournals");
                 e.printStackTrace();
             }
    @@ -110881,11 +115167,30 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' +const manualJournalLines = []; + +const credit: ManualJournalLine = { + lineAmount: 100.0, + accountCode: "400", + description: "Hello there" }; +manualJournalLines.push(credit) +const debit: ManualJournalLine = { + lineAmount: -100.0, + accountCode: "120", + description: "Hello there" }; +manualJournalLines.push(debit) -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const manualJournals: ManualJournals = { manualJournals: [{ narration: "Foo bar", journalLines: [{ lineAmount: 100.0, accountCode: "400", description: "Hello there" },{ lineAmount: -100.0, accountCode: "400", description: "Goodbye", tracking: [{ name: "Simpsons", option: "Bart" }]}], date: "2019-03-14" }]} +const manualJournal: ManualJournal = { + narration: "Foobar", + date: dateValue, + journalLines: manualJournalLines }; + +const manualJournals: ManualJournals = { + manualJournals: [manualJournal] }; try { const response = await xero.accountingApi.updateOrCreateManualJournals(xeroTenantId, manualJournals, summarizeErrors); @@ -110893,8 +115198,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -111336,31 +115709,46 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        PurchaseOrders purchaseOrders = { "PurchaseOrders": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "710" } ], "Date": "2019-03-13" } ] }; // PurchaseOrders | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors);
    +            PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(accessToken, xeroTenantId, purchaseOrders, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreatePurchaseOrders");
                 e.printStackTrace();
             }
    @@ -111430,11 +115818,28 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) +const purchaseOrder: PurchaseOrder = { + contact: contact, + lineItems: lineItems, + date: dateValue }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const purchaseOrders: PurchaseOrders = { purchaseOrders: [ { contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} +const purchaseOrders: PurchaseOrders = { + purchaseOrders: [purchaseOrder] }; try { const response = await xero.accountingApi.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders, summarizeErrors); @@ -111442,8 +115847,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -111884,31 +116351,46 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes?summarizeErrors=true"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        Boolean summarizeErrors = true;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        Quotes quotes = { "Quotes": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "12775" } ], "Date": "2020-02-01" } ] }; // Quotes | 
    -        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
             try {
    -            Quotes result = apiInstance.updateOrCreateQuotes(xeroTenantId, quotes, summarizeErrors);
    +            Quotes result = apiInstance.updateOrCreateQuotes(accessToken, xeroTenantId, quotes, summarizeErrors);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateOrCreateQuotes");
                 e.printStackTrace();
             }
    @@ -111978,11 +116460,28 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const summarizeErrors = true; +const dateValue = '2020-10-10' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const lineItem: LineItem = { + description: "Foobar", + quantity: 1.0, + unitAmount: 20.0, + accountCode: "000" }; +const lineItems = []; +lineItems.push(lineItem) +const quote: Quote = { + contact: contact, + lineItems: lineItems, + date: dateValue }; -const summarizeErrors = true; // {Boolean} If false return 200 OK and mix of successfully created objects and any with validation errors -const quotes: Quotes = { quotes: [{ contact: { contactID: "00000000-0000-0000-0000-000000000000" }, lineItems: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "12775" }], date: "2020-02-01" }]} +const quotes: Quotes = { + quotes: [quote] }; try { const response = await xero.accountingApi.updateOrCreateQuotes(xeroTenantId, quotes, summarizeErrors); @@ -111990,8 +116489,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -112432,31 +116993,33 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        PurchaseOrder purchaseOrder = new PurchaseOrder();
    +        purchaseOrder.setAttentionTo("Peter Parker");
    +        PurchaseOrders purchaseOrders = new PurchaseOrders();
    +        purchaseOrders.addPurchaseOrdersItem(purchaseOrder);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a PurchaseOrder
    -        PurchaseOrders purchaseOrders = { "PurchaseOrders": [ { "AttentionTo": "Peter Parker", "LineItems": [], "Contact": {} } ] }; // PurchaseOrders | 
             try {
    -            PurchaseOrders result = apiInstance.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders);
    +            PurchaseOrders result = apiInstance.updatePurchaseOrder(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updatePurchaseOrder");
                 e.printStackTrace();
             }
    @@ -112526,9 +117089,14 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a PurchaseOrder -const purchaseOrders: PurchaseOrders = { purchaseOrders:[ { attentionTo: "Peter Parker", lineItems: [], contact: {} }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; + +const purchaseOrder: PurchaseOrder = { + attentionTo: "Peter Parker" }; + +const purchaseOrders: PurchaseOrders = { + purchaseOrders: [purchaseOrder] }; try { const response = await xero.accountingApi.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders); @@ -112536,8 +117104,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -112984,32 +117573,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.png';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Purchase Order object
    -        String fileName = xero-dev.png; // String | Name of the attachment
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updatePurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body);
    +            Attachments result = apiInstance.updatePurchaseOrderAttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updatePurchaseOrderAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -113082,13 +117673,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const purchaseOrderID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Purchase Order object -const fileName = "xero-dev.png"; // {String} Name of the attachment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.png'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -113102,8 +117692,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -113579,31 +118183,38 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Quote
    -        Quotes quotes = { "Quotes": [ { "Reference": "I am an update", "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "Date": "2020-02-01" } ] }; // Quotes | 
             try {
    -            Quotes result = apiInstance.updateQuote(xeroTenantId, quoteID, quotes);
    +            Quotes result = apiInstance.updateQuote(accessToken, xeroTenantId, quoteID, quotes);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateQuote");
                 e.printStackTrace();
             }
    @@ -113673,9 +118284,20 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for an Quote -const quotes: Quotes = { quotes: [{ reference: "I am an update", contact: { contactID: "00000000-0000-0000-0000-000000000000" }, date: "2020-02-01" }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; +const dateValue = '2020-10-10' + +const contact: Contact = { + contactID: "00000000-0000-0000-0000-000000000000" }; + +const quote: Quote = { + reference: "I am an update", + contact: contact, + date: dateValue }; + +const quotes: Quotes = { + quotes: [quote] }; try { const response = await xero.accountingApi.updateQuote(xeroTenantId, quoteID, quotes); @@ -113683,8 +118305,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -114131,32 +118791,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for Quote object
    -        String fileName = xero-dev.jpg; // String | Name of the attachment
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
    +            Attachments result = apiInstance.updateQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateQuoteAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -114229,13 +118891,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const quoteID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for Quote object -const fileName = "xero-dev.jpg"; // {String} Name of the attachment +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const quoteID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -114249,8 +118910,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -114726,32 +119401,39 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}?unitdp=4"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        Integer unitdp = 4;
    +        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);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        Receipts receipts = { "Receipts": [ { "Lineitems": [], "User": { "UserID": "00000000-0000-0000-0000-000000000000" }, "Reference": "Foobar" } ] }; // Receipts | 
    -        Integer unitdp = 4; // Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
             try {
    -            Receipts result = apiInstance.updateReceipt(xeroTenantId, receiptID, receipts, unitdp);
    +            Receipts result = apiInstance.updateReceipt(accessToken, xeroTenantId, receiptID, receipts, unitdp);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateReceipt");
                 e.printStackTrace();
             }
    @@ -114824,12 +119506,21 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; +const unitdp = 4; +const dateValue = '2020-10-10' + +const user: User = { + userID: "00000000-0000-0000-0000-000000000000" }; +const receipt: Receipt = { + user: user, + reference: "Foobar", + date: dateValue }; -const unitdp = 4; // {Integer} e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -const receipts: Receipts = { receipts: [{ user: { userID: "00000000-0000-0000-0000-000000000000" }, reference: "Foobar", date: "2020-01-01", contact: {}, lineItems: [] }]} +const receipts: Receipts = { + receipts: [receipt] }; try { const response = await xero.accountingApi.updateReceipt(xeroTenantId, receiptID, receipts, unitdp); @@ -114837,8 +119528,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -115316,32 +120046,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to the Receipt
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
    +            Attachments result = apiInstance.updateReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateReceiptAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -115414,13 +120146,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const receiptID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Receipt -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to the Receipt +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const receiptID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -115434,8 +120165,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -115911,32 +120656,34 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        String fileName = 'xero-dev.jpg';
    +        File input = new File("/path/to/local/xero-dev.jpg");
    +        java.nio.file.Path inputPath = input.toPath();
    +        byte[] body = FileUtils.readFileToByteArray(input);
    +        String mimeType = Files.probeContentType(inputPath);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
    -        String fileName = xero-dev.jpg; // String | The name of the file being attached to a Repeating Invoice
    -        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
             try {
    -            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
    +            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, mimeType);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateRepeatingInvoiceAttachmentByFileName");
                 e.printStackTrace();
             }
    @@ -116009,13 +120756,12 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const repeatingInvoiceID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Repeating Invoice -const fileName = "xero-dev.jpg"; // {String} The name of the file being attached to a Repeating Invoice +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; +const fileName = 'xero-dev.jpg'; const path = require("path"); const mime = require("mime-types"); const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -import * as fs from "fs"; const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file const contentType = mime.lookup(fileName); @@ -116029,8 +120775,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -116506,30 +121266,36 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TaxRates"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        TaxComponent taxComponent = new TaxComponent();
    +        taxComponent.setName("State Tax");
    +        taxComponent.setRate(2.25);
    +        TaxRate taxRate = new TaxRate();
    +        taxRate.setName("CA State Tax");
    +        taxRate.addTaxComponentsItem(taxComponent);
    +        TaxRates taxRates = new TaxRates();
    +        taxRates.addTaxRatesItem(taxRate);
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        TaxRates taxRates = { "TaxRates": [ { "Name": "State Tax NY", "TaxComponents": [ { "Name": "State Tax", "Rate": 2.25 } ], "Status": "DELETED", "ReportTaxType": "INPUT" } ] }; // TaxRates | 
             try {
    -            TaxRates result = apiInstance.updateTaxRate(xeroTenantId, taxRates);
    +            TaxRates result = apiInstance.updateTaxRate(accessToken, xeroTenantId, taxRates);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateTaxRate");
                 e.printStackTrace();
             }
    @@ -116596,8 +121362,18 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const taxRates: TaxRates = { taxRates: [{ name: "State Tax NY", taxComponents: [{ name: "State Tax", rate: 2.25 }], status: TaxRate.StatusEnum.DELETED, reportTaxType: TaxRate.ReportTaxTypeEnum.INPUT }]} +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; + +const taxComponent: TaxComponent = { + name: "State Tax", + rate: 2.25 }; + +const taxRate: TaxRate = { + name: "CA State Tax", + taxRate: [taxComponent] }; + +const taxRates: TaxRates = { + taxRates: [taxRate] }; try { const response = await xero.accountingApi.updateTaxRate(xeroTenantId, taxRates); @@ -116605,8 +121381,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -117016,31 +121827,31 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        TrackingCategory trackingCategory = new TrackingCategory();
    +        trackingCategory.setName("Foobar");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
    -        TrackingCategory trackingCategory = { "Name": "Avengers" }; // TrackingCategory | 
             try {
    -            TrackingCategories result = apiInstance.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory);
    +            TrackingCategories result = apiInstance.updateTrackingCategory(accessToken, xeroTenantId, trackingCategoryID, trackingCategory);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateTrackingCategory");
                 e.printStackTrace();
             }
    @@ -117110,9 +121921,11 @@ 

    Usage and SDK Samples

    } await xero.setTokenSet(tokenSet); -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const trackingCategoryID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a TrackingCategory -const trackingCategory: TrackingCategory = { name: "Avengers" } +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; + +const trackingCategory: TrackingCategory = { + name: "Foobar" }; try { const response = await xero.accountingApi.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory); @@ -117120,8 +121933,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}
    -
  • NodeJS
  • +
  • Node
  • - + @@ -117568,32 +122392,32 @@

    Usage and SDK Samples

    curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"
    -
    import org.openapitools.client.*;
    -import org.openapitools.client.auth.*;
    -import org.openapitools.client.model.*;
    -import org.openapitools.client.api.AccountingApi;
    +                            
    import 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) {
    -        ApiClient defaultClient = Configuration.getDefaultApiClient();
    -        
    -        // Configure OAuth2 access token for authorization: OAuth2
    -        OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
    -        OAuth2.setAccessToken("YOUR ACCESS TOKEN");
    +        String accessToken = "YOUR_ACCESS_TOKEN";
    +        ApiClient defaultClient = new ApiClient();
    +
    +        // Get Singleton - instance of accounting client
    +        apiInstance = AccountingApi.getInstance(defaultClient);
    +        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
    +        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        UUID trackingOptionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
    +        TrackingOption trackingOption = new TrackingOption();
    +        trackingOption.setName("Foobar");
     
    -        AccountingApi apiInstance = new AccountingApi();
    -        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
    -        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
    -        UUID trackingOptionID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Tracking Option
    -        TrackingOption trackingOption = { name: "Vision" }; // TrackingOption | 
             try {
    -            TrackingOptions result = apiInstance.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
    +            TrackingOptions result = apiInstance.updateTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
                 System.out.println(result);
    -        } catch (ApiException e) {
    +        } catch (XeroException e) {
                 System.err.println("Exception when calling AccountingApi#updateTrackingOptions");
                 e.printStackTrace();
             }
    @@ -117665,11 +122489,13 @@ 

    Usage and SDK Samples

    session_state: 'xxx' } await xero.setTokenSet(tokenSet); -const trackingOption: TrackingOption = { name: "Vision" }; // {TrackingOption} -const xeroTenantId = "YOUR_XERO_TENANT_ID"; // {String} Xero identifier for Tenant -const trackingCategoryID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a TrackingCategory -const trackingOptionID = "00000000-0000-0000-0000-000000000000"; // {UUID} Unique identifier for a Tracking Option +const xeroTenantId = 'YOUR_XERO_TENANT_ID'; +const trackingCategoryID = '00000000-0000-0000-0000-000000000000'; +const trackingOptionID = '00000000-0000-0000-0000-000000000000'; + +const trackingOption: TrackingOption = { + name: "Foobar" }; try { const response = await xero.accountingApi.updateTrackingOptions(xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption); @@ -117677,8 +122503,7 @@

    Usage and SDK Samples

    } catch (err) { const error = JSON.stringify(err.response.body, null, 2) console.log(`Status Code: ${err.response.statusCode} => ${error}`); -} -
    +}