square.rb 10.0.0.202104217 → 13.1.0.20210818
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -3
- data/lib/square.rb +6 -0
- data/lib/square/api/base_api.rb +4 -6
- data/lib/square/api/cards_api.rb +170 -0
- data/lib/square/api/catalog_api.rb +8 -5
- data/lib/square/api/customer_groups_api.rb +10 -2
- data/lib/square/api/customer_segments_api.rb +10 -2
- data/lib/square/api/customers_api.rb +18 -12
- data/lib/square/api/disputes_api.rb +97 -86
- data/lib/square/api/gift_card_activities_api.rb +127 -0
- data/lib/square/api/gift_cards_api.rb +292 -0
- data/lib/square/api/inventory_api.rb +244 -5
- data/lib/square/api/labor_api.rb +64 -62
- data/lib/square/api/loyalty_api.rb +24 -8
- data/lib/square/api/o_auth_api.rb +8 -9
- data/lib/square/api/orders_api.rb +27 -27
- data/lib/square/api/sites_api.rb +42 -0
- data/lib/square/api/snippets_api.rb +146 -0
- data/lib/square/api/team_api.rb +30 -30
- data/lib/square/api/transactions_api.rb +3 -2
- data/lib/square/api/v1_transactions_api.rb +9 -0
- data/lib/square/api_helper.rb +18 -29
- data/lib/square/client.rb +37 -3
- data/lib/square/configuration.rb +23 -8
- data/lib/square/http/faraday_client.rb +6 -3
- data/lib/square/utilities/date_time_helper.rb +151 -0
- metadata +16 -7
@@ -5,6 +5,46 @@ module Square
|
|
5
5
|
super(config, http_call_back: http_call_back)
|
6
6
|
end
|
7
7
|
|
8
|
+
# Deprecated version of
|
9
|
+
# [RetrieveInventoryAdjustment]($e/Inventory/RetrieveInventoryAdjustment)
|
10
|
+
# after the endpoint URL
|
11
|
+
# is updated to conform to the standard convention.
|
12
|
+
# @param [String] adjustment_id Required parameter: ID of the
|
13
|
+
# [InventoryAdjustment]($m/InventoryAdjustment) to retrieve.
|
14
|
+
# @return [RetrieveInventoryAdjustmentResponse Hash] response from the API call
|
15
|
+
def deprecated_retrieve_inventory_adjustment(adjustment_id:)
|
16
|
+
warn 'Endpoint deprecated_retrieve_inventory_adjustment in InventoryApi '\
|
17
|
+
'is deprecated'
|
18
|
+
# Prepare query url.
|
19
|
+
_query_builder = config.get_base_uri
|
20
|
+
_query_builder << '/v2/inventory/adjustment/{adjustment_id}'
|
21
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
22
|
+
_query_builder,
|
23
|
+
'adjustment_id' => { 'value' => adjustment_id, 'encode' => true }
|
24
|
+
)
|
25
|
+
_query_url = APIHelper.clean_url _query_builder
|
26
|
+
|
27
|
+
# Prepare headers.
|
28
|
+
_headers = {
|
29
|
+
'accept' => 'application/json'
|
30
|
+
}
|
31
|
+
|
32
|
+
# Prepare and execute HttpRequest.
|
33
|
+
_request = config.http_client.get(
|
34
|
+
_query_url,
|
35
|
+
headers: _headers
|
36
|
+
)
|
37
|
+
OAuth2.apply(config, _request)
|
38
|
+
_response = execute_request(_request)
|
39
|
+
|
40
|
+
# Return appropriate response type.
|
41
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
42
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
43
|
+
ApiResponse.new(
|
44
|
+
_response, data: decoded, errors: _errors
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
8
48
|
# Returns the [InventoryAdjustment]($m/InventoryAdjustment) object
|
9
49
|
# with the provided `adjustment_id`.
|
10
50
|
# @param [String] adjustment_id Required parameter: ID of the
|
@@ -13,7 +53,7 @@ module Square
|
|
13
53
|
def retrieve_inventory_adjustment(adjustment_id:)
|
14
54
|
# Prepare query url.
|
15
55
|
_query_builder = config.get_base_uri
|
16
|
-
_query_builder << '/v2/inventory/
|
56
|
+
_query_builder << '/v2/inventory/adjustments/{adjustment_id}'
|
17
57
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
18
58
|
_query_builder,
|
19
59
|
'adjustment_id' => { 'value' => adjustment_id, 'encode' => true }
|
@@ -41,6 +81,123 @@ module Square
|
|
41
81
|
)
|
42
82
|
end
|
43
83
|
|
84
|
+
# Deprecated version of
|
85
|
+
# [BatchChangeInventory]($e/Inventory/BatchChangeInventory) after the
|
86
|
+
# endpoint URL
|
87
|
+
# is updated to conform to the standard convention.
|
88
|
+
# @param [BatchChangeInventoryRequest] body Required parameter: An object
|
89
|
+
# containing the fields to POST for the request. See the corresponding
|
90
|
+
# object definition for field details.
|
91
|
+
# @return [BatchChangeInventoryResponse Hash] response from the API call
|
92
|
+
def deprecated_batch_change_inventory(body:)
|
93
|
+
warn 'Endpoint deprecated_batch_change_inventory in InventoryApi is depr'\
|
94
|
+
'ecated'
|
95
|
+
# Prepare query url.
|
96
|
+
_query_builder = config.get_base_uri
|
97
|
+
_query_builder << '/v2/inventory/batch-change'
|
98
|
+
_query_url = APIHelper.clean_url _query_builder
|
99
|
+
|
100
|
+
# Prepare headers.
|
101
|
+
_headers = {
|
102
|
+
'accept' => 'application/json',
|
103
|
+
'content-type' => 'application/json; charset=utf-8'
|
104
|
+
}
|
105
|
+
|
106
|
+
# Prepare and execute HttpRequest.
|
107
|
+
_request = config.http_client.post(
|
108
|
+
_query_url,
|
109
|
+
headers: _headers,
|
110
|
+
parameters: body.to_json
|
111
|
+
)
|
112
|
+
OAuth2.apply(config, _request)
|
113
|
+
_response = execute_request(_request)
|
114
|
+
|
115
|
+
# Return appropriate response type.
|
116
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
117
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
118
|
+
ApiResponse.new(
|
119
|
+
_response, data: decoded, errors: _errors
|
120
|
+
)
|
121
|
+
end
|
122
|
+
|
123
|
+
# Deprecated version of
|
124
|
+
# [BatchRetrieveInventoryChanges]($e/Inventory/BatchRetrieveInventoryChanges
|
125
|
+
# ) after the endpoint URL
|
126
|
+
# is updated to conform to the standard convention.
|
127
|
+
# @param [BatchRetrieveInventoryChangesRequest] body Required parameter: An
|
128
|
+
# object containing the fields to POST for the request. See the
|
129
|
+
# corresponding object definition for field details.
|
130
|
+
# @return [BatchRetrieveInventoryChangesResponse Hash] response from the API call
|
131
|
+
def deprecated_batch_retrieve_inventory_changes(body:)
|
132
|
+
warn 'Endpoint deprecated_batch_retrieve_inventory_changes in InventoryA'\
|
133
|
+
'pi is deprecated'
|
134
|
+
# Prepare query url.
|
135
|
+
_query_builder = config.get_base_uri
|
136
|
+
_query_builder << '/v2/inventory/batch-retrieve-changes'
|
137
|
+
_query_url = APIHelper.clean_url _query_builder
|
138
|
+
|
139
|
+
# Prepare headers.
|
140
|
+
_headers = {
|
141
|
+
'accept' => 'application/json',
|
142
|
+
'content-type' => 'application/json; charset=utf-8'
|
143
|
+
}
|
144
|
+
|
145
|
+
# Prepare and execute HttpRequest.
|
146
|
+
_request = config.http_client.post(
|
147
|
+
_query_url,
|
148
|
+
headers: _headers,
|
149
|
+
parameters: body.to_json
|
150
|
+
)
|
151
|
+
OAuth2.apply(config, _request)
|
152
|
+
_response = execute_request(_request)
|
153
|
+
|
154
|
+
# Return appropriate response type.
|
155
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
156
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
157
|
+
ApiResponse.new(
|
158
|
+
_response, data: decoded, errors: _errors
|
159
|
+
)
|
160
|
+
end
|
161
|
+
|
162
|
+
# Deprecated version of
|
163
|
+
# [BatchRetrieveInventoryCounts]($e/Inventory/BatchRetrieveInventoryCounts)
|
164
|
+
# after the endpoint URL
|
165
|
+
# is updated to conform to the standard convention.
|
166
|
+
# @param [BatchRetrieveInventoryCountsRequest] body Required parameter: An
|
167
|
+
# object containing the fields to POST for the request. See the
|
168
|
+
# corresponding object definition for field details.
|
169
|
+
# @return [BatchRetrieveInventoryCountsResponse Hash] response from the API call
|
170
|
+
def deprecated_batch_retrieve_inventory_counts(body:)
|
171
|
+
warn 'Endpoint deprecated_batch_retrieve_inventory_counts in InventoryAp'\
|
172
|
+
'i is deprecated'
|
173
|
+
# Prepare query url.
|
174
|
+
_query_builder = config.get_base_uri
|
175
|
+
_query_builder << '/v2/inventory/batch-retrieve-counts'
|
176
|
+
_query_url = APIHelper.clean_url _query_builder
|
177
|
+
|
178
|
+
# Prepare headers.
|
179
|
+
_headers = {
|
180
|
+
'accept' => 'application/json',
|
181
|
+
'content-type' => 'application/json; charset=utf-8'
|
182
|
+
}
|
183
|
+
|
184
|
+
# Prepare and execute HttpRequest.
|
185
|
+
_request = config.http_client.post(
|
186
|
+
_query_url,
|
187
|
+
headers: _headers,
|
188
|
+
parameters: body.to_json
|
189
|
+
)
|
190
|
+
OAuth2.apply(config, _request)
|
191
|
+
_response = execute_request(_request)
|
192
|
+
|
193
|
+
# Return appropriate response type.
|
194
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
195
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
196
|
+
ApiResponse.new(
|
197
|
+
_response, data: decoded, errors: _errors
|
198
|
+
)
|
199
|
+
end
|
200
|
+
|
44
201
|
# Applies adjustments and counts to the provided item quantities.
|
45
202
|
# On success: returns the current calculated counts for all objects
|
46
203
|
# referenced in the request.
|
@@ -52,7 +209,7 @@ module Square
|
|
52
209
|
def batch_change_inventory(body:)
|
53
210
|
# Prepare query url.
|
54
211
|
_query_builder = config.get_base_uri
|
55
|
-
_query_builder << '/v2/inventory/batch-
|
212
|
+
_query_builder << '/v2/inventory/changes/batch-create'
|
56
213
|
_query_url = APIHelper.clean_url _query_builder
|
57
214
|
|
58
215
|
# Prepare headers.
|
@@ -91,7 +248,7 @@ module Square
|
|
91
248
|
def batch_retrieve_inventory_changes(body:)
|
92
249
|
# Prepare query url.
|
93
250
|
_query_builder = config.get_base_uri
|
94
|
-
_query_builder << '/v2/inventory/batch-retrieve
|
251
|
+
_query_builder << '/v2/inventory/changes/batch-retrieve'
|
95
252
|
_query_url = APIHelper.clean_url _query_builder
|
96
253
|
|
97
254
|
# Prepare headers.
|
@@ -134,7 +291,7 @@ module Square
|
|
134
291
|
def batch_retrieve_inventory_counts(body:)
|
135
292
|
# Prepare query url.
|
136
293
|
_query_builder = config.get_base_uri
|
137
|
-
_query_builder << '/v2/inventory/batch-retrieve
|
294
|
+
_query_builder << '/v2/inventory/counts/batch-retrieve'
|
138
295
|
_query_url = APIHelper.clean_url _query_builder
|
139
296
|
|
140
297
|
# Prepare headers.
|
@@ -160,6 +317,46 @@ module Square
|
|
160
317
|
)
|
161
318
|
end
|
162
319
|
|
320
|
+
# Deprecated version of
|
321
|
+
# [RetrieveInventoryPhysicalCount]($e/Inventory/RetrieveInventoryPhysicalCou
|
322
|
+
# nt) after the endpoint URL
|
323
|
+
# is updated to conform to the standard convention.
|
324
|
+
# @param [String] physical_count_id Required parameter: ID of the
|
325
|
+
# [InventoryPhysicalCount]($m/InventoryPhysicalCount) to retrieve.
|
326
|
+
# @return [RetrieveInventoryPhysicalCountResponse Hash] response from the API call
|
327
|
+
def deprecated_retrieve_inventory_physical_count(physical_count_id:)
|
328
|
+
warn 'Endpoint deprecated_retrieve_inventory_physical_count in Inventory'\
|
329
|
+
'Api is deprecated'
|
330
|
+
# Prepare query url.
|
331
|
+
_query_builder = config.get_base_uri
|
332
|
+
_query_builder << '/v2/inventory/physical-count/{physical_count_id}'
|
333
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
334
|
+
_query_builder,
|
335
|
+
'physical_count_id' => { 'value' => physical_count_id, 'encode' => true }
|
336
|
+
)
|
337
|
+
_query_url = APIHelper.clean_url _query_builder
|
338
|
+
|
339
|
+
# Prepare headers.
|
340
|
+
_headers = {
|
341
|
+
'accept' => 'application/json'
|
342
|
+
}
|
343
|
+
|
344
|
+
# Prepare and execute HttpRequest.
|
345
|
+
_request = config.http_client.get(
|
346
|
+
_query_url,
|
347
|
+
headers: _headers
|
348
|
+
)
|
349
|
+
OAuth2.apply(config, _request)
|
350
|
+
_response = execute_request(_request)
|
351
|
+
|
352
|
+
# Return appropriate response type.
|
353
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
354
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
355
|
+
ApiResponse.new(
|
356
|
+
_response, data: decoded, errors: _errors
|
357
|
+
)
|
358
|
+
end
|
359
|
+
|
163
360
|
# Returns the [InventoryPhysicalCount]($m/InventoryPhysicalCount)
|
164
361
|
# object with the provided `physical_count_id`.
|
165
362
|
# @param [String] physical_count_id Required parameter: ID of the
|
@@ -168,7 +365,7 @@ module Square
|
|
168
365
|
def retrieve_inventory_physical_count(physical_count_id:)
|
169
366
|
# Prepare query url.
|
170
367
|
_query_builder = config.get_base_uri
|
171
|
-
_query_builder << '/v2/inventory/physical-
|
368
|
+
_query_builder << '/v2/inventory/physical-counts/{physical_count_id}'
|
172
369
|
_query_builder = APIHelper.append_url_with_template_parameters(
|
173
370
|
_query_builder,
|
174
371
|
'physical_count_id' => { 'value' => physical_count_id, 'encode' => true }
|
@@ -196,6 +393,42 @@ module Square
|
|
196
393
|
)
|
197
394
|
end
|
198
395
|
|
396
|
+
# Returns the [InventoryTransfer]($m/InventoryTransfer) object
|
397
|
+
# with the provided `transfer_id`.
|
398
|
+
# @param [String] transfer_id Required parameter: ID of the
|
399
|
+
# [InventoryTransfer]($m/InventoryTransfer) to retrieve.
|
400
|
+
# @return [RetrieveInventoryTransferResponse Hash] response from the API call
|
401
|
+
def retrieve_inventory_transfer(transfer_id:)
|
402
|
+
# Prepare query url.
|
403
|
+
_query_builder = config.get_base_uri
|
404
|
+
_query_builder << '/v2/inventory/transfers/{transfer_id}'
|
405
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
406
|
+
_query_builder,
|
407
|
+
'transfer_id' => { 'value' => transfer_id, 'encode' => true }
|
408
|
+
)
|
409
|
+
_query_url = APIHelper.clean_url _query_builder
|
410
|
+
|
411
|
+
# Prepare headers.
|
412
|
+
_headers = {
|
413
|
+
'accept' => 'application/json'
|
414
|
+
}
|
415
|
+
|
416
|
+
# Prepare and execute HttpRequest.
|
417
|
+
_request = config.http_client.get(
|
418
|
+
_query_url,
|
419
|
+
headers: _headers
|
420
|
+
)
|
421
|
+
OAuth2.apply(config, _request)
|
422
|
+
_response = execute_request(_request)
|
423
|
+
|
424
|
+
# Return appropriate response type.
|
425
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
426
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
427
|
+
ApiResponse.new(
|
428
|
+
_response, data: decoded, errors: _errors
|
429
|
+
)
|
430
|
+
end
|
431
|
+
|
199
432
|
# Retrieves the current calculated stock count for a given
|
200
433
|
# [CatalogObject]($m/CatalogObject) at a given set of
|
201
434
|
# [Location]($m/Location)s. Responses are paginated and unsorted.
|
@@ -252,6 +485,11 @@ module Square
|
|
252
485
|
# Returns a set of physical counts and inventory adjustments for the
|
253
486
|
# provided [CatalogObject]($m/CatalogObject) at the requested
|
254
487
|
# [Location]($m/Location)s.
|
488
|
+
# You can achieve the same result by calling
|
489
|
+
# [BatchRetrieveInventoryChanges]($e/Inventory/BatchRetrieveInventoryChanges
|
490
|
+
# )
|
491
|
+
# and having the `catalog_object_ids` list contain a single element of the
|
492
|
+
# `CatalogObject` ID.
|
255
493
|
# Results are paginated and sorted in descending order according to their
|
256
494
|
# `occurred_at` timestamp (newest first).
|
257
495
|
# There are no limits on how far back the caller can page. This endpoint can
|
@@ -272,6 +510,7 @@ module Square
|
|
272
510
|
def retrieve_inventory_changes(catalog_object_id:,
|
273
511
|
location_ids: nil,
|
274
512
|
cursor: nil)
|
513
|
+
warn 'Endpoint retrieve_inventory_changes in InventoryApi is deprecated'
|
275
514
|
# Prepare query url.
|
276
515
|
_query_builder = config.get_base_uri
|
277
516
|
_query_builder << '/v2/inventory/{catalog_object_id}/changes'
|
data/lib/square/api/labor_api.rb
CHANGED
@@ -6,13 +6,14 @@ module Square
|
|
6
6
|
end
|
7
7
|
|
8
8
|
# Returns a paginated list of `BreakType` instances for a business.
|
9
|
-
# @param [String] location_id Optional parameter: Filter
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
9
|
+
# @param [String] location_id Optional parameter: Filter the returned
|
10
|
+
# `BreakType` results to only those that are associated with the specified
|
11
|
+
# location.
|
12
|
+
# @param [Integer] limit Optional parameter: The maximum number of
|
13
|
+
# `BreakType` results to return per page. The number can range between 1 and
|
14
|
+
# 200. The default is 200.
|
15
|
+
# @param [String] cursor Optional parameter: A pointer to the next page of
|
16
|
+
# `BreakType` results to fetch.
|
16
17
|
# @return [ListBreakTypesResponse Hash] response from the API call
|
17
18
|
def list_break_types(location_id: nil,
|
18
19
|
limit: nil,
|
@@ -57,8 +58,8 @@ module Square
|
|
57
58
|
# - `break_name`
|
58
59
|
# - `expected_duration`
|
59
60
|
# - `is_paid`
|
60
|
-
# You can only have
|
61
|
-
# add a
|
61
|
+
# You can only have three `BreakType` instances per location. If you attempt
|
62
|
+
# to add a fourth
|
62
63
|
# `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of
|
63
64
|
# 3 breaks per location."
|
64
65
|
# is returned.
|
@@ -97,7 +98,7 @@ module Square
|
|
97
98
|
|
98
99
|
# Deletes an existing `BreakType`.
|
99
100
|
# A `BreakType` can be deleted even if it is referenced from a `Shift`.
|
100
|
-
# @param [String] id Required parameter: UUID for the `BreakType` being
|
101
|
+
# @param [String] id Required parameter: The UUID for the `BreakType` being
|
101
102
|
# deleted.
|
102
103
|
# @return [DeleteBreakTypeResponse Hash] response from the API call
|
103
104
|
def delete_break_type(id:)
|
@@ -131,8 +132,8 @@ module Square
|
|
131
132
|
)
|
132
133
|
end
|
133
134
|
|
134
|
-
# Returns a single `BreakType` specified by id
|
135
|
-
# @param [String] id Required parameter: UUID for the `BreakType` being
|
135
|
+
# Returns a single `BreakType` specified by `id`.
|
136
|
+
# @param [String] id Required parameter: The UUID for the `BreakType` being
|
136
137
|
# retrieved.
|
137
138
|
# @return [GetBreakTypeResponse Hash] response from the API call
|
138
139
|
def get_break_type(id:)
|
@@ -167,7 +168,7 @@ module Square
|
|
167
168
|
end
|
168
169
|
|
169
170
|
# Updates an existing `BreakType`.
|
170
|
-
# @param [String] id Required parameter: UUID for the `BreakType` being
|
171
|
+
# @param [String] id Required parameter: The UUID for the `BreakType` being
|
171
172
|
# updated.
|
172
173
|
# @param [UpdateBreakTypeRequest] body Required parameter: An object
|
173
174
|
# containing the fields to POST for the request. See the corresponding
|
@@ -208,13 +209,13 @@ module Square
|
|
208
209
|
end
|
209
210
|
|
210
211
|
# Returns a paginated list of `EmployeeWage` instances for a business.
|
211
|
-
# @param [String] employee_id Optional parameter: Filter
|
212
|
-
# only those that are associated with the specified employee.
|
213
|
-
# @param [Integer] limit Optional parameter:
|
214
|
-
#
|
215
|
-
#
|
216
|
-
# @param [String] cursor Optional parameter:
|
217
|
-
#
|
212
|
+
# @param [String] employee_id Optional parameter: Filter the returned wages
|
213
|
+
# to only those that are associated with the specified employee.
|
214
|
+
# @param [Integer] limit Optional parameter: The maximum number of
|
215
|
+
# `EmployeeWage` results to return per page. The number can range between 1
|
216
|
+
# and 200. The default is 200.
|
217
|
+
# @param [String] cursor Optional parameter: A pointer to the next page of
|
218
|
+
# `EmployeeWage` results to fetch.
|
218
219
|
# @return [ListEmployeeWagesResponse Hash] response from the API call
|
219
220
|
def list_employee_wages(employee_id: nil,
|
220
221
|
limit: nil,
|
@@ -252,9 +253,9 @@ module Square
|
|
252
253
|
)
|
253
254
|
end
|
254
255
|
|
255
|
-
# Returns a single `EmployeeWage` specified by id
|
256
|
-
# @param [String] id Required parameter: UUID for the `EmployeeWage`
|
257
|
-
# retrieved.
|
256
|
+
# Returns a single `EmployeeWage` specified by `id`.
|
257
|
+
# @param [String] id Required parameter: The UUID for the `EmployeeWage`
|
258
|
+
# being retrieved.
|
258
259
|
# @return [GetEmployeeWageResponse Hash] response from the API call
|
259
260
|
def get_employee_wage(id:)
|
260
261
|
warn 'Endpoint get_employee_wage in LaborApi is deprecated'
|
@@ -289,7 +290,7 @@ module Square
|
|
289
290
|
end
|
290
291
|
|
291
292
|
# Creates a new `Shift`.
|
292
|
-
# A `Shift` represents a complete
|
293
|
+
# A `Shift` represents a complete workday for a single employee.
|
293
294
|
# You must provide the following values in your request to this
|
294
295
|
# endpoint:
|
295
296
|
# - `location_id`
|
@@ -299,12 +300,12 @@ module Square
|
|
299
300
|
# when:
|
300
301
|
# - The `status` of the new `Shift` is `OPEN` and the employee has another
|
301
302
|
# shift with an `OPEN` status.
|
302
|
-
# - The `start_at` date is in the future
|
303
|
-
# -
|
304
|
-
#
|
305
|
-
#
|
306
|
-
# after
|
307
|
-
# the `Shift.end_at
|
303
|
+
# - The `start_at` date is in the future.
|
304
|
+
# - The `start_at` or `end_at` date overlaps another shift for the same
|
305
|
+
# employee.
|
306
|
+
# - The `Break` instances are set in the request and a break `start_at`
|
307
|
+
# is before the `Shift.start_at`, a break `end_at` is after
|
308
|
+
# the `Shift.end_at`, or both.
|
308
309
|
# @param [CreateShiftRequest] body Required parameter: An object containing
|
309
310
|
# the fields to POST for the request. See the corresponding object
|
310
311
|
# definition for field details.
|
@@ -340,17 +341,17 @@ module Square
|
|
340
341
|
|
341
342
|
# Returns a paginated list of `Shift` records for a business.
|
342
343
|
# The list to be returned can be filtered by:
|
343
|
-
# - Location IDs
|
344
|
-
# -
|
345
|
-
# -
|
346
|
-
# -
|
347
|
-
# -
|
348
|
-
# -
|
344
|
+
# - Location IDs.
|
345
|
+
# - Employee IDs.
|
346
|
+
# - Shift status (`OPEN` and `CLOSED`).
|
347
|
+
# - Shift start.
|
348
|
+
# - Shift end.
|
349
|
+
# - Workday details.
|
349
350
|
# The list can be sorted by:
|
350
|
-
# - `start_at
|
351
|
-
# - `end_at
|
352
|
-
# - `created_at
|
353
|
-
# - `updated_at
|
351
|
+
# - `start_at`.
|
352
|
+
# - `end_at`.
|
353
|
+
# - `created_at`.
|
354
|
+
# - `updated_at`.
|
354
355
|
# @param [SearchShiftsRequest] body Required parameter: An object containing
|
355
356
|
# the fields to POST for the request. See the corresponding object
|
356
357
|
# definition for field details.
|
@@ -385,7 +386,7 @@ module Square
|
|
385
386
|
end
|
386
387
|
|
387
388
|
# Deletes a `Shift`.
|
388
|
-
# @param [String] id Required parameter: UUID for the `Shift` being
|
389
|
+
# @param [String] id Required parameter: The UUID for the `Shift` being
|
389
390
|
# deleted.
|
390
391
|
# @return [DeleteShiftResponse Hash] response from the API call
|
391
392
|
def delete_shift(id:)
|
@@ -419,8 +420,8 @@ module Square
|
|
419
420
|
)
|
420
421
|
end
|
421
422
|
|
422
|
-
# Returns a single `Shift` specified by id
|
423
|
-
# @param [String] id Required parameter: UUID for the `Shift` being
|
423
|
+
# Returns a single `Shift` specified by `id`.
|
424
|
+
# @param [String] id Required parameter: The UUID for the `Shift` being
|
424
425
|
# retrieved.
|
425
426
|
# @return [GetShiftResponse Hash] response from the API call
|
426
427
|
def get_shift(id:)
|
@@ -455,13 +456,14 @@ module Square
|
|
455
456
|
end
|
456
457
|
|
457
458
|
# Updates an existing `Shift`.
|
458
|
-
# When adding a `Break` to a `Shift`, any earlier `
|
459
|
-
# have
|
459
|
+
# When adding a `Break` to a `Shift`, any earlier `Break` instances in the
|
460
|
+
# `Shift` have
|
460
461
|
# the `end_at` property set to a valid RFC-3339 datetime string.
|
461
|
-
# When closing a `Shift`, all `Break` instances in the
|
462
|
+
# When closing a `Shift`, all `Break` instances in the `Shift` must be
|
462
463
|
# complete with `end_at`
|
463
464
|
# set on each `Break`.
|
464
|
-
# @param [String] id Required parameter: ID of the object being
|
465
|
+
# @param [String] id Required parameter: The ID of the object being
|
466
|
+
# updated.
|
465
467
|
# @param [UpdateShiftRequest] body Required parameter: An object containing
|
466
468
|
# the fields to POST for the request. See the corresponding object
|
467
469
|
# definition for field details.
|
@@ -501,13 +503,13 @@ module Square
|
|
501
503
|
end
|
502
504
|
|
503
505
|
# Returns a paginated list of `TeamMemberWage` instances for a business.
|
504
|
-
# @param [String] team_member_id Optional parameter: Filter
|
505
|
-
# to only those that are associated with the specified team member.
|
506
|
-
# @param [Integer] limit Optional parameter:
|
507
|
-
#
|
508
|
-
#
|
509
|
-
# @param [String] cursor Optional parameter:
|
510
|
-
#
|
506
|
+
# @param [String] team_member_id Optional parameter: Filter the returned
|
507
|
+
# wages to only those that are associated with the specified team member.
|
508
|
+
# @param [Integer] limit Optional parameter: The maximum number of
|
509
|
+
# `TeamMemberWage` results to return per page. The number can range between
|
510
|
+
# 1 and 200. The default is 200.
|
511
|
+
# @param [String] cursor Optional parameter: A pointer to the next page of
|
512
|
+
# `EmployeeWage` results to fetch.
|
511
513
|
# @return [ListTeamMemberWagesResponse Hash] response from the API call
|
512
514
|
def list_team_member_wages(team_member_id: nil,
|
513
515
|
limit: nil,
|
@@ -544,9 +546,9 @@ module Square
|
|
544
546
|
)
|
545
547
|
end
|
546
548
|
|
547
|
-
# Returns a single `TeamMemberWage` specified by id
|
548
|
-
# @param [String] id Required parameter: UUID for the `TeamMemberWage`
|
549
|
-
# retrieved.
|
549
|
+
# Returns a single `TeamMemberWage` specified by `id `.
|
550
|
+
# @param [String] id Required parameter: The UUID for the `TeamMemberWage`
|
551
|
+
# being retrieved.
|
550
552
|
# @return [GetTeamMemberWageResponse Hash] response from the API call
|
551
553
|
def get_team_member_wage(id:)
|
552
554
|
# Prepare query url.
|
@@ -580,10 +582,10 @@ module Square
|
|
580
582
|
end
|
581
583
|
|
582
584
|
# Returns a list of `WorkweekConfig` instances for a business.
|
583
|
-
# @param [Integer] limit Optional parameter:
|
584
|
-
#
|
585
|
-
# @param [String] cursor Optional parameter:
|
586
|
-
#
|
585
|
+
# @param [Integer] limit Optional parameter: The maximum number of
|
586
|
+
# `WorkweekConfigs` results to return per page.
|
587
|
+
# @param [String] cursor Optional parameter: A pointer to the next page of
|
588
|
+
# `WorkweekConfig` results to fetch.
|
587
589
|
# @return [ListWorkweekConfigsResponse Hash] response from the API call
|
588
590
|
def list_workweek_configs(limit: nil,
|
589
591
|
cursor: nil)
|
@@ -619,7 +621,7 @@ module Square
|
|
619
621
|
end
|
620
622
|
|
621
623
|
# Updates a `WorkweekConfig`.
|
622
|
-
# @param [String] id Required parameter: UUID for the `WorkweekConfig`
|
624
|
+
# @param [String] id Required parameter: The UUID for the `WorkweekConfig`
|
623
625
|
# object being updated.
|
624
626
|
# @param [UpdateWorkweekConfigRequest] body Required parameter: An object
|
625
627
|
# containing the fields to POST for the request. See the corresponding
|