diff --git a/doc/api/catalog.md b/doc/api/catalog.md index 6ddb2845..3ed63ed5 100644 --- a/doc/api/catalog.md +++ b/doc/api/catalog.md @@ -168,7 +168,6 @@ body = { 'present_at_all_locations': True, 'item_data': { 'name': 'Tea', - 'category_id': '#Beverages', 'tax_ids': [ '#SalesTax' ], @@ -188,6 +187,11 @@ body = { } } ], + 'categories': [ + { + 'id': '#Beverages' + } + ], 'description_html': '

Hot Leaf Juice

' } }, @@ -197,7 +201,6 @@ body = { 'present_at_all_locations': True, 'item_data': { 'name': 'Coffee', - 'category_id': '#Beverages', 'tax_ids': [ '#SalesTax' ], @@ -231,6 +234,11 @@ body = { } } ], + 'categories': [ + { + 'id': '#Beverages' + } + ], 'description_html': '

Hot Bean Juice

' } }, @@ -570,7 +578,8 @@ any [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to it. def retrieve_catalog_object(self, object_id, include_related_objects=False, - catalog_version=None) + catalog_version=None, + include_category_path_to_root=False) ``` ## Parameters @@ -580,6 +589,7 @@ def retrieve_catalog_object(self, | `object_id` | `str` | Template, Required | The object ID of any type of catalog objects to be retrieved. | | `include_related_objects` | `bool` | Query, Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field
of the response. These objects are put in the `related_objects` field. Setting this to `true` is
helpful when the objects are needed for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included. For example,

if the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false`
**Default**: `False` | | `catalog_version` | `long\|int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will
be from the current version of the catalog. | +| `include_category_path_to_root` | `bool` | Query, Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload.
**Default**: `False` | ## Response Type @@ -592,9 +602,12 @@ object_id = 'object_id8' include_related_objects = False +include_category_path_to_root = False + result = catalog_api.retrieve_catalog_object( object_id, - include_related_objects=include_related_objects + include_related_objects=include_related_objects, + include_category_path_to_root=include_category_path_to_root ) print(result) diff --git a/doc/api/checkout.md b/doc/api/checkout.md index 8c7c918f..4bc796c0 100644 --- a/doc/api/checkout.md +++ b/doc/api/checkout.md @@ -11,6 +11,10 @@ checkout_api = client.checkout ## Methods * [Create Checkout](../../doc/api/checkout.md#create-checkout) +* [Retrieve Location Settings](../../doc/api/checkout.md#retrieve-location-settings) +* [Update Location Settings](../../doc/api/checkout.md#update-location-settings) +* [Retrieve Merchant Settings](../../doc/api/checkout.md#retrieve-merchant-settings) +* [Update Merchant Settings](../../doc/api/checkout.md#update-merchant-settings) * [List Payment Links](../../doc/api/checkout.md#list-payment-links) * [Create Payment Link](../../doc/api/checkout.md#create-payment-link) * [Delete Payment Link](../../doc/api/checkout.md#delete-payment-link) @@ -155,6 +159,144 @@ elif result.is_error(): ``` +# Retrieve Location Settings + +Retrieves the location-level settings for a Square-hosted checkout page. + +```python +def retrieve_location_settings(self, + location_id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `location_id` | `str` | Template, Required | The ID of the location for which to retrieve settings. | + +## Response Type + +This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Retrieve Location Settings Response`](../../doc/models/retrieve-location-settings-response.md). + +## Example Usage + +```python +location_id = 'location_id4' + +result = checkout_api.retrieve_location_settings(location_id) +print(result) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + +# Update Location Settings + +Updates the location-level settings for a Square-hosted checkout page. + +```python +def update_location_settings(self, + location_id, + body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `location_id` | `str` | Template, Required | The ID of the location for which to retrieve settings. | +| `body` | [`Update Location Settings Request`](../../doc/models/update-location-settings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Update Location Settings Response`](../../doc/models/update-location-settings-response.md). + +## Example Usage + +```python +location_id = 'location_id4' + +body = { + 'location_settings': {} +} + +result = checkout_api.update_location_settings( + location_id, + body +) +print(result) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + +# Retrieve Merchant Settings + +Retrieves the merchant-level settings for a Square-hosted checkout page. + +```python +def retrieve_merchant_settings(self) +``` + +## Response Type + +This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Retrieve Merchant Settings Response`](../../doc/models/retrieve-merchant-settings-response.md). + +## Example Usage + +```python +result = checkout_api.retrieve_merchant_settings() +print(result) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + +# Update Merchant Settings + +Updates the merchant-level settings for a Square-hosted checkout page. + +```python +def update_merchant_settings(self, + body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`Update Merchant Settings Request`](../../doc/models/update-merchant-settings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Update Merchant Settings Response`](../../doc/models/update-merchant-settings-response.md). + +## Example Usage + +```python +body = { + 'merchant_settings': {} +} + +result = checkout_api.update_merchant_settings(body) +print(result) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + # List Payment Links Lists all payment links. diff --git a/doc/api/terminal.md b/doc/api/terminal.md index f6e87cd2..93979276 100644 --- a/doc/api/terminal.md +++ b/doc/api/terminal.md @@ -19,10 +19,12 @@ terminal_api = client.terminal * [Search Terminal Checkouts](../../doc/api/terminal.md#search-terminal-checkouts) * [Get Terminal Checkout](../../doc/api/terminal.md#get-terminal-checkout) * [Cancel Terminal Checkout](../../doc/api/terminal.md#cancel-terminal-checkout) +* [Dismiss Terminal Checkout](../../doc/api/terminal.md#dismiss-terminal-checkout) * [Create Terminal Refund](../../doc/api/terminal.md#create-terminal-refund) * [Search Terminal Refunds](../../doc/api/terminal.md#search-terminal-refunds) * [Get Terminal Refund](../../doc/api/terminal.md#get-terminal-refund) * [Cancel Terminal Refund](../../doc/api/terminal.md#cancel-terminal-refund) +* [Dismiss Terminal Refund](../../doc/api/terminal.md#dismiss-terminal-refund) # Create Terminal Action @@ -199,7 +201,7 @@ def dismiss_terminal_action(self, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `action_id` | `str` | Template, Required | Unique ID for the `TerminalAction` associated with the waiting dialog to be dismissed. | +| `action_id` | `str` | Template, Required | Unique ID for the `TerminalAction` associated with the action to be dismissed. | ## Response Type @@ -377,6 +379,40 @@ elif result.is_error(): ``` +# Dismiss Terminal Checkout + +Dismisses a Terminal checkout request if the status and type of the request permits it. + +```python +def dismiss_terminal_checkout(self, + checkout_id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkout_id` | `str` | Template, Required | Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. | + +## Response Type + +This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Dismiss Terminal Checkout Response`](../../doc/models/dismiss-terminal-checkout-response.md). + +## Example Usage + +```python +checkout_id = 'checkout_id8' + +result = terminal_api.dismiss_terminal_checkout(checkout_id) +print(result) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + # Create Terminal Refund Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](../../doc/api/refunds.md). @@ -530,3 +566,37 @@ elif result.is_error(): print(result.errors) ``` + +# Dismiss Terminal Refund + +Dismisses a Terminal refund request if the status and type of the request permits it. + +```python +def dismiss_terminal_refund(self, + terminal_refund_id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `terminal_refund_id` | `str` | Template, Required | Unique ID for the `TerminalRefund` associated with the refund to be dismissed. | + +## Response Type + +This method returns a `ApiResponse` instance. The `body` property of this instance returns the response data which is of type [`Dismiss Terminal Refund Response`](../../doc/models/dismiss-terminal-refund-response.md). + +## Example Usage + +```python +terminal_refund_id = 'terminal_refund_id0' + +result = terminal_api.dismiss_terminal_refund(terminal_refund_id) +print(result) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + diff --git a/doc/client.md b/doc/client.md index 9446a0b9..365e6a4e 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `square_version` | `str` | Square Connect API versions
*Default*: `'2023-11-15'` | +| `square_version` | `str` | Square Connect API versions
*Default*: `'2023-12-13'` | | `custom_url` | `str` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` | | `environment` | `string` | The API environment.
**Default: `production`** | | `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests | @@ -25,7 +25,7 @@ The API client can be initialized as follows: ```python from square.client import Client client = Client( - square_version='2023-11-15', + square_version='2023-12-13', access_token='AccessToken' ) ``` @@ -48,7 +48,7 @@ API calls return an `ApiResponse` object that includes the following fields: ```python from square.client import Client client = Client( - square_version='2023-11-15', + square_version='2023-12-13', access_token='AccessToken' ) diff --git a/doc/models/batch-retrieve-catalog-objects-request.md b/doc/models/batch-retrieve-catalog-objects-request.md index 41f1cb60..b6de223f 100644 --- a/doc/models/batch-retrieve-catalog-objects-request.md +++ b/doc/models/batch-retrieve-catalog-objects-request.md @@ -13,6 +13,7 @@ | `include_related_objects` | `bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field
of the response. These objects are put in the `related_objects` field. Setting this to `true` is
helpful when the objects are needed for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included. For example,

if the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false` | | `catalog_version` | `long\|int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical versions of objects. The specified version value is matched against
the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will
be from the current version of the catalog. | | `include_deleted_objects` | `bool` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. | +| `include_category_path_to_root` | `bool` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload. | ## Example (as JSON) @@ -24,7 +25,8 @@ "AA27W3M2GGTF3H6AVPNB77CK" ], "catalog_version": 190, - "include_deleted_objects": false + "include_deleted_objects": false, + "include_category_path_to_root": false } ``` diff --git a/doc/models/batch-retrieve-catalog-objects-response.md b/doc/models/batch-retrieve-catalog-objects-response.md index d25be34e..d0e4d750 100644 --- a/doc/models/batch-retrieve-catalog-objects-response.md +++ b/doc/models/batch-retrieve-catalog-objects-response.md @@ -22,7 +22,12 @@ "id": "W62UWFY35CWMYGVWK6TWJDNI", "is_deleted": false, "item_data": { - "category_id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], "description": "Hot Leaf Juice", "name": "Tea", "tax_ids": [ @@ -88,7 +93,12 @@ "id": "AA27W3M2GGTF3H6AVPNB77CK", "is_deleted": false, "item_data": { - "category_id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], "description": "Hot Bean Juice", "name": "Coffee", "tax_ids": [ diff --git a/doc/models/batch-upsert-catalog-objects-request.md b/doc/models/batch-upsert-catalog-objects-request.md index 8c93f598..12b17a94 100644 --- a/doc/models/batch-upsert-catalog-objects-request.md +++ b/doc/models/batch-upsert-catalog-objects-request.md @@ -22,7 +22,11 @@ { "id": "#Tea", "item_data": { - "category_id": "#Beverages", + "categories": [ + { + "id": "#Beverages" + } + ], "description_html": "

Hot Leaf Juice

", "name": "Tea", "tax_ids": [ @@ -84,7 +88,11 @@ { "id": "#Coffee", "item_data": { - "category_id": "#Beverages", + "categories": [ + { + "id": "#Beverages" + } + ], "description_html": "

Hot Bean Juice

", "name": "Coffee", "tax_ids": [ diff --git a/doc/models/batch-upsert-catalog-objects-response.md b/doc/models/batch-upsert-catalog-objects-response.md index 3f2a0bdb..104e7733 100644 --- a/doc/models/batch-upsert-catalog-objects-response.md +++ b/doc/models/batch-upsert-catalog-objects-response.md @@ -21,71 +21,83 @@ "id_mappings": [ { "client_object_id": "#Tea", - "object_id": "ZSDZN34NAXDLC6D5ZQMNSOUM" + "object_id": "67GA7XA2FWMRYY2VCONTYZJR" }, { "client_object_id": "#Coffee", - "object_id": "PJMCEBHHUS3OKDB6PYUHLCPP" + "object_id": "MQ4TZKOG3SR2EQI3TWEK4AH7" }, { "client_object_id": "#Beverages", - "object_id": "LYT72K3WGJFFCIMB63XARP3I" + "object_id": "XCS4SCGN4WQYE2VU4U3TKXEH" }, { "client_object_id": "#SalesTax", - "object_id": "XHSHLHNWSI3HVI4BW5ZUZXI3" + "object_id": "HP5VNYPKZKTNCKZ2Z5NPUH6A" }, { "client_object_id": "#Tea_Mug", - "object_id": "NAYHET5R52MIYCEF34ZMAHFM" + "object_id": "CAJBHUIQH7ONTSZI2KTVOUP6" }, { "client_object_id": "#Coffee_Regular", - "object_id": "OTYDX45SPG7LJQUVCBZI4INH" + "object_id": "GY2GXJTVVPQAPW43GFRR3NG6" }, { "client_object_id": "#Coffee_Large", - "object_id": "GZDA3JB37FYVOPI4AOEBOITI" + "object_id": "JE6VHPSRQL6IWSN26C36CJ7W" } ], "objects": [ { - "id": "ZSDZN34NAXDLC6D5ZQMNSOUM", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "67GA7XA2FWMRYY2VCONTYZJR", "is_deleted": false, "item_data": { - "category_id": "LYT72K3WGJFFCIMB63XARP3I", + "categories": [ + { + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "ordinal": -2251731094208512 + } + ], "description": "Hot Leaf Juice", "description_html": "

Hot Leaf Juice

", "description_plaintext": "Hot Leaf Juice", + "is_archived": false, + "is_taxable": true, "name": "Tea", + "product_type": "REGULAR", "tax_ids": [ - "XHSHLHNWSI3HVI4BW5ZUZXI3" + "HP5VNYPKZKTNCKZ2Z5NPUH6A" ], "variations": [ { - "id": "NAYHET5R52MIYCEF34ZMAHFM", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "CAJBHUIQH7ONTSZI2KTVOUP6", "is_deleted": false, "item_variation_data": { - "item_id": "ZSDZN34NAXDLC6D5ZQMNSOUM", + "item_id": "67GA7XA2FWMRYY2VCONTYZJR", "name": "Mug", "ordinal": 0, "price_money": { "amount": 150, "currency": "USD" }, - "pricing_type": "FIXED_PRICING" + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true }, "present_at_all_locations": true, "type": "ITEM_VARIATION", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798 + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 } ] }, "present_at_all_locations": true, "type": "ITEM", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798, + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400, "custom_attribute_values": { "key0": { "name": "name8", @@ -118,60 +130,75 @@ ] }, { - "id": "PJMCEBHHUS3OKDB6PYUHLCPP", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "MQ4TZKOG3SR2EQI3TWEK4AH7", "is_deleted": false, "item_data": { - "category_id": "LYT72K3WGJFFCIMB63XARP3I", + "categories": [ + { + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", + "ordinal": -2251662374731776 + } + ], "description": "Hot Bean Juice", "description_html": "

Hot Bean Juice

", "description_plaintext": "Hot Bean Juice", + "is_archived": false, + "is_taxable": true, "name": "Coffee", + "product_type": "REGULAR", "tax_ids": [ - "XHSHLHNWSI3HVI4BW5ZUZXI3" + "HP5VNYPKZKTNCKZ2Z5NPUH6A" ], "variations": [ { - "id": "OTYDX45SPG7LJQUVCBZI4INH", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "GY2GXJTVVPQAPW43GFRR3NG6", "is_deleted": false, "item_variation_data": { - "item_id": "PJMCEBHHUS3OKDB6PYUHLCPP", + "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", "name": "Regular", "ordinal": 0, "price_money": { "amount": 250, "currency": "USD" }, - "pricing_type": "FIXED_PRICING" + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true }, "present_at_all_locations": true, "type": "ITEM_VARIATION", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798 + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 }, { - "id": "GZDA3JB37FYVOPI4AOEBOITI", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "JE6VHPSRQL6IWSN26C36CJ7W", "is_deleted": false, "item_variation_data": { - "item_id": "PJMCEBHHUS3OKDB6PYUHLCPP", + "item_id": "MQ4TZKOG3SR2EQI3TWEK4AH7", "name": "Large", "ordinal": 1, "price_money": { "amount": 350, "currency": "USD" }, - "pricing_type": "FIXED_PRICING" + "pricing_type": "FIXED_PRICING", + "sellable": true, + "stockable": true }, "present_at_all_locations": true, "type": "ITEM_VARIATION", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798 + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400 } ] }, "present_at_all_locations": true, "type": "ITEM", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798, + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400, "custom_attribute_values": { "key0": { "name": "name8", @@ -205,14 +232,21 @@ }, { "category_data": { - "name": "Beverages" + "category_type": "REGULAR_CATEGORY", + "is_top_level": true, + "name": "Beverages", + "online_visibility": true, + "parent_category": { + "ordinal": -2250837741010944 + } }, - "id": "LYT72K3WGJFFCIMB63XARP3I", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "XCS4SCGN4WQYE2VU4U3TKXEH", "is_deleted": false, "present_at_all_locations": true, "type": "CATEGORY", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798, + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400, "custom_attribute_values": { "key0": { "name": "name8", @@ -245,7 +279,8 @@ ] }, { - "id": "XHSHLHNWSI3HVI4BW5ZUZXI3", + "created_at": "2023-11-30T19:24:35.4Z", + "id": "HP5VNYPKZKTNCKZ2Z5NPUH6A", "is_deleted": false, "present_at_all_locations": true, "tax_data": { @@ -257,8 +292,8 @@ "percentage": "5.0" }, "type": "TAX", - "updated_at": "2017-05-10T18:48:39.798Z", - "version": 1494442119798, + "updated_at": "2023-11-30T19:24:35.4Z", + "version": 1701372275400, "custom_attribute_values": { "key0": { "name": "name8", diff --git a/doc/models/catalog-availability-period.md b/doc/models/catalog-availability-period.md new file mode 100644 index 00000000..f151d556 --- /dev/null +++ b/doc/models/catalog-availability-period.md @@ -0,0 +1,27 @@ + +# Catalog Availability Period + +Represents a time period of availability. + +## Structure + +`Catalog Availability Period` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `start_local_time` | `str` | Optional | The start time of an availability period, specified in local time using partial-time
RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning.
Note that the seconds value is always :00, but it is appended for conformance to the RFC. | +| `end_local_time` | `str` | Optional | The end time of an availability period, specified in local time using partial-time
RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening.
Note that the seconds value is always :00, but it is appended for conformance to the RFC. | +| `day_of_week` | [`str (Day of Week)`](../../doc/models/day-of-week.md) | Optional | Indicates the specific day of the week. | + +## Example (as JSON) + +```json +{ + "start_local_time": "start_local_time6", + "end_local_time": "end_local_time8", + "day_of_week": "WED" +} +``` + diff --git a/doc/models/catalog-category-type.md b/doc/models/catalog-category-type.md new file mode 100644 index 00000000..ca2639f3 --- /dev/null +++ b/doc/models/catalog-category-type.md @@ -0,0 +1,17 @@ + +# Catalog Category Type + +Indicates the type of a category. + +## Enumeration + +`Catalog Category Type` + +## Fields + +| Name | Description | +| --- | --- | +| `REGULAR_CATEGORY` | The regular category. | +| `MENU_CATEGORY` | The menu category. | +| `KITCHEN_CATEGORY` | Kitchen categories are used by KDS (Kitchen Display System) to route items to specific clients | + diff --git a/doc/models/catalog-category.md b/doc/models/catalog-category.md index 51a85d23..9a1ea97a 100644 --- a/doc/models/catalog-category.md +++ b/doc/models/catalog-category.md @@ -13,6 +13,15 @@ A category to which a `CatalogItem` instance belongs. | --- | --- | --- | --- | | `name` | `str` | Optional | The category name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | | `image_ids` | `List[str]` | Optional | The IDs of images associated with this `CatalogCategory` instance.
Currently these images are not displayed by Square, but are free to be displayed in 3rd party applications. | +| `category_type` | [`str (Catalog Category Type)`](../../doc/models/catalog-category-type.md) | Optional | Indicates the type of a category. | +| `parent_category` | [`Catalog Object Category`](../../doc/models/catalog-object-category.md) | Optional | A category that can be assigned to an item or a parent category that can be assigned
to another category. For example, a clothing category can be assigned to a t-shirt item or
be made as the parent category to the pants category. | +| `is_top_level` | `bool` | Optional | Indicates whether a category is a top level category, which does not have any parent_category. | +| `channels` | `List[str]` | Optional | A list of IDs representing channels, such as a Square Online site, where the category can be made visible. | +| `availability_period_ids` | `List[str]` | Optional | The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. | +| `online_visibility` | `bool` | Optional | Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites. | +| `root_category` | `str` | Optional | The top-level category in a category hierarchy. | +| `ecom_seo_data` | [`Catalog Ecom Seo Data`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | +| `path_to_root` | [`List Category Path to Root Node`](../../doc/models/category-path-to-root-node.md) | Optional | The path from the category to its root category. The first node of the path is the parent of the category
and the last is the root category. The path is empty if the category is a root category. | ## Example (as JSON) @@ -31,7 +40,13 @@ A category to which a `CatalogItem` instance belongs. "image_ids7", "image_ids6", "image_ids5" - ] + ], + "category_type": "REGULAR_CATEGORY", + "parent_category": { + "id": "id4", + "ordinal": 114 + }, + "is_top_level": false } ``` diff --git a/doc/models/catalog-ecom-seo-data.md b/doc/models/catalog-ecom-seo-data.md new file mode 100644 index 00000000..e6b850db --- /dev/null +++ b/doc/models/catalog-ecom-seo-data.md @@ -0,0 +1,27 @@ + +# Catalog Ecom Seo Data + +SEO data for for a seller's Square Online store. + +## Structure + +`Catalog Ecom Seo Data` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `page_title` | `str` | Optional | The SEO title used for the Square Online store. | +| `page_description` | `str` | Optional | The SEO description used for the Square Online store. | +| `permalink` | `str` | Optional | The SEO permalink used for the Square Online store. | + +## Example (as JSON) + +```json +{ + "page_title": "page_title6", + "page_description": "page_description2", + "permalink": "permalink0" +} +``` + diff --git a/doc/models/catalog-item-variation.md b/doc/models/catalog-item-variation.md index 5a560a59..49159468 100644 --- a/doc/models/catalog-item-variation.md +++ b/doc/models/catalog-item-variation.md @@ -21,7 +21,7 @@ decreases by 2, and the stockable count automatically decreases by 0.4 bottle ac | Name | Type | Tags | Description | | --- | --- | --- | --- | | `item_id` | `str` | Optional | The ID of the `CatalogItem` associated with this item variation. | -| `name` | `str` | Optional | The item variation's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `name` | `str` | Optional | The item variation's name. This is a searchable attribute for use in applicable query filters.

Its value has a maximum length of 255 Unicode code points. However, when the parent [item](entity:CatalogItem)
uses [item options](entity:CatalogItemOption), this attribute is auto-generated, read-only, and can be
longer than 255 Unicode code points. | | `sku` | `str` | Optional | The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. | | `upc` | `str` | Optional | The universal product code (UPC) of the item variation, if any. This is a searchable attribute for use in applicable query filters.

The value of this attribute should be a number of 12-14 digits long. This restriction is enforced on the Square Seller Dashboard,
Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If a non-compliant UPC value is assigned
to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of Sale or Retail Point of Sale apps
unless it is updated to fit the expected format. | | `ordinal` | `int` | Optional | The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal
for each item variation within a parent `CatalogItem` is set according to the item variations's
position. On reads, the value is not guaranteed to be sequential or unique. | diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md index de07c9dd..2deafad0 100644 --- a/doc/models/catalog-item.md +++ b/doc/models/catalog-item.md @@ -18,7 +18,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ | `available_online` | `bool` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. | | `available_for_pickup` | `bool` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. | | `available_electronically` | `bool` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | -| `category_id` | `str` | Optional | The ID of the item's category, if any. | +| `category_id` | `str` | Optional | The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, instead. | | `tax_ids` | `List[str]` | Optional | A set of IDs indicating the taxes enabled for
this item. When updating an item, any taxes listed here will be added to the item.
Taxes may also be added to or deleted from an item using `UpdateItemTaxes`. | | `modifier_list_info` | [`List Catalog Item Modifier List Info`](../../doc/models/catalog-item-modifier-list-info.md) | Optional | A set of `CatalogItemModifierListInfo` objects
representing the modifier lists that apply to this item, along with the overrides and min
and max limits that are specific to this item. Modifier lists
may also be added to or deleted from an item using `UpdateItemModifierLists`. | | `variations` | [`List Catalog Object`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have
at least one variation. | @@ -27,9 +27,13 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ | `item_options` | [`List Catalog Item Option for Item`](../../doc/models/catalog-item-option-for-item.md) | Optional | List of item options IDs for this item. Used to manage and group item
variations in a specified order.

Maximum: 6 item options. | | `image_ids` | `List[str]` | Optional | The IDs of images associated with this `CatalogItem` instance.
These images will be shown to customers in Square Online Store.
The first image will show up as the icon for this item in POS. | | `sort_name` | `str` | Optional | A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting.
Its value must not be empty.

It is currently supported for sellers of the Japanese locale only. | +| `categories` | [`List Catalog Object Category`](../../doc/models/catalog-object-category.md) | Optional | The list of categories. | | `description_html` | `str` | Optional | The item's description as expressed in valid HTML elements. The length of this field value, including those of HTML tags,
is of Unicode points. With application query filters, the text values of the HTML elements and attributes are searchable. Invalid or
unsupported HTML elements or attributes are ignored.

Supported HTML elements include:

- `a`: Link. Supports linking to website URLs, email address, and telephone numbers.
- `b`, `strong`: Bold text
- `br`: Line break
- `code`: Computer code
- `div`: Section
- `h1-h6`: Headings
- `i`, `em`: Italics
- `li`: List element
- `ol`: Numbered list
- `p`: Paragraph
- `ul`: Bullet list
- `u`: Underline

Supported HTML attributes include:

- `align`: Alignment of the text content
- `href`: Link destination
- `rel`: Relationship between link's target and source
- `target`: Place to open the linked document
**Constraints**: *Maximum Length*: `65535` | | `description_plaintext` | `str` | Optional | A server-generated plaintext version of the `description_html` field, without formatting tags.
**Constraints**: *Maximum Length*: `65535` | +| `channels` | `List[str]` | Optional | A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. | | `is_archived` | `bool` | Optional | Indicates whether this item is archived (`true`) or not (`false`). | +| `ecom_seo_data` | [`Catalog Ecom Seo Data`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | +| `reporting_category` | [`Catalog Object Category`](../../doc/models/catalog-object-category.md) | Optional | A category that can be assigned to an item or a parent category that can be assigned
to another category. For example, a clothing category can be assigned to a t-shirt item or
be made as the parent category to the pants category. | ## Example (as JSON) diff --git a/doc/models/catalog-object-category.md b/doc/models/catalog-object-category.md new file mode 100644 index 00000000..b00822e4 --- /dev/null +++ b/doc/models/catalog-object-category.md @@ -0,0 +1,27 @@ + +# Catalog Object Category + +A category that can be assigned to an item or a parent category that can be assigned +to another category. For example, a clothing category can be assigned to a t-shirt item or +be made as the parent category to the pants category. + +## Structure + +`Catalog Object Category` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | The ID of the object's category. | +| `ordinal` | `long\|int` | Optional | The order of the object within the context of the category. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "ordinal": 8 +} +``` + diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md index d54c51a3..27e7a0b8 100644 --- a/doc/models/catalog-object.md +++ b/doc/models/catalog-object.md @@ -48,6 +48,7 @@ For a more detailed discussion of the Catalog data model, please see the | `custom_attribute_definition_data` | [`Catalog Custom Attribute Definition`](../../doc/models/catalog-custom-attribute-definition.md) | Optional | Contains information defining a custom attribute. Custom attributes are
intended to store additional information about a catalog object or to associate a
catalog object with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.).
[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) | | `quick_amounts_settings_data` | [`Catalog Quick Amounts Settings`](../../doc/models/catalog-quick-amounts-settings.md) | Optional | A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. | | `subscription_plan_variation_data` | [`Catalog Subscription Plan Variation`](../../doc/models/catalog-subscription-plan-variation.md) | Optional | Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold.
For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). | +| `availability_period_data` | [`Catalog Availability Period`](../../doc/models/catalog-availability-period.md) | Optional | Represents a time period of availability. | ## Example (as JSON) diff --git a/doc/models/catalog-query.md b/doc/models/catalog-query.md index 92d10c3b..b6b675ca 100644 --- a/doc/models/catalog-query.md +++ b/doc/models/catalog-query.md @@ -11,14 +11,15 @@ Any combination of the following types may be used together: - [range_query](../../doc/models/catalog-query-range.md) - [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md) - [text_query](../../doc/models/catalog-query-text.md) - All other query types cannot be combined with any others. + +All other query types cannot be combined with any others. When a query filter is based on an attribute, the attribute must be searchable. Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters. -* Searchable attribute and objects queryable by searchable attributes ** +Searchable attribute and objects queryable by searchable attributes: -- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, 'CatalogModifierList`,`CatalogItemOption`,`CatalogItemOptionValue` +- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue` - `description`: `CatalogItem`, `CatalogItemOptionValue` - `abbreviation`: `CatalogItem` - `upc`: `CatalogItemVariation` diff --git a/doc/models/category-path-to-root-node.md b/doc/models/category-path-to-root-node.md new file mode 100644 index 00000000..4f26ac37 --- /dev/null +++ b/doc/models/category-path-to-root-node.md @@ -0,0 +1,25 @@ + +# Category Path to Root Node + +A node in the path from a retrieved category to its root node. + +## Structure + +`Category Path to Root Node` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `category_id` | `str` | Optional | The category's ID. | +| `category_name` | `str` | Optional | The category's name. | + +## Example (as JSON) + +```json +{ + "category_id": "category_id0", + "category_name": "category_name0" +} +``` + diff --git a/doc/models/checkout-location-settings-branding-button-shape.md b/doc/models/checkout-location-settings-branding-button-shape.md new file mode 100644 index 00000000..9fdf539c --- /dev/null +++ b/doc/models/checkout-location-settings-branding-button-shape.md @@ -0,0 +1,15 @@ + +# Checkout Location Settings Branding Button Shape + +## Enumeration + +`Checkout Location Settings Branding Button Shape` + +## Fields + +| Name | +| --- | +| `SQUARED` | +| `ROUNDED` | +| `PILL` | + diff --git a/doc/models/checkout-location-settings-branding-header-type.md b/doc/models/checkout-location-settings-branding-header-type.md new file mode 100644 index 00000000..fe288e95 --- /dev/null +++ b/doc/models/checkout-location-settings-branding-header-type.md @@ -0,0 +1,15 @@ + +# Checkout Location Settings Branding Header Type + +## Enumeration + +`Checkout Location Settings Branding Header Type` + +## Fields + +| Name | +| --- | +| `BUSINESS_NAME` | +| `FRAMED_LOGO` | +| `FULL_WIDTH_LOGO` | + diff --git a/doc/models/checkout-location-settings-branding.md b/doc/models/checkout-location-settings-branding.md new file mode 100644 index 00000000..696b7dae --- /dev/null +++ b/doc/models/checkout-location-settings-branding.md @@ -0,0 +1,25 @@ + +# Checkout Location Settings Branding + +## Structure + +`Checkout Location Settings Branding` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `header_type` | [`str (Checkout Location Settings Branding Header Type)`](../../doc/models/checkout-location-settings-branding-header-type.md) | Optional | - | +| `button_color` | `str` | Optional | The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF").
**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7` | +| `button_shape` | [`str (Checkout Location Settings Branding Button Shape)`](../../doc/models/checkout-location-settings-branding-button-shape.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "header_type": "FULL_WIDTH_LOGO", + "button_color": "button_color2", + "button_shape": "ROUNDED" +} +``` + diff --git a/doc/models/checkout-location-settings-coupons.md b/doc/models/checkout-location-settings-coupons.md new file mode 100644 index 00000000..b7d8d0c4 --- /dev/null +++ b/doc/models/checkout-location-settings-coupons.md @@ -0,0 +1,21 @@ + +# Checkout Location Settings Coupons + +## Structure + +`Checkout Location Settings Coupons` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `enabled` | `bool` | Optional | Indicates whether coupons are enabled for this location. | + +## Example (as JSON) + +```json +{ + "enabled": false +} +``` + diff --git a/doc/models/checkout-location-settings-policy.md b/doc/models/checkout-location-settings-policy.md new file mode 100644 index 00000000..c899c995 --- /dev/null +++ b/doc/models/checkout-location-settings-policy.md @@ -0,0 +1,25 @@ + +# Checkout Location Settings Policy + +## Structure + +`Checkout Location Settings Policy` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `str` | Optional | A unique ID to identify the policy when making changes. You must set the UID for policy updates, but it’s optional when setting new policies. | +| `title` | `str` | Optional | The title of the policy. This is required when setting the description, though you can update it in a different request.
**Constraints**: *Maximum Length*: `50` | +| `description` | `str` | Optional | The description of the policy.
**Constraints**: *Maximum Length*: `4096` | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "title": "title6", + "description": "description0" +} +``` + diff --git a/doc/models/checkout-location-settings-tipping.md b/doc/models/checkout-location-settings-tipping.md new file mode 100644 index 00000000..bb0cdf7c --- /dev/null +++ b/doc/models/checkout-location-settings-tipping.md @@ -0,0 +1,48 @@ + +# Checkout Location Settings Tipping + +## Structure + +`Checkout Location Settings Tipping` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `percentages` | `List[int]` | Optional | Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. | +| `smart_tipping_enabled` | `bool` | Optional | Enables Smart Tip Amounts. If Smart Tip Amounts is enabled, tipping works as follows:
If a transaction is less than $10, the available tipping options include No Tip, $1, $2, or $3.
If a transaction is $10 or more, the available tipping options include No Tip, 15%, 20%, or 25%.
You can set custom percentage amounts with the `percentages` field. | +| `default_percent` | `int` | Optional | Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. | +| `smart_tips` | [`List Money`](../../doc/models/money.md) | Optional | Show the Smart Tip Amounts for this location. | +| `default_smart_tip` | [`Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | + +## Example (as JSON) + +```json +{ + "percentages": [ + 192, + 193 + ], + "smart_tipping_enabled": false, + "default_percent": 72, + "smart_tips": [ + { + "amount": 152, + "currency": "USN" + }, + { + "amount": 152, + "currency": "USN" + }, + { + "amount": 152, + "currency": "USN" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "XTS" + } +} +``` + diff --git a/doc/models/checkout-location-settings.md b/doc/models/checkout-location-settings.md new file mode 100644 index 00000000..1ac50cb3 --- /dev/null +++ b/doc/models/checkout-location-settings.md @@ -0,0 +1,67 @@ + +# Checkout Location Settings + +## Structure + +`Checkout Location Settings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `location_id` | `str` | Optional | The ID of the location that these settings apply to. | +| `customer_notes_enabled` | `bool` | Optional | Indicates whether customers are allowed to leave notes at checkout. | +| `policies` | [`List Checkout Location Settings Policy`](../../doc/models/checkout-location-settings-policy.md) | Optional | Policy information is displayed at the bottom of the checkout pages.
You can set a maximum of two policies. | +| `branding` | [`Checkout Location Settings Branding`](../../doc/models/checkout-location-settings-branding.md) | Optional | - | +| `tipping` | [`Checkout Location Settings Tipping`](../../doc/models/checkout-location-settings-tipping.md) | Optional | - | +| `coupons` | [`Checkout Location Settings Coupons`](../../doc/models/checkout-location-settings-coupons.md) | Optional | - | +| `updated_at` | `str` | Optional | The timestamp when the settings were last updated, in RFC 3339 format.
Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
UTC: 2020-01-26T02:25:34Z
Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 | + +## Example (as JSON) + +```json +{ + "location_id": "location_id4", + "customer_notes_enabled": false, + "policies": [ + { + "uid": "uid8", + "title": "title4", + "description": "description8" + }, + { + "uid": "uid8", + "title": "title4", + "description": "description8" + } + ], + "branding": { + "header_type": "FULL_WIDTH_LOGO", + "button_color": "button_color2", + "button_shape": "PILL" + }, + "tipping": { + "percentages": [ + 246, + 247 + ], + "smart_tipping_enabled": false, + "default_percent": 46, + "smart_tips": [ + { + "amount": 152, + "currency": "USN" + }, + { + "amount": 152, + "currency": "USN" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "XTS" + } + } +} +``` + diff --git a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md new file mode 100644 index 00000000..ffe896ba --- /dev/null +++ b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md @@ -0,0 +1,31 @@ + +# Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range + +A range of purchase price that qualifies. + +## Structure + +`Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `min` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | +| `max` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | + +## Example (as JSON) + +```json +{ + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } +} +``` + diff --git a/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md new file mode 100644 index 00000000..e2658259 --- /dev/null +++ b/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md @@ -0,0 +1,45 @@ + +# Checkout Merchant Settings Payment Methods Afterpay Clearpay + +The settings allowed for AfterpayClearpay. + +## Structure + +`Checkout Merchant Settings Payment Methods Afterpay Clearpay` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order_eligibility_range` | [`Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | +| `item_eligibility_range` | [`Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | +| `enabled` | `bool` | Optional | Indicates whether the payment method is enabled for the account. | + +## Example (as JSON) + +```json +{ + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "enabled": false +} +``` + diff --git a/doc/models/checkout-merchant-settings-payment-methods-payment-method.md b/doc/models/checkout-merchant-settings-payment-methods-payment-method.md new file mode 100644 index 00000000..6e5edeb0 --- /dev/null +++ b/doc/models/checkout-merchant-settings-payment-methods-payment-method.md @@ -0,0 +1,23 @@ + +# Checkout Merchant Settings Payment Methods Payment Method + +The settings allowed for a payment method. + +## Structure + +`Checkout Merchant Settings Payment Methods Payment Method` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `enabled` | `bool` | Optional | Indicates whether the payment method is enabled for the account. | + +## Example (as JSON) + +```json +{ + "enabled": false +} +``` + diff --git a/doc/models/checkout-merchant-settings-payment-methods.md b/doc/models/checkout-merchant-settings-payment-methods.md new file mode 100644 index 00000000..f74a4977 --- /dev/null +++ b/doc/models/checkout-merchant-settings-payment-methods.md @@ -0,0 +1,55 @@ + +# Checkout Merchant Settings Payment Methods + +## Structure + +`Checkout Merchant Settings Payment Methods` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `apple_pay` | [`Checkout Merchant Settings Payment Methods Payment Method`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | +| `google_pay` | [`Checkout Merchant Settings Payment Methods Payment Method`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | +| `cash_app` | [`Checkout Merchant Settings Payment Methods Payment Method`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | +| `afterpay_clearpay` | [`Checkout Merchant Settings Payment Methods Afterpay Clearpay`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md) | Optional | The settings allowed for AfterpayClearpay. | + +## Example (as JSON) + +```json +{ + "apple_pay": { + "enabled": false + }, + "google_pay": { + "enabled": false + }, + "cash_app": { + "enabled": false + }, + "afterpay_clearpay": { + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "enabled": false + } +} +``` + diff --git a/doc/models/checkout-merchant-settings.md b/doc/models/checkout-merchant-settings.md new file mode 100644 index 00000000..8576a82e --- /dev/null +++ b/doc/models/checkout-merchant-settings.md @@ -0,0 +1,56 @@ + +# Checkout Merchant Settings + +## Structure + +`Checkout Merchant Settings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payment_methods` | [`Checkout Merchant Settings Payment Methods`](../../doc/models/checkout-merchant-settings-payment-methods.md) | Optional | - | +| `updated_at` | `str` | Optional | The timestamp when the settings were last updated, in RFC 3339 format.
Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
UTC: 2020-01-26T02:25:34Z
Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 | + +## Example (as JSON) + +```json +{ + "payment_methods": { + "apple_pay": { + "enabled": false + }, + "google_pay": { + "enabled": false + }, + "cash_app": { + "enabled": false + }, + "afterpay_clearpay": { + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "enabled": false + } + }, + "updated_at": "updated_at0" +} +``` + diff --git a/doc/models/dismiss-terminal-checkout-response.md b/doc/models/dismiss-terminal-checkout-response.md new file mode 100644 index 00000000..a25ae2a3 --- /dev/null +++ b/doc/models/dismiss-terminal-checkout-response.md @@ -0,0 +1,76 @@ + +# Dismiss Terminal Checkout Response + +## Structure + +`Dismiss Terminal Checkout Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `checkout` | [`Terminal Checkout`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "app_id": "APP_ID", + "created_at": "2023-11-29T14:59:50.682Z", + "deadline_duration": "PT5M", + "device_options": { + "collect_signature": true, + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "loyalty_settings": { + "loyalty_screen_max_display_duration": "PT60S", + "show_card_linked_reward_redemption_screen": false, + "show_loyalty_screen": false, + "show_non_qualifying_loyalty_screen": false + }, + "skip_receipt_screen": false, + "tip_settings": { + "allow_tipping": true, + "custom_tip_field": false, + "separate_tip_screen": true, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "show_itemized_cart": false + }, + "id": "LmZEKbo3SBfqO", + "location_id": "LOCATION_ID", + "payment_ids": [ + "D7vLJqMkvSoAlX4yyFzUitOy4EPZY" + ], + "payment_options": { + "autocomplete": true, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + }, + "payment_type": "CARD_PRESENT", + "status": "COMPLETED", + "updated_at": "2023-11-29T15:00:18.936Z", + "reference_id": "reference_id0", + "note": "note8", + "order_id": "order_id6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/dismiss-terminal-refund-response.md b/doc/models/dismiss-terminal-refund-response.md new file mode 100644 index 00000000..0bb33121 --- /dev/null +++ b/doc/models/dismiss-terminal-refund-response.md @@ -0,0 +1,92 @@ + +# Dismiss Terminal Refund Response + +## Structure + +`Dismiss Terminal Refund Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `refund` | [`Terminal Refund`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | + +## Example (as JSON) + +```json +{ + "refund": { + "amount_money": { + "amount": 111, + "currency": "CAD" + }, + "app_id": "APP_ID", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 12, + "exp_year": 2024, + "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp4qQDGIPtxnFvTTWoqdfdP6TV8gLsSxoztXA", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_details": { + "auth_result_code": "RNy6Lf", + "avs_status": "AVS_ACCEPTED", + "card": { + "bin": "411111", + "card_brand": "VISA", + "card_type": "DEBIT", + "exp_month": 12, + "exp_year": 2024, + "fingerprint": "sq-1-ElNeDpZZqUBNDI7yNghyKO-o0yLXASp3qQDGIPtxnFvTTWoqdfdP6TV9gLsSxoztXA", + "last_4": "1111", + "prepaid_type": "NOT_PREPAID" + }, + "card_payment_timeline": { + "authorized_at": "2023-11-30T16:15:06.645Z", + "captured_at": "2023-11-30T16:15:13.272Z" + }, + "cvv_status": "CVV_ACCEPTED", + "device_details": { + "device_credential": { + "name": "Terminal API Device created on Nov 2, 2023", + "token": "9BFDXEYKB7H8Y" + }, + "device_id": "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + "device_installation_id": "0ef67d8e-61a3-4418-a0be-c143bfe6108d" + }, + "entry_method": "SWIPED", + "statement_description": "SQ TREATS", + "status": "CAPTURED" + }, + "created_at": "2023-11-30T16:16:39.299Z", + "deadline_duration": "PT5M", + "device_id": "47776348fd8b32b9", + "id": "vjkNb2HD-xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", + "order_id": "s8OMhQcpEp1b61YywlccSHWqUaQZY", + "payment_id": "xq5kiWWiJ7RhwrQnkxIn2N0l1nPZY", + "reason": "Returning item", + "status": "IN_PROGRESS", + "updated_at": "2023-11-30T16:16:57.863Z", + "refund_id": "refund_id2" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/retrieve-catalog-object-request.md b/doc/models/retrieve-catalog-object-request.md index ce825286..ee3edce8 100644 --- a/doc/models/retrieve-catalog-object-request.md +++ b/doc/models/retrieve-catalog-object-request.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `include_related_objects` | `bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field
of the response. These objects are put in the `related_objects` field. Setting this to `true` is
helpful when the objects are needed for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included. For example,

if the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false` | | `catalog_version` | `long\|int` | Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will
be from the current version of the catalog. | +| `include_category_path_to_root` | `bool` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload. | ## Example (as JSON) ```json { "include_related_objects": false, - "catalog_version": 224 + "catalog_version": 224, + "include_category_path_to_root": false } ``` diff --git a/doc/models/retrieve-catalog-object-response.md b/doc/models/retrieve-catalog-object-response.md index c57416e7..b5cd2135 100644 --- a/doc/models/retrieve-catalog-object-response.md +++ b/doc/models/retrieve-catalog-object-response.md @@ -21,7 +21,12 @@ "id": "W62UWFY35CWMYGVWK6TWJDNI", "is_deleted": false, "item_data": { - "category_id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "categories": [ + { + "id": "BJNQCF2FJ6S6UIDT65ABHLRX", + "ordinal": 0 + } + ], "description": "Hot Leaf Juice", "name": "Tea", "tax_ids": [ diff --git a/doc/models/retrieve-location-settings-response.md b/doc/models/retrieve-location-settings-response.md new file mode 100644 index 00000000..ab00091d --- /dev/null +++ b/doc/models/retrieve-location-settings-response.md @@ -0,0 +1,93 @@ + +# Retrieve Location Settings Response + +## Structure + +`Retrieve Location Settings Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `location_settings` | [`Checkout Location Settings`](../../doc/models/checkout-location-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "location_settings": { + "branding": { + "button_color": "#ffffff", + "button_shape": "ROUNDED", + "header_type": "FRAMED_LOGO" + }, + "customer_notes_enabled": true, + "location_id": "LOCATION_ID_1", + "policies": [ + { + "description": "This is my Return Policy", + "title": "Return Policy", + "uid": "POLICY_ID_1" + } + ], + "tipping": { + "default_percent": 15, + "default_whole_amount_money": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 10, + 15, + 20 + ], + "smart_tipping_enabled": true, + "whole_amounts": [ + { + "amount": 1000, + "currency": "USD" + }, + { + "amount": 1500, + "currency": "USD" + }, + { + "amount": 2000, + "currency": "USD" + } + ], + "smart_tips": [ + { + "amount": 152, + "currency": "USN" + }, + { + "amount": 152, + "currency": "USN" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "XTS" + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/retrieve-merchant-settings-response.md b/doc/models/retrieve-merchant-settings-response.md new file mode 100644 index 00000000..1825c70b --- /dev/null +++ b/doc/models/retrieve-merchant-settings-response.md @@ -0,0 +1,80 @@ + +# Retrieve Merchant Settings Response + +## Structure + +`Retrieve Merchant Settings Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `merchant_settings` | [`Checkout Merchant Settings`](../../doc/models/checkout-merchant-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "merchant_settings": { + "merchant_id": "MERCHANT_ID", + "payment_methods": { + "afterpay_clearpay": { + "available": true, + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "available": true, + "enabled": true + }, + "cash_app_pay": { + "available": true, + "enabled": true + }, + "google_pay": { + "available": true, + "enabled": true + }, + "cash_app": { + "enabled": false + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/search-catalog-objects-request.md b/doc/models/search-catalog-objects-request.md index 6a116687..0ca4347b 100644 --- a/doc/models/search-catalog-objects-request.md +++ b/doc/models/search-catalog-objects-request.md @@ -14,8 +14,9 @@ | `include_deleted_objects` | `bool` | Optional | If `true`, deleted objects will be included in the results. Deleted objects will have their
`is_deleted` field set to `true`. | | `include_related_objects` | `bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects. Related objects are objects that are referenced by object ID by the objects
in the response. This is helpful if the objects are being fetched for immediate display to a user.
This process only goes one level deep. Objects referenced by the related objects will not be included.
For example:

If the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response.

Default value: `false` | | `begin_time` | `str` | Optional | Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), in RFC 3339
format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a
timestamp equal to `begin_time` will not be included in the response. | -| `query` | [`Catalog Query`](../../doc/models/catalog-query.md) | Optional | A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](../../doc/api/catalog.md#search-catalog-objects).
Any combination of the following types may be used together:

- [exact_query](../../doc/models/catalog-query-exact.md)
- [prefix_query](../../doc/models/catalog-query-prefix.md)
- [range_query](../../doc/models/catalog-query-range.md)
- [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md)
- [text_query](../../doc/models/catalog-query-text.md)
All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

* Searchable attribute and objects queryable by searchable attributes **

- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, 'CatalogModifierList`,`CatalogItemOption`,`CatalogItemOptionValue`
- `description`: `CatalogItem`, `CatalogItemOptionValue`
- `abbreviation`: `CatalogItem`
- `upc`: `CatalogItemVariation`
- `sku`: `CatalogItemVariation`
- `caption`: `CatalogImage`
- `display_name`: `CatalogItemOption`

For example, to search for [CatalogItem](../../doc/models/catalog-item.md) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. | +| `query` | [`Catalog Query`](../../doc/models/catalog-query.md) | Optional | A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](../../doc/api/catalog.md#search-catalog-objects).
Any combination of the following types may be used together:

- [exact_query](../../doc/models/catalog-query-exact.md)
- [prefix_query](../../doc/models/catalog-query-prefix.md)
- [range_query](../../doc/models/catalog-query-range.md)
- [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md)
- [text_query](../../doc/models/catalog-query-text.md)

All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

Searchable attribute and objects queryable by searchable attributes:

- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, `CatalogModifierList`, `CatalogItemOption`, `CatalogItemOptionValue`
- `description`: `CatalogItem`, `CatalogItemOptionValue`
- `abbreviation`: `CatalogItem`
- `upc`: `CatalogItemVariation`
- `sku`: `CatalogItemVariation`
- `caption`: `CatalogImage`
- `display_name`: `CatalogItemOption`

For example, to search for [CatalogItem](../../doc/models/catalog-item.md) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. | | `limit` | `int` | Optional | A limit on the number of results to be returned in a single page. The limit is advisory -
the implementation may return more or fewer results. If the supplied limit is negative, zero, or
is higher than the maximum limit of 1,000, it will be ignored. | +| `include_category_path_to_root` | `bool` | Optional | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
in the response payload. | ## Example (as JSON) diff --git a/doc/models/search-catalog-objects-response.md b/doc/models/search-catalog-objects-response.md index 1281398b..8148f04e 100644 --- a/doc/models/search-catalog-objects-response.md +++ b/doc/models/search-catalog-objects-response.md @@ -24,7 +24,12 @@ "id": "X5DZ5NWWAQ44CKBLKIFQGOWK", "is_deleted": false, "item_data": { - "category_id": "E7CLE5RZZ744BHWVQQEAHI2C", + "categories": [ + { + "id": "E7CLE5RZZ744BHWVQQEAHI2C", + "ordinal": 0 + } + ], "description": "A delicious blend of black tea.", "name": "Tea - Black", "product_type": "REGULAR", @@ -110,7 +115,12 @@ "id": "NNNEM3LA656Q46NXLWCNI7S5", "is_deleted": false, "item_data": { - "category_id": "E7CLE5RZZ744BHWVQQEAHI2C", + "categories": [ + { + "id": "E7CLE5RZZ744BHWVQQEAHI2C", + "ordinal": 0 + } + ], "description": "Relaxing green herbal tea.", "name": "Tea - Green", "product_type": "REGULAR", diff --git a/doc/models/update-location-settings-request.md b/doc/models/update-location-settings-request.md new file mode 100644 index 00000000..29f6641b --- /dev/null +++ b/doc/models/update-location-settings-request.md @@ -0,0 +1,68 @@ + +# Update Location Settings Request + +## Structure + +`Update Location Settings Request` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `location_settings` | [`Checkout Location Settings`](../../doc/models/checkout-location-settings.md) | Required | - | + +## Example (as JSON) + +```json +{ + "location_settings": { + "location_id": "location_id0", + "customer_notes_enabled": false, + "policies": [ + { + "uid": "uid8", + "title": "title4", + "description": "description8" + }, + { + "uid": "uid8", + "title": "title4", + "description": "description8" + }, + { + "uid": "uid8", + "title": "title4", + "description": "description8" + } + ], + "branding": { + "header_type": "FULL_WIDTH_LOGO", + "button_color": "button_color2", + "button_shape": "PILL" + }, + "tipping": { + "percentages": [ + 246, + 247 + ], + "smart_tipping_enabled": false, + "default_percent": 46, + "smart_tips": [ + { + "amount": 152, + "currency": "USN" + }, + { + "amount": 152, + "currency": "USN" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "XTS" + } + } + } +} +``` + diff --git a/doc/models/update-location-settings-response.md b/doc/models/update-location-settings-response.md new file mode 100644 index 00000000..59136194 --- /dev/null +++ b/doc/models/update-location-settings-response.md @@ -0,0 +1,104 @@ + +# Update Location Settings Response + +## Structure + +`Update Location Settings Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the location settings. | +| `location_settings` | [`Checkout Location Settings`](../../doc/models/checkout-location-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "location_settings": { + "branding": { + "button_color": "#00b23b", + "button_shape": "ROUNDED", + "header_type": "FRAMED_LOGO" + }, + "customer_notes_enabled": false, + "location_id": "LOCATION_ID_1", + "policies": [ + { + "description": "This is my Return Policy", + "title": "Return Policy", + "uid": "POLICY_ID_1" + }, + { + "description": "Items may be returned within 30 days of purchase.", + "title": "Return Policy", + "uid": "POLICY_ID_2" + } + ], + "tipping": { + "default_percent": 20, + "default_whole_amount_money": { + "amount": 100, + "currency": "USD" + }, + "percentages": [ + 15, + 20, + 25 + ], + "smart_tipping_enabled": true, + "whole_amounts": [ + { + "amount": 1000, + "currency": "USD" + }, + { + "amount": 1500, + "currency": "USD" + }, + { + "amount": 2000, + "currency": "USD" + } + ], + "smart_tips": [ + { + "amount": 152, + "currency": "USN" + }, + { + "amount": 152, + "currency": "USN" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "XTS" + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/doc/models/update-merchant-settings-request.md b/doc/models/update-merchant-settings-request.md new file mode 100644 index 00000000..8fc97ff8 --- /dev/null +++ b/doc/models/update-merchant-settings-request.md @@ -0,0 +1,57 @@ + +# Update Merchant Settings Request + +## Structure + +`Update Merchant Settings Request` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchant_settings` | [`Checkout Merchant Settings`](../../doc/models/checkout-merchant-settings.md) | Required | - | + +## Example (as JSON) + +```json +{ + "merchant_settings": { + "payment_methods": { + "apple_pay": { + "enabled": false + }, + "google_pay": { + "enabled": false + }, + "cash_app": { + "enabled": false + }, + "afterpay_clearpay": { + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "ISK" + }, + "max": { + "amount": 140, + "currency": "OMR" + } + }, + "enabled": false + } + }, + "updated_at": "updated_at6" + } +} +``` + diff --git a/doc/models/update-merchant-settings-response.md b/doc/models/update-merchant-settings-response.md new file mode 100644 index 00000000..b8419e3a --- /dev/null +++ b/doc/models/update-merchant-settings-response.md @@ -0,0 +1,80 @@ + +# Update Merchant Settings Response + +## Structure + +`Update Merchant Settings Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List Error`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the merchant settings. | +| `merchant_settings` | [`Checkout Merchant Settings`](../../doc/models/checkout-merchant-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "merchant_settings": { + "merchant_id": "MERCHANT_ID", + "payment_methods": { + "afterpay_clearpay": { + "available": true, + "enabled": true, + "item_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + }, + "order_eligibility_range": { + "max": { + "amount": 10000, + "currency": "USD" + }, + "min": { + "amount": 100, + "currency": "USD" + } + } + }, + "apple_pay": { + "available": true, + "enabled": false + }, + "cash_app_pay": { + "available": true, + "enabled": true + }, + "google_pay": { + "available": true, + "enabled": true + }, + "cash_app": { + "enabled": false + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "MAP_KEY_LENGTH_TOO_LONG", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/pyproject.toml b/pyproject.toml index 578c94ac..f309d5b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,12 @@ requires = ["setuptools>=61.0"] [project] name = "squareup" description = "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management." -version = "33.0.0.20231115" +version = "33.1.0.20231213" readme = "README.md" requires-python = ">=3.7" authors = [{name = "Square Developer Platform", email = "developers@squareup.com"}] dependencies = ["apimatic-core~=0.2.0", "apimatic-core-interfaces~=0.1.0", "apimatic-requests-client-adapter~=0.1.0", "python-dateutil~=2.8.1", "deprecation~=2.1"] [project.optional-dependencies] testutils = ["pytest>=7.2.2"] +[tool.setuptools.packages.find] +exclude = ["tests", "tests.*"] diff --git a/square/api/base_api.py b/square/api/base_api.py index a56d05c1..9b53e739 100644 --- a/square/api/base_api.py +++ b/square/api/base_api.py @@ -23,7 +23,7 @@ class BaseApi(object): @staticmethod def user_agent(): - return 'Square-Python-SDK/33.0.0.20231115 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' + return 'Square-Python-SDK/33.1.0.20231213 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}' @staticmethod def user_agent_parameters(): diff --git a/square/api/catalog_api.py b/square/api/catalog_api.py index 88eb9d29..3e3040b9 100644 --- a/square/api/catalog_api.py +++ b/square/api/catalog_api.py @@ -538,7 +538,8 @@ def delete_catalog_object(self, def retrieve_catalog_object(self, object_id, include_related_objects=False, - catalog_version=None): + catalog_version=None, + include_category_path_to_root=False): """Does a GET request to /v2/catalog/object/{object_id}. Returns a single [CatalogItem]($m/CatalogItem) as a @@ -576,6 +577,14 @@ def retrieve_catalog_object(self, specific version of an object can be found in the version field of [CatalogObject]($m/CatalogObject)s. If not included, results will be from the current version of the catalog. + include_category_path_to_root (bool, optional): Specifies whether + or not to include the `path_to_root` list for each returned + category instance. The `path_to_root` list consists of + `CategoryPathToRootNode` objects and specifies the path that + starts with the immediate parent category of the returned + category and ends with its root category. If the returned + category is a top-level category, the `path_to_root` list is + empty and is not returned in the response payload. Returns: ApiResponse: An object with the response value as well as other @@ -603,6 +612,9 @@ def retrieve_catalog_object(self, .query_param(Parameter() .key('catalog_version') .value(catalog_version)) + .query_param(Parameter() + .key('include_category_path_to_root') + .value(include_category_path_to_root)) .header_param(Parameter() .key('accept') .value('application/json')) diff --git a/square/api/checkout_api.py b/square/api/checkout_api.py index 04d90e76..ab7d90bf 100644 --- a/square/api/checkout_api.py +++ b/square/api/checkout_api.py @@ -77,6 +77,178 @@ def create_checkout(self, .convertor(ApiResponse.create) ).execute() + def retrieve_location_settings(self, + location_id): + """Does a GET request to /v2/online-checkout/location-settings/{location_id}. + + Retrieves the location-level settings for a Square-hosted checkout + page. + + Args: + location_id (str): The ID of the location for which to retrieve + settings. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server('default') + .path('/v2/online-checkout/location-settings/{location_id}') + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key('location_id') + .value(location_id) + .should_encode(True)) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('global')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .is_api_response(True) + .convertor(ApiResponse.create) + ).execute() + + def update_location_settings(self, + location_id, + body): + """Does a PUT request to /v2/online-checkout/location-settings/{location_id}. + + Updates the location-level settings for a Square-hosted checkout + page. + + Args: + location_id (str): The ID of the location for which to retrieve + settings. + body (UpdateLocationSettingsRequest): An object containing the + fields to POST for the request. See the corresponding object + definition for field details. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server('default') + .path('/v2/online-checkout/location-settings/{location_id}') + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key('location_id') + .value(location_id) + .should_encode(True)) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) + .auth(Single('global')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .is_api_response(True) + .convertor(ApiResponse.create) + ).execute() + + def retrieve_merchant_settings(self): + """Does a GET request to /v2/online-checkout/merchant-settings. + + Retrieves the merchant-level settings for a Square-hosted checkout + page. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server('default') + .path('/v2/online-checkout/merchant-settings') + .http_method(HttpMethodEnum.GET) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('global')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .is_api_response(True) + .convertor(ApiResponse.create) + ).execute() + + def update_merchant_settings(self, + body): + """Does a PUT request to /v2/online-checkout/merchant-settings. + + Updates the merchant-level settings for a Square-hosted checkout + page. + + Args: + body (UpdateMerchantSettingsRequest): An object containing the + fields to POST for the request. See the corresponding object + definition for field details. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server('default') + .path('/v2/online-checkout/merchant-settings') + .http_method(HttpMethodEnum.PUT) + .header_param(Parameter() + .key('Content-Type') + .value('application/json')) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .body_serializer(APIHelper.json_serialize) + .auth(Single('global')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .is_api_response(True) + .convertor(ApiResponse.create) + ).execute() + def list_payment_links(self, cursor=None, limit=None): diff --git a/square/api/terminal_api.py b/square/api/terminal_api.py index b26ac448..f325bbe9 100644 --- a/square/api/terminal_api.py +++ b/square/api/terminal_api.py @@ -203,7 +203,7 @@ def dismiss_terminal_action(self, Args: action_id (str): Unique ID for the `TerminalAction` associated - with the waiting dialog to be dismissed. + with the action to be dismissed. Returns: ApiResponse: An object with the response value as well as other @@ -413,6 +413,48 @@ def cancel_terminal_checkout(self, .convertor(ApiResponse.create) ).execute() + def dismiss_terminal_checkout(self, + checkout_id): + """Does a POST request to /v2/terminals/checkouts/{checkout_id}/dismiss. + + Dismisses a Terminal checkout request if the status and type of the + request permits it. + + Args: + checkout_id (str): Unique ID for the `TerminalCheckout` associated + with the checkout to be dismissed. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server('default') + .path('/v2/terminals/checkouts/{checkout_id}/dismiss') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('checkout_id') + .value(checkout_id) + .should_encode(True)) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('global')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .is_api_response(True) + .convertor(ApiResponse.create) + ).execute() + def create_terminal_refund(self, body): """Does a POST request to /v2/terminals/refunds. @@ -590,3 +632,45 @@ def cancel_terminal_refund(self, .is_api_response(True) .convertor(ApiResponse.create) ).execute() + + def dismiss_terminal_refund(self, + terminal_refund_id): + """Does a POST request to /v2/terminals/refunds/{terminal_refund_id}/dismiss. + + Dismisses a Terminal refund request if the status and type of the + request permits it. + + Args: + terminal_refund_id (str): Unique ID for the `TerminalRefund` + associated with the refund to be dismissed. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + return super().new_api_call_builder.request( + RequestBuilder().server('default') + .path('/v2/terminals/refunds/{terminal_refund_id}/dismiss') + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key('terminal_refund_id') + .value(terminal_refund_id) + .should_encode(True)) + .header_param(Parameter() + .key('accept') + .value('application/json')) + .auth(Single('global')) + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .is_api_response(True) + .convertor(ApiResponse.create) + ).execute() diff --git a/square/client.py b/square/client.py index e91f14fd..16286af9 100644 --- a/square/client.py +++ b/square/client.py @@ -55,11 +55,11 @@ class Client(object): @staticmethod def sdk_version(): - return '33.0.0.20231115' + return '33.1.0.20231213' @staticmethod def square_version(): - return '2023-11-15' + return '2023-12-13' def user_agent_detail(self): return self.config.user_agent_detail @@ -234,7 +234,7 @@ def __init__(self, http_client_instance=None, retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods=['GET', 'PUT'], environment='production', custom_url='https://connect.squareup.com', access_token='', - square_version='2023-11-15', additional_headers={}, + square_version='2023-12-13', additional_headers={}, user_agent_detail='', config=None): if config is None: self.config = Configuration( diff --git a/square/configuration.py b/square/configuration.py index b217b314..5b4d7a46 100644 --- a/square/configuration.py +++ b/square/configuration.py @@ -41,7 +41,7 @@ def __init__( retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods=['GET', 'PUT'], environment='production', custom_url='https://connect.squareup.com', access_token='', - square_version='2023-11-15', additional_headers={}, + square_version='2023-12-13', additional_headers={}, user_agent_detail='' ): super().__init__(http_client_instance, override_http_client_configuration, http_call_back, timeout, max_retries,