Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions doc/api/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ body = {
'present_at_all_locations': True,
'item_data': {
'name': 'Tea',
'category_id': '#Beverages',
'tax_ids': [
'#SalesTax'
],
Expand All @@ -188,6 +187,11 @@ body = {
}
}
],
'categories': [
{
'id': '#Beverages'
}
],
'description_html': '<p><strong>Hot</strong> Leaf Juice</p>'
}
},
Expand All @@ -197,7 +201,6 @@ body = {
'present_at_all_locations': True,
'item_data': {
'name': 'Coffee',
'category_id': '#Beverages',
'tax_ids': [
'#SalesTax'
],
Expand Down Expand Up @@ -231,6 +234,11 @@ body = {
}
}
],
'categories': [
{
'id': '#Beverages'
}
],
'description_html': '<p>Hot <em>Bean Juice</em></p>'
}
},
Expand Down Expand Up @@ -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
Expand All @@ -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<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false`<br>**Default**: `False` |
| `catalog_version` | `long\|int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](../../doc/models/catalog-object.md)s. If not included, results will<br>be from the current version of the catalog. |
| `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<br>of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category<br>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<br>in the response payload.<br>**Default**: `False` |

## Response Type

Expand All @@ -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)

Expand Down
142 changes: 142 additions & 0 deletions doc/api/checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.<br><br>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.<br><br>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.
Expand Down
72 changes: 71 additions & 1 deletion doc/api/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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)
```

6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `square_version` | `str` | Square Connect API versions<br>*Default*: `'2023-11-15'` |
| `square_version` | `str` | Square Connect API versions<br>*Default*: `'2023-12-13'` |
| `custom_url` | `str` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests |
Expand All @@ -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'
)
```
Expand All @@ -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'
)

Expand Down
4 changes: 3 additions & 1 deletion doc/models/batch-retrieve-catalog-objects-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| `include_related_objects` | `bool` | Optional | If `true`, the response will include additional objects that are related to the<br>requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field<br>of the response. These objects are put in the `related_objects` field. Setting this to `true` is<br>helpful when the objects are needed for immediate display to a user.<br>This process only goes one level deep. Objects referenced by the related objects will not be included. For example,<br><br>if the `objects` field of the response contains a CatalogItem, its associated<br>CatalogCategory objects, CatalogTax objects, CatalogImage objects and<br>CatalogModifierLists will be returned in the `related_objects` field of the<br>response. If the `objects` field of the response contains a CatalogItemVariation,<br>its parent CatalogItem will be returned in the `related_objects` field of<br>the response.<br><br>Default value: `false` |
| `catalog_version` | `long\|int` | Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical versions of objects. The specified version value is matched against<br>the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will<br>be from the current version of the catalog. |
| `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<br>of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category<br>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<br>in the response payload. |

## Example (as JSON)

Expand All @@ -24,7 +25,8 @@
"AA27W3M2GGTF3H6AVPNB77CK"
],
"catalog_version": 190,
"include_deleted_objects": false
"include_deleted_objects": false,
"include_category_path_to_root": false
}
```

Loading