Xero Accounting API

Accounting

createAccount

Creates a new chart of accounts


/Accounts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

account = { 
  code: "123456",
  name: "FooBar",
  type:  XeroRuby::Accounting::AccountType::EXPENSE,
  description: "Hello World"
}  

begin
  response = xero_client.accounting_api.create_account(xero_tenant_id, account, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_account: #{e}"
end

Scopes

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

Parameters

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

createAccountAttachmentByFileName

Creates an attachment on a specific account


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_account_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createBankTransactionAttachmentByFileName

Creates an attachment for a specific bank transaction by filename


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_bank_transaction_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createBankTransactionHistoryRecord

Creates a history record for a specific bank transactions


/BankTransactions/{BankTransactionID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_bank_transaction_history_record: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBankTransactions

Creates one or more spent or received money transaction


/BankTransactions

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'

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

bank_account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

bank_transaction = { 
  type:  XeroRuby::Accounting::BankTransaction::RECEIVE,
  contact: contact,
  lineItems: lineItems,
  bank_account:  bank_account
}  

bankTransactions = {  
  bank_transactions: [bank_transaction]
} 

begin
  response = xero_client.accounting_api.create_bank_transactions(xero_tenant_id, bankTransactions, summarize_errors, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_bank_transactions: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
bankTransactions *
BankTransactions
BankTransactions with an array of BankTransaction objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createBankTransfer

Creates a bank transfer


/BankTransfers

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

fromBankAccount = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

toBankAccount = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

bank_transfer = { 
  from_bank_account: fromBankAccount,
  to_bank_account: toBankAccount,
  amount: 1.0
}  

bankTransfers = {  
  bank_transfers: [bank_transfer]
} 

begin
  response = xero_client.accounting_api.create_bank_transfer(xero_tenant_id, bankTransfers, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_bank_transfer: #{e}"
end

Scopes

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

Parameters

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

createBankTransferAttachmentByFileName


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_bank_transfer_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

createBankTransferHistoryRecord

Creates a history record for a specific bank transfer


/BankTransfers/{BankTransferID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_bank_transfer_history_record: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBatchPayment

Creates one or many batch payments for invoices


/BatchPayments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
curr_date = 'YYYY-MM-DD'

payment_account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

bank_account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

invoice = { 
  invoice_id: "00000000-0000-0000-0000-000000000000"
}  

payment = { 
  account:  bank_account,
  date:  curr_date,
  amount: 1.0,
  invoice: invoice
}    
payments = []
payments << payment

batch_payment = { 
  account:  payment_account,
  reference: "hello foobar",
  date:  curr_date,
  payments: payments
}  

batchPayments = {  
  batch_payments: [batch_payment]
} 

begin
  response = xero_client.accounting_api.create_batch_payment(xero_tenant_id, batchPayments, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_batch_payment: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
batchPayments *
BatchPayments
BatchPayments with an array of Payments in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createBatchPaymentHistoryRecord

Creates a history record for a specific batch payment


/BatchPayments/{BatchPaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
batch_payment_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_batch_payment_history_record: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
BatchPaymentID*
UUID (uuid)
Unique identifier for BatchPayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createBrandingThemePaymentServices

Creates a new custom payment service for a specific branding theme


/BrandingThemes/{BrandingThemeID}/PaymentServices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
branding_theme_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

payment_service = { 
  payment_service_id: "00000000-0000-0000-0000-000000000000",
  payment_service_name: "ACME Payments",
  payment_service_url: "https://www.payupnow.com/",
  pay_now_text: "Pay Now"
}  

paymentServices = {  
  paymentServices: [paymentService]
} 

begin
  response = xero_client.accounting_api.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, paymentServices, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_branding_theme_payment_services: #{e}"
end

Scopes

paymentservices Grant read-write access to payment services

Parameters

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

createContactAttachmentByFileName


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_contact_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createContactGroup

Creates a contact group


/ContactGroups

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

contact_group = { 
  name: "VIPs"
}  

contactGroups = {  
  contact_groups: [contact_group]
} 

begin
  response = xero_client.accounting_api.create_contact_group(xero_tenant_id, contactGroups, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_contact_group: #{e}"
end

Scopes

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

Parameters

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

createContactGroupContacts

Creates contacts to a specific contact group


/ContactGroups/{ContactGroupID}/Contacts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_group_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

contact = { 
  contact_id: "00000000-0000-0000-0000-000000000000"
}  

contacts = {  
  contacts: [contact]
} 

begin
  response = xero_client.accounting_api.create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_contact_group_contacts: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contacts *
Contacts
Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request
Required

createContactHistory

Creates a new history record for a specific contact


/Contacts/{ContactID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_contact_history(xero_tenant_id, contact_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_contact_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createContacts

Creates multiple contacts (bulk) in a Xero organisation


/Contacts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'

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.create_contacts(xero_tenant_id, contacts, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_contacts: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contacts *
Contacts
Contacts with an array of Contact objects to create in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createCreditNoteAllocation

Creates allocation for a specific credit note


/CreditNotes/{CreditNoteID}/Allocations

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
curr_date = 'YYYY-MM-DD'

invoice = { 
  invoiceID: "00000000-0000-0000-0000-000000000000"
}  

allocation = { 
  amount: 1.0,
  date:  curr_date,
  invoice: invoice
}  

allocations = {  
  allocations: [allocation]
} 

begin
  response = xero_client.accounting_api.create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_credit_note_allocation: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
allocations *
Allocations
Allocations with array of Allocation object in body of request.
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createCreditNoteAttachmentByFileName

Creates an attachment for a specific credit note


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
include_online = true
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, include_online, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_credit_note_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required
Query parameters
Name Description
IncludeOnline
Boolean
Allows an attachment to be seen by the end customer within their online invoice

createCreditNoteHistory

Retrieves history records of a specific credit note


/CreditNotes/{CreditNoteID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_credit_note_history(xero_tenant_id, credit_note_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_credit_note_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createCreditNotes

Creates a new credit note


/CreditNotes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'
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.create_credit_notes(xero_tenant_id, creditNotes, summarize_errors, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_credit_notes: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
creditNotes *
CreditNotes
Credit Notes with array of CreditNote object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createCurrency

Create a new currency for a Xero organisation


/Currencies

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

currency = { 
  code:  XeroRuby::Accounting::CurrencyCode::USD,
  description: "United States Dollar"
}  

begin
  response = xero_client.accounting_api.create_currency(xero_tenant_id, currency, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_currency: #{e}"
end

Scopes

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

Parameters

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

createEmployees

Creates new employees used in Xero payrun


/Employees

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'

employee = { 
  first_name: "Nick",
  last_name: "Fury"
}  

employees = {  
  employees: [employee]
} 

begin
  response = xero_client.accounting_api.create_employees(xero_tenant_id, employees, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_employees: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employees *
Employees
Employees with array of Employee object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createExpenseClaimHistory

Creates a history record for a specific expense claim


/ExpenseClaims/{ExpenseClaimID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
expense_claim_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_expense_claim_history(xero_tenant_id, expense_claim_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_expense_claim_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ExpenseClaimID*
UUID (uuid)
Unique identifier for a ExpenseClaim
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createExpenseClaims

Creates expense claims


/ExpenseClaims

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'
curr_date = 'YYYY-MM-DD'

user = { 
  user_id: "00000000-0000-0000-0000-000000000000"
}  

receipt = { 
  receipt_id: "00000000-0000-0000-0000-000000000000",
  date:  curr_date
}    
receipts = []
receipts << receipt

expense_claim = { 
  status:  XeroRuby::Accounting::ExpenseClaim::SUBMITTED,
  user: user,
  receipts: receipts
}  

expenseClaims = {  
  expense_claims: [expense_claim]
} 

begin
  response = xero_client.accounting_api.create_expense_claims(xero_tenant_id, expenseClaims, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_expense_claims: #{e}"
end

Scopes

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

Parameters

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

createInvoiceAttachmentByFileName

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
include_online = true
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, include_online, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_invoice_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required
Query parameters
Name Description
IncludeOnline
Boolean
Allows an attachment to be seen by the end customer within their online invoice

createInvoiceHistory

Creates a history record for a specific invoice


/Invoices/{InvoiceID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_invoice_history(xero_tenant_id, invoice_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_invoice_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createInvoices

Creates one or more sales invoices or purchase bills


/Invoices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'
date_value = 'YYYY-MM-DD'
due_date_value = 'YYYY-MM-DD'

contact = { 
  contact_id: "00000000-0000-0000-0000-000000000000"
}  

line_item_tracking = { 
  tracking_category_id: "00000000-0000-0000-0000-000000000000",
  tracking_option_id: "00000000-0000-0000-0000-000000000000"
}    
line_item_trackings = []
line_item_trackings << line_item_tracking

line_item = { 
  description: "Foobar",
  quantity: 1.0,
  unit_amount: 20.0,
  account_code: "000",
  tracking: lineItemTrackings
}    
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.create_invoices(xero_tenant_id, invoices, summarize_errors, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_invoices: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
invoices *
Invoices
Invoices with an array of invoice objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createItemHistory

Creates a history record for a specific item


/Items/{ItemID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
item_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_item_history(xero_tenant_id, item_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_item_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createItems

Creates one or more items


/Items

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'

purchase_details = { 
  cogs_account_code: "500"
}  

item = { 
  code: "abcXYZ123",
  name: "HelloWorld",
  description: "Foobar",
  inventory_asset_account_code: "140",
  purchase_details:  purchase_details
}  

items = {  
  items: [item]
} 

begin
  response = xero_client.accounting_api.create_items(xero_tenant_id, items, summarize_errors, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_items: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
items *
Items
Items with an array of Item objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createLinkedTransaction

Creates linked transactions (billable expenses)


/LinkedTransactions

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

linked_transaction = { 
  source_transaction_id: "00000000-0000-0000-0000-000000000000",
  source_line_item_id: "00000000-0000-0000-0000-000000000000"
}  

begin
  response = xero_client.accounting_api.create_linked_transaction(xero_tenant_id, linkedTransaction, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_linked_transaction: #{e}"
end

Scopes

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

Parameters

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

createManualJournalAttachmentByFileName

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_manual_journal_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createManualJournalHistoryRecord

Creates a history record for a specific manual journal


/ManualJournals/{ManualJournalID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_manual_journal_history_record(xero_tenant_id, manual_journal_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_manual_journal_history_record: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createManualJournals

Creates one or more manual journals


/ManualJournals

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
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.create_manual_journals(xero_tenant_id, manualJournals, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_manual_journals: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
manualJournals *
ManualJournals
ManualJournals array with ManualJournal object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createOverpaymentAllocations

Creates a single allocation for a specific overpayment


/Overpayments/{OverpaymentID}/Allocations

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
overpayment_id = '00000000-0000-0000-0000-000000000000'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
curr_date = 'YYYY-MM-DD'

invoice = { 
  invoice_id: "00000000-0000-0000-0000-000000000000"
}  

allocation = { 
  amount: 1.0,
  date:  curr_date,
  invoice: invoice
}  

allocations = {  
  allocations: [allocation]
} 

begin
  response = xero_client.accounting_api.create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_overpayment_allocations: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
allocations *
Allocations
Allocations array with Allocation object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createOverpaymentHistory

Creates a history record for a specific overpayment


/Overpayments/{OverpaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
overpayment_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_overpayment_history(xero_tenant_id, overpayment_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_overpayment_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPayment

Creates a single payment for invoice or credit notes


/Payments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'
date_value = 'YYYY-MM-DD'

invoice = { 
  invoice_id: "00000000-0000-0000-0000-000000000000"
}  

account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

payment = { 
  invoice: invoice,
  account: account,
  amount: 1.0,
  date:  date_value
}  

payments = {  
  payments: [payment]
} 

begin
  response = xero_client.accounting_api.create_payment(xero_tenant_id, payment, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_payment: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payment *
Payment
Request body with a single Payment object
Required

createPaymentHistory

Creates a history record for a specific payment


/Payments/{PaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
payment_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_payment_history(xero_tenant_id, payment_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_payment_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
PaymentID*
UUID (uuid)
Unique identifier for a Payment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPaymentService

Creates a payment service


/PaymentServices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

payment_service = { 
  payment_service_name: "ACME Payments",
  payment_service_url: "https://www.payupnow.com/",
  pay_now_text: "Pay Now"
}  

paymentServices = {  
  paymentServices: [paymentService]
} 

begin
  response = xero_client.accounting_api.create_payment_service(xero_tenant_id, paymentServices, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_payment_service: #{e}"
end

Scopes

paymentservices Grant read-write access to payment services

Parameters

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

createPayments

Creates multiple payments for invoices or credit notes


/Payments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
date_value = 'YYYY-MM-DD'

invoice = { 
  invoice_id: "00000000-0000-0000-0000-000000000000"
}  

account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

payment = { 
  invoice: invoice,
  account: account,
  amount: 1.0,
  date:  date_value
}  

payments = {  
  payments: [payment]
} 

begin
  response = xero_client.accounting_api.create_payments(xero_tenant_id, payments, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_payments: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
payments *
Payments
Payments array with Payment object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createPrepaymentAllocations

Allows you to create an Allocation for prepayments


/Prepayments/{PrepaymentID}/Allocations

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
prepayment_id = '00000000-0000-0000-0000-000000000000'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
curr_date = 'YYYY-MM-DD'

invoice = { 
  invoice_id: "00000000-0000-0000-0000-000000000000"
}  

allocation = { 
  invoice: invoice,
  amount: 1.0,
  date:  curr_date
}  

allocations = {  
  allocations: [allocation]
} 

begin
  response = xero_client.accounting_api.create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_prepayment_allocations: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for a PrePayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
allocations *
Allocations
Allocations with an array of Allocation object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createPrepaymentHistory

Creates a history record for a specific prepayment


/Prepayments/{PrepaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
prepayment_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_prepayment_history(xero_tenant_id, prepayment_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_prepayment_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for a PrePayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createPurchaseOrderAttachmentByFileName

Creates attachment for a specific purchase order


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_purchase_order_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createPurchaseOrderHistory

Creates a history record for a specific purchase orders


/PurchaseOrders/{PurchaseOrderID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_purchase_order_history(xero_tenant_id, purchase_order_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_purchase_order_history: #{e}"
end

Scopes

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

Parameters

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

createPurchaseOrders

Creates one or more purchase orders


/PurchaseOrders

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
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.create_purchase_orders(xero_tenant_id, purchaseOrders, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_purchase_orders: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
PurchaseOrders with an array of PurchaseOrder object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createQuoteAttachmentByFileName

Creates attachment for a specific quote


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_quote_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createQuoteHistory

Creates a history record for a specific quote


/Quotes/{QuoteID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_quote_history(xero_tenant_id, quote_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_quote_history: #{e}"
end

Scopes

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

Parameters

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

createQuotes

Create one or more quotes


/Quotes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
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.create_quotes(xero_tenant_id, quotes, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_quotes: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
quotes *
Quotes
Quotes with an array of Quote object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createReceipt

Creates draft expense claim receipts for any user


/Receipts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
unitdp = 4
idempotency_key = 'KEY_VALUE'

contact = { 
  contact_id: "00000000-0000-0000-0000-000000000000"
}  

user = { 
  user_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

receipt = { 
  contact: contact,
  user: user,
  line_items:  line_items,
  line_amount_types:  XeroRuby::Accounting::INCLUSIVE,
  status:  XeroRuby::Accounting::Receipt::DRAFT
}  

receipts = {  
  receipts: [receipt]
} 

begin
  response = xero_client.accounting_api.create_receipt(xero_tenant_id, receipts, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_receipt: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
receipts *
Receipts
Receipts with an array of Receipt object in body of request
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

createReceiptAttachmentByFileName

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


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_receipt_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createReceiptHistory

Creates a history record for a specific receipt


/Receipts/{ReceiptID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
receipt_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_receipt_history(xero_tenant_id, receipt_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_receipt_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createRepeatingInvoiceAttachmentByFileName

Creates an attachment from a specific repeating invoices by file name


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_repeating_invoice_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

createRepeatingInvoiceHistory

Creates a history record for a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
repeating_invoice_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

history_record = { 
  details: "Hello World"
}  

historyRecords = {  
  history_records: [history_record]
} 

begin
  response = xero_client.accounting_api.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, historyRecords, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_repeating_invoice_history: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
historyRecords *
HistoryRecords
HistoryRecords containing an array of HistoryRecord objects in body of request
Required

createRepeatingInvoices

Creates one or more repeating invoice templates


/RepeatingInvoices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.create_repeating_invoices(xero_tenant_id, repeatingInvoices, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_repeating_invoices: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
repeatingInvoices *
RepeatingInvoices
RepeatingInvoices with an array of repeating invoice objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

createTaxRates

Creates one or more tax rates


/TaxRates

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

tax_component = { 
  name: "State Tax",
  rate: 2.25
}    
taxComponent = []
tax_components << tax_component

tax_rate = { 
  name: "CA State Tax",
  taxComponents: taxComponents,

taxRates = {  
  tax_rates: [tax_rate]
} 

begin
  response = xero_client.accounting_api.create_tax_rates(xero_tenant_id, taxRates, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_tax_rates: #{e}"
end

Scopes

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

Parameters

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

createTrackingCategory

Create tracking categories


/TrackingCategories

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

trackingCategory = { 
  name: "Foobar"
}  

begin
  response = xero_client.accounting_api.create_tracking_category(xero_tenant_id, trackingCategory, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_tracking_category: #{e}"
end

Scopes

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

Parameters

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

createTrackingOptions

Creates options for a specific tracking category


/TrackingCategories/{TrackingCategoryID}/Options

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
tracking_category_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

trackingOption = { 
  name: "Foobar"
}  

begin
  response = xero_client.accounting_api.create_tracking_options(xero_tenant_id, tracking_category_id, trackingOption, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling create_tracking_options: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingOption *
TrackingOption
TrackingOption object in body of request
Required

deleteAccount

Deletes a chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_account(xero_tenant_id, account_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_account: #{e}"
end

Scopes

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

Parameters

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

deleteBatchPayment

Updates a specific batch payment for invoices and credit notes


/BatchPayments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

batchPaymentDelete = { 
  status: "DELETED"
}  
  batch_payment_id: "00000000-0000-0000-0000-000000000000"
}  

begin
  response = xero_client.accounting_api.delete_batch_payment(xero_tenant_id, batchPaymentDelete, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_batch_payment: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
batchPaymentDelete *
BatchPaymentDelete
Required

deleteBatchPaymentByUrlParam

Updates a specific batch payment for invoices and credit notes


/BatchPayments/{BatchPaymentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
batch_payment_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.delete_batch_payment_by_url_param(xero_tenant_id, batch_payment_id, batchPaymentDeleteByUrlParam, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_batch_payment_by_url_param: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
BatchPaymentID*
UUID (uuid)
Unique identifier for BatchPayment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
batchPaymentDeleteByUrlParam *
BatchPaymentDeleteByUrlParam
Required

deleteContactGroupContact

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_group_id = '00000000-0000-0000-0000-000000000000'
contact_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_contact_group_contact: #{e}"
end

Scopes

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

Parameters

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

deleteContactGroupContacts

Deletes all contacts from a specific contact group


/ContactGroups/{ContactGroupID}/Contacts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_group_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_contact_group_contacts(xero_tenant_id, contact_group_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_contact_group_contacts: #{e}"
end

Scopes

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

Parameters

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

deleteCreditNoteAllocations

Deletes an Allocation from a Credit Note


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
allocation_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_credit_note_allocations(xero_tenant_id, credit_note_id, allocation_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_credit_note_allocations: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
AllocationID*
UUID (uuid)
Unique identifier for Allocation object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteItem

Deletes a specific item


/Items/{ItemID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
item_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_item(xero_tenant_id, item_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_item: #{e}"
end

Scopes

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

Parameters

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

deleteLinkedTransaction

Deletes a specific linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
linked_transaction_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_linked_transaction(xero_tenant_id, linked_transaction_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_linked_transaction: #{e}"
end

Scopes

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

Parameters

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

deleteOverpaymentAllocations

Deletes an Allocation from an overpayment


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
overpayment_id = '00000000-0000-0000-0000-000000000000'
allocation_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_overpayment_allocations(xero_tenant_id, overpayment_id, allocation_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_overpayment_allocations: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
OverpaymentID*
UUID (uuid)
Unique identifier for a Overpayment
Required
AllocationID*
UUID (uuid)
Unique identifier for Allocation object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deletePayment

Updates a specific payment for invoices and credit notes


/Payments/{PaymentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
payment_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

paymentDelete = { 
  status: "DELETED"
}  

begin
  response = xero_client.accounting_api.delete_payment(xero_tenant_id, payment_id, paymentDelete, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_payment: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
PaymentID*
UUID (uuid)
Unique identifier for a Payment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
paymentDelete *
PaymentDelete
Required

deletePrepaymentAllocations

Deletes an Allocation from a Prepayment


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
prepayment_id = '00000000-0000-0000-0000-000000000000'
allocation_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_prepayment_allocations(xero_tenant_id, prepayment_id, allocation_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_prepayment_allocations: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
PrepaymentID*
UUID (uuid)
Unique identifier for a PrePayment
Required
AllocationID*
UUID (uuid)
Unique identifier for Allocation object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

deleteTrackingCategory

Deletes a specific tracking category


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
tracking_category_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.delete_tracking_category(xero_tenant_id, tracking_category_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_tracking_category: #{e}"
end

Scopes

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

Parameters

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

deleteTrackingOptions

Deletes a specific option for a specific tracking category


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

Usage and SDK Samples

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'

begin
  response = xero_client.accounting_api.delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling delete_tracking_options: #{e}"
end

Scopes

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

Parameters

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

emailInvoice

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


/Invoices/{InvoiceID}/Email

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

requestEmpty = { }

begin
  response = xero_client.accounting_api.email_invoice(xero_tenant_id, invoice_id, requestEmpty, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling email_invoice: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
requestEmpty *
RequestEmpty
Required

getAccount

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


/Accounts/{AccountID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_account(xero_tenant_id, account_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_account: #{e}"
end

Scopes

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

Parameters

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

getAccountAttachmentByFileName

Retrieves an attachment for a specific account by filename


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_account_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getAccountAttachmentById

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_account_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getAccountAttachments

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


/Accounts/{AccountID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_account_attachments(xero_tenant_id, account_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_account_attachments: #{e}"
end

Scopes

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

Parameters

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

getAccounts

Retrieves the full chart of accounts


/Accounts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Account::ACTIVE}'
order = 'Name ASC'

begin
  response = xero_client.accounting_api.get_accounts(xero_tenant_id, if_modified_since, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_accounts: #{e}"
end

Scopes

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

Parameters

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

getBankTransaction

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


/BankTransactions/{BankTransactionID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4

begin
  response = xero_client.accounting_api.get_bank_transaction(xero_tenant_id, bank_transaction_id, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transaction: #{e}"
end

Scopes

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

Parameters

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

getBankTransactionAttachmentByFileName

Retrieves a specific attachment from a specific bank transaction by filename


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transaction_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getBankTransactionAttachmentById

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transaction_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getBankTransactionAttachments

Retrieves any attachments from a specific bank transactions


/BankTransactions/{BankTransactionID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transaction_attachments: #{e}"
end

Scopes

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

Parameters

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

getBankTransactions

Retrieves any spent or received money transactions


/BankTransactions

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::BankTransaction::AUTHORISED}'
order = 'Type ASC'
page = 1
unitdp = 4
pageSize = 100

begin
  response = xero_client.accounting_api.get_bank_transactions(xero_tenant_id, if_modified_since, where, order, page, unitdp, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transactions: #{e}"
end

Scopes

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

Parameters

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

getBankTransactionsHistory

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


/BankTransactions/{BankTransactionID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_bank_transactions_history(xero_tenant_id, bank_transaction_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transactions_history: #{e}"
end

Scopes

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

Parameters

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

getBankTransfer

Retrieves specific bank transfers by using a unique bank transfer Id


/BankTransfers/{BankTransferID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_bank_transfer(xero_tenant_id, bank_transfer_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transfer: #{e}"
end

Scopes

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

Parameters

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

getBankTransferAttachmentByFileName

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transfer_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getBankTransferAttachmentById

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transfer_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getBankTransferAttachments

Retrieves attachments from a specific bank transfer


/BankTransfers/{BankTransferID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transfer_attachments: #{e}"
end

Scopes

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

Parameters

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

getBankTransferHistory

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


/BankTransfers/{BankTransferID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_bank_transfer_history(xero_tenant_id, bank_transfer_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transfer_history: #{e}"
end

Scopes

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

Parameters

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

getBankTransfers

Retrieves all bank transfers


/BankTransfers

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'HasAttachments==true'
order = 'Amount ASC'

begin
  response = xero_client.accounting_api.get_bank_transfers(xero_tenant_id, if_modified_since, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_bank_transfers: #{e}"
end

Scopes

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

Parameters

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

getBatchPayment

Retrieves a specific batch payment using a unique batch payment Id


/BatchPayments/{BatchPaymentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
batch_payment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_batch_payment(xero_tenant_id, batch_payment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_batch_payment: #{e}"
end

Scopes

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

Parameters

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

getBatchPaymentHistory

Retrieves history from a specific batch payment


/BatchPayments/{BatchPaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
batch_payment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_batch_payment_history(xero_tenant_id, batch_payment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_batch_payment_history: #{e}"
end

Scopes

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

Parameters

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

getBatchPayments

Retrieves either one or many batch payments for invoices


/BatchPayments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::BatchPayment::AUTHORISED}'
order = 'Date ASC'

begin
  response = xero_client.accounting_api.get_batch_payments(xero_tenant_id, if_modified_since, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_batch_payments: #{e}"
end

Scopes

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

Parameters

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

getBrandingTheme

Retrieves a specific branding theme using a unique branding theme Id


/BrandingThemes/{BrandingThemeID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
branding_theme_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_branding_theme(xero_tenant_id, branding_theme_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_branding_theme: #{e}"
end

Scopes

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

Parameters

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

getBrandingThemePaymentServices

Retrieves the payment services for a specific branding theme


/BrandingThemes/{BrandingThemeID}/PaymentServices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
branding_theme_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_branding_theme_payment_services(xero_tenant_id, branding_theme_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_branding_theme_payment_services: #{e}"
end

Scopes

paymentservices Grant read-write access to payment services

Parameters

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

getBrandingThemes

Retrieves all the branding themes


/BrandingThemes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'

begin
  response = xero_client.accounting_api.get_branding_themes(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_branding_themes: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getBudget

Retrieves a specific budget, which includes budget lines


/Budgets/{BudgetID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
budget_id = '00000000-0000-0000-0000-000000000000'
date_to = "2019-10-31"
date_from = "2019-10-31"

begin
  response = xero_client.accounting_api.get_budget(xero_tenant_id, budget_id, date_to, date_from)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_budget: #{e}"
end

Scopes

accounting.budgets.read

Parameters

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

getBudgets

Retrieve a list of budgets


/Budgets

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
ids = ["00000000-0000-0000-0000-000000000000"]
date_to = "2019-10-31"
date_from = "2019-10-31"

begin
  response = xero_client.accounting_api.get_budgets(xero_tenant_id, ids, date_to, date_from)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_budgets: #{e}"
end

Scopes

accounting.budgets.read

Parameters

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

getContact

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


/Contacts/{ContactID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_contact(xero_tenant_id, contact_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact: #{e}"
end

Scopes

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

Parameters

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

getContactAttachmentByFileName

Retrieves a specific attachment from a specific contact by file name


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getContactAttachmentById

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getContactAttachments

Retrieves attachments for a specific contact in a Xero organisation


/Contacts/{ContactID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_contact_attachments(xero_tenant_id, contact_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_attachments: #{e}"
end

Scopes

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

Parameters

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

getContactByContactNumber

Retrieves a specific contact by contact number in a Xero organisation


/Contacts/{ContactNumber}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_number = 'SB2'

begin
  response = xero_client.accounting_api.get_contact_by_contact_number(xero_tenant_id, contact_number)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_by_contact_number: #{e}"
end

Scopes

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

Parameters

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

getContactCISSettings

Retrieves CIS settings for a specific contact in a Xero organisation


/Contacts/{ContactID}/CISSettings

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_contact_cis_settings(xero_tenant_id, contact_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_cis_settings: #{e}"
end

Scopes

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

Parameters

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

getContactGroup

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


/ContactGroups/{ContactGroupID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_group_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_contact_group(xero_tenant_id, contact_group_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_group: #{e}"
end

Scopes

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

Parameters

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

getContactGroups

Retrieves the contact Id and name of each contact group


/ContactGroups

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
where = 'Status==#{XeroRuby::Accounting::ContactGroup::ACTIVE}'
order = 'Name ASC'

begin
  response = xero_client.accounting_api.get_contact_groups(xero_tenant_id, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_groups: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getContactHistory

Retrieves history records for a specific contact


/Contacts/{ContactID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_contact_history(xero_tenant_id, contact_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contact_history: #{e}"
end

Scopes

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

Parameters

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

getContacts

Retrieves all contacts in a Xero organisation


/Contacts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'ContactStatus==#{XeroRuby::Accounting::Contact::ACTIVE}'
order = 'Name ASC'
ids = ["00000000-0000-0000-0000-000000000000"]
page = 1
include_archived = true
summary_only = true
search_term = 'Joe Bloggs'
pageSize = 100

begin
  response = xero_client.accounting_api.get_contacts(xero_tenant_id, if_modified_since, where, order, ids, page, include_archived, summary_only, search_term, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_contacts: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
IDs
array[UUID] (uuid)
Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call.
page
Integer
e.g. page=1 - Up to 100 contacts will be returned in a single API call.
includeArchived
Boolean
e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response
summaryOnly
Boolean
Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
searchTerm
String
Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields.
pageSize
Integer
Number of records to retrieve per page

getCreditNote

Retrieves a specific credit note using a unique credit note Id


/CreditNotes/{CreditNoteID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4

begin
  response = xero_client.accounting_api.get_credit_note(xero_tenant_id, credit_note_id, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_note: #{e}"
end

Scopes

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

Parameters

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

getCreditNoteAsPdf

Retrieves credit notes as PDF files


/CreditNotes/{CreditNoteID}/pdf

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_credit_note_as_pdf(xero_tenant_id, credit_note_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_note_as_pdf: #{e}"
end

Scopes

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

Parameters

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

getCreditNoteAttachmentByFileName

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_note_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getCreditNoteAttachmentById

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_note_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getCreditNoteAttachments

Retrieves attachments for a specific credit notes


/CreditNotes/{CreditNoteID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_credit_note_attachments(xero_tenant_id, credit_note_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_note_attachments: #{e}"
end

Scopes

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

Parameters

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

getCreditNoteHistory

Retrieves history records of a specific credit note


/CreditNotes/{CreditNoteID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_credit_note_history(xero_tenant_id, credit_note_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_note_history: #{e}"
end

Scopes

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

Parameters

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

getCreditNotes

Retrieves any credit notes


/CreditNotes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::CreditNote::DRAFT}'
order = 'CreditNoteNumber ASC'
page = 1
unitdp = 4
pageSize = 100

begin
  response = xero_client.accounting_api.get_credit_notes(xero_tenant_id, if_modified_since, where, order, page, unitdp, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_credit_notes: #{e}"
end

Scopes

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

Parameters

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

getCurrencies

Retrieves currencies for your Xero organisation


/Currencies

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
where = 'Code==#{XeroRuby::Accounting::CurrencyCode::USD}'
order = 'Code ASC'

begin
  response = xero_client.accounting_api.get_currencies(xero_tenant_id, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_currencies: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getEmployee

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


/Employees/{EmployeeID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
employee_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_employee(xero_tenant_id, employee_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employee: #{e}"
end

Scopes

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

Parameters

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

getEmployees

Retrieves employees used in Xero payrun


/Employees

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Employee::ACTIVE}'
order = 'LastName ASC'

begin
  response = xero_client.accounting_api.get_employees(xero_tenant_id, if_modified_since, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_employees: #{e}"
end

Scopes

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

Parameters

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

getExpenseClaim

Retrieves a specific expense claim using a unique expense claim Id


/ExpenseClaims/{ExpenseClaimID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
expense_claim_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_expense_claim(xero_tenant_id, expense_claim_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_expense_claim: #{e}"
end

Scopes

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

Parameters

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

getExpenseClaimHistory

Retrieves history records of a specific expense claim


/ExpenseClaims/{ExpenseClaimID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
expense_claim_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_expense_claim_history(xero_tenant_id, expense_claim_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_expense_claim_history: #{e}"
end

Scopes

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

Parameters

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

getExpenseClaims

Retrieves expense claims


/ExpenseClaims

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::ExpenseClaim::SUBMITTED}'
order = 'Status ASC'

begin
  response = xero_client.accounting_api.get_expense_claims(xero_tenant_id, if_modified_since, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_expense_claims: #{e}"
end

Scopes

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

Parameters

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

getInvoice

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


/Invoices/{InvoiceID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4

begin
  response = xero_client.accounting_api.get_invoice(xero_tenant_id, invoice_id, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice: #{e}"
end

Scopes

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

Parameters

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

getInvoiceAsPdf

Retrieves invoices or purchase bills as PDF files


/Invoices/{InvoiceID}/pdf

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_invoice_as_pdf(xero_tenant_id, invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice_as_pdf: #{e}"
end

Scopes

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

Parameters

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

getInvoiceAttachmentByFileName

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getInvoiceAttachmentById

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


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getInvoiceAttachments

Retrieves attachments for a specific invoice or purchase bill


/Invoices/{InvoiceID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_invoice_attachments(xero_tenant_id, invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice_attachments: #{e}"
end

Scopes

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

Parameters

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

getInvoiceHistory

Retrieves history records for a specific invoice


/Invoices/{InvoiceID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_invoice_history(xero_tenant_id, invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice_history: #{e}"
end

Scopes

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

Parameters

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

getInvoiceReminders

Retrieves invoice reminder settings


/InvoiceReminders/Settings

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'

begin
  response = xero_client.accounting_api.get_invoice_reminders(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoice_reminders: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getInvoices

Retrieves sales invoices or purchase bills


/Invoices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Invoice::DRAFT}'
order = 'InvoiceNumber ASC'
ids = ["00000000-0000-0000-0000-000000000000"]
invoice_numbers = ["INV-001", "INV-002"]
contact_ids = ["00000000-0000-0000-0000-000000000000"]
statuses = ["DRAFT", "SUBMITTED"]
page = 1
include_archived = true
created_by_my_app = false
unitdp = 4
summary_only = true
pageSize = 100
search_term = 'SearchTerm=REF12'

begin
  response = xero_client.accounting_api.get_invoices(xero_tenant_id, if_modified_since, where, order, ids, invoice_numbers, contact_ids, statuses, page, include_archived, created_by_my_app, unitdp, summary_only, pageSize, search_term)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_invoices: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
IDs
array[UUID] (uuid)
Filter by a comma-separated list of InvoicesIDs.
InvoiceNumbers
array[String]
Filter by a comma-separated list of InvoiceNumbers.
ContactIDs
array[UUID] (uuid)
Filter by a comma-separated list of ContactIDs.
Statuses
array[String]
Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter.
page
Integer
e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
includeArchived
Boolean
e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response
createdByMyApp
Boolean
When set to true you'll only retrieve Invoices created by your app
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
summaryOnly
Boolean
Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
pageSize
Integer
Number of records to retrieve per page
searchTerm
String
Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference.

getItem

Retrieves a specific item using a unique item Id


/Items/{ItemID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
item_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4

begin
  response = xero_client.accounting_api.get_item(xero_tenant_id, item_id, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_item: #{e}"
end

Scopes

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

Parameters

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

getItemHistory

Retrieves history for a specific item


/Items/{ItemID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
item_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_item_history(xero_tenant_id, item_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_item_history: #{e}"
end

Scopes

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

Parameters

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

getItems

Retrieves items


/Items

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'IsSold==true'
order = 'Code ASC'
unitdp = 4

begin
  response = xero_client.accounting_api.get_items(xero_tenant_id, if_modified_since, where, order, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_items: #{e}"
end

Scopes

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

Parameters

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

getJournal

Retrieves a specific journal using a unique journal Id.


/Journals/{JournalID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
journal_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_journal(xero_tenant_id, journal_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_journal: #{e}"
end

Scopes

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

Parameters

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

getJournalByNumber

Retrieves a specific journal using a unique journal number.


/Journals/{JournalNumber}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
journal_number = 1000

begin
  response = xero_client.accounting_api.get_journal_by_number(xero_tenant_id, journal_number)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_journal_by_number: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
JournalNumber*
Integer
Number of a Journal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getJournals

Retrieves journals


/Journals

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
offset = 10
payments_only = true

begin
  response = xero_client.accounting_api.get_journals(xero_tenant_id, if_modified_since, offset, payments_only)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_journals: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
offset
Integer
Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned
paymentsOnly
Boolean
Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default.

getLinkedTransaction

Retrieves a specific linked transaction (billable expenses) using a unique linked transaction Id


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
linked_transaction_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_linked_transaction(xero_tenant_id, linked_transaction_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_linked_transaction: #{e}"
end

Scopes

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

Parameters

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

getLinkedTransactions

Retrieves linked transactions (billable expenses)


/LinkedTransactions

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
page = 1
linked_transaction_id = '00000000-0000-0000-0000-000000000000'
source_transaction_id = '00000000-0000-0000-0000-000000000000'
contact_id = '00000000-0000-0000-0000-000000000000'
status = 'APPROVED'
target_transaction_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_linked_transactions(xero_tenant_id, page, linked_transaction_id, source_transaction_id, contact_id, status, target_transaction_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_linked_transactions: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
page
Integer
Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.
LinkedTransactionID
UUID (uuid)
The Xero identifier for an Linked Transaction
SourceTransactionID
UUID (uuid)
Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice
ContactID
UUID (uuid)
Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer.
Status
String
Filter by the combination of ContactID and Status. Get the linked transactions associated to a customer and with a status
TargetTransactionID
UUID (uuid)
Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice

getManualJournal

Retrieves a specific manual journal


/ManualJournals/{ManualJournalID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_manual_journal(xero_tenant_id, manual_journal_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_manual_journal: #{e}"
end

Scopes

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

Parameters

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

getManualJournalAttachmentByFileName

Retrieves a specific attachment from a specific manual journal by file name


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_manual_journal_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getManualJournalAttachmentById

Allows you to retrieve a specific attachment from a specific manual journal using a unique attachment Id


/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_manual_journal_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getManualJournalAttachments

Retrieves attachment for a specific manual journal


/ManualJournals/{ManualJournalID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_manual_journal_attachments(xero_tenant_id, manual_journal_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_manual_journal_attachments: #{e}"
end

Scopes

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

Parameters

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

getManualJournals

Retrieves manual journals


/ManualJournals

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::ManualJournal::DRAFT}'
order = 'Date ASC'
page = 1
pageSize = 100

begin
  response = xero_client.accounting_api.get_manual_journals(xero_tenant_id, if_modified_since, where, order, page, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_manual_journals: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment
pageSize
Integer
Number of records to retrieve per page

getManualJournalsHistory

Retrieves history for a specific manual journal


/ManualJournals/{ManualJournalID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_manual_journals_history(xero_tenant_id, manual_journal_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_manual_journals_history: #{e}"
end

Scopes

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

Parameters

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

getOnlineInvoice

Retrieves a URL to an online invoice


/Invoices/{InvoiceID}/OnlineInvoice

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_online_invoice(xero_tenant_id, invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_online_invoice: #{e}"
end

Scopes

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

Parameters

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

getOrganisationActions

Retrieves a list of the key actions your app has permission to perform in the connected Xero organisation.


/Organisation/Actions

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'

begin
  response = xero_client.accounting_api.get_organisation_actions(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_organisation_actions: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOrganisationCISSettings

Retrieves the CIS settings for the Xero organistaion.


/Organisation/{OrganisationID}/CISSettings

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
organisation_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_organisation_cis_settings(xero_tenant_id, organisation_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_organisation_cis_settings: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
OrganisationID*
UUID (uuid)
The unique Xero identifier for an organisation
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOrganisations

Retrieves Xero organisation details


/Organisation

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'

begin
  response = xero_client.accounting_api.get_organisations(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_organisations: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getOverpayment

Retrieves a specific overpayment using a unique overpayment Id


/Overpayments/{OverpaymentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
overpayment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_overpayment(xero_tenant_id, overpayment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_overpayment: #{e}"
end

Scopes

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

Parameters

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

getOverpaymentHistory

Retrieves history records of a specific overpayment


/Overpayments/{OverpaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
overpayment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_overpayment_history(xero_tenant_id, overpayment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_overpayment_history: #{e}"
end

Scopes

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

Parameters

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

getOverpayments

Retrieves overpayments


/Overpayments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Overpayment::AUTHORISED}'
order = 'Status ASC'
page = 1
unitdp = 4
pageSize = 100

begin
  response = xero_client.accounting_api.get_overpayments(xero_tenant_id, if_modified_since, where, order, page, unitdp, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_overpayments: #{e}"
end

Scopes

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

Parameters

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

getPayment

Retrieves a specific payment for invoices and credit notes using a unique payment Id


/Payments/{PaymentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
payment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_payment(xero_tenant_id, payment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payment: #{e}"
end

Scopes

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

Parameters

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

getPaymentHistory

Retrieves history records of a specific payment


/Payments/{PaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
payment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_payment_history(xero_tenant_id, payment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payment_history: #{e}"
end

Scopes

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

Parameters

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

getPaymentServices

Retrieves payment services


/PaymentServices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'

begin
  response = xero_client.accounting_api.get_payment_services(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payment_services: #{e}"
end

Scopes

paymentservices Grant read-write access to payment services

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPayments

Retrieves payments for invoices and credit notes


/Payments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Payment::AUTHORISED}'
order = 'Amount ASC'
page = 1
pageSize = 100

begin
  response = xero_client.accounting_api.get_payments(xero_tenant_id, if_modified_since, where, order, page, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_payments: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
page
Integer
Up to 100 payments will be returned in a single API call
pageSize
Integer
Number of records to retrieve per page

getPrepayment

Allows you to retrieve a specified prepayments


/Prepayments/{PrepaymentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
prepayment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_prepayment(xero_tenant_id, prepayment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_prepayment: #{e}"
end

Scopes

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

Parameters

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

getPrepaymentHistory

Retrieves history record for a specific prepayment


/Prepayments/{PrepaymentID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
prepayment_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_prepayment_history(xero_tenant_id, prepayment_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_prepayment_history: #{e}"
end

Scopes

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

Parameters

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

getPrepayments

Retrieves prepayments


/Prepayments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Prepayment::AUTHORISED}'
order = 'Reference ASC'
page = 1
unitdp = 4
pageSize = 100

begin
  response = xero_client.accounting_api.get_prepayments(xero_tenant_id, if_modified_since, where, order, page, unitdp, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_prepayments: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrder

Retrieves a specific purchase order using a unique purchase order Id


/PurchaseOrders/{PurchaseOrderID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_purchase_order(xero_tenant_id, purchase_order_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrderAsPdf

Retrieves specific purchase order as PDF files using a unique purchase order Id


/PurchaseOrders/{PurchaseOrderID}/pdf

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order_as_pdf: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrderAttachmentByFileName

Retrieves a specific attachment for a specific purchase order by filename


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

Usage and SDK Samples

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'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_purchase_order_attachment_by_file_name(xero_tenant_id, purchase_order_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrderAttachmentById

Retrieves specific attachment for a specific purchase order using a unique attachment Id


/PurchaseOrders/{PurchaseOrderID}/Attachments/{AttachmentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_purchase_order_attachment_by_id(xero_tenant_id, purchase_order_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrderAttachments

Retrieves attachments for a specific purchase order


/PurchaseOrders/{PurchaseOrderID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_purchase_order_attachments(xero_tenant_id, purchase_order_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order_attachments: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrderByNumber

Retrieves a specific purchase order using purchase order number


/PurchaseOrders/{PurchaseOrderNumber}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_number = 'PO1234'

begin
  response = xero_client.accounting_api.get_purchase_order_by_number(xero_tenant_id, purchase_order_number)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order_by_number: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
PurchaseOrderNumber*
String
Unique identifier for a PurchaseOrder
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getPurchaseOrderHistory

Retrieves history for a specific purchase order


/PurchaseOrders/{PurchaseOrderID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_purchase_order_history(xero_tenant_id, purchase_order_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_order_history: #{e}"
end

Scopes

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

Parameters

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

getPurchaseOrders

Retrieves purchase orders


/PurchaseOrders

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
status = 'SUBMITTED'
date_from = '2019-12-01'
date_to = '2019-12-31'
order = 'PurchaseOrderNumber ASC'
page = 1
pageSize = 100

begin
  response = xero_client.accounting_api.get_purchase_orders(xero_tenant_id, if_modified_since, status, date_from, date_to, order, page, pageSize)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_purchase_orders: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
Status
String
Filter by purchase order status
DateFrom
String
Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
DateTo
String
Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31
order
String
Order by an any element
page
Integer
To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned.
pageSize
Integer
Number of records to retrieve per page

getQuote

Retrieves a specific quote using a unique quote Id


/Quotes/{QuoteID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_quote(xero_tenant_id, quote_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quote: #{e}"
end

Scopes

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

Parameters

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

getQuoteAsPdf

Retrieves a specific quote as a PDF file using a unique quote Id


/Quotes/{QuoteID}/pdf

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_quote_as_pdf(xero_tenant_id, quote_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quote_as_pdf: #{e}"
end

Scopes

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

Parameters

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

getQuoteAttachmentByFileName

Retrieves a specific attachment from a specific quote by filename


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

Usage and SDK Samples

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'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quote_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getQuoteAttachmentById

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


/Quotes/{QuoteID}/Attachments/{AttachmentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quote_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getQuoteAttachments

Retrieves attachments for a specific quote


/Quotes/{QuoteID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_quote_attachments(xero_tenant_id, quote_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quote_attachments: #{e}"
end

Scopes

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

Parameters

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

getQuoteHistory

Retrieves history records of a specific quote


/Quotes/{QuoteID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_quote_history(xero_tenant_id, quote_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quote_history: #{e}"
end

Scopes

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

Parameters

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

getQuotes

Retrieves sales quotes


/Quotes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
date_from = "2019-10-31"
date_to = "2019-10-31"
expiry_date_from = "2019-10-31"
expiry_date_to = "2019-10-31"
contact_id = '00000000-0000-0000-0000-000000000000'
status = 'DRAFT'
page = 1
order = 'Status ASC'
quote_number = 'QU-0001'

begin
  response = xero_client.accounting_api.get_quotes(xero_tenant_id, if_modified_since, date_from, date_to, expiry_date_from, expiry_date_to, contact_id, status, page, order, quote_number)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_quotes: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
If-Modified-Since
Date (date-time)
Only records created or modified since this timestamp will be returned
Query parameters
Name Description
DateFrom
date (date)
Filter for quotes after a particular date
DateTo
date (date)
Filter for quotes before a particular date
ExpiryDateFrom
date (date)
Filter for quotes expiring after a particular date
ExpiryDateTo
date (date)
Filter for quotes before a particular date
ContactID
UUID (uuid)
Filter for quotes belonging to a particular contact
Status
String
Filter for quotes of a particular Status
page
Integer
e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote
order
String
Order by an any element
QuoteNumber
String
Filter by quote number (e.g. GET https://.../Quotes?QuoteNumber=QU-0001)

getReceipt

Retrieves a specific draft expense claim receipt by using a unique receipt Id


/Receipts/{ReceiptID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
receipt_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4

begin
  response = xero_client.accounting_api.get_receipt(xero_tenant_id, receipt_id, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_receipt: #{e}"
end

Scopes

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

Parameters

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

getReceiptAttachmentByFileName

Retrieves a specific attachment from a specific expense claim receipts by file name


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

Usage and SDK Samples

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'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_receipt_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getReceiptAttachmentById

Retrieves a specific attachments from a specific expense claim receipts by using a unique attachment Id


/Receipts/{ReceiptID}/Attachments/{AttachmentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
receipt_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_receipt_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getReceiptAttachments

Retrieves attachments for a specific expense claim receipt


/Receipts/{ReceiptID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
receipt_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_receipt_attachments(xero_tenant_id, receipt_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_receipt_attachments: #{e}"
end

Scopes

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

Parameters

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

getReceiptHistory

Retrieves a history record for a specific receipt


/Receipts/{ReceiptID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
receipt_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_receipt_history(xero_tenant_id, receipt_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_receipt_history: #{e}"
end

Scopes

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

Parameters

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

getReceipts

Retrieves draft expense claim receipts for any user


/Receipts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'Status==#{XeroRuby::Accounting::Receipt::DRAFT}'
order = 'ReceiptNumber ASC'
unitdp = 4

begin
  response = xero_client.accounting_api.get_receipts(xero_tenant_id, if_modified_since, where, order, unitdp)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_receipts: #{e}"
end

Scopes

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

Parameters

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

getRepeatingInvoice

Retrieves a specific repeating invoice by using a unique repeating invoice Id


/RepeatingInvoices/{RepeatingInvoiceID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
repeating_invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_repeating_invoice(xero_tenant_id, repeating_invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_repeating_invoice: #{e}"
end

Scopes

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

Parameters

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

getRepeatingInvoiceAttachmentByFileName

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


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

Usage and SDK Samples

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'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_repeating_invoice_attachment_by_file_name: #{e}"
end

Scopes

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

Parameters

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

getRepeatingInvoiceAttachmentById

Retrieves a specific attachment from a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
repeating_invoice_id = '00000000-0000-0000-0000-000000000000'
attachment_id = '00000000-0000-0000-0000-000000000000'
content_type = 'image/jpg'

begin
  response = xero_client.accounting_api.get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_repeating_invoice_attachment_by_id: #{e}"
end

Scopes

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

Parameters

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

getRepeatingInvoiceAttachments

Retrieves attachments from a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/Attachments

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
repeating_invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_repeating_invoice_attachments: #{e}"
end

Scopes

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

Parameters

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

getRepeatingInvoiceHistory

Retrieves history record for a specific repeating invoice


/RepeatingInvoices/{RepeatingInvoiceID}/History

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
repeating_invoice_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_repeating_invoice_history: #{e}"
end

Scopes

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

Parameters

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

getRepeatingInvoices

Retrieves repeating invoices


/RepeatingInvoices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
where = 'Status==#{XeroRuby::Accounting::RepeatingInvoice::DRAFT}'
order = 'Total ASC'

begin
  response = xero_client.accounting_api.get_repeating_invoices(xero_tenant_id, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_repeating_invoices: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getReportAgedPayablesByContact

Retrieves report for aged payables by contact


/Reports/AgedPayablesByContact

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
date = "2019-10-31"
from_date = "2019-10-31"
to_date = "2019-10-31"

begin
  response = xero_client.accounting_api.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, date, from_date, to_date)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_aged_payables_by_contact: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
contactId*
UUID (uuid)
Unique identifier for a Contact
Required
date
date (date)
The date of the Aged Payables By Contact report
fromDate
date (date)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28

getReportAgedReceivablesByContact

Retrieves report for aged receivables by contact


/Reports/AgedReceivablesByContact

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
date = "2019-10-31"
from_date = "2019-10-31"
to_date = "2019-10-31"

begin
  response = xero_client.accounting_api.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, date, from_date, to_date)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_aged_receivables_by_contact: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
contactId*
UUID (uuid)
Unique identifier for a Contact
Required
date
date (date)
The date of the Aged Receivables By Contact report
fromDate
date (date)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28

getReportBalanceSheet

Retrieves report for balancesheet


/Reports/BalanceSheet

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
date = "2019-11-01"
periods = 3
timeframe = 'MONTH'
tracking_option_id_1 = '00000000-0000-0000-0000-000000000000'
tracking_option_id_2 = '00000000-0000-0000-0000-000000000000'
standard_layout = true
payments_only = false

begin
  response = xero_client.accounting_api.get_report_balance_sheet(xero_tenant_id, date, periods, timeframe, tracking_option_id_1, tracking_option_id_2, standard_layout, payments_only)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_balance_sheet: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date of the Balance Sheet report
periods
Integer
The number of periods for the Balance Sheet report
timeframe
String
The period size to compare to (MONTH, QUARTER, YEAR)
trackingOptionID1
String
The tracking option 1 for the Balance Sheet report
trackingOptionID2
String
The tracking option 2 for the Balance Sheet report
standardLayout
Boolean
The standard layout boolean for the Balance Sheet report
paymentsOnly
Boolean
return a cash basis for the Balance Sheet report

getReportBankSummary

Retrieves report for bank summary


/Reports/BankSummary

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
from_date = "2019-10-31"
to_date = "2019-10-31"

begin
  response = xero_client.accounting_api.get_report_bank_summary(xero_tenant_id, from_date, to_date)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_bank_summary: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
fromDate
date (date)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28

getReportBudgetSummary

Retrieves report for budget summary


/Reports/BudgetSummary

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
date = "2019-03-31"
periods = 2
timeframe = 3

begin
  response = xero_client.accounting_api.get_report_budget_summary(xero_tenant_id, date, periods, timeframe)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_budget_summary: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date for the Bank Summary report e.g. 2018-03-31
periods
Integer
The number of periods to compare (integer between 1 and 12)
timeframe
Integer
The period size to compare to (1=month, 3=quarter, 12=year)

getReportExecutiveSummary

Retrieves report for executive summary


/Reports/ExecutiveSummary

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
date = "2019-03-31"

begin
  response = xero_client.accounting_api.get_report_executive_summary(xero_tenant_id, date)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_executive_summary: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date for the Bank Summary report e.g. 2018-03-31

getReportFromId

Retrieves a specific report using a unique ReportID


/Reports/{ReportID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
report_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_report_from_id(xero_tenant_id, report_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_from_id: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ReportID*
String
Unique identifier for a Report
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getReportProfitAndLoss

Retrieves report for profit and loss


/Reports/ProfitAndLoss

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
from_date = "2019-10-31"
to_date = "2019-10-31"
periods = 3
timeframe = 'MONTH'
tracking_category_id = '00000000-0000-0000-0000-000000000000'
tracking_category_id_2 = '00000000-0000-0000-0000-000000000000'
tracking_option_id = '00000000-0000-0000-0000-000000000000'
tracking_option_id_2 = '00000000-0000-0000-0000-000000000000'
standard_layout = true
payments_only = false

begin
  response = xero_client.accounting_api.get_report_profit_and_loss(xero_tenant_id, from_date, to_date, periods, timeframe, tracking_category_id, tracking_category_id_2, tracking_option_id, tracking_option_id_2, standard_layout, payments_only)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_profit_and_loss: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
fromDate
date (date)
filter by the from date of the report e.g. 2021-02-01
toDate
date (date)
filter by the to date of the report e.g. 2021-02-28
periods
Integer
The number of periods to compare (integer between 1 and 12)
timeframe
String
The period size to compare to (MONTH, QUARTER, YEAR)
trackingCategoryID
String
The trackingCategory 1 for the ProfitAndLoss report
trackingCategoryID2
String
The trackingCategory 2 for the ProfitAndLoss report
trackingOptionID
String
The tracking option 1 for the ProfitAndLoss report
trackingOptionID2
String
The tracking option 2 for the ProfitAndLoss report
standardLayout
Boolean
Return the standard layout for the ProfitAndLoss report
paymentsOnly
Boolean
Return cash only basis for the ProfitAndLoss report

getReportTenNinetyNine

Retrieve reports for 1099


/Reports/TenNinetyNine

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
report_year = '2019'

begin
  response = xero_client.accounting_api.get_report_ten_ninety_nine(xero_tenant_id, report_year)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_ten_ninety_nine: #{e}"
end

Scopes

accounting.reports.read Grant read-only access to accounting reports
accounting.reports.tenninetynine.read Grant read-only access to 1099 reports

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
reportYear
String
The year of the 1099 report

getReportTrialBalance

Retrieves report for trial balance


/Reports/TrialBalance

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
date = "2019-10-31"
payments_only = true

begin
  response = xero_client.accounting_api.get_report_trial_balance(xero_tenant_id, date, payments_only)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_report_trial_balance: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
date
date (date)
The date for the Trial Balance report e.g. 2018-03-31
paymentsOnly
Boolean
Return cash only basis for the Trial Balance report

getReportsList

Retrieves a list of the organistaions unique reports that require a uuid to fetch


/Reports

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'

begin
  response = xero_client.accounting_api.get_reports_list(xero_tenant_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_reports_list: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getTaxRateByTaxType

Retrieves a specific tax rate according to given TaxType code


/TaxRates/{TaxType}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
taxType = 'INPUT2'

begin
  response = xero_client.accounting_api.get_tax_rate_by_tax_type(xero_tenant_id, taxType)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_tax_rate_by_tax_type: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
TaxType*
String
A valid TaxType code
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required

getTaxRates

Retrieves tax rates


/TaxRates

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
where = 'Status==#{XeroRuby::Accounting::TaxRate::ACTIVE}'
order = 'Name ASC'

begin
  response = xero_client.accounting_api.get_tax_rates(xero_tenant_id, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_tax_rates: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element

getTrackingCategories

Retrieves tracking categories and options


/TrackingCategories

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
where = 'Status==#{XeroRuby::Accounting::TrackingCategory::ACTIVE}'
order = 'Name ASC'
include_archived = true

begin
  response = xero_client.accounting_api.get_tracking_categories(xero_tenant_id, where, order, include_archived)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_tracking_categories: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Query parameters
Name Description
where
String
Filter by an any element
order
String
Order by an any element
includeArchived
Boolean
e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response

getTrackingCategory

Retrieves specific tracking categories and options using a unique tracking category Id


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
tracking_category_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_tracking_category(xero_tenant_id, tracking_category_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_tracking_category: #{e}"
end

Scopes

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

Parameters

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

getUser

Retrieves a specific user


/Users/{UserID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
user_id = '00000000-0000-0000-0000-000000000000'

begin
  response = xero_client.accounting_api.get_user(xero_tenant_id, user_id)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_user: #{e}"
end

Scopes

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

Parameters

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

getUsers

Retrieves users


/Users

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
if_modified_since = "2020-02-06T12:17:43.202-08:00"
where = 'IsSubscriber==true'
order = 'LastName ASC'

begin
  response = xero_client.accounting_api.get_users(xero_tenant_id, if_modified_since, where, order)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling get_users: #{e}"
end

Scopes

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

Parameters

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

postSetup

Sets the chart of accounts, the conversion date and conversion balances


/Setup

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

account = { 
  code: "123",
  name: "Business supplies",
  type:  XeroRuby::Accounting::AccountType::EXPENSE
}    
accounts = []
accounts << account

conversion_date = { 
  month: 10,
  year: 2020
}    
conversion_balances = []

setup = { 
  accounts: accounts,
  conversion_date:  conversion_date,
  conversion_balances:  conversion_balances
}  

begin
  response = xero_client.accounting_api.post_setup(xero_tenant_id, setup, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling post_setup: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
setup *
Setup
Object including an accounts array, a conversion balances array and a conversion date object in body of request
Required

updateAccount

Updates a chart of accounts


/Accounts/{AccountID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

account = { 
  code: "123456",
  name: "BarFoo",
  type:  XeroRuby::Accounting::AccountType::EXPENSE,
  description: "Hello World",
  tax_type: "NONE"
}  

accounts = {  
  accounts: [account]
} 

begin
  response = xero_client.accounting_api.update_account(xero_tenant_id, account_id, accounts, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_account: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
AccountID*
UUID (uuid)
Unique identifier for Account object
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
accounts *
Accounts
Request of type Accounts array with one Account
Required

updateAccountAttachmentByFileName

Updates attachment on a specific account by filename


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
account_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_account_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateBankTransaction

Updates a single spent or received money transaction


/BankTransactions/{BankTransactionID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4
idempotency_key = 'KEY_VALUE'

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

bank_account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

bank_transaction = { 
  reference: "You just updated",
  type:  XeroRuby::Accounting::BankTransaction::RECEIVE,
  contact: contact,
  lineItems: lineItems,
  bank_account:  bank_account
}  

bankTransactions = {  
  bank_transactions: [bank_transaction]
} 

begin
  response = xero_client.accounting_api.update_bank_transaction(xero_tenant_id, bank_transaction_id, bankTransactions, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_bank_transaction: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
bankTransactions *
BankTransactions
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateBankTransactionAttachmentByFileName

Updates a specific attachment from a specific bank transaction by filename


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transaction_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_bank_transaction_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransactionID*
UUID (uuid)
Xero generated unique identifier for a bank transaction
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateBankTransferAttachmentByFileName


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_transfer_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_bank_transfer_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

Path parameters
Name Description
BankTransferID*
UUID (uuid)
Xero generated unique identifier for a bank transfer
Required
FileName*
String
Name of the attachment
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
body *
byte[]
Byte array of file in body of request
Required

updateContact

Updates a specific contact in a Xero organisation


/Contacts/{ContactID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

contact = { 
  name: "Thanos",
  contactID: "00000000-0000-0000-0000-000000000000"
}  

contacts = {  
  contacts: [contact]
} 

begin
  response = xero_client.accounting_api.update_contact(xero_tenant_id, contact_id, contacts, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_contact: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ContactID*
UUID (uuid)
Unique identifier for a Contact
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contacts *
Contacts
an array of Contacts containing single Contact object with properties to update
Required

updateContactAttachmentByFileName


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_contact_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateContactGroup

Updates a specific contact group


/ContactGroups/{ContactGroupID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_group_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

contact_group = { 
  name: "Vendor"
}  

contactGroups = {  
  contact_groups: [contact_group]
} 

begin
  response = xero_client.accounting_api.update_contact_group(xero_tenant_id, contact_group_id, contactGroups, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_contact_group: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ContactGroupID*
UUID (uuid)
Unique identifier for a Contact Group
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contactGroups *
ContactGroups
an array of Contact groups with Name of specific group to update
Required

updateCreditNote

Updates a specific credit note


/CreditNotes/{CreditNoteID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4
idempotency_key = 'KEY_VALUE'
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,
  status:  XeroRuby::Accounting::CreditNote::AUTHORISED,
  reference: "My ref.",
  contact: contact,
  date:  curr_date,
  line_items:  line_items
}  

creditNotes = {  
  credit_notes: [credit_note]
} 

begin
  response = xero_client.accounting_api.update_credit_note(xero_tenant_id, credit_note_id, creditNotes, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_credit_note: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
CreditNoteID*
UUID (uuid)
Unique identifier for a Credit Note
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
creditNotes *
CreditNotes
an array of Credit Notes containing credit note details to update
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateCreditNoteAttachmentByFileName

Updates attachments on a specific credit note by file name


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
credit_note_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_credit_note_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateExpenseClaim

Updates a specific expense claims


/ExpenseClaims/{ExpenseClaimID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
expense_claim_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'
curr_date = 'YYYY-MM-DD'

user = { 
  user_id: "00000000-0000-0000-0000-000000000000"
}  

receipt = { 
  receipt_id: "00000000-0000-0000-0000-000000000000",
  date:  curr_date
}    
receipts = []
receipts << receipt

expense_claim = { 
  status:  XeroRuby::Accounting::ExpenseClaim::SUBMITTED,
  user: user,
  receipts: receipts
}  

expenseClaims = {  
  expense_claims: [expense_claim]
} 

begin
  response = xero_client.accounting_api.update_expense_claim(xero_tenant_id, expense_claim_id, expenseClaims, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_expense_claim: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ExpenseClaimID*
UUID (uuid)
Unique identifier for a ExpenseClaim
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
expenseClaims *
ExpenseClaims
Required

updateInvoice

Updates a specific sales invoices or purchase bills


/Invoices/{InvoiceID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4
idempotency_key = 'KEY_VALUE'

invoice = { 
  reference: "I am Iron man"
}  

invoices = {  
  invoices: [invoice]
} 

begin
  response = xero_client.accounting_api.update_invoice(xero_tenant_id, invoice_id, invoices, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_invoice: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
InvoiceID*
UUID (uuid)
Unique identifier for an Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
invoices *
Invoices
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateInvoiceAttachmentByFileName

Updates an attachment from a specific invoices or purchase bill by filename


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
invoice_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_invoice_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateItem

Updates a specific item


/Items/{ItemID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
item_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4
idempotency_key = 'KEY_VALUE'

item = { 
  code: "ItemCode123",
  description: "Goodbye"
}  

items = {  
  items: [item]
} 

begin
  response = xero_client.accounting_api.update_item(xero_tenant_id, item_id, items, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_item: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ItemID*
UUID (uuid)
Unique identifier for an Item
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
items *
Items
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateLinkedTransaction

Updates a specific linked transactions (billable expenses)


/LinkedTransactions/{LinkedTransactionID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
linked_transaction_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

linked_transaction = { 
  source_line_item_id: "00000000-0000-0000-0000-000000000000",
  contactID: "00000000-0000-0000-0000-000000000000"
}  

linkedTransactions = {  
  linked_transactions: [linked_transaction]
} 

begin
  response = xero_client.accounting_api.update_linked_transaction(xero_tenant_id, linked_transaction_id, linkedTransactions, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_linked_transaction: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
LinkedTransactionID*
UUID (uuid)
Unique identifier for a LinkedTransaction
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
linkedTransactions *
LinkedTransactions
Required

updateManualJournal

Updates a specific manual journal


/ManualJournals/{ManualJournalID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'
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_manual_journal(xero_tenant_id, manual_journal_id, manualJournals, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_manual_journal: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ManualJournalID*
UUID (uuid)
Unique identifier for a ManualJournal
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
manualJournals *
ManualJournals
Required

updateManualJournalAttachmentByFileName

Updates a specific attachment from a specific manual journal by file name


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

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
manual_journal_id = '00000000-0000-0000-0000-000000000000'
file_name = 'xero-dev.jpg'
idempotency_key = 'KEY_VALUE'
body = File.read('assets/images/xero-api.png')
begin
  response = xero_client.accounting_api.update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_manual_journal_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateOrCreateBankTransactions

Updates or creates one or more spent or received money transaction


/BankTransactions

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'

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

bank_account = { 
  account_id: "00000000-0000-0000-0000-000000000000"
}  

bank_transaction = { 
  type:  XeroRuby::Accounting::BankTransaction::RECEIVE,
  contact: contact,
  lineItems: lineItems,
  bank_account:  bank_account
}  

bankTransactions = {  
  bank_transactions: [bank_transaction]
} 

begin
  response = xero_client.accounting_api.update_or_create_bank_transactions(xero_tenant_id, bankTransactions, summarize_errors, unitdp, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_bank_transactions: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
bankTransactions *
BankTransactions
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateContacts

Updates or creates one or more contacts in a Xero organisation


/Contacts

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'

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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_contacts: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
contacts *
Contacts
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateCreditNotes

Updates or creates one or more credit notes


/CreditNotes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_credit_notes: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
creditNotes *
CreditNotes
an array of Credit Notes with a single CreditNote object.
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateEmployees

Creates a single new employees used in Xero payrun


/Employees

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'

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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_employees: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
employees *
Employees
Employees with array of Employee object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateInvoices

Updates or creates one or more sales invoices or purchase bills


/Invoices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_invoices: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
invoices *
Invoices
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateItems

Updates or creates one or more items


/Items

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
unitdp = 4
idempotency_key = 'KEY_VALUE'

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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_items: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
items *
Items
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateOrCreateManualJournals

Updates or creates a single manual journal


/ManualJournals

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_manual_journals: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
manualJournals *
ManualJournals
ManualJournals array with ManualJournal object in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreatePurchaseOrders

Updates or creates one or more purchase orders


/PurchaseOrders

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_purchase_orders: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
purchaseOrders *
PurchaseOrders
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateQuotes

Updates or creates one or more quotes


/Quotes

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_quotes: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
quotes *
Quotes
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updateOrCreateRepeatingInvoices

Creates or deletes one or more repeating invoice templates


/RepeatingInvoices

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
summarize_errors = true
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.update_or_create_repeating_invoices(xero_tenant_id, repeatingInvoices, summarize_errors, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_or_create_repeating_invoices: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
repeatingInvoices *
RepeatingInvoices
RepeatingInvoices with an array of repeating invoice objects in body of request
Required
Query parameters
Name Description
summarizeErrors
Boolean
If false return 200 OK and mix of successfully created objects and any with validation errors

updatePurchaseOrder

Updates a specific purchase order


/PurchaseOrders/{PurchaseOrderID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
purchase_order_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_purchase_order: #{e}"
end

Scopes

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

Parameters

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

updatePurchaseOrderAttachmentByFileName

Updates a specific attachment for a specific purchase order by filename


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_purchase_order_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateQuote

Updates a specific quote


/Quotes/{QuoteID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
quote_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_quote: #{e}"
end

Scopes

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

Parameters

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

updateQuoteAttachmentByFileName

Updates a specific attachment from a specific quote by filename


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_quote_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateReceipt

Updates a specific draft expense claim receipts


/Receipts/{ReceiptID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
receipt_id = '00000000-0000-0000-0000-000000000000'
unitdp = 4
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_receipt: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
ReceiptID*
UUID (uuid)
Unique identifier for a Receipt
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
receipts *
Receipts
Required
Query parameters
Name Description
unitdp
Integer
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

updateReceiptAttachmentByFileName

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


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_receipt_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateRepeatingInvoice

Deletes a specific repeating invoice template


/RepeatingInvoices/{RepeatingInvoiceID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
repeating_invoice_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

begin
  response = xero_client.accounting_api.update_repeating_invoice(xero_tenant_id, repeating_invoice_id, repeatingInvoices, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_repeating_invoice: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
RepeatingInvoiceID*
UUID (uuid)
Unique identifier for a Repeating Invoice
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
repeatingInvoices *
RepeatingInvoices
Required

updateRepeatingInvoiceAttachmentByFileName

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


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'
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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_repeating_invoice_attachment_by_file_name: #{e}"
end

Scopes

accounting.attachments Grant read-write access to attachments

Parameters

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

updateTaxRate

Updates tax rates


/TaxRates

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
idempotency_key = 'KEY_VALUE'

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, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_tax_rate: #{e}"
end

Scopes

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

Parameters

Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
taxRates *
TaxRates
Required

updateTrackingCategory

Updates a specific tracking category


/TrackingCategories/{TrackingCategoryID}

Usage and SDK Samples

xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
tracking_category_id = '00000000-0000-0000-0000-000000000000'
idempotency_key = 'KEY_VALUE'

trackingCategory = { 
  name: "Foobar"
}  

begin
  response = xero_client.accounting_api.update_tracking_category(xero_tenant_id, tracking_category_id, trackingCategory, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_tracking_category: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingCategory *
TrackingCategory
Required

updateTrackingOptions

Updates a specific option for a specific tracking category


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

Usage and SDK Samples

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'
idempotency_key = 'KEY_VALUE'

trackingOption = { 
  name: "Foobar"
}  

begin
  response = xero_client.accounting_api.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, trackingOption, idempotency_key)
  return response
rescue XeroRuby::ApiError => e
  puts "Exception when calling update_tracking_options: #{e}"
end

Scopes

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

Parameters

Path parameters
Name Description
TrackingCategoryID*
UUID (uuid)
Unique identifier for a TrackingCategory
Required
TrackingOptionID*
UUID (uuid)
Unique identifier for a Tracking Option
Required
Header parameters
Name Description
xero-tenant-id*
String
Xero identifier for Tenant
Required
Idempotency-Key
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
Body parameters
Name Description
trackingOption *
TrackingOption
Required