Skip to content

Commit 8798fd0

Browse files
Merge pull request #116 from square/release/28.0.0.20230608
Generated PR for Release: 28.0.0.20230608
2 parents df49a20 + febdf6d commit 8798fd0

File tree

159 files changed

+5285
-543
lines changed

Some content is hidden

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

159 files changed

+5285
-543
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "square/square",
33
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
4-
"version": "27.0.0.20230517",
4+
"version": "28.0.0.20230608",
55
"type": "library",
66
"keywords": [
77
"Square",

doc/apis/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.
@@ -50,7 +50,7 @@ function renewToken(string $clientId, RenewTokenRequest $body, string $authoriza
5050

5151
| Parameter | Type | Tags | Description |
5252
| --- | --- | --- | --- |
53-
| `clientId` | `string` | Template, Required | Your application ID, which is available in the OAuth page in the [Developer Dashboard](https://developer.squareup.com/apps). |
53+
| `clientId` | `string` | Template, Required | Your application ID, which is available on the **OAuth** page in the [Developer Dashboard](https://developer.squareup.com/apps). |
5454
| `body` | [`RenewTokenRequest`](../../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. |
5555
| `authorization` | `string` | Header, Required | Client APPLICATION_SECRET |
5656

@@ -103,8 +103,8 @@ following format:
103103
Authorization: Client APPLICATION_SECRET
104104
```
105105

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

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

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

doc/apis/subscriptions.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ $subscriptionsApi = $client->getSubscriptionsApi();
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
```php
3537
function createSubscription(CreateSubscriptionRequest $body): ApiResponse
3638
```
@@ -50,10 +52,10 @@ This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` met
5052
```php
5153
$body = CreateSubscriptionRequestBuilder::init(
5254
'S8GWD5R9QB376',
53-
'6JHXF3B2CW3YKHDV4XEM674H',
5455
'CHFGVKYY8RSV93M5KCYTG4PN0G'
5556
)
5657
->idempotencyKey('8193148c-9586-11e6-99f9-28cfe92138cf')
58+
->planId('6JHXF3B2CW3YKHDV4XEM674H')
5759
->startDate('2021-10-20')
5860
->taxPercentage('5')
5961
->priceOverrideMoney(
@@ -102,9 +104,6 @@ If the request specifies customer IDs, the endpoint orders results
102104
first by location, within location by customer ID, and within
103105
customer by subscription creation date.
104106

105-
For more information, see
106-
[Retrieve subscriptions](https://developer.squareup.com/docs/subscriptions-api/overview#retrieve-subscriptions).
107-
108107
```php
109108
function searchSubscriptions(SearchSubscriptionsRequest $body): ApiResponse
110109
```
@@ -164,7 +163,7 @@ var_dump($apiResponse->getHeaders());
164163

165164
# Retrieve Subscription
166165

167-
Retrieves a subscription.
166+
Retrieves a specific subscription.
168167

169168
```php
170169
function retrieveSubscription(string $subscriptionId, ?string $mInclude = null): ApiResponse
@@ -202,8 +201,8 @@ var_dump($apiResponse->getHeaders());
202201

203202
# Update Subscription
204203

205-
Updates a subscription. You can set, modify, and clear the
206-
`subscription` field values.
204+
Updates a subscription by modifying or clearing `subscription` field values.
205+
To clear a field, set its value to `null`.
207206

208207
```php
209208
function updateSubscription(string $subscriptionId, UpdateSubscriptionRequest $body): ApiResponse
@@ -292,9 +291,9 @@ var_dump($apiResponse->getHeaders());
292291

293292
# Cancel Subscription
294293

295-
Schedules a `CANCEL` action to cancel an active subscription
296-
by setting the `canceled_date` field to the end of the active billing period
297-
and changing the subscription status from ACTIVE to CANCELED after this date.
294+
Schedules a `CANCEL` action to cancel an active subscription. This
295+
sets the `canceled_date` field to the end of the active billing period. After this date,
296+
the subscription status changes from ACTIVE to CANCELED.
298297

299298
```php
300299
function cancelSubscription(string $subscriptionId): ApiResponse
@@ -331,7 +330,7 @@ var_dump($apiResponse->getHeaders());
331330

332331
# List Subscription Events
333332

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

336335
```php
337336
function listSubscriptionEvents(string $subscriptionId, ?string $cursor = null, ?int $limit = null): ApiResponse
@@ -342,7 +341,7 @@ function listSubscriptionEvents(string $subscriptionId, ?string $cursor = null,
342341
| Parameter | Type | Tags | Description |
343342
| --- | --- | --- | --- |
344343
| `subscriptionId` | `string` | Template, Required | The ID of the subscription to retrieve the events for. |
345-
| `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). |
344+
| `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). |
346345
| `limit` | `?int` | Query, Optional | The upper limit on the number of subscription events to return<br>in a paged response. |
347346

348347
## Response Type
@@ -456,7 +455,8 @@ var_dump($apiResponse->getHeaders());
456455

457456
# Swap Plan
458457

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

461461
```php
462462
function swapPlan(string $subscriptionId, SwapPlanRequest $body): ApiResponse
@@ -478,9 +478,7 @@ This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` met
478478
```php
479479
$subscriptionId = 'subscription_id0';
480480

481-
$body = SwapPlanRequestBuilder::init(
482-
''
483-
)->build();
481+
$body = SwapPlanRequestBuilder::init()->build();
484482

485483
$apiResponse = $subscriptionsApi->swapPlan(
486484
$subscriptionId,

doc/apis/terminal.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $terminalApi = $client->getTerminalApi();
1414
* [Search Terminal Actions](../../doc/apis/terminal.md#search-terminal-actions)
1515
* [Get Terminal Action](../../doc/apis/terminal.md#get-terminal-action)
1616
* [Cancel Terminal Action](../../doc/apis/terminal.md#cancel-terminal-action)
17+
* [Dismiss Terminal Action](../../doc/apis/terminal.md#dismiss-terminal-action)
1718
* [Create Terminal Checkout](../../doc/apis/terminal.md#create-terminal-checkout)
1819
* [Search Terminal Checkouts](../../doc/apis/terminal.md#search-terminal-checkouts)
1920
* [Get Terminal Checkout](../../doc/apis/terminal.md#get-terminal-checkout)
@@ -144,7 +145,7 @@ function getTerminalAction(string $actionId): ApiResponse
144145

145146
| Parameter | Type | Tags | Description |
146147
| --- | --- | --- | --- |
147-
| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction` |
148+
| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. |
148149

149150
## Response Type
150151

@@ -181,7 +182,7 @@ function cancelTerminalAction(string $actionId): ApiResponse
181182

182183
| Parameter | Type | Tags | Description |
183184
| --- | --- | --- | --- |
184-
| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction` |
185+
| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. |
185186

186187
## Response Type
187188

@@ -206,6 +207,45 @@ var_dump($apiResponse->getHeaders());
206207
```
207208

208209

210+
# Dismiss Terminal Action
211+
212+
Dismisses a Terminal action request if the status and type of the request permits it.
213+
214+
See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details.
215+
216+
```php
217+
function dismissTerminalAction(string $actionId): ApiResponse
218+
```
219+
220+
## Parameters
221+
222+
| Parameter | Type | Tags | Description |
223+
| --- | --- | --- | --- |
224+
| `actionId` | `string` | Template, Required | Unique ID for the `TerminalAction` associated with the waiting dialog to be dismissed. |
225+
226+
## Response Type
227+
228+
This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DismissTerminalActionResponse`](../../doc/models/dismiss-terminal-action-response.md).
229+
230+
## Example Usage
231+
232+
```php
233+
$actionId = 'action_id6';
234+
235+
$apiResponse = $terminalApi->dismissTerminalAction($actionId);
236+
237+
if ($apiResponse->isSuccess()) {
238+
$dismissTerminalActionResponse = $apiResponse->getResult();
239+
} else {
240+
$errors = $apiResponse->getErrors();
241+
}
242+
243+
// Getting more response information
244+
var_dump($apiResponse->getStatusCode());
245+
var_dump($apiResponse->getHeaders());
246+
```
247+
248+
209249
# Create Terminal Checkout
210250

211251
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-
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2023-05-17'` |
8+
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2023-06-08'` |
99
| `customUrl` | `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
| `timeout` | `int` | Timeout for API calls in seconds.<br>*Default*: `60` |
@@ -26,7 +26,7 @@ The API client can be initialized as follows:
2626
```php
2727
$client = SquareClientBuilder::init()
2828
->accessToken('AccessToken')
29-
->squareVersion('2023-05-17')
29+
->squareVersion('2023-06-08')
3030
->environment('production')
3131
->customUrl('https://connect.squareup.com')
3232
->build();
@@ -51,7 +51,7 @@ use Square\SquareClientBuilder;
5151

5252
$client = SquareClientBuilder::init()
5353
->accessToken('AccessToken')
54-
->squareVersion('2023-05-17')
54+
->squareVersion('2023-06-08')
5555
->build();
5656

5757
$apiResponse = $client->getLocationsApi()->listLocations();

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 | Getter | Setter |
1414
| --- | --- | --- | --- | --- | --- |
1515
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void |
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). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void |
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). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void |
1717
| `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of a single `CANCEL` action scheduled for the subscription. | getActions(): ?array | setActions(?array actions): void |
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)