Project

jumingo

0.0
The project is in a healthy, maintained state
A Ruby client for the Jumingo API, including authentication, errors, and endpoint helpers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.0
~> 3.0

Runtime

 Project Readme

Jumingo

Ruby client for the Jumingo shipping API.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add jumingo

If bundler is not being used to manage dependencies, install the gem by executing:

gem install jumingo

Usage

require "jumingo"

client = Jumingo::Client.new(
  Jumingo::Configuration.new.tap do |config|
    config.api_key = "your-api-key"
    config.base_url = "https://api.jumingo.com"
    config.timeout = 30
    config.open_timeout = 10
  end
)

Jumingo::Client API Reference

Carrier:

  • POST /v1/carrier/access-points-searchcarrier_access_points_search(payload)

Cart:

  • POST /v1/cart/totalcart_total(payload)

Connections:

  • GET /v1/connectionslist_connections(params: {})
  • GET /v1/connections/{uuid}get_connection(uuid)
  • POST /v1/connectionscreate_connection(payload)

Orders:

  • GET /v1/orderslist_orders(params: {})
  • GET /v1/orders/{id}get_order(id)
  • GET /v1/orders/{id}/documentsget_order_documents(id)
  • POST /v1/orderscreate_order(payload)

Shipments:

  • GET /v1/shipmentslist_shipments(params: {})
  • GET /v1/shipments/{shipment_id}get_shipment(shipment_id)
  • POST /v1/shipmentscreate_shipment(payload)
  • PUT /v1/shipments/{shipment_id}update_shipment(shipment_id, payload)
  • PATCH /v1/shipments/{shipment_id}patch_shipment(shipment_id, payload)
  • DELETE /v1/shipments/{shipment_id}delete_shipment(shipment_id)
  • POST /v1/shipments/cheapestcheapest_shipment_rate(payload, params: {})
  • POST /v1/shipments/{uuid}/file/upload/{type}upload_shipment_file(uuid, type, file)
  • DELETE /v1/shipments/{uuid}/file/upload/{type}delete_shipment_file(uuid, type)

Shipment Rates:

  • POST /v1/shipment-ratescreate_shipment_rate(payload)

Example Calls

client.list_orders(params: { page: 1, itemsPerPage: 20 })
client.create_shipment({ reference: "ORDER-123" })
client.upload_shipment_file("s_fbf8e2a57185478194fa264583b5b388", "commercial-invoice", "/path/to/invoice.pdf")

Pagination Helper

client.each_page("/orders", params: { itemsPerPage: 50 }) do |orders|
  puts orders.count
end

Error Handling

begin
  client.get_order("missing-id")
rescue Jumingo::Errors::NotFound => e
  puts e.status
  puts e.body
end

OpenAPI Source

The OpenAPI definition used to implement this client is stored at openapi/jumingo.yaml.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

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

License

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