Skip to content

Commit 5e10c4c

Browse files
Merge pull request #114 from square/release/28.0.0.20230608
Generated PR for Release: 28.0.0.20230608
2 parents cc7a5f6 + ade1470 commit 5e10c4c

File tree

80 files changed

+1060
-230
lines changed

Some content is hidden

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

80 files changed

+1060
-230
lines changed

doc/api/o-auth.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ following format:
3737
Authorization: Client APPLICATION_SECRET
3838
```
3939

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

4343
:information_source: **Note** This endpoint does not require authentication.
@@ -53,7 +53,7 @@ def renew_token(self,
5353

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

@@ -102,8 +102,8 @@ following format:
102102
Authorization: Client APPLICATION_SECRET
103103
```
104104

105-
Replace `APPLICATION_SECRET` with the application secret on the OAuth
106-
page for your application on the Developer Dashboard.
105+
Replace `APPLICATION_SECRET` with the application secret on the **OAuth**
106+
page for your application in the Developer Dashboard.
107107

108108
:information_source: **Note** This endpoint does not require authentication.
109109

@@ -156,7 +156,7 @@ returns only an access token.
156156
The `grant_type` parameter specifies the type of OAuth request. If
157157
`grant_type` is `authorization_code`, you must include the authorization
158158
code you received when a seller granted you authorization. If `grant_type`
159-
is `refresh_token`, you must provide a valid refresh token. If you are using
159+
is `refresh_token`, you must provide a valid refresh token. If you're using
160160
an old version of the Square APIs (prior to March 13, 2019), `grant_type`
161161
can be `migration_token` and you must provide a valid migration token.
162162

doc/api/subscriptions.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ subscriptions_api = client.subscriptions
2424

2525
# Create Subscription
2626

27-
Creates a subscription to a subscription plan by a customer.
27+
Enrolls a customer in a subscription.
2828

2929
If you provide a card on file in the request, Square charges the card for
30-
the subscription. Otherwise, Square bills an invoice to the customer's email
30+
the subscription. Otherwise, Square sends an invoice to the customer's email
3131
address. The subscription starts immediately, unless the request includes
3232
the optional `start_date`. Each individual subscription is associated with a particular location.
3333

34+
For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription).
35+
3436
```python
3537
def create_subscription(self,
3638
body)
@@ -51,9 +53,9 @@ def create_subscription(self,
5153
```python
5254
body = {
5355
'location_id': 'S8GWD5R9QB376',
54-
'plan_id': '6JHXF3B2CW3YKHDV4XEM674H',
5556
'customer_id': 'CHFGVKYY8RSV93M5KCYTG4PN0G',
5657
'idempotency_key': '8193148c-9586-11e6-99f9-28cfe92138cf',
58+
'plan_id': '6JHXF3B2CW3YKHDV4XEM674H',
5759
'start_date': '2021-10-20',
5860
'tax_percentage': '5',
5961
'price_override_money': {
@@ -94,9 +96,6 @@ If the request specifies customer IDs, the endpoint orders results
9496
first by location, within location by customer ID, and within
9597
customer by subscription creation date.
9698

97-
For more information, see
98-
[Retrieve subscriptions](https://developer.squareup.com/docs/subscriptions-api/overview#retrieve-subscriptions).
99-
10099
```python
101100
def search_subscriptions(self,
102101
body)
@@ -143,7 +142,7 @@ elif result.is_error():
143142

144143
# Retrieve Subscription
145144

146-
Retrieves a subscription.
145+
Retrieves a specific subscription.
147146

148147
```python
149148
def retrieve_subscription(self,
@@ -179,8 +178,8 @@ elif result.is_error():
179178

180179
# Update Subscription
181180

182-
Updates a subscription. You can set, modify, and clear the
183-
`subscription` field values.
181+
Updates a subscription by modifying or clearing `subscription` field values.
182+
To clear a field, set its value to `null`.
184183

185184
```python
186185
def update_subscription(self,
@@ -264,9 +263,9 @@ elif result.is_error():
264263

265264
# Cancel Subscription
266265

267-
Schedules a `CANCEL` action to cancel an active subscription
268-
by setting the `canceled_date` field to the end of the active billing period
269-
and changing the subscription status from ACTIVE to CANCELED after this date.
266+
Schedules a `CANCEL` action to cancel an active subscription. This
267+
sets the `canceled_date` field to the end of the active billing period. After this date,
268+
the subscription status changes from ACTIVE to CANCELED.
270269

271270
```python
272271
def cancel_subscription(self,
@@ -300,7 +299,7 @@ elif result.is_error():
300299

301300
# List Subscription Events
302301

303-
Lists all events for a specific subscription.
302+
Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription.
304303

305304
```python
306305
def list_subscription_events(self,
@@ -314,7 +313,7 @@ def list_subscription_events(self,
314313
| Parameter | Type | Tags | Description |
315314
| --- | --- | --- | --- |
316315
| `subscription_id` | `string` | Template, Required | The ID of the subscription to retrieve the events for. |
317-
| `cursor` | `string` | Query, Optional | When the total number of resulting subscription events exceeds the limit of a paged response,<br>specify the cursor returned from a preceding response here to fetch the next set of results.<br>If the cursor is unset, the response contains the last page of the results.<br><br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
316+
| `cursor` | `string` | Query, Optional | When the total number of resulting subscription events exceeds the limit of a paged response,<br>specify the cursor returned from a preceding response here to fetch the next set of results.<br>If the cursor is unset, the response contains the last page of the results.<br><br>For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
318317
| `limit` | `int` | Query, Optional | The upper limit on the number of subscription events to return<br>in a paged response. |
319318

320319
## Response Type
@@ -420,7 +419,8 @@ elif result.is_error():
420419

421420
# Swap Plan
422421

423-
Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing subscription.
422+
Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription.
423+
For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations).
424424

425425
```python
426426
def swap_plan(self,
@@ -444,9 +444,7 @@ def swap_plan(self,
444444
```python
445445
subscription_id = 'subscription_id0'
446446

447-
body = {
448-
None
449-
}
447+
body = {}
450448

451449
result = subscriptions_api.swap_plan(
452450
subscription_id,

doc/api/terminal.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ terminal_api = client.terminal
1414
* [Search Terminal Actions](../../doc/api/terminal.md#search-terminal-actions)
1515
* [Get Terminal Action](../../doc/api/terminal.md#get-terminal-action)
1616
* [Cancel Terminal Action](../../doc/api/terminal.md#cancel-terminal-action)
17+
* [Dismiss Terminal Action](../../doc/api/terminal.md#dismiss-terminal-action)
1718
* [Create Terminal Checkout](../../doc/api/terminal.md#create-terminal-checkout)
1819
* [Search Terminal Checkouts](../../doc/api/terminal.md#search-terminal-checkouts)
1920
* [Get Terminal Checkout](../../doc/api/terminal.md#get-terminal-checkout)
@@ -128,7 +129,7 @@ def get_terminal_action(self,
128129

129130
| Parameter | Type | Tags | Description |
130131
| --- | --- | --- | --- |
131-
| `action_id` | `string` | Template, Required | Unique ID for the desired `TerminalAction` |
132+
| `action_id` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. |
132133

133134
## Response Type
134135

@@ -162,7 +163,7 @@ def cancel_terminal_action(self,
162163

163164
| Parameter | Type | Tags | Description |
164165
| --- | --- | --- | --- |
165-
| `action_id` | `string` | Template, Required | Unique ID for the desired `TerminalAction` |
166+
| `action_id` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. |
166167

167168
## Response Type
168169

@@ -183,6 +184,42 @@ elif result.is_error():
183184
```
184185

185186

187+
# Dismiss Terminal Action
188+
189+
Dismisses a Terminal action request if the status and type of the request permits it.
190+
191+
See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details.
192+
193+
```python
194+
def dismiss_terminal_action(self,
195+
action_id)
196+
```
197+
198+
## Parameters
199+
200+
| Parameter | Type | Tags | Description |
201+
| --- | --- | --- | --- |
202+
| `action_id` | `string` | Template, Required | Unique ID for the `TerminalAction` associated with the waiting dialog to be dismissed. |
203+
204+
## Response Type
205+
206+
[`Dismiss Terminal Action Response`](../../doc/models/dismiss-terminal-action-response.md)
207+
208+
## Example Usage
209+
210+
```python
211+
action_id = 'action_id6'
212+
213+
result = terminal_api.dismiss_terminal_action(action_id)
214+
print(result)
215+
216+
if result.is_success():
217+
print(result.body)
218+
elif result.is_error():
219+
print(result.errors)
220+
```
221+
222+
186223
# Create Terminal Checkout
187224

188225
Creates a Terminal checkout request and sends it to the specified device to take a payment

doc/client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `square_version` | `string` | Square Connect API versions<br>*Default*: `'2023-05-17'` |
8+
| `square_version` | `string` | Square Connect API versions<br>*Default*: `'2023-06-08'` |
99
| `custom_url` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1111
| `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:
2525
```python
2626
from square.client import Client
2727
client = Client(
28-
square_version='2023-05-17',
28+
square_version='2023-06-08',
2929
access_token='AccessToken'
3030
)
3131
```
@@ -48,7 +48,7 @@ API calls return an `ApiResponse` object that includes the following fields:
4848
```python
4949
from square.client import Client
5050
client = Client(
51-
square_version='2023-05-17',
51+
square_version='2023-06-08',
5252
access_token='AccessToken'
5353
)
5454

doc/models/activity-type.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@
4444
| `THIRD_PARTY_FEE` | Fees collected by a third-party platform. |
4545
| `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. |
4646
| `PAYOUT` | Balance change due to money transfer. |
47+
| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates the withholding of a portion of each payment by Square that has been<br>automatically converted into bitcoin using Cash App. The seller manages their bitcoin in<br>their Cash App account. |
48+
| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates a return of the payment withholding that had been scheduled to be converted<br>into bitcoin using Cash App to the Square payments balance. |
49+
| `CREDIT_CARD_REPAYMENT` | The repayment made toward the outstanding balance on the seller's Square credit card. |
50+
| `CREDIT_CARD_REPAYMENT_REVERSED` | The reversal of the repayment made toward the outstanding balance on the seller's<br>Square credit card. |
4751

doc/models/cancel-subscription-response.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Defines output parameters in a response from the
1313
| Name | Type | Tags | Description |
1414
| --- | --- | --- | --- |
1515
| `errors` | [`List of Error`](../../doc/models/error.md) | Optional | Errors encountered during the request. |
16-
| `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.<br><br>For an overview of the `Subscription` type, see<br>[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). |
16+
| `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.<br><br>For more information, see<br>[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). |
1717
| `actions` | [`List of Subscription Action`](../../doc/models/subscription-action.md) | Optional | A list of a single `CANCEL` action scheduled for the subscription. |
1818

1919
## Example (as JSON)
@@ -35,7 +35,8 @@ Defines output parameters in a response from the
3535
"start_date": "2021-10-20",
3636
"status": "ACTIVE",
3737
"timezone": "America/Los_Angeles",
38-
"version": 1594311617331
38+
"version": 1594311617331,
39+
"plan_variation_id": "plan_variation_id8"
3940
},
4041
"errors": [
4142
{
@@ -62,19 +63,61 @@ Defines output parameters in a response from the
6263
"id": "id9",
6364
"type": "PAUSE",
6465
"effective_date": "effective_date1",
65-
"new_plan_id": "new_plan_id5"
66+
"phases": [
67+
{
68+
"uid": "uid6",
69+
"ordinal": 186,
70+
"order_template_id": "order_template_id8",
71+
"plan_phase_uid": "plan_phase_uid2"
72+
}
73+
],
74+
"new_plan_variation_id": "new_plan_variation_id9"
6675
},
6776
{
6877
"id": "id0",
6978
"type": "CANCEL",
7079
"effective_date": "effective_date0",
71-
"new_plan_id": "new_plan_id6"
80+
"phases": [
81+
{
82+
"uid": "uid5",
83+
"ordinal": 185,
84+
"order_template_id": "order_template_id7",
85+
"plan_phase_uid": "plan_phase_uid1"
86+
},
87+
{
88+
"uid": "uid6",
89+
"ordinal": 186,
90+
"order_template_id": "order_template_id8",
91+
"plan_phase_uid": "plan_phase_uid2"
92+
},
93+
{
94+
"uid": "uid7",
95+
"ordinal": 187,
96+
"order_template_id": "order_template_id9",
97+
"plan_phase_uid": "plan_phase_uid3"
98+
}
99+
],
100+
"new_plan_variation_id": "new_plan_variation_id0"
72101
},
73102
{
74103
"id": "id1",
75104
"type": "SWAP_PLAN",
76105
"effective_date": "effective_date9",
77-
"new_plan_id": "new_plan_id7"
106+
"phases": [
107+
{
108+
"uid": "uid4",
109+
"ordinal": 184,
110+
"order_template_id": "order_template_id6",
111+
"plan_phase_uid": "plan_phase_uid0"
112+
},
113+
{
114+
"uid": "uid5",
115+
"ordinal": 185,
116+
"order_template_id": "order_template_id7",
117+
"plan_phase_uid": "plan_phase_uid1"
118+
}
119+
],
120+
"new_plan_variation_id": "new_plan_variation_id1"
78121
}
79122
]
80123
}

doc/models/cancel-terminal-checkout-response.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"app_id": "APP_ID",
2525
"cancel_reason": "SELLER_CANCELED",
2626
"created_at": "2020-03-16T15:31:19.934Z",
27-
"deadline_duration": "PT10M",
27+
"deadline_duration": "PT5M",
2828
"device_options": {
2929
"device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003",
3030
"skip_receipt_screen": true,

doc/models/catalog-custom-attribute-definition.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ to store any sensitive information (personally identifiable information, card de
4141
"name": "name2"
4242
},
4343
"allowed_object_types": [
44-
"PRICING_RULE",
45-
"PRODUCT_SET",
46-
"TIME_PERIOD"
44+
"TIME_PERIOD",
45+
"MEASUREMENT_UNIT",
46+
"SUBSCRIPTION_PLAN_VARIATION"
4747
],
4848
"seller_visibility": "SELLER_VISIBILITY_HIDDEN",
4949
"app_visibility": "APP_VISIBILITY_HIDDEN",

doc/models/catalog-item-option.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ A group of variations for a `CatalogItem`.
2727
"show_colors": false,
2828
"values": [
2929
{
30-
"type": "MODIFIER",
30+
"type": "TAX",
3131
"id": "id0",
3232
"updated_at": "updated_at6",
3333
"version": 100,
@@ -71,7 +71,7 @@ A group of variations for a `CatalogItem`.
7171
]
7272
},
7373
{
74-
"type": "MODIFIER_LIST",
74+
"type": "ITEM_VARIATION",
7575
"id": "id1",
7676
"updated_at": "updated_at7",
7777
"version": 101,
@@ -100,7 +100,7 @@ A group of variations for a `CatalogItem`.
100100
]
101101
},
102102
{
103-
"type": "DISCOUNT",
103+
"type": "CATEGORY",
104104
"id": "id2",
105105
"updated_at": "updated_at8",
106106
"version": 102,

0 commit comments

Comments
 (0)