-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathauth-rules.ts
More file actions
300 lines (264 loc) · 9.77 KB
/
Copy pathauth-rules.ts
File metadata and controls
300 lines (264 loc) · 9.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as V2API from './v2/v2';
import {
AuthRule,
AuthRuleCondition,
AuthRuleVersion,
AuthRulesCursorPage,
BacktestStats,
CardTransactionUpdateAction,
Conditional3DSActionParameters,
ConditionalACHActionParameters,
ConditionalAttribute,
ConditionalAuthorizationActionParameters,
ConditionalAuthorizationAdjustmentParameters,
ConditionalBlockParameters,
ConditionalCardTransactionUpdateActionParameters,
ConditionalOperation,
ConditionalTokenizationActionParameters,
ConditionalValue,
EventStream,
MerchantLockParameters,
ReportStats,
RuleFeature,
SpendVelocityFilters,
TypescriptCodeParameters,
V2,
V2CreateParams,
V2DraftParams,
V2ListParams,
V2ListResultsParams,
V2ListResultsResponse,
V2ListResultsResponsesCursorPage,
V2ListVersionsResponse,
V2RetrieveFeaturesParams,
V2RetrieveFeaturesResponse,
V2RetrieveReportParams,
V2RetrieveReportResponse,
V2UpdateParams,
VelocityLimitFilters,
VelocityLimitParams,
VelocityLimitPeriod,
} from './v2/v2';
export class AuthRules extends APIResource {
v2: V2API.V2 = new V2API.V2(this._client);
}
/**
* Behavioral feature state for a card or account derived from its transaction
* history.
*
* Derived statistical features (averages, standard deviations, z-scores) are
* computed using Welford's online algorithm over approved transactions. Average
* fields are null when fewer than 5 approved transactions have been recorded.
* Standard deviation fields are null when fewer than 30 approved transactions have
* been recorded.
*
* 3DS fields (`three_ds_success_rate`, `three_ds_success_count`,
* `three_ds_total_count`) are card-scoped and will be null for account responses.
*
* Raw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are
* included so clients can compute their own transaction-specific derivations, such
* as checking whether a new transaction's country is in `seen_countries` to
* determine `is_new_country`, or computing a z-score using the raw mean and M2
* values.
*/
export interface SignalsResponse {
/**
* The Welford M2 accumulator for lifetime approved transaction amounts. Used
* together with `avg_transaction_amount` and `approved_txn_count` to compute the
* z-score of a new transaction amount (variance = M2 / (count - 1)).
*/
approved_txn_amount_m2: number | null;
/**
* The Welford M2 accumulator for approved transaction amounts over the last 30
* days.
*/
approved_txn_amount_m2_30d: number | null;
/**
* The Welford M2 accumulator for approved transaction amounts over the last 7
* days.
*/
approved_txn_amount_m2_7d: number | null;
/**
* The Welford M2 accumulator for approved transaction amounts over the last 90
* days.
*/
approved_txn_amount_m2_90d: number | null;
/**
* The total number of approved transactions over the entity's lifetime.
*/
approved_txn_count: number | null;
/**
* The number of approved transactions in the last 30 days.
*/
approved_txn_count_30d: number | null;
/**
* The number of approved transactions in the last 7 days.
*/
approved_txn_count_7d: number | null;
/**
* The number of approved transactions in the last 90 days.
*/
approved_txn_count_90d: number | null;
/**
* The average approved transaction amount over the entity's lifetime, in cents.
* Null if fewer than 5 approved transactions have been recorded.
*/
avg_transaction_amount: number | null;
/**
* The average approved transaction amount over the last 30 days, in cents. Null if
* fewer than 5 approved transactions in window.
*/
avg_transaction_amount_30d: number | null;
/**
* The average approved transaction amount over the last 7 days, in cents. Null if
* fewer than 5 approved transactions in window.
*/
avg_transaction_amount_7d: number | null;
/**
* The average approved transaction amount over the last 90 days, in cents. Null if
* fewer than 5 approved transactions in window.
*/
avg_transaction_amount_90d: number | null;
/**
* The number of distinct merchant countries seen in the entity's transaction
* history.
*/
distinct_country_count: number | null;
/**
* The number of distinct MCCs seen in the entity's transaction history.
*/
distinct_mcc_count: number | null;
/**
* The timestamp of the first approved transaction for the entity, in ISO 8601
* format.
*/
first_txn_at: string | null;
/**
* Whether the entity has no prior transaction history. Returns true if no history
* is found. Null if transaction history exists but a first transaction timestamp
* is unavailable.
*/
is_first_transaction: boolean | null;
/**
* The merchant country of the last card-present transaction.
*/
last_cp_country: string | null;
/**
* The merchant postal code of the last card-present transaction.
*/
last_cp_postal_code: string | null;
/**
* The timestamp of the last card-present transaction, in ISO 8601 format.
*/
last_cp_timestamp: string | null;
/**
* The timestamp of the most recent approved transaction for the entity, in ISO
* 8601 format.
*/
last_txn_approved_at: string | null;
/**
* The set of merchant countries seen in the entity's transaction history. Clients
* can use this to determine whether a new transaction's country is novel (i.e.
* compute `is_new_country`).
*/
seen_countries: Array<string> | null;
/**
* The set of MCCs seen in the entity's transaction history. Clients can use this
* to determine whether a new transaction's MCC is novel (i.e. compute
* `is_new_mcc`).
*/
seen_mccs: Array<string> | null;
/**
* The set of card acceptor IDs seen in the card's approved transaction history,
* capped at the 1000 most recently seen. Null for account responses. Clients can
* use this to determine whether a new transaction's merchant is novel (i.e.
* compute `is_new_merchant`).
*/
seen_merchants: Array<string> | null;
/**
* The standard deviation of approved transaction amounts over the entity's
* lifetime, in cents. Null if fewer than 30 approved transactions have been
* recorded.
*/
stdev_transaction_amount: number | null;
/**
* The standard deviation of approved transaction amounts over the last 30 days, in
* cents. Null if fewer than 30 approved transactions in window.
*/
stdev_transaction_amount_30d: number | null;
/**
* The standard deviation of approved transaction amounts over the last 7 days, in
* cents. Null if fewer than 30 approved transactions in window.
*/
stdev_transaction_amount_7d: number | null;
/**
* The standard deviation of approved transaction amounts over the last 90 days, in
* cents. Null if fewer than 30 approved transactions in window.
*/
stdev_transaction_amount_90d: number | null;
/**
* The number of successful 3DS authentications for the card. Null for account
* responses.
*/
three_ds_success_count: number | null;
/**
* The 3DS authentication success rate for the card, as a percentage from 0.0 to
* 100.0. Null for account responses.
*/
three_ds_success_rate: number | null;
/**
* The total number of 3DS authentication attempts for the card. Null for account
* responses.
*/
three_ds_total_count: number | null;
/**
* The number of days since the last approved transaction on the entity.
*/
time_since_last_transaction_days: number | null;
}
AuthRules.V2 = V2;
export declare namespace AuthRules {
export { type SignalsResponse as SignalsResponse };
export {
V2 as V2,
type AuthRule as AuthRule,
type AuthRuleCondition as AuthRuleCondition,
type AuthRuleVersion as AuthRuleVersion,
type BacktestStats as BacktestStats,
type CardTransactionUpdateAction as CardTransactionUpdateAction,
type Conditional3DSActionParameters as Conditional3DSActionParameters,
type ConditionalACHActionParameters as ConditionalACHActionParameters,
type ConditionalAttribute as ConditionalAttribute,
type ConditionalAuthorizationActionParameters as ConditionalAuthorizationActionParameters,
type ConditionalAuthorizationAdjustmentParameters as ConditionalAuthorizationAdjustmentParameters,
type ConditionalBlockParameters as ConditionalBlockParameters,
type ConditionalCardTransactionUpdateActionParameters as ConditionalCardTransactionUpdateActionParameters,
type ConditionalOperation as ConditionalOperation,
type ConditionalTokenizationActionParameters as ConditionalTokenizationActionParameters,
type ConditionalValue as ConditionalValue,
type EventStream as EventStream,
type MerchantLockParameters as MerchantLockParameters,
type ReportStats as ReportStats,
type RuleFeature as RuleFeature,
type SpendVelocityFilters as SpendVelocityFilters,
type TypescriptCodeParameters as TypescriptCodeParameters,
type VelocityLimitFilters as VelocityLimitFilters,
type VelocityLimitParams as VelocityLimitParams,
type VelocityLimitPeriod as VelocityLimitPeriod,
type V2ListResultsResponse as V2ListResultsResponse,
type V2ListVersionsResponse as V2ListVersionsResponse,
type V2RetrieveFeaturesResponse as V2RetrieveFeaturesResponse,
type V2RetrieveReportResponse as V2RetrieveReportResponse,
type AuthRulesCursorPage as AuthRulesCursorPage,
type V2ListResultsResponsesCursorPage as V2ListResultsResponsesCursorPage,
type V2CreateParams as V2CreateParams,
type V2UpdateParams as V2UpdateParams,
type V2ListParams as V2ListParams,
type V2DraftParams as V2DraftParams,
type V2ListResultsParams as V2ListResultsParams,
type V2RetrieveFeaturesParams as V2RetrieveFeaturesParams,
type V2RetrieveReportParams as V2RetrieveReportParams,
};
}