{"id":17083897,"url":"https://github.com/nkezhaya/shippex","last_synced_at":"2026-04-02T05:37:22.998Z","repository":{"id":55421190,"uuid":"76050457","full_name":"nkezhaya/shippex","owner":"nkezhaya","description":"Elixir shipping library","archived":false,"fork":false,"pushed_at":"2023-11-09T08:55:32.000Z","size":644,"stargazers_count":13,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-15T02:46:36.100Z","etag":null,"topics":["carrier","elixir","elixir-lang","fetching-rates","shipping","ups","usps"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkezhaya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-09T16:12:04.000Z","updated_at":"2024-05-22T14:29:27.597Z","dependencies_parsed_at":"2024-05-22T14:39:42.963Z","dependency_job_id":null,"html_url":"https://github.com/nkezhaya/shippex","commit_stats":null,"previous_names":["whitepaperclip/shippex"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkezhaya%2Fshippex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkezhaya%2Fshippex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkezhaya%2Fshippex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkezhaya%2Fshippex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkezhaya","download_url":"https://codeload.github.com/nkezhaya/shippex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633084,"owners_count":21136799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carrier","elixir","elixir-lang","fetching-rates","shipping","ups","usps"],"created_at":"2024-10-14T13:04:06.861Z","updated_at":"2026-04-02T05:37:22.971Z","avatar_url":"https://github.com/nkezhaya.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shippex\n\n[![Module Version](https://img.shields.io/hexpm/v/shippex.svg)](https://hex.pm/packages/shippex)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/shippex/)\n[![Total Download](https://img.shields.io/hexpm/dt/shippex.svg)](https://hex.pm/packages/shippex)\n[![License](https://img.shields.io/hexpm/l/shippex.svg)](https://hex.pm/packages/shippex)\n[![Last Updated](https://img.shields.io/github/last-commit/whitepaperclip/shippex.svg)](https://github.com/whitepaperclip/shippex/commits/master)\n\nShippex is an abstraction of commonly used features in shipping with various carriers. It provides a (hopefully) pleasant API to work with carrier-provided web interfaces for fetching rates and printing shipping labels.\n\nAs of now, only UPS and USPS are supported. More carrier support will come in the future. Units of measurement are mostly hardcoded to inches and miles.\n\n## Installation\n\nAdd `shippex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:shippex, \"~\u003e 0.18\"}]\nend\n```\n\nEnsure `shippex` is started before your application:\n\n```elixir\ndef application do\n  [applications: [:shippex]]\nend\n```\n\n## Configuration\n\n```elixir\nconfig :shippex,\n  env: :dev,\n  distance_unit: :in, # either :in or :cm\n  weight_unit: :lbs, # either :lbs or :kg\n  currency: :usd, # :usd, :can, :mxn, :eur\n  carriers: [\n    ups: [\n      username: \"MyUsername\",\n      password: \"MyPassword\",\n      secret_key: \"123123\",\n      shipper: %{\n        account_number: \"AB1234\",\n        name: \"My Company\",\n        phone: \"123-456-7890\",\n        address: \"1234 Foo St\",\n        city: \"Foo\",\n        state: \"TX\",\n        postal_code: \"78999\"\n      }\n    ],\n    usps: [\n      username: \"MyUsername\",\n      password: \"MyPassword\"\n    ]\n  ]\n```\n\n## Usage\n\n```elixir\n# Create origin/destination addresses.\norigin = Shippex.Address.new(%{\n  name: \"Earl G\",\n  phone: \"123-123-1234\",\n  address: \"9999 Hobby Lane\",\n  address_line_2: nil,\n  city: \"Austin\",\n  state: \"TX\",\n  postal_code: \"78703\"\n})\n\ndestination = Shippex.Address.new(%{\n  name: \"Bar Baz\",\n  phone: \"123-123-1234\",\n  address: \"1234 Foo Blvd\",\n  address_line_2: nil,\n  city: \"Plano\",\n  state: \"TX\",\n  postal_code: \"75074\",\n  country: \"US\" # optional\n})\n\n# Create a package. Currently only inches and pounds (lbs) supported.\npackage = Shippex.Package.new(%{\n  length: 8,\n  width: 8,\n  height: 4,\n  weight: 5,\n  description: \"Headphones\",\n  monetary_value: 20 # optional\n})\n\n# Link the origin, destination, and package with a shipment.\nshipment = Shippex.Shipment.new(origin, destination, package)\n\n# Fetch rates to present to the user.\nrates = Shippex.fetch_rates(shipment, carriers: :usps)\n\n# Accept one of the services and print the label\n{:ok, rate} = Enum.shuffle(rates) |\u003e hd\n\n# Fetch the label. Includes the tracking number and a gif image of the label.\n{:ok, transaction} = Shippex.create_transaction(shipment, rate.service)\n\nrate = transaction.rate\nlabel = transaction.label\n\n# Print the price.\nIO.puts(rate.price)\n\n# Write the label to disk.\nFile.write!(\"#{label.tracking_number}.#{label.format}\", Base.decode64!(label.image))\n```\n\n## TODO:\n\nCarrier support:\n\n- [x] UPS\n- [x] USPS\n- [ ] FedEx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkezhaya%2Fshippex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkezhaya%2Fshippex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkezhaya%2Fshippex/lists"}