View Source Plaid.Signal (plaid v3.3.0)

Functions for Plaid signal endpoint.

Link to this section Summary

Functions

Evaluate a planned ACH transaction.

When Link is not initialized with Signal, call /signal/prepare to opt-in that Item to the Signal data collection process, developing a Signal score. If run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item.

Report whether the ACH transaction was initiated

Report whether the ACH transaction was returned

Link to this section Types

@type config() :: %{required(atom()) => String.t() | keyword()}
@type error() :: {:error, Plaid.Error.t() | any()} | no_return()
@type params() :: %{required(atom()) => term()}
@type t() :: %Plaid.Signal{
  core_attributes: map(),
  request_id: String.t(),
  ruleset: Plaid.Signal.Ruleset.t(),
  scores: Plaid.Signal.Scores.t(),
  warnings: [Plaid.Signal.Warning.t()]
}

Link to this section Functions

Link to this function

evaluate(params, config \\ %{})

View Source
@spec evaluate(params(), config()) :: {:ok, t()} | error()

Evaluate a planned ACH transaction.

Parameters

%{
  access_token: "access-sandbox-71e02f71-0960-4a27-abd2-5631e04f2175",
  account_id: "3gE5gnRzNyfXpBK5wEEKcymJ5albGVUqg77gr",
  client_transaction_id: "txn12345",
  amount: 123.45,
  client_user_id: "user1234",
  user: %{
    name: %{
      prefix: "Ms.",
      given_name: "Jane",
      middle_name: "Leah",
      family_name: "Doe",
      suffix: "Jr.",
    },
    phone_number: "+14152223333",
    email_address: "jane.doe@example.com",
    address: %{
      street: "2493 Leisure Lane",
      city: "San Matias",
      region: "CA",
      postal_code: "93405-2255",
      country: "US",
    },
  },
  device: %{
    ip_address: "198.30.2.2",
    user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X)",
  },
  user_present: true,
  is_recurring: false
}
Link to this function

prepare(params, config \\ %{})

View Source
@spec prepare(params(), config()) :: {:ok, map()} | error()

When Link is not initialized with Signal, call /signal/prepare to opt-in that Item to the Signal data collection process, developing a Signal score. If run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item.

Parameters

%{
  access_token: 'access-sandbox-71e02f71-0960-4a27-abd2-5631e04f2175'
}

Response

{:ok, %{request_id: "a325fa"}}
Link to this function

report_decision(params, config \\ %{})

View Source
@spec report_decision(params(), config()) :: {:ok, map()} | error()

Report whether the ACH transaction was initiated

Parameters

%{
  client_transaction_id: "txn12345",
  initiated: true,
  days_funds_on_hold: 3,
  decision_outcome: "APPROVE",
  payment_method: "NEXT_DAY_ACH",
  amount_instantly_available: 102.25
}

Response

{:ok, %{request_id: "a325fa"}}
Link to this function

report_return(params, config \\ %{})

View Source
@spec report_return(params(), config()) :: {:ok, map()} | error()

Report whether the ACH transaction was returned

Parameters

%{
  client_transaction_id: "txn12345",
  return_code: "R01",
  returned_at: "2024-07-11T10:16:24Z"
}

Response

{:ok, %{request_id: "a325fa"}}