tindie_api is a Ruby gem that provides a convenient interface for interacting with the Tindie API. This library simplifies the process of managing products, orders, and other Tindie-related operations programmatically.
Add this line to your application's Gemfile:
gem 'tindie_api'
Then execute:
bundle install
Or install it yourself as:
gem install tindie_api
Get unshipped orders
get "/orders" do
@username = ENV['TINDIE_USERNAME']
@api_key = ENV['TINDIE_API_KEY']
@api = TindieApi::TindieOrdersAPI.new(@username, @api_key)
# false means unshipped
orders = @api.get_all_orders(false)
puts orders.inspect
erb :orders, locals: { orders: orders }
end
Note that the Tindie api uses pagination with 20 items (default) and 50 items (max).
There are 3 ways to get orders depending on the level of abstraction you desire
get_orders
(Returns TindieAPI Objects)get_orders_json
(Returns Json)get_all_orders
(Returns TindieAPI Objects)
See this git repo for additional examples