-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlegalentity.go
1412 lines (1265 loc) · 81.2 KB
/
legalentity.go
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.
package moderntreasury
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"time"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/apijson"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/apiquery"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/param"
"github.com/Modern-Treasury/modern-treasury-go/v2/internal/requestconfig"
"github.com/Modern-Treasury/modern-treasury-go/v2/option"
"github.com/Modern-Treasury/modern-treasury-go/v2/packages/pagination"
)
// LegalEntityService contains methods and other services that help with
// interacting with the Modern Treasury API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewLegalEntityService] method instead.
type LegalEntityService struct {
Options []option.RequestOption
}
// NewLegalEntityService generates a new service that applies the given options to
// each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewLegalEntityService(opts ...option.RequestOption) (r *LegalEntityService) {
r = &LegalEntityService{}
r.Options = opts
return
}
// create legal_entity
func (r *LegalEntityService) New(ctx context.Context, body LegalEntityNewParams, opts ...option.RequestOption) (res *LegalEntity, err error) {
opts = append(r.Options[:], opts...)
path := "api/legal_entities"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
// Get details on a single legal entity.
func (r *LegalEntityService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *LegalEntity, err error) {
opts = append(r.Options[:], opts...)
if id == "" {
err = errors.New("missing required id parameter")
return
}
path := fmt.Sprintf("api/legal_entities/%s", id)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}
// Update a legal entity.
func (r *LegalEntityService) Update(ctx context.Context, id string, body LegalEntityUpdateParams, opts ...option.RequestOption) (res *LegalEntity, err error) {
opts = append(r.Options[:], opts...)
if id == "" {
err = errors.New("missing required id parameter")
return
}
path := fmt.Sprintf("api/legal_entities/%s", id)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPatch, path, body, &res, opts...)
return
}
// Get a list of all legal entities.
func (r *LegalEntityService) List(ctx context.Context, query LegalEntityListParams, opts ...option.RequestOption) (res *pagination.Page[LegalEntity], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
path := "api/legal_entities"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Get a list of all legal entities.
func (r *LegalEntityService) ListAutoPaging(ctx context.Context, query LegalEntityListParams, opts ...option.RequestOption) *pagination.PageAutoPager[LegalEntity] {
return pagination.NewPageAutoPager(r.List(ctx, query, opts...))
}
type BankSettings struct {
ID string `json:"id,required" format:"uuid"`
// The percentage of backup withholding to apply to the legal entity.
BackupWithholdingPercentage int64 `json:"backup_withholding_percentage,required,nullable"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
// Whether backup withholding is enabled. See more here -
// https://www.irs.gov/businesses/small-businesses-self-employed/backup-withholding.
EnableBackupWithholding bool `json:"enable_backup_withholding,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
Object string `json:"object,required"`
// Cross River Bank specific setting to opt out of privacy policy.
PrivacyOptOut bool `json:"privacy_opt_out,required,nullable"`
// It covers, among other types of insider loans, extensions of credit by a member
// bank to an executive officer, director, or principal shareholder of the member
// bank; a bank holding company of which the member bank is a subsidiary; and any
// other subsidiary of that bank holding company.
RegulationO bool `json:"regulation_o,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
JSON bankSettingsJSON `json:"-"`
}
// bankSettingsJSON contains the JSON metadata for the struct [BankSettings]
type bankSettingsJSON struct {
ID apijson.Field
BackupWithholdingPercentage apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
EnableBackupWithholding apijson.Field
LiveMode apijson.Field
Object apijson.Field
PrivacyOptOut apijson.Field
RegulationO apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *BankSettings) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r bankSettingsJSON) RawJSON() string {
return r.raw
}
type BankSettingsParam struct {
ID param.Field[string] `json:"id,required" format:"uuid"`
// The percentage of backup withholding to apply to the legal entity.
BackupWithholdingPercentage param.Field[int64] `json:"backup_withholding_percentage,required"`
CreatedAt param.Field[time.Time] `json:"created_at,required" format:"date-time"`
DiscardedAt param.Field[time.Time] `json:"discarded_at,required" format:"date-time"`
// Whether backup withholding is enabled. See more here -
// https://www.irs.gov/businesses/small-businesses-self-employed/backup-withholding.
EnableBackupWithholding param.Field[bool] `json:"enable_backup_withholding,required"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode param.Field[bool] `json:"live_mode,required"`
Object param.Field[string] `json:"object,required"`
// Cross River Bank specific setting to opt out of privacy policy.
PrivacyOptOut param.Field[bool] `json:"privacy_opt_out,required"`
// It covers, among other types of insider loans, extensions of credit by a member
// bank to an executive officer, director, or principal shareholder of the member
// bank; a bank holding company of which the member bank is a subsidiary; and any
// other subsidiary of that bank holding company.
RegulationO param.Field[bool] `json:"regulation_o,required"`
UpdatedAt param.Field[time.Time] `json:"updated_at,required" format:"date-time"`
}
func (r BankSettingsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntity struct {
ID string `json:"id,required" format:"uuid"`
// A list of addresses for the entity.
Addresses []LegalEntityAddress `json:"addresses,required"`
BankSettings BankSettings `json:"bank_settings,required,nullable"`
// The business's legal business name.
BusinessName string `json:"business_name,required,nullable"`
// The country of citizenship for an individual.
CitizenshipCountry string `json:"citizenship_country,required,nullable"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// A business's formation date (YYYY-MM-DD).
DateFormed time.Time `json:"date_formed,required,nullable" format:"date"`
// An individual's date of birth (YYYY-MM-DD).
DateOfBirth time.Time `json:"date_of_birth,required,nullable" format:"date"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
DoingBusinessAsNames []string `json:"doing_business_as_names,required"`
// The entity's primary email.
Email string `json:"email,required,nullable"`
// An individual's first name.
FirstName string `json:"first_name,required,nullable"`
// A list of identifications for the legal entity.
Identifications []LegalEntityIdentification `json:"identifications,required"`
// An individual's last name.
LastName string `json:"last_name,required,nullable"`
// The legal entity associations and its child legal entities.
LegalEntityAssociations []LegalEntityAssociation `json:"legal_entity_associations,required,nullable"`
// The type of legal entity.
LegalEntityType LegalEntityLegalEntityType `json:"legal_entity_type,required"`
// The business's legal structure.
LegalStructure LegalEntityLegalStructure `json:"legal_structure,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
// Additional data represented as key-value pairs. Both the key and value must be
// strings.
Metadata map[string]string `json:"metadata,required"`
// An individual's middle name.
MiddleName string `json:"middle_name,required,nullable"`
Object string `json:"object,required"`
PhoneNumbers []LegalEntityPhoneNumber `json:"phone_numbers,required"`
// Whether the individual is a politically exposed person.
PoliticallyExposedPerson bool `json:"politically_exposed_person,required,nullable"`
// An individual's preferred name.
PreferredName string `json:"preferred_name,required,nullable"`
// An individual's prefix.
Prefix string `json:"prefix,required,nullable"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating LegalEntityRiskRating `json:"risk_rating,required,nullable"`
// An individual's suffix.
Suffix string `json:"suffix,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
WealthAndEmploymentDetails WealthAndEmploymentDetails `json:"wealth_and_employment_details,required,nullable"`
// The entity's primary website URL.
Website string `json:"website,required,nullable"`
JSON legalEntityJSON `json:"-"`
}
// legalEntityJSON contains the JSON metadata for the struct [LegalEntity]
type legalEntityJSON struct {
ID apijson.Field
Addresses apijson.Field
BankSettings apijson.Field
BusinessName apijson.Field
CitizenshipCountry apijson.Field
CreatedAt apijson.Field
DateFormed apijson.Field
DateOfBirth apijson.Field
DiscardedAt apijson.Field
DoingBusinessAsNames apijson.Field
Email apijson.Field
FirstName apijson.Field
Identifications apijson.Field
LastName apijson.Field
LegalEntityAssociations apijson.Field
LegalEntityType apijson.Field
LegalStructure apijson.Field
LiveMode apijson.Field
Metadata apijson.Field
MiddleName apijson.Field
Object apijson.Field
PhoneNumbers apijson.Field
PoliticallyExposedPerson apijson.Field
PreferredName apijson.Field
Prefix apijson.Field
RiskRating apijson.Field
Suffix apijson.Field
UpdatedAt apijson.Field
WealthAndEmploymentDetails apijson.Field
Website apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntity) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityJSON) RawJSON() string {
return r.raw
}
type LegalEntityAddress struct {
ID string `json:"id,required" format:"uuid"`
// The types of this address.
AddressTypes []LegalEntityAddressesAddressType `json:"address_types,required"`
// Country code conforms to [ISO 3166-1 alpha-2]
Country string `json:"country,required,nullable"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
Line1 string `json:"line1,required,nullable"`
Line2 string `json:"line2,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
// Locality or City.
Locality string `json:"locality,required,nullable"`
Object string `json:"object,required"`
// The postal code of the address.
PostalCode string `json:"postal_code,required,nullable"`
// Region or State.
Region string `json:"region,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
JSON legalEntityAddressJSON `json:"-"`
}
// legalEntityAddressJSON contains the JSON metadata for the struct
// [LegalEntityAddress]
type legalEntityAddressJSON struct {
ID apijson.Field
AddressTypes apijson.Field
Country apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
Line1 apijson.Field
Line2 apijson.Field
LiveMode apijson.Field
Locality apijson.Field
Object apijson.Field
PostalCode apijson.Field
Region apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityAddress) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityAddressJSON) RawJSON() string {
return r.raw
}
type LegalEntityAddressesAddressType string
const (
LegalEntityAddressesAddressTypeBusiness LegalEntityAddressesAddressType = "business"
LegalEntityAddressesAddressTypeMailing LegalEntityAddressesAddressType = "mailing"
LegalEntityAddressesAddressTypeOther LegalEntityAddressesAddressType = "other"
LegalEntityAddressesAddressTypePoBox LegalEntityAddressesAddressType = "po_box"
LegalEntityAddressesAddressTypeResidential LegalEntityAddressesAddressType = "residential"
)
func (r LegalEntityAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityAddressesAddressTypeBusiness, LegalEntityAddressesAddressTypeMailing, LegalEntityAddressesAddressTypeOther, LegalEntityAddressesAddressTypePoBox, LegalEntityAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityIdentification struct {
ID string `json:"id,required" format:"uuid"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
// The type of ID number.
IDType LegalEntityIdentificationsIDType `json:"id_type,required"`
// The ISO 3166-1 alpha-2 country code of the country that issued the
// identification
IssuingCountry string `json:"issuing_country,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
Object string `json:"object,required"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
JSON legalEntityIdentificationJSON `json:"-"`
}
// legalEntityIdentificationJSON contains the JSON metadata for the struct
// [LegalEntityIdentification]
type legalEntityIdentificationJSON struct {
ID apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
IDType apijson.Field
IssuingCountry apijson.Field
LiveMode apijson.Field
Object apijson.Field
UpdatedAt apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityIdentification) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityIdentificationJSON) RawJSON() string {
return r.raw
}
// The type of ID number.
type LegalEntityIdentificationsIDType string
const (
LegalEntityIdentificationsIDTypeArCuil LegalEntityIdentificationsIDType = "ar_cuil"
LegalEntityIdentificationsIDTypeArCuit LegalEntityIdentificationsIDType = "ar_cuit"
LegalEntityIdentificationsIDTypeBrCnpj LegalEntityIdentificationsIDType = "br_cnpj"
LegalEntityIdentificationsIDTypeBrCpf LegalEntityIdentificationsIDType = "br_cpf"
LegalEntityIdentificationsIDTypeClRun LegalEntityIdentificationsIDType = "cl_run"
LegalEntityIdentificationsIDTypeClRut LegalEntityIdentificationsIDType = "cl_rut"
LegalEntityIdentificationsIDTypeCoCedulas LegalEntityIdentificationsIDType = "co_cedulas"
LegalEntityIdentificationsIDTypeCoNit LegalEntityIdentificationsIDType = "co_nit"
LegalEntityIdentificationsIDTypeHnID LegalEntityIdentificationsIDType = "hn_id"
LegalEntityIdentificationsIDTypeHnRtn LegalEntityIdentificationsIDType = "hn_rtn"
LegalEntityIdentificationsIDTypeInLei LegalEntityIdentificationsIDType = "in_lei"
LegalEntityIdentificationsIDTypeKrBrn LegalEntityIdentificationsIDType = "kr_brn"
LegalEntityIdentificationsIDTypeKrCrn LegalEntityIdentificationsIDType = "kr_crn"
LegalEntityIdentificationsIDTypeKrRrn LegalEntityIdentificationsIDType = "kr_rrn"
LegalEntityIdentificationsIDTypePassport LegalEntityIdentificationsIDType = "passport"
LegalEntityIdentificationsIDTypeSaTin LegalEntityIdentificationsIDType = "sa_tin"
LegalEntityIdentificationsIDTypeSaVat LegalEntityIdentificationsIDType = "sa_vat"
LegalEntityIdentificationsIDTypeUsEin LegalEntityIdentificationsIDType = "us_ein"
LegalEntityIdentificationsIDTypeUsItin LegalEntityIdentificationsIDType = "us_itin"
LegalEntityIdentificationsIDTypeUsSsn LegalEntityIdentificationsIDType = "us_ssn"
LegalEntityIdentificationsIDTypeVnTin LegalEntityIdentificationsIDType = "vn_tin"
)
func (r LegalEntityIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityIdentificationsIDTypeArCuil, LegalEntityIdentificationsIDTypeArCuit, LegalEntityIdentificationsIDTypeBrCnpj, LegalEntityIdentificationsIDTypeBrCpf, LegalEntityIdentificationsIDTypeClRun, LegalEntityIdentificationsIDTypeClRut, LegalEntityIdentificationsIDTypeCoCedulas, LegalEntityIdentificationsIDTypeCoNit, LegalEntityIdentificationsIDTypeHnID, LegalEntityIdentificationsIDTypeHnRtn, LegalEntityIdentificationsIDTypeInLei, LegalEntityIdentificationsIDTypeKrBrn, LegalEntityIdentificationsIDTypeKrCrn, LegalEntityIdentificationsIDTypeKrRrn, LegalEntityIdentificationsIDTypePassport, LegalEntityIdentificationsIDTypeSaTin, LegalEntityIdentificationsIDTypeSaVat, LegalEntityIdentificationsIDTypeUsEin, LegalEntityIdentificationsIDTypeUsItin, LegalEntityIdentificationsIDTypeUsSsn, LegalEntityIdentificationsIDTypeVnTin:
return true
}
return false
}
// The type of legal entity.
type LegalEntityLegalEntityType string
const (
LegalEntityLegalEntityTypeBusiness LegalEntityLegalEntityType = "business"
LegalEntityLegalEntityTypeIndividual LegalEntityLegalEntityType = "individual"
LegalEntityLegalEntityTypeJoint LegalEntityLegalEntityType = "joint"
)
func (r LegalEntityLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityLegalEntityTypeBusiness, LegalEntityLegalEntityTypeIndividual, LegalEntityLegalEntityTypeJoint:
return true
}
return false
}
// The business's legal structure.
type LegalEntityLegalStructure string
const (
LegalEntityLegalStructureCorporation LegalEntityLegalStructure = "corporation"
LegalEntityLegalStructureLlc LegalEntityLegalStructure = "llc"
LegalEntityLegalStructureNonProfit LegalEntityLegalStructure = "non_profit"
LegalEntityLegalStructurePartnership LegalEntityLegalStructure = "partnership"
LegalEntityLegalStructureSoleProprietorship LegalEntityLegalStructure = "sole_proprietorship"
LegalEntityLegalStructureTrust LegalEntityLegalStructure = "trust"
)
func (r LegalEntityLegalStructure) IsKnown() bool {
switch r {
case LegalEntityLegalStructureCorporation, LegalEntityLegalStructureLlc, LegalEntityLegalStructureNonProfit, LegalEntityLegalStructurePartnership, LegalEntityLegalStructureSoleProprietorship, LegalEntityLegalStructureTrust:
return true
}
return false
}
// A list of phone numbers in E.164 format.
type LegalEntityPhoneNumber struct {
PhoneNumber string `json:"phone_number"`
JSON legalEntityPhoneNumberJSON `json:"-"`
}
// legalEntityPhoneNumberJSON contains the JSON metadata for the struct
// [LegalEntityPhoneNumber]
type legalEntityPhoneNumberJSON struct {
PhoneNumber apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *LegalEntityPhoneNumber) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r legalEntityPhoneNumberJSON) RawJSON() string {
return r.raw
}
// The risk rating of the legal entity. One of low, medium, high.
type LegalEntityRiskRating string
const (
LegalEntityRiskRatingLow LegalEntityRiskRating = "low"
LegalEntityRiskRatingMedium LegalEntityRiskRating = "medium"
LegalEntityRiskRatingHigh LegalEntityRiskRating = "high"
)
func (r LegalEntityRiskRating) IsKnown() bool {
switch r {
case LegalEntityRiskRatingLow, LegalEntityRiskRatingMedium, LegalEntityRiskRatingHigh:
return true
}
return false
}
type WealthAndEmploymentDetails struct {
ID string `json:"id,required" format:"uuid"`
// The annual income of the individual.
AnnualIncome int64 `json:"annual_income,required,nullable"`
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
DiscardedAt time.Time `json:"discarded_at,required,nullable" format:"date-time"`
// The country in which the employer is located.
EmployerCountry string `json:"employer_country,required,nullable"`
// The name of the employer.
EmployerName string `json:"employer_name,required,nullable"`
// The state in which the employer is located.
EmployerState string `json:"employer_state,required,nullable"`
// The employment status of the individual.
EmploymentStatus WealthAndEmploymentDetailsEmploymentStatus `json:"employment_status,required,nullable"`
// The country in which the individual's income is earned.
IncomeCountry string `json:"income_country,required,nullable"`
// The source of the individual's income.
IncomeSource WealthAndEmploymentDetailsIncomeSource `json:"income_source,required,nullable"`
// The state in which the individual's income is earned.
IncomeState string `json:"income_state,required,nullable"`
// The industry of the individual.
Industry WealthAndEmploymentDetailsIndustry `json:"industry,required,nullable"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode bool `json:"live_mode,required"`
Object string `json:"object,required"`
// The occupation of the individual.
Occupation WealthAndEmploymentDetailsOccupation `json:"occupation,required,nullable"`
// The source of the individual's funds.
SourceOfFunds WealthAndEmploymentDetailsSourceOfFunds `json:"source_of_funds,required,nullable"`
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// The source of the individual's wealth.
WealthSource WealthAndEmploymentDetailsWealthSource `json:"wealth_source,required,nullable"`
JSON wealthAndEmploymentDetailsJSON `json:"-"`
}
// wealthAndEmploymentDetailsJSON contains the JSON metadata for the struct
// [WealthAndEmploymentDetails]
type wealthAndEmploymentDetailsJSON struct {
ID apijson.Field
AnnualIncome apijson.Field
CreatedAt apijson.Field
DiscardedAt apijson.Field
EmployerCountry apijson.Field
EmployerName apijson.Field
EmployerState apijson.Field
EmploymentStatus apijson.Field
IncomeCountry apijson.Field
IncomeSource apijson.Field
IncomeState apijson.Field
Industry apijson.Field
LiveMode apijson.Field
Object apijson.Field
Occupation apijson.Field
SourceOfFunds apijson.Field
UpdatedAt apijson.Field
WealthSource apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *WealthAndEmploymentDetails) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r wealthAndEmploymentDetailsJSON) RawJSON() string {
return r.raw
}
// The employment status of the individual.
type WealthAndEmploymentDetailsEmploymentStatus string
const (
WealthAndEmploymentDetailsEmploymentStatusEmployed WealthAndEmploymentDetailsEmploymentStatus = "employed"
WealthAndEmploymentDetailsEmploymentStatusRetired WealthAndEmploymentDetailsEmploymentStatus = "retired"
WealthAndEmploymentDetailsEmploymentStatusSelfEmployed WealthAndEmploymentDetailsEmploymentStatus = "self_employed"
WealthAndEmploymentDetailsEmploymentStatusStudent WealthAndEmploymentDetailsEmploymentStatus = "student"
WealthAndEmploymentDetailsEmploymentStatusUnemployed WealthAndEmploymentDetailsEmploymentStatus = "unemployed"
)
func (r WealthAndEmploymentDetailsEmploymentStatus) IsKnown() bool {
switch r {
case WealthAndEmploymentDetailsEmploymentStatusEmployed, WealthAndEmploymentDetailsEmploymentStatusRetired, WealthAndEmploymentDetailsEmploymentStatusSelfEmployed, WealthAndEmploymentDetailsEmploymentStatusStudent, WealthAndEmploymentDetailsEmploymentStatusUnemployed:
return true
}
return false
}
// The source of the individual's income.
type WealthAndEmploymentDetailsIncomeSource string
const (
WealthAndEmploymentDetailsIncomeSourceFamilySupport WealthAndEmploymentDetailsIncomeSource = "family_support"
WealthAndEmploymentDetailsIncomeSourceGovernmentBenefits WealthAndEmploymentDetailsIncomeSource = "government_benefits"
WealthAndEmploymentDetailsIncomeSourceInheritance WealthAndEmploymentDetailsIncomeSource = "inheritance"
WealthAndEmploymentDetailsIncomeSourceInvestments WealthAndEmploymentDetailsIncomeSource = "investments"
WealthAndEmploymentDetailsIncomeSourceRentalIncome WealthAndEmploymentDetailsIncomeSource = "rental_income"
WealthAndEmploymentDetailsIncomeSourceRetirement WealthAndEmploymentDetailsIncomeSource = "retirement"
WealthAndEmploymentDetailsIncomeSourceSalary WealthAndEmploymentDetailsIncomeSource = "salary"
WealthAndEmploymentDetailsIncomeSourceSelfEmployed WealthAndEmploymentDetailsIncomeSource = "self_employed"
)
func (r WealthAndEmploymentDetailsIncomeSource) IsKnown() bool {
switch r {
case WealthAndEmploymentDetailsIncomeSourceFamilySupport, WealthAndEmploymentDetailsIncomeSourceGovernmentBenefits, WealthAndEmploymentDetailsIncomeSourceInheritance, WealthAndEmploymentDetailsIncomeSourceInvestments, WealthAndEmploymentDetailsIncomeSourceRentalIncome, WealthAndEmploymentDetailsIncomeSourceRetirement, WealthAndEmploymentDetailsIncomeSourceSalary, WealthAndEmploymentDetailsIncomeSourceSelfEmployed:
return true
}
return false
}
// The industry of the individual.
type WealthAndEmploymentDetailsIndustry string
const (
WealthAndEmploymentDetailsIndustryAccounting WealthAndEmploymentDetailsIndustry = "accounting"
WealthAndEmploymentDetailsIndustryAgriculture WealthAndEmploymentDetailsIndustry = "agriculture"
WealthAndEmploymentDetailsIndustryAutomotive WealthAndEmploymentDetailsIndustry = "automotive"
WealthAndEmploymentDetailsIndustryChemicalManufacturing WealthAndEmploymentDetailsIndustry = "chemical_manufacturing"
WealthAndEmploymentDetailsIndustryConstruction WealthAndEmploymentDetailsIndustry = "construction"
WealthAndEmploymentDetailsIndustryEducationalMedical WealthAndEmploymentDetailsIndustry = "educational_medical"
WealthAndEmploymentDetailsIndustryFoodService WealthAndEmploymentDetailsIndustry = "food_service"
WealthAndEmploymentDetailsIndustryFinance WealthAndEmploymentDetailsIndustry = "finance"
WealthAndEmploymentDetailsIndustryGasoline WealthAndEmploymentDetailsIndustry = "gasoline"
WealthAndEmploymentDetailsIndustryHealthStores WealthAndEmploymentDetailsIndustry = "health_stores"
WealthAndEmploymentDetailsIndustryLaundry WealthAndEmploymentDetailsIndustry = "laundry"
WealthAndEmploymentDetailsIndustryMaintenance WealthAndEmploymentDetailsIndustry = "maintenance"
WealthAndEmploymentDetailsIndustryManufacturing WealthAndEmploymentDetailsIndustry = "manufacturing"
WealthAndEmploymentDetailsIndustryMerchantWholesale WealthAndEmploymentDetailsIndustry = "merchant_wholesale"
WealthAndEmploymentDetailsIndustryMining WealthAndEmploymentDetailsIndustry = "mining"
WealthAndEmploymentDetailsIndustryPerformingArts WealthAndEmploymentDetailsIndustry = "performing_arts"
WealthAndEmploymentDetailsIndustryProfessionalNonLegal WealthAndEmploymentDetailsIndustry = "professional_non_legal"
WealthAndEmploymentDetailsIndustryPublicAdministration WealthAndEmploymentDetailsIndustry = "public_administration"
WealthAndEmploymentDetailsIndustryPublishing WealthAndEmploymentDetailsIndustry = "publishing"
WealthAndEmploymentDetailsIndustryRealEstate WealthAndEmploymentDetailsIndustry = "real_estate"
WealthAndEmploymentDetailsIndustryRecreationGambling WealthAndEmploymentDetailsIndustry = "recreation_gambling"
WealthAndEmploymentDetailsIndustryReligiousCharity WealthAndEmploymentDetailsIndustry = "religious_charity"
WealthAndEmploymentDetailsIndustryRentalServices WealthAndEmploymentDetailsIndustry = "rental_services"
WealthAndEmploymentDetailsIndustryRetailClothing WealthAndEmploymentDetailsIndustry = "retail_clothing"
WealthAndEmploymentDetailsIndustryRetailElectronics WealthAndEmploymentDetailsIndustry = "retail_electronics"
WealthAndEmploymentDetailsIndustryRetailFood WealthAndEmploymentDetailsIndustry = "retail_food"
WealthAndEmploymentDetailsIndustryRetailFurnishing WealthAndEmploymentDetailsIndustry = "retail_furnishing"
WealthAndEmploymentDetailsIndustryRetailHome WealthAndEmploymentDetailsIndustry = "retail_home"
WealthAndEmploymentDetailsIndustryRetailNonStore WealthAndEmploymentDetailsIndustry = "retail_non_store"
WealthAndEmploymentDetailsIndustryRetailSporting WealthAndEmploymentDetailsIndustry = "retail_sporting"
WealthAndEmploymentDetailsIndustryTransportation WealthAndEmploymentDetailsIndustry = "transportation"
WealthAndEmploymentDetailsIndustryTravel WealthAndEmploymentDetailsIndustry = "travel"
WealthAndEmploymentDetailsIndustryUtilities WealthAndEmploymentDetailsIndustry = "utilities"
)
func (r WealthAndEmploymentDetailsIndustry) IsKnown() bool {
switch r {
case WealthAndEmploymentDetailsIndustryAccounting, WealthAndEmploymentDetailsIndustryAgriculture, WealthAndEmploymentDetailsIndustryAutomotive, WealthAndEmploymentDetailsIndustryChemicalManufacturing, WealthAndEmploymentDetailsIndustryConstruction, WealthAndEmploymentDetailsIndustryEducationalMedical, WealthAndEmploymentDetailsIndustryFoodService, WealthAndEmploymentDetailsIndustryFinance, WealthAndEmploymentDetailsIndustryGasoline, WealthAndEmploymentDetailsIndustryHealthStores, WealthAndEmploymentDetailsIndustryLaundry, WealthAndEmploymentDetailsIndustryMaintenance, WealthAndEmploymentDetailsIndustryManufacturing, WealthAndEmploymentDetailsIndustryMerchantWholesale, WealthAndEmploymentDetailsIndustryMining, WealthAndEmploymentDetailsIndustryPerformingArts, WealthAndEmploymentDetailsIndustryProfessionalNonLegal, WealthAndEmploymentDetailsIndustryPublicAdministration, WealthAndEmploymentDetailsIndustryPublishing, WealthAndEmploymentDetailsIndustryRealEstate, WealthAndEmploymentDetailsIndustryRecreationGambling, WealthAndEmploymentDetailsIndustryReligiousCharity, WealthAndEmploymentDetailsIndustryRentalServices, WealthAndEmploymentDetailsIndustryRetailClothing, WealthAndEmploymentDetailsIndustryRetailElectronics, WealthAndEmploymentDetailsIndustryRetailFood, WealthAndEmploymentDetailsIndustryRetailFurnishing, WealthAndEmploymentDetailsIndustryRetailHome, WealthAndEmploymentDetailsIndustryRetailNonStore, WealthAndEmploymentDetailsIndustryRetailSporting, WealthAndEmploymentDetailsIndustryTransportation, WealthAndEmploymentDetailsIndustryTravel, WealthAndEmploymentDetailsIndustryUtilities:
return true
}
return false
}
// The occupation of the individual.
type WealthAndEmploymentDetailsOccupation string
const (
WealthAndEmploymentDetailsOccupationConsulting WealthAndEmploymentDetailsOccupation = "consulting"
WealthAndEmploymentDetailsOccupationExecutive WealthAndEmploymentDetailsOccupation = "executive"
WealthAndEmploymentDetailsOccupationFinanceAccounting WealthAndEmploymentDetailsOccupation = "finance_accounting"
WealthAndEmploymentDetailsOccupationFoodServices WealthAndEmploymentDetailsOccupation = "food_services"
WealthAndEmploymentDetailsOccupationGovernment WealthAndEmploymentDetailsOccupation = "government"
WealthAndEmploymentDetailsOccupationHealthcare WealthAndEmploymentDetailsOccupation = "healthcare"
WealthAndEmploymentDetailsOccupationLegalServices WealthAndEmploymentDetailsOccupation = "legal_services"
WealthAndEmploymentDetailsOccupationManufacturing WealthAndEmploymentDetailsOccupation = "manufacturing"
WealthAndEmploymentDetailsOccupationOther WealthAndEmploymentDetailsOccupation = "other"
WealthAndEmploymentDetailsOccupationSales WealthAndEmploymentDetailsOccupation = "sales"
WealthAndEmploymentDetailsOccupationScienceEngineering WealthAndEmploymentDetailsOccupation = "science_engineering"
WealthAndEmploymentDetailsOccupationTechnology WealthAndEmploymentDetailsOccupation = "technology"
)
func (r WealthAndEmploymentDetailsOccupation) IsKnown() bool {
switch r {
case WealthAndEmploymentDetailsOccupationConsulting, WealthAndEmploymentDetailsOccupationExecutive, WealthAndEmploymentDetailsOccupationFinanceAccounting, WealthAndEmploymentDetailsOccupationFoodServices, WealthAndEmploymentDetailsOccupationGovernment, WealthAndEmploymentDetailsOccupationHealthcare, WealthAndEmploymentDetailsOccupationLegalServices, WealthAndEmploymentDetailsOccupationManufacturing, WealthAndEmploymentDetailsOccupationOther, WealthAndEmploymentDetailsOccupationSales, WealthAndEmploymentDetailsOccupationScienceEngineering, WealthAndEmploymentDetailsOccupationTechnology:
return true
}
return false
}
// The source of the individual's funds.
type WealthAndEmploymentDetailsSourceOfFunds string
const (
WealthAndEmploymentDetailsSourceOfFundsAlimony WealthAndEmploymentDetailsSourceOfFunds = "alimony"
WealthAndEmploymentDetailsSourceOfFundsAnnuity WealthAndEmploymentDetailsSourceOfFunds = "annuity"
WealthAndEmploymentDetailsSourceOfFundsBusinessOwner WealthAndEmploymentDetailsSourceOfFunds = "business_owner"
WealthAndEmploymentDetailsSourceOfFundsGeneralEmployee WealthAndEmploymentDetailsSourceOfFunds = "general_employee"
WealthAndEmploymentDetailsSourceOfFundsGovernmentBenefits WealthAndEmploymentDetailsSourceOfFunds = "government_benefits"
WealthAndEmploymentDetailsSourceOfFundsHomemaker WealthAndEmploymentDetailsSourceOfFunds = "homemaker"
WealthAndEmploymentDetailsSourceOfFundsInheritanceGift WealthAndEmploymentDetailsSourceOfFunds = "inheritance_gift"
WealthAndEmploymentDetailsSourceOfFundsInvestment WealthAndEmploymentDetailsSourceOfFunds = "investment"
WealthAndEmploymentDetailsSourceOfFundsLegalSettlement WealthAndEmploymentDetailsSourceOfFunds = "legal_settlement"
WealthAndEmploymentDetailsSourceOfFundsLottery WealthAndEmploymentDetailsSourceOfFunds = "lottery"
WealthAndEmploymentDetailsSourceOfFundsRealEstate WealthAndEmploymentDetailsSourceOfFunds = "real_estate"
WealthAndEmploymentDetailsSourceOfFundsRetired WealthAndEmploymentDetailsSourceOfFunds = "retired"
WealthAndEmploymentDetailsSourceOfFundsRetirement WealthAndEmploymentDetailsSourceOfFunds = "retirement"
WealthAndEmploymentDetailsSourceOfFundsSalary WealthAndEmploymentDetailsSourceOfFunds = "salary"
WealthAndEmploymentDetailsSourceOfFundsSelfEmployed WealthAndEmploymentDetailsSourceOfFunds = "self_employed"
WealthAndEmploymentDetailsSourceOfFundsSeniorExecutive WealthAndEmploymentDetailsSourceOfFunds = "senior_executive"
WealthAndEmploymentDetailsSourceOfFundsTrustIncome WealthAndEmploymentDetailsSourceOfFunds = "trust_income"
)
func (r WealthAndEmploymentDetailsSourceOfFunds) IsKnown() bool {
switch r {
case WealthAndEmploymentDetailsSourceOfFundsAlimony, WealthAndEmploymentDetailsSourceOfFundsAnnuity, WealthAndEmploymentDetailsSourceOfFundsBusinessOwner, WealthAndEmploymentDetailsSourceOfFundsGeneralEmployee, WealthAndEmploymentDetailsSourceOfFundsGovernmentBenefits, WealthAndEmploymentDetailsSourceOfFundsHomemaker, WealthAndEmploymentDetailsSourceOfFundsInheritanceGift, WealthAndEmploymentDetailsSourceOfFundsInvestment, WealthAndEmploymentDetailsSourceOfFundsLegalSettlement, WealthAndEmploymentDetailsSourceOfFundsLottery, WealthAndEmploymentDetailsSourceOfFundsRealEstate, WealthAndEmploymentDetailsSourceOfFundsRetired, WealthAndEmploymentDetailsSourceOfFundsRetirement, WealthAndEmploymentDetailsSourceOfFundsSalary, WealthAndEmploymentDetailsSourceOfFundsSelfEmployed, WealthAndEmploymentDetailsSourceOfFundsSeniorExecutive, WealthAndEmploymentDetailsSourceOfFundsTrustIncome:
return true
}
return false
}
// The source of the individual's wealth.
type WealthAndEmploymentDetailsWealthSource string
const (
WealthAndEmploymentDetailsWealthSourceBusinessSale WealthAndEmploymentDetailsWealthSource = "business_sale"
WealthAndEmploymentDetailsWealthSourceFamilySupport WealthAndEmploymentDetailsWealthSource = "family_support"
WealthAndEmploymentDetailsWealthSourceGovernmentBenefits WealthAndEmploymentDetailsWealthSource = "government_benefits"
WealthAndEmploymentDetailsWealthSourceInheritance WealthAndEmploymentDetailsWealthSource = "inheritance"
WealthAndEmploymentDetailsWealthSourceInvestments WealthAndEmploymentDetailsWealthSource = "investments"
WealthAndEmploymentDetailsWealthSourceOther WealthAndEmploymentDetailsWealthSource = "other"
WealthAndEmploymentDetailsWealthSourceRentalIncome WealthAndEmploymentDetailsWealthSource = "rental_income"
WealthAndEmploymentDetailsWealthSourceRetirement WealthAndEmploymentDetailsWealthSource = "retirement"
WealthAndEmploymentDetailsWealthSourceSalary WealthAndEmploymentDetailsWealthSource = "salary"
WealthAndEmploymentDetailsWealthSourceSelfEmployed WealthAndEmploymentDetailsWealthSource = "self_employed"
)
func (r WealthAndEmploymentDetailsWealthSource) IsKnown() bool {
switch r {
case WealthAndEmploymentDetailsWealthSourceBusinessSale, WealthAndEmploymentDetailsWealthSourceFamilySupport, WealthAndEmploymentDetailsWealthSourceGovernmentBenefits, WealthAndEmploymentDetailsWealthSourceInheritance, WealthAndEmploymentDetailsWealthSourceInvestments, WealthAndEmploymentDetailsWealthSourceOther, WealthAndEmploymentDetailsWealthSourceRentalIncome, WealthAndEmploymentDetailsWealthSourceRetirement, WealthAndEmploymentDetailsWealthSourceSalary, WealthAndEmploymentDetailsWealthSourceSelfEmployed:
return true
}
return false
}
type WealthAndEmploymentDetailsParam struct {
ID param.Field[string] `json:"id,required" format:"uuid"`
// The annual income of the individual.
AnnualIncome param.Field[int64] `json:"annual_income,required"`
CreatedAt param.Field[time.Time] `json:"created_at,required" format:"date-time"`
DiscardedAt param.Field[time.Time] `json:"discarded_at,required" format:"date-time"`
// The country in which the employer is located.
EmployerCountry param.Field[string] `json:"employer_country,required"`
// The name of the employer.
EmployerName param.Field[string] `json:"employer_name,required"`
// The state in which the employer is located.
EmployerState param.Field[string] `json:"employer_state,required"`
// The employment status of the individual.
EmploymentStatus param.Field[WealthAndEmploymentDetailsEmploymentStatus] `json:"employment_status,required"`
// The country in which the individual's income is earned.
IncomeCountry param.Field[string] `json:"income_country,required"`
// The source of the individual's income.
IncomeSource param.Field[WealthAndEmploymentDetailsIncomeSource] `json:"income_source,required"`
// The state in which the individual's income is earned.
IncomeState param.Field[string] `json:"income_state,required"`
// The industry of the individual.
Industry param.Field[WealthAndEmploymentDetailsIndustry] `json:"industry,required"`
// This field will be true if this object exists in the live environment or false
// if it exists in the test environment.
LiveMode param.Field[bool] `json:"live_mode,required"`
Object param.Field[string] `json:"object,required"`
// The occupation of the individual.
Occupation param.Field[WealthAndEmploymentDetailsOccupation] `json:"occupation,required"`
// The source of the individual's funds.
SourceOfFunds param.Field[WealthAndEmploymentDetailsSourceOfFunds] `json:"source_of_funds,required"`
UpdatedAt param.Field[time.Time] `json:"updated_at,required" format:"date-time"`
// The source of the individual's wealth.
WealthSource param.Field[WealthAndEmploymentDetailsWealthSource] `json:"wealth_source,required"`
}
func (r WealthAndEmploymentDetailsParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityNewParams struct {
// The type of legal entity.
LegalEntityType param.Field[LegalEntityNewParamsLegalEntityType] `json:"legal_entity_type,required"`
// A list of addresses for the entity.
Addresses param.Field[[]LegalEntityNewParamsAddress] `json:"addresses"`
BankSettings param.Field[BankSettingsParam] `json:"bank_settings"`
// The business's legal business name.
BusinessName param.Field[string] `json:"business_name"`
// The country of citizenship for an individual.
CitizenshipCountry param.Field[string] `json:"citizenship_country"`
// A business's formation date (YYYY-MM-DD).
DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
// An individual's date of birth (YYYY-MM-DD).
DateOfBirth param.Field[time.Time] `json:"date_of_birth" format:"date"`
DoingBusinessAsNames param.Field[[]string] `json:"doing_business_as_names"`
// The entity's primary email.
Email param.Field[string] `json:"email"`
// An individual's first name.
FirstName param.Field[string] `json:"first_name"`
// A list of identifications for the legal entity.
Identifications param.Field[[]LegalEntityNewParamsIdentification] `json:"identifications"`
// An individual's last name.
LastName param.Field[string] `json:"last_name"`
// The legal entity associations and its child legal entities.
LegalEntityAssociations param.Field[[]LegalEntityNewParamsLegalEntityAssociation] `json:"legal_entity_associations"`
// The business's legal structure.
LegalStructure param.Field[LegalEntityNewParamsLegalStructure] `json:"legal_structure"`
// Additional data represented as key-value pairs. Both the key and value must be
// strings.
Metadata param.Field[map[string]string] `json:"metadata"`
// An individual's middle name.
MiddleName param.Field[string] `json:"middle_name"`
PhoneNumbers param.Field[[]LegalEntityNewParamsPhoneNumber] `json:"phone_numbers"`
// Whether the individual is a politically exposed person.
PoliticallyExposedPerson param.Field[bool] `json:"politically_exposed_person"`
// An individual's preferred name.
PreferredName param.Field[string] `json:"preferred_name"`
// An individual's prefix.
Prefix param.Field[string] `json:"prefix"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating param.Field[LegalEntityNewParamsRiskRating] `json:"risk_rating"`
// An individual's suffix.
Suffix param.Field[string] `json:"suffix"`
WealthAndEmploymentDetails param.Field[WealthAndEmploymentDetailsParam] `json:"wealth_and_employment_details"`
// The entity's primary website URL.
Website param.Field[string] `json:"website"`
}
func (r LegalEntityNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The type of legal entity.
type LegalEntityNewParamsLegalEntityType string
const (
LegalEntityNewParamsLegalEntityTypeBusiness LegalEntityNewParamsLegalEntityType = "business"
LegalEntityNewParamsLegalEntityTypeIndividual LegalEntityNewParamsLegalEntityType = "individual"
)
func (r LegalEntityNewParamsLegalEntityType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityTypeBusiness, LegalEntityNewParamsLegalEntityTypeIndividual:
return true
}
return false
}
type LegalEntityNewParamsAddress struct {
// Country code conforms to [ISO 3166-1 alpha-2]
Country param.Field[string] `json:"country,required"`
Line1 param.Field[string] `json:"line1,required"`
// Locality or City.
Locality param.Field[string] `json:"locality,required"`
// The postal code of the address.
PostalCode param.Field[string] `json:"postal_code,required"`
// Region or State.
Region param.Field[string] `json:"region,required"`
// The types of this address.
AddressTypes param.Field[[]LegalEntityNewParamsAddressesAddressType] `json:"address_types"`
Line2 param.Field[string] `json:"line2"`
}
func (r LegalEntityNewParamsAddress) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type LegalEntityNewParamsAddressesAddressType string
const (
LegalEntityNewParamsAddressesAddressTypeBusiness LegalEntityNewParamsAddressesAddressType = "business"
LegalEntityNewParamsAddressesAddressTypeMailing LegalEntityNewParamsAddressesAddressType = "mailing"
LegalEntityNewParamsAddressesAddressTypeOther LegalEntityNewParamsAddressesAddressType = "other"
LegalEntityNewParamsAddressesAddressTypePoBox LegalEntityNewParamsAddressesAddressType = "po_box"
LegalEntityNewParamsAddressesAddressTypeResidential LegalEntityNewParamsAddressesAddressType = "residential"
)
func (r LegalEntityNewParamsAddressesAddressType) IsKnown() bool {
switch r {
case LegalEntityNewParamsAddressesAddressTypeBusiness, LegalEntityNewParamsAddressesAddressTypeMailing, LegalEntityNewParamsAddressesAddressTypeOther, LegalEntityNewParamsAddressesAddressTypePoBox, LegalEntityNewParamsAddressesAddressTypeResidential:
return true
}
return false
}
type LegalEntityNewParamsIdentification struct {
// The ID number of identification document.
IDNumber param.Field[string] `json:"id_number,required"`
// The type of ID number.
IDType param.Field[LegalEntityNewParamsIdentificationsIDType] `json:"id_type,required"`
// The ISO 3166-1 alpha-2 country code of the country that issued the
// identification
IssuingCountry param.Field[string] `json:"issuing_country"`
}
func (r LegalEntityNewParamsIdentification) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// The type of ID number.
type LegalEntityNewParamsIdentificationsIDType string
const (
LegalEntityNewParamsIdentificationsIDTypeArCuil LegalEntityNewParamsIdentificationsIDType = "ar_cuil"
LegalEntityNewParamsIdentificationsIDTypeArCuit LegalEntityNewParamsIdentificationsIDType = "ar_cuit"
LegalEntityNewParamsIdentificationsIDTypeBrCnpj LegalEntityNewParamsIdentificationsIDType = "br_cnpj"
LegalEntityNewParamsIdentificationsIDTypeBrCpf LegalEntityNewParamsIdentificationsIDType = "br_cpf"
LegalEntityNewParamsIdentificationsIDTypeClRun LegalEntityNewParamsIdentificationsIDType = "cl_run"
LegalEntityNewParamsIdentificationsIDTypeClRut LegalEntityNewParamsIdentificationsIDType = "cl_rut"
LegalEntityNewParamsIdentificationsIDTypeCoCedulas LegalEntityNewParamsIdentificationsIDType = "co_cedulas"
LegalEntityNewParamsIdentificationsIDTypeCoNit LegalEntityNewParamsIdentificationsIDType = "co_nit"
LegalEntityNewParamsIdentificationsIDTypeHnID LegalEntityNewParamsIdentificationsIDType = "hn_id"
LegalEntityNewParamsIdentificationsIDTypeHnRtn LegalEntityNewParamsIdentificationsIDType = "hn_rtn"
LegalEntityNewParamsIdentificationsIDTypeInLei LegalEntityNewParamsIdentificationsIDType = "in_lei"
LegalEntityNewParamsIdentificationsIDTypeKrBrn LegalEntityNewParamsIdentificationsIDType = "kr_brn"
LegalEntityNewParamsIdentificationsIDTypeKrCrn LegalEntityNewParamsIdentificationsIDType = "kr_crn"
LegalEntityNewParamsIdentificationsIDTypeKrRrn LegalEntityNewParamsIdentificationsIDType = "kr_rrn"
LegalEntityNewParamsIdentificationsIDTypePassport LegalEntityNewParamsIdentificationsIDType = "passport"
LegalEntityNewParamsIdentificationsIDTypeSaTin LegalEntityNewParamsIdentificationsIDType = "sa_tin"
LegalEntityNewParamsIdentificationsIDTypeSaVat LegalEntityNewParamsIdentificationsIDType = "sa_vat"
LegalEntityNewParamsIdentificationsIDTypeUsEin LegalEntityNewParamsIdentificationsIDType = "us_ein"
LegalEntityNewParamsIdentificationsIDTypeUsItin LegalEntityNewParamsIdentificationsIDType = "us_itin"
LegalEntityNewParamsIdentificationsIDTypeUsSsn LegalEntityNewParamsIdentificationsIDType = "us_ssn"
LegalEntityNewParamsIdentificationsIDTypeVnTin LegalEntityNewParamsIdentificationsIDType = "vn_tin"
)
func (r LegalEntityNewParamsIdentificationsIDType) IsKnown() bool {
switch r {
case LegalEntityNewParamsIdentificationsIDTypeArCuil, LegalEntityNewParamsIdentificationsIDTypeArCuit, LegalEntityNewParamsIdentificationsIDTypeBrCnpj, LegalEntityNewParamsIdentificationsIDTypeBrCpf, LegalEntityNewParamsIdentificationsIDTypeClRun, LegalEntityNewParamsIdentificationsIDTypeClRut, LegalEntityNewParamsIdentificationsIDTypeCoCedulas, LegalEntityNewParamsIdentificationsIDTypeCoNit, LegalEntityNewParamsIdentificationsIDTypeHnID, LegalEntityNewParamsIdentificationsIDTypeHnRtn, LegalEntityNewParamsIdentificationsIDTypeInLei, LegalEntityNewParamsIdentificationsIDTypeKrBrn, LegalEntityNewParamsIdentificationsIDTypeKrCrn, LegalEntityNewParamsIdentificationsIDTypeKrRrn, LegalEntityNewParamsIdentificationsIDTypePassport, LegalEntityNewParamsIdentificationsIDTypeSaTin, LegalEntityNewParamsIdentificationsIDTypeSaVat, LegalEntityNewParamsIdentificationsIDTypeUsEin, LegalEntityNewParamsIdentificationsIDTypeUsItin, LegalEntityNewParamsIdentificationsIDTypeUsSsn, LegalEntityNewParamsIdentificationsIDTypeVnTin:
return true
}
return false
}
type LegalEntityNewParamsLegalEntityAssociation struct {
RelationshipTypes param.Field[[]LegalEntityNewParamsLegalEntityAssociationsRelationshipType] `json:"relationship_types,required"`
// The child legal entity.
ChildLegalEntity param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity] `json:"child_legal_entity"`
// The ID of the child legal entity.
ChildLegalEntityID param.Field[string] `json:"child_legal_entity_id"`
// The child entity's ownership percentage iff they are a beneficial owner.
OwnershipPercentage param.Field[int64] `json:"ownership_percentage"`
// The job title of the child entity at the parent entity.
Title param.Field[string] `json:"title"`
}
func (r LegalEntityNewParamsLegalEntityAssociation) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// A list of relationship types for how the child entity relates to parent entity.
type LegalEntityNewParamsLegalEntityAssociationsRelationshipType string
const (
LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeBeneficialOwner LegalEntityNewParamsLegalEntityAssociationsRelationshipType = "beneficial_owner"
LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeControlPerson LegalEntityNewParamsLegalEntityAssociationsRelationshipType = "control_person"
)
func (r LegalEntityNewParamsLegalEntityAssociationsRelationshipType) IsKnown() bool {
switch r {
case LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeBeneficialOwner, LegalEntityNewParamsLegalEntityAssociationsRelationshipTypeControlPerson:
return true
}
return false
}
// The child legal entity.
type LegalEntityNewParamsLegalEntityAssociationsChildLegalEntity struct {
// A list of addresses for the entity.
Addresses param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityAddress] `json:"addresses"`
BankSettings param.Field[BankSettingsParam] `json:"bank_settings"`
// The business's legal business name.
BusinessName param.Field[string] `json:"business_name"`
// The country of citizenship for an individual.
CitizenshipCountry param.Field[string] `json:"citizenship_country"`
// A business's formation date (YYYY-MM-DD).
DateFormed param.Field[time.Time] `json:"date_formed" format:"date"`
// An individual's date of birth (YYYY-MM-DD).
DateOfBirth param.Field[time.Time] `json:"date_of_birth" format:"date"`
DoingBusinessAsNames param.Field[[]string] `json:"doing_business_as_names"`
// The entity's primary email.
Email param.Field[string] `json:"email"`
// An individual's first name.
FirstName param.Field[string] `json:"first_name"`
// A list of identifications for the legal entity.
Identifications param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityIdentification] `json:"identifications"`
// An individual's last name.
LastName param.Field[string] `json:"last_name"`
// The type of legal entity.
LegalEntityType param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalEntityType] `json:"legal_entity_type"`
// The business's legal structure.
LegalStructure param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityLegalStructure] `json:"legal_structure"`
// Additional data represented as key-value pairs. Both the key and value must be
// strings.
Metadata param.Field[map[string]string] `json:"metadata"`
// An individual's middle name.
MiddleName param.Field[string] `json:"middle_name"`
PhoneNumbers param.Field[[]LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityPhoneNumber] `json:"phone_numbers"`
// Whether the individual is a politically exposed person.
PoliticallyExposedPerson param.Field[bool] `json:"politically_exposed_person"`
// An individual's preferred name.
PreferredName param.Field[string] `json:"preferred_name"`
// An individual's prefix.
Prefix param.Field[string] `json:"prefix"`
// The risk rating of the legal entity. One of low, medium, high.
RiskRating param.Field[LegalEntityNewParamsLegalEntityAssociationsChildLegalEntityRiskRating] `json:"risk_rating"`
// An individual's suffix.
Suffix param.Field[string] `json:"suffix"`
WealthAndEmploymentDetails param.Field[WealthAndEmploymentDetailsParam] `json:"wealth_and_employment_details"`
// The entity's primary website URL.
Website param.Field[string] `json:"website"`
}