Skip to content

Commit 916438f

Browse files
authored
Merge pull request #128 from square/release/36.0.0.20240222
Generated PR for Release: 36.0.0.20240222
2 parents 66cd8d7 + 5f86885 commit 916438f

File tree

72 files changed

+1320
-1589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1320
-1589
lines changed

doc/api/checkout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def list_payment_links(cursor: nil,
310310

311311
| Parameter | Type | Tags | Description |
312312
| --- | --- | --- | --- |
313-
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>If a cursor is not provided, the endpoint returns the first page of the results.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). |
313+
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>If a cursor is not provided, the endpoint returns the first page of the results.<br>For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
314314
| `limit` | `Integer` | Query, Optional | A limit on the number of results to return per page. The limit is advisory and<br>the implementation might return more or less results. If the supplied limit is negative, zero, or<br>greater than the maximum limit of 1000, it is ignored.<br><br>Default value: `100` |
315315

316316
## Response Type

doc/api/customers.md

Lines changed: 221 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ customers_api = client.customers
1212

1313
* [List Customers](../../doc/api/customers.md#list-customers)
1414
* [Create Customer](../../doc/api/customers.md#create-customer)
15+
* [Bulk Create Customers](../../doc/api/customers.md#bulk-create-customers)
16+
* [Bulk Delete Customers](../../doc/api/customers.md#bulk-delete-customers)
17+
* [Bulk Retrieve Customers](../../doc/api/customers.md#bulk-retrieve-customers)
18+
* [Bulk Update Customers](../../doc/api/customers.md#bulk-update-customers)
1519
* [Search Customers](../../doc/api/customers.md#search-customers)
1620
* [Delete Customer](../../doc/api/customers.md#delete-customer)
1721
* [Retrieve Customer](../../doc/api/customers.md#retrieve-customer)
@@ -126,6 +130,221 @@ end
126130
```
127131

128132

133+
# Bulk Create Customers
134+
135+
Creates multiple [customer profiles](../../doc/models/customer.md) for a business.
136+
137+
This endpoint takes a map of individual create requests and returns a map of responses.
138+
139+
You must provide at least one of the following values in each create request:
140+
141+
- `given_name`
142+
- `family_name`
143+
- `company_name`
144+
- `email_address`
145+
- `phone_number`
146+
147+
```ruby
148+
def bulk_create_customers(body:)
149+
```
150+
151+
## Parameters
152+
153+
| Parameter | Type | Tags | Description |
154+
| --- | --- | --- | --- |
155+
| `body` | [`Bulk Create Customers Request Hash`](../../doc/models/bulk-create-customers-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
156+
157+
## Response Type
158+
159+
This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Create Customers Response Hash`](../../doc/models/bulk-create-customers-response.md).
160+
161+
## Example Usage
162+
163+
```ruby
164+
body = {
165+
:customers => {
166+
'8bb76c4f-e35d-4c5b-90de-1194cd9179f0': {
167+
:given_name => 'Amelia',
168+
:family_name => 'Earhart',
169+
:email_address => '[email protected]',
170+
:address => {
171+
:address_line_1 => '500 Electric Ave',
172+
:address_line_2 => 'Suite 600',
173+
:locality => 'New York',
174+
:administrative_district_level_1 => 'NY',
175+
:postal_code => '10003',
176+
:country => 'US'
177+
},
178+
:phone_number => '+1-212-555-4240',
179+
:reference_id => 'YOUR_REFERENCE_ID',
180+
:note => 'a customer'
181+
},
182+
'd1689f23-b25d-4932-b2f0-aed00f5e2029': {
183+
:given_name => 'Marie',
184+
:family_name => 'Curie',
185+
:email_address => '[email protected]',
186+
:address => {
187+
:address_line_1 => '500 Electric Ave',
188+
:address_line_2 => 'Suite 601',
189+
:locality => 'New York',
190+
:administrative_district_level_1 => 'NY',
191+
:postal_code => '10003',
192+
:country => 'US'
193+
},
194+
:phone_number => '+1-212-444-4240',
195+
:reference_id => 'YOUR_REFERENCE_ID',
196+
:note => 'another customer'
197+
}
198+
}
199+
}
200+
201+
202+
result = customers_api.bulk_create_customers(body: body)
203+
204+
if result.success?
205+
puts result.data
206+
elsif result.error?
207+
warn result.errors
208+
end
209+
```
210+
211+
212+
# Bulk Delete Customers
213+
214+
Deletes multiple customer profiles.
215+
216+
The endpoint takes a list of customer IDs and returns a map of responses.
217+
218+
```ruby
219+
def bulk_delete_customers(body:)
220+
```
221+
222+
## Parameters
223+
224+
| Parameter | Type | Tags | Description |
225+
| --- | --- | --- | --- |
226+
| `body` | [`Bulk Delete Customers Request Hash`](../../doc/models/bulk-delete-customers-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
227+
228+
## Response Type
229+
230+
This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Delete Customers Response Hash`](../../doc/models/bulk-delete-customers-response.md).
231+
232+
## Example Usage
233+
234+
```ruby
235+
body = {
236+
:customer_ids => [
237+
'8DDA5NZVBZFGAX0V3HPF81HHE0',
238+
'N18CPRVXR5214XPBBA6BZQWF3C',
239+
'2GYD7WNXF7BJZW1PMGNXZ3Y8M8'
240+
]
241+
}
242+
243+
244+
result = customers_api.bulk_delete_customers(body: body)
245+
246+
if result.success?
247+
puts result.data
248+
elsif result.error?
249+
warn result.errors
250+
end
251+
```
252+
253+
254+
# Bulk Retrieve Customers
255+
256+
Retrieves multiple customer profiles.
257+
258+
This endpoint takes a list of customer IDs and returns a map of responses.
259+
260+
```ruby
261+
def bulk_retrieve_customers(body:)
262+
```
263+
264+
## Parameters
265+
266+
| Parameter | Type | Tags | Description |
267+
| --- | --- | --- | --- |
268+
| `body` | [`Bulk Retrieve Customers Request Hash`](../../doc/models/bulk-retrieve-customers-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
269+
270+
## Response Type
271+
272+
This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Retrieve Customers Response Hash`](../../doc/models/bulk-retrieve-customers-response.md).
273+
274+
## Example Usage
275+
276+
```ruby
277+
body = {
278+
:customer_ids => [
279+
'8DDA5NZVBZFGAX0V3HPF81HHE0',
280+
'N18CPRVXR5214XPBBA6BZQWF3C',
281+
'2GYD7WNXF7BJZW1PMGNXZ3Y8M8'
282+
]
283+
}
284+
285+
286+
result = customers_api.bulk_retrieve_customers(body: body)
287+
288+
if result.success?
289+
puts result.data
290+
elsif result.error?
291+
warn result.errors
292+
end
293+
```
294+
295+
296+
# Bulk Update Customers
297+
298+
Updates multiple customer profiles.
299+
300+
This endpoint takes a map of individual update requests and returns a map of responses.
301+
302+
You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/api/cards.md) or [Gift Cards API](../../doc/api/gift-cards.md).
303+
304+
```ruby
305+
def bulk_update_customers(body:)
306+
```
307+
308+
## Parameters
309+
310+
| Parameter | Type | Tags | Description |
311+
| --- | --- | --- | --- |
312+
| `body` | [`Bulk Update Customers Request Hash`](../../doc/models/bulk-update-customers-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
313+
314+
## Response Type
315+
316+
This method returns a `\ApiResponse` instance. The `data` property in this instance returns the response data which is of type [`Bulk Update Customers Response Hash`](../../doc/models/bulk-update-customers-response.md).
317+
318+
## Example Usage
319+
320+
```ruby
321+
body = {
322+
:customers => {
323+
'8DDA5NZVBZFGAX0V3HPF81HHE0': {
324+
:email_address => '[email protected]',
325+
:phone_number => 'phone_number2',
326+
:note => 'updated customer note',
327+
:version => 2
328+
},
329+
'N18CPRVXR5214XPBBA6BZQWF3C': {
330+
:given_name => 'Marie',
331+
:family_name => 'Curie',
332+
:version => 0
333+
}
334+
}
335+
}
336+
337+
338+
result = customers_api.bulk_update_customers(body: body)
339+
340+
if result.success?
341+
puts result.data
342+
elsif result.error?
343+
warn result.errors
344+
end
345+
```
346+
347+
129348
# Search Customers
130349

131350
Searches the customer profiles associated with a Square account using one or more supported query filters.
@@ -200,9 +419,6 @@ end
200419

201420
Deletes a customer profile from a business. This operation also unlinks any associated cards on file.
202421

203-
As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control.
204-
If included, the value must be set to the current version of the customer profile.
205-
206422
To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
207423

208424
```ruby
@@ -274,11 +490,7 @@ end
274490
# Update Customer
275491

276492
Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request.
277-
To add or update a field, specify the new value. To remove a field, specify `null`
278-
(recommended) or specify an empty string (string fields only).
279-
280-
As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control.
281-
If included, the value must be set to the current version of the customer profile.
493+
To add or update a field, specify the new value. To remove a field, specify `null`.
282494

283495
To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
284496

@@ -307,7 +519,7 @@ customer_id = 'customer_id8'
307519

308520
body = {
309521
:email_address => '[email protected]',
310-
:phone_number => '',
522+
:phone_number => 'phone_number2',
311523
:note => 'updated customer note',
312524
:version => 2
313525
}

doc/api/invoices.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,12 @@ nothing. Square also makes the invoice available on a Square-hosted invoice page
484484

485485
The invoice `status` also changes from `DRAFT` to a status
486486
based on the invoice configuration. For example, the status changes to `UNPAID` if
487-
Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the
487+
Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the
488488
invoice amount.
489489

490+
In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`
491+
and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments.
492+
490493
```ruby
491494
def publish_invoice(invoice_id:,
492495
body:)

doc/api/locations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locations_api = client.locations
1919
# List Locations
2020

2121
Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),
22-
including those with an inactive status.
22+
including those with an inactive status. Locations are listed alphabetically by `name`.
2323

2424
```ruby
2525
def list_locations

0 commit comments

Comments
 (0)