-
Notifications
You must be signed in to change notification settings - Fork 0
/
cards.ts
876 lines (766 loc) · 28.7 KB
/
cards.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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import * as Core from '../../core';
import { APIResource } from '../../resource';
import * as CardsAPI from './cards';
import * as FinancialTransactionsAPI from './financial-transactions';
import * as ProvisionsAPI from './provisions';
export class Cards extends APIResource {
financialTransactions: FinancialTransactionsAPI.FinancialTransactions =
new FinancialTransactionsAPI.FinancialTransactions(this._client);
provisions: ProvisionsAPI.Provisions = new ProvisionsAPI.Provisions(this._client);
/**
* Create a new virtual or physical card. Parameters `pin`, `shipping_address`, and
* `product_id` only apply to physical cards.
*/
create(params: CardCreateParams, options?: Core.RequestOptions): Core.APIPromise<CardCreateResponse> {
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
return this._client.post('/cards', {
body,
...options,
headers: {
...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
...options?.headers,
},
});
}
/**
* Get card configuration such as spend limit and state.
*/
retrieve(cardToken: string, options?: Core.RequestOptions): Core.APIPromise<CardRetrieveResponse> {
return this._client.get(`/cards/${cardToken}`, options);
}
/**
* Update the specified properties of the card. Unsupplied properties will remain
* unchanged. `pin` parameter only applies to physical cards.
*
* _Note: setting a card to a `CLOSED` state is a final action that cannot be
* undone._
*/
update(
cardToken: string,
body: CardUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<CardUpdateResponse> {
return this._client.patch(`/cards/${cardToken}`, { body, ...options });
}
}
export interface CardCreateResponse {
/**
* Globally unique identifier.
*/
token: string;
/**
* An RFC 3339 timestamp for when the card was created. UTC time zone.
*/
created: string;
funding: CardCreateResponse.Funding;
/**
* Last four digits of the card number.
*/
last_four: string;
/**
* Amount (in cents) to limit approved authorizations. Transaction requests above
* the spend limit will be declined.
*/
spend_limit: number;
/**
* Spend limit duration values:
*
* - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
* year.
* - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
* of the card.
* - `MONTHLY` - Card will authorize transactions up to spend limit for the
* trailing month. Month is calculated as this calendar date one month prior.
* - `TRANSACTION` - Card will authorize multiple transactions if each individual
* transaction is under the spend limit.
*/
spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';
/**
* Card state values:
*
* - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
* be undone.
* - `OPEN` - Card will approve authorizations (if they match card and account
* parameters).
* - `PAUSED` - Card will decline authorizations, but can be resumed at a later
* time.
* - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The
* card is provisioned pending manufacturing and fulfillment. Cards in this state
* can accept authorizations for e-commerce purchases, but not for "Card Present"
* purchases where the physical card itself is present.
* - `PENDING_ACTIVATION` - Each business day at 2pm Eastern Time Zone (ET), cards
* of type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card
* production warehouse and updated to state `PENDING_ACTIVATION` . Similar to
* `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce
* transactions. API clients should update the card's state to `OPEN` only after
* the cardholder confirms receipt of the card.
*
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually
* manufactured.
*/
state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT';
/**
* Card types:
*
* - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
* wallet like Apple Pay or Google Pay (if the card program is digital
* wallet-enabled).
* - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
* branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
* Reach out at [acme.com/contact](https://acme.com/contact) for more
* information.
* - `SINGLE_USE` - Card is closed upon first successful authorization.
* - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
* successfully authorizes the card.
*/
type: 'VIRTUAL' | 'PHYSICAL' | 'MERCHANT_LOCKED' | 'SINGLE_USE';
/**
* List of identifiers for the Auth Rule(s) that are applied on the card.
*/
auth_rule_tokens?: Array<string>;
/**
* Three digit cvv printed on the back of the card.
*/
cvv?: string;
/**
* Specifies the digital card art to be displayed in the user’s digital wallet
* after tokenization. This artwork must be approved by Mastercard and configured
* by Acme to use. See
* [Flexible Card Art Guide](https://docs.acme.com/docs/about-digital-wallets#flexible-card-art).
*/
digital_card_art_token?: string;
/**
* Two digit (MM) expiry month.
*/
exp_month?: string;
/**
* Four digit (yyyy) expiry year.
*/
exp_year?: string;
/**
* Hostname of card’s locked merchant (will be empty if not applicable).
*/
hostname?: string;
/**
* Friendly name to identify the card. We recommend against using this field to
* store JSON data as it can cause unexpected behavior.
*/
memo?: string;
/**
* Primary Account Number (PAN) (i.e. the card number). Customers must be PCI
* compliant to have PAN returned as a field in production. Please contact
* [[email protected]](mailto:[email protected]) for questions.
*/
pan?: string;
}
export namespace CardCreateResponse {
export interface Funding {
/**
* A globally unique identifier for this FundingAccount.
*/
token: string;
/**
* An RFC 3339 string representing when this funding source was added to the Acme
* account. This may be `null`. UTC time zone.
*/
created: string;
/**
* The last 4 digits of the account (e.g. bank account, debit card) associated with
* this FundingAccount. This may be null.
*/
last_four: string;
/**
* State of funding source.
*
* Funding source states:
*
* - `ENABLED` - The funding account is available to use for card creation and
* transactions.
* - `PENDING` - The funding account is still being verified e.g. bank
* micro-deposits verification.
* - `DELETED` - The founding account has been deleted.
*/
state: 'ENABLED' | 'PENDING' | 'DELETED';
/**
* Types of funding source:
*
* - `DEPOSITORY_CHECKING` - Bank checking account.
* - `DEPOSITORY_SAVINGS` - Bank savings account.
*/
type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS';
/**
* Account name identifying the funding source. This may be `null`.
*/
account_name?: string;
/**
* The nickname given to the `FundingAccount` or `null` if it has no nickname.
*/
nickname?: string;
}
}
export interface CardRetrieveResponse {
/**
* Globally unique identifier.
*/
token: string;
/**
* An RFC 3339 timestamp for when the card was created. UTC time zone.
*/
created: string;
funding: CardRetrieveResponse.Funding;
/**
* Last four digits of the card number.
*/
last_four: string;
/**
* Amount (in cents) to limit approved authorizations. Transaction requests above
* the spend limit will be declined.
*/
spend_limit: number;
/**
* Spend limit duration values:
*
* - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
* year.
* - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
* of the card.
* - `MONTHLY` - Card will authorize transactions up to spend limit for the
* trailing month. Month is calculated as this calendar date one month prior.
* - `TRANSACTION` - Card will authorize multiple transactions if each individual
* transaction is under the spend limit.
*/
spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';
/**
* Card state values:
*
* - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
* be undone.
* - `OPEN` - Card will approve authorizations (if they match card and account
* parameters).
* - `PAUSED` - Card will decline authorizations, but can be resumed at a later
* time.
* - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The
* card is provisioned pending manufacturing and fulfillment. Cards in this state
* can accept authorizations for e-commerce purchases, but not for "Card Present"
* purchases where the physical card itself is present.
* - `PENDING_ACTIVATION` - Each business day at 2pm Eastern Time Zone (ET), cards
* of type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card
* production warehouse and updated to state `PENDING_ACTIVATION` . Similar to
* `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce
* transactions. API clients should update the card's state to `OPEN` only after
* the cardholder confirms receipt of the card.
*
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually
* manufactured.
*/
state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT';
/**
* Card types:
*
* - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
* wallet like Apple Pay or Google Pay (if the card program is digital
* wallet-enabled).
* - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
* branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
* Reach out at [acme.com/contact](https://acme.com/contact) for more
* information.
* - `SINGLE_USE` - Card is closed upon first successful authorization.
* - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
* successfully authorizes the card.
*/
type: 'VIRTUAL' | 'PHYSICAL' | 'MERCHANT_LOCKED' | 'SINGLE_USE';
/**
* List of identifiers for the Auth Rule(s) that are applied on the card.
*/
auth_rule_tokens?: Array<string>;
/**
* Three digit cvv printed on the back of the card.
*/
cvv?: string;
/**
* Specifies the digital card art to be displayed in the user’s digital wallet
* after tokenization. This artwork must be approved by Mastercard and configured
* by Acme to use. See
* [Flexible Card Art Guide](https://docs.acme.com/docs/about-digital-wallets#flexible-card-art).
*/
digital_card_art_token?: string;
/**
* Two digit (MM) expiry month.
*/
exp_month?: string;
/**
* Four digit (yyyy) expiry year.
*/
exp_year?: string;
/**
* Hostname of card’s locked merchant (will be empty if not applicable).
*/
hostname?: string;
/**
* Friendly name to identify the card. We recommend against using this field to
* store JSON data as it can cause unexpected behavior.
*/
memo?: string;
/**
* Primary Account Number (PAN) (i.e. the card number). Customers must be PCI
* compliant to have PAN returned as a field in production. Please contact
* [[email protected]](mailto:[email protected]) for questions.
*/
pan?: string;
}
export namespace CardRetrieveResponse {
export interface Funding {
/**
* A globally unique identifier for this FundingAccount.
*/
token: string;
/**
* An RFC 3339 string representing when this funding source was added to the Acme
* account. This may be `null`. UTC time zone.
*/
created: string;
/**
* The last 4 digits of the account (e.g. bank account, debit card) associated with
* this FundingAccount. This may be null.
*/
last_four: string;
/**
* State of funding source.
*
* Funding source states:
*
* - `ENABLED` - The funding account is available to use for card creation and
* transactions.
* - `PENDING` - The funding account is still being verified e.g. bank
* micro-deposits verification.
* - `DELETED` - The founding account has been deleted.
*/
state: 'ENABLED' | 'PENDING' | 'DELETED';
/**
* Types of funding source:
*
* - `DEPOSITORY_CHECKING` - Bank checking account.
* - `DEPOSITORY_SAVINGS` - Bank savings account.
*/
type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS';
/**
* Account name identifying the funding source. This may be `null`.
*/
account_name?: string;
/**
* The nickname given to the `FundingAccount` or `null` if it has no nickname.
*/
nickname?: string;
}
}
export interface CardUpdateResponse {
/**
* Globally unique identifier.
*/
token: string;
/**
* An RFC 3339 timestamp for when the card was created. UTC time zone.
*/
created: string;
funding: CardUpdateResponse.Funding;
/**
* Last four digits of the card number.
*/
last_four: string;
/**
* Amount (in cents) to limit approved authorizations. Transaction requests above
* the spend limit will be declined.
*/
spend_limit: number;
/**
* Spend limit duration values:
*
* - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
* year.
* - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
* of the card.
* - `MONTHLY` - Card will authorize transactions up to spend limit for the
* trailing month. Month is calculated as this calendar date one month prior.
* - `TRANSACTION` - Card will authorize multiple transactions if each individual
* transaction is under the spend limit.
*/
spend_limit_duration: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';
/**
* Card state values:
*
* - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
* be undone.
* - `OPEN` - Card will approve authorizations (if they match card and account
* parameters).
* - `PAUSED` - Card will decline authorizations, but can be resumed at a later
* time.
* - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The
* card is provisioned pending manufacturing and fulfillment. Cards in this state
* can accept authorizations for e-commerce purchases, but not for "Card Present"
* purchases where the physical card itself is present.
* - `PENDING_ACTIVATION` - Each business day at 2pm Eastern Time Zone (ET), cards
* of type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card
* production warehouse and updated to state `PENDING_ACTIVATION` . Similar to
* `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce
* transactions. API clients should update the card's state to `OPEN` only after
* the cardholder confirms receipt of the card.
*
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually
* manufactured.
*/
state: 'CLOSED' | 'OPEN' | 'PAUSED' | 'PENDING_ACTIVATION' | 'PENDING_FULFILLMENT';
/**
* Card types:
*
* - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
* wallet like Apple Pay or Google Pay (if the card program is digital
* wallet-enabled).
* - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
* branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
* Reach out at [acme.com/contact](https://acme.com/contact) for more
* information.
* - `SINGLE_USE` - Card is closed upon first successful authorization.
* - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
* successfully authorizes the card.
*/
type: 'VIRTUAL' | 'PHYSICAL' | 'MERCHANT_LOCKED' | 'SINGLE_USE';
/**
* List of identifiers for the Auth Rule(s) that are applied on the card.
*/
auth_rule_tokens?: Array<string>;
/**
* Three digit cvv printed on the back of the card.
*/
cvv?: string;
/**
* Specifies the digital card art to be displayed in the user’s digital wallet
* after tokenization. This artwork must be approved by Mastercard and configured
* by Acme to use. See
* [Flexible Card Art Guide](https://docs.acme.com/docs/about-digital-wallets#flexible-card-art).
*/
digital_card_art_token?: string;
/**
* Two digit (MM) expiry month.
*/
exp_month?: string;
/**
* Four digit (yyyy) expiry year.
*/
exp_year?: string;
/**
* Hostname of card’s locked merchant (will be empty if not applicable).
*/
hostname?: string;
/**
* Friendly name to identify the card. We recommend against using this field to
* store JSON data as it can cause unexpected behavior.
*/
memo?: string;
/**
* Primary Account Number (PAN) (i.e. the card number). Customers must be PCI
* compliant to have PAN returned as a field in production. Please contact
* [[email protected]](mailto:[email protected]) for questions.
*/
pan?: string;
}
export namespace CardUpdateResponse {
export interface Funding {
/**
* A globally unique identifier for this FundingAccount.
*/
token: string;
/**
* An RFC 3339 string representing when this funding source was added to the Acme
* account. This may be `null`. UTC time zone.
*/
created: string;
/**
* The last 4 digits of the account (e.g. bank account, debit card) associated with
* this FundingAccount. This may be null.
*/
last_four: string;
/**
* State of funding source.
*
* Funding source states:
*
* - `ENABLED` - The funding account is available to use for card creation and
* transactions.
* - `PENDING` - The funding account is still being verified e.g. bank
* micro-deposits verification.
* - `DELETED` - The founding account has been deleted.
*/
state: 'ENABLED' | 'PENDING' | 'DELETED';
/**
* Types of funding source:
*
* - `DEPOSITORY_CHECKING` - Bank checking account.
* - `DEPOSITORY_SAVINGS` - Bank savings account.
*/
type: 'DEPOSITORY_CHECKING' | 'DEPOSITORY_SAVINGS';
/**
* Account name identifying the funding source. This may be `null`.
*/
account_name?: string;
/**
* The nickname given to the `FundingAccount` or `null` if it has no nickname.
*/
nickname?: string;
}
}
export interface CardCreateParams {
/**
* Body param: Card types:
*
* - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
* wallet like Apple Pay or Google Pay (if the card program is digital
* wallet-enabled).
* - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
* branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
* Reach out at [acme.com/contact](https://acme.com/contact) for more
* information.
* - `SINGLE_USE` - Card is closed upon first successful authorization.
* - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that
* successfully authorizes the card.
*/
type: 'VIRTUAL' | 'PHYSICAL' | 'MERCHANT_LOCKED' | 'SINGLE_USE';
/**
* Body param: Globally unique identifier for the account that the card will be
* associated with. Required for programs enrolling users using the
* [/account_holders endpoint](https://docs.acme.com/docs/account-holders-kyc). See
* [Managing Your Program](doc:managing-your-program) for more information.
*/
account_token?: string;
/**
* Body param: For card programs with more than one BIN range. This must be
* configured with Acme before use. Identifies the card program/BIN range under
* which to create the card. If omitted, will utilize the program's default
* `card_program_token`. In Sandbox, use 00000000-0000-0000-1000-000000000000 and
* 00000000-0000-0000-2000-000000000000 to test creating cards on specific card
* programs.
*/
card_program_token?: string;
/**
* Body param:
*/
carrier?: CardCreateParams.Carrier;
/**
* Body param: Specifies the digital card art to be displayed in the user’s digital
* wallet after tokenization. This artwork must be approved by Mastercard and
* configured by Acme to use. See
* [Flexible Card Art Guide](https://docs.acme.com/docs/about-digital-wallets#flexible-card-art).
*/
digital_card_art_token?: string;
/**
* Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year`
* is provided, an expiration date will be generated.
*/
exp_month?: string;
/**
* Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year`
* is provided, an expiration date will be generated.
*/
exp_year?: string;
/**
* Body param: Friendly name to identify the card. We recommend against using this
* field to store JSON data as it can cause unexpected behavior.
*/
memo?: string;
/**
* Body param: Encrypted PIN block (in base64). Only applies to cards of type
* `PHYSICAL` and `VIRTUAL`. See
* [Encrypted PIN Block](https://docs.acme.com/docs/cards#encrypted-pin-block-enterprise).
*/
pin?: string;
/**
* Body param: Only applicable to cards of type `PHYSICAL`. This must be configured
* with Acme before use. Specifies the configuration (i.e., physical card art) that
* the card should be manufactured with.
*/
product_id?: string;
/**
* Body param:
*/
shipping_address?: CardCreateParams.ShippingAddress;
/**
* Body param: Shipping method for the card. Only applies to cards of type
* PHYSICAL. Use of options besides `STANDARD` require additional permissions.
*
* - `STANDARD` - USPS regular mail or similar international option, with no
* tracking
* - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
* with tracking
* - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking
* - `EXPRESS` - FedEx Express, 3-day shipping, with tracking
* - `2_DAY` - FedEx 2-day shipping, with tracking
* - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
* tracking
*/
shipping_method?: 'STANDARD' | 'STANDARD_WITH_TRACKING' | 'PRIORITY' | 'EXPRESS' | '2_DAY' | 'EXPEDITED';
/**
* Body param: Amount (in cents) to limit approved authorizations. Transaction
* requests above the spend limit will be declined. Note that a spend limit of 0 is
* effectively no limit, and should only be used to reset or remove a prior limit.
* Only a limit of 1 or above will result in declined transactions due to checks
* against the card limit.
*/
spend_limit?: number;
/**
* Body param: Spend limit duration values:
*
* - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
* year.
* - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
* of the card.
* - `MONTHLY` - Card will authorize transactions up to spend limit for the
* trailing month. Month is calculated as this calendar date one month prior.
* - `TRANSACTION` - Card will authorize multiple transactions if each individual
* transaction is under the spend limit.
*/
spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';
/**
* Body param: Card state values:
*
* - `OPEN` - Card will approve authorizations (if they match card and account
* parameters).
* - `PAUSED` - Card will decline authorizations, but can be resumed at a later
* time.
*/
state?: 'OPEN' | 'PAUSED';
/**
* Header param: Idempotency key for the POST request. See
* [Idempotency Requests](https://docs.acme.com/docs/idempotent-requests) for
* details on behavior such as cache duration.
*/
'Idempotency-Key'?: string;
}
export namespace CardCreateParams {
export interface Carrier {
/**
* QR code url to display on the card carrier
*/
qr_code_url?: string;
}
export interface ShippingAddress {
/**
* Valid USPS routable address.
*/
address1: string;
/**
* City
*/
city: string;
/**
* Uppercase ISO 3166-1 alpha-3 three character abbreviation.
*/
country: string;
/**
* Customer's first name. This will be the first name printed on the physical card.
*/
first_name: string;
/**
* Customer's surname (family name). This will be the last name printed on the
* physical card.
*/
last_name: string;
/**
* Postal code (formerly zipcode). For US addresses, either five-digit zipcode or
* nine-digit "ZIP+4".
*/
postal_code: string;
/**
* Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a
* limit of 24 characters for other countries.
*/
state: string;
/**
* Unit number (if applicable).
*/
address2?: string;
/**
* Email address to be contacted for expedited shipping process purposes. Required
* if `shipping_method` is `EXPEDITED`.
*/
email?: string;
/**
* Text to be printed on line two of the physical card. Use of this field requires
* additional permissions.
*/
line2_text?: string;
/**
* Cardholder's phone number in E.164 format to be contacted for expedited shipping
* process purposes. Required if `shipping_method` is `EXPEDITED`.
*/
phone_number?: string;
}
}
export interface CardUpdateParams {
/**
* Identifier for any Auth Rules that will be applied to transactions taking place
* with the card.
*/
auth_rule_token?: string;
/**
* Specifies the digital card art to be displayed in the user’s digital wallet
* after tokenization. This artwork must be approved by Mastercard and configured
* by Acme to use. See
* [Flexible Card Art Guide](https://docs.acme.com/docs/about-digital-wallets#flexible-card-art).
*/
digital_card_art_token?: string;
/**
* Friendly name to identify the card. We recommend against using this field to
* store JSON data as it can cause unexpected behavior.
*/
memo?: string;
/**
* Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and
* `VIRTUAL`. See
* [Encrypted PIN Block](https://docs.acme.com/docs/cards#encrypted-pin-block-enterprise).
*/
pin?: string;
/**
* Amount (in cents) to limit approved authorizations. Transaction requests above
* the spend limit will be declined. Note that a spend limit of 0 is effectively no
* limit, and should only be used to reset or remove a prior limit. Only a limit of
* 1 or above will result in declined transactions due to checks against the card
* limit.
*/
spend_limit?: number;
/**
* Spend limit duration values:
*
* - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
* year.
* - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
* of the card.
* - `MONTHLY` - Card will authorize transactions up to spend limit for the
* trailing month. Month is calculated as this calendar date one month prior.
* - `TRANSACTION` - Card will authorize multiple transactions if each individual
* transaction is under the spend limit.
*/
spend_limit_duration?: 'ANNUALLY' | 'FOREVER' | 'MONTHLY' | 'TRANSACTION';
/**
* Card state values:
*
* - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
* be undone.
* - `OPEN` - Card will approve authorizations (if they match card and account
* parameters).
* - `PAUSED` - Card will decline authorizations, but can be resumed at a later
* time.
*/
state?: 'CLOSED' | 'OPEN' | 'PAUSED';
}
export namespace Cards {
export import CardCreateResponse = CardsAPI.CardCreateResponse;
export import CardRetrieveResponse = CardsAPI.CardRetrieveResponse;
export import CardUpdateResponse = CardsAPI.CardUpdateResponse;
export import CardCreateParams = CardsAPI.CardCreateParams;
export import CardUpdateParams = CardsAPI.CardUpdateParams;
export import FinancialTransactions = FinancialTransactionsAPI.FinancialTransactions;
export import FinancialTransactionGetFinancialTransactionByTokenResponse = FinancialTransactionsAPI.FinancialTransactionGetFinancialTransactionByTokenResponse;
export import Provisions = ProvisionsAPI.Provisions;
export import ProvisionPostProvisionResponse = ProvisionsAPI.ProvisionPostProvisionResponse;
export import ProvisionPostProvisionParams = ProvisionsAPI.ProvisionPostProvisionParams;
}