Skip to content

Commit 33e3740

Browse files
authored
Merge pull request #99 from square/release/25.0.0.20221214
Generated PR for Release: 25.0.0.20221214
2 parents 4aea417 + 4570152 commit 33e3740

File tree

52 files changed

+597
-885
lines changed

Some content is hidden

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

52 files changed

+597
-885
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": "24.0.0.20221116",
4+
"version": "25.0.0.20221214",
55
"type": "library",
66
"keywords": [
77
"Square",

doc/apis/o-auth.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ $oAuthApi = $client->getOAuthApi();
1313
* [Renew Token](../../doc/apis/o-auth.md#renew-token)
1414
* [Revoke Token](../../doc/apis/o-auth.md#revoke-token)
1515
* [Obtain Token](../../doc/apis/o-auth.md#obtain-token)
16+
* [Retrieve Token Status](../../doc/apis/o-auth.md#retrieve-token-status)
1617

1718

1819
# Renew Token
@@ -198,3 +199,55 @@ if ($apiResponse->isSuccess()) {
198199
// $headers = $apiResponse->getHeaders();
199200
```
200201

202+
203+
# Retrieve Token Status
204+
205+
Returns information about an [OAuth access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-an-oauth-access-token) or an application’s [personal access token](https://developer.squareup.com/docs/build-basics/access-tokens#get-a-personal-access-token).
206+
207+
Add the access token to the Authorization header of the request.
208+
209+
__Important:__ The `Authorization` header you provide to this endpoint must have the following format:
210+
211+
```
212+
Authorization: Bearer ACCESS_TOKEN
213+
```
214+
215+
where `ACCESS_TOKEN` is a
216+
[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).
217+
218+
If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error.
219+
220+
:information_source: **Note** This endpoint does not require authentication.
221+
222+
```php
223+
function retrieveTokenStatus(string $authorization): ApiResponse
224+
```
225+
226+
## Parameters
227+
228+
| Parameter | Type | Tags | Description |
229+
| --- | --- | --- | --- |
230+
| `authorization` | `string` | Header, Required | Client APPLICATION_SECRET |
231+
232+
## Response Type
233+
234+
[`RetrieveTokenStatusResponse`](../../doc/models/retrieve-token-status-response.md)
235+
236+
## Example Usage
237+
238+
```php
239+
$authorization = 'Client CLIENT_SECRET';
240+
241+
$apiResponse = $oAuthApi->retrieveTokenStatus($authorization);
242+
243+
if ($apiResponse->isSuccess()) {
244+
$retrieveTokenStatusResponse = $apiResponse->getResult();
245+
} else {
246+
$errors = $apiResponse->getErrors();
247+
}
248+
249+
// Get more response info...
250+
// $statusCode = $apiResponse->getStatusCode();
251+
// $headers = $apiResponse->getHeaders();
252+
```
253+

doc/apis/order-custom-attributes.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,14 @@ function createOrderCustomAttributeDefinition(CreateOrderCustomAttributeDefiniti
9595

9696
```php
9797
$body_customAttributeDefinition = new Models\CustomAttributeDefinition();
98+
$body_customAttributeDefinition->setKey('cover-count');
99+
$body_customAttributeDefinition->setName('Cover count');
100+
$body_customAttributeDefinition->setDescription('The number of people seated at a table');
101+
$body_customAttributeDefinition->setVisibility(Models\CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES);
98102
$body = new Models\CreateOrderCustomAttributeDefinitionRequest(
99103
$body_customAttributeDefinition
100104
);
105+
$body->setIdempotencyKey('IDEMPOTENCY_KEY');
101106

102107
$apiResponse = $orderCustomAttributesApi->createOrderCustomAttributeDefinition($body);
103108

@@ -223,14 +228,13 @@ function updateOrderCustomAttributeDefinition(
223228
```php
224229
$key = 'key0';
225230
$body_customAttributeDefinition = new Models\CustomAttributeDefinition();
226-
$body_customAttributeDefinition->setKey('wayne-test-15');
227-
$body_customAttributeDefinition->setName('wayne-test-15');
228-
$body_customAttributeDefinition->setDescription('updated');
229-
$body_customAttributeDefinition->setVisibility(Models\CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES);
230-
$body_customAttributeDefinition->setVersion(2);
231+
$body_customAttributeDefinition->setKey('cover-count');
232+
$body_customAttributeDefinition->setVisibility(Models\CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY);
233+
$body_customAttributeDefinition->setVersion(1);
231234
$body = new Models\UpdateOrderCustomAttributeDefinitionRequest(
232235
$body_customAttributeDefinition
233236
);
237+
$body->setIdempotencyKey('IDEMPOTENCY_KEY');
234238

235239
$apiResponse = $orderCustomAttributesApi->updateOrderCustomAttributeDefinition($key, $body);
236240

@@ -292,11 +296,6 @@ $body_values[''] = new Models\BulkDeleteOrderCustomAttributesRequestDeleteCustom
292296
$body_values__orderId
293297
);
294298

295-
$body_values__orderId = null;
296-
$body_values[''] = new Models\BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute(
297-
$body_values__orderId
298-
);
299-
300299
$body = new Models\BulkDeleteOrderCustomAttributesRequest(
301300
$body_values
302301
);

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*: `'2022-11-16'` |
8+
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-12-14'` |
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 = Square\SquareClientBuilder::init()
2828
->accessToken('AccessToken')
29-
->squareVersion('2022-11-16')
29+
->squareVersion('2022-12-14')
3030
->environment('production')
3131
->customUrl('https://connect.squareup.com')
3232
->build();
@@ -49,7 +49,7 @@ require_once "vendor/autoload.php";
4949

5050
$client = Square\SquareClientBuilder::init()
5151
->accessToken('AccessToken')
52-
->squareVersion('2022-11-16')
52+
->squareVersion('2022-12-14')
5353
->build();
5454

5555
$locationsApi = $client->getLocationsApi();

doc/models/bulk-delete-order-custom-attributes-request.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@ Represents a bulk delete request for one or more order custom attributes.
1818
```json
1919
{
2020
"values": {
21-
"entry-1": {
22-
"key": "wayne-test-15",
23-
"order_id": "VilxhxZHuWEqDC6GQNgiLNshRMYZY"
21+
"cover-count": {
22+
"key": "cover-count",
23+
"order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F"
2424
},
25-
"entry-2": {
26-
"key": "wayne-test-13",
27-
"order_id": "XNWR6zjcEXWQy6kbsIsQRTxS0wOZY"
28-
},
29-
"entry-3": {
30-
"key": "ca-key5",
31-
"order_id": "9QC9RohBVxfsaSOtYjY7KhmjqrLZY"
25+
"table-number": {
26+
"key": "table-number",
27+
"order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F"
3228
}
3329
}
3430
}

doc/models/bulk-delete-order-custom-attributes-response.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ Represents a response from deleting one or more order custom attributes.
1919
```json
2020
{
2121
"values": {
22-
"entry-1": {},
23-
"entry-2": {},
24-
"entry-3": {}
22+
"cover-count": {},
23+
"table-number": {}
2524
}
2625
}
2726
```

doc/models/create-order-custom-attribute-definition-request.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ Represents a create request for an order custom attribute definition.
1919
```json
2020
{
2121
"custom_attribute_definition": {
22-
"key": null,
22+
"description": "The number of people seated at a table",
23+
"key": "cover-count",
24+
"name": "Cover count",
2325
"schema": null,
24-
"name": null,
25-
"description": null,
26-
"visibility": null,
27-
"version": null
26+
"visibility": "VISIBILITY_READ_WRITE_VALUES"
2827
},
29-
"idempotency_key": null
28+
"idempotency_key": "IDEMPOTENCY_KEY"
3029
}
3130
```
3231

doc/models/create-order-custom-attribute-definition-response.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Represents a response from creating an order custom attribute definition.
1919
```json
2020
{
2121
"custom_attribute_definition": {
22-
"created_at": "2022-11-10T18:04:57.039Z",
23-
"description": "wayne test",
24-
"key": "wayne-test-16",
25-
"name": "wayne-test",
22+
"created_at": "2022-10-06T16:53:23.141Z",
23+
"description": "The number of people seated at a table",
24+
"key": "cover-count",
25+
"name": "Cover count",
2626
"schema": null,
27-
"updated_at": "2022-11-10T18:04:57.039Z",
27+
"updated_at": "2022-10-06T16:53:23.141Z",
2828
"version": 1,
2929
"visibility": "VISIBILITY_READ_WRITE_VALUES"
3030
}

doc/models/customer-filter.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
# Customer Filter
33

4-
Represents a set of `CustomerQuery` filters used to limit the set of
5-
customers returned by the [SearchCustomers](../../doc/apis/customers.md#search-customers) endpoint.
4+
Represents the filtering criteria in a [search query](../../doc/models/customer-query.md) that defines how to filter
5+
customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results.
66

77
## Structure
88

@@ -20,6 +20,7 @@ customers returned by the [SearchCustomers](../../doc/apis/customers.md#search-c
2020
| `referenceId` | [`?CustomerTextFilter`](../../doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of<br>customer attributes against a specified query. Depending on the customer attributes,<br>the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getReferenceId(): ?CustomerTextFilter | setReferenceId(?CustomerTextFilter referenceId): void |
2121
| `groupIds` | [`?FilterValue`](../../doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given<br>value, the value can only be in one property. Depending on the field, either<br>all properties can be set or only a subset will be available.<br><br>Refer to the documentation of the field. | getGroupIds(): ?FilterValue | setGroupIds(?FilterValue groupIds): void |
2222
| `customAttribute` | [`?CustomerCustomAttributeFilters`](../../doc/models/customer-custom-attribute-filters.md) | Optional | The custom attribute filters in a set of [customer filters](../../doc/models/customer-filter.md) used in a search query. Use this filter<br>to search based on [custom attributes](../../doc/models/custom-attribute.md) that are assigned to customer profiles. For more information, see<br>[Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute). | getCustomAttribute(): ?CustomerCustomAttributeFilters | setCustomAttribute(?CustomerCustomAttributeFilters customAttribute): void |
23+
| `segmentIds` | [`?FilterValue`](../../doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given<br>value, the value can only be in one property. Depending on the field, either<br>all properties can be set or only a subset will be available.<br><br>Refer to the documentation of the field. | getSegmentIds(): ?FilterValue | setSegmentIds(?FilterValue segmentIds): void |
2324

2425
## Example (as JSON)
2526

@@ -32,7 +33,8 @@ customers returned by the [SearchCustomers](../../doc/apis/customers.md#search-c
3233
"phone_number": null,
3334
"reference_id": null,
3435
"group_ids": null,
35-
"custom_attribute": null
36+
"custom_attribute": null,
37+
"segment_ids": null
3638
}
3739
```
3840

doc/models/customer-query.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

22
# Customer Query
33

4-
Represents a query (including filtering criteria, sorting criteria, or both) used to search
5-
for customer profiles.
4+
Represents filtering and sorting criteria for a [SearchCustomers](../../doc/apis/customers.md#search-customers) request.
65

76
## Structure
87

@@ -12,8 +11,8 @@ for customer profiles.
1211

1312
| Name | Type | Tags | Description | Getter | Setter |
1413
| --- | --- | --- | --- | --- | --- |
15-
| `filter` | [`?CustomerFilter`](../../doc/models/customer-filter.md) | Optional | Represents a set of `CustomerQuery` filters used to limit the set of<br>customers returned by the [SearchCustomers](../../doc/apis/customers.md#search-customers) endpoint. | getFilter(): ?CustomerFilter | setFilter(?CustomerFilter filter): void |
16-
| `sort` | [`?CustomerSort`](../../doc/models/customer-sort.md) | Optional | Specifies how searched customers profiles are sorted, including the sort key and sort order. | getSort(): ?CustomerSort | setSort(?CustomerSort sort): void |
14+
| `filter` | [`?CustomerFilter`](../../doc/models/customer-filter.md) | Optional | Represents the filtering criteria in a [search query](../../doc/models/customer-query.md) that defines how to filter<br>customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results. | getFilter(): ?CustomerFilter | setFilter(?CustomerFilter filter): void |
15+
| `sort` | [`?CustomerSort`](../../doc/models/customer-sort.md) | Optional | Represents the sorting criteria in a [search query](../../doc/models/customer-query.md) that defines how to sort<br>customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results. | getSort(): ?CustomerSort | setSort(?CustomerSort sort): void |
1716

1817
## Example (as JSON)
1918

0 commit comments

Comments
 (0)