No commit activity in last 3 years
No release in over 3 years
REST API Client for the helloextend.com ecommerce warranty API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.6, >= 3.6.0

Runtime

~> 2.1, >= 2.1.0
~> 1.0, >= 1.0.1
 Project Readme

Extend API autogenerated client in Ruby

Gem Version CircleCI build status for master branch

ruby client demo screencast

HOWTO

# from https://demo.merchants.extend.com/dashboard/settings

export EXTEND_STORE_ID="my-store-id
export EXTEND_API_KEY="my-api-key"
  • (OPTIONAL — I checked in a copy already) Find the current swagger source from extend's site. This part was hard — they don't explicitly publish it!

  • Download that source as ./reference/openapi_spec.json

  • Generate a new ruby client from that spec: make build-ruby-client (uses a docker image to generate ruby bindings from the JSON file)

  • Build and install the resulting ruby gem:

> make install-gem
cd ./clients/ruby && \
	gem build openapi_client.gemspec && \
	gem install ./openapi_client-1.0.0.gem
  Successfully built RubyGem
  Name: openapi_client
  Version: 1.0.0
  File: openapi_client-1.0.0.gem
Successfully installed openapi_client-1.0.0
Parsing documentation for openapi_client-1.0.0
Installing ri documentation for openapi_client-1.0.0
Done installing documentation for openapi_client after 1 seconds
1 gem installed
  • Execute the test client to create a new product for your store via the demo(sandbox) API:
> ruby ./test_client.rb
{:brand=>"ACME Brand", :createdAt=>1587580830481.0, :enabled=>false, :title=>"Product title", :updatedAt=>1587580830481.0, :referenceId=>"2895", :plans=>[]}
#<OpenapiClient::Product:0x00007f9ea5951348
 @brand="ACME Brand",
 @created_at=1587580830481.0,
 @enabled=false,
 @plans=[],
 @reference_id="2895",
 @title="Product title",
 @updated_at=1587580830481.0>