Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.11.0"
".": "0.12.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 190
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-fd53f07a8b1f148011972d7eba834d5995778d707ff8ef1ead92580b44142a15.yml
openapi_spec_hash: 45892e6361542824364d82181d4eb80d
config_hash: 5eca052bb23d273fa970eac3127dd919
configured_endpoints: 191
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-d29b68bb85936070878d8badaa8a7c5991313285e70a990bc812c838eba85373.yml
openapi_spec_hash: 54b44da68df22eb0ea99f2bc564667a2
config_hash: ac8326134e692f3f3bdec82396bbec80
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.12.0 (2026-04-20)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/lithic-com/lithic-ruby/compare/v0.11.0...v0.12.0)

### Features

* **api:** Add card_authorization.challenge_response webhook ([8abc734](https://github.com/lithic-com/lithic-ruby/commit/8abc7348e6ed248c532058d68388fc357e54f65f))
* **api:** Add card/account/business account signals endpoints and behavioral rule attributes ([76de3de](https://github.com/lithic-com/lithic-ruby/commit/76de3de7a510e54712be632789e90457b7486f3d))
* **api:** add set_verification_method to external_bank_accounts ([3878cb3](https://github.com/lithic-com/lithic-ruby/commit/3878cb30db9f591d2070bed948cc40da07dd3f0e))

## 0.11.0 (2026-04-13)

Full Changelog: [v0.10.0...v0.11.0](https://github.com/lithic-com/lithic-ruby/compare/v0.10.0...v0.11.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
lithic (0.11.0)
lithic (0.12.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "lithic", "~> 0.11.0"
gem "lithic", "~> 0.12.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/lithic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
require_relative "lithic/models/book_transfer_transaction_updated_webhook_event"
require_relative "lithic/models/card"
require_relative "lithic/models/card_authorization_approval_request_webhook_event"
require_relative "lithic/models/card_authorization_challenge_response_webhook_event"
require_relative "lithic/models/card_bulk_order"
require_relative "lithic/models/card_bulk_order_create_params"
require_relative "lithic/models/card_bulk_order_list_params"
Expand Down Expand Up @@ -270,6 +271,7 @@
require_relative "lithic/models/external_bank_account_retry_prenote_params"
require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params"
require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response"
require_relative "lithic/models/external_bank_account_set_verification_method_params"
require_relative "lithic/models/external_bank_account_unpause_params"
require_relative "lithic/models/external_bank_account_updated_webhook_event"
require_relative "lithic/models/external_bank_account_update_params"
Expand Down
6 changes: 6 additions & 0 deletions lib/lithic/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ module Lithic
CardAuthorizationApprovalRequestWebhookEvent =
Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent

CardAuthorizationChallengeResponseWebhookEvent =
Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent

CardBulkOrder = Lithic::Models::CardBulkOrder

CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams
Expand Down Expand Up @@ -297,6 +300,9 @@ module Lithic

ExternalBankAccounts = Lithic::Models::ExternalBankAccounts

ExternalBankAccountSetVerificationMethodParams =
Lithic::Models::ExternalBankAccountSetVerificationMethodParams

ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams

ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,33 @@ class Condition < Lithic::Internal::Type::BaseModel
# - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
# - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
# of the authorization.
# - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
# entity's transaction history. Null if fewer than 30 approved transactions in
# the specified window. Requires `parameters.scope` and `parameters.interval`.
# - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
# entity over the specified window, in cents. Requires `parameters.scope` and
# `parameters.interval`.
# - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
# amounts for the entity over the specified window, in cents. Null if fewer than
# 30 approved transactions in the specified window. Requires `parameters.scope`
# and `parameters.interval`.
# - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
# in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
# Requires `parameters.scope`.
# - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
# transaction history. Valid values are `TRUE`, `FALSE`. Requires
# `parameters.scope`.
# - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
# Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
# - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
# the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
# supported for `BUSINESS_ACCOUNT` scope.
# - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
# transaction for the entity. Requires `parameters.scope`.
# - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
# the entity's transaction history. Requires `parameters.scope`.
# - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
# a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
#
# @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute]
required :attribute,
Expand All @@ -124,7 +151,18 @@ class Condition < Lithic::Internal::Type::BaseModel
# @return [String, Integer, Array<String>, Time]
required :value, union: -> { Lithic::AuthRules::ConditionalValue }

# @!method initialize(attribute:, operation:, value:)
# @!attribute parameters
# Additional parameters required for transaction history signal attributes.
# Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
# `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
# `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
# or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
#
# @return [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters, nil]
optional :parameters,
-> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters }

# @!method initialize(attribute:, operation:, value:, parameters: nil)
# Some parameter documentations has been truncated, see
# {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition}
# for more details.
Expand All @@ -134,6 +172,8 @@ class Condition < Lithic::Internal::Type::BaseModel
# @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute
#
# @param value [String, Integer, Array<String>, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
#
# @param parameters [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters] Additional parameters required for transaction history signal attributes. Requir

# The attribute to target.
#
Expand Down Expand Up @@ -206,6 +246,33 @@ class Condition < Lithic::Internal::Type::BaseModel
# - `CARD_AGE`: The age of the card in seconds at the time of the authorization.
# - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time
# of the authorization.
# - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
# entity's transaction history. Null if fewer than 30 approved transactions in
# the specified window. Requires `parameters.scope` and `parameters.interval`.
# - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
# entity over the specified window, in cents. Requires `parameters.scope` and
# `parameters.interval`.
# - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
# amounts for the entity over the specified window, in cents. Null if fewer than
# 30 approved transactions in the specified window. Requires `parameters.scope`
# and `parameters.interval`.
# - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
# in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
# Requires `parameters.scope`.
# - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
# transaction history. Valid values are `TRUE`, `FALSE`. Requires
# `parameters.scope`.
# - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
# Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
# - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
# the entity over the last 30 days (rolling). Requires `parameters.scope`. Not
# supported for `BUSINESS_ACCOUNT` scope.
# - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
# transaction for the entity. Requires `parameters.scope`.
# - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
# the entity's transaction history. Requires `parameters.scope`.
# - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
# a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
#
# @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute
module Attribute
Expand Down Expand Up @@ -237,10 +304,85 @@ module Attribute
SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE
CARD_AGE = :CARD_AGE
ACCOUNT_AGE = :ACCOUNT_AGE
AMOUNT_Z_SCORE = :AMOUNT_Z_SCORE
AVG_TRANSACTION_AMOUNT = :AVG_TRANSACTION_AMOUNT
STDEV_TRANSACTION_AMOUNT = :STDEV_TRANSACTION_AMOUNT
IS_NEW_COUNTRY = :IS_NEW_COUNTRY
IS_NEW_MCC = :IS_NEW_MCC
IS_FIRST_TRANSACTION = :IS_FIRST_TRANSACTION
CONSECUTIVE_DECLINES = :CONSECUTIVE_DECLINES
TIME_SINCE_LAST_TRANSACTION = :TIME_SINCE_LAST_TRANSACTION
DISTINCT_COUNTRY_COUNT = :DISTINCT_COUNTRY_COUNT
THREE_DS_SUCCESS_RATE = :THREE_DS_SUCCESS_RATE

# @!method self.values
# @return [Array<Symbol>]
end

# @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#parameters
class Parameters < Lithic::Internal::Type::BaseModel
# @!attribute interval
# The time window for statistical attributes (`AMOUNT_Z_SCORE`,
# `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
# all-time history or a specific window (`7D`, `30D`, `90D`).
#
# @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval, nil]
optional :interval,
enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval }

# @!attribute scope
# The entity scope to evaluate the attribute against.
#
# @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope, nil]
optional :scope,
enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope }

# @!method initialize(interval: nil, scope: nil)
# Some parameter documentations has been truncated, see
# {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters}
# for more details.
#
# Additional parameters required for transaction history signal attributes.
# Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
# `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
# `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
# or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
#
# @param interval [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval] The time window for statistical attributes (`AMOUNT_Z_SCORE`, `AVG_TRANSACTION_A
#
# @param scope [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope] The entity scope to evaluate the attribute against.

# The time window for statistical attributes (`AMOUNT_Z_SCORE`,
# `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
# all-time history or a specific window (`7D`, `30D`, `90D`).
#
# @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#interval
module Interval
extend Lithic::Internal::Type::Enum

LIFETIME = :LIFETIME
INTERVAL_7_D = :"7D"
INTERVAL_30_D = :"30D"
INTERVAL_90_D = :"90D"

# @!method self.values
# @return [Array<Symbol>]
end

# The entity scope to evaluate the attribute against.
#
# @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#scope
module Scope
extend Lithic::Internal::Type::Enum

CARD = :CARD
ACCOUNT = :ACCOUNT
BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT

# @!method self.values
# @return [Array<Symbol>]
end
end
end
end
end
Expand Down
48 changes: 47 additions & 1 deletion lib/lithic/models/auth_rules/rule_feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ module AuthRules
# - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires
# `scope`, `period`, and optionally `filters` to configure the velocity
# calculation. Available for AUTHORIZATION event stream rules.
# - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the
# entity's transaction history. Requires `scope` to specify whether to load
# card, account, or business account history. Available for AUTHORIZATION event
# stream rules.
module RuleFeature
extend Lithic::Internal::Type::Union

Expand All @@ -43,6 +47,8 @@ module RuleFeature

variant -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature }

variant -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature }

class AuthorizationFeature < Lithic::Internal::Type::BaseModel
# @!attribute type
#
Expand Down Expand Up @@ -223,8 +229,48 @@ module Scope
end
end

class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel
# @!attribute scope
# The entity scope to load transaction history signals for.
#
# @return [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope]
required :scope, enum: -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope }

# @!attribute type
#
# @return [Symbol, :TRANSACTION_HISTORY_SIGNALS]
required :type, const: :TRANSACTION_HISTORY_SIGNALS

# @!attribute name
# The variable name for this feature in the rule function signature
#
# @return [String, nil]
optional :name, String

# @!method initialize(scope:, name: nil, type: :TRANSACTION_HISTORY_SIGNALS)
# @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope] The entity scope to load transaction history signals for.
#
# @param name [String] The variable name for this feature in the rule function signature
#
# @param type [Symbol, :TRANSACTION_HISTORY_SIGNALS]

# The entity scope to load transaction history signals for.
#
# @see Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature#scope
module Scope
extend Lithic::Internal::Type::Enum

CARD = :CARD
ACCOUNT = :ACCOUNT
BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT

# @!method self.values
# @return [Array<Symbol>]
end
end

# @!method self.variants
# @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature)]
# @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature)]
end
end
end
Expand Down
Loading