Lightspeed Restaurant API Client is a gem for interacting with Lightspeed Restaurant API. Lightspeed Restaurant is point of sale that helps bars, restaurants, and cafés deliver a better customer experience and run a more profitable business.
Add this line to your application's Gemfile:
gem "lightspeed_restaurant"
And then execute:
$ bundle
Or install it yourself as:
$ gem install lightspeed_restaurant
First, set your api token:
LightspeedRestaurantClient.api_token = "YOUR_API_TOKEN_HERE"
Next, make requests using the resource class you need:
customers = LightspeedRestaurantClient::Customer.all
customer = customers.first
customer.firstName = "Tom"
customer.save
That"s it!
Each action support a configuration object as the last param, allows you to setup api_token
, base_uri
Sample usage:
LightspeedRestaurantClient::Customer.all(LightspeedRestaurantClient.default_configuration.with(api_token: "MY_OTHER_TOKEN", base_uri: "other_ls_resto_uri"))
LightspeedRestaurantClient::Customer.all
LightspeedRestaurantClient::Customer.find(123)
LightspeedRestaurantClient::Customer.create(...firstName: "Tom", email: "tom@brady.com"...)
LightspeedRestaurantClient::Customer.update(123, { email: "tom@brady.com" })
customer = LightspeedRestaurantClient::Customer.find(123)
customer.firstName = "Micheal"
customer.save
customer = LightspeedRestaurantClient::Customer.find(123)
customer.destroy
By default the logs are done on STDOUT. You can specify your own logger (it has to respond to info and error methods, like the Rails logger) :
LightspeedRestaurantClient.logger = "YOUR_LOGGER"
Pull requests are welcome on GitHub at https://github.com/chronogolf/lightspeed_restaurant.
Chronogolf by Lightspeed's mission is to facilitate the interactions between golf managers and golf players. We are building software that allows golf directors to better manage their course, together with a marketplace to find & book games in real-time. We are constantly innovating and trying to challenge the status quo.
Learn more at https://www.lightspeedhq.com/golf/
- Improve destroy operation to handle destroy by passing an ID (or an array of IDs)
- Add missing resources (Company, Reservation, Floor, Table...)
- Improve test coverage
The gem is available as open source under the terms of the MIT License.