-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocal-docs-search.ts
More file actions
2923 lines (2888 loc) · 416 KB
/
Copy pathlocal-docs-search.ts
File metadata and controls
2923 lines (2888 loc) · 416 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import MiniSearch from 'minisearch';
import * as fs from 'node:fs/promises';
import * as path from 'node:path';
import { getLogger } from './logger';
type PerLanguageData = {
method?: string;
example?: string;
};
type MethodEntry = {
name: string;
endpoint: string;
httpMethod: string;
summary: string;
description: string;
stainlessPath: string;
qualified: string;
params?: string[];
response?: string;
markdown?: string;
perLanguage?: Record<string, PerLanguageData>;
};
type ProseChunk = {
content: string;
tag: string;
sectionContext?: string;
source?: string;
};
type MiniSearchDocument = {
id: string;
kind: 'http_method' | 'prose';
name?: string;
endpoint?: string;
summary?: string;
description?: string;
qualified?: string;
stainlessPath?: string;
content?: string;
sectionContext?: string;
_original: Record<string, unknown>;
};
type SearchResult = {
results: (string | Record<string, unknown>)[];
};
const EMBEDDED_METHODS: MethodEntry[] = [
{
name: 'create',
endpoint: '/auth/token',
httpMethod: 'post',
summary: 'Create Access Token',
description: 'Exchange the authorization code for an access token',
stainlessPath: '(resource) access_tokens > (method) create',
qualified: 'client.accessTokens.create',
params: ['code: string;', 'client_id?: string;', 'client_secret?: string;', 'redirect_uri?: string;'],
response:
"{ access_token: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_type: 'finch' | 'provider'; entity_ids: string[]; products: string[]; provider_id: string; token_type: string; account_id?: string; company_id?: string; customer_id?: string; customer_name?: string; }",
markdown:
"## create\n\n`client.accessTokens.create(code: string, client_id?: string, client_secret?: string, redirect_uri?: string): { access_token: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_type: 'finch' | 'provider'; entity_ids: string[]; products: string[]; provider_id: string; token_type: string; account_id?: string; company_id?: string; customer_id?: string; customer_name?: string; }`\n\n**post** `/auth/token`\n\nExchange the authorization code for an access token\n\n### Parameters\n\n- `code: string`\n The authorization code received from the authorization server\n\n- `client_id?: string`\n The client ID for your application\n\n- `client_secret?: string`\n The client secret for your application\n\n- `redirect_uri?: string`\n The redirect URI used in the authorization request (optional)\n\n### Returns\n\n- `{ access_token: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_type: 'finch' | 'provider'; entity_ids: string[]; products: string[]; provider_id: string; token_type: string; account_id?: string; company_id?: string; customer_id?: string; customer_name?: string; }`\n\n - `access_token: string`\n - `client_type: 'development' | 'production' | 'sandbox'`\n - `connection_id: string`\n - `connection_type: 'finch' | 'provider'`\n - `entity_ids: string[]`\n - `products: string[]`\n - `provider_id: string`\n - `token_type: string`\n - `account_id?: string`\n - `company_id?: string`\n - `customer_id?: string`\n - `customer_name?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst createAccessTokenResponse = await client.accessTokens.create({ code: 'code' });\n\nconsole.log(createAccessTokenResponse);\n```",
perLanguage: {
typescript: {
method: 'client.accessTokens.create',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst createAccessTokenResponse = await client.accessTokens.create({ code: 'code' });\n\nconsole.log(createAccessTokenResponse.connection_id);",
},
python: {
method: 'access_tokens.create',
example:
'from finch import Finch\n\nclient = Finch()\ncreate_access_token_response = client.access_tokens.create(\n code="code",\n)\nprint(create_access_token_response.connection_id)',
},
java: {
method: 'accessTokens().create',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccessTokenCreateParams;\nimport com.tryfinch.api.models.CreateAccessTokenResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n AccessTokenCreateParams params = AccessTokenCreateParams.builder()\n .code("code")\n .build();\n CreateAccessTokenResponse createAccessTokenResponse = client.accessTokens().create(params);\n }\n}',
},
kotlin: {
method: 'accessTokens().create',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.AccessTokenCreateParams\nimport com.tryfinch.api.models.CreateAccessTokenResponse\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val params: AccessTokenCreateParams = AccessTokenCreateParams.builder()\n .code("code")\n .build()\n val createAccessTokenResponse: CreateAccessTokenResponse = client.accessTokens().create(params)\n}',
},
go: {
method: 'client.AccessTokens.New',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tcreateAccessTokenResponse, err := client.AccessTokens.New(context.TODO(), finchgo.AccessTokenNewParams{\n\t\tCode: finchgo.F("code"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", createAccessTokenResponse.ConnectionID)\n}\n',
},
ruby: {
method: 'access_tokens.create',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(\n access_token: "My Access Token",\n client_id: "4ab15e51-11ad-49f4-acae-f343b7794375",\n client_secret: "My Client Secret"\n)\n\ncreate_access_token_response = finch.access_tokens.create(code: "code")\n\nputs(create_access_token_response)',
},
http: {
example:
'curl https://api.tryfinch.com/auth/token \\\n -H \'Content-Type: application/json\' \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN" \\\n -d \'{\n "code": "code"\n }\'',
},
},
},
{
name: 'retrieve',
endpoint: '/employer/company',
httpMethod: 'get',
summary: 'Company',
description: 'Read basic company data',
stainlessPath: '(resource) hris.company > (method) retrieve',
qualified: 'client.hris.company.retrieve',
params: ['entity_ids?: string[];'],
response:
"{ id: string; accounts: { account_name: string; account_number: string; account_type: 'checking' | 'savings'; institution_name: string; routing_number: string; }[]; departments: { name: string; parent: { name: string; }; }[]; ein: string; entity: { subtype: 's_corporation' | 'c_corporation' | 'b_corporation'; type: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }; legal_name: string; locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]; primary_email: string; primary_phone_number: string; }",
markdown:
"## retrieve\n\n`client.hris.company.retrieve(entity_ids?: string[]): { id: string; accounts: object[]; departments: object[]; ein: string; entity: object; legal_name: string; locations: location[]; primary_email: string; primary_phone_number: string; }`\n\n**get** `/employer/company`\n\nRead basic company data\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ id: string; accounts: { account_name: string; account_number: string; account_type: 'checking' | 'savings'; institution_name: string; routing_number: string; }[]; departments: { name: string; parent: { name: string; }; }[]; ein: string; entity: { subtype: 's_corporation' | 'c_corporation' | 'b_corporation'; type: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }; legal_name: string; locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]; primary_email: string; primary_phone_number: string; }`\n\n - `id: string`\n - `accounts: { account_name: string; account_number: string; account_type: 'checking' | 'savings'; institution_name: string; routing_number: string; }[]`\n - `departments: { name: string; parent: { name: string; }; }[]`\n - `ein: string`\n - `entity: { subtype: 's_corporation' | 'c_corporation' | 'b_corporation'; type: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }`\n - `legal_name: string`\n - `locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]`\n - `primary_email: string`\n - `primary_phone_number: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst company = await client.hris.company.retrieve();\n\nconsole.log(company);\n```",
perLanguage: {
typescript: {
method: 'client.hris.company.retrieve',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst company = await client.hris.company.retrieve();\n\nconsole.log(company.id);",
},
python: {
method: 'hris.company.retrieve',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\ncompany = client.hris.company.retrieve()\nprint(company.id)',
},
java: {
method: 'hris().company().retrieve',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.Company;\nimport com.tryfinch.api.models.HrisCompanyRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n Company company = client.hris().company().retrieve();\n }\n}',
},
kotlin: {
method: 'hris().company().retrieve',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.Company\nimport com.tryfinch.api.models.HrisCompanyRetrieveParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val company: Company = client.hris().company().retrieve()\n}',
},
go: {
method: 'client.HRIS.Company.Get',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompany, err := client.HRIS.Company.Get(context.TODO(), finchgo.HRISCompanyGetParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", company.ID)\n}\n',
},
ruby: {
method: 'hris.company.retrieve',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\ncompany = finch.hris.company.retrieve\n\nputs(company)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/company \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'list',
endpoint: '/employer/pay-statement-item',
httpMethod: 'get',
summary: 'Pay Statement Item',
description:
"Retrieve a list of detailed pay statement items for the access token's connection account.\n",
stainlessPath: '(resource) hris.company.pay_statement_item > (method) list',
qualified: 'client.hris.company.payStatementItem.list',
params: [
"categories?: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'[];",
'end_date?: string;',
'entity_ids?: string[];',
'name?: string;',
'start_date?: string;',
'type?: string;',
],
response:
"{ attributes: { metadata: object; employer?: boolean; pre_tax?: boolean; type?: string; }; category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'; name: string; }",
markdown:
"## list\n\n`client.hris.company.payStatementItem.list(categories?: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'[], end_date?: string, entity_ids?: string[], name?: string, start_date?: string, type?: string): { attributes: object; category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'; name: string; }`\n\n**get** `/employer/pay-statement-item`\n\nRetrieve a list of detailed pay statement items for the access token's connection account.\n\n\n### Parameters\n\n- `categories?: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'[]`\n Comma-delimited list of pay statement item categories to filter on. If empty, defaults to all categories.\n\n- `end_date?: string`\n The end date to retrieve pay statement items by via their last seen pay date in `YYYY-MM-DD` format.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n- `name?: string`\n Case-insensitive partial match search by pay statement item name.\n\n- `start_date?: string`\n The start date to retrieve pay statement items by via their last seen pay date (inclusive) in `YYYY-MM-DD` format.\n\n- `type?: string`\n String search by pay statement item type.\n\n### Returns\n\n- `{ attributes: { metadata: object; employer?: boolean; pre_tax?: boolean; type?: string; }; category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'; name: string; }`\n\n - `attributes: { metadata: object; employer?: boolean; pre_tax?: boolean; type?: string; }`\n - `category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'`\n - `name: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payStatementItemListResponse of client.hris.company.payStatementItem.list()) {\n console.log(payStatementItemListResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.company.payStatementItem.list',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const payStatementItemListResponse of client.hris.company.payStatementItem.list()) {\n console.log(payStatementItemListResponse.attributes);\n}",
},
python: {
method: 'hris.company.pay_statement_item.list',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.company.pay_statement_item.list()\npage = page.responses[0]\nprint(page.attributes)',
},
java: {
method: 'hris().company().payStatementItem().list',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemListPage;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisCompanyPayStatementItemListPage page = client.hris().company().payStatementItem().list();\n }\n}',
},
kotlin: {
method: 'hris().company().payStatementItem().list',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemListPage\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemListParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val page: HrisCompanyPayStatementItemListPage = client.hris().company().payStatementItem().list()\n}',
},
go: {
method: 'client.HRIS.Company.PayStatementItem.List',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Company.PayStatementItem.List(context.TODO(), finchgo.HRISCompanyPayStatementItemListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.company.pay_statement_item.list',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.company.pay_statement_item.list\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/pay-statement-item \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'create',
endpoint: '/employer/pay-statement-item/rule',
httpMethod: 'post',
summary: 'Create Rule',
description:
'Custom rules can be created to associate specific attributes to pay statement items depending on the use case. For example, pay statement items that meet certain conditions can be labeled as a pre-tax 401k. This metadata can be retrieved where pay statement item information is available.\n',
stainlessPath: '(resource) hris.company.pay_statement_item.rules > (method) create',
qualified: 'client.hris.company.payStatementItem.rules.create',
params: [
'entity_ids?: string[];',
'attributes?: { metadata?: object; };',
"conditions?: { field?: string; operator?: 'equals'; value?: string; }[];",
'effective_end_date?: string;',
'effective_start_date?: string;',
"entity_type?: 'pay_statement_item';",
],
response:
"{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }",
markdown:
"## create\n\n`client.hris.company.payStatementItem.rules.create(entity_ids?: string[], attributes?: { metadata?: object; }, conditions?: { field?: string; operator?: 'equals'; value?: string; }[], effective_end_date?: string, effective_start_date?: string, entity_type?: 'pay_statement_item'): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**post** `/employer/pay-statement-item/rule`\n\nCustom rules can be created to associate specific attributes to pay statement items depending on the use case. For example, pay statement items that meet certain conditions can be labeled as a pre-tax 401k. This metadata can be retrieved where pay statement item information is available.\n\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to create the rule for.\n\n- `attributes?: { metadata?: object; }`\n Specifies the fields to be applied when the condition is met.\n - `metadata?: object`\n The metadata to be attached in the entity. It is a key-value pairs where the values can be of any type (string, number, boolean, object, array, etc.).\n\n- `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n\n- `effective_end_date?: string`\n Specifies when the rules should stop applying rules based on the date.\n\n- `effective_start_date?: string`\n Specifies when the rule should begin applying based on the date.\n\n- `entity_type?: 'pay_statement_item'`\n The entity type to which the rule is applied.\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst rule = await client.hris.company.payStatementItem.rules.create();\n\nconsole.log(rule);\n```",
perLanguage: {
typescript: {
method: 'client.hris.company.payStatementItem.rules.create',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst rule = await client.hris.company.payStatementItem.rules.create();\n\nconsole.log(rule.id);",
},
python: {
method: 'hris.company.pay_statement_item.rules.create',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\nrule = client.hris.company.pay_statement_item.rules.create()\nprint(rule.id)',
},
java: {
method: 'hris().company().payStatementItem().rules().create',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleCreateParams;\nimport com.tryfinch.api.models.RuleCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RuleCreateResponse rule = client.hris().company().payStatementItem().rules().create();\n }\n}',
},
kotlin: {
method: 'hris().company().payStatementItem().rules().create',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleCreateParams\nimport com.tryfinch.api.models.RuleCreateResponse\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val rule: RuleCreateResponse = client.hris().company().payStatementItem().rules().create()\n}',
},
go: {
method: 'client.HRIS.Company.PayStatementItem.Rules.New',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.Company.PayStatementItem.Rules.New(context.TODO(), finchgo.HRISCompanyPayStatementItemRuleNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n',
},
ruby: {
method: 'hris.company.pay_statement_item.rules.create',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\nrule = finch.hris.company.pay_statement_item.rules.create\n\nputs(rule)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/pay-statement-item/rule \\\n -X POST \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'list',
endpoint: '/employer/pay-statement-item/rule',
httpMethod: 'get',
summary: 'Get Rules',
description: 'List all rules of a connection account.',
stainlessPath: '(resource) hris.company.pay_statement_item.rules > (method) list',
qualified: 'client.hris.company.payStatementItem.rules.list',
params: ['entity_ids?: string[];'],
response:
"{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }",
markdown:
"## list\n\n`client.hris.company.payStatementItem.rules.list(entity_ids?: string[]): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**get** `/employer/pay-statement-item/rule`\n\nList all rules of a connection account.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to retrieve rules for.\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const ruleListResponse of client.hris.company.payStatementItem.rules.list()) {\n console.log(ruleListResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.company.payStatementItem.rules.list',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const ruleListResponse of client.hris.company.payStatementItem.rules.list()) {\n console.log(ruleListResponse.id);\n}",
},
python: {
method: 'hris.company.pay_statement_item.rules.list',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.company.pay_statement_item.rules.list()\npage = page.responses[0]\nprint(page.id)',
},
java: {
method: 'hris().company().payStatementItem().rules().list',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListPage;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisCompanyPayStatementItemRuleListPage page = client.hris().company().payStatementItem().rules().list();\n }\n}',
},
kotlin: {
method: 'hris().company().payStatementItem().rules().list',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListPage\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleListParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val page: HrisCompanyPayStatementItemRuleListPage = client.hris().company().payStatementItem().rules().list()\n}',
},
go: {
method: 'client.HRIS.Company.PayStatementItem.Rules.List',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Company.PayStatementItem.Rules.List(context.TODO(), finchgo.HRISCompanyPayStatementItemRuleListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.company.pay_statement_item.rules.list',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.company.pay_statement_item.rules.list\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/pay-statement-item/rule \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'update',
endpoint: '/employer/pay-statement-item/rule/{rule_id}',
httpMethod: 'put',
summary: 'Update Rule',
description: 'Update a rule for a pay statement item.',
stainlessPath: '(resource) hris.company.pay_statement_item.rules > (method) update',
qualified: 'client.hris.company.payStatementItem.rules.update',
params: ['rule_id: string;', 'entity_ids?: string[];', 'optionalProperty?: object;'],
response:
"{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }",
markdown:
"## update\n\n`client.hris.company.payStatementItem.rules.update(rule_id: string, entity_ids?: string[], optionalProperty?: object): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**put** `/employer/pay-statement-item/rule/{rule_id}`\n\nUpdate a rule for a pay statement item.\n\n### Parameters\n\n- `rule_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to update the rule for.\n\n- `optionalProperty?: object`\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst rule = await client.hris.company.payStatementItem.rules.update('rule_id');\n\nconsole.log(rule);\n```",
perLanguage: {
typescript: {
method: 'client.hris.company.payStatementItem.rules.update',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst rule = await client.hris.company.payStatementItem.rules.update('rule_id');\n\nconsole.log(rule.id);",
},
python: {
method: 'hris.company.pay_statement_item.rules.update',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\nrule = client.hris.company.pay_statement_item.rules.update(\n rule_id="rule_id",\n)\nprint(rule.id)',
},
java: {
method: 'hris().company().payStatementItem().rules().update',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleUpdateParams;\nimport com.tryfinch.api.models.RuleUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RuleUpdateResponse rule = client.hris().company().payStatementItem().rules().update("rule_id");\n }\n}',
},
kotlin: {
method: 'hris().company().payStatementItem().rules().update',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleUpdateParams\nimport com.tryfinch.api.models.RuleUpdateResponse\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val rule: RuleUpdateResponse = client.hris().company().payStatementItem().rules().update("rule_id")\n}',
},
go: {
method: 'client.HRIS.Company.PayStatementItem.Rules.Update',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.Company.PayStatementItem.Rules.Update(\n\t\tcontext.TODO(),\n\t\t"rule_id",\n\t\tfinchgo.HRISCompanyPayStatementItemRuleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n',
},
ruby: {
method: 'hris.company.pay_statement_item.rules.update',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\nrule = finch.hris.company.pay_statement_item.rules.update("rule_id")\n\nputs(rule)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/pay-statement-item/rule/$RULE_ID \\\n -X PUT \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'delete',
endpoint: '/employer/pay-statement-item/rule/{rule_id}',
httpMethod: 'delete',
summary: 'Delete Rule',
description: 'Delete a rule for a pay statement item.',
stainlessPath: '(resource) hris.company.pay_statement_item.rules > (method) delete',
qualified: 'client.hris.company.payStatementItem.rules.delete',
params: ['rule_id: string;', 'entity_ids?: string[];'],
response:
"{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; deleted_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }",
markdown:
"## delete\n\n`client.hris.company.payStatementItem.rules.delete(rule_id: string, entity_ids?: string[]): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; deleted_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**delete** `/employer/pay-statement-item/rule/{rule_id}`\n\nDelete a rule for a pay statement item.\n\n### Parameters\n\n- `rule_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to delete the rule for.\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; deleted_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `deleted_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst rule = await client.hris.company.payStatementItem.rules.delete('rule_id');\n\nconsole.log(rule);\n```",
perLanguage: {
typescript: {
method: 'client.hris.company.payStatementItem.rules.delete',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst rule = await client.hris.company.payStatementItem.rules.delete('rule_id');\n\nconsole.log(rule.id);",
},
python: {
method: 'hris.company.pay_statement_item.rules.delete',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\nrule = client.hris.company.pay_statement_item.rules.delete(\n rule_id="rule_id",\n)\nprint(rule.id)',
},
java: {
method: 'hris().company().payStatementItem().rules().delete',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleDeleteParams;\nimport com.tryfinch.api.models.RuleDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RuleDeleteResponse rule = client.hris().company().payStatementItem().rules().delete("rule_id");\n }\n}',
},
kotlin: {
method: 'hris().company().payStatementItem().rules().delete',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisCompanyPayStatementItemRuleDeleteParams\nimport com.tryfinch.api.models.RuleDeleteResponse\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val rule: RuleDeleteResponse = client.hris().company().payStatementItem().rules().delete("rule_id")\n}',
},
go: {
method: 'client.HRIS.Company.PayStatementItem.Rules.Delete',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.Company.PayStatementItem.Rules.Delete(\n\t\tcontext.TODO(),\n\t\t"rule_id",\n\t\tfinchgo.HRISCompanyPayStatementItemRuleDeleteParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n',
},
ruby: {
method: 'hris.company.pay_statement_item.rules.delete',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\nrule = finch.hris.company.pay_statement_item.rules.delete("rule_id")\n\nputs(rule)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/pay-statement-item/rule/$RULE_ID \\\n -X DELETE \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'list',
endpoint: '/employer/directory',
httpMethod: 'get',
summary: 'Directory',
description: 'Read company directory and organization structure',
stainlessPath: '(resource) hris.directory > (method) list',
qualified: 'client.hris.directory.list',
params: ['entity_ids?: string[];', 'limit?: number;', 'offset?: number;'],
response:
'{ id: string; department: { name?: string; }; first_name: string; is_active: boolean; last_name: string; manager: { id: string; }; middle_name: string; }',
markdown:
"## list\n\n`client.hris.directory.list(entity_ids?: string[], limit?: number, offset?: number): { id: string; department: object; first_name: string; is_active: boolean; last_name: string; manager: object; middle_name: string; }`\n\n**get** `/employer/directory`\n\nRead company directory and organization structure\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n- `limit?: number`\n Number of employees to return (defaults to all)\n\n- `offset?: number`\n Index to start from (defaults to 0)\n\n### Returns\n\n- `{ id: string; department: { name?: string; }; first_name: string; is_active: boolean; last_name: string; manager: { id: string; }; middle_name: string; }`\n\n - `id: string`\n - `department: { name?: string; }`\n - `first_name: string`\n - `is_active: boolean`\n - `last_name: string`\n - `manager: { id: string; }`\n - `middle_name: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const individualInDirectory of client.hris.directory.list()) {\n console.log(individualInDirectory);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.directory.list',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const individualInDirectory of client.hris.directory.list()) {\n console.log(individualInDirectory.id);\n}",
},
python: {
method: 'hris.directory.list',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.directory.list()\npage = page.individuals[0]\nprint(page.id)',
},
java: {
method: 'hris().directory().list',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisDirectoryListPage page = client.hris().directory().list();\n }\n}',
},
kotlin: {
method: 'hris().directory().list',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisDirectoryListPage\nimport com.tryfinch.api.models.HrisDirectoryListParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val page: HrisDirectoryListPage = client.hris().directory().list()\n}',
},
go: {
method: 'client.HRIS.Directory.List',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.directory.list',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.directory.list\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/directory \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'list_individuals',
endpoint: '/employer/directory',
httpMethod: 'get',
summary: 'Directory',
description: 'Read company directory and organization structure',
stainlessPath: '(resource) hris.directory > (method) list_individuals',
qualified: 'client.hris.directory.listIndividuals',
perLanguage: {
typescript: {
method: 'client.hris.directory.listIndividuals',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const individualInDirectory of client.hris.directory.listIndividuals()) {\n console.log(individualInDirectory.id);\n}",
},
python: {
method: 'hris.directory.list_individuals',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.directory.list_individuals()\npage = page.individuals[0]\nprint(page.id)',
},
java: {
method: 'hris().directory().listIndividuals',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListIndividualsPage;\nimport com.tryfinch.api.models.HrisDirectoryListIndividualsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisDirectoryListIndividualsPage page = client.hris().directory().listIndividuals();\n }\n}',
},
kotlin: {
method: 'hris().directory().listIndividuals',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisDirectoryListIndividualsPage\nimport com.tryfinch.api.models.HrisDirectoryListIndividualsParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val page: HrisDirectoryListIndividualsPage = client.hris().directory().listIndividuals()\n}',
},
go: {
method: 'client.HRIS.Directory.ListIndividuals',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.ListIndividuals(context.TODO(), finchgo.HRISDirectoryListIndividualsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.directory.list_individuals',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.directory.list_individuals\n\nputs(page)',
},
},
},
{
name: 'retrieve_many',
endpoint: '/employer/individual',
httpMethod: 'post',
summary: 'Individual',
description: 'Read individual data, excluding income and employment data',
stainlessPath: '(resource) hris.individuals > (method) retrieve_many',
qualified: 'client.hris.individuals.retrieveMany',
params: [
'entity_ids?: string[];',
'options?: { include?: string[]; };',
'requests?: { individual_id?: string; }[];',
],
response:
"{ body: { id: string; dob: string; ethnicity: string; first_name: string; gender: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name: string; middle_name: string; phone_numbers: object[]; preferred_name: string; residence: location; emails?: object[]; encrypted_ssn?: string; ssn?: string; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }",
markdown:
"## retrieve_many\n\n`client.hris.individuals.retrieveMany(entity_ids?: string[], options?: { include?: string[]; }, requests?: { individual_id?: string; }[]): { body: individual; code: number; individual_id: string; }`\n\n**post** `/employer/individual`\n\nRead individual data, excluding income and employment data\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n- `options?: { include?: string[]; }`\n - `include?: string[]`\n\n- `requests?: { individual_id?: string; }[]`\n\n### Returns\n\n- `{ body: { id: string; dob: string; ethnicity: string; first_name: string; gender: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name: string; middle_name: string; phone_numbers: object[]; preferred_name: string; residence: location; emails?: object[]; encrypted_ssn?: string; ssn?: string; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }`\n\n - `body: { id: string; dob: string; ethnicity: string; first_name: string; gender: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name: string; middle_name: string; phone_numbers: { data: string; type: 'work' | 'personal'; }[]; preferred_name: string; residence: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; emails?: { data: string; type: 'work' | 'personal'; }[]; encrypted_ssn?: string; ssn?: string; } | { code: number; message: string; name: string; finch_code?: string; }`\n - `code: number`\n - `individual_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const individualResponse of client.hris.individuals.retrieveMany()) {\n console.log(individualResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.individuals.retrieveMany',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const individualResponse of client.hris.individuals.retrieveMany()) {\n console.log(individualResponse.individual_id);\n}",
},
python: {
method: 'hris.individuals.retrieve_many',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.individuals.retrieve_many()\npage = page.responses[0]\nprint(page.individual_id)',
},
java: {
method: 'hris().individuals().retrieveMany',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisIndividualRetrieveManyPage;\nimport com.tryfinch.api.models.HrisIndividualRetrieveManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisIndividualRetrieveManyPage page = client.hris().individuals().retrieveMany();\n }\n}',
},
kotlin: {
method: 'hris().individuals().retrieveMany',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisIndividualRetrieveManyPage\nimport com.tryfinch.api.models.HrisIndividualRetrieveManyParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val page: HrisIndividualRetrieveManyPage = client.hris().individuals().retrieveMany()\n}',
},
go: {
method: 'client.HRIS.Individuals.GetMany',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Individuals.GetMany(context.TODO(), finchgo.HRISIndividualGetManyParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.individuals.retrieve_many',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.individuals.retrieve_many\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/individual \\\n -X POST \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'retrieve_many',
endpoint: '/employer/employment',
httpMethod: 'post',
summary: 'Employment',
description: 'Read individual employment and income data',
stainlessPath: '(resource) hris.employments > (method) retrieve_many',
qualified: 'client.hris.employments.retrieveMany',
params: ['requests: { individual_id: string; }[];', 'entity_ids?: string[];'],
response:
"{ body: { id: string; class_code: string; department: object; employment: object; employment_status: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date: string; first_name: string; flsa_status: 'exempt' | 'non_exempt' | 'unknown'; is_active: boolean; last_name: string; latest_rehire_date: string; location: location; manager: object; middle_name: string; start_date: string; title: string; custom_fields?: object[]; income?: income; income_history?: income[]; source_id?: string; work_id?: string; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }",
markdown:
"## retrieve_many\n\n`client.hris.employments.retrieveMany(requests: { individual_id: string; }[], entity_ids?: string[]): { body: employment_data; code: number; individual_id: string; }`\n\n**post** `/employer/employment`\n\nRead individual employment and income data\n\n### Parameters\n\n- `requests: { individual_id: string; }[]`\n The array of batch requests.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ body: { id: string; class_code: string; department: object; employment: object; employment_status: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date: string; first_name: string; flsa_status: 'exempt' | 'non_exempt' | 'unknown'; is_active: boolean; last_name: string; latest_rehire_date: string; location: location; manager: object; middle_name: string; start_date: string; title: string; custom_fields?: object[]; income?: income; income_history?: income[]; source_id?: string; work_id?: string; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }`\n\n - `body: { id: string; class_code: string; department: { name: string; }; employment: { subtype: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type: 'employee' | 'contractor'; }; employment_status: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date: string; first_name: string; flsa_status: 'exempt' | 'non_exempt' | 'unknown'; is_active: boolean; last_name: string; latest_rehire_date: string; location: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; manager: { id: string; }; middle_name: string; start_date: string; title: string; custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]; income?: { amount: number; currency: string; effective_date: string; unit: string; }; income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[]; source_id?: string; work_id?: string; } | { code: number; message: string; name: string; finch_code?: string; }`\n - `code: number`\n - `individual_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const employmentDataResponse of client.hris.employments.retrieveMany({ requests: [{ individual_id: 'individual_id' }] })) {\n console.log(employmentDataResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.employments.retrieveMany',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const employmentDataResponse of client.hris.employments.retrieveMany({\n requests: [{ individual_id: 'individual_id' }],\n})) {\n console.log(employmentDataResponse.individual_id);\n}",
},
python: {
method: 'hris.employments.retrieve_many',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.employments.retrieve_many(\n requests=[{\n "individual_id": "individual_id"\n }],\n)\npage = page.responses[0]\nprint(page.individual_id)',
},
java: {
method: 'hris().employments().retrieveMany',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisEmploymentRetrieveManyPage;\nimport com.tryfinch.api.models.HrisEmploymentRetrieveManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisEmploymentRetrieveManyParams params = HrisEmploymentRetrieveManyParams.builder()\n .addRequest(HrisEmploymentRetrieveManyParams.Request.builder()\n .individualId("individual_id")\n .build())\n .build();\n HrisEmploymentRetrieveManyPage page = client.hris().employments().retrieveMany(params);\n }\n}',
},
kotlin: {
method: 'hris().employments().retrieveMany',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisEmploymentRetrieveManyPage\nimport com.tryfinch.api.models.HrisEmploymentRetrieveManyParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val params: HrisEmploymentRetrieveManyParams = HrisEmploymentRetrieveManyParams.builder()\n .addRequest(HrisEmploymentRetrieveManyParams.Request.builder()\n .individualId("individual_id")\n .build())\n .build()\n val page: HrisEmploymentRetrieveManyPage = client.hris().employments().retrieveMany(params)\n}',
},
go: {
method: 'client.HRIS.Employments.GetMany',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Employments.GetMany(context.TODO(), finchgo.HRISEmploymentGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISEmploymentGetManyParamsRequest{{\n\t\t\tIndividualID: finchgo.F("individual_id"),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.employments.retrieve_many',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.employments.retrieve_many(requests: [{individual_id: "individual_id"}])\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/employment \\\n -H \'Content-Type: application/json\' \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN" \\\n -d \'{\n "requests": [\n {\n "individual_id": "individual_id"\n }\n ]\n }\'',
},
},
},
{
name: 'list',
endpoint: '/employer/payment',
httpMethod: 'get',
summary: 'Payment',
description: 'Read payroll and contractor related payments by the company.',
stainlessPath: '(resource) hris.payments > (method) list',
qualified: 'client.hris.payments.list',
params: ['end_date: string;', 'start_date: string;', 'entity_ids?: string[];'],
response:
'{ id: string; company_debit: { amount: number; currency: string; }; debit_date: string; employee_taxes: { amount: number; currency: string; }; employer_taxes: { amount: number; currency: string; }; gross_pay: { amount: number; currency: string; }; individual_ids: string[]; net_pay: { amount: number; currency: string; }; pay_date: string; pay_frequencies: string[]; pay_group_ids: string[]; pay_period: { end_date: string; start_date: string; }; }',
markdown:
"## list\n\n`client.hris.payments.list(end_date: string, start_date: string, entity_ids?: string[]): { id: string; company_debit: money; debit_date: string; employee_taxes: money; employer_taxes: money; gross_pay: money; individual_ids: string[]; net_pay: money; pay_date: string; pay_frequencies: string[]; pay_group_ids: string[]; pay_period: object; }`\n\n**get** `/employer/payment`\n\nRead payroll and contractor related payments by the company.\n\n### Parameters\n\n- `end_date: string`\n The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. Filters payments by their **pay_date** field.\n\n- `start_date: string`\n The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. Filters payments by their **pay_date** field.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ id: string; company_debit: { amount: number; currency: string; }; debit_date: string; employee_taxes: { amount: number; currency: string; }; employer_taxes: { amount: number; currency: string; }; gross_pay: { amount: number; currency: string; }; individual_ids: string[]; net_pay: { amount: number; currency: string; }; pay_date: string; pay_frequencies: string[]; pay_group_ids: string[]; pay_period: { end_date: string; start_date: string; }; }`\n\n - `id: string`\n - `company_debit: { amount: number; currency: string; }`\n - `debit_date: string`\n - `employee_taxes: { amount: number; currency: string; }`\n - `employer_taxes: { amount: number; currency: string; }`\n - `gross_pay: { amount: number; currency: string; }`\n - `individual_ids: string[]`\n - `net_pay: { amount: number; currency: string; }`\n - `pay_date: string`\n - `pay_frequencies: string[]`\n - `pay_group_ids: string[]`\n - `pay_period: { end_date: string; start_date: string; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.hris.payments.list({ end_date: '2021-01-01', start_date: '2021-01-01' })) {\n console.log(payment);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.payments.list',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.hris.payments.list({\n end_date: '2021-01-01',\n start_date: '2021-01-01',\n})) {\n console.log(payment.id);\n}",
},
python: {
method: 'hris.payments.list',
example:
'from datetime import date\nfrom finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.payments.list(\n end_date=date.fromisoformat("2021-01-01"),\n start_date=date.fromisoformat("2021-01-01"),\n)\npage = page.items[0]\nprint(page.id)',
},
java: {
method: 'hris().payments().list',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPaymentListPage;\nimport com.tryfinch.api.models.HrisPaymentListParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisPaymentListParams params = HrisPaymentListParams.builder()\n .endDate(LocalDate.parse("2021-01-01"))\n .startDate(LocalDate.parse("2021-01-01"))\n .build();\n HrisPaymentListPage page = client.hris().payments().list(params);\n }\n}',
},
kotlin: {
method: 'hris().payments().list',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisPaymentListPage\nimport com.tryfinch.api.models.HrisPaymentListParams\nimport java.time.LocalDate\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val params: HrisPaymentListParams = HrisPaymentListParams.builder()\n .endDate(LocalDate.parse("2021-01-01"))\n .startDate(LocalDate.parse("2021-01-01"))\n .build()\n val page: HrisPaymentListPage = client.hris().payments().list(params)\n}',
},
go: {
method: 'client.HRIS.Payments.List',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Payments.List(context.TODO(), finchgo.HRISPaymentListParams{\n\t\tEndDate: finchgo.F(time.Now()),\n\t\tStartDate: finchgo.F(time.Now()),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.payments.list',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.payments.list(end_date: "2021-01-01", start_date: "2021-01-01")\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/payment \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'retrieve_many',
endpoint: '/employer/pay-statement',
httpMethod: 'post',
summary: 'Pay Statement',
description:
'Read detailed pay statements for each individual.\n\nDeduction and contribution types are supported by the payroll systems that supports Benefits.',
stainlessPath: '(resource) hris.pay_statements > (method) retrieve_many',
qualified: 'client.hris.payStatements.retrieveMany',
params: [
'requests: { payment_id: string; limit?: number; offset?: number; }[];',
'entity_ids?: string[];',
],
response:
"{ body: { paging: object; pay_statements: pay_statement[]; } | { code: number; message: string; name: string; finch_code?: string; } | { code: 202; finch_code: 'data_sync_in_progress'; message: 'The pay statements for this payment are being fetched. Please check back later.'; name: 'accepted'; }; code: number; payment_id: string; }",
markdown:
"## retrieve_many\n\n`client.hris.payStatements.retrieveMany(requests: { payment_id: string; limit?: number; offset?: number; }[], entity_ids?: string[]): { body: pay_statement_response_body | object | pay_statement_data_sync_in_progress; code: number; payment_id: string; }`\n\n**post** `/employer/pay-statement`\n\nRead detailed pay statements for each individual.\n\nDeduction and contribution types are supported by the payroll systems that supports Benefits.\n\n### Parameters\n\n- `requests: { payment_id: string; limit?: number; offset?: number; }[]`\n The array of batch requests.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ body: { paging: object; pay_statements: pay_statement[]; } | { code: number; message: string; name: string; finch_code?: string; } | { code: 202; finch_code: 'data_sync_in_progress'; message: 'The pay statements for this payment are being fetched. Please check back later.'; name: 'accepted'; }; code: number; payment_id: string; }`\n\n - `body: { paging: { offset: number; count?: number; }; pay_statements: { earnings: object[]; employee_deductions: object[]; employer_contributions: object[]; gross_pay: money; individual_id: string; net_pay: money; payment_method: 'check' | 'direct_deposit' | 'other'; taxes: object[]; total_hours: number; type: 'off_cycle_payroll' | 'one_time_payment' | 'regular_payroll'; }[]; } | { code: number; message: string; name: string; finch_code?: string; } | { code: 202; finch_code: 'data_sync_in_progress'; message: 'The pay statements for this payment are being fetched. Please check back later.'; name: 'accepted'; }`\n - `code: number`\n - `payment_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payStatementResponse of client.hris.payStatements.retrieveMany({ requests: [{ payment_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }] })) {\n console.log(payStatementResponse);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.payStatements.retrieveMany',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const payStatementResponse of client.hris.payStatements.retrieveMany({\n requests: [{ payment_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }],\n})) {\n console.log(payStatementResponse.payment_id);\n}",
},
python: {
method: 'hris.pay_statements.retrieve_many',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.pay_statements.retrieve_many(\n requests=[{\n "payment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }],\n)\npage = page.responses[0]\nprint(page.payment_id)',
},
java: {
method: 'hris().payStatements().retrieveMany',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementRetrieveManyPage;\nimport com.tryfinch.api.models.HrisPayStatementRetrieveManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisPayStatementRetrieveManyParams params = HrisPayStatementRetrieveManyParams.builder()\n .addRequest(HrisPayStatementRetrieveManyParams.Request.builder()\n .paymentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build())\n .build();\n HrisPayStatementRetrieveManyPage page = client.hris().payStatements().retrieveMany(params);\n }\n}',
},
kotlin: {
method: 'hris().payStatements().retrieveMany',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisPayStatementRetrieveManyPage\nimport com.tryfinch.api.models.HrisPayStatementRetrieveManyParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val params: HrisPayStatementRetrieveManyParams = HrisPayStatementRetrieveManyParams.builder()\n .addRequest(HrisPayStatementRetrieveManyParams.Request.builder()\n .paymentId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .build())\n .build()\n val page: HrisPayStatementRetrieveManyPage = client.hris().payStatements().retrieveMany(params)\n}',
},
go: {
method: 'client.HRIS.PayStatements.GetMany',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatements.GetMany(context.TODO(), finchgo.HRISPayStatementGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISPayStatementGetManyParamsRequest{{\n\t\t\tPaymentID: finchgo.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.pay_statements.retrieve_many',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.pay_statements.retrieve_many(requests: [{payment_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}])\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/pay-statement \\\n -H \'Content-Type: application/json\' \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN" \\\n -d \'{\n "requests": [\n {\n "payment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"\n }\n ]\n }\'',
},
},
},
{
name: 'list',
endpoint: '/employer/documents',
httpMethod: 'get',
summary: 'List Documents',
description:
'**Beta:** This endpoint is in beta and may change.\nRetrieve a list of company-wide documents.\n',
stainlessPath: '(resource) hris.documents > (method) list',
qualified: 'client.hris.documents.list',
params: [
'entity_ids?: string[];',
'individual_ids?: string[];',
'limit?: number;',
'offset?: number;',
"types?: 'w4_2020' | 'w4_2005'[];",
],
response:
"{ documents: { id: string; individual_id: string; type: 'w4_2020' | 'w4_2005'; url: string; year: number; }[]; paging: { offset: number; count?: number; }; }",
markdown:
"## list\n\n`client.hris.documents.list(entity_ids?: string[], individual_ids?: string[], limit?: number, offset?: number, types?: 'w4_2020' | 'w4_2005'[]): { documents: document_response[]; paging: paging; }`\n\n**get** `/employer/documents`\n\n**Beta:** This endpoint is in beta and may change.\nRetrieve a list of company-wide documents.\n\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n- `individual_ids?: string[]`\n Comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all individuals\n\n- `limit?: number`\n Number of documents to return (defaults to all)\n\n- `offset?: number`\n Index to start from (defaults to 0)\n\n- `types?: 'w4_2020' | 'w4_2005'[]`\n Comma-delimited list of document types to filter on. If empty, defaults to all types\n\n### Returns\n\n- `{ documents: { id: string; individual_id: string; type: 'w4_2020' | 'w4_2005'; url: string; year: number; }[]; paging: { offset: number; count?: number; }; }`\n\n - `documents: { id: string; individual_id: string; type: 'w4_2020' | 'w4_2005'; url: string; year: number; }[]`\n - `paging: { offset: number; count?: number; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst documents = await client.hris.documents.list();\n\nconsole.log(documents);\n```",
perLanguage: {
typescript: {
method: 'client.hris.documents.list',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst documents = await client.hris.documents.list();\n\nconsole.log(documents.documents);",
},
python: {
method: 'hris.documents.list',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\ndocuments = client.hris.documents.list()\nprint(documents.documents)',
},
java: {
method: 'hris().documents().list',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.DocumentListResponse;\nimport com.tryfinch.api.models.HrisDocumentListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n DocumentListResponse documents = client.hris().documents().list();\n }\n}',
},
kotlin: {
method: 'hris().documents().list',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.DocumentListResponse\nimport com.tryfinch.api.models.HrisDocumentListParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val documents: DocumentListResponse = client.hris().documents().list()\n}',
},
go: {
method: 'client.HRIS.Documents.List',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdocuments, err := client.HRIS.Documents.List(context.TODO(), finchgo.HRISDocumentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", documents.Documents)\n}\n',
},
ruby: {
method: 'hris.documents.list',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\ndocuments = finch.hris.documents.list\n\nputs(documents)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/documents \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'retreive',
endpoint: '/employer/documents/{document_id}',
httpMethod: 'get',
summary: 'Get Document',
description:
'**Beta:** This endpoint is in beta and may change.\nRetrieve details of a specific document by its ID.\n',
stainlessPath: '(resource) hris.documents > (method) retreive',
qualified: 'client.hris.documents.retreive',
params: ['document_id: string;', 'entity_ids?: string[];'],
response:
"{ data: { amount_for_other_dependents: number; amount_for_qualifying_children_under_17: number; deductions: number; extra_withholding: number; filing_status: string; individual_id: string; other_income: number; total_claim_dependent_and_other_credits: number; }; type: 'w4_2020'; year: number; } | { data: { additional_withholding: number; exemption: 'exempt' | 'non_exempt'; filing_status: 'married' | 'married_but_withhold_at_higher_single_rate' | 'single'; individual_id: string; total_number_of_allowances: number; }; type: 'w4_2005'; year: number; }",
markdown:
"## retreive\n\n`client.hris.documents.retreive(document_id: string, entity_ids?: string[]): object | object`\n\n**get** `/employer/documents/{document_id}`\n\n**Beta:** This endpoint is in beta and may change.\nRetrieve details of a specific document by its ID.\n\n\n### Parameters\n\n- `document_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ data: { amount_for_other_dependents: number; amount_for_qualifying_children_under_17: number; deductions: number; extra_withholding: number; filing_status: string; individual_id: string; other_income: number; total_claim_dependent_and_other_credits: number; }; type: 'w4_2020'; year: number; } | { data: { additional_withholding: number; exemption: 'exempt' | 'non_exempt'; filing_status: 'married' | 'married_but_withhold_at_higher_single_rate' | 'single'; individual_id: string; total_number_of_allowances: number; }; type: 'w4_2005'; year: number; }`\n A 2020 version of the W-4 tax form containing information on an individual's filing status, dependents, and withholding details.\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst response = await client.hris.documents.retreive('document_id');\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.hris.documents.retreive',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst response = await client.hris.documents.retreive('document_id');\n\nconsole.log(response);",
},
python: {
method: 'hris.documents.retreive',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\nresponse = client.hris.documents.retreive(\n document_id="document_id",\n)\nprint(response)',
},
java: {
method: 'hris().documents().retreive',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.DocumentRetreiveResponse;\nimport com.tryfinch.api.models.HrisDocumentRetreiveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n DocumentRetreiveResponse response = client.hris().documents().retreive("document_id");\n }\n}',
},
kotlin: {
method: 'hris().documents().retreive',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.DocumentRetreiveResponse\nimport com.tryfinch.api.models.HrisDocumentRetreiveParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val response: DocumentRetreiveResponse = client.hris().documents().retreive("document_id")\n}',
},
go: {
method: 'client.HRIS.Documents.Retreive',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.HRIS.Documents.Retreive(\n\t\tcontext.TODO(),\n\t\t"document_id",\n\t\tfinchgo.HRISDocumentRetreiveParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n',
},
ruby: {
method: 'hris.documents.retreive',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\nresponse = finch.hris.documents.retreive("document_id")\n\nputs(response)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/documents/$DOCUMENT_ID \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'list',
endpoint: '/employer/benefits',
httpMethod: 'get',
summary: 'Get All Deductions',
description: 'List all company-wide deductions and contributions.',
stainlessPath: '(resource) hris.benefits > (method) list',
qualified: 'client.hris.benefits.list',
params: ['entity_ids?: string[];'],
response:
"{ benefit_id: string; description: string; frequency: 'every_paycheck' | 'monthly' | 'one_time'; type: string; company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }; }",
markdown:
"## list\n\n`client.hris.benefits.list(entity_ids?: string[]): { benefit_id: string; description: string; frequency: benefit_frequency; type: benefit_type; company_contribution?: object; }`\n\n**get** `/employer/benefits`\n\nList all company-wide deductions and contributions.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ benefit_id: string; description: string; frequency: 'every_paycheck' | 'monthly' | 'one_time'; type: string; company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }; }`\n\n - `benefit_id: string`\n - `description: string`\n - `frequency: 'every_paycheck' | 'monthly' | 'one_time'`\n - `type: string`\n - `company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const companyBenefit of client.hris.benefits.list()) {\n console.log(companyBenefit);\n}\n```",
perLanguage: {
typescript: {
method: 'client.hris.benefits.list',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\n// Automatically fetches more pages as needed.\nfor await (const companyBenefit of client.hris.benefits.list()) {\n console.log(companyBenefit.benefit_id);\n}",
},
python: {
method: 'hris.benefits.list',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\npage = client.hris.benefits.list()\npage = page.items[0]\nprint(page.benefit_id)',
},
java: {
method: 'hris().benefits().list',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitListPage;\nimport com.tryfinch.api.models.HrisBenefitListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisBenefitListPage page = client.hris().benefits().list();\n }\n}',
},
kotlin: {
method: 'hris().benefits().list',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.HrisBenefitListPage\nimport com.tryfinch.api.models.HrisBenefitListParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val page: HrisBenefitListPage = client.hris().benefits().list()\n}',
},
go: {
method: 'client.HRIS.Benefits.List',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.List(context.TODO(), finchgo.HRISBenefitListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n',
},
ruby: {
method: 'hris.benefits.list',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.benefits.list\n\nputs(page)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/benefits \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'create',
endpoint: '/employer/benefits',
httpMethod: 'post',
summary: 'Create Deduction',
description:
'Creates a new company-wide deduction or contribution. Please use the `/providers` endpoint to view available types for each provider.',
stainlessPath: '(resource) hris.benefits > (method) create',
qualified: 'client.hris.benefits.create',
params: [
'entity_ids?: string[];',
"company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; };",
'description?: string;',
"frequency?: 'every_paycheck' | 'monthly' | 'one_time';",
'type?: string;',
],
response: '{ benefit_id: string; job_id: string; }',
markdown:
"## create\n\n`client.hris.benefits.create(entity_ids?: string[], company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }, description?: string, frequency?: 'every_paycheck' | 'monthly' | 'one_time', type?: string): { benefit_id: string; job_id: string; }`\n\n**post** `/employer/benefits`\n\nCreates a new company-wide deduction or contribution. Please use the `/providers` endpoint to view available types for each provider.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n- `company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }`\n The company match for this benefit.\n - `tiers: { match: number; threshold: number; }[]`\n - `type: 'match'`\n\n- `description?: string`\n Name of the benefit as it appears in the provider and pay statements. Recommend limiting this to <30 characters due to limitations in specific providers (e.g. Justworks).\n\n- `frequency?: 'every_paycheck' | 'monthly' | 'one_time'`\n The frequency of the benefit deduction/contribution.\n\n- `type?: string`\n Type of benefit.\n\n### Returns\n\n- `{ benefit_id: string; job_id: string; }`\n\n - `benefit_id: string`\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst createCompanyBenefitsResponse = await client.hris.benefits.create();\n\nconsole.log(createCompanyBenefitsResponse);\n```",
perLanguage: {
typescript: {
method: 'client.hris.benefits.create',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst createCompanyBenefitsResponse = await client.hris.benefits.create();\n\nconsole.log(createCompanyBenefitsResponse.benefit_id);",
},
python: {
method: 'hris.benefits.create',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\ncreate_company_benefits_response = client.hris.benefits.create()\nprint(create_company_benefits_response.benefit_id)',
},
java: {
method: 'hris().benefits().create',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.CreateCompanyBenefitsResponse;\nimport com.tryfinch.api.models.HrisBenefitCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n CreateCompanyBenefitsResponse createCompanyBenefitsResponse = client.hris().benefits().create();\n }\n}',
},
kotlin: {
method: 'hris().benefits().create',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.CreateCompanyBenefitsResponse\nimport com.tryfinch.api.models.HrisBenefitCreateParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val createCompanyBenefitsResponse: CreateCompanyBenefitsResponse = client.hris().benefits().create()\n}',
},
go: {
method: 'client.HRIS.Benefits.New',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcreateCompanyBenefitsResponse, err := client.HRIS.Benefits.New(context.TODO(), finchgo.HRISBenefitNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", createCompanyBenefitsResponse.BenefitID)\n}\n',
},
ruby: {
method: 'hris.benefits.create',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\ncreate_company_benefits_response = finch.hris.benefits.create\n\nputs(create_company_benefits_response)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/benefits \\\n -X POST \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'retrieve',
endpoint: '/employer/benefits/{benefit_id}',
httpMethod: 'get',
summary: 'Get Deduction',
description: 'Lists deductions and contributions information for a given item',
stainlessPath: '(resource) hris.benefits > (method) retrieve',
qualified: 'client.hris.benefits.retrieve',
params: ['benefit_id: string;', 'entity_ids?: string[];'],
response:
"{ benefit_id: string; description: string; frequency: 'every_paycheck' | 'monthly' | 'one_time'; type: string; company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }; }",
markdown:
"## retrieve\n\n`client.hris.benefits.retrieve(benefit_id: string, entity_ids?: string[]): { benefit_id: string; description: string; frequency: benefit_frequency; type: benefit_type; company_contribution?: object; }`\n\n**get** `/employer/benefits/{benefit_id}`\n\nLists deductions and contributions information for a given item\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n### Returns\n\n- `{ benefit_id: string; description: string; frequency: 'every_paycheck' | 'monthly' | 'one_time'; type: string; company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }; }`\n\n - `benefit_id: string`\n - `description: string`\n - `frequency: 'every_paycheck' | 'monthly' | 'one_time'`\n - `type: string`\n - `company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst companyBenefit = await client.hris.benefits.retrieve('benefit_id');\n\nconsole.log(companyBenefit);\n```",
perLanguage: {
typescript: {
method: 'client.hris.benefits.retrieve',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst companyBenefit = await client.hris.benefits.retrieve('benefit_id');\n\nconsole.log(companyBenefit.benefit_id);",
},
python: {
method: 'hris.benefits.retrieve',
example:
'from finch import Finch\n\nclient = Finch(\n access_token="My Access Token",\n)\ncompany_benefit = client.hris.benefits.retrieve(\n benefit_id="benefit_id",\n)\nprint(company_benefit.benefit_id)',
},
java: {
method: 'hris().benefits().retrieve',
example:
'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.CompanyBenefit;\nimport com.tryfinch.api.models.HrisBenefitRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n CompanyBenefit companyBenefit = client.hris().benefits().retrieve("benefit_id");\n }\n}',
},
kotlin: {
method: 'hris().benefits().retrieve',
example:
'package com.tryfinch.api.example\n\nimport com.tryfinch.api.client.FinchClient\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient\nimport com.tryfinch.api.models.CompanyBenefit\nimport com.tryfinch.api.models.HrisBenefitRetrieveParams\n\nfun main() {\n val client: FinchClient = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build()\n\n val companyBenefit: CompanyBenefit = client.hris().benefits().retrieve("benefit_id")\n}',
},
go: {
method: 'client.HRIS.Benefits.Get',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go"\n\t"github.com/Finch-API/finch-api-go/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompanyBenefit, err := client.HRIS.Benefits.Get(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", companyBenefit.BenefitID)\n}\n',
},
ruby: {
method: 'hris.benefits.retrieve',
example:
'require "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\ncompany_benefit = finch.hris.benefits.retrieve("benefit_id")\n\nputs(company_benefit)',
},
http: {
example:
'curl https://api.tryfinch.com/employer/benefits/$BENEFIT_ID \\\n -H \'Finch-API-Version: 2020-09-17\' \\\n -H "Authorization: Bearer $ACCESS_TOKEN"',
},
},
},
{
name: 'update',
endpoint: '/employer/benefits/{benefit_id}',
httpMethod: 'post',
summary: 'Update Deduction',
description: 'Updates an existing company-wide deduction or contribution',
stainlessPath: '(resource) hris.benefits > (method) update',
qualified: 'client.hris.benefits.update',
params: ['benefit_id: string;', 'entity_ids?: string[];', 'description?: string;'],
response: '{ benefit_id: string; job_id: string; }',
markdown:
"## update\n\n`client.hris.benefits.update(benefit_id: string, entity_ids?: string[], description?: string): { benefit_id: string; job_id: string; }`\n\n**post** `/employer/benefits/{benefit_id}`\n\nUpdates an existing company-wide deduction or contribution\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access.\n\n- `description?: string`\n Updated name or description.\n\n### Returns\n\n- `{ benefit_id: string; job_id: string; }`\n\n - `benefit_id: string`\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst updateCompanyBenefitResponse = await client.hris.benefits.update('benefit_id');\n\nconsole.log(updateCompanyBenefitResponse);\n```",
perLanguage: {
typescript: {
method: 'client.hris.benefits.update',
example:
"import Finch from '@tryfinch/finch-api';\n\nconst client = new Finch({\n accessToken: 'My Access Token',\n});\n\nconst updateCompanyBenefitResponse = await client.hris.benefits.update('benefit_id');\n\nconsole.log(updateCompanyBenefitResponse.benefit_id);",
},
python: {