square.rb 9.0.0.20210226 → 11.0.0.20210513

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d590e351e349cad97ee0e30e6f0c281f699e9357b68007ce847cdf3d69b86451
4
- data.tar.gz: 5f89a1777603830bb3b6878f3e45041522c862a2b625e8bdda39c2893678e93d
3
+ metadata.gz: 5bd47b45ea9eca98fd3703e49daddc69b4b2ff2dea6d7badf813f75712ef1a41
4
+ data.tar.gz: a26991adca5e6f459a2467678cce0f61e244b2a997aa60750ed2d3a17f183aec
5
5
  SHA512:
6
- metadata.gz: d460315ea4f40be58b73ae56ce056ae5a7e0d09f8ca3b8604e8e347987743054228243318d4e23cbb2cf876272c88e7c5ace6cd50ddf9ad2a116f84c20a378f0
7
- data.tar.gz: 48da57deda485630006753f057fc6962caea914f058fca58d20884696e101b3e859b8cd5bf68a6d69817ed62b66fb743bddde49b5c15d9837ccca91fe40dc806
6
+ metadata.gz: 4923c144ec01aade0ca6386fef939d257213eac3f55565fcf29f34c9876e032c9ff47004e04d36453b70028d00b04573911c59434654cd500f655b3a718df04b
7
+ data.tar.gz: 9b2539e8da3c4d0e613c76e27a0ae82c64accac2008e7db8ca324cb48e19cfe663e65f1b86118ba56f133daeaf813e98dad05f1bd75144c198494c07fe61457d
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Square Ruby SDK
4
4
 
5
- [![Travis status](https://travis-ci.org/square/square-ruby-sdk.svg?branch=master)](https://travis-ci.org/square/square-ruby-sdk)
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
- * [O Auth]
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
- [O Auth]: doc/api/o-auth.md
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
@@ -55,6 +55,8 @@ require_relative 'square/api/merchants_api.rb'
55
55
  require_relative 'square/api/orders_api.rb'
56
56
  require_relative 'square/api/payments_api.rb'
57
57
  require_relative 'square/api/refunds_api.rb'
58
+ require_relative 'square/api/sites_api.rb'
59
+ require_relative 'square/api/snippets_api.rb'
58
60
  require_relative 'square/api/subscriptions_api.rb'
59
61
  require_relative 'square/api/team_api.rb'
60
62
  require_relative 'square/api/terminal_api.rb'
@@ -5,17 +5,18 @@ module Square
5
5
  super(config, http_call_back: http_call_back)
6
6
  end
7
7
 
8
- # Activates a domain for use with Web Apple Pay and Square. A validation
9
- # will be performed on this domain by Apple to ensure is it properly set up
8
+ # Activates a domain for use with Apple Pay on the Web and Square. A
9
+ # validation
10
+ # is performed on this domain by Apple to ensure that it is properly set up
10
11
  # as
11
12
  # an Apple Pay enabled domain.
12
13
  # This endpoint provides an easy way for platform developers to bulk
13
14
  # activate
14
- # Web Apple Pay with Square for merchants using their platform.
15
- # To learn more about Apple Pay on Web see the Apple Pay section in the
16
- # [Square Payment Form
17
- # Walkthrough](https://developer.squareup.com/docs/payment-form/payment-form
18
- # -walkthrough).
15
+ # Apple Pay on the Web with Square for merchants using their platform.
16
+ # To learn more about Web Apple Pay, see
17
+ # [Add the Apple Pay on the Web
18
+ # Button](https://developer.squareup.com/docs/payment-form/add-digital-walle
19
+ # ts/apple-pay).
19
20
  # @param [RegisterDomainRequest] body Required parameter: An object
20
21
  # containing the fields to POST for the request. See the corresponding
21
22
  # object definition for field details.
@@ -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](#type-bankaccount) objects linked to a
9
- # Square account.
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](#type-bankaccount) identified by V1
59
- # bank account ID.
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](#type-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`.
@@ -8,7 +8,7 @@ module Square
8
8
  @http_call_back = http_call_back
9
9
 
10
10
  @global_headers = {
11
- 'user-agent' => 'Square-Ruby-SDK/9.0.0.20210226',
11
+ 'user-agent' => 'Square-Ruby-SDK/11.0.0.20210513',
12
12
  'Square-Version' => config.square_version
13
13
  }
14
14
  end
@@ -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](#type-booking) object representing the to-be-retrieved
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](#type-booking) object representing the to-be-updated 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](#type-booking) object representing the to-be-cancelled
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.
@@ -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](#endpoint-CashDrawers-ListCashDrawerShiftEvent
67
- # s) for a list of cash drawer shift events.
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](#type-catalogitem)s based on the
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](#type-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](#type-catalogitem) returned in the set includes all of
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](#type-catalogitemvariation) objects, references to
57
- # its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids
58
- # of
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](#type-catalogimage) object linked to an existing
142
- # [CatalogObject](#type-catalogobject) instance. A call to this endpoint can
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,22 +226,23 @@ module Square
228
226
  )
229
227
  end
230
228
 
231
- # Returns a list of [CatalogObject](#type-catalogobject)s that includes
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](#type-catalogitem)
234
- # and [CatalogTax](#type-catalogtax) objects) in the catalog. The `types`
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](#type-catalogobject) types:
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](#endpoint-Catalog-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. See
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,
@@ -254,7 +253,7 @@ module Square
254
253
  # @param [Long] catalog_version Optional parameter: The specific version of
255
254
  # the catalog objects to be included in the response. This allows you to
256
255
  # retrieve historical versions of objects. The specified version value is
257
- # matched against the [CatalogObject](#type-catalogobject)s' `version`
256
+ # matched against the [CatalogObject]($m/CatalogObject)s' `version`
258
257
  # attribute.
259
258
  # @return [ListCatalogResponse Hash] response from the API call
260
259
  def list_catalog(cursor: nil,
@@ -292,7 +291,7 @@ module Square
292
291
  )
293
292
  end
294
293
 
295
- # Creates or updates the target [CatalogObject](#type-catalogobject).
294
+ # Creates or updates the target [CatalogObject]($m/CatalogObject).
296
295
  # @param [UpsertCatalogObjectRequest] body Required parameter: An object
297
296
  # containing the fields to POST for the request. See the corresponding
298
297
  # object definition for field details.
@@ -326,14 +325,14 @@ module Square
326
325
  )
327
326
  end
328
327
 
329
- # Deletes a single [CatalogObject](#type-catalogobject) based on the
328
+ # Deletes a single [CatalogObject]($m/CatalogObject) based on the
330
329
  # provided ID and returns the set of successfully deleted IDs in the
331
330
  # response.
332
331
  # Deletion is a cascading event such that all children of the targeted
333
332
  # object
334
- # are also deleted. For example, deleting a [CatalogItem](#type-catalogitem)
333
+ # are also deleted. For example, deleting a [CatalogItem]($m/CatalogItem)
335
334
  # will also delete all of its
336
- # [CatalogItemVariation](#type-catalogitemvariation) children.
335
+ # [CatalogItemVariation]($m/CatalogItemVariation) children.
337
336
  # @param [String] object_id Required parameter: The ID of the catalog object
338
337
  # to be deleted. When an object is deleted, other objects in the graph that
339
338
  # depend on that object will be deleted as well (for example, deleting a
@@ -370,14 +369,13 @@ module Square
370
369
  )
371
370
  end
372
371
 
373
- # Returns a single [CatalogItem](#type-catalogitem) as a
374
- # [CatalogObject](#type-catalogobject) based on the provided ID. The
375
- # returned
376
- # object includes all of the relevant [CatalogItem](#type-catalogitem)
377
- # information including: [CatalogItemVariation](#type-catalogitemvariation)
372
+ # Returns a single [CatalogItem]($m/CatalogItem) as a
373
+ # [CatalogObject]($m/CatalogObject) based on the provided ID. The returned
374
+ # object includes all of the relevant [CatalogItem]($m/CatalogItem)
375
+ # information including: [CatalogItemVariation]($m/CatalogItemVariation)
378
376
  # children, references to its
379
- # [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of
380
- # any [CatalogTax](#type-catalogtax) objects that apply to it.
377
+ # [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of
378
+ # any [CatalogTax]($m/CatalogTax) objects that apply to it.
381
379
  # @param [String] object_id Required parameter: The object ID of any type of
382
380
  # catalog objects to be retrieved.
383
381
  # @param [Boolean] include_related_objects Optional parameter: If `true`,
@@ -392,8 +390,7 @@ module Square
392
390
  # @param [Long] catalog_version Optional parameter: Requests objects as of a
393
391
  # specific version of the catalog. This allows you to retrieve historical
394
392
  # 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.
393
+ # can be found in the version field of [CatalogObject]($m/CatalogObject)s.
397
394
  # @return [RetrieveCatalogObjectResponse Hash] response from the API call
398
395
  def retrieve_catalog_object(object_id:,
399
396
  include_related_objects: false,
@@ -433,12 +430,12 @@ module Square
433
430
  )
434
431
  end
435
432
 
436
- # Searches for [CatalogObject](#type-CatalogObject) of any type by matching
433
+ # Searches for [CatalogObject]($m/CatalogObject) of any type by matching
437
434
  # supported search attribute values,
438
435
  # excluding custom attribute values on items or item variations, against one
439
436
  # or more of the specified query expressions.
440
437
  # This (`SearchCatalogObjects`) endpoint differs from the
441
- # [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems)
438
+ # [SearchCatalogItems]($e/Catalog/SearchCatalogItems)
442
439
  # endpoint in the following aspects:
443
440
  # - `SearchCatalogItems` can only search for items or item variations,
444
441
  # whereas `SearchCatalogObjects` can search for any type of catalog objects.
@@ -488,7 +485,7 @@ module Square
488
485
  # custom attribute values, against one or more of the specified query
489
486
  # expressions.
490
487
  # This (`SearchCatalogItems`) endpoint differs from the
491
- # [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects)
488
+ # [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects)
492
489
  # endpoint in the following aspects:
493
490
  # - `SearchCatalogItems` can only search for items or item variations,
494
491
  # whereas `SearchCatalogObjects` can search for any type of catalog objects.
@@ -533,8 +530,8 @@ module Square
533
530
  )
534
531
  end
535
532
 
536
- # Updates the [CatalogModifierList](#type-catalogmodifierlist) objects
537
- # that apply to the targeted [CatalogItem](#type-catalogitem) without having
533
+ # Updates the [CatalogModifierList]($m/CatalogModifierList) objects
534
+ # that apply to the targeted [CatalogItem]($m/CatalogItem) without having
538
535
  # to perform an upsert on the entire item.
539
536
  # @param [UpdateItemModifierListsRequest] body Required parameter: An object
540
537
  # containing the fields to POST for the request. See the corresponding
@@ -569,8 +566,8 @@ module Square
569
566
  )
570
567
  end
571
568
 
572
- # Updates the [CatalogTax](#type-catalogtax) objects that apply to the
573
- # targeted [CatalogItem](#type-catalogitem) without having to perform an
569
+ # Updates the [CatalogTax]($m/CatalogTax) objects that apply to the
570
+ # targeted [CatalogItem]($m/CatalogItem) without having to perform an
574
571
  # upsert on the entire item.
575
572
  # @param [UpdateItemTaxesRequest] body Required parameter: An object
576
573
  # containing the fields to POST for the request. See the corresponding
@@ -5,8 +5,8 @@ module Square
5
5
  super(config, http_call_back: http_call_back)
6
6
  end
7
7
 
8
- # Links a `checkoutId` to a `checkout_page_url` that customers will
9
- # be directed to in order to provide their payment information using a
8
+ # Links a `checkoutId` to a `checkout_page_url` that customers are
9
+ # directed to in order to provide their payment information using a
10
10
  # payment processing workflow hosted on connect.squareup.com.
11
11
  # @param [String] location_id Required parameter: The ID of the business
12
12
  # location to associate the checkout with.
@@ -7,10 +7,10 @@ module Square
7
7
 
8
8
  # Retrieves the list of customer groups of a business.
9
9
  # @param [String] cursor Optional parameter: A pagination cursor returned by
10
- # a previous call to this endpoint. Provide this to retrieve the next set of
11
- # results for your original query. See the [Pagination
12
- # guide](https://developer.squareup.com/docs/working-with-apis/pagination)
13
- # for more information.
10
+ # a previous call to this endpoint. Provide this cursor to retrieve the next
11
+ # set of results for your original query. For more information, see
12
+ # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
13
+ # ion).
14
14
  # @return [ListCustomerGroupsResponse Hash] response from the API call
15
15
  def list_customer_groups(cursor: nil)
16
16
  # Prepare query url.
@@ -7,10 +7,10 @@ module Square
7
7
 
8
8
  # Retrieves the list of customer segments of a business.
9
9
  # @param [String] cursor Optional parameter: A pagination cursor returned by
10
- # previous calls to __ListCustomerSegments__. Used to retrieve the next set
11
- # of query results. See the [Pagination
12
- # guide](https://developer.squareup.com/docs/working-with-apis/pagination)
13
- # for more information.
10
+ # previous calls to `ListCustomerSegments`. This cursor is used to retrieve
11
+ # the next set of query results. For more information, see
12
+ # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
13
+ # ion).
14
14
  # @return [ListCustomerSegmentsResponse Hash] response from the API call
15
15
  def list_customer_segments(cursor: nil)
16
16
  # Prepare query url.
@@ -13,14 +13,14 @@ module Square
13
13
  # profiles can take closer to one minute or longer, especially during
14
14
  # network incidents and outages.
15
15
  # @param [String] cursor Optional parameter: A pagination cursor returned by
16
- # a previous call to this endpoint. Provide this to retrieve the next set of
17
- # results for your original query. See the [Pagination
18
- # guide](https://developer.squareup.com/docs/working-with-apis/pagination)
19
- # for more information.
16
+ # a previous call to this endpoint. Provide this cursor to retrieve the next
17
+ # set of results for your original query. For more information, see
18
+ # [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
19
+ # ion).
20
20
  # @param [CustomerSortField] sort_field Optional parameter: Indicates how
21
- # Customers should be sorted. Default: `DEFAULT`.
21
+ # customers should be sorted. Default: `DEFAULT`.
22
22
  # @param [SortOrder] sort_order Optional parameter: Indicates whether
23
- # Customers should be sorted in ascending (`ASC`) or descending (`DESC`)
23
+ # customers should be sorted in ascending (`ASC`) or descending (`DESC`)
24
24
  # order. Default: `ASC`.
25
25
  # @return [ListCustomersResponse Hash] response from the API call
26
26
  def list_customers(cursor: nil,
@@ -60,8 +60,8 @@ module Square
60
60
 
61
61
  # Creates a new customer for a business, which can have associated cards on
62
62
  # file.
63
- # You must provide __at least one__ of the following values in your request
64
- # to this
63
+ # You must provide at least one of the following values in your request to
64
+ # this
65
65
  # endpoint:
66
66
  # - `given_name`
67
67
  # - `family_name`
@@ -145,15 +145,27 @@ module Square
145
145
  )
146
146
  end
147
147
 
148
- # Deletes a customer from a business, along with any linked cards on file.
149
- # When two profiles
150
- # are merged into a single profile, that profile is assigned a new
151
- # `customer_id`. You must use the
152
- # new `customer_id` to delete merged profiles.
148
+ # Deletes a customer profile from a business, including any linked cards on
149
+ # file.
150
+ # As a best practice, you should include the `version` field in the request
151
+ # to enable [optimistic
152
+ # concurrency](https://developer.squareup.com/docs/working-with-apis/optimis
153
+ # tic-concurrency) control. The value must be set to the current version of
154
+ # the customer profile.
155
+ # To delete a customer profile that was created by merging existing
156
+ # profiles, you must use the ID of the newly created profile.
153
157
  # @param [String] customer_id Required parameter: The ID of the customer to
154
158
  # delete.
159
+ # @param [Long] version Optional parameter: The current version of the
160
+ # customer profile. As a best practice, you should include this parameter
161
+ # to enable [optimistic
162
+ # concurrency](https://developer.squareup.com/docs/working-with-apis/optimis
163
+ # tic-concurrency) control. For more information, see [Delete a customer
164
+ # profile](https://developer.squareup.com/docs/customers-api/use-the-api/kee
165
+ # p-records#delete-customer-profile).
155
166
  # @return [DeleteCustomerResponse Hash] response from the API call
156
- def delete_customer(customer_id:)
167
+ def delete_customer(customer_id:,
168
+ version: nil)
157
169
  # Prepare query url.
158
170
  _query_builder = config.get_base_uri
159
171
  _query_builder << '/v2/customers/{customer_id}'
@@ -161,6 +173,10 @@ module Square
161
173
  _query_builder,
162
174
  'customer_id' => { 'value' => customer_id, 'encode' => true }
163
175
  )
176
+ _query_builder = APIHelper.append_url_with_query_parameters(
177
+ _query_builder,
178
+ 'version' => version
179
+ )
164
180
  _query_url = APIHelper.clean_url _query_builder
165
181
 
166
182
  # Prepare headers.
@@ -219,16 +235,21 @@ module Square
219
235
  )
220
236
  end
221
237
 
222
- # Updates the details of an existing customer. When two profiles are merged
223
- # into a single profile, that profile is assigned a new `customer_id`. You
224
- # must use
225
- # the new `customer_id` to update merged profiles.
226
- # You cannot edit a customer's cards on file with this endpoint. To make
227
- # changes
228
- # to a card on file, you must delete the existing card on file with the
229
- # [DeleteCustomerCard](#endpoint-Customers-deletecustomercard) endpoint,
230
- # then create a new one with the
231
- # [CreateCustomerCard](#endpoint-Customers-createcustomercard) endpoint.
238
+ # Updates a customer profile. To change an attribute, specify the new value.
239
+ # To remove an attribute, specify the value as an empty string or empty
240
+ # object.
241
+ # As a best practice, you should include the `version` field in the request
242
+ # to enable [optimistic
243
+ # concurrency](https://developer.squareup.com/docs/working-with-apis/optimis
244
+ # tic-concurrency) control. The value must be set to the current version of
245
+ # the customer profile.
246
+ # To update a customer profile that was created by merging existing
247
+ # profiles, you must use the ID of the newly created profile.
248
+ # You cannot use this endpoint to change cards on file. To change a card on
249
+ # file, call [DeleteCustomerCard]($e/Customers/DeleteCustomerCard) to delete
250
+ # the existing card and then call
251
+ # [CreateCustomerCard]($e/Customers/CreateCustomerCard) to create a new
252
+ # card.
232
253
  # @param [String] customer_id Required parameter: The ID of the customer to
233
254
  # update.
234
255
  # @param [UpdateCustomerRequest] body Required parameter: An object