Skip to content

Commit

Permalink
Showing 52 changed files with 597 additions and 885 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "square/square",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"version": "24.0.0.20221116",
"version": "25.0.0.20221214",
"type": "library",
"keywords": [
"Square",
53 changes: 53 additions & 0 deletions doc/apis/o-auth.md
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ $oAuthApi = $client->getOAuthApi();
* [Renew Token](../../doc/apis/o-auth.md#renew-token)
* [Revoke Token](../../doc/apis/o-auth.md#revoke-token)
* [Obtain Token](../../doc/apis/o-auth.md#obtain-token)
* [Retrieve Token Status](../../doc/apis/o-auth.md#retrieve-token-status)


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


# Retrieve Token Status

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).

Add the access token to the Authorization header of the request.

__Important:__ The `Authorization` header you provide to this endpoint must have the following format:

```
Authorization: Bearer ACCESS_TOKEN
```

where `ACCESS_TOKEN` is a
[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens).

If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error.

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

```php
function retrieveTokenStatus(string $authorization): ApiResponse
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `authorization` | `string` | Header, Required | Client APPLICATION_SECRET |

## Response Type

[`RetrieveTokenStatusResponse`](../../doc/models/retrieve-token-status-response.md)

## Example Usage

```php
$authorization = 'Client CLIENT_SECRET';

$apiResponse = $oAuthApi->retrieveTokenStatus($authorization);

if ($apiResponse->isSuccess()) {
$retrieveTokenStatusResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}

// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
```

19 changes: 9 additions & 10 deletions doc/apis/order-custom-attributes.md
Original file line number Diff line number Diff line change
@@ -95,9 +95,14 @@ function createOrderCustomAttributeDefinition(CreateOrderCustomAttributeDefiniti

```php
$body_customAttributeDefinition = new Models\CustomAttributeDefinition();
$body_customAttributeDefinition->setKey('cover-count');
$body_customAttributeDefinition->setName('Cover count');
$body_customAttributeDefinition->setDescription('The number of people seated at a table');
$body_customAttributeDefinition->setVisibility(Models\CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES);
$body = new Models\CreateOrderCustomAttributeDefinitionRequest(
$body_customAttributeDefinition
);
$body->setIdempotencyKey('IDEMPOTENCY_KEY');

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

@@ -223,14 +228,13 @@ function updateOrderCustomAttributeDefinition(
```php
$key = 'key0';
$body_customAttributeDefinition = new Models\CustomAttributeDefinition();
$body_customAttributeDefinition->setKey('wayne-test-15');
$body_customAttributeDefinition->setName('wayne-test-15');
$body_customAttributeDefinition->setDescription('updated');
$body_customAttributeDefinition->setVisibility(Models\CustomAttributeDefinitionVisibility::VISIBILITY_READ_WRITE_VALUES);
$body_customAttributeDefinition->setVersion(2);
$body_customAttributeDefinition->setKey('cover-count');
$body_customAttributeDefinition->setVisibility(Models\CustomAttributeDefinitionVisibility::VISIBILITY_READ_ONLY);
$body_customAttributeDefinition->setVersion(1);
$body = new Models\UpdateOrderCustomAttributeDefinitionRequest(
$body_customAttributeDefinition
);
$body->setIdempotencyKey('IDEMPOTENCY_KEY');

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

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

$body_values__orderId = null;
$body_values[''] = new Models\BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute(
$body_values__orderId
);

$body = new Models\BulkDeleteOrderCustomAttributesRequest(
$body_values
);
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-11-16'` |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-12-14'` |
| `customUrl` | `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`** |
| `timeout` | `int` | Timeout for API calls in seconds.<br>*Default*: `60` |
@@ -26,7 +26,7 @@ The API client can be initialized as follows:
```php
$client = Square\SquareClientBuilder::init()
->accessToken('AccessToken')
->squareVersion('2022-11-16')
->squareVersion('2022-12-14')
->environment('production')
->customUrl('https://connect.squareup.com')
->build();
@@ -49,7 +49,7 @@ require_once "vendor/autoload.php";

$client = Square\SquareClientBuilder::init()
->accessToken('AccessToken')
->squareVersion('2022-11-16')
->squareVersion('2022-12-14')
->build();

$locationsApi = $client->getLocationsApi();
16 changes: 6 additions & 10 deletions doc/models/bulk-delete-order-custom-attributes-request.md
Original file line number Diff line number Diff line change
@@ -18,17 +18,13 @@ Represents a bulk delete request for one or more order custom attributes.
```json
{
"values": {
"entry-1": {
"key": "wayne-test-15",
"order_id": "VilxhxZHuWEqDC6GQNgiLNshRMYZY"
"cover-count": {
"key": "cover-count",
"order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F"
},
"entry-2": {
"key": "wayne-test-13",
"order_id": "XNWR6zjcEXWQy6kbsIsQRTxS0wOZY"
},
"entry-3": {
"key": "ca-key5",
"order_id": "9QC9RohBVxfsaSOtYjY7KhmjqrLZY"
"table-number": {
"key": "table-number",
"order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F"
}
}
}
5 changes: 2 additions & 3 deletions doc/models/bulk-delete-order-custom-attributes-response.md
Original file line number Diff line number Diff line change
@@ -19,9 +19,8 @@ Represents a response from deleting one or more order custom attributes.
```json
{
"values": {
"entry-1": {},
"entry-2": {},
"entry-3": {}
"cover-count": {},
"table-number": {}
}
}
```
11 changes: 5 additions & 6 deletions doc/models/create-order-custom-attribute-definition-request.md
Original file line number Diff line number Diff line change
@@ -19,14 +19,13 @@ Represents a create request for an order custom attribute definition.
```json
{
"custom_attribute_definition": {
"key": null,
"description": "The number of people seated at a table",
"key": "cover-count",
"name": "Cover count",
"schema": null,
"name": null,
"description": null,
"visibility": null,
"version": null
"visibility": "VISIBILITY_READ_WRITE_VALUES"
},
"idempotency_key": null
"idempotency_key": "IDEMPOTENCY_KEY"
}
```

10 changes: 5 additions & 5 deletions doc/models/create-order-custom-attribute-definition-response.md
Original file line number Diff line number Diff line change
@@ -19,12 +19,12 @@ Represents a response from creating an order custom attribute definition.
```json
{
"custom_attribute_definition": {
"created_at": "2022-11-10T18:04:57.039Z",
"description": "wayne test",
"key": "wayne-test-16",
"name": "wayne-test",
"created_at": "2022-10-06T16:53:23.141Z",
"description": "The number of people seated at a table",
"key": "cover-count",
"name": "Cover count",
"schema": null,
"updated_at": "2022-11-10T18:04:57.039Z",
"updated_at": "2022-10-06T16:53:23.141Z",
"version": 1,
"visibility": "VISIBILITY_READ_WRITE_VALUES"
}
8 changes: 5 additions & 3 deletions doc/models/customer-filter.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# Customer Filter

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

## Structure

@@ -20,6 +20,7 @@ customers returned by the [SearchCustomers](../../doc/apis/customers.md#search-c
| `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 |
| `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 |
| `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 |
| `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 |

## Example (as JSON)

@@ -32,7 +33,8 @@ customers returned by the [SearchCustomers](../../doc/apis/customers.md#search-c
"phone_number": null,
"reference_id": null,
"group_ids": null,
"custom_attribute": null
"custom_attribute": null,
"segment_ids": null
}
```

7 changes: 3 additions & 4 deletions doc/models/customer-query.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

# Customer Query

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

## Structure

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

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `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 |
| `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 |
| `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 |
| `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 |

## Example (as JSON)

3 changes: 2 additions & 1 deletion doc/models/customer-sort.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

# Customer Sort

Specifies how searched customers profiles are sorted, including the sort key and sort order.
Represents the sorting criteria in a [search query](../../doc/models/customer-query.md) that defines how to sort
customer profiles returned in [SearchCustomers](../../doc/apis/customers.md#search-customers) results.

## Structure

4 changes: 2 additions & 2 deletions doc/models/customer.md
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@ Represents a Square customer profile in the Customer Directory of a Square selle
| `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void |
| `preferences` | [`?CustomerPreferences`](../../doc/models/customer-preferences.md) | Optional | Represents communication preferences for the customer profile. | getPreferences(): ?CustomerPreferences | setPreferences(?CustomerPreferences preferences): void |
| `creationSource` | [`?string (CustomerCreationSource)`](../../doc/models/customer-creation-source.md) | Optional | Indicates the method used to create the customer profile. | getCreationSource(): ?string | setCreationSource(?string creationSource): void |
| `groupIds` | `?(string[])` | Optional | The IDs of customer groups the customer belongs to. | getGroupIds(): ?array | setGroupIds(?array groupIds): void |
| `segmentIds` | `?(string[])` | Optional | The IDs of segments the customer belongs to. | getSegmentIds(): ?array | setSegmentIds(?array segmentIds): void |
| `groupIds` | `?(string[])` | Optional | The IDs of [customer groups](../../doc/models/customer-group.md) the customer belongs to. | getGroupIds(): ?array | setGroupIds(?array groupIds): void |
| `segmentIds` | `?(string[])` | Optional | The IDs of [customer segments](../../doc/models/customer-segment.md) the customer belongs to. | getSegmentIds(): ?array | setSegmentIds(?array segmentIds): void |
| `version` | `?int` | Optional | The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership and cards on file. | getVersion(): ?int | setVersion(?int version): void |
| `taxIds` | [`?CustomerTaxIds`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.<br>For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids). | getTaxIds(): ?CustomerTaxIds | setTaxIds(?CustomerTaxIds taxIds): void |

25 changes: 0 additions & 25 deletions doc/models/dispute-evidence-created-webhook-data.md

This file was deleted.

21 changes: 0 additions & 21 deletions doc/models/dispute-evidence-created-webhook-object.md

This file was deleted.

60 changes: 0 additions & 60 deletions doc/models/dispute-evidence-created-webhook.md

This file was deleted.

Loading

0 comments on commit 33e3740

Please sign in to comment.