Releases: XeroAPI/xero-ruby
2.4.1
2.4.1
Accounting API
new POST /Setup route
Associated models for the /Setup route code
fix batch payment reference length
Project API
Add charge type
NZ PAYROLL API
In TaxSettings changed periodunits from int to decimal
Move CalendarType into a separate component for reuse by PayRun and PayRunCalendar
Add TwiceMonthly value to CalendarType enum
Files API
Serialize back created/updated UTC (currently as string, until we can fix the spec at source to work across languages)
2.3.1
.1 patch - removed unnecessary files from the actual gem publish #89 #90 for massive reduction in gem size.
This Release adds all the remaining API sets that the XeroAPI can interact with for the Xero product suite.
- Adds the files API
- Adds the Payroll Api AU
- Adds the Payroll Api NZ
- Adds the Payroll Api UK
Documentation updated.
2.3.0
This Release adds all the remaining API sets that the XeroAPI can interact with for the Xero product suite.
- Adds the files API
- Adds the Payroll Api AU
- Adds the Payroll Api NZ
- Adds the Payroll Api UK
Documentation updated.
2.2.4
2.2.3
Regenerated with recent OAS to fix things like quote number method
fixes #76 - adds two currencies and renames _TRY to TRY (Turkish Lira)
graceful handling of date parsing in case anyone overrides it in their rails config it won't break the date parsing / deserialization
Time.at(seconds_since_epoch).strftime('%Y-%m-%dT%l:%M:%S%z')
adds repeating_invoice_id
2.2.2
Supports edge cases and core operations in the where filter object.
First laid out in issue #73 - here is exhaustive list of a lot of the options you can now properly use in where
Main convention is that for a filter with an operator, pass that in as an array
where: {
field: ['operator', 'query']
}
Querying & Filtering
Examples for the opts
(options) parameters most endpoints support. This is an area of focus and improvement. If you have a complex filering/sorting/where usage that is not supported please open an issue.
# Invoices
opts = {
page: 1,
where: {
type: ['=', XeroRuby::Accounting::Invoice::ACCREC],
fully_paid_on_date: (DateTime.now - 6.month)..DateTime.now,
amount_due: ['>=', 0],
reference: ['=', "Website Design"],
invoice_number: ['=', "INV-0001"],
contact_id: ['=', 'contact-uuid-xxxx-xxx-xxxxxxx'],
contact_number: ['=', "the-contact-number"],
# date: (DateTime.now - 2.year)..DateTime.now
# ▲ you can pass a range ▼ or a date & operator
date: ['>=', DateTime.now - 2.year],
status: ['=', XeroRuby::Accounting::Invoice::PAID]
}
}
xero_client.accounting_api.get_invoices(tenant_id, opts).invoices
# Contacts
opts = {
if_modified_since: (DateTime.now - 1.weeks).to_s,
# ▼ ordering by strings needs PascalCase convention
order: 'UpdatedDateUtc DESC',
where: {
is_customer: ['==', true],
is_supplier: ['==', true]
}
}
xero_client.accounting_api.get_contacts(tenant_id, opts).contacts
# Bank Transactions
opts = {
if_modified_since: (DateTime.now - 1.year).to_s,
where: { type: ['==', XeroRuby::Accounting::BankTransaction::SPEND] },
order: 'UpdatedDateUtc DESC',
page: 2,
unitdp: 4 # (Unit Decimal Places)
}
xero_client.accounting_api.get_bank_transactions(tenant_id, opts).bank_transactions
# Bank Transfers
opts = {
if_modified_since: (DateTime.now - 1.month).to_s,
where: {
amount: [">=" , 999.99]
},
order: 'Amount ASC'
}
xero_client.accounting_api.get_bank_transfers(tenant_id, opts).bank_transfers
2.1.2
2.1.1
Fix docs to show proper BigDecimal
types
PR generated from The version of the OpenAPI document: 2.2.14
https://github.com/XeroAPI/Xero-OpenAPI
This change was mainly to validate some the origination template changes did not effect downstream generation
Also added a DELETED Enum to employee, and removed a contact id param from bank transactions
2.1.0
- Large readme usability cleanup
- Fixes #56 - invoice_id serialization
- Fixes and adds examples in readme for #24 - as well as sample app
This issue was mainly fixed by addressing an issue in XeroAPI's IDs
convention where openapi-generator
does not snake_case properly.. Code manual over-rides the i_ds
malformations:
2.0.3
Ruby 2.0.3 release
generated from Xero-OpenAPI version: 2.2.11
BREAKING changes include:
- All monetary fields are now typed as
BigDecimal
across all api sets - examples in readme
changes include:
- re-serialization of params during PUT's and POST's to the XeroAPI to PascalCase from Ruby's preferred snake_case 🐍 related code
SDK does still supports existing functionality of passing camelCase, PascalCase, or some combination.
But now all params can now be snake cased before sent to any SDK method:
invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: contacts[0].contact_id }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: BigDecimal("20.99"), account_code: "600", tax_type: XeroRuby::Accounting::TaxType::NONE }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]}
bug fixes / improvements
- fixing all file download routes based on @wojw5's suggestion in #32
- Download as PDF (#43) also fixed by (https://github.com/XeroAPI/xero-ruby/pull/54/files#diff-c1ed4f733dbf7dd2d5bbba26b23819e5R379)
- Duplicate Constants removed for account.rb & organisation.rb reported in #50
- Upload attachments examples added to readme and sample app
invoice = xero_client.accounting_api.get_invoices(current_user.active_tenant_id).invoices.first
file_name = "an-invoice-filename.png"
opts = {
include_online: true # Boolean | Allows an attachment to be seen by the end customer within their online invoice
}
file = File.read(Rails.root.join('app/assets/images/xero-api.png'))
attachment = xero_client.accounting_api.create_invoice_attachment_by_file_name(current_user.active_tenant_id, invoice.invoice_id, file_name, file, opts)
Readme & related sample app updates
- updates readme with PUT/POST examples
- updates to readme showing how to download a file as PDF
- Related updates to the companion sample app showing more comprehensive xero-ruby SDK usage