From 1a60b08fb40f971c629f0ac98556a58da6870099 Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Mon, 12 Apr 2021 11:57:19 -0600 Subject: [PATCH 1/2] adds token revoke method, ready for test pypi --- setup.py | 2 +- xero_python/__init__.py | 2 +- xero_python/api_client/__init__.py | 10 ++++++ xero_python/api_client/oauth2.py | 54 ++++++++++++++++++++++++++++++ xero_python/docs/README.md | 2 +- 5 files changed, 67 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 05ad3450..a7204076 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,5 @@ def read_file(filename): keywords="xero python sdk API oAuth", name="xero_python", packages=find_packages(include=["xero_python", "xero_python.*"]), - version="1.5.2", + version="1.5.3b1", ) diff --git a/xero_python/__init__.py b/xero_python/__init__.py index f91f489f..3f31ce20 100644 --- a/xero_python/__init__.py +++ b/xero_python/__init__.py @@ -2,4 +2,4 @@ __author__ = """Xero Developer API""" __email__ = "api@xero.com" -__version__ = "1.5.2" +__version__ = "1.5.3b1" diff --git a/xero_python/api_client/__init__.py b/xero_python/api_client/__init__.py index 5f005fe8..22b8f792 100644 --- a/xero_python/api_client/__init__.py +++ b/xero_python/api_client/__init__.py @@ -748,6 +748,16 @@ def refresh_oauth2_token(self): if oauth2_token.refresh_access_token(self): return self.get_oauth2_token() + def revoke_oauth2_token(self): + """ + Force revoke oauth2 token + :return: empty oauth2 token + """ + oauth2_token = self.configuration.oauth2_token + oauth2_token.update_token(**self.get_oauth2_token()) + if oauth2_token.revoke_access_token(self): + return self.get_oauth2_token() + def oauth2_token_getter(self, token_getter): """ A decorator to register a callback function for getting oauth2 token diff --git a/xero_python/api_client/oauth2.py b/xero_python/api_client/oauth2.py index ed614145..ef382eb6 100644 --- a/xero_python/api_client/oauth2.py +++ b/xero_python/api_client/oauth2.py @@ -11,6 +11,7 @@ class TokenApi: """ refresh_token_url = "https://identity.xero.com/connect/token" + revoke_token_url = "https://identity.xero.com/connect/revocation" def __init__(self, api_client, client_id, client_secret): self.api_client = api_client @@ -49,6 +50,35 @@ def refresh_token(self, refresh_token, scope): ) # todo validate response is json return self.parse_token_response(response) + + def revoke_token(self, refresh_token): + """ + Call xero identity API to revoke access tokens and remove all a user's connections using refresh token + :param refresh_token: str auth2 refresh token + :return: status response + """ + post_data = { + "token": refresh_token, + "client_id": self.client_id, + "client_secret": self.client_secret, + } + response, status, headers = self.api_client.call_api( + self.revoke_token_url, + "POST", + header_params={ + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }, + post_params=post_data, + auth_settings=None, # important to prevent infinite recursive loop + _preload_content=False, + ) + if status != 200: + # todo improve error handling + raise Exception( + "refresh token status {} {} {!r}".format(status, response, headers) + ) + return status def parse_token_response(self, response): """ @@ -171,6 +201,30 @@ def refresh_access_token(self, api_client): api_client.set_oauth2_token(new_token) return True + def revoke_access_token(self, api_client): + """ + Perform auth2 revoke token call. + :param api_client: ApiClient instance used to perform refresh token API call. + :return: bool - True if success + :raise: http request related errors + """ + if not self.can_refresh_access_token(): + return False + token_api = TokenApi(api_client, self.client_id, self.client_secret) + token_api.revoke_token(self.refresh_token) + new_token = { + "access_token": None, + "refresh_token": None, + "scope": None, + "expires_at": None, + "expires_in": None, + "token_type": "Bearer", + "id_token": None, + } + self.update_token(**new_token) + api_client.set_oauth2_token(new_token) + return True + def update_token( self, access_token, diff --git a/xero_python/docs/README.md b/xero_python/docs/README.md index abf9c0f0..de440787 100644 --- a/xero_python/docs/README.md +++ b/xero_python/docs/README.md @@ -4,7 +4,7 @@ These endpoints are related to managing authentication tokens and identity for X The `xero_python` package is automatically generated by the [XeroAPI SDK 2.0 Codegen](https://github.com/xero-github/xeroapi-sdk-codegen) project: - API version: 2.10.4 -- Package version: 1.5.2 +- Package version: 1.5.3b1 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://developer.xero.com](https://developer.xero.com) From c7809c5958a0a392d8644dfafb67f787138cdc45 Mon Sep 17 00:00:00 2001 From: Rett Behrens Date: Mon, 12 Apr 2021 16:20:34 -0600 Subject: [PATCH 2/2] version 1.5.3 --- docs/v1/accounting/index.html | 110341 ++++------------------------ setup.py | 2 +- xero_python/__init__.py | 2 +- xero_python/api_client/oauth2.py | 2 +- xero_python/docs/README.md | 2 +- 5 files changed, 16081 insertions(+), 94268 deletions(-) diff --git a/docs/v1/accounting/index.html b/docs/v1/accounting/index.html index e9ce1fda..797973a7 100644 --- a/docs/v1/accounting/index.html +++ b/docs/v1/accounting/index.html @@ -1,25 +1,27 @@ - - - Xero Accounting API - - - - - xero-ruby Accounting SDK Docs - + + + Xero Accounting API + + + + + + xero-python Accounting SDK Docs + + - - - - - - - - - - - -
- -
- -
-
- -
-
- -
-
- Accounting API - - -
+ function routeDocs(event) { + var selectedOption = event.options[event.selectedIndex]; + location = selectedOption.dataset.url + } + +
+ - -
-
-
- +
+ +
+
+ +
-
-
-
-

Xero Accounting API

+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+

Xero Accounting API

+
+
-
-
- + + + + unitdp + + + +
+
+
+ + Integer + + +
+e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +
+
+
+
+ + -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+              
+
+
+
+
+

updateOrCreateContacts

+

Updates or creates one or more contacts in a Xero organisation

+
+
+
+

+

+

+
+
/Contacts
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -109760,61 +39232,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateContacts: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-
-phone = { 
-  phone_number: "555-1212",
-  phone_type:  XeroRuby::Accounting::PhoneType::MOBILE
-}    
-phones = []
-phones << phone
-
-contact = { 
-  name: "Bruce Banner",
-  email_address: "hulk@avengers.com",
-  phones: phones
-}  
-
-contacts = {  
-  contacts: [contact]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_contacts(xero_tenant_id, contacts, summarize_errors)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_contacts: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.contactsGrant read-write access to contacts and contact groups
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -109837,34 +39273,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
contacts * -
-
- - Contacts - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
contacts * +
+
+ + Contacts + +
+
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + -
NameDescription
summarizeErrors @@ -109924,463 +39336,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreateCreditNotes

-

Updates or creates one or more credit notes

-
-
-
-

-

-

-
-
/CreditNotes
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/CreditNotes?summarizeErrors=true&unitdp=4"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        Integer unitdp = 4;
-        LocalDate currDate = LocalDate.now();
-        
-        Contact contact = new Contact();
-        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
-        
-        LineItem lineItem = new LineItem();
-        lineItem.setDescription("Foobar");
-        lineItem.setQuantity(1.0);
-        lineItem.setUnitAmount(20.0);
-        lineItem.setAccountCode("000");
-
-        List<LineItem> lineItems = new ArrayList<LineItem>();
-        lineItems.add(lineItem);
-        
-        CreditNote creditNote = new CreditNote();
-        creditNote.setType(com.xero.models.accounting.CreditNote.TypeEnum.ACCPAYCREDIT);
-        creditNote.setContact(contact);
-        creditNote.setDate(currDate);
-        creditNote.setLineItems(lineItems);
-        
-        CreditNotes creditNotes = new CreditNotes();
-        creditNotes.addCreditNotesItem(creditNote);
-
-        try {
-            CreditNotes result = apiInstance.updateOrCreateCreditNotes(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateCreditNotes");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        CreditNotes creditNotes = { "CreditNotes":[ { "Type":"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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateCreditNotes");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-CreditNotes *creditNotes = { "CreditNotes":[ { "Type":"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" } ] } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-Integer *unitdp = 4; // e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates or creates one or more credit notes
-[apiInstance updateOrCreateCreditNotesWith:xeroTenantId
-    creditNotes:creditNotes
-    summarizeErrors:summarizeErrors
-    unitdp:unitdp
-              completionHandler: ^(CreditNotes output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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 lineItem: LineItem = { 
-    description: "Foobar",
-    quantity: 1.0,
-    unitAmount: 20.0,
-    accountCode: "000" };   
-const lineItems = [];    
-lineItems.push(lineItem)
-
-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);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreateCreditNotesExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-            var unitdp = 4;
-            var currDate = DateTime.Now;
-
-            var contact = new Contact();
-            contact.ContactID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var lineItem = new LineItem();
-            lineItem.Description = "Foobar";
-            lineItem.Quantity = new decimal(1.0);
-            lineItem.UnitAmount = new decimal(20.0);
-            lineItem.AccountCode = "000";
-            var lineItems = new List<LineItem>();
-            lineItems.Add(lineItem);
-
-            var creditNote = new CreditNote();
-            creditNote.Type = CreditNote.TypeEnum.ACCPAYCREDIT;
-            creditNote.Contact = contact;
-            creditNote.Date = currDate;
-            creditNote.LineItems = lineItems;
-
-            var creditNotes = new CreditNotes();
-            var creditNotesList = new List<CreditNote>();
-            creditNotesList.Add(creditNote); 
-            creditNotes._CreditNotes = creditNotesList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreateCreditNotesAsync(accessToken, xeroTenantId, creditNotes, summarizeErrors, unitdp);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreateCreditNotes: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-$unitdp = 4;
-$currDate = new DateTime('2020-12-10');
-
-$contact = new XeroAPI\XeroPHP\Models\Accounting\Contact;
-$contact->setContactID('00000000-0000-0000-0000-000000000000');
-
-$lineItem = new XeroAPI\XeroPHP\Models\Accounting\LineItem;
-$lineItem->setDescription('Foobar');
-$lineItem->setQuantity(1.0);
-$lineItem->setUnitAmount(20.0);
-$lineItem->setAccountCode('000');
-$lineItems = [];
-array_push($lineItems, $lineItem);
-
-$creditNote = new XeroAPI\XeroPHP\Models\Accounting\CreditNote;
-$creditNote->setType(XeroAPI\XeroPHP\Models\Accounting\CreditNote::TYPE_ACCPAYCREDIT);
-$creditNote->setContact($contact);
-$creditNote->setDate($currDate);
-$creditNote->setLineItems($lineItems);
-
-$creditNotes = new XeroAPI\XeroPHP\Models\Accounting\CreditNotes;
-$arr_credit_notes = [];
-array_push($arr_credit_notes, $creditNote);
-$creditNotes->setCreditNotes($arr_credit_notes);
-
-try {
-  $result = $apiInstance->updateOrCreateCreditNotes($xeroTenantId, $creditNotes, $summarizeErrors, $unitdp);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreateCreditNotes: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $creditNotes = ::Object::CreditNotes->new(); # CreditNotes | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-my $unitdp = 4; # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
-
-eval { 
-    my $result = $api_instance->updateOrCreateCreditNotes(xeroTenantId => $xeroTenantId, creditNotes => $creditNotes, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreateCreditNotes: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreateCreditNotes

+

Updates or creates one or more credit notes

+
+
+
+

+

+

+
+
/CreditNotes
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -110425,70 +39408,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateCreditNotes: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-unitdp = 4
-curr_date = 'YYYY-MM-DD'
-
-contact = { 
-  contact_id: "00000000-0000-0000-0000-000000000000"
-}  
-
-line_item = { 
-  description: "Foobar",
-  quantity: 1.0,
-  unit_amount: 20.0,
-  account_code: "000"
-}    
-line_items = []
-line_items << line_item
-
-credit_note = { 
-  type:  XeroRuby::Accounting::CreditNote::ACCPAYCREDIT,
-  contact: contact,
-  date:  curr_date,
-  line_items:  line_items
-}  
-
-creditNotes = {  
-  credit_notes: [credit_note]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_credit_notes(xero_tenant_id, creditNotes, summarize_errors, unitdp)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_credit_notes: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -110511,34 +39449,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
creditNotes * -
-
- - CreditNotes - - -
-an array of Credit Notes with a single CreditNote object. -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
creditNotes * +
+
+ + CreditNotes + +
+ an array of Credit Notes with a single CreditNote object.
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + - + -
NameDescription
summarizeErrors @@ -110599,7 +39513,7 @@

Parameters

unitdp
unitdp @@ -110619,397 +39533,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreateEmployees

-

Creates a single new employees used in Xero payrun

-
-
-
-

-

-

-
-
/Employees
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Employees?summarizeErrors=true"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        
-        Employee employee = new Employee();
-        employee.setFirstName("Nick");
-        employee.setLastName("Fury");
-        
-        Employees employees = new Employees();
-        employees.addEmployeesItem(employee);
-
-        try {
-            Employees result = apiInstance.updateOrCreateEmployees(accessToken, xeroTenantId, employees, summarizeErrors);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateEmployees");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        Employees employees = { "Employees": [ { "FirstName": "Nick", "LastName": "Fury", "ExternalLink": { "Url": "http://twitter.com/#!/search/Nick+Fury" } } ] }; // Employees | 
-        Boolean summarizeErrors = true; // Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-        try {
-            Employees result = apiInstance.updateOrCreateEmployees(xeroTenantId, employees, summarizeErrors);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateEmployees");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-Employees *employees = { "Employees": [ { "FirstName": "Nick", "LastName": "Fury", "ExternalLink": { "Url": "http://twitter.com/#!/search/Nick+Fury" } } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Creates a single new employees used in Xero payrun
-[apiInstance updateOrCreateEmployeesWith:xeroTenantId
-    employees:employees
-    summarizeErrors:summarizeErrors
-              completionHandler: ^(Employees output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-const xeroTenantId = 'YOUR_XERO_TENANT_ID';
-const summarizeErrors = true;
-
-const employee: Employee = { 
-    firstName: "Nick",
-    lastName: "Fury" }; 
-
-const employees: Employees = {  
-    employees: [employee] }; 
-
-try {
-  const response = await xero.accountingApi.updateOrCreateEmployees(xeroTenantId, employees,  summarizeErrors);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreateEmployeesExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-
-            var employee = new Employee();
-            employee.FirstName = "Nick";
-            employee.LastName = "Fury";
-
-            var employees = new Employees();
-            var employeesList = new List<Employee>();
-            employeesList.Add(employee); 
-            employees._Employees = employeesList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreateEmployeesAsync(accessToken, xeroTenantId, employees, summarizeErrors);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreateEmployees: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-
-$employee = new XeroAPI\XeroPHP\Models\Accounting\Employee;
-$employee->setFirstName('Nick');
-$employee->setLastName('Fury');
-
-$employees = new XeroAPI\XeroPHP\Models\Accounting\Employees;
-$arr_employees = [];
-array_push($arr_employees, $employee);
-$employees->setEmployees($arr_employees);
-
-try {
-  $result = $apiInstance->updateOrCreateEmployees($xeroTenantId, $employees, $summarizeErrors);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreateEmployees: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $employees = ::Object::Employees->new(); # Employees | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-
-eval { 
-    my $result = $api_instance->updateOrCreateEmployees(xeroTenantId => $xeroTenantId, employees => $employees, summarizeErrors => $summarizeErrors);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreateEmployees: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreateEmployees

+

Creates a single new employees used in Xero payrun

+
+
+
+

+

+

+
+
/Employees
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -111039,53 +39590,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateEmployees: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-
-employee = { 
-  first_name: "Nick",
-  last_name: "Fury"
-}  
-
-employees = {  
-  employees: [employee]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_employees(xero_tenant_id, employees, summarize_errors)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_employees: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.settingsGrant read-write access to organisation and account settings
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -111108,34 +39631,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
employees * -
-
- - Employees - - -
-Employees with array of Employee object in body of request -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
employees * +
+
+ + Employees + +
+ Employees with array of Employee object in body of request
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + -
NameDescription
summarizeErrors @@ -111196,478 +39695,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreateInvoices

-

Updates or creates one or more sales invoices or purchase bills

-
-
-
-

-

-

-
-
/Invoices
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Invoices?summarizeErrors=true&unitdp=4"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        Integer unitdp = 4;
-        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
-        LocalDate dueDateValue = LocalDate.of(2020, Month.OCTOBER, 28);
-        
-        Contact contact = new Contact();
-        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
-        
-        LineItem lineItem = new LineItem();
-        lineItem.setDescription("Foobar");
-        lineItem.setQuantity(1.0);
-        lineItem.setUnitAmount(20.0);
-        lineItem.setAccountCode("000");
-
-        List<LineItem> lineItems = new ArrayList<LineItem>();
-        lineItems.add(lineItem);
-        
-        Invoice invoice = new Invoice();
-        invoice.setType(com.xero.models.accounting.Invoice.TypeEnum.ACCREC);
-        invoice.setContact(contact);
-        invoice.setDate(dateValue);
-        invoice.setDate(dueDateValue);
-        invoice.setLineItems(lineItems);
-        invoice.setReference("Website Design");
-        invoice.setStatus(com.xero.models.accounting.Invoice.StatusEnum.DRAFT);
-        
-        Invoices invoices = new Invoices();
-        invoices.addInvoicesItem(invoice);
-
-        try {
-            Invoices result = apiInstance.updateOrCreateInvoices(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateInvoices");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        Invoices invoices = { "Invoices": [ { "Type": "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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateInvoices");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-Invoices *invoices = { "Invoices": [ { "Type": "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" } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-Integer *unitdp = 4; // e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates or creates one or more sales invoices or purchase bills
-[apiInstance updateOrCreateInvoicesWith:xeroTenantId
-    invoices:invoices
-    summarizeErrors:summarizeErrors
-    unitdp:unitdp
-              completionHandler: ^(Invoices output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreateInvoicesExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-            var unitdp = 4;
-            var dateValue = new DateTime(2020, 10, 10);
-            var dueDateValue = new DateTime(2020, 10, 10);
-
-            var contact = new Contact();
-            contact.ContactID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var lineItem = new LineItem();
-            lineItem.Description = "Foobar";
-            lineItem.Quantity = new decimal(1.0);
-            lineItem.UnitAmount = new decimal(20.0);
-            lineItem.AccountCode = "000";
-            var lineItems = new List<LineItem>();
-            lineItems.Add(lineItem);
-
-            var invoice = new Invoice();
-            invoice.Type = Invoice.TypeEnum.ACCREC;
-            invoice.Contact = contact;
-            invoice.Date = dateValue;
-            invoice.Date = dueDateValue;
-            invoice.LineItems = lineItems;
-            invoice.Reference = "Website Design";
-            invoice.Status = Invoice.StatusEnum.DRAFT;
-
-            var invoices = new Invoices();
-            var invoicesList = new List<Invoice>();
-            invoicesList.Add(invoice); 
-            invoices._Invoices = invoicesList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreateInvoicesAsync(accessToken, xeroTenantId, invoices, summarizeErrors, unitdp);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreateInvoices: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-$unitdp = 4;
-$dateValue = new DateTime('2020-10-10');
-$dueDateValue = new DateTime('2020-10-28');
-
-$contact = new XeroAPI\XeroPHP\Models\Accounting\Contact;
-$contact->setContactID('00000000-0000-0000-0000-000000000000');
-
-$lineItem = new XeroAPI\XeroPHP\Models\Accounting\LineItem;
-$lineItem->setDescription('Foobar');
-$lineItem->setQuantity(1.0);
-$lineItem->setUnitAmount(20.0);
-$lineItem->setAccountCode('000');
-$lineItems = [];
-array_push($lineItems, $lineItem);
-
-$invoice = new XeroAPI\XeroPHP\Models\Accounting\Invoice;
-$invoice->setType(XeroAPI\XeroPHP\Models\Accounting\Invoice::TYPE_ACCREC);
-$invoice->setContact($contact);
-$invoice->setDate($dateValue);
-$invoice->setDate($dueDateValue);
-$invoice->setLineItems($lineItems);
-$invoice->setReference('Website Design');
-$invoice->setStatus(XeroAPI\XeroPHP\Models\Accounting\Invoice::STATUS_DRAFT);
-
-$invoices = new XeroAPI\XeroPHP\Models\Accounting\Invoices;
-$arr_invoices = [];
-array_push($arr_invoices, $invoice);
-$invoices->setInvoices($arr_invoices);
-
-try {
-  $result = $apiInstance->updateOrCreateInvoices($xeroTenantId, $invoices, $summarizeErrors, $unitdp);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreateInvoices: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $invoices = ::Object::Invoices->new(); # Invoices | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-my $unitdp = 4; # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
-
-eval { 
-    my $result = $api_instance->updateOrCreateInvoices(xeroTenantId => $xeroTenantId, invoices => $invoices, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreateInvoices: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreateInvoices

+

Updates or creates one or more sales invoices or purchase bills

+
+
+
+

+

+

+
+
/Invoices
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -111716,74 +39771,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateInvoices: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-unitdp = 4
-date_value = 'YYYY-MM-DD'
-due_date_value = 'YYYY-MM-DD'
-
-contact = { 
-  contact_id: "00000000-0000-0000-0000-000000000000"
-}  
-
-line_item = { 
-  description: "Foobar",
-  quantity: 1.0,
-  unit_amount: 20.0,
-  account_code: "000"
-}    
-line_items = []
-line_items << line_item
-
-invoice = { 
-  type:  XeroRuby::Accounting::Invoice::ACCREC,
-  contact: contact,
-  date:  date_value,
-  due_date:  due_date_value,
-  line_items:  line_items,
-  reference: "Website Design",
-  status:  XeroRuby::Accounting::Invoice::DRAFT
-}  
-
-invoices = {  
-  invoices: [invoice]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_invoices(xero_tenant_id, invoices, summarize_errors, unitdp)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_invoices: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -111806,34 +39812,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
invoices * -
-
- - Invoices - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
invoices * +
+
+ + Invoices + +
+
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + - + -
NameDescription
summarizeErrors @@ -111893,7 +39875,7 @@

Parameters

unitdp
unitdp @@ -111913,409 +39895,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreateItems

-

Updates or creates one or more items

-
-
-
-

-

-

-
-
/Items
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Items?summarizeErrors=true&unitdp=4"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        Integer unitdp = 4;
-        
-        Item item = new Item();
-        item.setCode("abcXYZ123");
-        item.setName("HelloWorld");
-        item.setDescription("Foobar");
-        
-        Items items = new Items();
-        items.addItemsItem(item);
-
-        try {
-            Items result = apiInstance.updateOrCreateItems(accessToken, xeroTenantId, items, summarizeErrors, unitdp);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateItems");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        Items items = { "Items": [ { "Code": "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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateItems");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-Items *items = { "Items": [ { "Code": "ItemCode123", "Name": "ItemName XYZ", "Description": "Item Description ABC" } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-Integer *unitdp = 4; // e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates or creates one or more items
-[apiInstance updateOrCreateItemsWith:xeroTenantId
-    items:items
-    summarizeErrors:summarizeErrors
-    unitdp:unitdp
-              completionHandler: ^(Items output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-const xeroTenantId = 'YOUR_XERO_TENANT_ID';
-const summarizeErrors = true;
-const unitdp = 4;
-
-const item: Item = { 
-    code: "abcXYZ123",
-    name: "HelloWorld",
-    description: "Foobar" }; 
-
-const items: Items = {  
-    items: [item] }; 
-
-try {
-  const response = await xero.accountingApi.updateOrCreateItems(xeroTenantId, items,  summarizeErrors, unitdp);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreateItemsExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-            var unitdp = 4;
-
-            var item = new Item();
-            item.Code = "abcXYZ123";
-            item.Name = "HelloWorld";
-            item.Description = "Foobar";
-
-            var items = new Items();
-            var itemsList = new List<Item>();
-            itemsList.Add(item); 
-            items._Items = itemsList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreateItemsAsync(accessToken, xeroTenantId, items, summarizeErrors, unitdp);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreateItems: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-$unitdp = 4;
-
-$item = new XeroAPI\XeroPHP\Models\Accounting\Item;
-$item->setCode('abcXYZ123');
-$item->setName('HelloWorld');
-$item->setDescription('Foobar');
-
-$items = new XeroAPI\XeroPHP\Models\Accounting\Items;
-$arr_items = [];
-array_push($arr_items, $item);
-$items->setItems($arr_items);
-
-try {
-  $result = $apiInstance->updateOrCreateItems($xeroTenantId, $items, $summarizeErrors, $unitdp);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreateItems: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $items = ::Object::Items->new(); # Items | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-my $unitdp = 4; # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
-
-eval { 
-    my $result = $api_instance->updateOrCreateItems(xeroTenantId => $xeroTenantId, items => $items, summarizeErrors => $summarizeErrors, unitdp => $unitdp);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreateItems: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreateItems

+

Updates or creates one or more items

+
+
+
+

+

+

+
+
/Items
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -112346,55 +39953,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateItems: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-unitdp = 4
-
-item = { 
-  code: "abcXYZ123",
-  name: "HelloWorld",
-  description: "Foobar"
-}  
-
-items = {  
-  items: [item]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_items(xero_tenant_id, items, summarize_errors, unitdp)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_items: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.settingsGrant read-write access to organisation and account settings
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -112417,34 +39994,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
items * -
-
- - Items - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
items * +
+
+ + Items + +
+
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + - + -
NameDescription
summarizeErrors @@ -112504,7 +40057,7 @@

Parameters

unitdp
unitdp @@ -112524,458 +40077,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreateManualJournals

-

Updates or creates a single manual journal

-
-
-
-

-

-

-
-
/ManualJournals
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/ManualJournals?summarizeErrors=true"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
-
-        List<ManualJournalLine> manualJournalLines = new ArrayList<ManualJournalLine>();
-        
-        ManualJournalLine credit = new ManualJournalLine();
-        credit.setLineAmount(100.0);
-        credit.setAccountCode("400");
-        credit.setDescription("Hello there");
-        manualJournalLines.add(credit);
-        
-        ManualJournalLine debit = new ManualJournalLine();
-        debit.setLineAmount(-100.0);
-        debit.setAccountCode("120");
-        debit.setDescription("Hello there");
-        manualJournalLines.add(debit);
-        
-        ManualJournal manualJournal = new ManualJournal();
-        manualJournal.setNarration("Foobar");
-        manualJournal.setDate(dateValue);
-        manualJournal.setJournalLines(manualJournalLines);
-        
-        ManualJournals manualJournals = new ManualJournals();
-        manualJournals.addManualJournalsItem(manualJournal);
-
-        try {
-            ManualJournals result = apiInstance.updateOrCreateManualJournals(accessToken, xeroTenantId, manualJournals, summarizeErrors);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateManualJournals");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        ManualJournals manualJournals = { "ManualJournals": [ { "Narration": "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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateManualJournals");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-ManualJournals *manualJournals = { "ManualJournals": [ { "Narration": "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" } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates or creates a single manual journal
-[apiInstance updateOrCreateManualJournalsWith:xeroTenantId
-    manualJournals:manualJournals
-    summarizeErrors:summarizeErrors
-              completionHandler: ^(ManualJournals output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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,
-    manualJournalLines: manualJournalLines }; 
-
-const manualJournals: ManualJournals = {  
-    manualJournals: [manualJournal] }; 
-
-try {
-  const response = await xero.accountingApi.updateOrCreateManualJournals(xeroTenantId, manualJournals,  summarizeErrors);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreateManualJournalsExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-            var dateValue = new DateTime(2020, 10, 10);
-            var manualJournalLines = new List<ManualJournalLine>();
-
-            var credit = new ManualJournalLine();
-            credit.LineAmount = new decimal(100.0);
-            credit.AccountCode = "400";
-            credit.Description = "Hello there";
-            manualJournalLines.Add(credit);
-
-            var debit = new ManualJournalLine();
-            debit.LineAmount = new decimal(-100.0);
-            debit.AccountCode = "120";
-            debit.Description = "Hello there";
-            manualJournalLines.Add(debit);
-
-            var manualJournal = new ManualJournal();
-            manualJournal.Narration = "Foobar";
-            manualJournal.Date = dateValue;
-            manualJournal.JournalLines = manualJournalLines;
-
-            var manualJournals = new ManualJournals();
-            var manualJournalsList = new List<ManualJournal>();
-            manualJournalsList.Add(manualJournal); 
-            manualJournals._ManualJournals = manualJournalsList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreateManualJournalsAsync(accessToken, xeroTenantId, manualJournals, summarizeErrors);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreateManualJournals: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-$dateValue = new DateTime('2020-10-10');
-$manualJournalLines = [];
-
-$credit = new XeroAPI\XeroPHP\Models\Accounting\ManualJournalLine;
-$credit->setLineAmount(100.0);
-$credit->setAccountCode('400');
-$credit->setDescription('Hello there');
-array_push($manualJournalLines, $credit);
-
-$debit = new XeroAPI\XeroPHP\Models\Accounting\ManualJournalLine;
-$debit->setLineAmount(-100.0);
-$debit->setAccountCode('120');
-$debit->setDescription('Hello there');
-array_push($manualJournalLines, $debit);
-
-$manualJournal = new XeroAPI\XeroPHP\Models\Accounting\ManualJournal;
-$manualJournal->setNarration('Foobar');
-$manualJournal->setDate($dateValue);
-$manualJournal->setJournalLines($manualJournalLines);
-
-$manualJournals = new XeroAPI\XeroPHP\Models\Accounting\ManualJournals;
-$arr_manual_journals = [];
-array_push($arr_manual_journals, $manualJournal);
-$manualJournals->setManualJournals($arr_manual_journals);
-
-try {
-  $result = $apiInstance->updateOrCreateManualJournals($xeroTenantId, $manualJournals, $summarizeErrors);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreateManualJournals: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $manualJournals = ::Object::ManualJournals->new(); # ManualJournals | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-
-eval { 
-    my $result = $api_instance->updateOrCreateManualJournals(xeroTenantId => $xeroTenantId, manualJournals => $manualJournals, summarizeErrors => $summarizeErrors);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreateManualJournals: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreateManualJournals

+

Updates or creates a single manual journal

+
+
+
+

+

+

+
+
/ManualJournals
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -113021,70 +40150,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateManualJournals: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-date_value = 'YYYY-MM-DD'  
-manual_journal_lines = []
-
-credit = { 
-  line_amount: 100.0,
-  account_code: "400",
-  description: "Hello there"
-}  
-manual_journal_lines << credit
-
-debit = { 
-  line_amount: -100.0,
-  account_code: "120",
-  description: "Hello there"
-}  
-manual_journal_lines << debit
-
-manual_journal = { 
-  narration: "Foobar",
-  date:  date_value,
-  journal_lines:  manual_journal_lines
-}  
-
-manualJournals = {  
-  manual_journals: [manual_journal]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_manual_journals(xero_tenant_id, manualJournals, summarize_errors)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_manual_journals: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -113107,34 +40191,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
manualJournals * -
-
- - ManualJournals - - -
-ManualJournals array with ManualJournal object in body of request -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
manualJournals * +
+
+ + ManualJournals + +
+ ManualJournals array with ManualJournal object in body of request
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + -
NameDescription
summarizeErrors @@ -113195,450 +40255,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreatePurchaseOrders

-

Updates or creates one or more purchase orders

-
-
-
-

-

-

-
-
/PurchaseOrders
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders?summarizeErrors=true"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
-        
-        Contact contact = new Contact();
-        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
-        
-        LineItem lineItem = new LineItem();
-        lineItem.setDescription("Foobar");
-        lineItem.setQuantity(1.0);
-        lineItem.setUnitAmount(20.0);
-        lineItem.setAccountCode("000");
-
-        List<LineItem> lineItems = new ArrayList<LineItem>();
-        lineItems.add(lineItem);
-        
-        PurchaseOrder purchaseOrder = new PurchaseOrder();
-        purchaseOrder.setContact(contact);
-        purchaseOrder.setLineItems(lineItems);
-        purchaseOrder.setDate(dateValue);
-        
-        PurchaseOrders purchaseOrders = new PurchaseOrders();
-        purchaseOrders.addPurchaseOrdersItem(purchaseOrder);
-
-        try {
-            PurchaseOrders result = apiInstance.updateOrCreatePurchaseOrders(accessToken, xeroTenantId, purchaseOrders, summarizeErrors);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreatePurchaseOrders");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        PurchaseOrders purchaseOrders = { "PurchaseOrders": [ { "Contact": { "ContactID": "00000000-0000-0000-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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreatePurchaseOrders");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-PurchaseOrders *purchaseOrders = { "PurchaseOrders": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "710" } ], "Date": "2019-03-13" } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates or creates one or more purchase orders
-[apiInstance updateOrCreatePurchaseOrdersWith:xeroTenantId
-    purchaseOrders:purchaseOrders
-    summarizeErrors:summarizeErrors
-              completionHandler: ^(PurchaseOrders output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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 purchaseOrders: PurchaseOrders = {  
-    purchaseOrders: [purchaseOrder] }; 
-
-try {
-  const response = await xero.accountingApi.updateOrCreatePurchaseOrders(xeroTenantId, purchaseOrders,  summarizeErrors);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreatePurchaseOrdersExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-            var dateValue = DateTime.Now;
-
-            var contact = new Contact();
-            contact.ContactID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var lineItem = new LineItem();
-            lineItem.Description = "Foobar";
-            lineItem.Quantity = new decimal(1.0);
-            lineItem.UnitAmount = new decimal(20.0);
-            lineItem.AccountCode = "000";
-            var lineItems = new List<LineItem>();
-            lineItems.Add(lineItem);
-
-            var purchaseOrder = new PurchaseOrder();
-            purchaseOrder.Contact = contact;
-            purchaseOrder.LineItems = lineItems;
-            purchaseOrder.Date = dateValue;
-
-            var purchaseOrders = new PurchaseOrders();
-            var purchaseOrdersList = new List<PurchaseOrder>();
-            purchaseOrdersList.Add(purchaseOrder); 
-            purchaseOrders._PurchaseOrders = purchaseOrdersList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreatePurchaseOrdersAsync(accessToken, xeroTenantId, purchaseOrders, summarizeErrors);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreatePurchaseOrders: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-$dateValue = new DateTime('2020-12-10');
-
-$contact = new XeroAPI\XeroPHP\Models\Accounting\Contact;
-$contact->setContactID('00000000-0000-0000-0000-000000000000');
-
-$lineItem = new XeroAPI\XeroPHP\Models\Accounting\LineItem;
-$lineItem->setDescription('Foobar');
-$lineItem->setQuantity(1.0);
-$lineItem->setUnitAmount(20.0);
-$lineItem->setAccountCode('000');
-$lineItems = [];
-array_push($lineItems, $lineItem);
-
-$purchaseOrder = new XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder;
-$purchaseOrder->setContact($contact);
-$purchaseOrder->setLineItems($lineItems);
-$purchaseOrder->setDate($dateValue);
-
-$purchaseOrders = new XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders;
-$arr_purchase_orders = [];
-array_push($arr_purchase_orders, $purchaseOrder);
-$purchaseOrders->setPurchaseOrders($arr_purchase_orders);
-
-try {
-  $result = $apiInstance->updateOrCreatePurchaseOrders($xeroTenantId, $purchaseOrders, $summarizeErrors);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreatePurchaseOrders: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $purchaseOrders = ::Object::PurchaseOrders->new(); # PurchaseOrders | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-
-eval { 
-    my $result = $api_instance->updateOrCreatePurchaseOrders(xeroTenantId => $xeroTenantId, purchaseOrders => $purchaseOrders, summarizeErrors => $summarizeErrors);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreatePurchaseOrders: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreatePurchaseOrders

+

Updates or creates one or more purchase orders

+
+
+
+

+

+

+
+
/PurchaseOrders
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -113682,68 +40326,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreatePurchaseOrders: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-date_value = 'YYYY-MM-DD'
-
-contact = { 
-  contact_id: "00000000-0000-0000-0000-000000000000"
-}  
-
-line_item = { 
-  description: "Foobar",
-  quantity: 1.0,
-  unit_amount: 20.0,
-  account_code: "000"
-}    
-line_items = []
-line_items << line_item
-
-purchase_order = { 
-  contact: contact,
-  line_items:  line_items,
-  date:  date_value
-}  
-
-purchaseOrders = {  
-  purchase_orders: [purchase_order]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_purchase_orders(xero_tenant_id, purchaseOrders, summarize_errors)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_purchase_orders: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -113766,34 +40367,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
purchaseOrders * -
-
- - PurchaseOrders - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
purchaseOrders * +
+
+ + PurchaseOrders + +
+
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + -
NameDescription
summarizeErrors @@ -113853,450 +40430,34 @@

Parameters

- -
-
-
-
-
-
-

updateOrCreateQuotes

-

Updates or creates one or more quotes

-
-
-
-

-

-

-
-
/Quotes
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Quotes?summarizeErrors=true"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        Boolean summarizeErrors = true;
-        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
-        
-        Contact contact = new Contact();
-        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
-        
-        LineItem lineItem = new LineItem();
-        lineItem.setDescription("Foobar");
-        lineItem.setQuantity(1.0);
-        lineItem.setUnitAmount(20.0);
-        lineItem.setAccountCode("000");
-
-        List<LineItem> lineItems = new ArrayList<LineItem>();
-        lineItems.add(lineItem);
-        
-        Quote quote = new Quote();
-        quote.setContact(contact);
-        quote.setLineItems(lineItems);
-        quote.setDate(dateValue);
-        
-        Quotes quotes = new Quotes();
-        quotes.addQuotesItem(quote);
-
-        try {
-            Quotes result = apiInstance.updateOrCreateQuotes(accessToken, xeroTenantId, quotes, summarizeErrors);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateQuotes");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        Quotes quotes = { "Quotes": [ { "Contact": { "ContactID": "00000000-0000-0000-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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateOrCreateQuotes");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-Quotes *quotes = { "Quotes": [ { "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "LineItems": [ { "Description": "Foobar", "Quantity": 1, "UnitAmount": 20, "AccountCode": "12775" } ], "Date": "2020-02-01" } ] }; // 
-Boolean *summarizeErrors = true; // If false return 200 OK and mix of successfully created objects and any with validation errors (optional) (default to false)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates or creates one or more quotes
-[apiInstance updateOrCreateQuotesWith:xeroTenantId
-    quotes:quotes
-    summarizeErrors:summarizeErrors
-              completionHandler: ^(Quotes output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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 quotes: Quotes = {  
-    quotes: [quote] }; 
-
-try {
-  const response = await xero.accountingApi.updateOrCreateQuotes(xeroTenantId, quotes,  summarizeErrors);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateOrCreateQuotesExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var summarizeErrors = true;
-            var dateValue = DateTime.Now;
-
-            var contact = new Contact();
-            contact.ContactID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var lineItem = new LineItem();
-            lineItem.Description = "Foobar";
-            lineItem.Quantity = new decimal(1.0);
-            lineItem.UnitAmount = new decimal(20.0);
-            lineItem.AccountCode = "000";
-            var lineItems = new List<LineItem>();
-            lineItems.Add(lineItem);
-
-            var quote = new Quote();
-            quote.Contact = contact;
-            quote.LineItems = lineItems;
-            quote.Date = dateValue;
-
-            var quotes = new Quotes();
-            var quotesList = new List<Quote>();
-            quotesList.Add(quote); 
-            quotes._Quotes = quotesList;
-            
-            try {
-                var result = await apiInstance.UpdateOrCreateQuotesAsync(accessToken, xeroTenantId, quotes, summarizeErrors);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateOrCreateQuotes: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$summarizeErrors = true;
-$dateValue = new DateTime('2020-12-10');
-
-$contact = new XeroAPI\XeroPHP\Models\Accounting\Contact;
-$contact->setContactID('00000000-0000-0000-0000-000000000000');
-
-$lineItem = new XeroAPI\XeroPHP\Models\Accounting\LineItem;
-$lineItem->setDescription('Foobar');
-$lineItem->setQuantity(1.0);
-$lineItem->setUnitAmount(20.0);
-$lineItem->setAccountCode('000');
-$lineItems = [];
-array_push($lineItems, $lineItem);
-
-$quote = new XeroAPI\XeroPHP\Models\Accounting\Quote;
-$quote->setContact($contact);
-$quote->setLineItems($lineItems);
-$quote->setDate($dateValue);
-
-$quotes = new XeroAPI\XeroPHP\Models\Accounting\Quotes;
-$arr_quotes = [];
-array_push($arr_quotes, $quote);
-$quotes->setQuotes($arr_quotes);
-
-try {
-  $result = $apiInstance->updateOrCreateQuotes($xeroTenantId, $quotes, $summarizeErrors);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateOrCreateQuotes: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $quotes = ::Object::Quotes->new(); # Quotes | 
-my $summarizeErrors = true; # Boolean | If false return 200 OK and mix of successfully created objects and any with validation errors
-
-eval { 
-    my $result = $api_instance->updateOrCreateQuotes(xeroTenantId => $xeroTenantId, quotes => $quotes, summarizeErrors => $summarizeErrors);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateOrCreateQuotes: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateOrCreateQuotes

+

Updates or creates one or more quotes

+
+
+
+

+

+

+
+
/Quotes
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -114340,68 +40501,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateOrCreateQuotes: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-summarize_errors = true
-date_value = 'YYYY-MM-DD'
-
-contact = { 
-  contact_id: "00000000-0000-0000-0000-000000000000"
-}  
-
-line_item = { 
-  description: "Foobar",
-  quantity: 1.0,
-  unit_amount: 20.0,
-  account_code: "000"
-}    
-line_items = []
-line_items << line_item
-
-quote = { 
-  contact: contact,
-  line_items:  line_items,
-  date:  date_value
-}  
-
-quotes = {  
-  quotes: [quote]
-} 
-
-begin
-  response = xero_client.accounting_api.update_or_create_quotes(xero_tenant_id, quotes, summarize_errors)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_or_create_quotes: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -114424,34 +40542,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
quotes * -
-
- - Quotes - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
quotes * +
+
+ + Quotes + +
+
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
summarizeErrors
+
Query parameters
+ + + + + + -
NameDescription
summarizeErrors @@ -114511,393 +40605,34 @@

Parameters

- -
-
-
-
-
-
-

updatePurchaseOrder

-

Updates a specific purchase order

-
-
-
-

-

-

-
-
/PurchaseOrders/{PurchaseOrderID}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        
-        PurchaseOrder purchaseOrder = new PurchaseOrder();
-        purchaseOrder.setAttentionTo("Peter Parker");
-        
-        PurchaseOrders purchaseOrders = new PurchaseOrders();
-        purchaseOrders.addPurchaseOrdersItem(purchaseOrder);
-
-        try {
-            PurchaseOrders result = apiInstance.updatePurchaseOrder(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updatePurchaseOrder");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Purchase Order
-        PurchaseOrders purchaseOrders = { "PurchaseOrders": [ { "AttentionTo": "Peter Parker", "LineItems": [], "Contact": {} } ] }; // PurchaseOrders | 
-        try {
-            PurchaseOrders result = apiInstance.updatePurchaseOrder(xeroTenantId, purchaseOrderID, purchaseOrders);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updatePurchaseOrder");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *purchaseOrderID = 00000000-0000-0000-0000-000000000000; // Unique identifier for an Purchase Order (default to null)
-PurchaseOrders *purchaseOrders = { "PurchaseOrders": [ { "AttentionTo": "Peter Parker", "LineItems": [], "Contact": {} } ] }; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific purchase order
-[apiInstance updatePurchaseOrderWith:xeroTenantId
-    purchaseOrderID:purchaseOrderID
-    purchaseOrders:purchaseOrders
-              completionHandler: ^(PurchaseOrders output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdatePurchaseOrderExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var purchaseOrderID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var purchaseOrder = new PurchaseOrder();
-            purchaseOrder.AttentionTo = "Peter Parker";
-
-            var purchaseOrders = new PurchaseOrders();
-            var purchaseOrdersList = new List<PurchaseOrder>();
-            purchaseOrdersList.Add(purchaseOrder); 
-            purchaseOrders._PurchaseOrders = purchaseOrdersList;
-            
-            try {
-                var result = await apiInstance.UpdatePurchaseOrderAsync(accessToken, xeroTenantId, purchaseOrderID, purchaseOrders);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdatePurchaseOrder: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$purchaseOrderID = "00000000-0000-0000-0000-000000000000";
-
-$purchaseOrder = new XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder;
-$purchaseOrder->setAttentionTo('Peter Parker');
-
-$purchaseOrders = new XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders;
-$arr_purchase_orders = [];
-array_push($arr_purchase_orders, $purchaseOrder);
-$purchaseOrders->setPurchaseOrders($arr_purchase_orders);
-
-try {
-  $result = $apiInstance->updatePurchaseOrder($xeroTenantId, $purchaseOrderID, $purchaseOrders);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updatePurchaseOrder: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $purchaseOrderID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for an Purchase Order
-my $purchaseOrders = ::Object::PurchaseOrders->new(); # PurchaseOrders | 
-
-eval { 
-    my $result = $api_instance->updatePurchaseOrder(xeroTenantId => $xeroTenantId, purchaseOrderID => $purchaseOrderID, purchaseOrders => $purchaseOrders);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updatePurchaseOrder: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updatePurchaseOrder

+

Updates a specific purchase order

+
+
+
+

+

+

+
+
/PurchaseOrders/{PurchaseOrderID}
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -114926,51 +40661,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updatePurchaseOrder: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-purchase_order_id = '00000000-0000-0000-0000-000000000000'
-
-purchase_order = { 
-  attentionTo: "Peter Parker"
-}  
-
-purchaseOrders = {  
-  purchase_orders: [purchase_order]
-} 
-
-begin
-  response = xero_client.accounting_api.update_purchase_order(xero_tenant_id, purchase_order_id, purchaseOrders)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_purchase_order: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
PurchaseOrderID*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Path parameters
+ + + + + + -
NameDescription
PurchaseOrderID* @@ -114996,15 +40705,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -115027,34 +40735,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
purchaseOrders * -
-
- - PurchaseOrders - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
purchaseOrders * +
+
+ + PurchaseOrders + +
+
- - -
-
- - - -
-
-
-
-
-
-

updatePurchaseOrderAttachmentByFileName

-

Updates a specific attachment for a specific purchase order by filename

-
-
-
-

-

-

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

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID purchaseOrderID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        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);
-
-        try {
-            Attachments result = apiInstance.updatePurchaseOrderAttachmentByFileName(accessToken, xeroTenantId, purchaseOrderID, fileName, body, mimeType);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updatePurchaseOrderAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID purchaseOrderID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Purchase Order
-        String fileName = xero-dev.jpg; // String | Name of the attachment
-        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
-        try {
-            Attachments result = apiInstance.updatePurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updatePurchaseOrderAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *purchaseOrderID = 00000000-0000-0000-0000-000000000000; // Unique identifier for an Purchase Order (default to null)
-String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
-byte[] *body = BYTE_ARRAY_DATA_HERE; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific attachment for a specific purchase order by filename
-[apiInstance updatePurchaseOrderAttachmentByFileNameWith:xeroTenantId
-    purchaseOrderID:purchaseOrderID
-    fileName:fileName
-    body:body
-              completionHandler: ^(Attachments output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-const xeroTenantId = 'YOUR_XERO_TENANT_ID';
-const purchaseOrderID = '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
-const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
-const contentType = mime.lookup(fileName);
-
-try {
-  const response = await xero.accountingApi.updatePurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body, {
-    headers: {
-      "Content-Type": contentType,
-    }
-  });
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdatePurchaseOrderAttachmentByFileNameExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var purchaseOrderID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var fileName = "xero-dev.jpg";
-            byte[] body = System.IO.File.ReadAllBytes(fileName);
-            
-            try {
-                var result = await apiInstance.UpdatePurchaseOrderAttachmentByFileNameAsync(accessToken, xeroTenantId, purchaseOrderID, fileName, body);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdatePurchaseOrderAttachmentByFileName: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$purchaseOrderID = "00000000-0000-0000-0000-000000000000";
-$fileName = "xero-dev.jpg";
-
-$handle = fopen($fileName, "r");
-$body = fread($handle, filesize($fileName));
-fclose($handle);
-
-try {
-  $result = $apiInstance->updatePurchaseOrderAttachmentByFileName($xeroTenantId, $purchaseOrderID, $fileName, $body);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updatePurchaseOrderAttachmentByFileName: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $purchaseOrderID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for an Purchase Order
-my $fileName = xero-dev.jpg; # String | Name of the attachment
-my $body = ::Object::byte[]->new(); # byte[] | 
-
-eval { 
-    my $result = $api_instance->updatePurchaseOrderAttachmentByFileName(xeroTenantId => $xeroTenantId, purchaseOrderID => $purchaseOrderID, fileName => $fileName, body => $body);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updatePurchaseOrderAttachmentByFileName: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updatePurchaseOrderAttachmentByFileName

+

Updates a specific attachment for a specific purchase order by filename

+
+
+
+

+

+

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

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -115500,44 +40826,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updatePurchaseOrderAttachmentByFileName: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-purchase_order_id = '00000000-0000-0000-0000-000000000000'
-file_name = 'xero-dev.jpg'
-body = File.read('assets/images/xero-api.png')
-begin
-  response = xero_client.accounting_api.update_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_purchase_order_attachment_by_file_name: #{e}"
-end
-
-
-
- -

Scopes

- - - - - - - -
accounting.attachmentsGrant read-write access to attachments
- -

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
PurchaseOrderID*
+ + + + + + +
accounting.attachmentsGrant read-write access to attachments
+

Parameters

+
Path parameters
+ + + + + + - + -
NameDescription
PurchaseOrderID* @@ -115563,7 +40870,7 @@

Parameters

FileName*
FileName* @@ -115586,15 +40893,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -115617,34 +40923,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
body * -
-
- - byte[] - - -
-Byte array of file in body of request -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
body * +
+
+ + byte[] + +
+ Byte array of file in body of request
- - -
-
- - - -
-
-
-
-
-
-

updateQuote

-

Updates a specific quote

-
-
-
-

-

-

-
-
/Quotes/{QuoteID}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        LocalDate dateValue = LocalDate.of(2020, Month.OCTOBER, 10);
-        
-        Contact contact = new Contact();
-        contact.setContactID(UUID.fromString("00000000-0000-0000-0000-000000000000"));
-        
-        Quote quote = new Quote();
-        quote.setReference("I am an update");
-        quote.setContact(contact);
-        quote.setDate(dateValue);
-        
-        Quotes quotes = new Quotes();
-        quotes.addQuotesItem(quote);
-
-        try {
-            Quotes result = apiInstance.updateQuote(accessToken, xeroTenantId, quoteID, quotes);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateQuote");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID quoteID = 00000000-0000-0000-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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateQuote");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *quoteID = 00000000-0000-0000-0000-000000000000; // Unique identifier for an Quote (default to null)
-Quotes *quotes = { "Quotes": [ { "Reference": "I am an update", "Contact": { "ContactID": "00000000-0000-0000-0000-000000000000" }, "Date": "2020-02-01" } ] }; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific quote
-[apiInstance updateQuoteWith:xeroTenantId
-    quoteID:quoteID
-    quotes:quotes
-              completionHandler: ^(Quotes output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateQuoteExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var quoteID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var dateValue = DateTime.Now;
-
-            var contact = new Contact();
-            contact.ContactID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var quote = new Quote();
-            quote.Reference = "I am an update";
-            quote.Contact = contact;
-            quote.Date = dateValue;
-
-            var quotes = new Quotes();
-            var quotesList = new List<Quote>();
-            quotesList.Add(quote); 
-            quotes._Quotes = quotesList;
-            
-            try {
-                var result = await apiInstance.UpdateQuoteAsync(accessToken, xeroTenantId, quoteID, quotes);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateQuote: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$quoteID = "00000000-0000-0000-0000-000000000000";
-$dateValue = new DateTime('2020-12-10');
-
-$contact = new XeroAPI\XeroPHP\Models\Accounting\Contact;
-$contact->setContactID('00000000-0000-0000-0000-000000000000');
-
-$quote = new XeroAPI\XeroPHP\Models\Accounting\Quote;
-$quote->setReference('I am an update');
-$quote->setContact($contact);
-$quote->setDate($dateValue);
-
-$quotes = new XeroAPI\XeroPHP\Models\Accounting\Quotes;
-$arr_quotes = [];
-array_push($arr_quotes, $quote);
-$quotes->setQuotes($arr_quotes);
-
-try {
-  $result = $apiInstance->updateQuote($xeroTenantId, $quoteID, $quotes);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateQuote: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $quoteID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for an Quote
-my $quotes = ::Object::Quotes->new(); # Quotes | 
-
-eval { 
-    my $result = $api_instance->updateQuote(xeroTenantId => $xeroTenantId, quoteID => $quoteID, quotes => $quotes);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateQuote: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateQuote

+

Updates a specific quote

+
+
+
+

+

+

+
+
/Quotes/{QuoteID}
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -116124,58 +41022,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateQuote: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-quote_id = '00000000-0000-0000-0000-000000000000'
-date_value = 'YYYY-MM-DD'
-
-contact = { 
-  contact_id: "00000000-0000-0000-0000-000000000000"
-}  
-
-quote = { 
-  reference: "I am an update",
-  contact: contact,
-  date:  date_value
-}  
-
-quotes = {  
-  quotes: [quote]
-} 
-
-begin
-  response = xero_client.accounting_api.update_quote(xero_tenant_id, quote_id, quotes)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_quote: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
QuoteID*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Path parameters
+ + + + + + -
NameDescription
QuoteID* @@ -116201,15 +41066,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -116232,34 +41096,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
quotes * -
-
- - Quotes - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
quotes * +
+
+ + Quotes + +
+
- - -
-
- - - -
-
-
-
-
-
-

updateQuoteAttachmentByFileName

-

Updates a specific attachment from a specific quote by filename

-
-
-
-

-

-

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

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Quotes/{QuoteID}/Attachments/{FileName}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID quoteID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        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);
-
-        try {
-            Attachments result = apiInstance.updateQuoteAttachmentByFileName(accessToken, xeroTenantId, quoteID, fileName, body, mimeType);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateQuoteAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID quoteID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for an Quote
-        String fileName = xero-dev.jpg; // String | Name of the attachment
-        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
-        try {
-            Attachments result = apiInstance.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateQuoteAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *quoteID = 00000000-0000-0000-0000-000000000000; // Unique identifier for an Quote (default to null)
-String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
-byte[] *body = BYTE_ARRAY_DATA_HERE; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific attachment from a specific quote by filename
-[apiInstance updateQuoteAttachmentByFileNameWith:xeroTenantId
-    quoteID:quoteID
-    fileName:fileName
-    body:body
-              completionHandler: ^(Attachments output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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
-const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
-const contentType = mime.lookup(fileName);
-
-try {
-  const response = await xero.accountingApi.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, {
-    headers: {
-      "Content-Type": contentType,
-    }
-  });
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateQuoteAttachmentByFileNameExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var quoteID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var fileName = "xero-dev.jpg";
-            byte[] body = System.IO.File.ReadAllBytes(fileName);
-            
-            try {
-                var result = await apiInstance.UpdateQuoteAttachmentByFileNameAsync(accessToken, xeroTenantId, quoteID, fileName, body);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateQuoteAttachmentByFileName: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$quoteID = "00000000-0000-0000-0000-000000000000";
-$fileName = "xero-dev.jpg";
-
-$handle = fopen($fileName, "r");
-$body = fread($handle, filesize($fileName));
-fclose($handle);
-
-try {
-  $result = $apiInstance->updateQuoteAttachmentByFileName($xeroTenantId, $quoteID, $fileName, $body);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateQuoteAttachmentByFileName: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $quoteID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for an Quote
-my $fileName = xero-dev.jpg; # String | Name of the attachment
-my $body = ::Object::byte[]->new(); # byte[] | 
-
-eval { 
-    my $result = $api_instance->updateQuoteAttachmentByFileName(xeroTenantId => $xeroTenantId, quoteID => $quoteID, fileName => $fileName, body => $body);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateQuoteAttachmentByFileName: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateQuoteAttachmentByFileName

+

Updates a specific attachment from a specific quote by filename

+
+
+
+

+

+

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

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -116705,44 +41187,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateQuoteAttachmentByFileName: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-quote_id = '00000000-0000-0000-0000-000000000000'
-file_name = 'xero-dev.jpg'
-body = File.read('assets/images/xero-api.png')
-begin
-  response = xero_client.accounting_api.update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_quote_attachment_by_file_name: #{e}"
-end
-
-
-
- -

Scopes

- - - - - - - -
accounting.attachmentsGrant read-write access to attachments
- -

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
QuoteID*
+ + + + + + +
accounting.attachmentsGrant read-write access to attachments
+

Parameters

+
Path parameters
+ + + + + + - + -
NameDescription
QuoteID* @@ -116768,7 +41231,7 @@

Parameters

FileName*
FileName* @@ -116791,15 +41254,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -116822,34 +41284,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
body * -
-
- - byte[] - - -
-Byte array of file in body of request -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
body * +
+
+ + byte[] + +
+ Byte array of file in body of request
- - -
-
- - - -
-
-
-
-
-
-

updateReceipt

-

Updates a specific draft expense claim receipts

-
-
-
-

-

-

-
-
/Receipts/{ReceiptID}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}?unitdp=4"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        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);
-
-        try {
-            Receipts result = apiInstance.updateReceipt(accessToken, xeroTenantId, receiptID, receipts, unitdp);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateReceipt");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID receiptID = 00000000-0000-0000-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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateReceipt");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *receiptID = 00000000-0000-0000-0000-000000000000; // Unique identifier for a Receipt (default to null)
-Receipts *receipts = { "Receipts": [ { "Lineitems": [], "User": { "UserID": "00000000-0000-0000-0000-000000000000" }, "Reference": "Foobar" } ] }; // 
-Integer *unitdp = 4; // e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) (default to null)
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific draft expense claim receipts
-[apiInstance updateReceiptWith:xeroTenantId
-    receiptID:receiptID
-    receipts:receipts
-    unitdp:unitdp
-              completionHandler: ^(Receipts output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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 receipts: Receipts = {  
-    receipts: [receipt] }; 
-
-try {
-  const response = await xero.accountingApi.updateReceipt(xeroTenantId, receiptID, receipts,  unitdp);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateReceiptExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var receiptID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var unitdp = 4;
-            var dateValue = DateTime.Now;
-
-            var user = new User();
-            user.UserID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var receipt = new Receipt();
-            receipt.User = user;
-            receipt.Reference = "Foobar";
-            receipt.Date = dateValue;
-
-            var receipts = new Receipts();
-            var receiptsList = new List<Receipt>();
-            receiptsList.Add(receipt); 
-            receipts._Receipts = receiptsList;
-            
-            try {
-                var result = await apiInstance.UpdateReceiptAsync(accessToken, xeroTenantId, receiptID, receipts, unitdp);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateReceipt: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$receiptID = "00000000-0000-0000-0000-000000000000";
-$unitdp = 4;
-$dateValue = new DateTime('2020-12-10');
-
-$user = new XeroAPI\XeroPHP\Models\Accounting\User;
-$user->setUserID('00000000-0000-0000-0000-000000000000');
-
-$receipt = new XeroAPI\XeroPHP\Models\Accounting\Receipt;
-$receipt->setUser($user);
-$receipt->setReference('Foobar');
-$receipt->setDate($dateValue);
-
-$receipts = new XeroAPI\XeroPHP\Models\Accounting\Receipts;
-$arr_receipts = [];
-array_push($arr_receipts, $receipt);
-$receipts->setReceipts($arr_receipts);
-
-try {
-  $result = $apiInstance->updateReceipt($xeroTenantId, $receiptID, $receipts, $unitdp);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateReceipt: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $receiptID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for a Receipt
-my $receipts = ::Object::Receipts->new(); # Receipts | 
-my $unitdp = 4; # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
-
-eval { 
-    my $result = $api_instance->updateReceipt(xeroTenantId => $xeroTenantId, receiptID => $receiptID, receipts => $receipts, unitdp => $unitdp);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateReceipt: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateReceipt

+

Updates a specific draft expense claim receipts

+
+
+
+

+

+

+
+
/Receipts/{ReceiptID}
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -117337,59 +41383,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateReceipt: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-receipt_id = '00000000-0000-0000-0000-000000000000'
-unitdp = 4
-dateValue = 'YYYY-MM-DD'
-
-user = { 
-  user_id: "00000000-0000-0000-0000-000000000000"
-}  
-
-receipt = { 
-  user: user,
-  reference: "Foobar",
-  date: dateValue
-}  
-
-receipts = {  
-  receipts: [receipt]
-} 
-
-begin
-  response = xero_client.accounting_api.update_receipt(xero_tenant_id, receipt_id, receipts, unitdp)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_receipt: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
ReceiptID*
+ + + + + + +
accounting.transactionsGrant read-write access to bank transactions, credit notes, invoices, repeating invoices
+

Parameters

+
Path parameters
+ + + + + + -
NameDescription
ReceiptID* @@ -117415,15 +41427,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -117446,34 +41457,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
receipts * -
-
- - Receipts - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
receipts * +
+
+ + Receipts + +
+
- - -
-
- - -
Query parameters
- - - - - - +} + +
NameDescription
unitdp
+
Query parameters
+ + + + + + -
NameDescription
unitdp @@ -117533,392 +41520,34 @@

Parameters

- -
-
-
-
-
-
-

updateReceiptAttachmentByFileName

-

Updates a specific attachment on a specific expense claim receipts by file name

-
-
-
-

-

-

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

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/Receipts/{ReceiptID}/Attachments/{FileName}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID receiptID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        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);
-
-        try {
-            Attachments result = apiInstance.updateReceiptAttachmentByFileName(accessToken, xeroTenantId, receiptID, fileName, body, mimeType);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateReceiptAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID receiptID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Receipt
-        String fileName = xero-dev.jpg; // String | Name of the attachment
-        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
-        try {
-            Attachments result = apiInstance.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateReceiptAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *receiptID = 00000000-0000-0000-0000-000000000000; // Unique identifier for a Receipt (default to null)
-String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
-byte[] *body = BYTE_ARRAY_DATA_HERE; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific attachment on a specific expense claim receipts by file name
-[apiInstance updateReceiptAttachmentByFileNameWith:xeroTenantId
-    receiptID:receiptID
-    fileName:fileName
-    body:body
-              completionHandler: ^(Attachments output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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
-const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
-const contentType = mime.lookup(fileName);
-
-try {
-  const response = await xero.accountingApi.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, {
-    headers: {
-      "Content-Type": contentType,
-    }
-  });
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateReceiptAttachmentByFileNameExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var receiptID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var fileName = "xero-dev.jpg";
-            byte[] body = System.IO.File.ReadAllBytes(fileName);
-            
-            try {
-                var result = await apiInstance.UpdateReceiptAttachmentByFileNameAsync(accessToken, xeroTenantId, receiptID, fileName, body);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateReceiptAttachmentByFileName: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$receiptID = "00000000-0000-0000-0000-000000000000";
-$fileName = "xero-dev.jpg";
-
-$handle = fopen($fileName, "r");
-$body = fread($handle, filesize($fileName));
-fclose($handle);
-
-try {
-  $result = $apiInstance->updateReceiptAttachmentByFileName($xeroTenantId, $receiptID, $fileName, $body);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateReceiptAttachmentByFileName: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $receiptID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for a Receipt
-my $fileName = xero-dev.jpg; # String | Name of the attachment
-my $body = ::Object::byte[]->new(); # byte[] | 
-
-eval { 
-    my $result = $api_instance->updateReceiptAttachmentByFileName(xeroTenantId => $xeroTenantId, receiptID => $receiptID, fileName => $fileName, body => $body);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateReceiptAttachmentByFileName: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+                  
+                
+
+
+
+
+
+

updateReceiptAttachmentByFileName

+

Updates a specific attachment on a specific expense claim receipts by file name

+
+
+
+

+

+

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

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -117946,44 +41575,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateReceiptAttachmentByFileName: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-receipt_id = '00000000-0000-0000-0000-000000000000'
-file_name = 'xero-dev.jpg'
-body = File.read('assets/images/xero-api.png')
-begin
-  response = xero_client.accounting_api.update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_receipt_attachment_by_file_name: #{e}"
-end
-
-
-
- -

Scopes

- - - - - - - -
accounting.attachmentsGrant read-write access to attachments
- -

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
ReceiptID*
+ + + + + + +
accounting.attachmentsGrant read-write access to attachments
+

Parameters

+
Path parameters
+ + + + + + - + -
NameDescription
ReceiptID* @@ -118009,7 +41619,7 @@

Parameters

FileName*
FileName* @@ -118032,15 +41642,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -118063,34 +41672,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
body * -
-
- - byte[] - - -
-Byte array of file in body of request -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
body * +
+
+ + byte[] + +
+ Byte array of file in body of request
- - -
-
- - - -
-
-
-
-
-
-

updateRepeatingInvoiceAttachmentByFileName

-

Updates a specific attachment from a specific repeating invoices by file name

-
-
-
-

-

-

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

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID repeatingInvoiceID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        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);
-
-        try {
-            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body, mimeType);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateRepeatingInvoiceAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a Repeating Invoice
-        String fileName = xero-dev.jpg; // String | Name of the attachment
-        byte[] body = BYTE_ARRAY_DATA_HERE; // byte[] | 
-        try {
-            Attachments result = apiInstance.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateRepeatingInvoiceAttachmentByFileName");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; // Unique identifier for a Repeating Invoice (default to null)
-String *fileName = xero-dev.jpg; // Name of the attachment (default to null)
-byte[] *body = BYTE_ARRAY_DATA_HERE; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific attachment from a specific repeating invoices by file name
-[apiInstance updateRepeatingInvoiceAttachmentByFileNameWith:xeroTenantId
-    repeatingInvoiceID:repeatingInvoiceID
-    fileName:fileName
-    body:body
-              completionHandler: ^(Attachments output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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
-const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file
-const contentType = mime.lookup(fileName);
-
-try {
-  const response = await xero.accountingApi.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, {
-    headers: {
-      "Content-Type": contentType,
-    }
-  });
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateRepeatingInvoiceAttachmentByFileNameExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var repeatingInvoiceID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var fileName = "xero-dev.jpg";
-            byte[] body = System.IO.File.ReadAllBytes(fileName);
-            
-            try {
-                var result = await apiInstance.UpdateRepeatingInvoiceAttachmentByFileNameAsync(accessToken, xeroTenantId, repeatingInvoiceID, fileName, body);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateRepeatingInvoiceAttachmentByFileName: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$repeatingInvoiceID = "00000000-0000-0000-0000-000000000000";
-$fileName = "xero-dev.jpg";
-
-$handle = fopen($fileName, "r");
-$body = fread($handle, filesize($fileName));
-fclose($handle);
-
-try {
-  $result = $apiInstance->updateRepeatingInvoiceAttachmentByFileName($xeroTenantId, $repeatingInvoiceID, $fileName, $body);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateRepeatingInvoiceAttachmentByFileName: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $repeatingInvoiceID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for a Repeating Invoice
-my $fileName = xero-dev.jpg; # String | Name of the attachment
-my $body = ::Object::byte[]->new(); # byte[] | 
-
-eval { 
-    my $result = $api_instance->updateRepeatingInvoiceAttachmentByFileName(xeroTenantId => $xeroTenantId, repeatingInvoiceID => $repeatingInvoiceID, fileName => $fileName, body => $body);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateRepeatingInvoiceAttachmentByFileName: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateRepeatingInvoiceAttachmentByFileName

+

Updates a specific attachment from a specific repeating invoices by file name

+
+
+
+

+

+

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

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -118538,44 +41764,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateRepeatingInvoiceAttachmentByFileName: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-repeating_invoice_id = '00000000-0000-0000-0000-000000000000'
-file_name = 'xero-dev.jpg'
-body = File.read('assets/images/xero-api.png')
-begin
-  response = xero_client.accounting_api.update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_repeating_invoice_attachment_by_file_name: #{e}"
-end
-
-
-
- -

Scopes

- - - - - - - -
accounting.attachmentsGrant read-write access to attachments
- -

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
RepeatingInvoiceID*
+ + + + + + +
accounting.attachmentsGrant read-write access to attachments
+

Parameters

+
Path parameters
+ + + + + + - + -
NameDescription
RepeatingInvoiceID* @@ -118601,7 +41808,7 @@

Parameters

FileName*
FileName* @@ -118624,15 +41831,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -118655,34 +41861,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
body * -
-
- - byte[] - - -
-Byte array of file in body of request -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
body * +
+
+ + byte[] + +
+ Byte array of file in body of request
- - -
-
- - - -
-
-
-
-
-
-

updateTaxRate

-

Updates tax rates

-
-
-
-

-

-

-
-
/TaxRates
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/TaxRates"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        
-        TaxComponent taxComponent = new TaxComponent();
-        taxComponent.setName("State Tax");
-        taxComponent.setRate(2.25);
-
-        List<TaxComponents> taxComponents = new ArrayList<TaxComponents>();
-        taxComponents.add(taxComponent);
-        
-        TaxRate taxRate = new TaxRate();
-        taxRate.setName("CA State Tax");
-        taxRate.setTaxComponents(taxComponents);
-        
-        TaxRates taxRates = new TaxRates();
-        taxRates.addTaxRatesItem(taxRate);
-
-        try {
-            TaxRates result = apiInstance.updateTaxRate(accessToken, xeroTenantId, taxRates);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateTaxRate");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        TaxRates taxRates = { "TaxRates": [ { "Name": "State Tax NY", "TaxComponents": [ { "Name": "State Tax", "Rate": 2.25 } ], "Status": "DELETED", "ReportTaxType": "INPUT" } ] }; // TaxRates | 
-        try {
-            TaxRates result = apiInstance.updateTaxRate(xeroTenantId, taxRates);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateTaxRate");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-TaxRates *taxRates = { "TaxRates": [ { "Name": "State Tax NY", "TaxComponents": [ { "Name": "State Tax", "Rate": 2.25 } ], "Status": "DELETED", "ReportTaxType": "INPUT" } ] }; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates tax rates
-[apiInstance updateTaxRateWith:xeroTenantId
-    taxRates:taxRates
-              completionHandler: ^(TaxRates output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-const xeroTenantId = 'YOUR_XERO_TENANT_ID';
-
-const taxComponent: TaxComponent = { 
-    name: "State Tax",
-    rate: 2.25 };   
-const taxComponents = [];    
-taxComponents.push(taxComponent)
-
-const taxRate: TaxRate = { 
-    name: "CA State Tax",
-    taxComponents: taxComponents,
-
-const taxRates: TaxRates = {  
-    taxRates: [taxRate] }; 
-
-try {
-  const response = await xero.accountingApi.updateTaxRate(xeroTenantId, taxRates);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateTaxRateExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-
-            var taxComponent = new TaxComponent();
-            taxComponent.Name = "State Tax";
-            taxComponent.Rate = new decimal(2.25);
-            var taxComponents = new List<TaxComponent>();
-            taxComponents.Add(taxComponent);
-
-            var taxRate = new TaxRate();
-            taxRate.Name = "CA State Tax";
-            taxRate.TaxComponents = taxComponents;
-
-            var taxRates = new TaxRates();
-            var taxRatesList = new List<TaxRate>();
-            taxRatesList.Add(taxRate); 
-            taxRates._TaxRates = taxRatesList;
-            
-            try {
-                var result = await apiInstance.UpdateTaxRateAsync(accessToken, xeroTenantId, taxRates);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateTaxRate: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-
-$taxComponent = new XeroAPI\XeroPHP\Models\Accounting\TaxComponent;
-$taxComponent->setName('State Tax');
-$taxComponent->setRate(2.25);
-$taxComponents = [];
-array_push($taxComponents, $taxComponent);
-
-$taxRate = new XeroAPI\XeroPHP\Models\Accounting\TaxRate;
-$taxRate->setName('CA State Tax');
-$taxRate->setTaxComponents($taxComponents);
-
-$taxRates = new XeroAPI\XeroPHP\Models\Accounting\TaxRates;
-$arr_tax_rates = [];
-array_push($arr_tax_rates, $taxRate);
-$taxRates->setTaxRates($arr_tax_rates);
-
-try {
-  $result = $apiInstance->updateTaxRate($xeroTenantId, $taxRates);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateTaxRate: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $taxRates = ::Object::TaxRates->new(); # TaxRates | 
-
-eval { 
-    my $result = $api_instance->updateTaxRate(xeroTenantId => $xeroTenantId, taxRates => $taxRates);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateTaxRate: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateTaxRate

+

Updates tax rates

+
+
+
+

+

+

+
+
/TaxRates
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -119160,58 +41961,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateTaxRate: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-
-tax_component = { 
-  name: "State Tax",
-  rate: 2.25
-}    
-taxComponents = []
-tax_components << tax_component
-
-tax_rate = { 
-  name: "CA State Tax",
-  taxComponents: taxComponents,
-
-taxRates = {  
-  tax_rates: [tax_rate]
-} 
-
-begin
-  response = xero_client.accounting_api.update_tax_rate(xero_tenant_id, taxRates)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_tax_rate: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- - -
Header parameters
- - - - - - + + +

Scopes

+
NameDescription
xero-tenant-id*
+ + + + + + +
accounting.settingsGrant read-write access to organisation and account settings
+

Parameters

+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -119234,34 +42002,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
taxRates * -
-
- - TaxRates - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
taxRates * +
+
+ + TaxRates + +
+
- - -
-
- - - -
-
-
-
-
-
-

updateTrackingCategory

-

Updates a specific tracking category

-
-
-
-

-

-

-
-
/TrackingCategories/{TrackingCategoryID}
-

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        
-        TrackingCategory trackingCategory = new TrackingCategory();
-        trackingCategory.setName("Foobar");
-
-        try {
-            TrackingCategories result = apiInstance.updateTrackingCategory(accessToken, xeroTenantId, trackingCategoryID, trackingCategory);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateTrackingCategory");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID trackingCategoryID = 00000000-0000-0000-0000-000000000000; // UUID | Unique identifier for a TrackingCategory
-        TrackingCategory trackingCategory = { "Name": "Avengers" }; // TrackingCategory | 
-        try {
-            TrackingCategories result = apiInstance.updateTrackingCategory(xeroTenantId, trackingCategoryID, trackingCategory);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateTrackingCategory");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *trackingCategoryID = 00000000-0000-0000-0000-000000000000; // Unique identifier for a TrackingCategory (default to null)
-TrackingCategory *trackingCategory = { "Name": "Avengers" }; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific tracking category
-[apiInstance updateTrackingCategoryWith:xeroTenantId
-    trackingCategoryID:trackingCategoryID
-    trackingCategory:trackingCategory
-              completionHandler: ^(TrackingCategories output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateTrackingCategoryExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var trackingCategoryID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var trackingCategory = new TrackingCategory();
-            trackingCategory.Name = "Foobar";
-            
-            try {
-                var result = await apiInstance.UpdateTrackingCategoryAsync(accessToken, xeroTenantId, trackingCategoryID, trackingCategory);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateTrackingCategory: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$trackingCategoryID = "00000000-0000-0000-0000-000000000000";
-
-$trackingCategory = new XeroAPI\XeroPHP\Models\Accounting\TrackingCategory;
-$trackingCategory->setName('Foobar');
-
-try {
-  $result = $apiInstance->updateTrackingCategory($xeroTenantId, $trackingCategoryID, $trackingCategory);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateTrackingCategory: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $trackingCategoryID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for a TrackingCategory
-my $trackingCategory = ::Object::TrackingCategory->new(); # TrackingCategory | 
-
-eval { 
-    my $result = $api_instance->updateTrackingCategory(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID, trackingCategory => $trackingCategory);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateTrackingCategory: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateTrackingCategory

+

Updates a specific tracking category

+
+
+
+

+

+

+
+
/TrackingCategories/{TrackingCategoryID}
+

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -119690,47 +42091,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateTrackingCategory: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-tracking_category_id = '00000000-0000-0000-0000-000000000000'
-
-trackingCategory = { 
-  name: "Foobar"
-}  
-
-begin
-  response = xero_client.accounting_api.update_tracking_category(xero_tenant_id, tracking_category_id, trackingCategory)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_tracking_category: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
TrackingCategoryID*
+ + + + + + +
accounting.settingsGrant read-write access to organisation and account settings
+

Parameters

+
Path parameters
+ + + + + + -
NameDescription
TrackingCategoryID* @@ -119756,15 +42135,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -119787,34 +42165,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
trackingCategory * -
-
- - TrackingCategory - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
trackingCategory * +
+
+ + TrackingCategory + +
+
- - -
-
- - - -
-
-
-
-
-
-

updateTrackingOptions

-

Updates a specific option for a specific tracking category

-
-
-
-

-

-

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

-

Usage and SDK Samples

-

- - -
-
-
curl -X  "https://api.xero.com/api.xro/2.0/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}"
-
-
-
import org.openapitools.client.api.*;
-import org.openapitools.client.api.client.AccountingApi;
-import org.openapitools.client.models.accounting.*;
-
-import java.io.File;
-import java.util.*;
-
-public class AccountingApiExample {
-    private AccountingApi apiInstance;
-    
-    public static void main(String[] args) {
-        String accessToken = "YOUR_ACCESS_TOKEN";
-        ApiClient defaultClient = new ApiClient();
-
-        apiInstance = AccountingApi.getInstance(defaultClient);
-        String xeroTenantId = 'YOUR_XERO_TENANT_ID';
-        UUID trackingCategoryID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        UUID trackingOptionID = UUID.fromString("00000000-0000-0000-0000-000000000000");
-        
-        TrackingOption trackingOption = new TrackingOption();
-        trackingOption.setName("Foobar");
-
-        try {
-            TrackingOptions result = apiInstance.updateTrackingOptions(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
-            System.out.println(result);
-        } catch (XeroException e) {
-            System.err.println("Exception when calling AccountingApi#updateTrackingOptions");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
import org.openapitools.client.api.AccountingApi;
-
-public class AccountingApiExample {
-
-    public static void main(String[] args) {
-        AccountingApi apiInstance = new AccountingApi();
-        String xeroTenantId = YOUR_XERO_TENANT_ID; // String | Xero identifier for Tenant
-        UUID trackingCategoryID = 00000000-0000-0000-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);
-            System.out.println(result);
-        } catch (ApiException e) {
-            System.err.println("Exception when calling AccountingApi#updateTrackingOptions");
-            e.printStackTrace();
-        }
-    }
-}
-
- -
-
Configuration *apiConfig = [Configuration sharedConfig];
-
-// Configure OAuth2 access token for authorization: (authentication scheme: OAuth2)
-[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
-
-String *xeroTenantId = YOUR_XERO_TENANT_ID; // Xero identifier for Tenant (default to null)
-UUID *trackingCategoryID = 00000000-0000-0000-0000-000000000000; // Unique identifier for a TrackingCategory (default to null)
-UUID *trackingOptionID = 00000000-0000-0000-0000-000000000000; // Unique identifier for a Tracking Option (default to null)
-TrackingOption *trackingOption = { name: "Vision" }; // 
-
-AccountingApi *apiInstance = [[AccountingApi alloc] init];
-
-// Updates a specific option for a specific tracking category
-[apiInstance updateTrackingOptionsWith:xeroTenantId
-    trackingCategoryID:trackingCategoryID
-    trackingOptionID:trackingOptionID
-    trackingOption:trackingOption
-              completionHandler: ^(TrackingOptions output, NSError* error) {
-                            if (output) {
-                                NSLog(@"%@", output);
-                            }
-                            if (error) {
-                                NSLog(@"Error: %@", error);
-                            }
-                        }];
-
-
- -
-
await xero.setTokenSet(tokenSet);
-
-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);
-  console.log(response.body || response.response.statusCode)
-} catch (err) {
-  const error = JSON.stringify(err.response.body, null, 2)
-  console.log(`Status Code: ${err.response.statusCode} => ${error}`);
-}
-
- - -
-
using System;
-using System.Diagnostics;
-using Xero.NetStandard.OAuth2.Api;
-using Xero.NetStandard.OAuth2.Client;
-using Xero.NetStandard.OAuth2.Model;
-
-namespace Example
-{
-    public class UpdateTrackingOptionsExample
-    {
-        public async Task Main()
-        {            
-            var accessToken = "YOUR_ACCESS_TOKEN";          
-            var apiInstance = new AccountingApi();
-            var xeroTenantId = "YOUR_XERO_TENANT_ID";
-            var trackingCategoryID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-            var trackingOptionID = Guid.Parse("00000000-0000-0000-0000-000000000000");
-
-            var trackingOption = new TrackingOption();
-            trackingOption.Name = "Foobar";
-            
-            try {
-                var result = await apiInstance.UpdateTrackingOptionsAsync(accessToken, xeroTenantId, trackingCategoryID, trackingOptionID, trackingOption);
-                Console.WriteLine(result);
-            }
-            catch (Exception e)
-            {
-                Console.WriteLine("Exception when calling apiInstance.UpdateTrackingOptions: " + e.Message );
-            }
-        }
-    }
-}
-
- -
-
<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );       
-
-$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
-    new GuzzleHttp\Client(),
-    $config
-);
-$xeroTenantId = "YOUR_XERO_TENANT_ID";
-$trackingCategoryID = "00000000-0000-0000-0000-000000000000";
-$trackingOptionID = "00000000-0000-0000-0000-000000000000";
-
-$trackingOption = new XeroAPI\XeroPHP\Models\Accounting\TrackingOption;
-$trackingOption->setName('Foobar');
-
-try {
-  $result = $apiInstance->updateTrackingOptions($xeroTenantId, $trackingCategoryID, $trackingOptionID, $trackingOption);
-} catch (Exception $e) {
-  echo 'Exception when calling AccountingApi->updateTrackingOptions: ', $e->getMessage(), PHP_EOL;
 }
-?>
-
-
- -
-
use Data::Dumper;
-use ::Configuration;
-use ::AccountingApi;
-
-# Configure OAuth2 access token for authorization: OAuth2
-$::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
-
-my $api_instance = ::AccountingApi->new();
-my $xeroTenantId = YOUR_XERO_TENANT_ID; # String | Xero identifier for Tenant
-my $trackingCategoryID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for a TrackingCategory
-my $trackingOptionID = 00000000-0000-0000-0000-000000000000; # UUID | Unique identifier for a Tracking Option
-my $trackingOption = ::Object::TrackingOption->new(); # TrackingOption | 
-
-eval { 
-    my $result = $api_instance->updateTrackingOptions(xeroTenantId => $xeroTenantId, trackingCategoryID => $trackingCategoryID, trackingOptionID => $trackingOptionID, trackingOption => $trackingOption);
-    print Dumper($result);
-};
-if ($@) {
-    warn "Exception when calling AccountingApi->updateTrackingOptions: $@\n";
-}
-
- -
-
# configure api_client for use with xero-python sdk client
+    
+                  
+                
+
+
+
+
+
+

updateTrackingOptions

+

Updates a specific option for a specific tracking category

+
+
+
+

+

+

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

+

Usage and SDK Samples

+

+ +
+ +
+
# configure api_client for use with xero-python sdk client
 api_client = ApiClient(
     Configuration(
         debug=false,
@@ -120252,48 +42255,25 @@ 

Usage and SDK Samples

print(api_response) except AccountingBadRequestException as e: print("Exception when calling AccountingApi->updateTrackingOptions: %s\n" % e)
-
- -
-
xero_client.set_token_set(user.token_set)
-
-xero_tenant_id = 'YOUR_XERO_TENANT_ID'
-tracking_category_id = '00000000-0000-0000-0000-000000000000'
-tracking_option_id = '00000000-0000-0000-0000-000000000000'
-
-trackingOption = { 
-  name: "Foobar"
-}  
-
-begin
-  response = xero_client.accounting_api.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, trackingOption)
-  return response
-rescue XeroRuby::ApiError => e
-  puts "Exception when calling update_tracking_options: #{e}"
-end
-
-
-
- -

Scopes

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

Parameters

- -
Path parameters
- - - - - - + + +

Scopes

+
NameDescription
TrackingCategoryID*
+ + + + + + +
accounting.settingsGrant read-write access to organisation and account settings
+

Parameters

+
Path parameters
+ + + + + + - + -
NameDescription
TrackingCategoryID* @@ -120319,7 +42299,7 @@

Parameters

TrackingOptionID*
TrackingOptionID* @@ -120345,15 +42325,14 @@

Parameters

- -
Header parameters
- - - - - - +
NameDescription
xero-tenant-id*
+
Header parameters
+ + + + + + -
NameDescription
xero-tenant-id* @@ -120376,34 +42355,31 @@

Parameters

- -
Body parameters
- - - - - - -
NameDescription
trackingOption * -
-
- - TrackingOption - - -
- -
-
-
- Required -
+
+
Body parameters
+ + + + + + + + - - -
NameDescription
trackingOption * +
+
+ + TrackingOption + +
+
- - -
-
- - - -
-
-
- +} + + + +
+
+
+
-
- - - - - - - - + + + diff --git a/setup.py b/setup.py index a7204076..0b9c535b 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,5 @@ def read_file(filename): keywords="xero python sdk API oAuth", name="xero_python", packages=find_packages(include=["xero_python", "xero_python.*"]), - version="1.5.3b1", + version="1.5.3", ) diff --git a/xero_python/__init__.py b/xero_python/__init__.py index 3f31ce20..6c68a2b9 100644 --- a/xero_python/__init__.py +++ b/xero_python/__init__.py @@ -2,4 +2,4 @@ __author__ = """Xero Developer API""" __email__ = "api@xero.com" -__version__ = "1.5.3b1" +__version__ = "1.5.3" diff --git a/xero_python/api_client/oauth2.py b/xero_python/api_client/oauth2.py index ef382eb6..7f7e41a5 100644 --- a/xero_python/api_client/oauth2.py +++ b/xero_python/api_client/oauth2.py @@ -50,7 +50,7 @@ def refresh_token(self, refresh_token, scope): ) # todo validate response is json return self.parse_token_response(response) - + def revoke_token(self, refresh_token): """ Call xero identity API to revoke access tokens and remove all a user's connections using refresh token diff --git a/xero_python/docs/README.md b/xero_python/docs/README.md index de440787..7f7c8d1f 100644 --- a/xero_python/docs/README.md +++ b/xero_python/docs/README.md @@ -4,7 +4,7 @@ These endpoints are related to managing authentication tokens and identity for X The `xero_python` package is automatically generated by the [XeroAPI SDK 2.0 Codegen](https://github.com/xero-github/xeroapi-sdk-codegen) project: - API version: 2.10.4 -- Package version: 1.5.3b1 +- Package version: 1.5.3 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://developer.xero.com](https://developer.xero.com)