Skip to content

Commit 8320c4e

Browse files
authored
Merge pull request #20 from square/release/6.1.0.20200722
release 6.1.0.20200722
2 parents caee316 + 1c1a5ae commit 8320c4e

File tree

221 files changed

+8664
-736
lines changed

Some content is hidden

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

221 files changed

+8664
-736
lines changed

CHANGELOG.md

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

3+
## Version 6.1.0.20200722 (2020-07-22)
4+
## API releases
5+
6+
* Invoices API (beta):
7+
* For an overview, see [Manage Invoices Using the Invoices API](https://developer.squareup.com/docs/invoices-api/overview).
8+
* For technical reference, see [Invoices API](https://developer.squareup.com/reference/square_2020-07-22/invoices-api).
9+
10+
## Existing API updates
11+
12+
* Catalog API
13+
* [SearchCatalogItems](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-items). You can now call the new search endpoint to [search for catalog items or item variations](https://developer.squareup.com/docs/catalog-api/search-catalog-items), with simplified programming experiences, using one or more of the supported query filters, including the custom attribute value filter.
14+
* Locations API
15+
* [Locations API Overview](https://developer.squareup.com/docs/locations-api). Introduced the "main" location concept.
16+
* [RetrieveLocation](https://developer.squareup.com/reference/square_2020-07-22/locations-api/retrieve-location). You can now specify "main" as the location ID to retrieve the main location information.
17+
18+
* Merchants API
19+
* [RetrieveMerchant](https://developer.squareup.com/reference/square_2020-07-22/merchants-api/retrieve-merchant) and [ListMerchants](https://developer.squareup.com/reference/square_2020-07-22/merchants-api/retrieve-merchant). These endpoints now return a new field, `main_location_id`.
20+
21+
* Orders API
22+
* [PricingOptions](https://developer.squareup.com/reference/square_2020-07-22/objects/Order#definition__property-pricing_options). You can now enable the `auto_apply_discounts` of the options to have rule-based discounts automatically applied to an [Order](https://developer.squareup.com/reference/square_2020-07-22/objects/Order) that is pre-configured with a [pricing rule](https://developer.squareup.com/reference/square_2020-07-22/objects/CatalogPricingRule).
23+
24+
* [Inventory API](https://developer.squareup.com/reference/square_2020-07-22/inventory-api)
25+
* Replaced 500 error on max string length exceeded with a max length error message. Max length attribute added to string type fields.
26+
27+
* Terminal API (beta)
28+
* [TerminalCheckout](https://developer.squareup.com/reference/square_2020-07-22/objects/TerminalCheckout) object. The `TerminalCheckoutCancelReason` field is renamed to `ActionCancelReason`.
29+
30+
## Documentation updates
31+
32+
* Catalog API
33+
* [Search a catalog](https://developer.squareup.com/docs/catalog-api/search-catalog). New topics added to provide actionable guides to using the existing [SearchCatalogObjects](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-objects) endpoint, in addition to the [SearchCatalogItems](https://developer.squareup.com/reference/square_2020-07-22/catalog-api/search-catalog-items) endpoints.
34+
35+
* Orders API
36+
* [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders). Updated existing content with the new pricing option for the automatic application of rule-based discounts.
37+
38+
339
## Version 6.0.0.20200625 (2020-06-25)
440

541
## New API release

README.md

Lines changed: 150 additions & 149 deletions
Large diffs are not rendered by default.

doc/catalog.md

Lines changed: 105 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ CatalogApi catalogApi = client.getCatalogApi();
2020
* [Delete Catalog Object](/doc/catalog.md#delete-catalog-object)
2121
* [Retrieve Catalog Object](/doc/catalog.md#retrieve-catalog-object)
2222
* [Search Catalog Objects](/doc/catalog.md#search-catalog-objects)
23+
* [Search Catalog Items](/doc/catalog.md#search-catalog-items)
2324
* [Update Item Modifier Lists](/doc/catalog.md#update-item-modifier-lists)
2425
* [Update Item Taxes](/doc/catalog.md#update-item-taxes)
2526

@@ -270,12 +271,12 @@ catalogApi.batchUpsertCatalogObjectsAsync(body).thenAccept(result -> {
270271

271272
## Create Catalog Image
272273

273-
Upload an image file to create a new [CatalogImage](#type-catalogimage) for an existing
274-
[CatalogObject](#type-catalogobject). Images can be uploaded and linked in this request or created independently
275-
(without an object assignment) and linked to a [CatalogObject](#type-catalogobject) at a later time.
274+
Uploads an image file to be represented by an [CatalogImage](#type-catalogimage) object linked to an existing
275+
[CatalogObject](#type-catalogobject) instance. A call to this endpoint can upload an image, link an image to
276+
a catalog object, or do both.
276277

277-
CreateCatalogImage accepts HTTP multipart/form-data requests with a JSON part and an image file part in
278-
JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
278+
This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in
279+
JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
279280

280281
Additional information and an example cURL request can be found in the [Create a Catalog Image recipe](https://developer.squareup.com/docs/more-apis/catalog/cookbook/create-catalog-images).
281282

@@ -323,8 +324,8 @@ catalogApi.createCatalogImageAsync(request, null).thenAccept(result -> {
323324

324325
## Catalog Info
325326

326-
Returns information about the Square Catalog API, such as batch size
327-
limits for `BatchUpsertCatalogObjects`.
327+
Retrieves information about the Square Catalog API, such as batch size
328+
limits that can be used by the `BatchUpsertCatalogObjects` endpoint.
328329

329330
```java
330331
CompletableFuture<CatalogInfoResponse> catalogInfoAsync()
@@ -509,17 +510,16 @@ catalogApi.retrieveCatalogObjectAsync(objectId, null).thenAccept(result -> {
509510

510511
## Search Catalog Objects
511512

512-
Queries the targeted catalog using a variety of query expressions.
513+
Searches for [CatalogObject](#type-CatalogObject) of any types against supported search attribute values,
514+
excluding custom attribute values on items or item variations, against one or more of the specified query expressions,
513515

514-
Supported query expressions are of the following types:
515-
- [CatalogQuerySortedAttribute](#type-catalogquerysortedattribute),
516-
- [CatalogQueryExact](#type-catalogqueryexact),
517-
- [CatalogQueryRange](#type-catalogqueryrange),
518-
- [CatalogQueryText](#type-catalogquerytext),
519-
- [CatalogQueryItemsForTax](#type-catalogqueryitemsfortax),
520-
- [CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist),
521-
- [CatalogQueryItemsForItemOptions](#type-catalogqueryitemsforitemoptions), and
522-
- [CatalogQueryItemVariationsForItemOptionValues](#type-catalogqueryitemvariationsforitemoptionvalues).
516+
This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems)
517+
endpoint in the following aspects:
518+
519+
- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.
520+
- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not.
521+
- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does.
522+
- The both endpoints have different call conventions, including the query filter formats.
523523

524524
```java
525525
CompletableFuture<SearchCatalogObjectsResponse> searchCatalogObjectsAsync(
@@ -562,6 +562,94 @@ catalogApi.searchCatalogObjectsAsync(body).thenAccept(result -> {
562562
});
563563
```
564564

565+
## Search Catalog Items
566+
567+
Searches for catalog items or item variations by matching supported search attribute values, including
568+
custom attribute values, against one or more of the specified query expressions,
569+
570+
This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects)
571+
endpoint in the following aspects:
572+
573+
- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.
574+
- `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not.
575+
- `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does.
576+
- The both endpoints use different call conventions, including the query filter formats.
577+
578+
```java
579+
CompletableFuture<SearchCatalogItemsResponse> searchCatalogItemsAsync(
580+
final SearchCatalogItemsRequest body)
581+
```
582+
583+
### Parameters
584+
585+
| Parameter | Type | Tags | Description |
586+
| --- | --- | --- | --- |
587+
| `body` | [`SearchCatalogItemsRequest`](/doc/models/search-catalog-items-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
588+
589+
### Response Type
590+
591+
[`SearchCatalogItemsResponse`](/doc/models/search-catalog-items-response.md)
592+
593+
### Example Usage
594+
595+
```java
596+
List<String> bodyCategoryIds = new LinkedList<>();
597+
bodyCategoryIds.add("WINE_CATEGORY_ID");
598+
List<String> bodyStockLevels = new LinkedList<>();
599+
bodyStockLevels.add("OUT");
600+
bodyStockLevels.add("LOW");
601+
List<String> bodyEnabledLocationIds = new LinkedList<>();
602+
bodyEnabledLocationIds.add("ATL_LOCATION_ID");
603+
List<String> bodyProductTypes = new LinkedList<>();
604+
bodyProductTypes.add("REGULAR");
605+
List<CustomAttributeFilter> bodyCustomAttributeFilters = new LinkedList<>();
606+
607+
CustomAttributeFilter bodyCustomAttributeFilters0 = new CustomAttributeFilter.Builder()
608+
.customAttributeDefinitionId("VEGAN_DEFINITION_ID")
609+
.boolFilter(true)
610+
.build();
611+
bodyCustomAttributeFilters.add(bodyCustomAttributeFilters0);
612+
613+
CustomAttributeFilter bodyCustomAttributeFilters1 = new CustomAttributeFilter.Builder()
614+
.customAttributeDefinitionId("BRAND_DEFINITION_ID")
615+
.stringFilter("Dark Horse")
616+
.build();
617+
bodyCustomAttributeFilters.add(bodyCustomAttributeFilters1);
618+
619+
Range bodyCustomAttributeFilters2NumberFilter = new Range.Builder()
620+
.min("2017")
621+
.max("2018")
622+
.build();
623+
CustomAttributeFilter bodyCustomAttributeFilters2 = new CustomAttributeFilter.Builder()
624+
.key("VINTAGE")
625+
.numberFilter(bodyCustomAttributeFilters2NumberFilter)
626+
.build();
627+
bodyCustomAttributeFilters.add(bodyCustomAttributeFilters2);
628+
629+
CustomAttributeFilter bodyCustomAttributeFilters3 = new CustomAttributeFilter.Builder()
630+
.customAttributeDefinitionId("VARIETAL_DEFINITION_ID")
631+
.build();
632+
bodyCustomAttributeFilters.add(bodyCustomAttributeFilters3);
633+
634+
SearchCatalogItemsRequest body = new SearchCatalogItemsRequest.Builder()
635+
.textFilter("red")
636+
.categoryIds(bodyCategoryIds)
637+
.stockLevels(bodyStockLevels)
638+
.enabledLocationIds(bodyEnabledLocationIds)
639+
.limit(100)
640+
.sortOrder("ASC")
641+
.productTypes(bodyProductTypes)
642+
.customAttributeFilters(bodyCustomAttributeFilters)
643+
.build();
644+
645+
catalogApi.searchCatalogItemsAsync(body).thenAccept(result -> {
646+
// TODO success callback handler
647+
}).exceptionally(exception -> {
648+
// TODO failure callback handler
649+
return null;
650+
});
651+
```
652+
565653
## Update Item Modifier Lists
566654

567655
Updates the [CatalogModifierList](#type-catalogmodifierlist) objects

doc/inventory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ CompletableFuture<RetrieveInventoryChangesResponse> retrieveInventoryChangesAsyn
310310
| --- | --- | --- | --- |
311311
| `catalogObjectId` | `String` | Template, Required | ID of the [CatalogObject](#type-catalogobject) to retrieve. |
312312
| `locationIds` | `String` | Query, Optional | The [Location](#type-location) IDs to look up as a comma-separated<br>list. An empty list queries all locations. |
313-
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for the original query.<br><br>See the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information. |
313+
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for the original query.<br><br>See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. |
314314

315315
### Response Type
316316

0 commit comments

Comments
 (0)