Auth Rules V2 — real-time card authorization controls.
Supports: Conditional Action Rules, Velocity Limit Rules, Hold Adjustment Rules, Custom Code Rules (TypeScript→WASM), and Authorization Challenges.
Lifecycle
# Create a velocity rule
{:ok, rule} = Lithic.AuthRules.create(%{
name: "Daily spend limit",
parameters: %{
scope: "CARD",
limits: [%{limit: 100_00, period: "DAY"}]
}
})
# Draft → promote versioning
{:ok, _} = Lithic.AuthRules.draft(rule["token"], %{parameters: updated_params})
{:ok, _} = Lithic.AuthRules.promote(rule["token"])
# Backtest against historical data
{:ok, backtest} = Lithic.AuthRules.request_backtest(rule["token"], %{
start: "2024-01-01T00:00:00Z",
end: "2024-03-01T00:00:00Z"
})
Summary
Functions
Draft a new version of a rule without activating it.
Get backtest results.
Get calculated feature/signal values for a rule.
Retrieve a performance report for a rule.
List backtests for a rule.
List rule evaluation results.
List versions of a rule.
Promote the drafted version of a rule to active.
Request a backtest of a rule against historical transactions.
Functions
@spec create( map(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec delete( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec draft(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}
Draft a new version of a rule without activating it.
@spec get( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
@spec get_backtest(String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}
Get backtest results.
@spec get_calculated_features( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
Get calculated feature/signal values for a rule.
@spec get_performance_report( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
Retrieve a performance report for a rule.
@spec list(keyword()) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
@spec list_backtests( String.t(), keyword() ) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
List backtests for a rule.
@spec list_evaluation_results( String.t(), keyword() ) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
List rule evaluation results.
@spec list_versions( String.t(), keyword() ) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}
List versions of a rule.
@spec promote( String.t(), keyword() ) :: {:ok, map()} | {:error, Lithic.Error.t()}
Promote the drafted version of a rule to active.
@spec request_backtest(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}
Request a backtest of a rule against historical transactions.
@spec stream(keyword()) :: Enumerable.t()
@spec update(String.t(), map(), keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}