square.rb 9.1.0.20210317 → 12.0.0.20210616
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -3
- data/lib/square.rb +5 -0
- data/lib/square/api/bank_accounts_api.rb +5 -5
- data/lib/square/api/base_api.rb +1 -1
- data/lib/square/api/bookings_api.rb +3 -5
- 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 +40 -41
- data/lib/square/api/customer_groups_api.rb +4 -4
- data/lib/square/api/customer_segments_api.rb +4 -4
- data/lib/square/api/customers_api.rb +45 -26
- data/lib/square/api/devices_api.rb +2 -1
- data/lib/square/api/disputes_api.rb +100 -91
- data/lib/square/api/gift_card_activities_api.rb +127 -0
- data/lib/square/api/gift_cards_api.rb +291 -0
- data/lib/square/api/inventory_api.rb +16 -16
- data/lib/square/api/invoices_api.rb +14 -14
- data/lib/square/api/locations_api.rb +1 -2
- data/lib/square/api/loyalty_api.rb +66 -14
- data/lib/square/api/merchants_api.rb +1 -1
- data/lib/square/api/o_auth_api.rb +8 -9
- data/lib/square/api/orders_api.rb +35 -33
- data/lib/square/api/payments_api.rb +4 -1
- data/lib/square/api/refunds_api.rb +4 -1
- data/lib/square/api/sites_api.rb +42 -0
- data/lib/square/api/snippets_api.rb +146 -0
- data/lib/square/api/subscriptions_api.rb +36 -1
- data/lib/square/api/team_api.rb +40 -40
- data/lib/square/api/transactions_api.rb +32 -20
- data/lib/square/api/v1_employees_api.rb +2 -1
- data/lib/square/api/v1_transactions_api.rb +9 -0
- data/lib/square/api_helper.rb +5 -5
- data/lib/square/client.rb +37 -3
- data/lib/square/configuration.rb +23 -8
- data/lib/square/http/faraday_client.rb +5 -2
- data/test/api/test_locations_api.rb +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2899ef8f7b608c506ec04abc840c1c80f24109063086e5f756049544919e7d6e
|
4
|
+
data.tar.gz: 5835b5bc55af2f9cd9618dc5d09cdc47b1d197c23cf45d8293c4f59e90521c33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3352454a34c03eeaebff9db1e805f8c12bf929deaf045c4b0a258caf917c5b4dad010bfd18741881c99057a254890d5f8ef4887f53360430915a3c746b3e7311
|
7
|
+
data.tar.gz: ff8762e1244f9a074599fbb05b2441fbc2f16c715bfc466f8ab3c49b53d88b3664eee9622d9b44e0f8b4c5209b8eeedebaaaf284495bdd620e72f698dfcefab2
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Square Ruby SDK
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![Build](https://github.com/square/square-ruby-sdk/actions/workflows/ruby.yml/badge.svg)](https://github.com/square/square-ruby-sdk/actions/workflows/ruby.yml)
|
6
6
|
[![Gem version](https://badge.fury.io/rb/square.rb.svg?new)](https://badge.fury.io/rb/square.rb)
|
7
7
|
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)
|
8
8
|
|
@@ -73,9 +73,13 @@ gem 'square.rb'
|
|
73
73
|
### Financials
|
74
74
|
* [Bank Accounts]
|
75
75
|
|
76
|
+
### Online
|
77
|
+
* [Sites]
|
78
|
+
* [Snippets]
|
79
|
+
|
76
80
|
### Authorization APIs
|
77
81
|
* [Mobile Authorization]
|
78
|
-
* [
|
82
|
+
* [OAuth]
|
79
83
|
|
80
84
|
### Deprecated APIs
|
81
85
|
* [V1 Employees]
|
@@ -322,8 +326,10 @@ You can also use the Square API to create applications or services that work wit
|
|
322
326
|
[Refunds]: doc/api/refunds.md
|
323
327
|
[Subscriptions]: doc/api/subscriptions.md
|
324
328
|
[Mobile Authorization]: doc/api/mobile-authorization.md
|
325
|
-
[
|
329
|
+
[OAuth]: doc/api/o-auth.md
|
326
330
|
[V1 Employees]: doc/api/v1-employees.md
|
327
331
|
[V1 Transactions]: doc/api/v1-transactions.md
|
328
332
|
[V1 Items]: doc/api/v1-items.md
|
329
333
|
[Transactions]: doc/api/transactions.md
|
334
|
+
[Sites]: doc/api/sites.md
|
335
|
+
[Snippets]: doc/api/snippets.md
|
data/lib/square.rb
CHANGED
@@ -36,6 +36,7 @@ require_relative 'square/api/v1_transactions_api.rb'
|
|
36
36
|
require_relative 'square/api/apple_pay_api.rb'
|
37
37
|
require_relative 'square/api/bank_accounts_api.rb'
|
38
38
|
require_relative 'square/api/bookings_api.rb'
|
39
|
+
require_relative 'square/api/cards_api.rb'
|
39
40
|
require_relative 'square/api/cash_drawers_api.rb'
|
40
41
|
require_relative 'square/api/catalog_api.rb'
|
41
42
|
require_relative 'square/api/customers_api.rb'
|
@@ -44,6 +45,8 @@ require_relative 'square/api/customer_segments_api.rb'
|
|
44
45
|
require_relative 'square/api/devices_api.rb'
|
45
46
|
require_relative 'square/api/disputes_api.rb'
|
46
47
|
require_relative 'square/api/employees_api.rb'
|
48
|
+
require_relative 'square/api/gift_cards_api.rb'
|
49
|
+
require_relative 'square/api/gift_card_activities_api.rb'
|
47
50
|
require_relative 'square/api/inventory_api.rb'
|
48
51
|
require_relative 'square/api/invoices_api.rb'
|
49
52
|
require_relative 'square/api/labor_api.rb'
|
@@ -55,6 +58,8 @@ require_relative 'square/api/merchants_api.rb'
|
|
55
58
|
require_relative 'square/api/orders_api.rb'
|
56
59
|
require_relative 'square/api/payments_api.rb'
|
57
60
|
require_relative 'square/api/refunds_api.rb'
|
61
|
+
require_relative 'square/api/sites_api.rb'
|
62
|
+
require_relative 'square/api/snippets_api.rb'
|
58
63
|
require_relative 'square/api/subscriptions_api.rb'
|
59
64
|
require_relative 'square/api/team_api.rb'
|
60
65
|
require_relative 'square/api/terminal_api.rb'
|
@@ -5,8 +5,8 @@ module Square
|
|
5
5
|
super(config, http_call_back: http_call_back)
|
6
6
|
end
|
7
7
|
|
8
|
-
# Returns a list of [BankAccount](
|
9
|
-
#
|
8
|
+
# Returns a list of [BankAccount]($m/BankAccount) objects linked to a Square
|
9
|
+
# account.
|
10
10
|
# @param [String] cursor Optional parameter: The pagination cursor returned
|
11
11
|
# by a previous call to this endpoint. Use it in the next `ListBankAccounts`
|
12
12
|
# request to retrieve the next set of results. See the
|
@@ -55,8 +55,8 @@ module Square
|
|
55
55
|
)
|
56
56
|
end
|
57
57
|
|
58
|
-
# Returns details of a [BankAccount](
|
59
|
-
#
|
58
|
+
# Returns details of a [BankAccount]($m/BankAccount) identified by V1 bank
|
59
|
+
# account ID.
|
60
60
|
# @param [String] v1_bank_account_id Required parameter: Connect V1 ID of
|
61
61
|
# the desired `BankAccount`. For more information, see [Retrieve a bank
|
62
62
|
# account by using an ID issued by V1 Bank Accounts
|
@@ -94,7 +94,7 @@ module Square
|
|
94
94
|
)
|
95
95
|
end
|
96
96
|
|
97
|
-
# Returns details of a [BankAccount](
|
97
|
+
# Returns details of a [BankAccount]($m/BankAccount)
|
98
98
|
# linked to a Square account.
|
99
99
|
# @param [String] bank_account_id Required parameter: Square-issued ID of
|
100
100
|
# the desired `BankAccount`.
|
data/lib/square/api/base_api.rb
CHANGED
@@ -188,8 +188,7 @@ module Square
|
|
188
188
|
|
189
189
|
# Retrieves a booking.
|
190
190
|
# @param [String] booking_id Required parameter: The ID of the
|
191
|
-
# [Booking](
|
192
|
-
# booking.
|
191
|
+
# [Booking]($m/Booking) object representing the to-be-retrieved booking.
|
193
192
|
# @return [RetrieveBookingResponse Hash] response from the API call
|
194
193
|
def retrieve_booking(booking_id:)
|
195
194
|
# Prepare query url.
|
@@ -224,7 +223,7 @@ module Square
|
|
224
223
|
|
225
224
|
# Updates a booking.
|
226
225
|
# @param [String] booking_id Required parameter: The ID of the
|
227
|
-
# [Booking](
|
226
|
+
# [Booking]($m/Booking) object representing the to-be-updated booking.
|
228
227
|
# @param [UpdateBookingRequest] body Required parameter: An object
|
229
228
|
# containing the fields to POST for the request. See the corresponding
|
230
229
|
# object definition for field details.
|
@@ -265,8 +264,7 @@ module Square
|
|
265
264
|
|
266
265
|
# Cancels an existing booking.
|
267
266
|
# @param [String] booking_id Required parameter: The ID of the
|
268
|
-
# [Booking](
|
269
|
-
# booking.
|
267
|
+
# [Booking]($m/Booking) object representing the to-be-cancelled booking.
|
270
268
|
# @param [CancelBookingRequest] body Required parameter: An object
|
271
269
|
# containing the fields to POST for the request. See the corresponding
|
272
270
|
# object definition for field details.
|
@@ -0,0 +1,170 @@
|
|
1
|
+
module Square
|
2
|
+
# CardsApi
|
3
|
+
class CardsApi < BaseApi
|
4
|
+
def initialize(config, http_call_back: nil)
|
5
|
+
super(config, http_call_back: http_call_back)
|
6
|
+
end
|
7
|
+
|
8
|
+
# Retrieves a list of cards owned by the account making the request.
|
9
|
+
# A max of 25 cards will be returned.
|
10
|
+
# @param [String] cursor Optional parameter: A pagination cursor returned by
|
11
|
+
# a previous call to this endpoint. Provide this to retrieve the next set of
|
12
|
+
# results for your original query. See
|
13
|
+
# [Pagination](https://developer.squareup.com/docs/basics/api101/pagination)
|
14
|
+
# for more information.
|
15
|
+
# @param [String] customer_id Optional parameter: Limit results to cards
|
16
|
+
# associated with the customer supplied. By default, all cards owned by the
|
17
|
+
# merchant are returned.
|
18
|
+
# @param [Boolean] include_disabled Optional parameter: Includes disabled
|
19
|
+
# cards. By default, all enabled cards owned by the merchant are returned.
|
20
|
+
# @param [String] reference_id Optional parameter: Limit results to cards
|
21
|
+
# associated with the reference_id supplied.
|
22
|
+
# @param [SortOrder] sort_order Optional parameter: Sorts the returned list
|
23
|
+
# by when the card was created with the specified order. This field defaults
|
24
|
+
# to ASC.
|
25
|
+
# @return [ListCardsResponse Hash] response from the API call
|
26
|
+
def list_cards(cursor: nil,
|
27
|
+
customer_id: nil,
|
28
|
+
include_disabled: false,
|
29
|
+
reference_id: nil,
|
30
|
+
sort_order: nil)
|
31
|
+
# Prepare query url.
|
32
|
+
_query_builder = config.get_base_uri
|
33
|
+
_query_builder << '/v2/cards'
|
34
|
+
_query_builder = APIHelper.append_url_with_query_parameters(
|
35
|
+
_query_builder,
|
36
|
+
'cursor' => cursor,
|
37
|
+
'customer_id' => customer_id,
|
38
|
+
'include_disabled' => include_disabled,
|
39
|
+
'reference_id' => reference_id,
|
40
|
+
'sort_order' => sort_order
|
41
|
+
)
|
42
|
+
_query_url = APIHelper.clean_url _query_builder
|
43
|
+
|
44
|
+
# Prepare headers.
|
45
|
+
_headers = {
|
46
|
+
'accept' => 'application/json'
|
47
|
+
}
|
48
|
+
|
49
|
+
# Prepare and execute HttpRequest.
|
50
|
+
_request = config.http_client.get(
|
51
|
+
_query_url,
|
52
|
+
headers: _headers
|
53
|
+
)
|
54
|
+
OAuth2.apply(config, _request)
|
55
|
+
_response = execute_request(_request)
|
56
|
+
|
57
|
+
# Return appropriate response type.
|
58
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
59
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
60
|
+
ApiResponse.new(
|
61
|
+
_response, data: decoded, errors: _errors
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Adds a card on file to an existing merchant.
|
66
|
+
# @param [CreateCardRequest] body Required parameter: An object containing
|
67
|
+
# the fields to POST for the request. See the corresponding object
|
68
|
+
# definition for field details.
|
69
|
+
# @return [CreateCardResponse Hash] response from the API call
|
70
|
+
def create_card(body:)
|
71
|
+
# Prepare query url.
|
72
|
+
_query_builder = config.get_base_uri
|
73
|
+
_query_builder << '/v2/cards'
|
74
|
+
_query_url = APIHelper.clean_url _query_builder
|
75
|
+
|
76
|
+
# Prepare headers.
|
77
|
+
_headers = {
|
78
|
+
'accept' => 'application/json',
|
79
|
+
'content-type' => 'application/json; charset=utf-8'
|
80
|
+
}
|
81
|
+
|
82
|
+
# Prepare and execute HttpRequest.
|
83
|
+
_request = config.http_client.post(
|
84
|
+
_query_url,
|
85
|
+
headers: _headers,
|
86
|
+
parameters: body.to_json
|
87
|
+
)
|
88
|
+
OAuth2.apply(config, _request)
|
89
|
+
_response = execute_request(_request)
|
90
|
+
|
91
|
+
# Return appropriate response type.
|
92
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
93
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
94
|
+
ApiResponse.new(
|
95
|
+
_response, data: decoded, errors: _errors
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Retrieves details for a specific Card.
|
100
|
+
# @param [String] card_id Required parameter: Unique ID for the desired
|
101
|
+
# Card.
|
102
|
+
# @return [RetrieveCardResponse Hash] response from the API call
|
103
|
+
def retrieve_card(card_id:)
|
104
|
+
# Prepare query url.
|
105
|
+
_query_builder = config.get_base_uri
|
106
|
+
_query_builder << '/v2/cards/{card_id}'
|
107
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
108
|
+
_query_builder,
|
109
|
+
'card_id' => { 'value' => card_id, 'encode' => true }
|
110
|
+
)
|
111
|
+
_query_url = APIHelper.clean_url _query_builder
|
112
|
+
|
113
|
+
# Prepare headers.
|
114
|
+
_headers = {
|
115
|
+
'accept' => 'application/json'
|
116
|
+
}
|
117
|
+
|
118
|
+
# Prepare and execute HttpRequest.
|
119
|
+
_request = config.http_client.get(
|
120
|
+
_query_url,
|
121
|
+
headers: _headers
|
122
|
+
)
|
123
|
+
OAuth2.apply(config, _request)
|
124
|
+
_response = execute_request(_request)
|
125
|
+
|
126
|
+
# Return appropriate response type.
|
127
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
128
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
129
|
+
ApiResponse.new(
|
130
|
+
_response, data: decoded, errors: _errors
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Disables the card, preventing any further updates or charges.
|
135
|
+
# Disabling an already disabled card is allowed but has no effect.
|
136
|
+
# @param [String] card_id Required parameter: Unique ID for the desired
|
137
|
+
# Card.
|
138
|
+
# @return [DisableCardResponse Hash] response from the API call
|
139
|
+
def disable_card(card_id:)
|
140
|
+
# Prepare query url.
|
141
|
+
_query_builder = config.get_base_uri
|
142
|
+
_query_builder << '/v2/cards/{card_id}/disable'
|
143
|
+
_query_builder = APIHelper.append_url_with_template_parameters(
|
144
|
+
_query_builder,
|
145
|
+
'card_id' => { 'value' => card_id, 'encode' => true }
|
146
|
+
)
|
147
|
+
_query_url = APIHelper.clean_url _query_builder
|
148
|
+
|
149
|
+
# Prepare headers.
|
150
|
+
_headers = {
|
151
|
+
'accept' => 'application/json'
|
152
|
+
}
|
153
|
+
|
154
|
+
# Prepare and execute HttpRequest.
|
155
|
+
_request = config.http_client.post(
|
156
|
+
_query_url,
|
157
|
+
headers: _headers
|
158
|
+
)
|
159
|
+
OAuth2.apply(config, _request)
|
160
|
+
_response = execute_request(_request)
|
161
|
+
|
162
|
+
# Return appropriate response type.
|
163
|
+
decoded = APIHelper.json_deserialize(_response.raw_body)
|
164
|
+
_errors = APIHelper.map_response(decoded, ['errors'])
|
165
|
+
ApiResponse.new(
|
166
|
+
_response, data: decoded, errors: _errors
|
167
|
+
)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
@@ -63,8 +63,8 @@ module Square
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Provides the summary details for a single cash drawer shift. See
|
66
|
-
# [ListCashDrawerShiftEvents](
|
67
|
-
#
|
66
|
+
# [ListCashDrawerShiftEvents]($e/CashDrawers/ListCashDrawerShiftEvents) for
|
67
|
+
# a list of cash drawer shift events.
|
68
68
|
# @param [String] location_id Required parameter: The ID of the location to
|
69
69
|
# retrieve cash drawer shifts from.
|
70
70
|
# @param [String] shift_id Required parameter: The shift ID.
|
@@ -5,12 +5,12 @@ module Square
|
|
5
5
|
super(config, http_call_back: http_call_back)
|
6
6
|
end
|
7
7
|
|
8
|
-
# Deletes a set of [CatalogItem](
|
8
|
+
# Deletes a set of [CatalogItem]($m/CatalogItem)s based on the
|
9
9
|
# provided list of target IDs and returns a set of successfully deleted IDs
|
10
10
|
# in
|
11
11
|
# the response. Deletion is a cascading event such that all children of the
|
12
12
|
# targeted object are also deleted. For example, deleting a CatalogItem will
|
13
|
-
# also delete all of its [CatalogItemVariation](
|
13
|
+
# also delete all of its [CatalogItemVariation]($m/CatalogItemVariation)
|
14
14
|
# children.
|
15
15
|
# `BatchDeleteCatalogObjects` succeeds even if only a portion of the
|
16
16
|
# targeted
|
@@ -50,13 +50,11 @@ module Square
|
|
50
50
|
end
|
51
51
|
|
52
52
|
# Returns a set of objects based on the provided ID.
|
53
|
-
# Each [CatalogItem](
|
54
|
-
# its
|
53
|
+
# Each [CatalogItem]($m/CatalogItem) returned in the set includes all of its
|
55
54
|
# child information including: all of its
|
56
|
-
# [CatalogItemVariation](
|
57
|
-
# its [CatalogModifierList](
|
58
|
-
#
|
59
|
-
# any [CatalogTax](#type-catalogtax) objects that apply to it.
|
55
|
+
# [CatalogItemVariation]($m/CatalogItemVariation) objects, references to
|
56
|
+
# its [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of
|
57
|
+
# any [CatalogTax]($m/CatalogTax) objects that apply to it.
|
60
58
|
# @param [BatchRetrieveCatalogObjectsRequest] body Required parameter: An
|
61
59
|
# object containing the fields to POST for the request. See the
|
62
60
|
# corresponding object definition for field details.
|
@@ -138,8 +136,8 @@ module Square
|
|
138
136
|
end
|
139
137
|
|
140
138
|
# Uploads an image file to be represented by a
|
141
|
-
# [CatalogImage](
|
142
|
-
# [CatalogObject](
|
139
|
+
# [CatalogImage]($m/CatalogImage) object linked to an existing
|
140
|
+
# [CatalogObject]($m/CatalogObject) instance. A call to this endpoint can
|
143
141
|
# upload an image, link an image to
|
144
142
|
# a catalog object, or do both.
|
145
143
|
# This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data
|
@@ -228,33 +226,36 @@ module Square
|
|
228
226
|
)
|
229
227
|
end
|
230
228
|
|
231
|
-
# Returns a list of [CatalogObject](
|
229
|
+
# Returns a list of [CatalogObject]($m/CatalogObject)s that includes
|
232
230
|
# all objects of a set of desired types (for example, all
|
233
|
-
# [CatalogItem](
|
234
|
-
# and [CatalogTax](
|
231
|
+
# [CatalogItem]($m/CatalogItem)
|
232
|
+
# and [CatalogTax]($m/CatalogTax) objects) in the catalog. The `types`
|
235
233
|
# parameter
|
236
234
|
# is specified as a comma-separated list of valid
|
237
|
-
# [CatalogObject](
|
235
|
+
# [CatalogObject]($m/CatalogObject) types:
|
238
236
|
# `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`,
|
239
237
|
# `DISCOUNT`, `TAX`, `IMAGE`.
|
240
238
|
# __Important:__ ListCatalog does not return deleted catalog items. To
|
241
239
|
# retrieve
|
242
240
|
# deleted catalog items, use
|
243
|
-
# [SearchCatalogObjects](
|
241
|
+
# [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects)
|
244
242
|
# and set the `include_deleted_objects` attribute value to `true`.
|
245
243
|
# @param [String] cursor Optional parameter: The pagination cursor returned
|
246
|
-
# in the previous response. Leave unset for an initial request.
|
244
|
+
# in the previous response. Leave unset for an initial request. The page
|
245
|
+
# size is currently set to be 100. See
|
247
246
|
# [Pagination](https://developer.squareup.com/docs/basics/api101/pagination)
|
248
247
|
# for more information.
|
249
248
|
# @param [String] types Optional parameter: An optional case-insensitive,
|
250
|
-
# comma-separated list of object types to retrieve
|
251
|
-
#
|
252
|
-
#
|
253
|
-
# `
|
249
|
+
# comma-separated list of object types to retrieve. The valid values are
|
250
|
+
# defined in the [CatalogObjectType]($m/CatalogObjectType) enum, including
|
251
|
+
# `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`,
|
252
|
+
# `MODIFIER_LIST`, or `IMAGE`. If this is unspecified, the operation
|
253
|
+
# returns objects of all the types at the version of the Square API used to
|
254
|
+
# make the request.
|
254
255
|
# @param [Long] catalog_version Optional parameter: The specific version of
|
255
256
|
# the catalog objects to be included in the response. This allows you to
|
256
257
|
# retrieve historical versions of objects. The specified version value is
|
257
|
-
# matched against the [CatalogObject](
|
258
|
+
# matched against the [CatalogObject]($m/CatalogObject)s' `version`
|
258
259
|
# attribute.
|
259
260
|
# @return [ListCatalogResponse Hash] response from the API call
|
260
261
|
def list_catalog(cursor: nil,
|
@@ -292,7 +293,7 @@ module Square
|
|
292
293
|
)
|
293
294
|
end
|
294
295
|
|
295
|
-
# Creates or updates the target [CatalogObject](
|
296
|
+
# Creates or updates the target [CatalogObject]($m/CatalogObject).
|
296
297
|
# @param [UpsertCatalogObjectRequest] body Required parameter: An object
|
297
298
|
# containing the fields to POST for the request. See the corresponding
|
298
299
|
# object definition for field details.
|
@@ -326,14 +327,14 @@ module Square
|
|
326
327
|
)
|
327
328
|
end
|
328
329
|
|
329
|
-
# Deletes a single [CatalogObject](
|
330
|
+
# Deletes a single [CatalogObject]($m/CatalogObject) based on the
|
330
331
|
# provided ID and returns the set of successfully deleted IDs in the
|
331
332
|
# response.
|
332
333
|
# Deletion is a cascading event such that all children of the targeted
|
333
334
|
# object
|
334
|
-
# are also deleted. For example, deleting a [CatalogItem](
|
335
|
+
# are also deleted. For example, deleting a [CatalogItem]($m/CatalogItem)
|
335
336
|
# will also delete all of its
|
336
|
-
# [CatalogItemVariation](
|
337
|
+
# [CatalogItemVariation]($m/CatalogItemVariation) children.
|
337
338
|
# @param [String] object_id Required parameter: The ID of the catalog object
|
338
339
|
# to be deleted. When an object is deleted, other objects in the graph that
|
339
340
|
# depend on that object will be deleted as well (for example, deleting a
|
@@ -370,14 +371,13 @@ module Square
|
|
370
371
|
)
|
371
372
|
end
|
372
373
|
|
373
|
-
# Returns a single [CatalogItem](
|
374
|
-
# [CatalogObject](
|
375
|
-
#
|
376
|
-
#
|
377
|
-
# information including: [CatalogItemVariation](#type-catalogitemvariation)
|
374
|
+
# Returns a single [CatalogItem]($m/CatalogItem) as a
|
375
|
+
# [CatalogObject]($m/CatalogObject) based on the provided ID. The returned
|
376
|
+
# object includes all of the relevant [CatalogItem]($m/CatalogItem)
|
377
|
+
# information including: [CatalogItemVariation]($m/CatalogItemVariation)
|
378
378
|
# children, references to its
|
379
|
-
# [CatalogModifierList](
|
380
|
-
# any [CatalogTax](
|
379
|
+
# [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of
|
380
|
+
# any [CatalogTax]($m/CatalogTax) objects that apply to it.
|
381
381
|
# @param [String] object_id Required parameter: The object ID of any type of
|
382
382
|
# catalog objects to be retrieved.
|
383
383
|
# @param [Boolean] include_related_objects Optional parameter: If `true`,
|
@@ -392,8 +392,7 @@ module Square
|
|
392
392
|
# @param [Long] catalog_version Optional parameter: Requests objects as of a
|
393
393
|
# specific version of the catalog. This allows you to retrieve historical
|
394
394
|
# versions of objects. The value to retrieve a specific version of an object
|
395
|
-
# can be found in the version field of
|
396
|
-
# [CatalogObject](#type-catalogobject)s.
|
395
|
+
# can be found in the version field of [CatalogObject]($m/CatalogObject)s.
|
397
396
|
# @return [RetrieveCatalogObjectResponse Hash] response from the API call
|
398
397
|
def retrieve_catalog_object(object_id:,
|
399
398
|
include_related_objects: false,
|
@@ -433,12 +432,12 @@ module Square
|
|
433
432
|
)
|
434
433
|
end
|
435
434
|
|
436
|
-
# Searches for [CatalogObject](
|
435
|
+
# Searches for [CatalogObject]($m/CatalogObject) of any type by matching
|
437
436
|
# supported search attribute values,
|
438
437
|
# excluding custom attribute values on items or item variations, against one
|
439
438
|
# or more of the specified query expressions.
|
440
439
|
# This (`SearchCatalogObjects`) endpoint differs from the
|
441
|
-
# [SearchCatalogItems](
|
440
|
+
# [SearchCatalogItems]($e/Catalog/SearchCatalogItems)
|
442
441
|
# endpoint in the following aspects:
|
443
442
|
# - `SearchCatalogItems` can only search for items or item variations,
|
444
443
|
# whereas `SearchCatalogObjects` can search for any type of catalog objects.
|
@@ -488,7 +487,7 @@ module Square
|
|
488
487
|
# custom attribute values, against one or more of the specified query
|
489
488
|
# expressions.
|
490
489
|
# This (`SearchCatalogItems`) endpoint differs from the
|
491
|
-
# [SearchCatalogObjects](
|
490
|
+
# [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects)
|
492
491
|
# endpoint in the following aspects:
|
493
492
|
# - `SearchCatalogItems` can only search for items or item variations,
|
494
493
|
# whereas `SearchCatalogObjects` can search for any type of catalog objects.
|
@@ -533,8 +532,8 @@ module Square
|
|
533
532
|
)
|
534
533
|
end
|
535
534
|
|
536
|
-
# Updates the [CatalogModifierList](
|
537
|
-
# that apply to the targeted [CatalogItem](
|
535
|
+
# Updates the [CatalogModifierList]($m/CatalogModifierList) objects
|
536
|
+
# that apply to the targeted [CatalogItem]($m/CatalogItem) without having
|
538
537
|
# to perform an upsert on the entire item.
|
539
538
|
# @param [UpdateItemModifierListsRequest] body Required parameter: An object
|
540
539
|
# containing the fields to POST for the request. See the corresponding
|
@@ -569,8 +568,8 @@ module Square
|
|
569
568
|
)
|
570
569
|
end
|
571
570
|
|
572
|
-
# Updates the [CatalogTax](
|
573
|
-
# targeted [CatalogItem](
|
571
|
+
# Updates the [CatalogTax]($m/CatalogTax) objects that apply to the
|
572
|
+
# targeted [CatalogItem]($m/CatalogItem) without having to perform an
|
574
573
|
# upsert on the entire item.
|
575
574
|
# @param [UpdateItemTaxesRequest] body Required parameter: An object
|
576
575
|
# containing the fields to POST for the request. See the corresponding
|