{"id":16487536,"url":"https://github.com/sikanhe/stripe-elixir","last_synced_at":"2025-10-19T09:29:42.463Z","repository":{"id":57553922,"uuid":"64089809","full_name":"sikanhe/stripe-elixir","owner":"sikanhe","description":"Stripe API client for Elixir","archived":false,"fork":false,"pushed_at":"2020-09-08T04:26:21.000Z","size":97,"stargazers_count":68,"open_issues_count":8,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-04T06:59:42.071Z","etag":null,"topics":["elixir","stripe","stripe-api"],"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/sikanhe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-24T23:12:15.000Z","updated_at":"2025-07-25T12:59:15.000Z","dependencies_parsed_at":"2022-09-26T18:51:08.384Z","dependency_job_id":null,"html_url":"https://github.com/sikanhe/stripe-elixir","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sikanhe/stripe-elixir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Fstripe-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Fstripe-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Fstripe-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Fstripe-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sikanhe","download_url":"https://codeload.github.com/sikanhe/stripe-elixir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sikanhe%2Fstripe-elixir/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270061046,"owners_count":24520231,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["elixir","stripe","stripe-api"],"created_at":"2024-10-11T13:35:12.051Z","updated_at":"2025-10-19T09:29:37.413Z","avatar_url":"https://github.com/sikanhe.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stripe [![Build Status](https://semaphoreci.com/api/v1/sikanhe/stripe-elixir/branches/master/badge.svg)](https://semaphoreci.com/sikanhe/stripe-elixir) #\n\nStripe API client for Elixir. [Documentation](https://hexdocs.pm/stripe_elixir/api-reference.html)\n- Everything except for Relay features are complete and tested.\n- Looking for more contributors/maintainers for this project, currently need help with documentation.\n\n## Installation\n\n  1. Add `stripe` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:stripe, \"~\u003e 0.8.0\", hex: :stripe_elixir}]\nend\n```\n\n  2. (Pre-Elixir 1.4) Ensure `stripe` is started before your application:\n\n```elixir\ndef application do\n  [applications: [:stripe]]\nend\n```\n\n  3. Make sure your stripe secret_key is added to your config file:\n\n```elixir\nconfig :stripe, :secret_key, \u003cYOUR_SECRET_KEY\u003e\n```\n\n  4. Alternatively, you can also set the secret key as an environment variable:\n\n```bash\nexport STRIPE_SECRET_KEY=\u003cYOUR_SECRET_KEY\u003e\n```\n\n## Basic Usage\n\nThis lib closely follows the official Ruby Client API.\n\n* `Stripe.{RESOURCE}.create`\n* `Stripe.{RESOURCE}.retrieve`\n* `Stripe.{RESOURCE}.update`\n* `Stripe.{RESOURCE}.list`\n\nReturns `{:ok, RESPONSE_BODY}` when the request is successful.\n\n`{:error, %ERROR_STRUCT{}}` tuples are returned when there is a request/api error.  \nSee all error types at https://stripe.com/docs/api/ruby#errors\n\n## Some Basic Examples\n\nCreate a customer:\n\n```elixir\n{:ok, %{\"id\" =\u003e \"cus_asdfghjkl\"} =\n    Stripe.Customer.create(email: \"example@gmail.com\")\n```\n\nNote that either KeywordLists or Maps with either String or Atom keys are acceptable for arguments and options. So all of the following would also work:\n\n```elixir\nStripe.Customer.create(%{email: \"example@gmail.com\"})\nStripe.Customer.create(%{\"email\" =\u003e \"example@gmail.com\"})\nStripe.Customer.create([{\"email\", \"example@gmail.com\"}])\n```\n\nRetrieve that customer:\n\n```elixir   \n{:ok, customer} = Stripe.Customer.retrieve(\"cus_asdfghjkl\")\n```\n\nUpdate the customer:\n\n```elixir\n{:ok, %{\"metadata\" =\u003e %{\"somedata\" =\u003e \"somevalue\"}}} =\n  Stripe.Customer.update(\"cus_asdfghjkl\", metadata: [somedata: \"somevalue\"])\n```\n\nDelete the customer:\n\n```elixir\n{:ok, %{\"deleted\" =\u003e true}} = Stripe.Customer.delete(\"cus_asdfghjkl\")\n```\n\n## Stripe Connect\n\nTo perform a Direct Charge on a connected stripe account, simply pass :stripe_account as an option\n\n```elixir\nStripe.Charge.create([customer: \"cus_asdfghjkl\", amount: 400], stripe_account: \"acct_sOMeAcCountId\")\n```\n\n#### Generate a Connect authorization url via `Stripe.Connect.authorize_url/1`. \n\n```elixir \nStripe.Connect.authorize_url([\n  redirect_uri: \u003cOPTIONAL CALLBACK URL\u003e,\n  state: \u003cOPTIONAL CSRF TOKEN\u003e,\n  client_id: \u003cOPTIONAL STRIPE PLATFORM CLIENT ID\u003e\n])\n```\n\n#### Options: \n- `redirect_uri`: An optional callback url after authorization succeeds. \n- `state`: You can protect your request from CSRF attacks by passing a csrf token.\n- `client_id`: You can pass in an optional client_id to be used for this url. Defaults to `STRIPE_CLIENT_ID` environment variable or `config :stripe, :client_id` config value. \n\n\n## Handling Webhooks\n\nStripe uses webhooks to notify your web app with events. `Stripe.Webhook` provides `construct_event/3` to authenticate the requests, which can be useful in plugs.\n\n```elixir\npayload = # HTTP content body (e.g. from Plug.Conn.read_body/3)\nsignature = # 'Stripe-Signature' HTTP header (e.g. from Plug.Conn.get_req_header/2)\nsecret = # Provided by Stripe\n\ncase Stripe.Webhook.construct_event(payload, signature, secret) do\n  {:ok, event} -\u003e\n    # Return 2XX\n  {:error, %Stripe.SignatureVerificationError{}} -\u003e\n    # Return non-2XX and handle error\nend\n```\n\nThe default tolerance is 5 minutes (300 seconds as per official libraries). If your app is rejecting requests because the tolerance is too low, consider passing a higher number to `construct_event/4`.\n\n```elixir\nStripe.Webhook.construct_event(payload, signature, secret, 600)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsikanhe%2Fstripe-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsikanhe%2Fstripe-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsikanhe%2Fstripe-elixir/lists"}