README.md in acumatica-0.2.1 vs README.md in acumatica-0.3.0

- old
+ new

@@ -1,9 +1,12 @@ # Acumatica This gem provides a wrapper for the [Acumatica REST API](https://help.acumatica.com/Main?ScreenId=ShowWiki&pageid=ca2716f1-025a-4a6e-9090-797cf32b0459). +![Gem](https://img.shields.io/gem/v/acumatica.svg) +![Travis](https://img.shields.io/travis/Jetbuilt/acumatica.svg) + ## Installation Add this line to your application's Gemfile: ```ruby @@ -18,19 +21,39 @@ $ gem install acumatica ## Usage +### Client + ``` acumatica = Acumatica::Client.configure do |config| config.url = "https://mycompany.acumatica.com" config.name = "user@company" config.password = "sekret" end +# Manually log in/out acumatica.login +acumatica.stock_items.find_all(limit: 1) +acumatica.logout +# Wrap calls in session to automatically log in/out +acumatica.session do + acumatica.stock_items.find_all( + select: 'Attributes,InventoryID', + filter: '', + offset: 0, + limit: 100, + expand: 'Attributes' + ) +end +``` + +### StockItem + +``` acumatica.stock_items.find_all( select: 'Attributes,InventoryID', filter: '', offset: 0, limit: 100, @@ -45,21 +68,29 @@ "AttributeID": { "value": "Manufacturer" }, "Value": { "value": "ACME" } } ] }) +``` -acumatica.logout -``` +### Customer +``` +acumatica.customers.find_all(limit: 1) +acumatica.customers.create(customer_id: "123", customer_name: "ACME", tax_zone: "TAXES!") +``` + ## NOTES -- Currently only querying and creating StockItems has been implemented - pull requests welcome! -- Querying Acumatica can be very slow, account for that when designing your integration. -- Some Acumatica installations limit the number of concurrent users, so make sure to logout when finished. +- This library is very much a work in progress - pull requests welcome! +- Querying Acumatica can be very slow, account for that when designing your integration. For + example, calling `find_all` on a resource without a limit may take minutes to complete the + request. YMMV. +- Some Acumatica installations limit the number of concurrent users, so make sure to logout when + finished or wrap calls with `Acumatica::Client#session` ## TODO - OAuth Authentication (coming soon) -- Tests +- Document public methods ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jetbuilt/acumatica. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.