Skip to content

Commit 554ec04

Browse files
author
autobot
committed
Generated PR for Release: 11.0.0.20210513
1 parent 8cd0c89 commit 554ec04

File tree

184 files changed

+4058
-1043
lines changed

Some content is hidden

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

184 files changed

+4058
-1043
lines changed

.github/workflows/maven.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Java CI with Maven
5+
6+
on:
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
build:
14+
env:
15+
SQUARE_ENVIRONMENT: sandbox
16+
SQUARE_ACCESS_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }}
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up JDK 8
23+
uses: actions/setup-java@v2
24+
with:
25+
java-version: "8"
26+
distribution: "adopt"
27+
- name: Build with Maven
28+
run: mvn test -B

CHANGELOG.md

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

3+
## Version 11.0.0.20210513 (2021-05-13)
4+
## New API releases
5+
6+
* **Sites API.** The [Sites API](https://developer.squareup.com/reference/square_2021-05-13/sites-api) lets you retrieve basic details about the Square Online sites that belong to a Square seller. For more information, see [Sites API Overview.](https://developer.squareup.com/docs/sites-api/overview)
7+
8+
9+
* **Snippets API.** The [Snippets API](https://developer.squareup.com/reference/square_2021-05-13/snippets-api) lets you manage snippets that provide custom functionality on Square Online sites. A snippet is a script that is injected into all pages on a site, except for checkout pages. For more information, see [Snippets API Overview.](https://developer.squareup.com/docs/snippets-api/overview)
10+
11+
The Sites API and Snippets API are publicly available to all developers as part of an early access program (EAP). 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)
12+
13+
## API updates
14+
15+
* **Payments API.**
16+
* [CreatePayment.](https://developer.squareup.com/reference/square_2021-05-13/payments-api/create-payment) The endpoint now supports ACH bank transfer payments. For more information, see [ACH Payment](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments).
17+
18+
* **Loyalty API:**
19+
* The [Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state.
20+
21+
* The [ListLoyaltyPrograms](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/list-loyalty-programs) endpoint is deprecated and replaced by the [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/retrieve-loyalty-program) endpoint when used with the `main` keyword.
22+
23+
* [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccount)  object. The `mappings` field is retired and replaced by `mapping`.
24+
25+
* [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccountMapping) object. The `type` and `value` fields are retired and replaced by `phone_number`.
26+
27+
Starting in Square version 2021-05-13:
28+
* `mappings` is not accepted in `CreateLoyaltyAccount` requests or returned in responses.
29+
* `type` and `value` are not accepted in `CreateLoyaltyAccount` or `SearchLoyaltyAccounts` requests or returned in responses.
30+
31+
For more information, see [Migration notes.](https://developer.squareup.com/docs/loyalty-api/overview#migration-notes)
32+
33+
## Documentation updates
34+
* **Getting Started** Added step that shows how to use the API Logs to examine a transaction.
35+
36+
337
## Version 10.0.0.20210421 (2021-04-21)
438
## New API releases
539

README.md

Lines changed: 10 additions & 4 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>10.0.0.20210421</version>
36+
<version>11.0.0.20210513</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:10.0.0.20210421"
45+
implementation "com.squareup:square:11.0.0.20210513"
4646
```
4747

4848
## API documentation
@@ -93,9 +93,13 @@ implementation "com.squareup:square:10.0.0.20210421"
9393
### Financials
9494
* [Bank Accounts]
9595

96+
### Online
97+
* [Sites]
98+
* [Snippets]
99+
96100
### Authorization APIs
97101
* [Mobile Authorization]
98-
* [O Auth]
102+
* [OAuth]
99103

100104
### Deprecated APIs
101105
* [V1 Employees]
@@ -337,9 +341,11 @@ You can also use the Square API to create applications or services that work wit
337341
[Refunds]: doc/api/refunds.md
338342
[Subscriptions]: doc/api/subscriptions.md
339343
[Mobile Authorization]: doc/api/mobile-authorization.md
340-
[O Auth]: doc/api/o-auth.md
344+
[OAuth]: doc/api/o-auth.md
341345
[V1 Employees]: doc/api/v1-employees.md
342346
[V1 Transactions]: doc/api/v1-transactions.md
343347
[V1 Items]: doc/api/v1-items.md
344348
[Team]: doc/api/team.md
345349
[Transactions]: doc/api/transactions.md
350+
[Sites]: doc/api/sites.md
351+
[Snippets]: doc/api/snippets.md

doc/api/catalog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ CompletableFuture<ListCatalogResponse> listCatalogAsync(
548548

549549
| Parameter | Type | Tags | Description |
550550
| --- | --- | --- | --- |
551-
| `cursor` | `String` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.<br>See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. |
551+
| `cursor` | `String` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.<br>The page size is currently set to be 100.<br>See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. |
552552
| `types` | `String` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve, for example<br>`ITEM,ITEM_VARIATION,CATEGORY,IMAGE`.<br><br>The legal values are taken from the CatalogObjectType enum:<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. |
553553
| `catalogVersion` | `Long` | Query, Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical<br>versions of objects. The specified version value is matched against<br>the [CatalogObject](/doc/models/catalog-object.md)s' `version` attribute. |
554554

doc/api/inventory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ InventoryChange bodyChanges0 = new InventoryChange.Builder()
130130
.build();
131131
bodyChanges.add(bodyChanges0);
132132

133-
BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder()
134-
.idempotencyKey("8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe")
133+
BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder(
134+
"8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe")
135135
.changes(bodyChanges)
136136
.ignoreUnchangedCounts(true)
137137
.build();

doc/api/loyalty.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LoyaltyApi loyaltyApi = client.getLoyaltyApi();
2828

2929
# Create Loyalty Account
3030

31-
Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and either the `mapping` field (preferred) or the `mappings` field.
31+
Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer.
3232

3333
```java
3434
CompletableFuture<CreateLoyaltyAccountResponse> createLoyaltyAccountAsync(
@@ -48,31 +48,18 @@ CompletableFuture<CreateLoyaltyAccountResponse> createLoyaltyAccountAsync(
4848
## Example Usage
4949

5050
```java
51-
List<LoyaltyAccountMapping> bodyLoyaltyAccountMappings = new LinkedList<>();
52-
53-
LoyaltyAccountMapping bodyLoyaltyAccountMappings0 = new LoyaltyAccountMapping.Builder()
54-
.id("id0")
55-
.type("PHONE")
56-
.value("value2")
57-
.createdAt("created_at8")
58-
.phoneNumber("phone_number8")
59-
.build();
60-
bodyLoyaltyAccountMappings.add(bodyLoyaltyAccountMappings0);
61-
6251
LoyaltyAccountMapping bodyLoyaltyAccountMapping = new LoyaltyAccountMapping.Builder()
6352
.id("id6")
64-
.type("PHONE")
65-
.value("value8")
6653
.createdAt("created_at4")
6754
.phoneNumber("+14155551234")
6855
.build();
6956
LoyaltyAccount bodyLoyaltyAccount = new LoyaltyAccount.Builder(
7057
"d619f755-2d17-41f3-990d-c04ecedd64dd")
7158
.id("id2")
72-
.mappings(bodyLoyaltyAccountMappings)
7359
.balance(14)
7460
.lifetimePoints(38)
7561
.customerId("customer_id0")
62+
.enrolledAt("enrolled_at2")
7663
.mapping(bodyLoyaltyAccountMapping)
7764
.build();
7865
CreateLoyaltyAccountRequest body = new CreateLoyaltyAccountRequest.Builder(
@@ -119,8 +106,6 @@ List<LoyaltyAccountMapping> bodyQueryMappings = new LinkedList<>();
119106

120107
LoyaltyAccountMapping bodyQueryMappings0 = new LoyaltyAccountMapping.Builder()
121108
.id("id4")
122-
.type("PHONE")
123-
.value("value6")
124109
.createdAt("created_at8")
125110
.phoneNumber("+14155551234")
126111
.build();
@@ -366,8 +351,12 @@ loyaltyApi.searchLoyaltyEventsAsync(body).thenAccept(result -> {
366351

367352
# List Loyalty Programs
368353

354+
**This endpoint is deprecated. **
355+
369356
Returns a list of loyalty programs in the seller's account.
370-
Currently, a seller can only have one loyalty program.
357+
Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview).
358+
359+
Replaced with [RetrieveLoyaltyProgram](/doc/api/loyalty.md#retrieve-loyalty-program) when used with the keyword `main`.
371360

372361
```java
373362
CompletableFuture<ListLoyaltyProgramsResponse> listLoyaltyProgramsAsync()

doc/api/orders.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ OrdersApi ordersApi = client.getOrdersApi();
2121

2222
# Create Order
2323

24-
Creates a new [Order](/doc/models/order.md) which can include information on products for
24+
Creates a new [order](/doc/models/order.md) that can include information about products for
2525
purchase and settings to apply to the purchase.
2626

27-
To pay for a created order, please refer to the
28-
[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders)
29-
guide.
27+
To pay for a created order, see
28+
[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).
3029

3130
You can modify open orders using the [UpdateOrder](/doc/api/orders.md#update-order) endpoint.
3231

@@ -217,9 +216,9 @@ ordersApi.createOrderAsync(body).thenAccept(result -> {
217216

218217
# Batch Retrieve Orders
219218

220-
Retrieves a set of [Order](/doc/models/order.md)s by their IDs.
219+
Retrieves a set of [orders](/doc/models/order.md) by their IDs.
221220

222-
If a given Order ID does not exist, the ID is ignored instead of generating an error.
221+
If a given order ID does not exist, the ID is ignored instead of generating an error.
223222

224223
```java
225224
CompletableFuture<BatchRetrieveOrdersResponse> batchRetrieveOrdersAsync(
@@ -402,19 +401,19 @@ ordersApi.calculateOrderAsync(body).thenAccept(result -> {
402401

403402
Search all orders for one or more locations. Orders include all sales,
404403
returns, and exchanges regardless of how or when they entered the Square
405-
Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc).
404+
ecosystem (such as Point of Sale, Invoices, and Connect APIs).
406405

407-
SearchOrders requests need to specify which locations to search and define a
408-
[`SearchOrdersQuery`](/doc/models/search-orders-query.md) object which controls
409-
how to sort or filter the results. Your SearchOrdersQuery can:
406+
`SearchOrders` requests need to specify which locations to search and define a
407+
[SearchOrdersQuery](/doc/models/search-orders-query.md) object that controls
408+
how to sort or filter the results. Your `SearchOrdersQuery` can:
410409

411410
Set filter criteria.
412-
Set sort order.
413-
Determine whether to return results as complete Order objects, or as
411+
Set the sort order.
412+
Determine whether to return results as complete `Order` objects or as
414413
[OrderEntry](/doc/models/order-entry.md) objects.
415414

416415
Note that details for orders processed with Square Point of Sale while in
417-
offline mode may not be transmitted to Square for up to 72 hours. Offline
416+
offline mode might not be transmitted to Square for up to 72 hours. Offline
418417
orders have a `created_at` value that reflects the time the order was created,
419418
not the time it was subsequently transmitted to Square.
420419

@@ -548,21 +547,21 @@ ordersApi.retrieveOrderAsync(orderId).thenAccept(result -> {
548547

549548
# Update Order
550549

551-
Updates an open [Order](/doc/models/order.md) by adding, replacing, or deleting
550+
Updates an open [order](/doc/models/order.md) by adding, replacing, or deleting
552551
fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated.
553552

554-
An UpdateOrder request requires the following:
553+
An `UpdateOrder` request requires the following:
555554

556555
- The `order_id` in the endpoint path, identifying the order to update.
557556
- The latest `version` of the order to update.
558557
- The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders#sparse-order-objects)
559-
containing only the fields to update and the version the update is
560-
being applied to.
558+
containing only the fields to update and the version to which the update is
559+
being applied.
561560
- If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation)
562-
identifying fields to clear.
561+
identifying the fields to clear.
563562

564-
To pay for an order, please refer to the
565-
[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide.
563+
To pay for an order, see
564+
[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders).
566565

567566
```java
568567
CompletableFuture<UpdateOrderResponse> updateOrderAsync(
@@ -668,20 +667,20 @@ ordersApi.updateOrderAsync(orderId, body).thenAccept(result -> {
668667

669668
# Pay Order
670669

671-
Pay for an [order](/doc/models/order.md) using one or more approved [payments](/doc/models/payment.md),
670+
Pay for an [order](/doc/models/order.md) using one or more approved [payments](/doc/models/payment.md)
672671
or settle an order with a total of `0`.
673672

674673
The total of the `payment_ids` listed in the request must be equal to the order
675674
total. Orders with a total amount of `0` can be marked as paid by specifying an empty
676675
array of `payment_ids` in the request.
677676

678-
To be used with PayOrder, a payment must:
677+
To be used with `PayOrder`, a payment must:
679678

680679
- Reference the order by specifying the `order_id` when [creating the payment](/doc/api/payments.md#create-payment).
681680
Any approved payments that reference the same `order_id` not specified in the
682-
`payment_ids` will be canceled.
681+
`payment_ids` is canceled.
683682
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture).
684-
Using a delayed capture payment with PayOrder will complete the approved payment.
683+
Using a delayed capture payment with `PayOrder` completes the approved payment.
685684

686685
```java
687686
CompletableFuture<PayOrderResponse> payOrderAsync(

doc/api/sites.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Sites
2+
3+
```java
4+
SitesApi sitesApi = client.getSitesApi();
5+
```
6+
7+
## Class Name
8+
9+
`SitesApi`
10+
11+
12+
# List Sites
13+
14+
Lists the Square Online sites that belong to a seller.
15+
16+
__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).
17+
18+
```java
19+
CompletableFuture<ListSitesResponse> listSitesAsync()
20+
```
21+
22+
## Response Type
23+
24+
[`ListSitesResponse`](/doc/models/list-sites-response.md)
25+
26+
## Example Usage
27+
28+
```java
29+
sitesApi.listSitesAsync().thenAccept(result -> {
30+
// TODO success callback handler
31+
}).exceptionally(exception -> {
32+
// TODO failure callback handler
33+
return null;
34+
});
35+
```
36+

0 commit comments

Comments
 (0)