{"id":15010120,"url":"https://github.com/lunarwireless/shippo","last_synced_at":"2026-02-24T02:31:38.939Z","repository":{"id":57547551,"uuid":"256055009","full_name":"lunarwireless/shippo","owner":"lunarwireless","description":"Elixir Shippo API Wrapper","archived":false,"fork":false,"pushed_at":"2020-04-16T18:02:13.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T07:34:02.848Z","etag":null,"topics":["api","elixir","shippo"],"latest_commit_sha":null,"homepage":"https://github.com/christopherlai/shippo","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lunarwireless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-15T22:53:28.000Z","updated_at":"2020-05-20T21:44:29.000Z","dependencies_parsed_at":"2022-09-26T17:21:34.445Z","dependency_job_id":null,"html_url":"https://github.com/lunarwireless/shippo","commit_stats":null,"previous_names":["christopherlai/shippo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lunarwireless/shippo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwireless%2Fshippo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwireless%2Fshippo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwireless%2Fshippo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwireless%2Fshippo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunarwireless","download_url":"https://codeload.github.com/lunarwireless/shippo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarwireless%2Fshippo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29769176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T01:40:24.820Z","status":"online","status_checked_at":"2026-02-24T02:00:07.497Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","elixir","shippo"],"created_at":"2024-09-24T19:30:22.922Z","updated_at":"2026-02-24T02:31:38.913Z","avatar_url":"https://github.com/lunarwireless.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shippo\nLight wrapper around the Shippo[API](https://goshippo.com/docs/intro/).\n\n[https://hexdocs.pm/shippo](https://hexdocs.pm/shippo)\n\n## Installation\nThe package can be installed by adding `shippo` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:shippo, \"~\u003e 0.1.0\"},\n  {:hackney, \"~\u003e 1.15\"}\n  {:jason, \"~\u003e 1.2\"}\n  ]\nend\n```\n\n## Configuration\n`Shippo` can be configured in `config.exs`. The only configuration required is the Shippo token.\n\n```elixir\nconfig :shippo,\n  token: \"\u003cshippo-token\u003e\"\n```\n\nOther options include:\n* `url`\n* `client`\n* `client_opts`\n* `json_library`\n\n`Shippo.Client.Hackney` is the default HTTP client and `jason` is the default JSON library. Both are optional and can be replaced with your package of choice.\n\nIf you’d like to use a different HTTP client, simply create a module that uses the `Shippo.Client` behaviour, and set your `client` configuration to the module.\n\n```elixir\n# shippo_client.ex\n\ndefmodule MyApp.ShippoClient do\n  @behaviour Shippo.Client\n\n  @impl true\n  def request(method, url, headers, body, opts) do\n  # your code here\n  end\nend\n\n\n# config.exs\n\nconfig :shippo,\n  token: \"\u003cshippo-token\u003e\",\n  client: MyApp.ShippoClient\n```\n\n## Usage\nThis package is a simple and lightweight wrapper around the Shippo API. API requests are made by constructing a `Operation` struct and then passing the operation to `Shippo.request/1`.\n\nIn the example below, `Shippo.Operation.Address.create/1` returns an `Operation` struct; this function does not produce network side effects. The `Operation` is executed by passing it to `Shippo.request/1`, this produces the network side effect and makes a HTTP call to the Shippo API.\n\n```elixir\nparams = %{\n  name: \"Kris Shippo\",\n  street1: \"123 Address\",\n  ctiy: \"City\",\n  state: \"CA\",\n  zip: \"92000\",\n  country: \"US\"\n}\n\nparams\n|\u003e Shippo.Operation.Address.create()\n|\u003e Shippo.request()\n# {:ok, %{...}}\n```\n\n### Filtering\nThe Shippo API supports [filtering](https://goshippo.com/docs/filtering/) through query parameters. This functionality is support by passing a keyword list to function calls.\n\n```elixir\noperation = Shippo.Operation.Address.list(results: 1, object_created_gt: \"2020-01-01\")\n\nShippo.request(operation) # {:ok, %{...}}\n```\n\n### Pagination\nListing resources is paginated (a default of 5 objects are returned per the Shippo API documentation). If paginated, the response body will return a URL in the `next` and `previous` fields. These fields can be passed directly to `Shippo.request/1` to request the next or previous set of resources.\n\n```elixir\noperation = Shippo.Operation.Address.list(results: 1, object_created_gt: \"2020-01-01\")\n\n{:ok, response} = Shippo.request(operation)\n{:ok, response} = Shippo.request(response[\"next\"])\n{:ok, response} = Shippo.request(response[\"previous\"])\n```\n\n## Testing\nA combination of `mox` and `behaviours` are used for testing.\n\n```elixir\n# test_helper.exs\nExUnit.start()\nMox.defmock(MyApp.ShippoClient, for: Shippo.Client)\n\n# my_app_test.exs\ndefmodule MyAppTest do\n  use ExUnit.Case\n  import Mox\n  setup :verify_on_exit!\n\n  test \"test usps\" do\n   expect(MyApp.ShippoClient, :request, fn _method, _url, _headers, _body, _opts -\u003e\n      {:ok, %{status_code: 200, headers: [], body:\"\"}}\n    end)\n\n    assert {:ok, response} =\n      \"1234\"\n      |\u003e Shippo.Operation.Address.get()\n      |\u003e Shippo.request()\n  end\nend\n\n```\n\nPlease see [`mox`](#)(https://hexdocs.pm/mox/Mox.html) for more information.\n\n## Code Status\n![ci](https://github.com/christopherlai/shippo/workflows/ci/badge.svg)\n\n## License\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOF\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarwireless%2Fshippo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunarwireless%2Fshippo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarwireless%2Fshippo/lists"}