Skip to content

Commit c4a8749

Browse files
authored
Merge pull request #128 from square/release/35.0.0.20240222
Generated PR for Release: 35.0.0.20240222
2 parents ad8dd22 + e1f76eb commit c4a8749

File tree

106 files changed

+1417
-1858
lines changed

Some content is hidden

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

106 files changed

+1417
-1858
lines changed

doc/api/checkout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def list_payment_links(self,
311311

312312
| Parameter | Type | Tags | Description |
313313
| --- | --- | --- | --- |
314-
| `cursor` | `str` | 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). |
314+
| `cursor` | `str` | 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). |
315315
| `limit` | `int` | 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` |
316316

317317
## 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)
@@ -128,6 +132,221 @@ elif result.is_error():
128132
```
129133

130134

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

133352
Searches the customer profiles associated with a Square account using one or more supported query filters.
@@ -202,9 +421,6 @@ elif result.is_error():
202421

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

205-
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.
206-
If included, the value must be set to the current version of the customer profile.
207-
208424
To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
209425

210426
```python
@@ -276,11 +492,7 @@ elif result.is_error():
276492
# Update Customer
277493

278494
Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request.
279-
To add or update a field, specify the new value. To remove a field, specify `null`
280-
(recommended) or specify an empty string (string fields only).
281-
282-
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.
283-
If included, the value must be set to the current version of the customer profile.
495+
To add or update a field, specify the new value. To remove a field, specify `null`.
284496

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

@@ -310,7 +522,7 @@ customer_id = 'customer_id8'
310522

311523
body = {
312524
'email_address': '[email protected]',
313-
'phone_number': '',
525+
'phone_number': 'phone_number2',
314526
'note': 'updated customer note',
315527
'version': 2
316528
}

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
```python
491494
def publish_invoice(self,
492495
invoice_id,

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
```python
2525
def list_locations(self)

0 commit comments

Comments
 (0)