0.01
Low commit activity in last 3 years
No release in over a year
Client to access packlink.com shipping API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

 Project Readme

PacklinkLite

Build Status

Packlink.com API client

Installation

Add this line to your application's Gemfile:

gem 'packlink_lite'

Configuration

PacklinkLite.configure do |config|
  config.api_key = ENV['PACKLINK_API_KEY']
  config.testing = true
end

API key can be passed via options too:

PacklinkLite::Service.all(query, api_key: 'mykey')
PacklinkLite::Order.create(order_hash, api_key: 'mykey')

Usage

Fetch services list

services = PacklinkLite::Service.all(
  from: { country: 'DE', zip: 56457 },
  to: { country: 'DE', zip: 56457 },
  packages: { 0 => { width: 10, height: 10, length: 10, weight: 1 } }
)

Create order

order = PacklinkLite::Order.create(order_hash)

Fetch shipment tracking

tracking_history = PacklinkLite::TrackingHistory.find(shipment_reference)

Set callback urls

PacklinkLite.change_shipment_callback_url(url)
PacklinkLite.change_tracking_callback_url(url)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/vinted/packlink_lite.

License

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