Skip to content

Commit c5b6084

Browse files
author
Xiao Hu
authored
Merge pull request #80 from square/release/16.0.0.20211117
Generated PR for Release: 16.0.0.20211117
2 parents 15193d0 + a5be2c4 commit c5b6084

119 files changed

Lines changed: 1348 additions & 396 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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Change Log
22

3+
## Version 16.0.0.20211117 (2021-11-17)
4+
## API updates
5+
6+
* **Cards API.** The [Card](https://developer.squareup.com/reference/square_2021-11-17/objects/card) object and webhook response body for all webhooks are updated updated with fields.
7+
* Added the [Card.merchant_id](https://developer.squareup.com/reference/square_2021-11-17/objects/Card#definition__property-merchant_id) field to identify the Square seller that stored the payment card on file.
8+
* Added a [Card](https://developer.squareup.com/reference/square_2021-11-17/objects/Card) object to the response bodies of all [Cards API webhooks](https://developer.squareup.com/docs/webhooks/v2webhook-events-tech-ref#cards-api). The `Card` is added as a child of the `data.object` field in all webhook responses.
9+
10+
* **Bookings API.** The new [ListBookings](https://developer.squareup.com/reference/square_2021-11-17/bookings-api/list-bookings) endpoint supports browsing a collection of bookings of a seller. For more information, see [Use the Bookings API: list bookings.](https://developer.squareup.com/docs/bookings-api/use-the-api#list-bookings)
11+
12+
* **Subscriptions API.** Introduced the new [actions framework](https://developer.squareup.com/docs/subscriptions-api/overview#subscriptions-actions-overview) representing scheduled, future changes to subscriptions.
13+
* The new [PauseSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/pause-subscription) endpoint supports temporarily pausing a subscription. Calling this endpoint schedules a new `PAUSE` action.
14+
* The new [SwapPlan](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/swap-plan) endpoint supports changing the subscription plan associated with a single customer. Calling this endpoint schedules a new `SWAP_PLAN` action.
15+
* The new [DeleteSubscriptionAction](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/delete-subscription-action) endpoint supports deleting a scheduled action.
16+
* The [ResumeSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/resume-subscription) endpoint has been updated to support resuming a paused subscription. Calling this endpoint schedules a new `RESUME` action.
17+
* The [CancelSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/cancel-subscription) endpoint now schedules a new `CANCEL` action.
18+
* Added an optional `include` body parameter to the [SearchSubscriptions](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/search-subscriptions) endpoint. Include `actions` in the request to return all [actions](https://developer.squareup.com/docs/subscriptions-api/overview#subscriptions-actions-overview) associated with the subscriptions.
19+
20+
## Documentation Update
21+
22+
* **Migration Guides.**
23+
* [Migrate from the Connect V1 Refunds API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-refunds) The topic is updated to include information to migrate from the v1 ListRefunds endpoint to the appropriate Square API counterparts.
24+
* [Migrate from the Connect V1 Payments API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-payments) The topic provides developers information to migrate from the Connect V1 Payments API to the appropriate Square API counterparts.
25+
26+
Code that relies on these V1 API endpoints must be updated to avoid breaking when these APIs reach retirement.
27+
28+
329
## Version 15.0.0.20211020 (2021-10-20)
430
## API updates
531
* **Transactions API.** Three previously deprecated endpoints (`ListRefunds`, `Charge`, and `CreateRefund`) in the [Transactions API](https://developer.squareup.com/reference/square_2021-10-20/transactions-api) are removed from Square API version 2021-10-20 and later. These endpoints will work if you are using Square API versions prior to 2021-10-20. However, these endpoints will eventually be retired from all Square versions.

doc/api/bookings.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ bookings_api = client.bookings
1010

1111
## Methods
1212

13+
* [List Bookings](/doc/api/bookings.md#list-bookings)
1314
* [Create Booking](/doc/api/bookings.md#create-booking)
1415
* [Search Availability](/doc/api/bookings.md#search-availability)
1516
* [Retrieve Business Booking Profile](/doc/api/bookings.md#retrieve-business-booking-profile)
@@ -20,6 +21,54 @@ bookings_api = client.bookings
2021
* [Cancel Booking](/doc/api/bookings.md#cancel-booking)
2122

2223

24+
# List Bookings
25+
26+
Retrieve a collection of bookings.
27+
28+
```python
29+
def list_bookings(self,
30+
limit=None,
31+
cursor=None,
32+
team_member_id=None,
33+
location_id=None,
34+
start_at_min=None,
35+
start_at_max=None)
36+
```
37+
38+
## Parameters
39+
40+
| Parameter | Type | Tags | Description |
41+
| --- | --- | --- | --- |
42+
| `limit` | `int` | Query, Optional | The maximum number of results per page to return in a paged response. |
43+
| `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. |
44+
| `team_member_id` | `string` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
45+
| `location_id` | `string` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
46+
| `start_at_min` | `string` | Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. |
47+
| `start_at_max` | `string` | Query, Optional | The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. |
48+
49+
## Response Type
50+
51+
[`List Bookings Response`](/doc/models/list-bookings-response.md)
52+
53+
## Example Usage
54+
55+
```python
56+
limit = 172
57+
cursor = 'cursor6'
58+
team_member_id = 'team_member_id0'
59+
location_id = 'location_id4'
60+
start_at_min = 'start_at_min8'
61+
start_at_max = 'start_at_max8'
62+
63+
result = bookings_api.list_bookings(limit, cursor, team_member_id, location_id, start_at_min, start_at_max)
64+
65+
if result.is_success():
66+
print(result.body)
67+
elif result.is_error():
68+
print(result.errors)
69+
```
70+
71+
2372
# Create Booking
2473

2574
Creates a booking.

doc/api/disputes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def list_disputes(self,
4848

4949
```python
5050
cursor = 'cursor6'
51-
states = 'EVIDENCE_REQUIRED'
51+
states = 'INQUIRY_EVIDENCE_REQUIRED'
5252
location_id = 'location_id4'
5353

5454
result = disputes_api.list_disputes(cursor, states, location_id)

doc/api/gift-card-activities.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def list_gift_card_activities(self,
3737

3838
| Parameter | Type | Tags | Description |
3939
| --- | --- | --- | --- |
40-
| `gift_card_id` | `string` | Query, Optional | If you provide a gift card ID, the endpoint returns activities that belong<br>to the specified gift card. Otherwise, the endpoint returns all gift card activities for<br>the seller. |
41-
| `mtype` | `string` | Query, Optional | If you provide a type, the endpoint returns gift card activities of this type.<br>Otherwise, the endpoint returns all types of gift card activities. |
42-
| `location_id` | `string` | Query, Optional | If you provide a location ID, the endpoint returns gift card activities for that location.<br>Otherwise, the endpoint returns gift card activities for all locations. |
43-
| `begin_time` | `string` | Query, Optional | The timestamp for the beginning of the reporting period, in RFC 3339 format.<br>Inclusive. Default: The current time minus one year. |
44-
| `end_time` | `string` | Query, Optional | The timestamp for the end of the reporting period, in RFC 3339 format.<br>Inclusive. Default: The current time. |
45-
| `limit` | `int` | Query, Optional | If you provide a limit value, the endpoint returns the specified number<br>of results (or less) per page. A maximum value is 100. The default value is 50. |
46-
| `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 you do not provide the cursor, the call returns the first page of the results. |
40+
| `gift_card_id` | `string` | Query, Optional | If a gift card ID is provided, the endpoint returns activities related<br>to the specified gift card. Otherwise, the endpoint returns all gift card activities for<br>the seller. |
41+
| `mtype` | `string` | Query, Optional | If a [type](/doc/models/gift-card-activity-type.md) is provided, the endpoint returns gift card activities of the specified type.<br>Otherwise, the endpoint returns all types of gift card activities. |
42+
| `location_id` | `string` | Query, Optional | If a location ID is provided, the endpoint returns gift card activities for the specified location.<br>Otherwise, the endpoint returns gift card activities for all locations. |
43+
| `begin_time` | `string` | Query, Optional | The timestamp for the beginning of the reporting period, in RFC 3339 format.<br>This start time is inclusive. The default value is the current time minus one year. |
44+
| `end_time` | `string` | Query, Optional | The timestamp for the end of the reporting period, in RFC 3339 format.<br>This end time is inclusive. The default value is the current time. |
45+
| `limit` | `int` | Query, Optional | If a limit is provided, the endpoint returns the specified number<br>of results (or fewer) per page. The maximum value is 100. The default value is 50.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
46+
| `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/working-with-apis/pagination). |
4747
| `sort_order` | `string` | Query, Optional | The order in which the endpoint returns the activities, based on `created_at`.<br><br>- `ASC` - Oldest to newest.<br>- `DESC` - Newest to oldest (default). |
4848

4949
## Response Type

doc/api/gift-cards.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def list_gift_cards(self,
3737

3838
| Parameter | Type | Tags | Description |
3939
| --- | --- | --- | --- |
40-
| `mtype` | `string` | Query, Optional | If a type is provided, gift cards of this type are returned<br>(see [GiftCardType](/doc/models/gift-card-type.md)).<br>If no type is provided, it returns gift cards of all types. |
41-
| `state` | `string` | Query, Optional | If the state is provided, it returns the gift cards in the specified state<br>(see [GiftCardStatus](/doc/models/gift-card-status.md)).<br>Otherwise, it returns the gift cards of all states. |
42-
| `limit` | `int` | Query, Optional | If a value is provided, it returns only that number of results per page.<br>The maximum number of results allowed per page is 50. The default value is 30. |
43-
| `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, it returns the first page of the results.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
44-
| `customer_id` | `string` | Query, Optional | If a value is provided, returns only the gift cards linked to the specified customer |
40+
| `mtype` | `string` | Query, Optional | If a [type](/doc/models/gift-card-type.md) is provided, the endpoint returns gift cards of the specified type.<br>Otherwise, the endpoint returns gift cards of all types. |
41+
| `state` | `string` | Query, Optional | If a [state](/doc/models/gift-card-status.md) is provided, the endpoint returns the gift cards in the specified state.<br>Otherwise, the endpoint returns the gift cards of all states. |
42+
| `limit` | `int` | Query, Optional | If a limit is provided, the endpoint returns only the specified number of results per page.<br>The maximum value is 50. The default value is 30.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
43+
| `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/working-with-apis/pagination). |
44+
| `customer_id` | `string` | Query, Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. |
4545

4646
## Response Type
4747

@@ -147,7 +147,7 @@ elif result.is_error():
147147

148148
# Retrieve Gift Card From Nonce
149149

150-
Retrieves a gift card using a nonce (a secure token) that represents the gift card.
150+
Retrieves a gift card using a secure payment token that represents the gift card.
151151

152152
```python
153153
def retrieve_gift_card_from_nonce(self,
@@ -181,7 +181,7 @@ elif result.is_error():
181181

182182
# Link Customer to Gift Card
183183

184-
Links a customer to a gift card
184+
Links a customer to a gift card, which is also referred to as adding a card on file.
185185

186186
```python
187187
def link_customer_to_gift_card(self,
@@ -193,7 +193,7 @@ def link_customer_to_gift_card(self,
193193

194194
| Parameter | Type | Tags | Description |
195195
| --- | --- | --- | --- |
196-
| `gift_card_id` | `string` | Template, Required | The ID of the gift card to link. |
196+
| `gift_card_id` | `string` | Template, Required | The ID of the gift card to be linked. |
197197
| `body` | [`Link Customer to Gift Card Request`](/doc/models/link-customer-to-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
198198

199199
## Response Type
@@ -218,7 +218,7 @@ elif result.is_error():
218218

219219
# Unlink Customer From Gift Card
220220

221-
Unlinks a customer from a gift card
221+
Unlinks a customer from a gift card, which is also referred to as removing a card on file.
222222

223223
```python
224224
def unlink_customer_from_gift_card(self,
@@ -230,7 +230,7 @@ def unlink_customer_from_gift_card(self,
230230

231231
| Parameter | Type | Tags | Description |
232232
| --- | --- | --- | --- |
233-
| `gift_card_id` | `string` | Template, Required | - |
233+
| `gift_card_id` | `string` | Template, Required | The ID of the gift card to be unlinked. |
234234
| `body` | [`Unlink Customer From Gift Card Request`](/doc/models/unlink-customer-from-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
235235

236236
## Response Type

doc/api/sites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sites_api = client.sites
1111

1212
# List Sites
1313

14-
Lists the Square Online sites that belong to a seller.
14+
Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date.
1515

1616
__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
1717

0 commit comments

Comments
 (0)