1616
1717
1818class ConditionParameters (TypedDict , total = False ):
19- """Additional parameters for spend velocity attributes.
19+ """Additional parameters for certain attributes.
2020
2121 Required when `attribute` is
22- `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`. Not used for other attributes.
22+ `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, and
23+ optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
24+ `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`,
25+ `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT`
26+ (require `scope`, and additionally `interval` for the statistical attributes); or
27+ `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for
28+ other attributes.
2329 """
2430
2531 filters : SpendVelocityFiltersParam
2632
33+ interval : Literal ["LIFETIME" , "7D" , "30D" , "90D" ]
34+ """
35+ The time window for statistical attributes (`AMOUNT_Z_SCORE`,
36+ `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for
37+ all-time history or a specific window (`7D`, `30D`, `90D`).
38+ """
39+
2740 period : VelocityLimitPeriodParam
2841 """The time period over which to calculate the spend velocity."""
2942
3043 scope : Literal ["CARD" , "ACCOUNT" , "GLOBAL" ]
31- """The entity scope to evaluate the attribute against."""
44+ """The entity scope to evaluate the attribute against.
45+
46+ `GLOBAL` is only valid for spend velocity attributes.
47+ """
48+
49+ unit : Literal ["MPH" , "KPH" , "MILES" , "KILOMETERS" ]
50+ """The unit for impossible travel attributes.
51+
52+ Required when `attribute` is `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
53+
54+ For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
55+
56+ For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
57+ """
3258
3359
3460class Condition (TypedDict , total = False ):
@@ -50,6 +76,19 @@ class Condition(TypedDict, total=False):
5076 "ACCOUNT_AGE" ,
5177 "SPEND_VELOCITY_COUNT" ,
5278 "SPEND_VELOCITY_AMOUNT" ,
79+ "AMOUNT_Z_SCORE" ,
80+ "AVG_TRANSACTION_AMOUNT" ,
81+ "STDEV_TRANSACTION_AMOUNT" ,
82+ "IS_NEW_COUNTRY" ,
83+ "IS_NEW_MCC" ,
84+ "IS_FIRST_TRANSACTION" ,
85+ "CONSECUTIVE_DECLINES" ,
86+ "TIME_SINCE_LAST_TRANSACTION" ,
87+ "DISTINCT_COUNTRY_COUNT" ,
88+ "IS_NEW_MERCHANT" ,
89+ "THREE_DS_SUCCESS_RATE" ,
90+ "TRAVEL_SPEED" ,
91+ "DISTANCE_FROM_LAST_TRANSACTION" ,
5392 ]
5493 ]
5594 """The attribute to target.
@@ -106,6 +145,52 @@ class Condition(TypedDict, total=False):
106145 - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions
107146 matching the specified filters within the given period. Requires `parameters`
108147 with `scope`, `period`, and optional `filters`. Use an integer value.
148+ - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the
149+ entity's transaction history. Null if fewer than 30 approved transactions in
150+ the specified window. Requires `parameters.scope` and `parameters.interval`.
151+ Use a decimal value.
152+ - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the
153+ entity over the specified window, in cents. Requires `parameters.scope` and
154+ `parameters.interval`. Use a decimal value.
155+ - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction
156+ amounts for the entity over the specified window, in cents. Null if fewer than
157+ 30 approved transactions in the specified window. Requires `parameters.scope`
158+ and `parameters.interval`. Use a decimal value.
159+ - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen
160+ in the entity's transaction history. Valid values are `TRUE`, `FALSE`.
161+ Requires `parameters.scope`.
162+ - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's
163+ transaction history. Valid values are `TRUE`, `FALSE`. Requires
164+ `parameters.scope`.
165+ - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity.
166+ Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`.
167+ - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for
168+ the entity over the last 30 days (rolling). Requires `parameters.scope`. Use
169+ an integer value.
170+ - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved
171+ transaction for the entity, rounded to the nearest whole day. Requires
172+ `parameters.scope`. Use an integer value.
173+ - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in
174+ the entity's transaction history. Requires `parameters.scope`. Use an integer
175+ value.
176+ - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the
177+ card's approved transaction history (capped at the 1000 most recently seen
178+ merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no
179+ `parameters` required.
180+ - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
181+ a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
182+ Use a decimal value.
183+ - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance
184+ between the postal code centers of the last card-present transaction and the
185+ current transaction, divided by the elapsed time. Null if there is no prior
186+ card-present transaction, if either postal code cannot be geocoded, or if
187+ elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a
188+ decimal value.
189+ - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal
190+ code centers of the last card-present transaction and the current transaction.
191+ Null if there is no prior card-present transaction or if either postal code
192+ cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`.
193+ Use a decimal value.
109194 """
110195
111196 operation : Required [ConditionalOperation ]
@@ -115,10 +200,16 @@ class Condition(TypedDict, total=False):
115200 """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
116201
117202 parameters : ConditionParameters
118- """Additional parameters for spend velocity attributes.
119-
120- Required when `attribute` is `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`.
121- Not used for other attributes.
203+ """Additional parameters for certain attributes.
204+
205+ Required when `attribute` is `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT`
206+ (require `scope`, `period`, and optional `filters`); `AMOUNT_Z_SCORE`,
207+ `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`,
208+ `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
209+ `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`, and
210+ additionally `interval` for the statistical attributes); or `TRAVEL_SPEED` or
211+ `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other
212+ attributes.
122213 """
123214
124215
0 commit comments