lithic 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/lithic/client.rb +15 -1
  5. data/lib/lithic/models/account.rb +2 -2
  6. data/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb +5 -4
  7. data/lib/lithic/models/account_holder_update_response.rb +3 -3
  8. data/lib/lithic/models/account_retrieve_signals_params.rb +20 -0
  9. data/lib/lithic/models/account_update_params.rb +2 -2
  10. data/lib/lithic/models/auth_rules/auth_rule.rb +14 -8
  11. data/lib/lithic/models/auth_rules/auth_rule_version.rb +5 -3
  12. data/lib/lithic/models/auth_rules/card_transaction_update_action.rb +109 -0
  13. data/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb +78 -12
  14. data/lib/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rb +244 -0
  15. data/lib/lithic/models/auth_rules/event_stream.rb +1 -0
  16. data/lib/lithic/models/auth_rules/spend_velocity_filters.rb +33 -0
  17. data/lib/lithic/models/auth_rules/v2_create_params.rb +27 -15
  18. data/lib/lithic/models/auth_rules/v2_draft_params.rb +5 -3
  19. data/lib/lithic/models/card_create_params.rb +4 -2
  20. data/lib/lithic/models/card_renew_params.rb +4 -2
  21. data/lib/lithic/models/card_retrieve_signals_params.rb +20 -0
  22. data/lib/lithic/models/non_pci_card.rb +13 -13
  23. data/lib/lithic/models/reports/settlement/network_total_list_params.rb +1 -0
  24. data/lib/lithic/models/settlement_detail.rb +11 -4
  25. data/lib/lithic/models/settlement_summary_details.rb +1 -0
  26. data/lib/lithic/models/signals_response.rb +306 -0
  27. data/lib/lithic/models.rb +6 -0
  28. data/lib/lithic/resources/accounts.rb +28 -1
  29. data/lib/lithic/resources/auth_rules/v2.rb +1 -1
  30. data/lib/lithic/resources/cards.rb +25 -0
  31. data/lib/lithic/version.rb +1 -1
  32. data/lib/lithic.rb +7 -1
  33. data/rbi/lithic/models/account.rbi +3 -6
  34. data/rbi/lithic/models/account_holder_simulate_enrollment_review_response.rbi +10 -14
  35. data/rbi/lithic/models/account_holder_update_response.rbi +3 -3
  36. data/rbi/lithic/models/account_retrieve_signals_params.rbi +35 -0
  37. data/rbi/lithic/models/account_update_params.rbi +5 -8
  38. data/rbi/lithic/models/auth_rules/auth_rule.rbi +10 -3
  39. data/rbi/lithic/models/auth_rules/auth_rule_version.rbi +2 -0
  40. data/rbi/lithic/models/auth_rules/card_transaction_update_action.rbi +242 -0
  41. data/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi +159 -18
  42. data/rbi/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbi +573 -0
  43. data/rbi/lithic/models/auth_rules/event_stream.rbi +5 -0
  44. data/rbi/lithic/models/auth_rules/spend_velocity_filters.rbi +58 -0
  45. data/rbi/lithic/models/auth_rules/v2_create_params.rbi +30 -9
  46. data/rbi/lithic/models/auth_rules/v2_draft_params.rbi +4 -0
  47. data/rbi/lithic/models/card_create_params.rbi +8 -4
  48. data/rbi/lithic/models/card_renew_params.rbi +8 -4
  49. data/rbi/lithic/models/card_retrieve_signals_params.rbi +35 -0
  50. data/rbi/lithic/models/non_pci_card.rbi +21 -31
  51. data/rbi/lithic/models/reports/settlement/network_total_list_params.rbi +5 -0
  52. data/rbi/lithic/models/settlement_detail.rbi +17 -4
  53. data/rbi/lithic/models/settlement_summary_details.rbi +2 -0
  54. data/rbi/lithic/models/signals_response.rbi +352 -0
  55. data/rbi/lithic/models.rbi +6 -0
  56. data/rbi/lithic/resources/accounts.rbi +23 -1
  57. data/rbi/lithic/resources/auth_rules/v2.rbi +1 -0
  58. data/rbi/lithic/resources/cards.rbi +27 -4
  59. data/sig/lithic/models/account.rbs +4 -8
  60. data/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs +4 -8
  61. data/sig/lithic/models/account_retrieve_signals_params.rbs +23 -0
  62. data/sig/lithic/models/account_update_params.rbs +4 -8
  63. data/sig/lithic/models/auth_rules/auth_rule.rbs +2 -0
  64. data/sig/lithic/models/auth_rules/auth_rule_version.rbs +1 -0
  65. data/sig/lithic/models/auth_rules/card_transaction_update_action.rbs +100 -0
  66. data/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs +31 -3
  67. data/sig/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbs +155 -0
  68. data/sig/lithic/models/auth_rules/event_stream.rbs +2 -0
  69. data/sig/lithic/models/auth_rules/spend_velocity_filters.rbs +35 -0
  70. data/sig/lithic/models/auth_rules/v2_create_params.rbs +3 -0
  71. data/sig/lithic/models/auth_rules/v2_draft_params.rbs +1 -0
  72. data/sig/lithic/models/card_retrieve_signals_params.rbs +23 -0
  73. data/sig/lithic/models/non_pci_card.rbs +20 -30
  74. data/sig/lithic/models/reports/settlement/network_total_list_params.rbs +2 -1
  75. data/sig/lithic/models/settlement_detail.rbs +3 -1
  76. data/sig/lithic/models/settlement_summary_details.rbs +3 -1
  77. data/sig/lithic/models/signals_response.rbs +170 -0
  78. data/sig/lithic/models.rbs +6 -0
  79. data/sig/lithic/resources/accounts.rbs +6 -1
  80. data/sig/lithic/resources/cards.rbs +5 -0
  81. metadata +20 -2
@@ -112,6 +112,7 @@ module Lithic
112
112
  module Network
113
113
  extend Lithic::Internal::Type::Enum
114
114
 
115
+ AMEX = :AMEX
115
116
  VISA = :VISA
116
117
  MASTERCARD = :MASTERCARD
117
118
  MAESTRO = :MAESTRO
@@ -49,7 +49,8 @@ module Lithic
49
49
  required :disputes_gross_amount, Integer
50
50
 
51
51
  # @!attribute event_tokens
52
- # Globally unique identifiers denoting the Events associated with this settlement.
52
+ # Array of globally unique identifiers for the financial events that comprise this
53
+ # settlement. Use these tokens to access detailed event-level information.
53
54
  #
54
55
  # @return [Array<String>]
55
56
  required :event_tokens, Lithic::Internal::Type::ArrayOf[String]
@@ -106,7 +107,12 @@ module Lithic
106
107
  required :settlement_date, String
107
108
 
108
109
  # @!attribute transaction_token
109
- # Globally unique identifier denoting the associated Transaction object.
110
+ # Globally unique identifier denoting the associated transaction. For settlement
111
+ # records with type `CLEARING`, `FINANCIAL`, or `NON-FINANCIAL`, this references a
112
+ # card transaction token. For settlement records with type `CHARGEBACK`,
113
+ # `REPRESENTMENT`, `PREARBITRATION`, `ARBITRATION`, or `COLLABORATION`, this
114
+ # references the dispute transaction token. May be null for certain settlement
115
+ # types.
110
116
  #
111
117
  # @return [String]
112
118
  required :transaction_token, String
@@ -154,7 +160,7 @@ module Lithic
154
160
  #
155
161
  # @param disputes_gross_amount [Integer] The total gross amount of disputes settlements.
156
162
  #
157
- # @param event_tokens [Array<String>] Globally unique identifiers denoting the Events associated with this settlement.
163
+ # @param event_tokens [Array<String>] Array of globally unique identifiers for the financial events that comprise this
158
164
  #
159
165
  # @param institution [String] The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE f
160
166
  #
@@ -172,7 +178,7 @@ module Lithic
172
178
  #
173
179
  # @param settlement_date [String] Date of when money movement is triggered for the transaction. One exception appl
174
180
  #
175
- # @param transaction_token [String] Globally unique identifier denoting the associated Transaction object.
181
+ # @param transaction_token [String] Globally unique identifier denoting the associated transaction. For settlement r
176
182
  #
177
183
  # @param transactions_gross_amount [Integer] The total amount of settlement impacting transactions (excluding interchange, fe
178
184
  #
@@ -188,6 +194,7 @@ module Lithic
188
194
  module Network
189
195
  extend Lithic::Internal::Type::Enum
190
196
 
197
+ AMEX = :AMEX
191
198
  INTERLINK = :INTERLINK
192
199
  MAESTRO = :MAESTRO
193
200
  MASTERCARD = :MASTERCARD
@@ -80,6 +80,7 @@ module Lithic
80
80
  module Network
81
81
  extend Lithic::Internal::Type::Enum
82
82
 
83
+ AMEX = :AMEX
83
84
  INTERLINK = :INTERLINK
84
85
  MAESTRO = :MAESTRO
85
86
  MASTERCARD = :MASTERCARD
@@ -0,0 +1,306 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lithic
4
+ module Models
5
+ class SignalsResponse < Lithic::Internal::Type::BaseModel
6
+ # @!attribute approved_txn_amount_m2
7
+ # The Welford M2 accumulator for lifetime approved transaction amounts. Used
8
+ # together with `avg_transaction_amount` and `approved_txn_count` to compute the
9
+ # z-score of a new transaction amount (variance = M2 / (count - 1)).
10
+ #
11
+ # @return [Float, nil]
12
+ required :approved_txn_amount_m2, Float, nil?: true
13
+
14
+ # @!attribute approved_txn_amount_m2_30d
15
+ # The Welford M2 accumulator for approved transaction amounts over the last 30
16
+ # days.
17
+ #
18
+ # @return [Float, nil]
19
+ required :approved_txn_amount_m2_30d, Float, nil?: true
20
+
21
+ # @!attribute approved_txn_amount_m2_7d
22
+ # The Welford M2 accumulator for approved transaction amounts over the last 7
23
+ # days.
24
+ #
25
+ # @return [Float, nil]
26
+ required :approved_txn_amount_m2_7d, Float, nil?: true
27
+
28
+ # @!attribute approved_txn_amount_m2_90d
29
+ # The Welford M2 accumulator for approved transaction amounts over the last 90
30
+ # days.
31
+ #
32
+ # @return [Float, nil]
33
+ required :approved_txn_amount_m2_90d, Float, nil?: true
34
+
35
+ # @!attribute approved_txn_count
36
+ # The total number of approved transactions over the entity's lifetime.
37
+ #
38
+ # @return [Integer, nil]
39
+ required :approved_txn_count, Integer, nil?: true
40
+
41
+ # @!attribute approved_txn_count_30d
42
+ # The number of approved transactions in the last 30 days.
43
+ #
44
+ # @return [Integer, nil]
45
+ required :approved_txn_count_30d, Integer, nil?: true
46
+
47
+ # @!attribute approved_txn_count_7d
48
+ # The number of approved transactions in the last 7 days.
49
+ #
50
+ # @return [Integer, nil]
51
+ required :approved_txn_count_7d, Integer, nil?: true
52
+
53
+ # @!attribute approved_txn_count_90d
54
+ # The number of approved transactions in the last 90 days.
55
+ #
56
+ # @return [Integer, nil]
57
+ required :approved_txn_count_90d, Integer, nil?: true
58
+
59
+ # @!attribute avg_transaction_amount
60
+ # The average approved transaction amount over the entity's lifetime, in cents.
61
+ # Null if fewer than 5 approved transactions have been recorded.
62
+ #
63
+ # @return [Float, nil]
64
+ required :avg_transaction_amount, Float, nil?: true
65
+
66
+ # @!attribute avg_transaction_amount_30d
67
+ # The average approved transaction amount over the last 30 days, in cents. Null if
68
+ # fewer than 5 approved transactions in window.
69
+ #
70
+ # @return [Float, nil]
71
+ required :avg_transaction_amount_30d, Float, nil?: true
72
+
73
+ # @!attribute avg_transaction_amount_7d
74
+ # The average approved transaction amount over the last 7 days, in cents. Null if
75
+ # fewer than 5 approved transactions in window.
76
+ #
77
+ # @return [Float, nil]
78
+ required :avg_transaction_amount_7d, Float, nil?: true
79
+
80
+ # @!attribute avg_transaction_amount_90d
81
+ # The average approved transaction amount over the last 90 days, in cents. Null if
82
+ # fewer than 5 approved transactions in window.
83
+ #
84
+ # @return [Float, nil]
85
+ required :avg_transaction_amount_90d, Float, nil?: true
86
+
87
+ # @!attribute distinct_country_count
88
+ # The number of distinct merchant countries seen in the entity's transaction
89
+ # history.
90
+ #
91
+ # @return [Integer, nil]
92
+ required :distinct_country_count, Integer, nil?: true
93
+
94
+ # @!attribute distinct_mcc_count
95
+ # The number of distinct MCCs seen in the entity's transaction history.
96
+ #
97
+ # @return [Integer, nil]
98
+ required :distinct_mcc_count, Integer, nil?: true
99
+
100
+ # @!attribute first_txn_at
101
+ # The timestamp of the first approved transaction for the entity, in ISO 8601
102
+ # format.
103
+ #
104
+ # @return [Time, nil]
105
+ required :first_txn_at, Time, nil?: true
106
+
107
+ # @!attribute is_first_transaction
108
+ # Whether the entity has no prior transaction history. Returns true if no history
109
+ # is found. Null if transaction history exists but a first transaction timestamp
110
+ # is unavailable.
111
+ #
112
+ # @return [Boolean, nil]
113
+ required :is_first_transaction, Lithic::Internal::Type::Boolean, nil?: true
114
+
115
+ # @!attribute last_cp_country
116
+ # The merchant country of the last card-present transaction.
117
+ #
118
+ # @return [String, nil]
119
+ required :last_cp_country, String, nil?: true
120
+
121
+ # @!attribute last_cp_postal_code
122
+ # The merchant postal code of the last card-present transaction.
123
+ #
124
+ # @return [String, nil]
125
+ required :last_cp_postal_code, String, nil?: true
126
+
127
+ # @!attribute last_cp_timestamp
128
+ # The timestamp of the last card-present transaction, in ISO 8601 format.
129
+ #
130
+ # @return [Time, nil]
131
+ required :last_cp_timestamp, Time, nil?: true
132
+
133
+ # @!attribute last_txn_approved_at
134
+ # The timestamp of the most recent approved transaction for the entity, in ISO
135
+ # 8601 format.
136
+ #
137
+ # @return [Time, nil]
138
+ required :last_txn_approved_at, Time, nil?: true
139
+
140
+ # @!attribute seen_countries
141
+ # The set of merchant countries seen in the entity's transaction history. Clients
142
+ # can use this to determine whether a new transaction's country is novel (i.e.
143
+ # compute `is_new_country`).
144
+ #
145
+ # @return [Array<String>, nil]
146
+ required :seen_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true
147
+
148
+ # @!attribute seen_mccs
149
+ # The set of MCCs seen in the entity's transaction history. Clients can use this
150
+ # to determine whether a new transaction's MCC is novel (i.e. compute
151
+ # `is_new_mcc`).
152
+ #
153
+ # @return [Array<String>, nil]
154
+ required :seen_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true
155
+
156
+ # @!attribute seen_merchants
157
+ # The set of card acceptor IDs seen in the card's approved transaction history,
158
+ # capped at the 1000 most recently seen. Null for account responses. Clients can
159
+ # use this to determine whether a new transaction's merchant is novel (i.e.
160
+ # compute `is_new_merchant`).
161
+ #
162
+ # @return [Array<String>, nil]
163
+ required :seen_merchants, Lithic::Internal::Type::ArrayOf[String], nil?: true
164
+
165
+ # @!attribute stdev_transaction_amount
166
+ # The standard deviation of approved transaction amounts over the entity's
167
+ # lifetime, in cents. Null if fewer than 30 approved transactions have been
168
+ # recorded.
169
+ #
170
+ # @return [Float, nil]
171
+ required :stdev_transaction_amount, Float, nil?: true
172
+
173
+ # @!attribute stdev_transaction_amount_30d
174
+ # The standard deviation of approved transaction amounts over the last 30 days, in
175
+ # cents. Null if fewer than 30 approved transactions in window.
176
+ #
177
+ # @return [Float, nil]
178
+ required :stdev_transaction_amount_30d, Float, nil?: true
179
+
180
+ # @!attribute stdev_transaction_amount_7d
181
+ # The standard deviation of approved transaction amounts over the last 7 days, in
182
+ # cents. Null if fewer than 30 approved transactions in window.
183
+ #
184
+ # @return [Float, nil]
185
+ required :stdev_transaction_amount_7d, Float, nil?: true
186
+
187
+ # @!attribute stdev_transaction_amount_90d
188
+ # The standard deviation of approved transaction amounts over the last 90 days, in
189
+ # cents. Null if fewer than 30 approved transactions in window.
190
+ #
191
+ # @return [Float, nil]
192
+ required :stdev_transaction_amount_90d, Float, nil?: true
193
+
194
+ # @!attribute three_ds_success_count
195
+ # The number of successful 3DS authentications for the card. Null for account
196
+ # responses.
197
+ #
198
+ # @return [Integer, nil]
199
+ required :three_ds_success_count, Integer, nil?: true
200
+
201
+ # @!attribute three_ds_success_rate
202
+ # The 3DS authentication success rate for the card, as a percentage from 0.0 to
203
+ # 100.0. Null for account responses.
204
+ #
205
+ # @return [Float, nil]
206
+ required :three_ds_success_rate, Float, nil?: true
207
+
208
+ # @!attribute three_ds_total_count
209
+ # The total number of 3DS authentication attempts for the card. Null for account
210
+ # responses.
211
+ #
212
+ # @return [Integer, nil]
213
+ required :three_ds_total_count, Integer, nil?: true
214
+
215
+ # @!attribute time_since_last_transaction_days
216
+ # The number of days since the last approved transaction on the entity.
217
+ #
218
+ # @return [Float, nil]
219
+ required :time_since_last_transaction_days, Float, nil?: true
220
+
221
+ # @!method initialize(approved_txn_amount_m2:, approved_txn_amount_m2_30d:, approved_txn_amount_m2_7d:, approved_txn_amount_m2_90d:, approved_txn_count:, approved_txn_count_30d:, approved_txn_count_7d:, approved_txn_count_90d:, avg_transaction_amount:, avg_transaction_amount_30d:, avg_transaction_amount_7d:, avg_transaction_amount_90d:, distinct_country_count:, distinct_mcc_count:, first_txn_at:, is_first_transaction:, last_cp_country:, last_cp_postal_code:, last_cp_timestamp:, last_txn_approved_at:, seen_countries:, seen_mccs:, seen_merchants:, stdev_transaction_amount:, stdev_transaction_amount_30d:, stdev_transaction_amount_7d:, stdev_transaction_amount_90d:, three_ds_success_count:, three_ds_success_rate:, three_ds_total_count:, time_since_last_transaction_days:)
222
+ # Some parameter documentations has been truncated, see
223
+ # {Lithic::Models::SignalsResponse} for more details.
224
+ #
225
+ # Behavioral feature state for a card or account derived from its transaction
226
+ # history.
227
+ #
228
+ # Derived statistical features (averages, standard deviations, z-scores) are
229
+ # computed using Welford's online algorithm over approved transactions. Average
230
+ # fields are null when fewer than 5 approved transactions have been recorded.
231
+ # Standard deviation fields are null when fewer than 30 approved transactions have
232
+ # been recorded.
233
+ #
234
+ # 3DS fields (`three_ds_success_rate`, `three_ds_success_count`,
235
+ # `three_ds_total_count`) are card-scoped and will be null for account responses.
236
+ #
237
+ # Raw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are
238
+ # included so clients can compute their own transaction-specific derivations, such
239
+ # as checking whether a new transaction's country is in `seen_countries` to
240
+ # determine `is_new_country`, or computing a z-score using the raw mean and M2
241
+ # values.
242
+ #
243
+ # @param approved_txn_amount_m2 [Float, nil] The Welford M2 accumulator for lifetime approved transaction amounts. Used toget
244
+ #
245
+ # @param approved_txn_amount_m2_30d [Float, nil] The Welford M2 accumulator for approved transaction amounts over the last 30 day
246
+ #
247
+ # @param approved_txn_amount_m2_7d [Float, nil] The Welford M2 accumulator for approved transaction amounts over the last 7 days
248
+ #
249
+ # @param approved_txn_amount_m2_90d [Float, nil] The Welford M2 accumulator for approved transaction amounts over the last 90 day
250
+ #
251
+ # @param approved_txn_count [Integer, nil] The total number of approved transactions over the entity's lifetime.
252
+ #
253
+ # @param approved_txn_count_30d [Integer, nil] The number of approved transactions in the last 30 days.
254
+ #
255
+ # @param approved_txn_count_7d [Integer, nil] The number of approved transactions in the last 7 days.
256
+ #
257
+ # @param approved_txn_count_90d [Integer, nil] The number of approved transactions in the last 90 days.
258
+ #
259
+ # @param avg_transaction_amount [Float, nil] The average approved transaction amount over the entity's lifetime, in cents. Nu
260
+ #
261
+ # @param avg_transaction_amount_30d [Float, nil] The average approved transaction amount over the last 30 days, in cents. Null if
262
+ #
263
+ # @param avg_transaction_amount_7d [Float, nil] The average approved transaction amount over the last 7 days, in cents. Null if
264
+ #
265
+ # @param avg_transaction_amount_90d [Float, nil] The average approved transaction amount over the last 90 days, in cents. Null if
266
+ #
267
+ # @param distinct_country_count [Integer, nil] The number of distinct merchant countries seen in the entity's transaction histo
268
+ #
269
+ # @param distinct_mcc_count [Integer, nil] The number of distinct MCCs seen in the entity's transaction history.
270
+ #
271
+ # @param first_txn_at [Time, nil] The timestamp of the first approved transaction for the entity, in ISO 8601 form
272
+ #
273
+ # @param is_first_transaction [Boolean, nil] Whether the entity has no prior transaction history. Returns true if no history
274
+ #
275
+ # @param last_cp_country [String, nil] The merchant country of the last card-present transaction.
276
+ #
277
+ # @param last_cp_postal_code [String, nil] The merchant postal code of the last card-present transaction.
278
+ #
279
+ # @param last_cp_timestamp [Time, nil] The timestamp of the last card-present transaction, in ISO 8601 format.
280
+ #
281
+ # @param last_txn_approved_at [Time, nil] The timestamp of the most recent approved transaction for the entity, in ISO 860
282
+ #
283
+ # @param seen_countries [Array<String>, nil] The set of merchant countries seen in the entity's transaction history. Clients
284
+ #
285
+ # @param seen_mccs [Array<String>, nil] The set of MCCs seen in the entity's transaction history. Clients can use this t
286
+ #
287
+ # @param seen_merchants [Array<String>, nil] The set of card acceptor IDs seen in the card's approved transaction history, ca
288
+ #
289
+ # @param stdev_transaction_amount [Float, nil] The standard deviation of approved transaction amounts over the entity's lifetim
290
+ #
291
+ # @param stdev_transaction_amount_30d [Float, nil] The standard deviation of approved transaction amounts over the last 30 days, in
292
+ #
293
+ # @param stdev_transaction_amount_7d [Float, nil] The standard deviation of approved transaction amounts over the last 7 days, in
294
+ #
295
+ # @param stdev_transaction_amount_90d [Float, nil] The standard deviation of approved transaction amounts over the last 90 days, in
296
+ #
297
+ # @param three_ds_success_count [Integer, nil] The number of successful 3DS authentications for the card. Null for account resp
298
+ #
299
+ # @param three_ds_success_rate [Float, nil] The 3DS authentication success rate for the card, as a percentage from 0.0 to 10
300
+ #
301
+ # @param three_ds_total_count [Integer, nil] The total number of 3DS authentication attempts for the card. Null for account r
302
+ #
303
+ # @param time_since_last_transaction_days [Float, nil] The number of days since the last approved transaction on the entity.
304
+ end
305
+ end
306
+ end
data/lib/lithic/models.rb CHANGED
@@ -82,6 +82,8 @@ module Lithic
82
82
 
83
83
  AccountRetrieveParams = Lithic::Models::AccountRetrieveParams
84
84
 
85
+ AccountRetrieveSignalsParams = Lithic::Models::AccountRetrieveSignalsParams
86
+
85
87
  AccountRetrieveSpendLimitsParams = Lithic::Models::AccountRetrieveSpendLimitsParams
86
88
 
87
89
  AccountSpendLimits = Lithic::Models::AccountSpendLimits
@@ -176,6 +178,8 @@ module Lithic
176
178
 
177
179
  CardRetrieveParams = Lithic::Models::CardRetrieveParams
178
180
 
181
+ CardRetrieveSignalsParams = Lithic::Models::CardRetrieveSignalsParams
182
+
179
183
  CardRetrieveSpendLimitsParams = Lithic::Models::CardRetrieveSpendLimitsParams
180
184
 
181
185
  Cards = Lithic::Models::Cards
@@ -487,6 +491,8 @@ module Lithic
487
491
 
488
492
  ShippingAddress = Lithic::Models::ShippingAddress
489
493
 
494
+ SignalsResponse = Lithic::Models::SignalsResponse
495
+
490
496
  SpendLimitDuration = Lithic::Models::SpendLimitDuration
491
497
 
492
498
  StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent
@@ -44,7 +44,7 @@ module Lithic
44
44
  #
45
45
  # @param state [Symbol, Lithic::Models::AccountUpdateParams::State] Account states.
46
46
  #
47
- # @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus] Account state substatus values:
47
+ # @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil] Account state substatus values:
48
48
  #
49
49
  # @param verification_address [Lithic::Models::AccountUpdateParams::VerificationAddress] Address used during Address Verification Service (AVS) checks during transaction
50
50
  #
@@ -99,6 +99,33 @@ module Lithic
99
99
  )
100
100
  end
101
101
 
102
+ # Returns behavioral feature state derived from an account's transaction history.
103
+ #
104
+ # These signals expose the same data used by behavioral rule attributes (e.g.
105
+ # `AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`)
106
+ # and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to
107
+ # inspect feature values before writing rules and debug rule behavior.
108
+ #
109
+ # Note: 3DS fields are not available at the account scope and will be null.
110
+ #
111
+ # @overload retrieve_signals(account_token, request_options: {})
112
+ #
113
+ # @param account_token [String] The token of the account to fetch signals for.
114
+ #
115
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
116
+ #
117
+ # @return [Lithic::Models::SignalsResponse]
118
+ #
119
+ # @see Lithic::Models::AccountRetrieveSignalsParams
120
+ def retrieve_signals(account_token, params = {})
121
+ @client.request(
122
+ method: :get,
123
+ path: ["v1/accounts/%1$s/signals", account_token],
124
+ model: Lithic::SignalsResponse,
125
+ options: params[:request_options]
126
+ )
127
+ end
128
+
102
129
  # Get an Account's available spend limits, which is based on the spend limit
103
130
  # configured on the Account and the amount already spent over the spend limit's
104
131
  # duration. For example, if the Account has a daily spend limit of $1000
@@ -144,7 +144,7 @@ module Lithic
144
144
  #
145
145
  # @param auth_rule_token [String]
146
146
  #
147
- # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, nil] Parameters for the Auth Rule
147
+ # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, nil] Parameters for the Auth Rule
148
148
  #
149
149
  # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
150
150
  #
@@ -404,6 +404,31 @@ module Lithic
404
404
  )
405
405
  end
406
406
 
407
+ # Returns behavioral feature state derived from a card's transaction history.
408
+ #
409
+ # These signals expose the same data used by behavioral rule attributes (e.g.
410
+ # `AMOUNT_Z_SCORE` with `scope: CARD`, `IS_NEW_COUNTRY` with `scope: CARD`) and
411
+ # custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect
412
+ # feature values before writing rules and debug rule behavior.
413
+ #
414
+ # @overload retrieve_signals(card_token, request_options: {})
415
+ #
416
+ # @param card_token [String] The token of the card to fetch signals for.
417
+ #
418
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
419
+ #
420
+ # @return [Lithic::Models::SignalsResponse]
421
+ #
422
+ # @see Lithic::Models::CardRetrieveSignalsParams
423
+ def retrieve_signals(card_token, params = {})
424
+ @client.request(
425
+ method: :get,
426
+ path: ["v1/cards/%1$s/signals", card_token],
427
+ model: Lithic::SignalsResponse,
428
+ options: params[:request_options]
429
+ )
430
+ end
431
+
407
432
  # Get a Card's available spend limit, which is based on the spend limit configured
408
433
  # on the Card and the amount already spent over the spend limit's duration. For
409
434
  # example, if the Card has a monthly spend limit of $1000 configured, and has
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.12.0"
4
+ VERSION = "0.14.0"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -57,6 +57,7 @@ require_relative "lithic/internal/cursor_page"
57
57
  require_relative "lithic/internal/single_page"
58
58
  require_relative "lithic/models/merchant"
59
59
  require_relative "lithic/models/transaction"
60
+ require_relative "lithic/models/auth_rules/velocity_limit_filters"
60
61
  require_relative "lithic/models/auth_rules/v2/backtest_results"
61
62
  require_relative "lithic/models/book_transfer_response"
62
63
  require_relative "lithic/models/non_pci_card"
@@ -108,6 +109,7 @@ require_relative "lithic/models/account_holder_upload_document_params"
108
109
  require_relative "lithic/models/account_holder_verification_webhook_event"
109
110
  require_relative "lithic/models/account_list_params"
110
111
  require_relative "lithic/models/account_retrieve_params"
112
+ require_relative "lithic/models/account_retrieve_signals_params"
111
113
  require_relative "lithic/models/account_retrieve_spend_limits_params"
112
114
  require_relative "lithic/models/account_spend_limits"
113
115
  require_relative "lithic/models/account_update_params"
@@ -118,11 +120,13 @@ require_relative "lithic/models/auth_rules/auth_rule"
118
120
  require_relative "lithic/models/auth_rules/auth_rule_condition"
119
121
  require_relative "lithic/models/auth_rules/auth_rule_version"
120
122
  require_relative "lithic/models/auth_rules/backtest_stats"
123
+ require_relative "lithic/models/auth_rules/card_transaction_update_action"
121
124
  require_relative "lithic/models/auth_rules/conditional_3ds_action_parameters"
122
125
  require_relative "lithic/models/auth_rules/conditional_ach_action_parameters"
123
126
  require_relative "lithic/models/auth_rules/conditional_attribute"
124
127
  require_relative "lithic/models/auth_rules/conditional_authorization_action_parameters"
125
128
  require_relative "lithic/models/auth_rules/conditional_block_parameters"
129
+ require_relative "lithic/models/auth_rules/conditional_card_transaction_update_action_parameters"
126
130
  require_relative "lithic/models/auth_rules/conditional_operation"
127
131
  require_relative "lithic/models/auth_rules/conditional_tokenization_action_parameters"
128
132
  require_relative "lithic/models/auth_rules/conditional_value"
@@ -130,6 +134,7 @@ require_relative "lithic/models/auth_rules/event_stream"
130
134
  require_relative "lithic/models/auth_rules/merchant_lock_parameters"
131
135
  require_relative "lithic/models/auth_rules/report_stats"
132
136
  require_relative "lithic/models/auth_rules/rule_feature"
137
+ require_relative "lithic/models/auth_rules/spend_velocity_filters"
133
138
  require_relative "lithic/models/auth_rules/typescript_code_parameters"
134
139
  require_relative "lithic/models/auth_rules/v2/backtest_create_params"
135
140
  require_relative "lithic/models/auth_rules/v2/backtest_create_response"
@@ -149,7 +154,6 @@ require_relative "lithic/models/auth_rules/v2_retrieve_params"
149
154
  require_relative "lithic/models/auth_rules/v2_retrieve_report_params"
150
155
  require_relative "lithic/models/auth_rules/v2_retrieve_report_response"
151
156
  require_relative "lithic/models/auth_rules/v2_update_params"
152
- require_relative "lithic/models/auth_rules/velocity_limit_filters"
153
157
  require_relative "lithic/models/auth_rules/velocity_limit_params"
154
158
  require_relative "lithic/models/auth_rules/velocity_limit_period"
155
159
  require_relative "lithic/models/auth_rules_backtest_report_created_webhook_event"
@@ -192,6 +196,7 @@ require_relative "lithic/models/card_reissue_params"
192
196
  require_relative "lithic/models/card_renewed_webhook_event"
193
197
  require_relative "lithic/models/card_renew_params"
194
198
  require_relative "lithic/models/card_retrieve_params"
199
+ require_relative "lithic/models/card_retrieve_signals_params"
195
200
  require_relative "lithic/models/card_retrieve_spend_limits_params"
196
201
  require_relative "lithic/models/cards/balance_list_params"
197
202
  require_relative "lithic/models/cards/financial_transaction_list_params"
@@ -391,6 +396,7 @@ require_relative "lithic/models/settlement_detail"
391
396
  require_relative "lithic/models/settlement_report_updated_webhook_event"
392
397
  require_relative "lithic/models/settlement_summary_details"
393
398
  require_relative "lithic/models/shipping_address"
399
+ require_relative "lithic/models/signals_response"
394
400
  require_relative "lithic/models/spend_limit_duration"
395
401
  require_relative "lithic/models/statements_created_webhook_event"
396
402
  require_relative "lithic/models/statement_totals"
@@ -101,10 +101,7 @@ module Lithic
101
101
  # of the above categories. A comment should be provided to specify the
102
102
  # particular reason.
103
103
  sig { returns(T.nilable(Lithic::Account::Substatus::TaggedSymbol)) }
104
- attr_reader :substatus
105
-
106
- sig { params(substatus: Lithic::Account::Substatus::OrSymbol).void }
107
- attr_writer :substatus
104
+ attr_accessor :substatus
108
105
 
109
106
  sig { returns(T.nilable(Lithic::Account::VerificationAddress)) }
110
107
  attr_reader :verification_address
@@ -126,7 +123,7 @@ module Lithic
126
123
  auth_rule_tokens: T::Array[String],
127
124
  cardholder_currency: String,
128
125
  comment: String,
129
- substatus: Lithic::Account::Substatus::OrSymbol,
126
+ substatus: T.nilable(Lithic::Account::Substatus::OrSymbol),
130
127
  verification_address: Lithic::Account::VerificationAddress::OrHash
131
128
  ).returns(T.attached_class)
132
129
  end
@@ -208,7 +205,7 @@ module Lithic
208
205
  auth_rule_tokens: T::Array[String],
209
206
  cardholder_currency: String,
210
207
  comment: String,
211
- substatus: Lithic::Account::Substatus::TaggedSymbol,
208
+ substatus: T.nilable(Lithic::Account::Substatus::TaggedSymbol),
212
209
  verification_address: Lithic::Account::VerificationAddress
213
210
  }
214
211
  )
@@ -110,7 +110,7 @@ module Lithic
110
110
  sig { params(email: String).void }
111
111
  attr_writer :email
112
112
 
113
- # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
113
+ # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
114
114
  # holder is not KYC-Exempt.
115
115
  sig do
116
116
  returns(
@@ -119,15 +119,7 @@ module Lithic
119
119
  )
120
120
  )
121
121
  end
122
- attr_reader :exemption_type
123
-
124
- sig do
125
- params(
126
- exemption_type:
127
- Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol
128
- ).void
129
- end
130
- attr_writer :exemption_type
122
+ attr_accessor :exemption_type
131
123
 
132
124
  # Customer-provided token that indicates a relationship with an object outside of
133
125
  # the Lithic ecosystem.
@@ -301,7 +293,9 @@ module Lithic
301
293
  created: Time,
302
294
  email: String,
303
295
  exemption_type:
304
- Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol,
296
+ T.nilable(
297
+ Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol
298
+ ),
305
299
  external_id: String,
306
300
  individual:
307
301
  Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::OrHash,
@@ -359,7 +353,7 @@ module Lithic
359
353
  # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of
360
354
  # Account Holder.
361
355
  email: nil,
362
- # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
356
+ # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
363
357
  # holder is not KYC-Exempt.
364
358
  exemption_type: nil,
365
359
  # Customer-provided token that indicates a relationship with an object outside of
@@ -420,7 +414,9 @@ module Lithic
420
414
  created: Time,
421
415
  email: String,
422
416
  exemption_type:
423
- Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol,
417
+ T.nilable(
418
+ Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol
419
+ ),
424
420
  external_id: String,
425
421
  individual:
426
422
  Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual,
@@ -850,7 +846,7 @@ module Lithic
850
846
  end
851
847
  end
852
848
 
853
- # The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account
849
+ # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account
854
850
  # holder is not KYC-Exempt.
855
851
  module ExemptionType
856
852
  extend Lithic::Internal::Type::Enum