{"id":48480251,"url":"https://github.com/next-tms/freight_kit","last_synced_at":"2026-04-07T08:06:26.611Z","repository":{"id":37022444,"uuid":"413667015","full_name":"next-tms/freight_kit","owner":"next-tms","description":"Freight carrier API and website abstraction library 📦","archived":false,"fork":false,"pushed_at":"2025-03-12T14:43:58.000Z","size":2090,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-02T00:43:46.358Z","etag":null,"topics":["active-shipping","backoffice","freight","freight-carriers","logistics","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/next-tms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-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":"2021-10-05T03:59:14.000Z","updated_at":"2025-06-26T16:43:32.000Z","dependencies_parsed_at":"2024-03-24T01:33:32.773Z","dependency_job_id":"4afdd468-6da9-42c7-8b92-4fc91415f0fe","html_url":"https://github.com/next-tms/freight_kit","commit_stats":null,"previous_names":["next-tms/freight_kit","next-tms/interstellar"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/next-tms/freight_kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-tms%2Ffreight_kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-tms%2Ffreight_kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-tms%2Ffreight_kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-tms%2Ffreight_kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/next-tms","download_url":"https://codeload.github.com/next-tms/freight_kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/next-tms%2Ffreight_kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["active-shipping","backoffice","freight","freight-carriers","logistics","ruby"],"created_at":"2026-04-07T08:06:23.479Z","updated_at":"2026-04-07T08:06:26.603Z","avatar_url":"https://github.com/next-tms.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FreightKit\n\nThis library interfaces with the web services of various shipping carriers. The goal is to abstract the features that are most frequently used into a pleasant and consistent Ruby API.\n\nFreightKit supports:\n\n- Downloading scanned documents\n- Finding shipping rates\n- Tracking shipments\n\nOn a technical level it supports:\n\n- Abstracted accessorials\n- Abstracted tracking events\n- Cubic feet and density calculations\n- Freight class calculations (and manual overriding)\n\n## Definitions\n\nCarrier: Has unique web services pertaining to whatever real-world services they provide.\n\nPlatform: Provides web-accessible services for many carriers at once.\n\n__Note:__ `Carrier`s may extend `Platform`s and override them when their behavior differs from the `Platform`.\n\n## Plug-in System\n\nFreightKit relies on plug-ins (gems) to define how it connects to individual `Carrier`s and `Platform`s.\n\n## Installation\n\nUsing bundler, add to the `Gemfile`:\n\n```ruby\ngem 'freight_kit'\n```\n\nOr standalone:\n\n```\n$ gem install freight_kit\n```\n\n__Note__: Plug-ins are required to connect to `Carrier`s and `Platforms` (see above).\n\n## Standard Usage\n\nStart off by initializing the `Carrier` provided by a `Carrier` plug-in:\n\n```ruby\nrequire 'freight_kit'\n\n# Typically just one `Credential` is required\ncredentials = [\n  FreightKit::Credential.new(\n    type: :api,\n    account: 'account_number',\n    username: 'username',\n    password: 'password',\n    tariff: FreightKit::Tariff.new # optional\n  ),\n  FreightKit::Credential.new(\n    type: :oauth2,\n    access_token: 'token',\n    expires_at: DateTime.current + 1.day, # DateTime\n    scope: 'scope'\n  ),\n  FreightKit::Credential.new(\n    type: :website,\n    username: 'username',\n    password: 'password'\n  ),\n  FreightKit::Credential.new(\n    type: :selenoid,\n    base_url: URI.parse('http://domain:4444'),\n    browser: :chrome\n  )\n]\n\ncarrier = FreightKit::SCAC.new(credentials)\n```\n\n### Documents\n\n```ruby\ncarrier.bol(tracking_number) # BOL generated by carrier\ncarrier.scanned_bol(tracking_number) # BOL scanned by carrier\n\ncarrier.pod(tracking_number)\n```\n\n### Tracking\n\n```ruby\ntracking = carrier.find_tracking_info(tracking_number)\n\ntracking.delivered?\ntracking.status\n\ntracking.shipment_events.each do |event|\n  puts \"#{event.name} at #{event.location.city}, #{event.location.state} on #{event.time}. #{event.message}\"\nend\n```\n\n### Quoting\n\n```ruby\npackages = [\n  FreightKit::Package.new(\n    371 * 16, # 371 lbs\n    {\n      length: 40, # inches\n      width: 48,\n      height: 47\n    },\n    units: :imperial\n  ),\n  FreightKit::Package.new(\n    371 * 16, # 371 lbs\n    {\n      length: 40, # inches\n      width: 48,\n      height: 47\n    },\n    freight_class: 125, # override calculated freight class\n    units: :imperial\n  )\n]\n\norigin = FreightKit::Location.new(\n  country: 'US',\n  state: 'CA',\n  city: 'Los Angeles',\n  zip: '90001'\n)\n\ndestination = FreightKit::Location.new(\n  country: 'US',\n  state: 'IL',\n  city: 'Chicago',\n  zip: '60007'\n)\n\naccessorials = %i[\n  appointment_delivery\n  liftgate_delivery\n  residential_delivery\n]\n\nresponse = carrier.find_rates(origin, destination, packages, accessorials: accessorials)\nrates = response.rates\nrates = response.rates.sort_by(\u0026:price).collect { |rate| [rate.service_name, rate.price] }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-tms%2Ffreight_kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnext-tms%2Ffreight_kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnext-tms%2Ffreight_kit/lists"}