Skip to content

Commit 0846994

Browse files
authored
Merge pull request #82 from square/release/17.1.0.20220120
Generated PR for Release: 17.1.0.20220120
2 parents dee4a02 + f5786c2 commit 0846994

113 files changed

Lines changed: 1277 additions & 628 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Change Log
22

3+
For general API and SDK changelogs, see [Square APIs and SDKs Release Notes](https://developer.squareup.com/docs/changelog/connect).
4+
35
## Version 17.0.0.20211215 (2021-12-15)
46
### API updates
57

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021 Square, Inc.
1+
Copyright 2022 Square, Inc.
22
Licensed under the Apache License, Version 2.0 (the "License");
33
you may not use this file except in compliance with the License.
44
You may obtain a copy of the License at

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ python setup.py install --user
3131
In Python 2, you can install via pip:
3232

3333
```sh
34-
pip install -r requirement.txt
34+
pip install -r requirements.txt
3535
pip install -r test-requirements.txt
3636
```
3737

doc/api/bookings.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ bookings_api = client.bookings
2525

2626
Retrieve a collection of bookings.
2727

28+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.
29+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
30+
2831
```python
2932
def list_bookings(self,
3033
limit=None,
@@ -73,6 +76,9 @@ elif result.is_error():
7376

7477
Creates a booking.
7578

79+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.
80+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.
81+
7682
```python
7783
def create_booking(self,
7884
body)
@@ -113,6 +119,9 @@ elif result.is_error():
113119

114120
Searches for availabilities for booking.
115121

122+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.
123+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
124+
116125
```python
117126
def search_availability(self,
118127
body)
@@ -206,8 +215,8 @@ def list_team_member_booking_profiles(self,
206215
| Parameter | Type | Tags | Description |
207216
| --- | --- | --- | --- |
208217
| `bookable_only` | `bool` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).<br>**Default**: `False` |
209-
| `limit` | `int` | Query, Optional | The maximum number of results to return. |
210-
| `cursor` | `string` | Query, Optional | The cursor for paginating through the results. |
218+
| `limit` | `int` | Query, Optional | The maximum number of results to return in a paged response. |
219+
| `cursor` | `string` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
211220
| `location_id` | `string` | Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. |
212221

213222
## Response Type
@@ -268,6 +277,9 @@ elif result.is_error():
268277

269278
Retrieves a booking.
270279

280+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.
281+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
282+
271283
```python
272284
def retrieve_booking(self,
273285
booking_id)
@@ -301,6 +313,9 @@ elif result.is_error():
301313

302314
Updates a booking.
303315

316+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.
317+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.
318+
304319
```python
305320
def update_booking(self,
306321
booking_id,
@@ -344,6 +359,9 @@ elif result.is_error():
344359

345360
Cancels an existing booking.
346361

362+
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.
363+
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.
364+
347365
```python
348366
def cancel_booking(self,
349367
booking_id,

doc/api/checkout.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ body['pre_populate_shipping_address']['sublocality'] = 'sublocality0'
160160
body['pre_populate_shipping_address']['administrative_district_level_1'] = 'CA'
161161
body['pre_populate_shipping_address']['postal_code'] = '94103'
162162
body['pre_populate_shipping_address']['country'] = 'US'
163-
body['pre_populate_shipping_address']['first_name'] = 'Jane'
164-
body['pre_populate_shipping_address']['last_name'] = 'Doe'
165163
body['redirect_url'] = 'https://merchant.website.com/order-confirm'
166164
body['additional_recipients'] = []
167165

doc/api/locations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locations_api = client.locations
1818

1919
# List Locations
2020

21-
Provides details about all of the seller's locations,
21+
Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api),
2222
including those with an inactive status.
2323

2424
```python
@@ -131,7 +131,7 @@ elif result.is_error():
131131

132132
# Update Location
133133

134-
Updates a location.
134+
Updates a [location](https://developer.squareup.com/docs/locations-api).
135135

136136
```python
137137
def update_location(self,

doc/api/loyalty.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ Adds points to a loyalty account.
164164
[CalculateLoyaltyPoints](/doc/api/loyalty.md#calculate-loyalty-points) to compute the points
165165
that you provide to this endpoint.
166166

167-
__Note:__ The country of the seller's Square account determines whether tax is included in the purchase amount when accruing points for spend-based and visit-based programs.
168-
For more information, see [Availability of Square Loyalty](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability).
169-
170167
```python
171168
def accumulate_loyalty_points(self,
172169
account_id,
@@ -374,16 +371,15 @@ elif result.is_error():
374371

375372
Calculates the points a purchase earns.
376373

377-
- If you are using the Orders API to manage orders, you provide `order_id` in the request. The
374+
- If you are using the Orders API to manage orders, you provide the `order_id` in the request. The
378375
endpoint calculates the points by reading the order.
379376
- If you are not using the Orders API to manage orders, you provide the purchase amount in
380377
the request for the endpoint to calculate the points.
381378

382379
An application might call this endpoint to show the points that a buyer can earn with the
383380
specific purchase.
384381

385-
__Note:__ The country of the seller's Square account determines whether tax is included in the purchase amount when accruing points for spend-based and visit-based programs.
386-
For more information, see [Availability of Square Loyalty](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability).
382+
For spend-based and visit-based programs, the `tax_mode` setting of the accrual rule indicates how taxes should be treated for loyalty points accrual.
387383

388384
```python
389385
def calculate_loyalty_points(self,

doc/api/refunds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def list_payment_refunds(self,
4646
| `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><br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). |
4747
| `location_id` | `string` | Query, Optional | Limit results to the location supplied. By default, results are returned<br>for all locations associated with the seller. |
4848
| `status` | `string` | Query, Optional | If provided, only refunds with the given status are returned.<br>For a list of refund status values, see [PaymentRefund](/doc/models/payment-refund.md).<br><br>Default: If omitted, refunds are returned regardless of their status. |
49-
| `source_type` | `string` | Query, Optional | If provided, only refunds with the given source type are returned.<br><br>- `CARD` - List refunds only for payments where `CARD` was specified as the payment<br> source.<br><br>Default: If omitted, refunds are returned regardless of the source type. |
49+
| `source_type` | `string` | Query, Optional | If provided, only returns refunds whose payments have the indicated source type.<br>Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.<br>For information about these payment source types, see<br>[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).<br><br>Default: If omitted, refunds are returned regardless of the source type. |
5050
| `limit` | `int` | Query, Optional | The maximum number of results to be returned in a single page.<br><br>It is possible to receive fewer results than the specified limit on a given page.<br><br>If the supplied value is greater than 100, no more than 100 results are returned.<br><br>Default: 100 |
5151

5252
## Response Type

doc/client.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `square_version` | `string` | Square Connect API versions<br>*Default*: `'2021-12-15'` |
9-
| `access_token` | `string` | The OAuth 2.0 Access Token to use for API requests. |
8+
| `square_version` | `string` | Square Connect API versions<br>*Default*: `'2022-01-20'` |
109
| `custom_url` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1110
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1211
| `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests |
@@ -25,8 +24,7 @@ The API client can be initialized as follows:
2524
from square.client import Client
2625

2726
client = Client(
28-
square_version='2021-12-15',
29-
access_token='AccessToken',
27+
square_version='2022-01-20',
3028
environment='production',
3129
custom_url = 'https://connect.squareup.com',)
3230
```
@@ -50,8 +48,7 @@ API calls return an `ApiResponse` object that includes the following fields:
5048
from square.client import Client
5149

5250
client = Client(
53-
square_version='2021-12-15',
54-
access_token='AccessToken',)
51+
square_version='2022-01-20',)
5552

5653
locations_api = client.locations
5754
result = locations_api.list_locations()

doc/models/address.md

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,8 @@
11

22
# Address
33

4-
Represents a postal address in a country. The address format is based
5-
on an [open-source library from Google](https://github.com/google/libaddressinput). For more information,
6-
see [AddressValidationMetadata](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata).
7-
This format has dedicated fields for four address components: postal code,
8-
locality (city), administrative district (state, prefecture, or province), and
9-
sublocality (town or village). These components have dedicated fields in the
10-
`Address` object because software sometimes behaves differently based on them.
11-
For example, sales tax software may charge different amounts of sales tax
12-
based on the postal code, and some software is only available in
13-
certain states due to compliance reasons.
14-
15-
For the remaining address components, the `Address` type provides the
16-
`address_line_1` and `address_line_2` fields for free-form data entry.
17-
These fields are free-form because the remaining address components have
18-
too many variations around the world and typical software does not parse
19-
these components. These fields enable users to enter anything they want.
20-
21-
Note that, in the current implementation, all other `Address` type fields are blank.
22-
These include `address_line_3`, `sublocality_2`, `sublocality_3`,
23-
`administrative_district_level_2`, `administrative_district_level_3`,
24-
`first_name`, `last_name`, and `organization`.
25-
26-
When it comes to localization, the seller's language preferences
27-
(see [Language preferences](https://developer.squareup.com/docs/locations-api#location-specific-and-seller-level-language-preferences))
28-
are ignored for addresses. Even though Square products (such as Square Point of Sale
29-
and the Seller Dashboard) mostly use a seller's language preference in
30-
communication, when it comes to addresses, they will use English for a US address,
31-
Japanese for an address in Japan, and so on.
4+
Represents a postal address in a country.
5+
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
326

337
## Structure
348

@@ -41,18 +15,11 @@ Japanese for an address in Japan, and so on.
4115
| `address_line_1` | `string` | Optional | The first line of the address.<br><br>Fields that start with `address_line` provide the address's most specific<br>details, like street number, street name, and building name. They do *not*<br>provide less specific details like city, state/province, or country (these<br>details are provided in other fields). |
4216
| `address_line_2` | `string` | Optional | The second line of the address, if any. |
4317
| `address_line_3` | `string` | Optional | The third line of the address, if any. |
44-
| `locality` | `string` | Optional | The city or town of the address. |
18+
| `locality` | `string` | Optional | The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
4519
| `sublocality` | `string` | Optional | A civil region within the address's `locality`, if any. |
46-
| `sublocality_2` | `string` | Optional | A civil region within the address's `sublocality`, if any. |
47-
| `sublocality_3` | `string` | Optional | A civil region within the address's `sublocality_2`, if any. |
48-
| `administrative_district_level_1` | `string` | Optional | A civil entity within the address's country. In the US, this<br>is the state. |
49-
| `administrative_district_level_2` | `string` | Optional | A civil entity within the address's `administrative_district_level_1`.<br>In the US, this is the county. |
50-
| `administrative_district_level_3` | `string` | Optional | A civil entity within the address's `administrative_district_level_2`,<br>if any. |
51-
| `postal_code` | `string` | Optional | The address's postal code. |
20+
| `administrative_district_level_1` | `string` | Optional | A civil entity within the address's country. In the US, this<br>is the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
21+
| `postal_code` | `string` | Optional | The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
5222
| `country` | [`str (Country)`](/doc/models/country.md) | Optional | Indicates the country associated with another entity, such as a business.<br>Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). |
53-
| `first_name` | `string` | Optional | Optional first name when it's representing recipient. |
54-
| `last_name` | `string` | Optional | Optional last name when it's representing recipient. |
55-
| `organization` | `string` | Optional | Optional organization name when it's representing recipient. |
5623

5724
## Example (as JSON)
5825

0 commit comments

Comments
 (0)