Skip to content

Commit

Permalink
Merge pull request #88 from square/release/18.0.0.20220420
Browse files Browse the repository at this point in the history
Generated PR for Release: 18.0.0.20220420
  • Loading branch information
jguze authored Apr 19, 2022
2 parents 13b161f + 16a0674 commit a597f14
Show file tree
Hide file tree
Showing 109 changed files with 1,549 additions and 193 deletions.
1 change: 1 addition & 0 deletions doc/api/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ body = {}
body['object_ids'] = ['W62UWFY35CWMYGVWK6TWJDNI', 'AA27W3M2GGTF3H6AVPNB77CK']
body['include_related_objects'] = True
body['catalog_version'] = 118
body['include_deleted_objects'] = False

result = catalog_api.batch_retrieve_catalog_objects(body)

Expand Down
6 changes: 3 additions & 3 deletions doc/api/locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ elif result.is_error():

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

```python
Expand Down
6 changes: 2 additions & 4 deletions doc/api/orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ body['order']['line_items'][1]['modifiers'][0]['uid'] = 'uid1'
body['order']['line_items'][1]['modifiers'][0]['catalog_object_id'] = 'CHQX7Y4KY6N5KINJKZCFURPZ'
body['order']['line_items'][1]['modifiers'][0]['catalog_version'] = 69
body['order']['line_items'][1]['modifiers'][0]['name'] = 'name1'
body['order']['line_items'][1]['modifiers'][0]['base_price_money'] = {}
body['order']['line_items'][1]['modifiers'][0]['base_price_money']['amount'] = 53
body['order']['line_items'][1]['modifiers'][0]['base_price_money']['currency'] = 'TTD'
body['order']['line_items'][1]['modifiers'][0]['quantity'] = 'quantity7'

body['order']['line_items'][1]['applied_discounts'] = []

Expand Down Expand Up @@ -579,7 +577,7 @@ To be used with `PayOrder`, a payment must:
- Reference the order by specifying the `order_id` when [creating the payment](../../doc/api/payments.md#create-payment).
Any approved payments that reference the same `order_id` not specified in the
`payment_ids` is canceled.
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture).
- Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture).
Using a delayed capture payment with `PayOrder` completes the approved payment.

```python
Expand Down
146 changes: 146 additions & 0 deletions doc/api/payouts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Payouts

```python
payouts_api = client.payouts
```

## Class Name

`PayoutsApi`

## Methods

* [List Payouts](../../doc/api/payouts.md#list-payouts)
* [Get Payout](../../doc/api/payouts.md#get-payout)
* [List Payout Entries](../../doc/api/payouts.md#list-payout-entries)


# List Payouts

Retrieves a list of all payouts for the default location.
You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.

```python
def list_payouts(self,
location_id=None,
status=None,
begin_time=None,
end_time=None,
sort_order=None,
cursor=None,
limit=None)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `location_id` | `string` | Query, Optional | The ID of the location for which to list the payouts.<br>By default, payouts are returned for the default (main) location associated with the seller. |
| `status` | [`str (Payout Status)`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. |
| `begin_time` | `string` | Query, Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.<br>Inclusive. Default: The current time minus one year. |
| `end_time` | `string` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.<br>Default: The current time. |
| `sort_order` | [`str (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. |
| `cursor` | `string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).<br>If request parameters change between requests, subsequent results may contain duplicates or missing records. |
| `limit` | `int` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value. If the provided value is<br>greater than 100, it is ignored and the default value is used instead.<br>Default: `100` |

## Response Type

[`List Payouts Response`](../../doc/models/list-payouts-response.md)

## Example Usage

```python
location_id = 'location_id4'
status = 'PAID'
begin_time = 'begin_time2'
end_time = 'end_time2'
sort_order = 'DESC'
cursor = 'cursor6'
limit = 172

result = payouts_api.list_payouts(location_id, status, begin_time, end_time, sort_order, cursor, limit)

if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
```


# Get Payout

Retrieves details of a specific payout identified by a payout ID.
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.

```python
def get_payout(self,
payout_id)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `payout_id` | `string` | Template, Required | The ID of the payout to retrieve the information for. |

## Response Type

[`Get Payout Response`](../../doc/models/get-payout-response.md)

## Example Usage

```python
payout_id = 'payout_id6'

result = payouts_api.get_payout(payout_id)

if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
```


# List Payout Entries

Retrieves a list of all payout entries for a specific payout.
To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.

```python
def list_payout_entries(self,
payout_id,
sort_order=None,
cursor=None,
limit=None)
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `payout_id` | `string` | Template, Required | The ID of the payout to retrieve the information for. |
| `sort_order` | [`str (Sort Order)`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. |
| `cursor` | `string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination).<br>If request parameters change between requests, subsequent results may contain duplicates or missing records. |
| `limit` | `int` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value. If the provided value is<br>greater than 100, it is ignored and the default value is used instead.<br>Default: `100` |

## Response Type

[`List Payout Entries Response`](../../doc/models/list-payout-entries-response.md)

## Example Usage

```python
payout_id = 'payout_id6'
sort_order = 'DESC'
cursor = 'cursor6'
limit = 172

result = payouts_api.list_payout_entries(payout_id, sort_order, cursor, limit)

if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)
```

1 change: 0 additions & 1 deletion doc/api/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ elif result.is_error():
# List Subscription Events

Lists all events for a specific subscription.
In the current implementation, only `START_SUBSCRIPTION` and `STOP_SUBSCRIPTION` (when the subscription was canceled) events are returned.

```python
def list_subscription_events(self,
Expand Down
13 changes: 8 additions & 5 deletions doc/api/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ body['checkout']['note'] = 'A brief note'
body['checkout']['device_options'] = {}
body['checkout']['device_options']['device_id'] = 'dbb5d83a-7838-11ea-bc55-0242ac130003'
body['checkout']['device_options']['skip_receipt_screen'] = False
body['checkout']['device_options']['collect_signature'] = False
body['checkout']['device_options']['tip_settings'] = {}
body['checkout']['device_options']['tip_settings']['allow_tipping'] = False
body['checkout']['device_options']['tip_settings']['separate_tip_screen'] = False
Expand All @@ -75,7 +76,7 @@ elif result.is_error():

# Search Terminal Checkouts

Retrieves a filtered list of Terminal checkout requests created by the account making the request.
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.

```python
def search_terminal_checkouts(self,
Expand Down Expand Up @@ -119,7 +120,7 @@ elif result.is_error():

# Get Terminal Checkout

Retrieves a Terminal checkout request by `checkout_id`.
Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days.

```python
def get_terminal_checkout(self,
Expand Down Expand Up @@ -185,7 +186,7 @@ elif result.is_error():

# Create Terminal Refund

Creates a request to refund an Interac payment completed on a Square Terminal.
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).

```python
def create_terminal_refund(self,
Expand Down Expand Up @@ -217,6 +218,8 @@ body['refund']['amount_money']['amount'] = 111
body['refund']['amount_money']['currency'] = 'CAD'
body['refund']['reason'] = 'Returning items'
body['refund']['device_id'] = 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291'
body['refund']['deadline_duration'] = 'deadline_duration6'
body['refund']['status'] = 'status6'

result = terminal_api.create_terminal_refund(body)

Expand All @@ -229,7 +232,7 @@ elif result.is_error():

# Search Terminal Refunds

Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request.
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.

```python
def search_terminal_refunds(self,
Expand Down Expand Up @@ -273,7 +276,7 @@ elif result.is_error():

# Get Terminal Refund

Retrieves an Interac Terminal refund object by ID.
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.

```python
def get_terminal_refund(self,
Expand Down
7 changes: 4 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` | `string` | Square Connect API versions<br>*Default*: `'2022-03-16'` |
| `square_version` | `string` | Square Connect API versions<br>*Default*: `'2022-04-20'` |
| `custom_url` | `string` | 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 @@ -26,7 +26,7 @@ The API client can be initialized as follows:
from square.client import Client

client = Client(
square_version='2022-03-16',
square_version='2022-04-20',
access_token='AccessToken',
environment='production',
custom_url = 'https://connect.squareup.com',)
Expand All @@ -51,7 +51,7 @@ API calls return an `ApiResponse` object that includes the following fields:
from square.client import Client

client = Client(
square_version='2022-03-16',
square_version='2022-04-20',
access_token='AccessToken',)

locations_api = client.locations
Expand Down Expand Up @@ -98,6 +98,7 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold
| merchants | Gets MerchantsApi |
| orders | Gets OrdersApi |
| payments | Gets PaymentsApi |
| payouts | Gets PayoutsApi |
| refunds | Gets RefundsApi |
| sites | Gets SitesApi |
| snippets | Gets SnippetsApi |
Expand Down
46 changes: 46 additions & 0 deletions doc/models/activity-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

# Activity Type

## Enumeration

`Activity Type`

## Fields

| Name | Description |
| --- | --- |
| `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. |
| `APP_FEE_REFUND` | A refund for an application fee on a payment. |
| `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. |
| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account.<br>These are, generally, proportional to the seller's sales. |
| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance.<br>These are, generally, proportional to the seller's refunds. |
| `CHARGE` | A credit card payment capture. |
| `DEPOSIT_FEE` | Any fees involved with deposits such as instant deposits. |
| `DISPUTE` | The balance change due to a dispute event. |
| `ESCHEATMENT` | An escheatment entry for remittance. |
| `FEE` | The Square processing fee. |
| `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller<br>referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).<br>This entry represents a credit to the seller for the purposes of free processing. |
| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. |
| `INITIAL_BALANCE_CHANGE` | An external change to a seller's balance. Initial, in the sense that it<br>causes the creation of the other activity types, such as hold and refund. |
| `MONEY_TRANSFER` | The balance change from a money transfer. |
| `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. |
| `OPEN_DISPUTE` | The balance change for a chargeback that has been filed. |
| `OTHER` | Any other type that does not belong in the rest of the types. |
| `OTHER_ADJUSTMENT` | Any other type of adjustment that does not fall under existing types. |
| `PAID_SERVICE_FEE` | A fee paid to a third-party merchant. |
| `PAID_SERVICE_FEE_REFUND` | A fee paid to a third-party merchant. |
| `REDEMPTION_CODE` | Repayment for a redemption code. |
| `REFUND` | A refund for an existing card payment. |
| `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. |
| `RESERVE_HOLD` | Fees paid for funding risk reserve. |
| `RESERVE_RELEASE` | Fees released from risk reserve. |
| `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the<br>settlement of the original entry failed. |
| `SQUARE_CAPITAL_PAYMENT` | A capital merchant cash advance (MCA) assessment. These are, generally,<br>proportional to the merchant's sales but can be issued for other reasons related to the MCA. |
| `SQUARE_CAPITAL_REVERSED_PAYMENT` | A capital merchant cash advance (MCA) assessment refund. These are, generally,<br>proportional to the merchant's refunds but can be issued for other reasons related to the MCA. |
| `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. |
| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that has been refunded. |
| `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. |
| `TAX_ON_FEE` | The tax paid on fee amounts. |
| `THIRD_PARTY_FEE` | Fees collected by a third-party platform. |
| `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. |

1 change: 1 addition & 0 deletions doc/models/batch-retrieve-catalog-objects-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
| `object_ids` | `List of string` | Required | The IDs of the CatalogObjects to be retrieved. |
| `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`. |

## Example (as JSON)

Expand Down
4 changes: 2 additions & 2 deletions doc/models/bulk-create-vendors-request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Bulk Create Vendors Request

Represents an input to a call to [BulkCreateVendors.](../../doc/api/vendors.md#bulk-create-vendors)
Represents an input to a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors).

## Structure

Expand All @@ -11,7 +11,7 @@ Represents an input to a call to [BulkCreateVendors.](../../doc/api/vendors.md#b

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `vendors` | [`Dict`](../../doc/models/vendor.md) | Required | Specifies a set of new [Vendor](entity:Vendor] objects as represented by a collection of idempotency-key/`Vendor`-object pairs. |
| `vendors` | [`Dict`](../../doc/models/vendor.md) | Required | Specifies a set of new [Vendor](../../doc/models/vendor.md) objects as represented by a collection of idempotency-key/`Vendor`-object pairs. |

## Example (as JSON)

Expand Down
4 changes: 2 additions & 2 deletions doc/models/bulk-create-vendors-response.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Bulk Create Vendors Response

Represents an output from a call to [BulkCreateVendors.](../../doc/api/vendors.md#bulk-create-vendors)
Represents an output from a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors).

## Structure

Expand All @@ -12,7 +12,7 @@ Represents an output from a call to [BulkCreateVendors.](../../doc/api/vendors.m
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `errors` | [`List of Error`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. |
| `responses` | [`Dict`](../../doc/models/create-vendor-response.md) | Optional | A set of [CreateVendorResponse](../../doc/models/create-vendor-response.md) objects encapsulating successfully created [Vendor](../../doc/models/vendor.md)<br>objects or error responses for failed attempts. The set is represented by<br>a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The impotency keys correspond to those specified<br>in the input. |
| `responses` | [`Dict`](../../doc/models/create-vendor-response.md) | Optional | A set of [CreateVendorResponse](../../doc/models/create-vendor-response.md) objects encapsulating successfully created [Vendor](../../doc/models/vendor.md)<br>objects or error responses for failed attempts. The set is represented by<br>a collection of idempotency-key/`Vendor`-object or idempotency-key/error-object pairs. The idempotency keys correspond to those specified<br>in the input. |

## Example (as JSON)

Expand Down
Loading

0 comments on commit a597f14

Please sign in to comment.