Skip to content

Commit dee4a02

Browse files
authored
Merge pull request #81 from square/release/17.0.0.20211215
Generated PR for Release: 17.0.0.20211215
2 parents c5b6084 + 0a824b7 commit dee4a02

58 files changed

Lines changed: 480 additions & 192 deletions

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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Change Log
22

3+
## Version 17.0.0.20211215 (2021-12-15)
4+
### API updates
5+
6+
* **Invoices API:**
7+
* The Invoices API now supports seller accounts in France. For more information, see [International availability and considerations.](https://developer.squareup.com/docs/invoices-api/overview#international-availability-invoices)
8+
* France only: [`Invoice`](https://developer.squareup.com/reference/square_2021-12-15/objects/Invoice) object. Added a new `payment_conditions` field, which contains payment terms and conditions that are displayed on the invoice. This field is available only for sellers in France. For more information, see [Payment conditions.](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions)
9+
10+
Square version 2021-12-15 or higher is required to set this field, but it is returned in `ListInvoices` and `RetrieveInvoice` requests for all Square versions.
11+
12+
* **Cards API**
13+
* Added the `CARD_DECLINED_VERIFICATION_REQUIRED` error code to the list of error codes returned by [CreateCard](https://developer.squareup.com/reference/square_2021-12-15/cards-api/CreateCard).
14+
* **Catalog API:**
15+
* [CreateCatalogImage](https://developer.squareup.com/reference/square_2021-12-15/catalog-api/create-catalog-image) endpoint
16+
* Updated to support attaching multiple images to a [Catalogbject](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogObject) instance.
17+
* Added `is_primary` option to let the caller choose to attach an image as the primary image on the object for display with the Square Point of Sale and other first-party Square applications. For more information, see [Upload and Attach Images.](https://developer.squareup.com/docs/catalog-api/upload-and-attach-images)
18+
* [CatalogObject](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogObject) object
19+
* Retired the `image_id` field, used to hold a single image object attached to an image-supporting object of the `ITEM`, `ITEM_VARIATION`, `CATEGORY`, or `MODIFIER_LIST` type, in Square API version 2021-12-15 and later, which supports attachment of multiple images. The `image_id` field is still supported in Square API version prior to 2021-12-15. For more information, see [Work with Images: Overview.](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image#overview)
20+
* [CatalogItem](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogItem), [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogItemVariation), [CatalogCategory](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogCategory) or [CatalogModifierList](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogModifierList) object
21+
* Added `image_ids` list to hold attached image objects. The first element of `image_ids` list refers to the primary image attached to the catalog object. For more information, see [Work with Images: Overview.](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image#overview)
22+
* [UpdateCatalogImage](https://developer.squareup.com/reference/square_2021-12-15/catalog-api/update-catalog-image) endpoint
23+
* Added to support replacing the image file encapsulated by an existing [CatalogImage](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogImage) object. For more information, see [Replace image file on a CatalogImage object.](https://developer.squareup.com/docs/catalog-api/manage-images#replace-the-image-file-of-a-catalogimage-object)
24+
25+
* [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogPricingRule) object
26+
* Added [minimum_order_subtotal_money](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogPricingRule#definition__property-minimum_order_subtotal_money) field to require that the minimum order subtotal be reached before the pricing rule may be applied.
27+
28+
### Documentation updates
29+
* Added a new top-level node for Developer Tools. This node includes such features as Sandbox, API Logs, and Webhooks.
30+
* Added [Webhook Event Logs (beta)](https://developer.squareup.com/docs/devtools/webhook-logs) documentation to the Developer Tools node.
31+
32+
333
## Version 16.0.0.20211117 (2021-11-17)
434
## API updates
535

doc/api/catalog.md

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ catalog_api = client.catalog
1414
* [Batch Retrieve Catalog Objects](/doc/api/catalog.md#batch-retrieve-catalog-objects)
1515
* [Batch Upsert Catalog Objects](/doc/api/catalog.md#batch-upsert-catalog-objects)
1616
* [Create Catalog Image](/doc/api/catalog.md#create-catalog-image)
17+
* [Update Catalog Image](/doc/api/catalog.md#update-catalog-image)
1718
* [Catalog Info](/doc/api/catalog.md#catalog-info)
1819
* [List Catalog](/doc/api/catalog.md#list-catalog)
1920
* [Upsert Catalog Object](/doc/api/catalog.md#upsert-catalog-object)
@@ -302,6 +303,7 @@ body['batches'][0]['objects'][2]['catalog_v1_ids'][2]['location_id'] = 'location
302303
body['batches'][0]['objects'][2]['present_at_all_locations'] = True
303304
body['batches'][0]['objects'][2]['category_data'] = {}
304305
body['batches'][0]['objects'][2]['category_data']['name'] = 'Beverages'
306+
body['batches'][0]['objects'][2]['category_data']['image_ids'] = ['image_ids1', 'image_ids2']
305307

306308
body['batches'][0]['objects'].append({})
307309
body['batches'][0]['objects'][3]['type'] = 'TAX'
@@ -338,9 +340,9 @@ elif result.is_error():
338340

339341
# Create Catalog Image
340342

341-
Uploads an image file to be represented by a [CatalogImage](/doc/models/catalog-image.md) object linked to an existing
342-
[CatalogObject](/doc/models/catalog-object.md) instance. A call to this endpoint can upload an image, link an image to
343-
a catalog object, or do both.
343+
Uploads an image file to be represented by a [CatalogImage](/doc/models/catalog-image.md) object that can be linked to an existing
344+
[CatalogObject](/doc/models/catalog-object.md) instance. The resulting `CatalogImage` is unattached to any `CatalogObject` if the `object_id`
345+
is not specified.
344346

345347
This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in
346348
JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
@@ -385,6 +387,8 @@ request['image']['image_data'] = {}
385387
request['image']['image_data']['name'] = 'name0'
386388
request['image']['image_data']['url'] = 'url4'
387389
request['image']['image_data']['caption'] = 'A picture of a cup of coffee'
390+
request['image']['image_data']['photo_studio_order_id'] = 'photo_studio_order_id2'
391+
request['is_primary'] = False
388392
image_file = FileWrapper(open('dummy_file', 'rb'), 'optional-content-type')
389393

390394
result = catalog_api.create_catalog_image(request, image_file)
@@ -396,6 +400,49 @@ elif result.is_error():
396400
```
397401

398402

403+
# Update Catalog Image
404+
405+
Uploads a new image file to replace the existing one in the specified [CatalogImage](/doc/models/catalog-image.md) object.
406+
407+
This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in
408+
JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
409+
410+
```python
411+
def update_catalog_image(self,
412+
image_id,
413+
request=None,
414+
image_file=None)
415+
```
416+
417+
## Parameters
418+
419+
| Parameter | Type | Tags | Description |
420+
| --- | --- | --- | --- |
421+
| `image_id` | `string` | Template, Required | The ID of the `CatalogImage` object to update the encapsulated image file. |
422+
| `request` | [`Update Catalog Image Request`](/doc/models/update-catalog-image-request.md) | Form, Optional | - |
423+
| `image_file` | `typing.BinaryIO` | Form, Optional | - |
424+
425+
## Response Type
426+
427+
[`Update Catalog Image Response`](/doc/models/update-catalog-image-response.md)
428+
429+
## Example Usage
430+
431+
```python
432+
image_id = 'image_id4'
433+
request = {}
434+
request['idempotency_key'] = '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86'
435+
image_file = FileWrapper(open('dummy_file', 'rb'), 'optional-content-type')
436+
437+
result = catalog_api.update_catalog_image(image_id, request, image_file)
438+
439+
if result.is_success():
440+
print(result.body)
441+
elif result.is_error():
442+
print(result.errors)
443+
```
444+
445+
399446
# Catalog Info
400447

401448
Retrieves information about the Square Catalog API, such as batch size
@@ -423,11 +470,10 @@ elif result.is_error():
423470

424471
# List Catalog
425472

426-
Returns a list of [CatalogObject](/doc/models/catalog-object.md)s that includes
427-
all objects of a set of desired types (for example, all [CatalogItem](/doc/models/catalog-item.md)
428-
and [CatalogTax](/doc/models/catalog-tax.md) objects) in the catalog. The `types` parameter
429-
is specified as a comma-separated list of valid [CatalogObject](/doc/models/catalog-object.md) types:
430-
`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`.
473+
Returns a list of all [CatalogObject](/doc/models/catalog-object.md)s of the specified types in the catalog.
474+
475+
The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](/doc/models/catalog-object-type.md) values,
476+
for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`".
431477

432478
__Important:__ ListCatalog does not return deleted catalog items. To retrieve
433479
deleted catalog items, use [SearchCatalogObjects](/doc/api/catalog.md#search-catalog-objects)
@@ -445,8 +491,8 @@ def list_catalog(self,
445491
| Parameter | Type | Tags | Description |
446492
| --- | --- | --- | --- |
447493
| `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. |
448-
| `types` | `string` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve.<br><br>The valid values are defined in the [CatalogObjectType](/doc/models/catalog-object-type.md) enum, including<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, or `IMAGE`.<br><br>If this is unspecified, the operation returns objects of all the types at the version of the Square API used to make the request. |
449-
| `catalog_version` | `long\|int` | 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. |
494+
| `types` | `string` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve.<br><br>The valid values are defined in the [CatalogObjectType](/doc/models/catalog-object-type.md) enum, for example,<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.<br><br>If this is unspecified, the operation returns objects of all the top level types at the version<br>of the Square API used to make the request. Object types that are nested onto other object types<br>are not included in the defaults.<br><br>At the current API version the default object types are:<br>ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST, DINING_OPTION, TAX_EXEMPTION,<br>SERVICE_CHARGE, PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,<br>SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. |
495+
| `catalog_version` | `long\|int` | 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. If not included, results will<br>be from the current version of the catalog. |
450496

451497
## Response Type
452498

@@ -644,8 +690,8 @@ def retrieve_catalog_object(self,
644690
| Parameter | Type | Tags | Description |
645691
| --- | --- | --- | --- |
646692
| `object_id` | `string` | Template, Required | The object ID of any type of catalog objects to be retrieved. |
647-
| `include_related_objects` | `bool` | Query, Optional | If `true`, the response will include additional objects that are related to the<br>requested object, as follows:<br><br>If the `object` field of the response contains a `CatalogItem`, its associated<br>`CatalogCategory`, `CatalogTax`, `CatalogImage` and `CatalogModifierList` objects will<br>be returned in the `related_objects` field of the response. If the `object` field of<br>the response contains a `CatalogItemVariation`, its parent `CatalogItem` will be returned<br>in the `related_objects` field of the response.<br><br>Default value: `false`<br>**Default**: `False` |
648-
| `catalog_version` | `long\|int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](/doc/models/catalog-object.md)s. |
693+
| `include_related_objects` | `bool` | Query, Optional | If `true`, the response will include additional objects that are related to the<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false`<br>**Default**: `False` |
694+
| `catalog_version` | `long\|int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](/doc/models/catalog-object.md)s. If not included, results will<br>be from the current version of the catalog. |
649695

650696
## Response Type
651697

doc/api/locations.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ locations_api = client.locations
1818

1919
# List Locations
2020

21-
Provides information of all locations of a business.
22-
23-
Many Square API endpoints require a `location_id` parameter.
24-
The `id` field of the [`Location`](/doc/models/location.md) objects returned by this
25-
endpoint correspond to that `location_id` parameter.
21+
Provides details about all of the seller's locations,
22+
including those with an inactive status.
2623

2724
```python
2825
def list_locations(self)
@@ -46,7 +43,13 @@ elif result.is_error():
4643

4744
# Create Location
4845

49-
Creates a location.
46+
Creates a [location](https://developer.squareup.com/docs/locations-api).
47+
Creating new locations allows for separate configuration of receipt layouts, item prices,
48+
and sales reports. Developers can use locations to separate sales activity via applications
49+
that integrate with Square from sales activity elsewhere in a seller's account.
50+
Locations created programmatically with the Locations API will last forever and
51+
are visible to the seller for their own management, so ensure that
52+
each location has a sensible and unique name.
5053

5154
```python
5255
def create_location(self,
@@ -94,9 +97,8 @@ elif result.is_error():
9497

9598
# Retrieve Location
9699

97-
Retrieves details of a location. You can specify "main"
98-
as the location ID to retrieve details of the
99-
main location.
100+
Retrieves details of a single location. Specify "main"
101+
as the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location).
100102

101103
```python
102104
def retrieve_location(self,
@@ -107,7 +109,7 @@ def retrieve_location(self,
107109

108110
| Parameter | Type | Tags | Description |
109111
| --- | --- | --- | --- |
110-
| `location_id` | `string` | Template, Required | The ID of the location to retrieve. If you specify the string "main",<br>then the endpoint returns the main location. |
112+
| `location_id` | `string` | Template, Required | The ID of the location to retrieve. Specify the string<br>"main" to return the main location. |
111113

112114
## Response Type
113115

doc/api/mobile-authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ mobile_authorization_api = client.mobile_authorization
1111

1212
# Create Mobile Authorization Code
1313

14-
Generates code to authorize a mobile application to connect to a Square card reader
14+
Generates code to authorize a mobile application to connect to a Square card reader.
1515

16-
Authorization codes are one-time-use and expire __60 minutes__ after being issued.
16+
Authorization codes are one-time-use codes and expire 60 minutes after being issued.
1717

1818
__Important:__ The `Authorization` header you provide to this endpoint must have the following format:
1919

doc/api/o-auth.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ o_auth_api = client.o_auth
2424

2525
Renews an OAuth access token before it expires.
2626

27-
OAuth access tokens besides your application's personal access token expire after __30 days__.
28-
You can also renew expired tokens within __15 days__ of their expiration.
27+
OAuth access tokens besides your application's personal access token expire after 30 days.
28+
You can also renew expired tokens within 15 days of their expiration.
2929
You cannot renew an access token that has been expired for more than 15 days.
30-
Instead, the associated user must re-complete the OAuth flow from the beginning.
30+
Instead, the associated user must recomplete the OAuth flow from the beginning.
3131

3232
__Important:__ The `Authorization` header for this endpoint must have the
3333
following format:
@@ -37,7 +37,7 @@ Authorization: Client APPLICATION_SECRET
3737
```
3838

3939
Replace `APPLICATION_SECRET` with the application secret on the Credentials
40-
page in the [developer dashboard](https://developer.squareup.com/apps).
40+
page in the [Developer Dashboard](https://developer.squareup.com/apps).
4141

4242
:information_source: **Note** This endpoint does not require authentication.
4343

@@ -52,7 +52,7 @@ def renew_token(self,
5252

5353
| Parameter | Type | Tags | Description |
5454
| --- | --- | --- | --- |
55-
| `client_id` | `string` | Template, Required | Your application ID, available from the OAuth page for your<br>application on the Developer Dashboard. |
55+
| `client_id` | `string` | Template, Required | Your application ID, which is available in the OAuth page in the [Developer Dashboard](https://developer.squareup.com/apps). |
5656
| `body` | [`Renew Token Request`](/doc/models/renew-token-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
5757
| `authorization` | `string` | Header, Required | Client APPLICATION_SECRET |
5858

0 commit comments

Comments
 (0)