-
Notifications
You must be signed in to change notification settings - Fork 18
/
Types.ts
3312 lines (2714 loc) · 115 KB
/
Types.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
/** Type for a bankauthorisation resource. */
export interface BankAuthorisation {
// Type of authorisation, can be either 'mandate' or 'payment'.
authorisation_type: BankAuthorisationAuthorisationType;
// Timestamp when the flow was created
created_at: string;
// Timestamp when the url will expire. Each authorisation url currently lasts
// for 15 minutes, but this can vary by bank.
expires_at: string;
// Unique identifier, beginning with "BAU".
id: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when the
// authorisation URL has been visited.
last_visited_at?: string;
// Resources linked to this BankAuthorisation.
links: BankAuthorisationLinks;
// URL that the payer can be redirected to after authorising the payment.
redirect_uri: string;
// Short URL that redirects via GoCardless to the original URL, more suitable
// for encoding in a QR code
short_url: string;
// URL for an oauth flow that will allow the user to authorise the payment
url: string;
}
/** Type for a bankauthorisationcreaterequestlinks resource. */
export interface BankAuthorisationCreateRequestLinks {
// ID of the [billing request](#billing-requests-billing-requests) against
// which this authorisation was created.
billing_request: string;
// ID of the [institution](#billing-requests-institutions) against which this
// authorisation was created.
institution: string;
// ID of the payment request against which this authorisation was created.
payment_request: string;
}
export enum BankAuthorisationAuthorisationType {
Mandate = 'mandate',
Payment = 'payment',
}
/** Type for a bankauthorisationlinks resource. */
export interface BankAuthorisationLinks {
// ID of the [billing request](#billing-requests-billing-requests) against
// which this authorisation was created.
billing_request: string;
// ID of the [institution](#billing-requests-institutions) against which this
// authorisation was created.
institution: string;
// ID of the payment request against which this authorisation was created.
payment_request: string;
}
/** Type for a bankdetailslookup resource. */
export interface BankDetailsLookup {
// Array of [schemes](#mandates_scheme) supported for this bank account. This
// will be an empty array if the bank account is not reachable by any schemes.
available_debit_schemes: BankDetailsLookupAvailableDebitScheme[];
// The name of the bank with which the account is held (if available).
bank_name?: string;
// ISO 9362 SWIFT BIC of the bank with which the account is held.
//
// <p class="notice">Even if no BIC is returned for an account, GoCardless may
// still be able to collect payments from it - you should refer to the
// `available_debit_schemes` attribute to determine reachability.</p>
bic?: string;
}
export enum BankDetailsLookupAvailableDebitScheme {
Ach = 'ach',
Autogiro = 'autogiro',
Bacs = 'bacs',
Becs = 'becs',
BecsNz = 'becs_nz',
Betalingsservice = 'betalingsservice',
Pad = 'pad',
SepaCore = 'sepa_core',
}
/** Type for a billingrequest resource. */
export interface BillingRequest {
// List of actions that can be performed before this billing request can be
// fulfilled.
actions: BillingRequestAction[];
// Should the billing request be fulfilled as soon as it's ready
auto_fulfil: boolean;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// Unique identifier, beginning with "PY".
id: string;
// Resources linked to this BillingRequest.
links: BillingRequestLinks;
// Request for a mandate
mandate_request: BillingRequestMandateRequest;
// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata: JsonMap;
// Request for a one-off strongly authorised payment
payment_request: BillingRequestPaymentRequest;
//
resources: BillingRequestResources;
// One of:
// <ul>
// <li>`pending`: the billing_request is pending and can be used</li>
// <li>`ready_to_fulfil`: the billing_request is ready to fulfil</li>
// <li>`fulfilled`: the billing_request has been fulfilled and a payment
// created</li>
// <li>`cancelled`: the billing_request has been cancelled and cannot be
// used</li>
// </ul>
status: BillingRequestStatus;
}
/** Type for a billingrequestcreaterequestlinks resource. */
export interface BillingRequestCreateRequestLinks {
// ID of the [customer](#core-endpoints-customers) against which this request
// should be made.
customer: string;
// (Optional) ID of the
// [customer_bank_account](#core-endpoints-customer-bank-accounts) against
// which this request should be made.
//
customer_bank_account: string;
}
/** Type for a billingrequestmandaterequest resource. */
export interface BillingRequestMandateRequest {
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently only "GBP" is supported as we only have one scheme that is
// per_payment_authorised.
currency: string;
// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
scheme?: string;
}
/** Type for a billingrequestpaymentrequest resource. */
export interface BillingRequestPaymentRequest {
// Amount in minor unit (e.g. pence in GBP, cents in EUR).
amount: string;
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently only "GBP" is supported as we only have one scheme that is
// per_payment_authorised.
currency: string;
// A human-readable description of the payment. This will be displayed to the
// payer when authorising the billing request.
//
description?: string;
}
/** Type for a billingrequestcustomer resource. */
export interface BillingRequestCustomer {
// Customer's company name. Required unless a `given_name` and `family_name`
// are provided. For Canadian customers, the use of a `company_name` value
// will mean that any mandate created from this customer will be considered to
// be a "Business PAD" (otherwise, any mandate will be considered to be a
// "Personal PAD").
company_name?: string;
// Customer's email address. Required in most cases, as this allows GoCardless
// to send notifications to this customer.
email?: string;
// Customer's surname. Required unless a `company_name` is provided.
family_name?: string;
// Customer's first name. Required unless a `company_name` is provided.
given_name?: string;
// [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code.
// Used as the language for notification emails sent by GoCardless if your
// organisation does not send its own (see [compliance
// requirements](#appendix-compliance-requirements)). Currently only "en",
// "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported.
// If this is not provided, the language will be chosen based on the
// `country_code` (if supplied) or default to "en".
language?: string;
// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata: JsonMap;
// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number,
// including country code.
phone_number?: string;
}
/** Type for a billingrequestcustomerbillingdetail resource. */
export interface BillingRequestCustomerBillingDetail {
// The first line of the customer's address.
address_line1?: string;
// The second line of the customer's address.
address_line2?: string;
// The third line of the customer's address.
address_line3?: string;
// The city of the customer's address.
city?: string;
// [ISO 3166-1 alpha-2
// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
country_code?: string;
// For Danish customers only. The civic/company number (CPR or CVR) of the
// customer. Must be supplied if the customer's bank account is denominated in
// Danish krone (DKK).
danish_identity_number?: string;
// The customer's postal code.
postal_code?: string;
// The customer's address region, county or department. For US customers a 2
// letter [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
// code is required (e.g. `CA` for California).
region?: string;
// For Swedish customers only. The civic/company number (personnummer,
// samordningsnummer, or organisationsnummer) of the customer. Must be
// supplied if the customer's bank account is denominated in Swedish krona
// (SEK). This field cannot be changed once it has been set.
swedish_identity_number?: string;
}
export enum BillingRequestAccountType {
Savings = 'savings',
Checking = 'checking',
}
export enum BillingRequestNotificationType {
Email = 'email',
}
/** Type for a billingrequestaction resource. */
export interface BillingRequestAction {
// Which other action types this action can complete.
completes_actions: string[];
// Informs you whether the action is required to fulfil the billing request or
// not.
required: boolean;
// Requires completing these actions before this action can be completed.
requires_actions: string[];
// Unique identifier for the action.
type: BillingRequestActionType;
}
export enum BillingRequestActionType {
ChooseCurrency = 'choose_currency',
CollectCustomerDetails = 'collect_customer_details',
CollectBankAccountDetails = 'collect_bank_account_details',
PaymentBankAuthorisation = 'payment_bank_authorisation',
MandateBankAuthorisation = 'mandate_bank_authorisation',
}
/** Type for a billingrequestlinks resource. */
export interface BillingRequestLinks {
// ID of the [customer](#core-endpoints-customers) that will be used for this
// request
customer: string;
// (Optional) ID of the
// [customer_bank_account](#core-endpoints-customer-bank-accounts) that will
// be used for this request
customer_bank_account: string;
// ID of the customer billing detail that will be used for this request
customer_billing_detail: string;
// (Optional) ID of the [mandate bank
// authorisation](#billing-requests-bank-authorisations) that was used to
// verify this request.
mandate_bank_authorisation: string;
// (Optional) ID of the [payment bank
// authorisation](#billing-requests-bank-authorisations) that was used to
// verify this request.
payment_bank_authorisation: string;
}
/** Type for a billingrequestmandaterequest resource. */
export interface BillingRequestMandateRequest {
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently only "GBP" is supported as we only have one scheme that is
// per_payment_authorised.
currency: string;
// Resources linked to this BillingRequestMandateRequest.
links: BillingRequestMandateRequestLinks;
// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
scheme?: string;
}
/** Type for a billingrequestmandaterequestlinks resource. */
export interface BillingRequestMandateRequestLinks {
// (Optional) ID of the [mandate](#core-endpoints-mandates) that was created
// from this mandate request. this mandate request.
//
mandate: string;
}
/** Type for a billingrequestpaymentrequest resource. */
export interface BillingRequestPaymentRequest {
// Amount in minor unit (e.g. pence in GBP, cents in EUR).
amount: string;
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently only "GBP" is supported as we only have one scheme that is
// per_payment_authorised.
currency: string;
// A human-readable description of the payment. This will be displayed to the
// payer when authorising the billing request.
//
description?: string;
// Resources linked to this BillingRequestPaymentRequest.
links: BillingRequestPaymentRequestLinks;
// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
scheme?: string;
}
/** Type for a billingrequestpaymentrequestlinks resource. */
export interface BillingRequestPaymentRequestLinks {
// (Optional) ID of the [payment](#core-endpoints-payments) that was created
// from this payment request.
payment: string;
}
/** Type for a billingrequestresources resource. */
export interface BillingRequestResources {
// Embedded customer
customer: BillingRequestResourcesCustomer;
// Embedded customer bank account, only if a bank account is linked
customer_bank_account?: BillingRequestResourcesCustomerBankAccount;
// Embedded customer billing detail
customer_billing_detail: BillingRequestResourcesCustomerBillingDetail;
}
/** Type for a billingrequestresourcescustomer resource. */
export interface BillingRequestResourcesCustomer {
// Customer's company name. Required unless a `given_name` and `family_name`
// are provided. For Canadian customers, the use of a `company_name` value
// will mean that any mandate created from this customer will be considered to
// be a "Business PAD" (otherwise, any mandate will be considered to be a
// "Personal PAD").
company_name?: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// Customer's email address. Required in most cases, as this allows GoCardless
// to send notifications to this customer.
email?: string;
// Customer's surname. Required unless a `company_name` is provided.
family_name?: string;
// Customer's first name. Required unless a `company_name` is provided.
given_name?: string;
// Unique identifier, beginning with "CU".
id: string;
// [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code.
// Used as the language for notification emails sent by GoCardless if your
// organisation does not send its own (see [compliance
// requirements](#appendix-compliance-requirements)). Currently only "en",
// "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported.
// If this is not provided, the language will be chosen based on the
// `country_code` (if supplied) or default to "en".
language?: string;
// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata: JsonMap;
// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number,
// including country code.
phone_number?: string;
}
/** Type for a billingrequestresourcescustomerbankaccount resource. */
export interface BillingRequestResourcesCustomerBankAccount {
// Name of the account holder, as known by the bank. Usually this is the same
// as the name stored with the linked [creditor](#core-endpoints-creditors).
// This field will be transliterated, upcased and truncated to 18 characters.
// This field is required unless the request includes a [customer bank account
// token](#javascript-flow-customer-bank-account-tokens).
account_holder_name: string;
// The last few digits of the account number. Currently 4 digits for NZD bank
// accounts and 2 digits for other currencies.
account_number_ending: string;
// Bank account type. Required for USD-denominated bank accounts. Must not be
// provided for bank accounts in other currencies. See [local
// details](#local-bank-details-united-states) for more information.
account_type: BillingRequestResourcesCustomerBankAccountAccountType;
// Name of bank, taken from the bank details.
bank_name: string;
// [ISO 3166-1 alpha-2
// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
// Defaults to the country code of the `iban` if supplied, otherwise is
// required.
country_code?: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD"
// are supported.
currency?: string;
// Boolean value showing whether the bank account is enabled or disabled.
enabled: boolean;
// Unique identifier, beginning with "BA".
id: string;
// Resources linked to this BillingRequestResourcesCustomerBankAccount.
links: BillingRequestResourcesCustomerBankAccountLinks;
// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata: JsonMap;
}
export enum BillingRequestResourcesCustomerBankAccountAccountType {
Savings = 'savings',
Checking = 'checking',
}
/** Type for a billingrequestresourcescustomerbankaccountlinks resource. */
export interface BillingRequestResourcesCustomerBankAccountLinks {
// ID of the [customer](#core-endpoints-customers) that owns this bank
// account.
customer: string;
}
/** Type for a billingrequestresourcescustomerbillingdetail resource. */
export interface BillingRequestResourcesCustomerBillingDetail {
// The first line of the customer's address.
address_line1?: string;
// The second line of the customer's address.
address_line2?: string;
// The third line of the customer's address.
address_line3?: string;
// The city of the customer's address.
city?: string;
// [ISO 3166-1 alpha-2
// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
country_code?: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// For Danish customers only. The civic/company number (CPR or CVR) of the
// customer. Must be supplied if the customer's bank account is denominated in
// Danish krone (DKK).
danish_identity_number?: string;
// Unique identifier, beginning with "CU".
id: string;
// The customer's postal code.
postal_code?: string;
// The customer's address region, county or department. For US customers a 2
// letter [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
// code is required (e.g. `CA` for California).
region?: string;
// The schemes associated with this customer billing detail
schemes: string[];
// For Swedish customers only. The civic/company number (personnummer,
// samordningsnummer, or organisationsnummer) of the customer. Must be
// supplied if the customer's bank account is denominated in Swedish krona
// (SEK). This field cannot be changed once it has been set.
swedish_identity_number?: string;
}
export enum BillingRequestStatus {
Pending = 'pending',
ReadyToFulfil = 'ready_to_fulfil',
Fulfilled = 'fulfilled',
Cancelled = 'cancelled',
}
/** Type for a billingrequestflow resource. */
export interface BillingRequestFlow {
// URL for a GC-controlled flow which will allow the payer to fulfil the
// billing request
authorisation_url: string;
// Timestamp when the flow was created
created_at: string;
// Timestamp when the flow will expire. Each flow currently lasts for 7 days.
expires_at: string;
// Resources linked to this BillingRequestFlow.
links: BillingRequestFlowLinks;
// URL that the payer can be redirected to after completing the request flow.
redirect_uri: string;
}
/** Type for a billingrequestflowcreaterequestlinks resource. */
export interface BillingRequestFlowCreateRequestLinks {
// ID of the [billing request](#billing-requests-billing-requests) against
// which this flow was created.
billing_request: string;
}
/** Type for a billingrequestflowlinks resource. */
export interface BillingRequestFlowLinks {
// ID of the [billing request](#billing-requests-billing-requests) against
// which this flow was created.
billing_request: string;
}
/** Type for a creditor resource. */
export interface Creditor {
// The first line of the creditor's address.
address_line1?: string;
// The second line of the creditor's address.
address_line2?: string;
// The third line of the creditor's address.
address_line3?: string;
// Boolean indicating whether the creditor is permitted to create refunds
can_create_refunds: boolean;
// The city of the creditor's address.
city?: string;
// [ISO 3166-1 alpha-2
// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
country_code?: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// Boolean value indicating whether creditor has the [Custom Payment
// Pages](https://support.gocardless.com/hc/en-gb/articles/115003734705-Custom-payment-pages)
// functionality enabled.
custom_payment_pages_enabled: boolean;
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the
// currency in which amounts will be paid out (after foreign exchange).
// Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are
// supported. Present only if payouts will be (or were) made via foreign
// exchange.
fx_payout_currency: CreditorFxPayoutCurrency;
// Unique identifier, beginning with "CR".
id: string;
// Resources linked to this Creditor.
links: CreditorLinks;
// URL for the creditor's logo, which may be shown on their payment pages.
logo_url?: string;
// Boolean value indicating whether creditor has the [Mandate
// Imports](#core-endpoints-mandate-imports) functionality enabled.
mandate_imports_enabled: boolean;
// Boolean value indicating whether the organisation is responsible for
// sending all customer notifications (note this is separate from the
// functionality described
// [here](/getting-started/api/handling-customer-notifications/)). If you are
// a partner app, and this value is true, you should not send notifications on
// behalf of this organisation.
merchant_responsible_for_notifications: boolean;
// The creditor's name.
name: string;
// The creditor's postal code.
postal_code?: string;
// The creditor's address region, county or department.
region?: string;
// An array of the scheme identifiers this creditor can create mandates
// against.
//
// The support address, `phone_number` and `email` fields are for customers to
// contact the merchant for support purposes. They must be displayed on the
// payment page, please see our [compliance
// requirements](#appendix-compliance-requirements) for more details.
scheme_identifiers: CreditorSchemeIdentifier[];
// The creditor's verification status, indicating whether they can yet receive
// payouts. For more details on handling verification as a partner, see our
// ["Helping your users get verified"
// guide](/getting-started/partners/helping-your-users-get-verified/). One of:
// <ul>
// <li>`successful`: The creditor's account is fully verified, and they can
// receive payouts. Once a creditor has been successfully verified, they may
// in the future require further verification - for example, if they change
// their payout bank account, we will have to check that they own the new bank
// account before they can receive payouts again.</li>
// <li>`in_review`: The creditor has provided all of the information currently
// requested, and it is awaiting review by GoCardless before they can be
// verified and receive payouts.</li>
// <li>`action_required`: The creditor needs to provide further information to
// verify their account so they can receive payouts, and should visit the
// verification flow.</li>
// </ul>
verification_status: CreditorVerificationStatus;
}
/** Type for a creditorupdaterequestlinks resource. */
export interface CreditorUpdateRequestLinks {
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in AUD.
default_aud_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in CAD.
default_cad_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in DKK.
default_dkk_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in EUR.
default_eur_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in GBP.
default_gbp_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in NZD.
default_nzd_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in SEK.
default_sek_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in USD.
default_usd_payout_account?: string;
}
export enum CreditorFxPayoutCurrency {
AUD = 'AUD',
CAD = 'CAD',
DKK = 'DKK',
EUR = 'EUR',
GBP = 'GBP',
NZD = 'NZD',
SEK = 'SEK',
USD = 'USD',
}
/** Type for a creditorlinks resource. */
export interface CreditorLinks {
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in AUD.
default_aud_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in CAD.
default_cad_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in DKK.
default_dkk_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in EUR.
default_eur_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in GBP.
default_gbp_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in NZD.
default_nzd_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in SEK.
default_sek_payout_account?: string;
// ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is
// set up to receive payouts in USD.
default_usd_payout_account?: string;
}
/** Type for a creditorschemeidentifier resource. */
export interface CreditorSchemeIdentifier {
// The first line of the support address.
address_line1: string;
// The second line of the support address.
address_line2?: string;
// The third line of the support address.
address_line3?: string;
// Whether a custom reference can be submitted for mandates using this scheme
// identifier.
can_specify_mandate_reference: boolean;
// The city of the support address.
city: string;
// [ISO 3166-1 alpha-2
// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
country_code: string;
// The currency of the scheme identifier.
currency: CreditorSchemeIdentifierCurrency;
// The support email address.
email: string;
// The minimum interval, in working days, between the sending of a
// pre-notification to the customer, and the charge date of a payment using
// this scheme identifier.
//
// By default, GoCardless sends these notifications automatically. Please see
// our [compliance requirements](#appendix-compliance-requirements) for more
// details.
minimum_advance_notice: number;
// The name which appears on customers' bank statements.
name: string;
// The support phone number.
phone_number: string;
// The support postal code.
postal_code: string;
// The scheme-unique identifier against which payments are submitted.
reference: string;
// The support address region, county or department.
region?: string;
// The scheme which this scheme identifier applies to.
scheme: CreditorSchemeIdentifierScheme;
}
export enum CreditorSchemeIdentifierCurrency {
AUD = 'AUD',
CAD = 'CAD',
DKK = 'DKK',
EUR = 'EUR',
GBP = 'GBP',
NZD = 'NZD',
SEK = 'SEK',
USD = 'USD',
}
export enum CreditorSchemeIdentifierScheme {
Ach = 'ach',
Autogiro = 'autogiro',
Bacs = 'bacs',
Becs = 'becs',
BecsNz = 'becs_nz',
Betalingsservice = 'betalingsservice',
FasterPayments = 'faster_payments',
Pad = 'pad',
Sepa = 'sepa',
}
export enum CreditorVerificationStatus {
Successful = 'successful',
InReview = 'in_review',
ActionRequired = 'action_required',
}
/** Type for a creditorbankaccount resource. */
export interface CreditorBankAccount {
// Name of the account holder, as known by the bank. Usually this is the same
// as the name stored with the linked [creditor](#core-endpoints-creditors).
// This field will be transliterated, upcased and truncated to 18 characters.
account_holder_name: string;
// The last few digits of the account number. Currently 4 digits for NZD bank
// accounts and 2 digits for other currencies.
account_number_ending: string;
// Bank account type. Required for USD-denominated bank accounts. Must not be
// provided for bank accounts in other currencies. See [local
// details](#local-bank-details-united-states) for more information.
account_type: CreditorBankAccountAccountType;
// Name of bank, taken from the bank details.
bank_name: string;
// [ISO 3166-1 alpha-2
// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
// Defaults to the country code of the `iban` if supplied, otherwise is
// required.
country_code?: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD"
// are supported.
currency?: string;
// Boolean value showing whether the bank account is enabled or disabled.
enabled: boolean;
// Unique identifier, beginning with "BA".
id: string;
// Resources linked to this CreditorBankAccount.
links: CreditorBankAccountLinks;
// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata: JsonMap;
}
/** Type for a creditorbankaccountcreaterequestlinks resource. */
export interface CreditorBankAccountCreateRequestLinks {
// ID of the [creditor](#core-endpoints-creditors) that owns this bank
// account.
creditor: string;
}
export enum CreditorBankAccountAccountType {
Savings = 'savings',
Checking = 'checking',
}
/** Type for a creditorbankaccountlinks resource. */
export interface CreditorBankAccountLinks {
// ID of the [creditor](#core-endpoints-creditors) that owns this bank
// account.
creditor: string;
}
/** Type for a currencyexchangerate resource. */
export interface CurrencyExchangeRate {
// The exchange rate from the source to target currencies provided with up to
// 10 decimal places.
rate: string;
// Source currency
source: string;
// Target currency
target: string;
// Time at which the rate was retrieved from the provider.
time: string;
}
/** Type for a customer resource. */
export interface Customer {
// The first line of the customer's address.
address_line1?: string;
// The second line of the customer's address.
address_line2?: string;
// The third line of the customer's address.
address_line3?: string;
// The city of the customer's address.
city?: string;
// Customer's company name. Required unless a `given_name` and `family_name`
// are provided. For Canadian customers, the use of a `company_name` value
// will mean that any mandate created from this customer will be considered to
// be a "Business PAD" (otherwise, any mandate will be considered to be a
// "Personal PAD").
company_name?: string;
// [ISO 3166-1 alpha-2
// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
country_code?: string;
// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
// resource was created.
created_at: string;
// For Danish customers only. The civic/company number (CPR or CVR) of the
// customer. Must be supplied if the customer's bank account is denominated in
// Danish krone (DKK).
danish_identity_number?: string;
// Customer's email address. Required in most cases, as this allows GoCardless
// to send notifications to this customer.
email?: string;
// Customer's surname. Required unless a `company_name` is provided.
family_name?: string;
// Customer's first name. Required unless a `company_name` is provided.
given_name?: string;
// Unique identifier, beginning with "CU".
id: string;
// [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code.
// Used as the language for notification emails sent by GoCardless if your
// organisation does not send its own (see [compliance
// requirements](#appendix-compliance-requirements)). Currently only "en",
// "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported.
// If this is not provided, the language will be chosen based on the
// `country_code` (if supplied) or default to "en".
language?: string;
// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata: JsonMap;
// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number,
// including country code.
phone_number?: string;
// The customer's postal code.
postal_code?: string;
// The customer's address region, county or department. For US customers a 2
// letter [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
// code is required (e.g. `CA` for California).
region?: string;
// For Swedish customers only. The civic/company number (personnummer,
// samordningsnummer, or organisationsnummer) of the customer. Must be
// supplied if the customer's bank account is denominated in Swedish krona
// (SEK). This field cannot be changed once it has been set.
swedish_identity_number?: string;
}
export enum CustomerCurrency {
AUD = 'AUD',
CAD = 'CAD',
DKK = 'DKK',
EUR = 'EUR',