-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathv2.ts
1151 lines (982 loc) · 32.4 KB
/
v2.ts
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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../../resource';
import { isRequestOptions } from '../../../core';
import * as Core from '../../../core';
import * as V2API from './v2';
import * as BacktestsAPI from './backtests';
import { BacktestCreateParams, BacktestCreateResponse, BacktestResults, Backtests } from './backtests';
import { CursorPage, type CursorPageParams } from '../../../pagination';
export class V2 extends APIResource {
backtests: BacktestsAPI.Backtests = new BacktestsAPI.Backtests(this._client);
/**
* Creates a new V2 authorization rule in draft mode
*/
create(body: V2CreateParams, options?: Core.RequestOptions): Core.APIPromise<V2CreateResponse> {
return this._client.post('/v2/auth_rules', { body, ...options });
}
/**
* Fetches a V2 authorization rule by its token
*/
retrieve(authRuleToken: string, options?: Core.RequestOptions): Core.APIPromise<V2RetrieveResponse> {
return this._client.get(`/v2/auth_rules/${authRuleToken}`, options);
}
/**
* Updates a V2 authorization rule's properties
*
* If `account_tokens`, `card_tokens`, `program_level`, or `excluded_card_tokens`
* is provided, this will replace existing associations with the provided list of
* entities.
*/
update(
authRuleToken: string,
body: V2UpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<V2UpdateResponse> {
return this._client.patch(`/v2/auth_rules/${authRuleToken}`, { body, ...options });
}
/**
* Lists V2 authorization rules
*/
list(
query?: V2ListParams,
options?: Core.RequestOptions,
): Core.PagePromise<V2ListResponsesCursorPage, V2ListResponse>;
list(options?: Core.RequestOptions): Core.PagePromise<V2ListResponsesCursorPage, V2ListResponse>;
list(
query: V2ListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<V2ListResponsesCursorPage, V2ListResponse> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/v2/auth_rules', V2ListResponsesCursorPage, { query, ...options });
}
/**
* Deletes a V2 authorization rule
*/
del(authRuleToken: string, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.delete(`/v2/auth_rules/${authRuleToken}`, options);
}
/**
* Associates a V2 authorization rule with a card program, the provided account(s)
* or card(s).
*
* Prefer using the `PATCH` method for this operation.
*/
apply(
authRuleToken: string,
body: V2ApplyParams,
options?: Core.RequestOptions,
): Core.APIPromise<V2ApplyResponse> {
return this._client.post(`/v2/auth_rules/${authRuleToken}/apply`, { body, ...options });
}
/**
* Creates a new draft version of a rule that will be ran in shadow mode.
*
* This can also be utilized to reset the draft parameters, causing a draft version
* to no longer be ran in shadow mode.
*/
draft(
authRuleToken: string,
body: V2DraftParams,
options?: Core.RequestOptions,
): Core.APIPromise<V2DraftResponse> {
return this._client.post(`/v2/auth_rules/${authRuleToken}/draft`, { body, ...options });
}
/**
* Promotes the draft version of an authorization rule to the currently active
* version such that it is enforced in the authorization stream.
*/
promote(authRuleToken: string, options?: Core.RequestOptions): Core.APIPromise<V2PromoteResponse> {
return this._client.post(`/v2/auth_rules/${authRuleToken}/promote`, options);
}
/**
* Requests a performance report of an authorization rule to be asynchronously
* generated. Reports can only be run on rules in draft or active mode and will
* included approved and declined statistics as well as examples. The generated
* report will be delivered asynchronously through a webhook with `event_type` =
* `auth_rules.performance_report.created`. See the docs on setting up
* [webhook subscriptions](https://docs.lithic.com/docs/events-api).
*
* Reports are generated based on data collected by Lithic's authorization
* processing system in the trailing week. The performance of the auth rule will be
* assessed on the configuration of the auth rule at the time the report is
* requested. This implies that if a performance report is requested, right after
* updating an auth rule, depending on the number of authorizations processed for a
* card program, it may be the case that no data is available for the report.
* Therefore Lithic recommends to decouple making updates to an Auth Rule, and
* requesting performance reports.
*
* To make this concrete, consider the following example:
*
* 1. At time `t`, a new Auth Rule is created, and applies to all authorizations on
* a card program. The Auth Rule has not yet been promoted, causing the draft
* version of the rule to be applied in shadow mode.
* 2. At time `t + 1 hour` a performance report is requested for the Auth Rule.
* This performance report will _only_ contain data for the Auth Rule being
* executed in the window between `t` and `t + 1 hour`. This is because Lithic's
* transaction processing system will only start capturing data for the Auth
* Rule at the time it is created.
* 3. At time `t + 2 hours` the draft version of the Auth Rule is promoted to the
* active version of the Auth Rule by calling the
* `/v2/auth_rules/{auth_rule_token}/promote` endpoint. If a performance report
* is requested at this moment it will still only contain data for this version
* of the rule, but the window of available data will now span from `t` to
* `t + 2 hours`.
* 4. At time `t + 3 hours` a new version of the rule is drafted by calling the
* `/v2/auth_rules/{auth_rule_token}/draft` endpoint. If a performance report is
* requested right at this moment, it will only contain data for authorizations
* to which both the active version and the draft version is applied. Lithic
* does this to ensure that performance reports represent a fair comparison
* between rules. Because there may be no authorizations in this window, and
* because there may be some lag before data is available in a performance
* report, the requested performance report could contain no to little data.
* 5. At time `t + 4 hours` another performance report is requested: this time the
* performance report will contain data from the window between `t + 3 hours`
* and `t + 4 hours`, for any authorizations to which both the current version
* of the authorization rule (in enforcing mode) and the draft version of the
* authorization rule (in shadow mode) applied.
*
* Note that generating a report may take up to 15 minutes and that delivery is not
* guaranteed. Customers are required to have created an event subscription to
* receive the webhook. Additionally, there is a delay of approximately 15 minutes
* between when Lithic's transaction processing systems have processed the
* transaction, and when a transaction will be included in the report.
*/
report(authRuleToken: string, options?: Core.RequestOptions): Core.APIPromise<V2ReportResponse> {
return this._client.post(`/v2/auth_rules/${authRuleToken}/report`, options);
}
}
export class V2ListResponsesCursorPage extends CursorPage<V2ListResponse> {}
export interface AuthRule {
/**
* Globally unique identifier.
*/
token: string;
/**
* Indicates whether the Auth Rule is ACTIVE or INACTIVE
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* Array of account_token(s) identifying the accounts that the Auth Rule applies
* to. Note that only this field or `card_tokens` can be provided for a given Auth
* Rule.
*/
account_tokens?: Array<string>;
/**
* Countries in which the Auth Rule permits transactions. Note that Lithic
* maintains a list of countries in which all transactions are blocked; "allowing"
* those countries in an Auth Rule does not override the Lithic-wide restrictions.
*/
allowed_countries?: Array<string>;
/**
* Merchant category codes for which the Auth Rule permits transactions.
*/
allowed_mcc?: Array<string>;
/**
* Countries in which the Auth Rule automatically declines transactions.
*/
blocked_countries?: Array<string>;
/**
* Merchant category codes for which the Auth Rule automatically declines
* transactions.
*/
blocked_mcc?: Array<string>;
/**
* Array of card_token(s) identifying the cards that the Auth Rule applies to. Note
* that only this field or `account_tokens` can be provided for a given Auth Rule.
*/
card_tokens?: Array<string>;
/**
* Boolean indicating whether the Auth Rule is applied at the program level.
*/
program_level?: boolean;
}
export interface AuthRuleCondition {
/**
* The attribute to target.
*
* The following attributes may be targeted:
*
* - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
* business by the types of goods or services it provides.
* - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
* ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
* Netherlands Antilles.
* - `CURRENCY`: 3-digit alphabetic ISO 4217 code for the merchant currency of the
* transaction.
* - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
* (merchant).
* - `DESCRIPTOR`: Short description of card acceptor.
* - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer
* applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or
* `TOKEN_AUTHENTICATED`.
* - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number
* (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`,
* `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`,
* `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`,
* `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`.
* - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
* fee field in the settlement/cardholder billing currency. This is the amount
* the issuer should authorize against unless the issuer is paying the acquirer
* fee on behalf of the cardholder.
* - `RISK_SCORE`: Network-provided score assessing risk level associated with a
* given authorization. Scores are on a range of 0-999, with 0 representing the
* lowest risk and 999 representing the highest risk. For Visa transactions,
* where the raw score has a range of 0-99, Lithic will normalize the score by
* multiplying the raw score by 10x.
* - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
* trailing hour up and until the authorization.
* - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
* trailing 24 hours up and until the authorization.
* - `CARD_STATE`: The current state of the card associated with the transaction.
* Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
* `PENDING_FULFILLMENT`.
*/
attribute?: ConditionalAttribute;
/**
* The operation to apply to the attribute
*/
operation?:
| 'IS_ONE_OF'
| 'IS_NOT_ONE_OF'
| 'MATCHES'
| 'DOES_NOT_MATCH'
| 'IS_GREATER_THAN'
| 'IS_LESS_THAN';
/**
* A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
*/
value?: string | number | Array<string>;
}
/**
* The attribute to target.
*
* The following attributes may be targeted:
*
* - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a
* business by the types of goods or services it provides.
* - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all
* ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for
* Netherlands Antilles.
* - `CURRENCY`: 3-digit alphabetic ISO 4217 code for the merchant currency of the
* transaction.
* - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor
* (merchant).
* - `DESCRIPTOR`: Short description of card acceptor.
* - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer
* applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or
* `TOKEN_AUTHENTICATED`.
* - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number
* (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`,
* `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`,
* `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`,
* `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`.
* - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer
* fee field in the settlement/cardholder billing currency. This is the amount
* the issuer should authorize against unless the issuer is paying the acquirer
* fee on behalf of the cardholder.
* - `RISK_SCORE`: Network-provided score assessing risk level associated with a
* given authorization. Scores are on a range of 0-999, with 0 representing the
* lowest risk and 999 representing the highest risk. For Visa transactions,
* where the raw score has a range of 0-99, Lithic will normalize the score by
* multiplying the raw score by 10x.
* - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
* trailing hour up and until the authorization.
* - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
* trailing 24 hours up and until the authorization.
* - `CARD_STATE`: The current state of the card associated with the transaction.
* Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`,
* `PENDING_FULFILLMENT`.
*/
export type ConditionalAttribute =
| 'MCC'
| 'COUNTRY'
| 'CURRENCY'
| 'MERCHANT_ID'
| 'DESCRIPTOR'
| 'LIABILITY_SHIFT'
| 'PAN_ENTRY_MODE'
| 'TRANSACTION_AMOUNT'
| 'RISK_SCORE'
| 'CARD_TRANSACTION_COUNT_1H'
| 'CARD_TRANSACTION_COUNT_24H'
| 'CARD_STATE';
export interface ConditionalBlockParameters {
conditions: Array<AuthRuleCondition>;
}
export interface VelocityLimitParams {
filters: VelocityLimitParams.Filters;
/**
* The size of the trailing window to calculate Spend Velocity over in seconds. The
* minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days).
*/
period: number | VelocityLimitParamsPeriodWindow;
scope: 'CARD' | 'ACCOUNT';
/**
* The maximum amount of spend velocity allowed in the period in minor units (the
* smallest unit of a currency, e.g. cents for USD). Transactions exceeding this
* limit will be declined.
*/
limit_amount?: number | null;
/**
* The number of spend velocity impacting transactions may not exceed this limit in
* the period. Transactions exceeding this limit will be declined. A spend velocity
* impacting transaction is a transaction that has been authorized, and optionally
* settled, or a force post (a transaction that settled without prior
* authorization).
*/
limit_count?: number | null;
}
export namespace VelocityLimitParams {
export interface Filters {
/**
* ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation.
* Transactions not matching any of the provided will not be included in the
* calculated velocity.
*/
include_countries?: Array<string> | null;
/**
* Merchant Category Codes to include in the velocity calculation. Transactions not
* matching this MCC will not be included in the calculated velocity.
*/
include_mccs?: Array<string> | null;
}
}
/**
* The window of time to calculate Spend Velocity over.
*
* - `DAY`: Velocity over the current day since midnight Eastern Time.
* - `WEEK`: Velocity over the current week since 00:00 / 12 AM on Monday in
* Eastern Time.
* - `MONTH`: Velocity over the current month since 00:00 / 12 AM on the first of
* the month in Eastern Time.
*/
export type VelocityLimitParamsPeriodWindow = 'DAY' | 'WEEK' | 'MONTH';
export interface V2CreateResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2CreateResponse.CurrentVersion | null;
draft_version: V2CreateResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2CreateResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2RetrieveResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2RetrieveResponse.CurrentVersion | null;
draft_version: V2RetrieveResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2RetrieveResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2UpdateResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2UpdateResponse.CurrentVersion | null;
draft_version: V2UpdateResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2UpdateResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2ListResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2ListResponse.CurrentVersion | null;
draft_version: V2ListResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2ListResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2ApplyResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2ApplyResponse.CurrentVersion | null;
draft_version: V2ApplyResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2ApplyResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2DraftResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2DraftResponse.CurrentVersion | null;
draft_version: V2DraftResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2DraftResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2PromoteResponse {
/**
* Auth Rule Token
*/
token: string;
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
current_version: V2PromoteResponse.CurrentVersion | null;
draft_version: V2PromoteResponse.DraftVersion | null;
/**
* Auth Rule Name
*/
name: string | null;
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* The state of the Auth Rule
*/
state: 'ACTIVE' | 'INACTIVE';
/**
* The type of Auth Rule
*/
type: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
}
export namespace V2PromoteResponse {
export interface CurrentVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
export interface DraftVersion {
/**
* Parameters for the Auth Rule
*/
parameters: V2API.ConditionalBlockParameters | V2API.VelocityLimitParams;
/**
* The version of the rule, this is incremented whenever the rule's parameters
* change.
*/
version: number;
}
}
export interface V2ReportResponse {
report_token?: string;
}
export type V2CreateParams =
| V2CreateParams.CreateAuthRuleRequestAccountTokens
| V2CreateParams.CreateAuthRuleRequestCardTokens
| V2CreateParams.CreateAuthRuleRequestProgramLevel;
export declare namespace V2CreateParams {
export interface CreateAuthRuleRequestAccountTokens {
/**
* Account tokens to which the Auth Rule applies.
*/
account_tokens: Array<string>;
/**
* Auth Rule Name
*/
name?: string | null;
/**
* Parameters for the Auth Rule
*/
parameters?: ConditionalBlockParameters | VelocityLimitParams;
/**
* The type of Auth Rule
*/
type?: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
}
export interface CreateAuthRuleRequestCardTokens {
/**
* Card tokens to which the Auth Rule applies.
*/
card_tokens: Array<string>;
/**
* Auth Rule Name
*/
name?: string | null;
/**
* Parameters for the Auth Rule
*/
parameters?: ConditionalBlockParameters | VelocityLimitParams;
/**
* The type of Auth Rule
*/
type?: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
}
export interface CreateAuthRuleRequestProgramLevel {
/**
* Whether the Auth Rule applies to all authorizations on the card program.
*/
program_level: boolean;
/**
* Card tokens to which the Auth Rule does not apply.
*/
excluded_card_tokens?: Array<string>;
/**
* Auth Rule Name
*/
name?: string | null;
/**
* Parameters for the Auth Rule
*/
parameters?: ConditionalBlockParameters | VelocityLimitParams;
/**
* The type of Auth Rule
*/
type?: 'CONDITIONAL_BLOCK' | 'VELOCITY_LIMIT';
}
}
export type V2UpdateParams =
| V2UpdateParams.AccountLevelRule
| V2UpdateParams.CardLevelRule
| V2UpdateParams.ProgramLevelRule;
export declare namespace V2UpdateParams {
export interface AccountLevelRule {
/**
* Account tokens to which the Auth Rule applies.
*/