forked from square/connect-api-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.json
26185 lines (26185 loc) · 872 KB
/
api.json
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
{
"swagger": "2.0",
"info": {
"version": "2.0",
"title": "Square Connect API",
"description": "Client library for accessing the Square Connect APIs",
"termsOfService": "https://connect.squareup.com/tos",
"contact": {
"name": "Square Developer Platform",
"email": "developers@squareup.com",
"url": "https://squareup.com/developers"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"externalDocs": {
"description": "Read the official documentation here:",
"url": "https://docs.connect.squareup.com/"
},
"host": "connect.squareup.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"securityDefinitions": {
"oauth2": {
"type": "oauth2",
"authorizationUrl": "https://connect.squareup.com/oauth2/authorize",
"flow": "accessCode",
"tokenUrl": "https://connect.squareup.com/oauth2/token",
"scopes": {
"BANK_ACCOUNTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to bank account information associated with the targeted\nSquare account. For example, to call the Connect v1 ListBankAccounts endpoint.",
"CUSTOMERS_READ": "__HTTP Method__: `GET`\n\nGrants read access to customer information. For example, to call the\nListCustomers endpoint.",
"CUSTOMERS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to customer information. For example, to create and update\ncustomer profiles.",
"EMPLOYEES_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee profile information. For example, to call the\nConnect v1 Employees API.",
"EMPLOYEES_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee profile information. For example, to create\nand modify employee profiles.",
"INVENTORY_READ": "__HTTP Method__: `GET`\n\nGrants read access to inventory information. For example, to call the\nRetrieveInventoryCount endpoint.",
"INVENTORY_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to inventory information. For example, to call the\nBatchChangeInventory endpoint.",
"ITEMS_READ": "__HTTP Method__: `GET`\n\nGrants read access to business and location information. For example, to\nobtain a location ID for subsequent activity.",
"ITEMS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to product catalog information. For example, to modify or\nadd to a product catalog.",
"MERCHANT_PROFILE_READ": "__HTTP Method__: `GET`\n\nGrants read access to business and location information. For example, to\nobtain a location ID for subsequent activity.",
"ORDERS_READ": "__HTTP Method__: `GET`\n\nGrants read access to order information. For example, to call the\nBatchRetrieveOrders endpoint.",
"ORDERS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to order information. For example, to call the\nCreateCheckout endpoint.",
"PAYMENTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to transaction and refund information. For example, to call\nthe RetrieveTransaction endpoint.",
"PAYMENTS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to transaction and refunds information. For example, to\nprocess payments with the Transactions or Checkout API.",
"PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nAllow third party applications to deduct a portion of each transaction amount.\n__Required__ to use multiparty transaction functionality with the Transactions\nAPI.",
"PAYMENTS_WRITE_IN_PERSON": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to transaction and refunds information. For example, to\nprocess in-person payments.",
"SETTLEMENTS_READ": "__HTTP Method__: `GET`\n\nGrants read access to settlement (deposit) information. For example, to call\nthe Connect v1 ListSettlements endpoint.",
"TIMECARDS_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee timecard information. For example, to call the\nConnect v1 ListTimecards endpoint.",
"TIMECARDS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee timecard information. For example, to create\nand modify timecards.",
"TIMECARDS_SETTINGS_READ": "__HTTP Method__: `GET`\n\nGrants read access to employee timecard settings information. For example, to\ncall the GetBreakType endpoint.",
"TIMECARDS_SETTINGS_WRITE": "__HTTP Method__: `POST`, `PUT`, `DELETE`\n\nGrants write access to employee timecard settings information. For example, to\ncall the UpdateBreakType endpoint."
}
},
"oauth2ClientSecret": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
},
"paths": {
"/mobile/authorization-code": {
"post": {
"tags": [
"MobileAuthorization"
],
"summary": "CreateMobileAuthorizationCode",
"operationId": "CreateMobileAuthorizationCode",
"description": "Generates code to authorize a mobile application to connect to a Square card reader\n\nAuthorization codes are one-time-use and expire __60 minutes__ after being issued.\n\n__Important:__ The `Authorization` header you provide to this endpoint must have the following format:\n\n```\nAuthorization: Bearer ACCESS_TOKEN\n```\n\nReplace `ACCESS_TOKEN` with a [valid production authorization credential](https://docs.connect.squareup.com/get-started#step-4-understand-the-different-application-credentials).",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"PAYMENTS_WRITE_IN_PERSON"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"PAYMENTS_WRITE_IN_PERSON"
]
}
],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/CreateMobileAuthorizationCodeRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/CreateMobileAuthorizationCodeResponse"
}
}
}
}
},
"/oauth2/clients/{client_id}/access-token/renew": {
"post": {
"tags": [
"OAuth"
],
"summary": "RenewToken",
"operationId": "RenewToken",
"description": "`RenewToken` is deprecated. For information about refreshing OAuth access tokens, see \n[Renew OAuth Token](/authz/oauth/cookbook/oauth-renew).\n\n\nRenews an OAuth access token before it expires.\n\nOAuth access tokens besides your application\u0027s personal access token expire after __30 days__.\nYou can also renew expired tokens within __15 days__ of their expiration.\nYou cannot renew an access token that has been expired for more than 15 days.\nInstead, the associated user must re-complete the OAuth flow from the beginning.\n\n__Important:__ The `Authorization` header for this endpoint must have the\nfollowing format:\n\n```\nAuthorization: Client APPLICATION_SECRET\n```\n\nReplace `APPLICATION_SECRET` with the application secret on the Credentials\npage in the [application dashboard](https://connect.squareup.com/apps).",
"x-release-status": "DEPRECATED",
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2ClientSecret": []
}
],
"parameters": [
{
"name": "client_id",
"description": "Your application\u0027s ID, available from the [application dashboard](https://connect.squareup.com/apps).",
"type": "string",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/RenewTokenRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/RenewTokenResponse"
}
}
}
}
},
"/oauth2/revoke": {
"post": {
"tags": [
"OAuth"
],
"summary": "RevokeToken",
"operationId": "RevokeToken",
"description": "Revokes an access token generated with the OAuth flow.\n\nIf an account has more than one OAuth access token for your application, this\nendpoint revokes all of them, regardless of which token you specify. When an\nOAuth access token is revoked, all of the active subscriptions associated\nwith that OAuth token are canceled immediately.\n\n__Important:__ The `Authorization` header for this endpoint must have the\nfollowing format:\n\n```\nAuthorization: Client APPLICATION_SECRET\n```\n\nReplace `APPLICATION_SECRET` with the application secret on the Credentials\npage in the [application dashboard](https://connect.squareup.com/apps).",
"x-release-status": "PUBLIC",
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2ClientSecret": []
}
],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/RevokeTokenRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/RevokeTokenResponse"
}
}
}
}
},
"/oauth2/token": {
"post": {
"tags": [
"OAuth"
],
"summary": "ObtainToken",
"operationId": "ObtainToken",
"description": "Returns an OAuth access token. \n\nThe endpoint supports distinct methods of obtaining OAuth access tokens. \nApplications specify a method by adding the `grant_type` parameter \nin the request and also provide relevant information. \nFor more information, see [OAuth access token management](/authz/oauth/how-it-works#oauth-access-token-management). \n\n__Note:__ Regardless of the method application specified,\nthe endpoint always returns two items; an OAuth access token and \na refresh token in the response. \n\n__OAuth tokens should only live on secure servers. Application clients\nshould never interact directly with OAuth tokens__.",
"x-release-status": "PUBLIC",
"x-sq-version": "2019-06-12",
"security": [],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/ObtainTokenRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/ObtainTokenResponse"
}
}
}
}
},
"/v1/me": {
"get": {
"tags": [
"V1Locations"
],
"summary": "RetrieveBusiness",
"operationId": "RetrieveBusiness",
"description": "Get a business\u0027s information.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"MERCHANT_PROFILE_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"MERCHANT_PROFILE_READ"
]
}
],
"parameters": [],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Merchant"
}
}
}
}
},
"/v1/me/employees": {
"get": {
"tags": [
"V1Employees"
],
"summary": "ListEmployees",
"operationId": "ListEmployees",
"description": "Provides summary information for all of a business\u0027s employees.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_READ"
]
}
],
"parameters": [
{
"name": "order",
"description": "The order in which employees are listed in the response, based on their created_at field. Default value: ASC",
"enum": [
"DESC",
"ASC"
],
"type": "string",
"in": "query",
"required": false
},
{
"name": "begin_updated_at",
"description": "If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format",
"type": "string",
"in": "query",
"required": false
},
{
"name": "end_updated_at",
"description": "If filtering results by there updated_at field, the end of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "begin_created_at",
"description": "If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "end_created_at",
"description": "If filtering results by their created_at field, the end of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "status",
"description": "If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE).",
"enum": [
"ACTIVE",
"INACTIVE"
],
"type": "string",
"in": "query",
"required": false
},
{
"name": "external_id",
"description": "If provided, the endpoint returns only employee entities with the specified external_id.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "limit",
"description": "The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.",
"type": "integer",
"in": "query",
"required": false
},
{
"name": "batch_token",
"description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint.",
"type": "string",
"in": "query",
"required": false
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/V1Employee"
}
}
}
}
},
"post": {
"tags": [
"V1Employees"
],
"summary": "CreateEmployee",
"operationId": "CreateEmployee",
"description": " Use the CreateEmployee endpoint to add an employee to a Square\naccount. Employees created with the Connect API have an initial status\nof `INACTIVE`. Inactive employees cannot sign in to Square Point of Sale\nuntil they are activated from the Square Dashboard. Employee status\ncannot be changed with the Connect API.\n\n\u003caside class\u003d\"important\"\u003e\nEmployee entities cannot be deleted. To disable employee profiles,\nset the employee\u0027s status to \u003ccode\u003eINACTIVE\u003c/code\u003e\n\u003c/aside\u003e",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_WRITE"
]
}
],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/V1Employee"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Employee"
}
}
}
}
},
"/v1/me/employees/{employee_id}": {
"get": {
"tags": [
"V1Employees"
],
"summary": "RetrieveEmployee",
"operationId": "RetrieveEmployee",
"description": "Provides the details for a single employee.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_READ"
]
}
],
"parameters": [
{
"name": "employee_id",
"description": "The employee\u0027s ID.",
"type": "string",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Employee"
}
}
}
},
"put": {
"tags": [
"V1Employees"
],
"summary": "UpdateEmployee",
"operationId": "UpdateEmployee",
"description": "",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_WRITE"
]
}
],
"parameters": [
{
"name": "employee_id",
"description": "The ID of the role to modify.",
"type": "string",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/V1Employee"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Employee"
}
}
}
}
},
"/v1/me/locations": {
"get": {
"tags": [
"V1Locations"
],
"summary": "ListLocations",
"operationId": "ListLocations",
"description": "Provides details for a business\u0027s locations, including their IDs.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"MERCHANT_PROFILE_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"MERCHANT_PROFILE_READ"
]
}
],
"parameters": [],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/V1Merchant"
}
}
}
}
}
},
"/v1/me/roles": {
"get": {
"tags": [
"V1Employees"
],
"summary": "ListEmployeeRoles",
"operationId": "ListEmployeeRoles",
"description": "Provides summary information for all of a business\u0027s employee roles.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_READ"
]
}
],
"parameters": [
{
"name": "order",
"description": "The order in which employees are listed in the response, based on their created_at field.Default value: ASC",
"enum": [
"DESC",
"ASC"
],
"type": "string",
"in": "query",
"required": false
},
{
"name": "limit",
"description": "The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.",
"type": "integer",
"in": "query",
"required": false
},
{
"name": "batch_token",
"description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint.",
"type": "string",
"in": "query",
"required": false
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/V1EmployeeRole"
}
}
}
}
},
"post": {
"tags": [
"V1Employees"
],
"summary": "CreateEmployeeRole",
"operationId": "CreateEmployeeRole",
"description": "Creates an employee role you can then assign to employees.\n\nSquare accounts can include any number of roles that can be assigned to\nemployees. These roles define the actions and permissions granted to an\nemployee with that role. For example, an employee with a \"Shift Manager\"\nrole might be able to issue refunds in Square Point of Sale, whereas an\nemployee with a \"Clerk\" role might not.\n\nRoles are assigned with the [V1UpdateEmployee](#endpoint-v1updateemployee)\nendpoint. An employee can have only one role at a time.\n\nIf an employee has no role, they have none of the permissions associated\nwith roles. All employees can accept payments with Square Point of Sale.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_WRITE"
]
}
],
"parameters": [
{
"name": "employee_role",
"in": "body",
"required": true,
"description": "An EmployeeRole object with a name and permissions, and an optional owner flag.",
"schema": {
"$ref": "#/definitions/V1EmployeeRole"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1EmployeeRole"
}
}
}
}
},
"/v1/me/roles/{role_id}": {
"get": {
"tags": [
"V1Employees"
],
"summary": "RetrieveEmployeeRole",
"operationId": "RetrieveEmployeeRole",
"description": "Provides the details for a single employee role.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_READ"
]
}
],
"parameters": [
{
"name": "role_id",
"description": "The role\u0027s ID.",
"type": "string",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1EmployeeRole"
}
}
}
},
"put": {
"tags": [
"V1Employees"
],
"summary": "UpdateEmployeeRole",
"operationId": "UpdateEmployeeRole",
"description": "Modifies the details of an employee role.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"EMPLOYEES_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"EMPLOYEES_WRITE"
]
}
],
"parameters": [
{
"name": "role_id",
"description": "The ID of the role to modify.",
"type": "string",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/V1EmployeeRole"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1EmployeeRole"
}
}
}
}
},
"/v1/me/timecards": {
"get": {
"tags": [
"V1Employees"
],
"summary": "ListTimecards",
"operationId": "ListTimecards",
"description": "Provides summary information for all of a business\u0027s employee timecards.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"TIMECARDS_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"TIMECARDS_READ"
]
}
],
"parameters": [
{
"name": "order",
"description": "The order in which timecards are listed in the response, based on their created_at field.",
"enum": [
"DESC",
"ASC"
],
"type": "string",
"in": "query",
"required": false
},
{
"name": "employee_id",
"description": "If provided, the endpoint returns only timecards for the employee with the specified ID.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "begin_clockin_time",
"description": "If filtering results by their clockin_time field, the beginning of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "end_clockin_time",
"description": "If filtering results by their clockin_time field, the end of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "begin_clockout_time",
"description": "If filtering results by their clockout_time field, the beginning of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "end_clockout_time",
"description": "If filtering results by their clockout_time field, the end of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "begin_updated_at",
"description": "If filtering results by their updated_at field, the beginning of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "end_updated_at",
"description": "If filtering results by their updated_at field, the end of the requested reporting period, in ISO 8601 format.",
"type": "string",
"in": "query",
"required": false
},
{
"name": "deleted",
"description": "If true, only deleted timecards are returned. If false, only valid timecards are returned.If you don\u0027t provide this parameter, both valid and deleted timecards are returned.",
"type": "boolean",
"in": "query",
"required": false
},
{
"name": "limit",
"description": "The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.",
"type": "integer",
"in": "query",
"required": false
},
{
"name": "batch_token",
"description": "A pagination cursor to retrieve the next set of results for your\noriginal query to the endpoint.",
"type": "string",
"in": "query",
"required": false
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/V1Timecard"
}
}
}
}
},
"post": {
"tags": [
"V1Employees"
],
"summary": "CreateTimecard",
"operationId": "CreateTimecard",
"description": "Creates a timecard for an employee and clocks them in with an\n`API_CREATE` event and a `clockin_time` set to the current time unless\nthe request provides a different value. To import timecards from another\nsystem (rather than clocking someone in). Specify the `clockin_time`\nand* `clockout_time` in the request.\n\nTimecards correspond to exactly one shift for a given employee, bounded\nby the `clockin_time` and `clockout_time` fields. An employee is\nconsidered clocked in if they have a timecard that doesn\u0027t have a\n`clockout_time` set. An employee that is currently clocked in cannot\nbe clocked in a second time.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"TIMECARDS_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"TIMECARDS_WRITE"
]
}
],
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\n\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/V1Timecard"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Timecard"
}
}
}
}
},
"/v1/me/timecards/{timecard_id}": {
"delete": {
"tags": [
"V1Employees"
],
"summary": "DeleteTimecard",
"operationId": "DeleteTimecard",
"description": "Deletes a timecard. Timecards can also be deleted through the\nSquare Dashboard. Deleted timecards are still accessible through\nConnect API endpoints, but cannot be modified. The `deleted` field of\nthe `Timecard` object indicates whether the timecard has been deleted.\n\n*Note**: By default, deleted timecards appear alongside valid timecards in\nresults returned by the [ListTimecards](#endpoint-v1employees-listtimecards)\nendpoint. To filter deleted timecards, include the `deleted` query\nparameter in the list request.\n\n\u003caside\u003e\nOnly approved accounts can manage their employees with Square.\nUnapproved accounts cannot use employee management features with the\nAPI.\n\u003c/aside\u003e",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"TIMECARDS_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"TIMECARDS_WRITE"
]
}
],
"parameters": [
{
"name": "timecard_id",
"description": "The ID of the timecard to delete.",
"type": "string",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object"
}
}
}
},
"get": {
"tags": [
"V1Employees"
],
"summary": "RetrieveTimecard",
"operationId": "RetrieveTimecard",
"description": "Provides the details for a single timecard.\n\u003caside\u003e\nOnly approved accounts can manage their employees with Square.\nUnapproved accounts cannot use employee management features with the\nAPI.\n\u003c/aside\u003e",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"TIMECARDS_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"TIMECARDS_READ"
]
}
],
"parameters": [
{
"name": "timecard_id",
"description": "The timecard\u0027s ID.",
"type": "string",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Timecard"
}
}
}
},
"put": {
"tags": [
"V1Employees"
],
"summary": "UpdateTimecard",
"operationId": "UpdateTimecard",
"description": "Modifies the details of a timecard with an `API_EDIT` event for\nthe timecard. Updating an active timecard with a `clockout_time`\nclocks the employee out.",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"TIMECARDS_WRITE"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"TIMECARDS_WRITE"
]
}
],
"parameters": [
{
"name": "timecard_id",
"description": "TThe ID of the timecard to modify.",
"type": "string",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"description": "An object containing the fields to POST for the request.\nSee the corresponding object definition for field details.",
"schema": {
"$ref": "#/definitions/V1Timecard"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/V1Timecard"
}
}
}
}
},
"/v1/me/timecards/{timecard_id}/events": {
"get": {
"tags": [
"V1Employees"
],
"summary": "ListTimecardEvents",
"operationId": "ListTimecardEvents",
"description": "Provides summary information for all events associated with a\nparticular timecard.\n\n\u003caside\u003e\nOnly approved accounts can manage their employees with Square.\nUnapproved accounts cannot use employee management features with the\nAPI.\n\u003c/aside\u003e",
"x-release-status": "PUBLIC",
"x-oauthpermissions": [
"TIMECARDS_READ"
],
"x-sq-version": "2019-06-12",
"security": [
{
"oauth2": [
"TIMECARDS_READ"
]
}
],
"parameters": [
{
"name": "timecard_id",
"description": "The ID of the timecard to list events for.",