Skip to content

Commit 475cd33

Browse files
author
Xiao Hu
authored
Merge pull request #66 from square/release/17.0.0.20211117
Generated PR for Release: 17.0.0.20211117
2 parents dc02d72 + 68ce2be commit 475cd33

File tree

166 files changed

+3896
-669
lines changed

Some content is hidden

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

166 files changed

+3896
-669
lines changed

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 17.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 16.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.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Install the client dynamically by adding a dependency to the POM for your projec
3333
<dependency>
3434
<groupId>com.squareup</groupId>
3535
<artifactId>square</artifactId>
36-
<version>16.0.0.20211020</version>
36+
<version>17.0.0.20211117</version>
3737
</dependency>
3838
```
3939

@@ -42,7 +42,7 @@ Install the client dynamically by adding a dependency to the POM for your projec
4242
Install the client by adding the following dependency to the build file for your project:
4343

4444
```
45-
implementation "com.squareup:square:16.0.0.20211020"
45+
implementation "com.squareup:square:17.0.0.20211117"
4646
```
4747

4848
## API documentation

doc/api/bookings.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ BookingsApi bookingsApi = client.getBookingsApi();
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 @@ BookingsApi bookingsApi = client.getBookingsApi();
2021
* [Cancel Booking](/doc/api/bookings.md#cancel-booking)
2122

2223

24+
# List Bookings
25+
26+
Retrieve a collection of bookings.
27+
28+
```java
29+
CompletableFuture<ListBookingsResponse> listBookingsAsync(
30+
final Integer limit,
31+
final String cursor,
32+
final String teamMemberId,
33+
final String locationId,
34+
final String startAtMin,
35+
final String startAtMax)
36+
```
37+
38+
## Parameters
39+
40+
| Parameter | Type | Tags | Description |
41+
| --- | --- | --- | --- |
42+
| `limit` | `Integer` | 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+
| `teamMemberId` | `String` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
45+
| `locationId` | `String` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
46+
| `startAtMin` | `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+
| `startAtMax` | `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+
[`ListBookingsResponse`](/doc/models/list-bookings-response.md)
52+
53+
## Example Usage
54+
55+
```java
56+
Integer limit = 172;
57+
String cursor = "cursor6";
58+
String teamMemberId = "team_member_id0";
59+
String locationId = "location_id4";
60+
String startAtMin = "start_at_min8";
61+
String startAtMax = "start_at_max8";
62+
63+
bookingsApi.listBookingsAsync(limit, cursor, teamMemberId, locationId, startAtMin, startAtMax).thenAccept(result -> {
64+
// TODO success callback handler
65+
}).exceptionally(exception -> {
66+
// TODO failure callback handler
67+
return null;
68+
});
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 @@ CompletableFuture<ListDisputesResponse> listDisputesAsync(
4848

4949
```java
5050
String cursor = "cursor6";
51-
String states = "EVIDENCE_REQUIRED";
51+
String states = "INQUIRY_EVIDENCE_REQUIRED";
5252
String locationId = "location_id4";
5353

5454
disputesApi.listDisputesAsync(cursor, states, locationId).thenAccept(result -> {

doc/api/gift-card-activities.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ CompletableFuture<ListGiftCardActivitiesResponse> listGiftCardActivitiesAsync(
3737

3838
| Parameter | Type | Tags | Description |
3939
| --- | --- | --- | --- |
40-
| `giftCardId` | `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-
| `type` | `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-
| `locationId` | `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-
| `beginTime` | `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-
| `endTime` | `String` | Query, Optional | The timestamp for the end of the reporting period, in RFC 3339 format.<br>Inclusive. Default: The current time. |
45-
| `limit` | `Integer` | 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+
| `giftCardId` | `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+
| `type` | `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+
| `locationId` | `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+
| `beginTime` | `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+
| `endTime` | `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` | `Integer` | 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
| `sortOrder` | `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 @@ CompletableFuture<ListGiftCardsResponse> listGiftCardsAsync(
3737

3838
| Parameter | Type | Tags | Description |
3939
| --- | --- | --- | --- |
40-
| `type` | `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` | `Integer` | 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-
| `customerId` | `String` | Query, Optional | If a value is provided, returns only the gift cards linked to the specified customer |
40+
| `type` | `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` | `Integer` | 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+
| `customerId` | `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

@@ -153,7 +153,7 @@ giftCardsApi.retrieveGiftCardFromGANAsync(body).thenAccept(result -> {
153153

154154
# Retrieve Gift Card From Nonce
155155

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

158158
```java
159159
CompletableFuture<RetrieveGiftCardFromNonceResponse> retrieveGiftCardFromNonceAsync(
@@ -188,7 +188,7 @@ giftCardsApi.retrieveGiftCardFromNonceAsync(body).thenAccept(result -> {
188188

189189
# Link Customer to Gift Card
190190

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

193193
```java
194194
CompletableFuture<LinkCustomerToGiftCardResponse> linkCustomerToGiftCardAsync(
@@ -200,7 +200,7 @@ CompletableFuture<LinkCustomerToGiftCardResponse> linkCustomerToGiftCardAsync(
200200

201201
| Parameter | Type | Tags | Description |
202202
| --- | --- | --- | --- |
203-
| `giftCardId` | `String` | Template, Required | The ID of the gift card to link. |
203+
| `giftCardId` | `String` | Template, Required | The ID of the gift card to be linked. |
204204
| `body` | [`LinkCustomerToGiftCardRequest`](/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. |
205205

206206
## Response Type
@@ -226,7 +226,7 @@ giftCardsApi.linkCustomerToGiftCardAsync(giftCardId, body).thenAccept(result ->
226226

227227
# Unlink Customer From Gift Card
228228

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

231231
```java
232232
CompletableFuture<UnlinkCustomerFromGiftCardResponse> unlinkCustomerFromGiftCardAsync(
@@ -238,7 +238,7 @@ CompletableFuture<UnlinkCustomerFromGiftCardResponse> unlinkCustomerFromGiftCard
238238

239239
| Parameter | Type | Tags | Description |
240240
| --- | --- | --- | --- |
241-
| `giftCardId` | `String` | Template, Required | - |
241+
| `giftCardId` | `String` | Template, Required | The ID of the gift card to be unlinked. |
242242
| `body` | [`UnlinkCustomerFromGiftCardRequest`](/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. |
243243

244244
## Response Type

doc/api/refunds.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ Money bodyAppFeeMoney = new Money.Builder()
109109
.build();
110110
RefundPaymentRequest body = new RefundPaymentRequest.Builder(
111111
"9b7f2dcf-49da-4411-b23e-a2d6af21333a",
112-
bodyAmountMoney,
113-
"R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY")
112+
bodyAmountMoney)
114113
.appFeeMoney(bodyAppFeeMoney)
114+
.paymentId("R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY")
115115
.reason("Example")
116116
.paymentVersionToken("payment_version_token6")
117117
.teamMemberId("team_member_id4")

doc/api/sites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SitesApi sitesApi = client.getSitesApi();
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)