Ruby wrapper for NZ Post's Shipping APIs.
You must be a registered user of these APIs to use this gem.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install parcel_api
By default credentials are taken from the local environment, for this to work the following ENV variables must be set:
You can also configure credentials via
client = ParcelApi::Client.new.tap do |config| config.client_id = ENV['CLIENT_ID'] config.client_secret = ENV['CLIENT_SECRET'] config.username = ENV['USERNAME'] config.password = ENV['PASSWORD'] config.address = 'https://api.uat.nzpost.co.nz/' # defaults to api.nzpost.co.nz end
Client connections can be passed to each method:
Documentation is available here
Some usage examples are also available here
After checking out the repo, run
bin/setup to install dependencies. Then, run
bin/console for an interactive prompt that will allow you to experiment.
- Fork it ( https://github.com/etailer/parcel_api/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request