0.01
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
This is a simple client for the PlentyMarkets REST API providing classes to interact with it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
>= 0
~> 0.11
~> 12.0
~> 3.0
~> 3.0

Runtime

>= 0.9
>= 1.8.0
>= 1.3.0
 Project Readme

Deprecation Notice

This gem is no longer maintained.

For an actively maintained fork please refer to ReverseRetail/plenty_client.

PlentyClient

Code Climate Issue Count Test Coverage Build Status Gem Version

This Client is a ruby wrapper around the PlentyMarkets REST API.
The complete documentation can be found here.

Installation

Add this line to your application's Gemfile:

gem 'plenty_client'

And then execute:

bundle install

Or install it yourself as:

gem install plenty_client

Getting Started

Configuration

PlentyClient is a simple Ruby library. It works with Rails, as well as in a simple irb. Make sure you configure the PlentyClient with the following options:

PlentyClient::Config.site_url     = 'http://plenty7.plentymarkets.de/rest'
PlentyClient::Config.api_user     = 'myusername'
PlentyClient::Config.api_password = 'mypassword'
PlentyClient::Config.log          = true || false
PlentyClient::Config.plenty_id    = 111111

Calls

Note:

  • required parameters need to be passed in, otherwise you will receive an PlentyClient::ResponseError
  • This Client handles no validation, it is only a gateway to the API

Once you are set up you can use the client like so:

PlentyClient::Item.find(103)
PlentyClient::Item::Variation.find(103, 105)

PlentyClient::Item.list
PlentyClient::Item::Variation.list

PlentyClient::Item.create(parameters)

PlentyClient::Item::Variation.update(103, update_parameters)

PlentyClient::Item::Variation.destroy(103, 105)

# Use blocks to iterate in batches
PlentyClient::Item.list do |item|
  puts item
end

# You can set optional headers after the required parameters of each request
PlentyClient::Item::Variation.list(103, { 'itemsPerPage' => 1, 'page' => 4 }) do |item|
  puts item
end

Warnings

There is a difference in the get method with and without a block. The Call without the block will return the complete response.
With the block you will only receive the entries.

Debugging

If you are not sure which required parameters to pass in simply call

PlentyClient::Item::Variation.routes

Todo:

  • write some specs
  • clean up plenty_client/request.rb

Contributing

Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.