1313
1414
1515class ConditionParameters (TypedDict , total = False ):
16- """Additional parameters required for transaction history signal attributes.
16+ """Additional parameters for certain attributes.
1717
18- Required when
19- `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
20- `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`,
21- `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT`.
18+ Required when `attribute` is one of
19+ `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`,
20+ `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`,
21+ `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`);
22+ or `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`).
2223 Not used for other attributes.
2324 """
2425
@@ -32,6 +33,16 @@ class ConditionParameters(TypedDict, total=False):
3233 scope : Literal ["CARD" , "ACCOUNT" , "BUSINESS_ACCOUNT" ]
3334 """The entity scope to evaluate the attribute against."""
3435
36+ unit : Literal ["MPH" , "KPH" , "MILES" , "KILOMETERS" ]
37+ """The unit for impossible travel attributes.
38+
39+ Required when `attribute` is `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`.
40+
41+ For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour).
42+
43+ For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`.
44+ """
45+
3546
3647class Condition (TypedDict , total = False ):
3748 attribute : Required [
@@ -73,6 +84,8 @@ class Condition(TypedDict, total=False):
7384 "DISTINCT_COUNTRY_COUNT" ,
7485 "IS_NEW_MERCHANT" ,
7586 "THREE_DS_SUCCESS_RATE" ,
87+ "TRAVEL_SPEED" ,
88+ "DISTANCE_FROM_LAST_TRANSACTION" ,
7689 ]
7790 ]
7891 """The attribute to target.
@@ -177,6 +190,15 @@ class Condition(TypedDict, total=False):
177190 `parameters` required.
178191 - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as
179192 a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required.
193+ - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance
194+ between the postal code centers of the last card-present transaction and the
195+ current transaction, divided by the elapsed time. Null if there is no prior
196+ card-present transaction, if either postal code cannot be geocoded, or if
197+ elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`.
198+ - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal
199+ code centers of the last card-present transaction and the current transaction.
200+ Null if there is no prior card-present transaction or if either postal code
201+ cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`.
180202 """
181203
182204 operation : Required [ConditionalOperation ]
@@ -186,12 +208,14 @@ class Condition(TypedDict, total=False):
186208 """A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`"""
187209
188210 parameters : ConditionParameters
189- """Additional parameters required for transaction history signal attributes.
211+ """Additional parameters for certain attributes.
190212
191213 Required when `attribute` is one of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`,
192214 `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`,
193215 `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`,
194- or `DISTINCT_COUNTRY_COUNT`. Not used for other attributes.
216+ or `DISTINCT_COUNTRY_COUNT` (require `scope`); or `TRAVEL_SPEED` or
217+ `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other
218+ attributes.
195219 """
196220
197221
0 commit comments