{"id":13509622,"url":"https://github.com/C404/sift_ex","last_synced_at":"2025-03-30T13:32:30.841Z","repository":{"id":57548011,"uuid":"69998618","full_name":"C404/sift_ex","owner":"C404","description":"Siftscience API Library for Elixir","archived":false,"fork":false,"pushed_at":"2016-10-20T14:46:54.000Z","size":11,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T10:25:56.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/C404.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-04T19:25:51.000Z","updated_at":"2023-04-21T02:31:37.000Z","dependencies_parsed_at":"2022-09-26T18:41:07.933Z","dependency_job_id":null,"html_url":"https://github.com/C404/sift_ex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/C404%2Fsift_ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/C404%2Fsift_ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/C404%2Fsift_ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/C404%2Fsift_ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/C404","download_url":"https://codeload.github.com/C404/sift_ex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246324145,"owners_count":20759086,"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":[],"created_at":"2024-08-01T02:01:10.511Z","updated_at":"2025-03-30T13:32:30.554Z","avatar_url":"https://github.com/C404.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/C404/sift_ex.svg?branch=master)](https://travis-ci.org/C404/sift_ex)\n[![Hex.pm](https://img.shields.io/hexpm/v/sift_ex.svg)](https://hex.pm/packages/sift_ex)\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n# Siftscience API Library for Elixir\nThis library (based on the official [SiftScience](https://github.com/SiftScience) libraries) allows you to interact with the SiftScience API via various functions in Elixir.\n\n## Installation\n\nFirst, add sift_ex to your `mix.exs` dependencies:\n\n```elixir\ndef deps do\n  [{:sift_ex, \"~\u003e 0.1\"}]\nend\n```\nand run `$ mix deps.get`.\n\n\n## Usage\n\n**Set your Sift API key**\n\n`Application.put_env(:sift_ex, :api_key, YOUR_API_KEY)`\n\n\n**Set your Account ID (optional)**\n\n`Application.put_env(:sift_ex, :account_id, YOUR_ACCOUNT_ID)`\n\n\n```iex\niex\u003e SiftEx.start\n\n# send a transaction event -- note this is blocking\niex\u003e event = \"$transaction\"\n\niex\u003e user_id = \"23069\"  # User ID's may only contain a-z, A-Z, 0-9, =, ., -, _, +, @, :, \u0026, ^, %, !, $\n\niex\u003e properties = %{\n \"$user_id\" =\u003e user_id,\n  \"$user_email\" =\u003e \"buyer@gmail.com\",\n  \"$seller_user_id\" =\u003e \"2371\",\n  \"seller_user_email\" =\u003e \"seller@gmail.com\",\n  \"$transaction_id\" =\u003e \"573050\",\n  \"$payment_method\" =\u003e %{\n    \"$payment_type\"    =\u003e \"$credit_card\",\n    \"$payment_gateway\" =\u003e \"$braintree\",\n    \"$card_bin\"        =\u003e \"542486\",\n    \"$card_last4\"      =\u003e \"4444\"             \n  },\n  \"$currency_code\" =\u003e \"USD\",\n  \"$amount\" =\u003e 15230000,\n}\n\niex\u003e response = SiftEx.track(event, properties)\n\niex\u003e response[\"status\"]  # returns Sift status, default is 0\niex\u003e response[\"error_message\"]  # returns Sift error message, default is \"OK\"\niex\u003e IO.inspect response # for more details of the response format\n\n# Request a score for the user with user_id 23069\nresponse = SiftEx.score(user_id)\n\n# Label the user with user_id 23069 as Bad with all optional fields\niex\u003e response = SiftEx.label(user_id, %{\n  \"$is_bad\" =\u003e true,\n  \"$abuse_type\" =\u003e \"payment_abuse\",\n  \"$description\" =\u003e \"Chargeback issued\",\n  \"$source\" =\u003e \"Manual Review\",\n  \"$analyst\" =\u003e \"analyst.name@your_domain.com\"\n})\n\n# Get the status of a workflow run\niex\u003e response = SiftEx.get_workflow_status('my_run_id')\n\n# Get the latest decisions for a user\niex\u003e response = SiftEx.get_user_decisions('example_user_id')\n\n# Get the latest decisions for an order\niex\u003e response = SiftEx.get_order_decisions('example_order_id')\n```\n\nCheck out the official documentation [here](https://siftscience.com/developers/docs/curl/apis-overview) for more informations\n\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Testing\n\nVarious tests included, just run:\n\n    mix deps.get\n    mix test\n\n## License\n\nCopyright (c) 2015 Thibault Hagler. See the LICENSE file for license rights and limitations (MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FC404%2Fsift_ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FC404%2Fsift_ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FC404%2Fsift_ex/lists"}