square.rb 8.1.0.20210121 → 18.1.0.20220316
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +59 -213
- data/lib/square/api/apple_pay_api.rb +9 -8
- data/lib/square/api/bank_accounts_api.rb +5 -5
- data/lib/square/api/base_api.rb +20 -9
- data/lib/square/api/bookings_api.rb +95 -12
- data/lib/square/api/cards_api.rb +170 -0
- data/lib/square/api/cash_drawers_api.rb +2 -2
- data/lib/square/api/catalog_api.rb +140 -66
- data/lib/square/api/checkout_api.rb +3 -3
- data/lib/square/api/customer_groups_api.rb +17 -8
- data/lib/square/api/customer_segments_api.rb +15 -6
- data/lib/square/api/customers_api.rb +61 -31
- data/lib/square/api/devices_api.rb +3 -2
- data/lib/square/api/disputes_api.rb +101 -92
- data/lib/square/api/gift_card_activities_api.rb +133 -0
- data/lib/square/api/gift_cards_api.rb +297 -0
- data/lib/square/api/inventory_api.rb +263 -24
- data/lib/square/api/invoices_api.rb +19 -19
- data/lib/square/api/labor_api.rb +70 -68
- data/lib/square/api/locations_api.rb +22 -14
- data/lib/square/api/loyalty_api.rb +86 -32
- data/lib/square/api/merchants_api.rb +11 -9
- data/lib/square/api/mobile_authorization_api.rb +4 -4
- data/lib/square/api/o_auth_api.rb +31 -25
- data/lib/square/api/orders_api.rb +78 -39
- data/lib/square/api/payments_api.rb +71 -23
- data/lib/square/api/refunds_api.rb +18 -7
- data/lib/square/api/sites_api.rb +43 -0
- data/lib/square/api/snippets_api.rb +146 -0
- data/lib/square/api/subscriptions_api.rb +190 -12
- data/lib/square/api/team_api.rb +46 -46
- data/lib/square/api/terminal_api.rb +19 -18
- data/lib/square/api/transactions_api.rb +15 -191
- data/lib/square/api/v1_transactions_api.rb +13 -85
- data/lib/square/api/vendors_api.rb +257 -0
- data/lib/square/api_helper.rb +45 -57
- data/lib/square/client.rb +54 -18
- data/lib/square/configuration.rb +59 -20
- data/lib/square/http/api_response.rb +1 -1
- data/lib/square/http/faraday_client.rb +24 -4
- data/lib/square/utilities/date_time_helper.rb +151 -0
- data/lib/square/utilities/file_wrapper.rb +1 -2
- data/lib/square.rb +49 -44
- data/test/api/test_locations_api.rb +2 -5
- data/test/test_helper.rb +1 -1
- metadata +11 -6
- data/lib/square/api/v1_employees_api.rb +0 -749
- data/lib/square/api/v1_items_api.rb +0 -1766
@@ -7,7 +7,7 @@ module Square
|
|
7
7
|
|
8
8
|
# Returns a list of invoices for a given location. The response
|
9
9
|
# is paginated. If truncated, the response includes a `cursor` that you
|
10
|
-
# use in a subsequent request to
|
10
|
+
# use in a subsequent request to retrieve the next set of invoices.
|
11
11
|
# @param [String] location_id Required parameter: The ID of the location for
|
12
12
|
# which to list invoices.
|
13
13
|
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
@@ -16,7 +16,7 @@ module Square
|
|
16
16
|
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
|
17
17
|
# ion).
|
18
18
|
# @param [Integer] limit Optional parameter: The maximum number of invoices
|
19
|
-
# to return (200 is the maximum `limit`). If not provided, the server
|
19
|
+
# to return (200 is the maximum `limit`). If not provided, the server uses
|
20
20
|
# a default limit of 100 invoices.
|
21
21
|
# @return [ListInvoicesResponse Hash] response from the API call
|
22
22
|
def list_invoices(location_id:,
|
@@ -54,7 +54,7 @@ module Square
|
|
54
54
|
)
|
55
55
|
end
|
56
56
|
|
57
|
-
# Creates a draft [invoice](
|
57
|
+
# Creates a draft [invoice]($m/Invoice)
|
58
58
|
# for an order created using the Orders API.
|
59
59
|
# A draft invoice remains in your account and no action is taken.
|
60
60
|
# You must publish the invoice before Square can process it (send it to the
|
@@ -72,7 +72,7 @@ module Square
|
|
72
72
|
# Prepare headers.
|
73
73
|
_headers = {
|
74
74
|
'accept' => 'application/json',
|
75
|
-
'
|
75
|
+
'Content-Type' => 'application/json'
|
76
76
|
}
|
77
77
|
|
78
78
|
# Prepare and execute HttpRequest.
|
@@ -98,7 +98,7 @@ module Square
|
|
98
98
|
# location and
|
99
99
|
# optionally one customer.
|
100
100
|
# The response is paginated. If truncated, the response includes a `cursor`
|
101
|
-
# that you use in a subsequent request to
|
101
|
+
# that you use in a subsequent request to retrieve the next set of invoices.
|
102
102
|
# @param [SearchInvoicesRequest] body Required parameter: An object
|
103
103
|
# containing the fields to POST for the request. See the corresponding
|
104
104
|
# object definition for field details.
|
@@ -112,7 +112,7 @@ module Square
|
|
112
112
|
# Prepare headers.
|
113
113
|
_headers = {
|
114
114
|
'accept' => 'application/json',
|
115
|
-
'
|
115
|
+
'Content-Type' => 'application/json'
|
116
116
|
}
|
117
117
|
|
118
118
|
# Prepare and execute HttpRequest.
|
@@ -133,15 +133,15 @@ module Square
|
|
133
133
|
end
|
134
134
|
|
135
135
|
# Deletes the specified invoice. When an invoice is deleted, the
|
136
|
-
# associated
|
136
|
+
# associated order status changes to CANCELED. You can only delete a draft
|
137
137
|
# invoice (you cannot delete a published invoice, including one that is
|
138
138
|
# scheduled for processing).
|
139
139
|
# @param [String] invoice_id Required parameter: The ID of the invoice to
|
140
140
|
# delete.
|
141
141
|
# @param [Integer] version Optional parameter: The version of the
|
142
|
-
# [invoice](
|
143
|
-
#
|
144
|
-
# [ListInvoices](
|
142
|
+
# [invoice]($m/Invoice) to delete. If you do not know the version, you can
|
143
|
+
# call [GetInvoice]($e/Invoices/GetInvoice) or
|
144
|
+
# [ListInvoices]($e/Invoices/ListInvoices).
|
145
145
|
# @return [DeleteInvoiceResponse Hash] response from the API call
|
146
146
|
def delete_invoice(invoice_id:,
|
147
147
|
version: nil)
|
@@ -180,7 +180,7 @@ module Square
|
|
180
180
|
end
|
181
181
|
|
182
182
|
# Retrieves an invoice by invoice ID.
|
183
|
-
# @param [String] invoice_id Required parameter: The
|
183
|
+
# @param [String] invoice_id Required parameter: The ID of the invoice to
|
184
184
|
# retrieve.
|
185
185
|
# @return [GetInvoiceResponse Hash] response from the API call
|
186
186
|
def get_invoice(invoice_id:)
|
@@ -216,10 +216,10 @@ module Square
|
|
216
216
|
|
217
217
|
# Updates an invoice by modifying fields, clearing fields, or both. For most
|
218
218
|
# updates, you can use a sparse
|
219
|
-
# `Invoice` object to add fields or change values
|
219
|
+
# `Invoice` object to add fields or change values and use the
|
220
220
|
# `fields_to_clear` field to specify fields to clear.
|
221
221
|
# However, some restrictions apply. For example, you cannot change the
|
222
|
-
# `order_id` or `location_id` field
|
222
|
+
# `order_id` or `location_id` field and you
|
223
223
|
# must provide the complete `custom_fields` list to update a custom field.
|
224
224
|
# Published invoices have additional restrictions.
|
225
225
|
# @param [String] invoice_id Required parameter: The ID of the invoice to
|
@@ -242,7 +242,7 @@ module Square
|
|
242
242
|
# Prepare headers.
|
243
243
|
_headers = {
|
244
244
|
'accept' => 'application/json',
|
245
|
-
'
|
245
|
+
'Content-Type' => 'application/json'
|
246
246
|
}
|
247
247
|
|
248
248
|
# Prepare and execute HttpRequest.
|
@@ -267,7 +267,7 @@ module Square
|
|
267
267
|
# You cannot cancel an invoice in the `DRAFT` state or in a terminal state:
|
268
268
|
# `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`.
|
269
269
|
# @param [String] invoice_id Required parameter: The ID of the
|
270
|
-
# [invoice](
|
270
|
+
# [invoice]($m/Invoice) to cancel.
|
271
271
|
# @param [CancelInvoiceRequest] body Required parameter: An object
|
272
272
|
# containing the fields to POST for the request. See the corresponding
|
273
273
|
# object definition for field details.
|
@@ -286,7 +286,7 @@ module Square
|
|
286
286
|
# Prepare headers.
|
287
287
|
_headers = {
|
288
288
|
'accept' => 'application/json',
|
289
|
-
'
|
289
|
+
'Content-Type' => 'application/json'
|
290
290
|
}
|
291
291
|
|
292
292
|
# Prepare and execute HttpRequest.
|
@@ -318,8 +318,8 @@ module Square
|
|
318
318
|
# `UNPAID` if
|
319
319
|
# Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on
|
320
320
|
# file for a portion of the
|
321
|
-
# invoice amount
|
322
|
-
# @param [String] invoice_id Required parameter: The
|
321
|
+
# invoice amount.
|
322
|
+
# @param [String] invoice_id Required parameter: The ID of the invoice to
|
323
323
|
# publish.
|
324
324
|
# @param [PublishInvoiceRequest] body Required parameter: An object
|
325
325
|
# containing the fields to POST for the request. See the corresponding
|
@@ -339,7 +339,7 @@ module Square
|
|
339
339
|
# Prepare headers.
|
340
340
|
_headers = {
|
341
341
|
'accept' => 'application/json',
|
342
|
-
'
|
342
|
+
'Content-Type' => 'application/json'
|
343
343
|
}
|
344
344
|
|
345
345
|
# Prepare and execute HttpRequest.
|
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.
|
@@ -75,7 +76,7 @@ module Square
|
|
75
76
|
# Prepare headers.
|
76
77
|
_headers = {
|
77
78
|
'accept' => 'application/json',
|
78
|
-
'
|
79
|
+
'Content-Type' => 'application/json'
|
79
80
|
}
|
80
81
|
|
81
82
|
# Prepare and execute HttpRequest.
|
@@ -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
|
@@ -187,7 +188,7 @@ module Square
|
|
187
188
|
# Prepare headers.
|
188
189
|
_headers = {
|
189
190
|
'accept' => 'application/json',
|
190
|
-
'
|
191
|
+
'Content-Type' => 'application/json'
|
191
192
|
}
|
192
193
|
|
193
194
|
# Prepare and execute HttpRequest.
|
@@ -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.
|
@@ -318,7 +319,7 @@ module Square
|
|
318
319
|
# Prepare headers.
|
319
320
|
_headers = {
|
320
321
|
'accept' => 'application/json',
|
321
|
-
'
|
322
|
+
'Content-Type' => 'application/json'
|
322
323
|
}
|
323
324
|
|
324
325
|
# Prepare and execute HttpRequest.
|
@@ -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.
|
@@ -364,7 +365,7 @@ module Square
|
|
364
365
|
# Prepare headers.
|
365
366
|
_headers = {
|
366
367
|
'accept' => 'application/json',
|
367
|
-
'
|
368
|
+
'Content-Type' => 'application/json'
|
368
369
|
}
|
369
370
|
|
370
371
|
# Prepare and execute HttpRequest.
|
@@ -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.
|
@@ -480,7 +482,7 @@ module Square
|
|
480
482
|
# Prepare headers.
|
481
483
|
_headers = {
|
482
484
|
'accept' => 'application/json',
|
483
|
-
'
|
485
|
+
'Content-Type' => 'application/json'
|
484
486
|
}
|
485
487
|
|
486
488
|
# Prepare and execute HttpRequest.
|
@@ -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
|
@@ -639,7 +641,7 @@ module Square
|
|
639
641
|
# Prepare headers.
|
640
642
|
_headers = {
|
641
643
|
'accept' => 'application/json',
|
642
|
-
'
|
644
|
+
'Content-Type' => 'application/json'
|
643
645
|
}
|
644
646
|
|
645
647
|
# Prepare and execute HttpRequest.
|
@@ -5,11 +5,9 @@ module Square
|
|
5
5
|
super(config, http_call_back: http_call_back)
|
6
6
|
end
|
7
7
|
|
8
|
-
# Provides
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# this
|
12
|
-
# endpoint correspond to that `location_id` parameter.
|
8
|
+
# Provides details about all of the seller's
|
9
|
+
# [locations](https://developer.squareup.com/docs/locations-api),
|
10
|
+
# including those with an inactive status.
|
13
11
|
# @return [ListLocationsResponse Hash] response from the API call
|
14
12
|
def list_locations
|
15
13
|
# Prepare query url.
|
@@ -38,7 +36,17 @@ module Square
|
|
38
36
|
)
|
39
37
|
end
|
40
38
|
|
41
|
-
# Creates a location.
|
39
|
+
# Creates a [location](https://developer.squareup.com/docs/locations-api).
|
40
|
+
# Creating new locations allows for separate configuration of receipt
|
41
|
+
# layouts, item prices,
|
42
|
+
# and sales reports. Developers can use locations to separate sales activity
|
43
|
+
# via applications
|
44
|
+
# that integrate with Square from sales activity elsewhere in a seller's
|
45
|
+
# account.
|
46
|
+
# Locations created programmatically with the Locations API will last
|
47
|
+
# forever and
|
48
|
+
# are visible to the seller for their own management, so ensure that
|
49
|
+
# each location has a sensible and unique name.
|
42
50
|
# @param [CreateLocationRequest] body Required parameter: An object
|
43
51
|
# containing the fields to POST for the request. See the corresponding
|
44
52
|
# object definition for field details.
|
@@ -52,7 +60,7 @@ module Square
|
|
52
60
|
# Prepare headers.
|
53
61
|
_headers = {
|
54
62
|
'accept' => 'application/json',
|
55
|
-
'
|
63
|
+
'Content-Type' => 'application/json'
|
56
64
|
}
|
57
65
|
|
58
66
|
# Prepare and execute HttpRequest.
|
@@ -72,12 +80,12 @@ module Square
|
|
72
80
|
)
|
73
81
|
end
|
74
82
|
|
75
|
-
# Retrieves details of a location.
|
76
|
-
# as the location ID to retrieve details of the
|
77
|
-
#
|
83
|
+
# Retrieves details of a single location. Specify "main"
|
84
|
+
# as the location ID to retrieve details of the [main
|
85
|
+
# location](https://developer.squareup.com/docs/locations-api#about-the-main
|
86
|
+
# -location).
|
78
87
|
# @param [String] location_id Required parameter: The ID of the location to
|
79
|
-
# retrieve.
|
80
|
-
# main location.
|
88
|
+
# retrieve. Specify the string "main" to return the main location.
|
81
89
|
# @return [RetrieveLocationResponse Hash] response from the API call
|
82
90
|
def retrieve_location(location_id:)
|
83
91
|
# Prepare query url.
|
@@ -110,7 +118,7 @@ module Square
|
|
110
118
|
)
|
111
119
|
end
|
112
120
|
|
113
|
-
# Updates a location.
|
121
|
+
# Updates a [location](https://developer.squareup.com/docs/locations-api).
|
114
122
|
# @param [String] location_id Required parameter: The ID of the location to
|
115
123
|
# update.
|
116
124
|
# @param [UpdateLocationRequest] body Required parameter: An object
|
@@ -131,7 +139,7 @@ module Square
|
|
131
139
|
# Prepare headers.
|
132
140
|
_headers = {
|
133
141
|
'accept' => 'application/json',
|
134
|
-
'
|
142
|
+
'Content-Type' => 'application/json'
|
135
143
|
}
|
136
144
|
|
137
145
|
# Prepare and execute HttpRequest.
|