{"id":17832416,"url":"https://github.com/thecookieorg/unleashed_client","last_synced_at":"2025-04-02T12:26:35.951Z","repository":{"id":59158668,"uuid":"295291954","full_name":"thecookieorg/unleashed_client","owner":"thecookieorg","description":"A Ruby wrapper for Unleashed API","archived":false,"fork":false,"pushed_at":"2020-09-14T05:01:43.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T11:39:05.969Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"https://apidocs.unleashedsoftware.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecookieorg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-14T03:18:15.000Z","updated_at":"2020-09-14T05:01:45.000Z","dependencies_parsed_at":"2022-09-13T17:51:00.517Z","dependency_job_id":null,"html_url":"https://github.com/thecookieorg/unleashed_client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecookieorg%2Funleashed_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecookieorg%2Funleashed_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecookieorg%2Funleashed_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecookieorg%2Funleashed_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecookieorg","download_url":"https://codeload.github.com/thecookieorg/unleashed_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246813588,"owners_count":20838133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-10-27T19:56:48.944Z","updated_at":"2025-04-02T12:26:35.928Z","avatar_url":"https://github.com/thecookieorg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unleashed\n\n![](https://res.cloudinary.com/manoylo/image/upload/v1600048806/unleashed-logo_s2plij.svg)\n\nA Ruby wrapper for [Unleashed](https://www.unleashedsoftware.com/)\n\nCheck out [example app here](https://obscure-springs-18424.herokuapp.com/)\nand example app [repo here](https://github.com/thecookieorg/unleashed_client_example).\n\n## Documentation\nThe documentation for Unleashed API can be found [here](https://apidocs.unleashedsoftware.com)\n\n## Supported Resources\nThis library supports the following resources:\n* [SalesOrders](https://apidocs.unleashedsoftware.com/SalesOrders)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'unleashed_client'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install unleashed_client\n\n## Getting Started\n\n### 1. Unleashed API key and API ID\n\nBefore you can use the gem, you will have to register and get your API key and API ID. Check out [Unleashed get started page](https://apidocs.unleashedsoftware.com/) for more information.\n\n### 2. Set your ENV\nSet your API_KEY and API_ID as your environment variables. If you're managing your environment variables [dotenv](https://github.com/bkeepers/dotenv) add API_KEY=your_key and API_ID=your_id to your .env file, or if you're using something like [Figaro](https://github.com/laserlemon/figaro) set your API_KEY: your_key and your API_ID: your_id.\n\n### 3. Use it\n```ruby\nrequire 'unleashed_client'\n\n@client = UnleashedClient::SalesOrder.new(api_key: ENV['API_KEY'], api_id: ENV['API_ID'])\n```\n\n### Get total number of pages\nThis is useful if you need to iterate over all pages and get all the data:\n\n```ruby\npages = @client.get_number_of_pages\n```\n\n### Get the first 200 sales orders\nReturns the first 200 sales orders because page number 1 is the default:\n\n```ruby\nitems = @client.get_first_200\n```\n\n### Get sales orders from a specific page\n```ruby\nyour_page_number = 2\n\nitems = @client.get_orders_from_page(page_number: your_page_number)\n```\n\nExample usage:\nYou can combine get_orders_from_page with get_number_of_pages. This will allow you to loop through all available pages and get the data (for example, if you are creating records in your local database):\n\n```ruby\nrequire 'unleashed_client'\n\n@client = UnleashedClient::SalesOrder.new(api_key: ENV['API_KEY'], api_id: ENV['API_ID'])\n\nnumber_of_pages = @client.get_number_of_pages\n\nnumber_of_pages.downto(1).each do |i|\n    items = @client.get_orders_from_page(page_number: i)\n    # do stuff with items\nend\n```\n\n### Get sales orders details\nReturns details of a particular sales order using sales order guid value (ex guid: E6E8163F-6911-40e9-B740-90E5A0A3A996)\n\n```ruby\nyour_guid = \"E6E8163F-6911-40e9-B740-90E5A0A3A996\"\nresponse = @client.get_details(guid: your_guid)\n\n# response[\"Guid\"] =\u003e \"E6E8163F-6911-40e9-B740-90E5A0A3A996\"\n# response[\"OrderNumber\"] =\u003e \"SO-xxx\"\n# ...\n```\n\n## TODO\n* Add better tests wth Rspec;\n* Let users pick returned data type between JSON and Xml;\n\nWhat has to be added for SalesOrders resource:\n* creating new sales orders;\n* complete a sales order;\n* update a sales order;\n\nOther resources to be added:\n* [Customers](https://apidocs.unleashedsoftware.com/Customers);\n* [Products](https://apidocs.unleashedsoftware.com/Products);\n* [PurchaseOrders](https://apidocs.unleashedsoftware.com/Purchases);\n* [SalesPersons](https://apidocs.unleashedsoftware.com/SalesPersons);\n* [SalesPersons](https://apidocs.unleashedsoftware.com/SalesPersons);\n* [SalesShipments](https://apidocs.unleashedsoftware.com/SalesShipments);\n* [StockAdjustments](https://apidocs.unleashedsoftware.com/StockAdjustments);\n* [WarehouseStockTransfers](https://apidocs.unleashedsoftware.com/WarehouseStockTransfers);\n\n## Author\n* Marko Manojlovic \u003cmarko.manojlovic.bg@gmail.com\u003e\n* [https://manoylo.me](https:/manoylo.me)\n* [LinkedIn](https://www.linkedin.com/in/marko-manojlovic-mm/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecookieorg%2Funleashed_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecookieorg%2Funleashed_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecookieorg%2Funleashed_client/lists"}