diff --git a/composer.json b/composer.json
index e864c6ef..145845e4 100644
--- a/composer.json
+++ b/composer.json
@@ -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": "32.0.0.20231018",
+ "version": "33.0.0.20231115",
"type": "library",
"keywords": [
"Square",
diff --git a/doc/apis/labor.md b/doc/apis/labor.md
index 93989ad8..f1bb006b 100644
--- a/doc/apis/labor.md
+++ b/doc/apis/labor.md
@@ -371,9 +371,9 @@ This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` met
```php
$body = CreateShiftRequestBuilder::init(
ShiftBuilder::init(
+ 'PAA1RJZZKXBFG',
'2019-01-25T03:11:00-05:00'
)
- ->locationId('PAA1RJZZKXBFG')
->endAt('2019-01-25T13:11:00-05:00')
->wage(
ShiftWageBuilder::init()
@@ -384,6 +384,7 @@ $body = CreateShiftRequestBuilder::init(
->currency(Currency::USD)
->build()
)
+ ->tipEligible(true)
->build()
)
->breaks(
@@ -400,6 +401,12 @@ $body = CreateShiftRequestBuilder::init(
]
)
->teamMemberId('ormj0jJJZ5OZIzxrZYJI')
+ ->declaredCashTipMoney(
+ MoneyBuilder::init()
+ ->amount(500)
+ ->currency(Currency::USD)
+ ->build()
+ )
->build()
)
->idempotencyKey('HIDSNG5KS478L')
@@ -599,9 +606,9 @@ $id = 'id0';
$body = UpdateShiftRequestBuilder::init(
ShiftBuilder::init(
+ 'PAA1RJZZKXBFG',
'2019-01-25T03:11:00-05:00'
)
- ->locationId('PAA1RJZZKXBFG')
->endAt('2019-01-25T13:11:00-05:00')
->wage(
ShiftWageBuilder::init()
@@ -612,6 +619,7 @@ $body = UpdateShiftRequestBuilder::init(
->currency(Currency::USD)
->build()
)
+ ->tipEligible(true)
->build()
)
->breaks(
@@ -630,6 +638,12 @@ $body = UpdateShiftRequestBuilder::init(
)
->version(1)
->teamMemberId('ormj0jJJZ5OZIzxrZYJI')
+ ->declaredCashTipMoney(
+ MoneyBuilder::init()
+ ->amount(500)
+ ->currency(Currency::USD)
+ ->build()
+ )
->build()
)->build();
diff --git a/doc/client.md b/doc/client.md
index 40a13289..9cb5ed39 100644
--- a/doc/client.md
+++ b/doc/client.md
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
-| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2023-10-18'` |
+| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2023-11-15'` |
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment.
**Default: `production`** |
| `timeout` | `int` | Timeout for API calls in seconds.
*Default*: `60` |
@@ -26,7 +26,7 @@ The API client can be initialized as follows:
```php
$client = SquareClientBuilder::init()
->accessToken('AccessToken')
- ->squareVersion('2023-10-18')
+ ->squareVersion('2023-11-15')
->environment('production')
->customUrl('https://connect.squareup.com')
->build();
@@ -51,7 +51,7 @@ use Square\SquareClientBuilder;
$client = SquareClientBuilder::init()
->accessToken('AccessToken')
- ->squareVersion('2023-10-18')
+ ->squareVersion('2023-11-15')
->build();
$apiResponse = $client->getLocationsApi()->listLocations();
diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md
index 4a9af0fe..5a4c2968 100644
--- a/doc/models/catalog-item.md
+++ b/doc/models/catalog-item.md
@@ -35,17 +35,6 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
```json
{
- "object": {
- "id": "#Cocoa",
- "item_data": {
- "abbreviation": "Ch",
- "description": "Hot chocolate",
- "name": "Cocoa",
- "visibility": "PRIVATE"
- },
- "present_at_all_locations": true,
- "type": "ITEM"
- },
"name": "name6",
"description": "description6",
"abbreviation": "abbreviation8",
diff --git a/doc/models/catalog-modifier-list.md b/doc/models/catalog-modifier-list.md
index 55eb1148..031f7bd3 100644
--- a/doc/models/catalog-modifier-list.md
+++ b/doc/models/catalog-modifier-list.md
@@ -26,49 +26,6 @@ the modifier list are allowed.
```json
{
- "id": "#MilkType",
- "modifier_list_data": {
- "allow_quantities": false,
- "modifiers": [
- {
- "modifier_data": {
- "name": "Whole Milk",
- "price_money": {
- "amount": 0,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- },
- {
- "modifier_data": {
- "name": "Almond Milk",
- "price_money": {
- "amount": 250,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- },
- {
- "modifier_data": {
- "name": "Soy Milk",
- "price_money": {
- "amount": 250,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- }
- ],
- "name": "Milk Type",
- "selection_type": "SINGLE"
- },
- "present_at_all_locations": true,
- "type": "MODIFIER_LIST",
"name": "name4",
"ordinal": 226,
"selection_type": "SINGLE",
diff --git a/doc/models/catalog-object-batch.md b/doc/models/catalog-object-batch.md
index 6f79b6c0..308d3bbf 100644
--- a/doc/models/catalog-object-batch.md
+++ b/doc/models/catalog-object-batch.md
@@ -21,19 +21,6 @@ A batch of catalog objects.
{
"type": "PRICING_RULE",
"id": "id6",
- "item_data": {
- "object": {
- "id": "#Cocoa",
- "item_data": {
- "abbreviation": "Ch",
- "description": "Hot chocolate",
- "name": "Cocoa",
- "visibility": "PRIVATE"
- },
- "present_at_all_locations": true,
- "type": "ITEM"
- }
- },
"category_data": {
"object": {
"category_data": {
@@ -73,51 +60,6 @@ A batch of catalog objects.
"type": "DISCOUNT"
}
},
- "modifier_list_data": {
- "id": "#MilkType",
- "modifier_list_data": {
- "allow_quantities": false,
- "modifiers": [
- {
- "modifier_data": {
- "name": "Whole Milk",
- "price_money": {
- "amount": 0,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- },
- {
- "modifier_data": {
- "name": "Almond Milk",
- "price_money": {
- "amount": 250,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- },
- {
- "modifier_data": {
- "name": "Soy Milk",
- "price_money": {
- "amount": 250,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- }
- ],
- "name": "Milk Type",
- "selection_type": "SINGLE"
- },
- "present_at_all_locations": true,
- "type": "MODIFIER_LIST"
- },
"modifier_data": {
"object": {
"modifier_data": {
diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md
index e5ef18de..f74edd8f 100644
--- a/doc/models/catalog-object.md
+++ b/doc/models/catalog-object.md
@@ -55,19 +55,6 @@ For a more detailed discussion of the Catalog data model, please see the
{
"type": "TAX",
"id": "id4",
- "item_data": {
- "object": {
- "id": "#Cocoa",
- "item_data": {
- "abbreviation": "Ch",
- "description": "Hot chocolate",
- "name": "Cocoa",
- "visibility": "PRIVATE"
- },
- "present_at_all_locations": true,
- "type": "ITEM"
- }
- },
"category_data": {
"object": {
"category_data": {
@@ -107,51 +94,6 @@ For a more detailed discussion of the Catalog data model, please see the
"type": "DISCOUNT"
}
},
- "modifier_list_data": {
- "id": "#MilkType",
- "modifier_list_data": {
- "allow_quantities": false,
- "modifiers": [
- {
- "modifier_data": {
- "name": "Whole Milk",
- "price_money": {
- "amount": 0,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- },
- {
- "modifier_data": {
- "name": "Almond Milk",
- "price_money": {
- "amount": 250,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- },
- {
- "modifier_data": {
- "name": "Soy Milk",
- "price_money": {
- "amount": 250,
- "currency": "USD"
- }
- },
- "present_at_all_locations": true,
- "type": "MODIFIER"
- }
- ],
- "name": "Milk Type",
- "selection_type": "SINGLE"
- },
- "present_at_all_locations": true,
- "type": "MODIFIER_LIST"
- },
"modifier_data": {
"object": {
"modifier_data": {
diff --git a/doc/models/change-billing-anchor-date-response.md b/doc/models/change-billing-anchor-date-response.md
index 89587389..0abb62b3 100644
--- a/doc/models/change-billing-anchor-date-response.md
+++ b/doc/models/change-billing-anchor-date-response.md
@@ -20,33 +20,12 @@ Defines output parameters in a request to the
```json
{
- "errors": [
- {
- "category": "MERCHANT_SUBSCRIPTION_ERROR",
- "code": "MAP_KEY_LENGTH_TOO_LONG",
- "detail": "detail6",
- "field": "field4"
- },
- {
- "category": "MERCHANT_SUBSCRIPTION_ERROR",
- "code": "MAP_KEY_LENGTH_TOO_LONG",
- "detail": "detail6",
- "field": "field4"
- }
- ],
- "subscription": {
- "id": "id4",
- "location_id": "location_id8",
- "plan_variation_id": "plan_variation_id8",
- "customer_id": "customer_id2",
- "start_date": "start_date8"
- },
"actions": [
{
- "id": "id8",
- "type": "RESUME",
- "effective_date": "effective_date8",
- "monthly_billing_anchor_date": 186,
+ "effective_date": "2023-11-01",
+ "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83",
+ "monthly_billing_anchor_date": 1,
+ "type": "CHANGE_BILLING_ANCHOR_DATE",
"phases": [
{
"uid": "uid0",
@@ -68,6 +47,47 @@ Defines output parameters in a request to the
}
]
}
+ ],
+ "subscription": {
+ "created_at": "2023-06-20T21:53:10Z",
+ "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
+ "id": "9ba40961-995a-4a3d-8c53-048c40cafc13",
+ "location_id": "S8GWD5R9QB376",
+ "monthly_billing_anchor_date": 20,
+ "phases": [
+ {
+ "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY",
+ "ordinal": 0,
+ "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7",
+ "uid": "98d6f53b-40e1-4714-8827-032fd923be25"
+ }
+ ],
+ "plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7",
+ "price_override_money": {
+ "amount": 2000,
+ "currency": "USD"
+ },
+ "source": {
+ "name": "My Application"
+ },
+ "status": "ACTIVE",
+ "timezone": "America/Los_Angeles",
+ "version": 3,
+ "start_date": "start_date8"
+ },
+ "errors": [
+ {
+ "category": "MERCHANT_SUBSCRIPTION_ERROR",
+ "code": "MAP_KEY_LENGTH_TOO_LONG",
+ "detail": "detail6",
+ "field": "field4"
+ },
+ {
+ "category": "MERCHANT_SUBSCRIPTION_ERROR",
+ "code": "MAP_KEY_LENGTH_TOO_LONG",
+ "detail": "detail6",
+ "field": "field4"
+ }
]
}
```
diff --git a/doc/models/create-shift-request.md b/doc/models/create-shift-request.md
index 255f61dd..7c3b3862 100644
--- a/doc/models/create-shift-request.md
+++ b/doc/models/create-shift-request.md
@@ -30,6 +30,10 @@ Represents a request to create a `Shift`.
"start_at": "2019-01-25T06:11:00-05:00"
}
],
+ "declared_cash_tip_money": {
+ "amount": 500,
+ "currency": "USD"
+ },
"end_at": "2019-01-25T13:11:00-05:00",
"location_id": "PAA1RJZZKXBFG",
"start_at": "2019-01-25T03:11:00-05:00",
@@ -39,7 +43,9 @@ Represents a request to create a `Shift`.
"amount": 1100,
"currency": "USD"
},
- "title": "Barista"
+ "tip_eligible": true,
+ "title": "Barista",
+ "job_id": "job_id0"
},
"id": "id4",
"employee_id": "employee_id4",
diff --git a/doc/models/create-shift-response.md b/doc/models/create-shift-response.md
index 310641cb..4a3eedf5 100644
--- a/doc/models/create-shift-response.md
+++ b/doc/models/create-shift-response.md
@@ -33,6 +33,10 @@ the request resulted in errors.
}
],
"created_at": "2019-02-28T00:39:02Z",
+ "declared_cash_tip_money": {
+ "amount": 500,
+ "currency": "USD"
+ },
"employee_id": "ormj0jJJZ5OZIzxrZYJI",
"end_at": "2019-01-25T13:11:00-05:00",
"id": "K0YH4CV5462JB",
@@ -49,6 +53,7 @@ the request resulted in errors.
"currency": "USD"
},
"job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
+ "tip_eligible": true,
"title": "Barista"
}
},
diff --git a/doc/models/get-shift-response.md b/doc/models/get-shift-response.md
index 95dc37ad..7dff7c41 100644
--- a/doc/models/get-shift-response.md
+++ b/doc/models/get-shift-response.md
@@ -33,6 +33,10 @@ the request resulted in errors.
}
],
"created_at": "2019-02-27T00:12:12Z",
+ "declared_cash_tip_money": {
+ "amount": 500,
+ "currency": "USD"
+ },
"employee_id": "D71KRMQof6cXGUW0aAv7",
"end_at": "2019-02-23T21:00:00-05:00",
"id": "T35HMQSN89SV4",
@@ -49,6 +53,7 @@ the request resulted in errors.
"currency": "USD"
},
"job_id": "N4YKVLzFj3oGtNocqoYHYpW3",
+ "tip_eligible": true,
"title": "Cashier"
}
},
diff --git a/doc/models/get-team-member-wage-response.md b/doc/models/get-team-member-wage-response.md
index 3dd614ea..e1f4b729 100644
--- a/doc/models/get-team-member-wage-response.md
+++ b/doc/models/get-team-member-wage-response.md
@@ -28,6 +28,7 @@ the request resulted in errors.
"id": "pXS3qCv7BERPnEGedM4S8mhm",
"job_id": "jxJNN6eCJsLrhg5UFJrDWDGE",
"team_member_id": "33fJchumvVdJwxV0H6L9",
+ "tip_eligible": false,
"title": "Manager"
},
"errors": [
diff --git a/doc/models/list-team-member-wages-response.md b/doc/models/list-team-member-wages-response.md
index 161cb5bd..4ae1bdc1 100644
--- a/doc/models/list-team-member-wages-response.md
+++ b/doc/models/list-team-member-wages-response.md
@@ -30,6 +30,7 @@ a set of `TeamMemberWage` objects.
"id": "pXS3qCv7BERPnEGedM4S8mhm",
"job_id": "jxJNN6eCJsLrhg5UFJrDWDGE",
"team_member_id": "33fJchumvVdJwxV0H6L9",
+ "tip_eligible": false,
"title": "Manager"
},
{
@@ -40,6 +41,7 @@ a set of `TeamMemberWage` objects.
"id": "rZduCkzYDUVL3ovh1sQgbue6",
"job_id": "gcbz15vKGnMKmaWJJ152kjim",
"team_member_id": "33fJchumvVdJwxV0H6L9",
+ "tip_eligible": true,
"title": "Cook"
},
{
@@ -50,6 +52,7 @@ a set of `TeamMemberWage` objects.
"id": "FxLbs5KpPUHa8wyt5ctjubDX",
"job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
"team_member_id": "33fJchumvVdJwxV0H6L9",
+ "tip_eligible": true,
"title": "Barista"
},
{
@@ -60,6 +63,7 @@ a set of `TeamMemberWage` objects.
"id": "vD1wCgijMDR3cX5TPnu7VXto",
"job_id": "N4YKVLzFj3oGtNocqoYHYpW3",
"team_member_id": "33fJchumvVdJwxV0H6L9",
+ "tip_eligible": true,
"title": "Cashier"
}
],
diff --git a/doc/models/obtain-token-response.md b/doc/models/obtain-token-response.md
index 31d3cf53..00a7a931 100644
--- a/doc/models/obtain-token-response.md
+++ b/doc/models/obtain-token-response.md
@@ -9,14 +9,14 @@
| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
-| `accessToken` | `?string` | Optional | A valid OAuth access token. OAuth access tokens are 64 bytes long.
Provide the access token in a header with every request to Connect API
endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void |
+| `accessToken` | `?string` | Optional | A valid OAuth access token.
Provide the access token in a header with every request to Connect API
endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void |
| `tokenType` | `?string` | Optional | This value is always _bearer_.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10` | getTokenType(): ?string | setTokenType(?string tokenType): void |
| `expiresAt` | `?string` | Optional | The date when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void |
| `merchantId` | `?string` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | getMerchantId(): ?string | setMerchantId(?string merchantId): void |
| `subscriptionId` | `?string` | Optional | __LEGACY FIELD__. The ID of a subscription plan the merchant signed up
for. The ID is only present if the merchant signed up for a subscription plan during authorization. | getSubscriptionId(): ?string | setSubscriptionId(?string subscriptionId): void |
| `planId` | `?string` | Optional | __LEGACY FIELD__. The ID of the subscription plan the merchant signed
up for. The ID is only present if the merchant signed up for a subscription plan during
authorization. | getPlanId(): ?string | setPlanId(?string planId): void |
| `idToken` | `?string` | Optional | The OpenID token belonging to this person. This token is only present if the
OPENID scope is included in the authorization request. | getIdToken(): ?string | setIdToken(?string idToken): void |
-| `refreshToken` | `?string` | Optional | A refresh token. OAuth refresh tokens are 64 bytes long.
For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void |
+| `refreshToken` | `?string` | Optional | A refresh token.
For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void |
| `shortLived` | `?bool` | Optional | A Boolean indicating that the access token is a short-lived access token.
The short-lived access token returned in the response expires in 24 hours. | getShortLived(): ?bool | setShortLived(?bool shortLived): void |
| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void |
| `refreshTokenExpiresAt` | `?string` | Optional | The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getRefreshTokenExpiresAt(): ?string | setRefreshTokenExpiresAt(?string refreshTokenExpiresAt): void |
diff --git a/doc/models/search-shifts-response.md b/doc/models/search-shifts-response.md
index cb2c2643..97c09e09 100644
--- a/doc/models/search-shifts-response.md
+++ b/doc/models/search-shifts-response.md
@@ -35,6 +35,10 @@ the request resulted in errors.
}
],
"created_at": "2019-01-24T01:12:03Z",
+ "declared_cash_tip_money": {
+ "amount": 500,
+ "currency": "USD"
+ },
"employee_id": "ormj0jJJZ5OZIzxrZYJI",
"end_at": "2019-01-21T13:11:00-05:00",
"id": "X714F3HA6D1PT",
@@ -51,6 +55,7 @@ the request resulted in errors.
"currency": "USD"
},
"job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
+ "tip_eligible": true,
"title": "Barista"
}
},
@@ -76,6 +81,10 @@ the request resulted in errors.
}
],
"created_at": "2019-01-23T23:32:45Z",
+ "declared_cash_tip_money": {
+ "amount": 0,
+ "currency": "USD"
+ },
"employee_id": "33fJchumvVdJwxV0H6L9",
"end_at": "2019-01-22T13:02:00-05:00",
"id": "GDHYBZYWK0P2V",
@@ -92,6 +101,7 @@ the request resulted in errors.
"currency": "USD"
},
"job_id": "gcbz15vKGnMKmaWJJ152kjim",
+ "tip_eligible": true,
"title": "Cook"
}
}
diff --git a/doc/models/shift-wage.md b/doc/models/shift-wage.md
index 59cfbe8c..5d158054 100644
--- a/doc/models/shift-wage.md
+++ b/doc/models/shift-wage.md
@@ -14,6 +14,7 @@ The hourly wage rate used to compensate an employee for this shift.
| `title` | `?string` | Optional | The name of the job performed during this shift. | getTitle(): ?string | setTitle(?string title): void |
| `hourlyRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void |
| `jobId` | `?string` | Optional | The id of the job performed during this shift. Square
labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. | getJobId(): ?string | setJobId(?string jobId): void |
+| `tipEligible` | `?bool` | Optional | Whether team members are eligible for tips when working this job. | getTipEligible(): ?bool | setTipEligible(?bool tipEligible): void |
## Example (as JSON)
@@ -24,7 +25,8 @@ The hourly wage rate used to compensate an employee for this shift.
"amount": 172,
"currency": "OMR"
},
- "job_id": "job_id2"
+ "job_id": "job_id2",
+ "tip_eligible": false
}
```
diff --git a/doc/models/shift.md b/doc/models/shift.md
index 78efbe4d..0df0b6c9 100644
--- a/doc/models/shift.md
+++ b/doc/models/shift.md
@@ -15,7 +15,7 @@ taken during the shift.
| --- | --- | --- | --- | --- | --- |
| `id` | `?string` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void |
| `employeeId` | `?string` | Optional | The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead. | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void |
-| `locationId` | `?string` | Optional | The ID of the location this shift occurred at. The location should be based on
where the employee clocked in. | getLocationId(): ?string | setLocationId(?string locationId): void |
+| `locationId` | `string` | Required | The ID of the location this shift occurred at. The location should be based on
where the employee clocked in.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void |
| `timezone` | `?string` | Optional | The read-only convenience value that is calculated from the location based
on the `location_id`. Format: the IANA timezone database identifier for the
location timezone. | getTimezone(): ?string | setTimezone(?string timezone): void |
| `startAt` | `string` | Required | RFC 3339; shifted to the location timezone + offset. Precision up to the
minute is respected; seconds are truncated.
**Constraints**: *Minimum Length*: `1` | getStartAt(): string | setStartAt(string startAt): void |
| `endAt` | `?string` | Optional | RFC 3339; shifted to the timezone + offset. Precision up to the minute is
respected; seconds are truncated. | getEndAt(): ?string | setEndAt(?string endAt): void |
@@ -26,6 +26,7 @@ taken during the shift.
| `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void |
| `updatedAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void |
| `teamMemberId` | `?string` | Optional | The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void |
+| `declaredCashTipMoney` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getDeclaredCashTipMoney(): ?Money | setDeclaredCashTipMoney(?Money declaredCashTipMoney): void |
## Example (as JSON)
@@ -36,7 +37,16 @@ taken during the shift.
"location_id": "location_id4",
"timezone": "timezone0",
"start_at": "start_at2",
- "end_at": "end_at0"
+ "end_at": "end_at0",
+ "wage": {
+ "title": "title8",
+ "hourly_rate": {
+ "amount": 172,
+ "currency": "OMR"
+ },
+ "job_id": "job_id0",
+ "tip_eligible": false
+ }
}
```
diff --git a/doc/models/team-member-wage.md b/doc/models/team-member-wage.md
index 8fd5498a..3af7c007 100644
--- a/doc/models/team-member-wage.md
+++ b/doc/models/team-member-wage.md
@@ -17,6 +17,7 @@ specified by the `title` property of this object.
| `title` | `?string` | Optional | The job title that this wage relates to. | getTitle(): ?string | setTitle(?string title): void |
| `hourlyRate` | [`?Money`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void |
| `jobId` | `?string` | Optional | An identifier for the job that this wage relates to. This cannot be
used to retrieve the job. | getJobId(): ?string | setJobId(?string jobId): void |
+| `tipEligible` | `?bool` | Optional | Whether team members are eligible for tips when working this job. | getTipEligible(): ?bool | setTipEligible(?bool tipEligible): void |
## Example (as JSON)
diff --git a/doc/models/update-shift-request.md b/doc/models/update-shift-request.md
index b260fe6a..9644e0c0 100644
--- a/doc/models/update-shift-request.md
+++ b/doc/models/update-shift-request.md
@@ -29,6 +29,10 @@ A request to update a `Shift` object.
"start_at": "2019-01-25T06:11:00-05:00"
}
],
+ "declared_cash_tip_money": {
+ "amount": 500,
+ "currency": "USD"
+ },
"end_at": "2019-01-25T13:11:00-05:00",
"location_id": "PAA1RJZZKXBFG",
"start_at": "2019-01-25T03:11:00-05:00",
@@ -39,7 +43,9 @@ A request to update a `Shift` object.
"amount": 1500,
"currency": "USD"
},
- "title": "Bartender"
+ "tip_eligible": true,
+ "title": "Bartender",
+ "job_id": "job_id0"
},
"id": "id4",
"employee_id": "employee_id4",
diff --git a/doc/models/update-shift-response.md b/doc/models/update-shift-response.md
index 28b04d31..ef3458fd 100644
--- a/doc/models/update-shift-response.md
+++ b/doc/models/update-shift-response.md
@@ -33,6 +33,10 @@ the request resulted in errors.
}
],
"created_at": "2019-02-28T00:39:02Z",
+ "declared_cash_tip_money": {
+ "amount": 500,
+ "currency": "USD"
+ },
"employee_id": "ormj0jJJZ5OZIzxrZYJI",
"end_at": "2019-01-25T13:11:00-05:00",
"id": "K0YH4CV5462JB",
@@ -49,6 +53,7 @@ the request resulted in errors.
"currency": "USD"
},
"job_id": "dZtrPh5GSDGugyXGByesVp51",
+ "tip_eligible": true,
"title": "Bartender"
}
},
diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php
index a4410518..0cc102ce 100644
--- a/src/ConfigurationDefaults.php
+++ b/src/ConfigurationDefaults.php
@@ -27,7 +27,7 @@ class ConfigurationDefaults
public const HTTP_METHODS_TO_RETRY = ['GET', 'PUT'];
- public const SQUARE_VERSION = '2023-10-18';
+ public const SQUARE_VERSION = '2023-11-15';
public const ADDITIONAL_HEADERS = [];
diff --git a/src/Models/Builders/ShiftBuilder.php b/src/Models/Builders/ShiftBuilder.php
index c2b45183..f38b34b7 100644
--- a/src/Models/Builders/ShiftBuilder.php
+++ b/src/Models/Builders/ShiftBuilder.php
@@ -5,6 +5,7 @@
namespace Square\Models\Builders;
use Core\Utils\CoreHelper;
+use Square\Models\Money;
use Square\Models\Shift;
use Square\Models\ShiftWage;
@@ -28,9 +29,9 @@ private function __construct(Shift $instance)
/**
* Initializes a new shift Builder object.
*/
- public static function init(string $startAt): self
+ public static function init(string $locationId, string $startAt): self
{
- return new self(new Shift($startAt));
+ return new self(new Shift($locationId, $startAt));
}
/**
@@ -60,24 +61,6 @@ public function unsetEmployeeId(): self
return $this;
}
- /**
- * Sets location id field.
- */
- public function locationId(?string $value): self
- {
- $this->instance->setLocationId($value);
- return $this;
- }
-
- /**
- * Unsets location id field.
- */
- public function unsetLocationId(): self
- {
- $this->instance->unsetLocationId();
- return $this;
- }
-
/**
* Sets timezone field.
*/
@@ -195,6 +178,15 @@ public function unsetTeamMemberId(): self
return $this;
}
+ /**
+ * Sets declared cash tip money field.
+ */
+ public function declaredCashTipMoney(?Money $value): self
+ {
+ $this->instance->setDeclaredCashTipMoney($value);
+ return $this;
+ }
+
/**
* Initializes a new shift object.
*/
diff --git a/src/Models/Builders/ShiftWageBuilder.php b/src/Models/Builders/ShiftWageBuilder.php
index 304e51c1..02a483eb 100644
--- a/src/Models/Builders/ShiftWageBuilder.php
+++ b/src/Models/Builders/ShiftWageBuilder.php
@@ -69,6 +69,24 @@ public function jobId(?string $value): self
return $this;
}
+ /**
+ * Sets tip eligible field.
+ */
+ public function tipEligible(?bool $value): self
+ {
+ $this->instance->setTipEligible($value);
+ return $this;
+ }
+
+ /**
+ * Unsets tip eligible field.
+ */
+ public function unsetTipEligible(): self
+ {
+ $this->instance->unsetTipEligible();
+ return $this;
+ }
+
/**
* Initializes a new shift wage object.
*/
diff --git a/src/Models/Builders/TeamMemberWageBuilder.php b/src/Models/Builders/TeamMemberWageBuilder.php
index 67cdfef4..a174ff31 100644
--- a/src/Models/Builders/TeamMemberWageBuilder.php
+++ b/src/Models/Builders/TeamMemberWageBuilder.php
@@ -105,6 +105,24 @@ public function unsetJobId(): self
return $this;
}
+ /**
+ * Sets tip eligible field.
+ */
+ public function tipEligible(?bool $value): self
+ {
+ $this->instance->setTipEligible($value);
+ return $this;
+ }
+
+ /**
+ * Unsets tip eligible field.
+ */
+ public function unsetTipEligible(): self
+ {
+ $this->instance->unsetTipEligible();
+ return $this;
+ }
+
/**
* Initializes a new team member wage object.
*/
diff --git a/src/Models/ObtainTokenResponse.php b/src/Models/ObtainTokenResponse.php
index a0693362..37bd65db 100644
--- a/src/Models/ObtainTokenResponse.php
+++ b/src/Models/ObtainTokenResponse.php
@@ -65,7 +65,7 @@ class ObtainTokenResponse implements \JsonSerializable
/**
* Returns Access Token.
- * A valid OAuth access token. OAuth access tokens are 64 bytes long.
+ * A valid OAuth access token.
* Provide the access token in a header with every request to Connect API
* endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.
* com/docs/oauth-api/walkthrough).
@@ -77,7 +77,7 @@ public function getAccessToken(): ?string
/**
* Sets Access Token.
- * A valid OAuth access token. OAuth access tokens are 64 bytes long.
+ * A valid OAuth access token.
* Provide the access token in a header with every request to Connect API
* endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.
* com/docs/oauth-api/walkthrough).
@@ -221,7 +221,7 @@ public function setIdToken(?string $idToken): void
/**
* Returns Refresh Token.
- * A refresh token. OAuth refresh tokens are 64 bytes long.
+ * A refresh token.
* For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.
* squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
*/
@@ -232,7 +232,7 @@ public function getRefreshToken(): ?string
/**
* Sets Refresh Token.
- * A refresh token. OAuth refresh tokens are 64 bytes long.
+ * A refresh token.
* For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.
* squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
*
diff --git a/src/Models/Shift.php b/src/Models/Shift.php
index 685d31b9..c9784a21 100644
--- a/src/Models/Shift.php
+++ b/src/Models/Shift.php
@@ -24,9 +24,9 @@ class Shift implements \JsonSerializable
private $employeeId = [];
/**
- * @var array
+ * @var string
*/
- private $locationId = [];
+ private $locationId;
/**
* @var array
@@ -79,10 +79,17 @@ class Shift implements \JsonSerializable
private $teamMemberId = [];
/**
+ * @var Money|null
+ */
+ private $declaredCashTipMoney;
+
+ /**
+ * @param string $locationId
* @param string $startAt
*/
- public function __construct(string $startAt)
+ public function __construct(string $locationId, string $startAt)
{
+ $this->locationId = $locationId;
$this->startAt = $startAt;
}
@@ -146,12 +153,9 @@ public function unsetEmployeeId(): void
* The ID of the location this shift occurred at. The location should be based on
* where the employee clocked in.
*/
- public function getLocationId(): ?string
+ public function getLocationId(): string
{
- if (count($this->locationId) == 0) {
- return null;
- }
- return $this->locationId['value'];
+ return $this->locationId;
}
/**
@@ -159,21 +163,12 @@ public function getLocationId(): ?string
* The ID of the location this shift occurred at. The location should be based on
* where the employee clocked in.
*
+ * @required
* @maps location_id
*/
- public function setLocationId(?string $locationId): void
- {
- $this->locationId['value'] = $locationId;
- }
-
- /**
- * Unsets Location Id.
- * The ID of the location this shift occurred at. The location should be based on
- * where the employee clocked in.
- */
- public function unsetLocationId(): void
+ public function setLocationId(string $locationId): void
{
- $this->locationId = [];
+ $this->locationId = $locationId;
}
/**
@@ -446,6 +441,38 @@ public function unsetTeamMemberId(): void
$this->teamMemberId = [];
}
+ /**
+ * Returns Declared Cash Tip Money.
+ * Represents an amount of money. `Money` fields can be signed or unsigned.
+ * Fields that do not explicitly define whether they are signed or unsigned are
+ * considered unsigned and can only hold positive amounts. For signed fields, the
+ * sign of the value indicates the purpose of the money transfer. See
+ * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-
+ * monetary-amounts)
+ * for more information.
+ */
+ public function getDeclaredCashTipMoney(): ?Money
+ {
+ return $this->declaredCashTipMoney;
+ }
+
+ /**
+ * Sets Declared Cash Tip Money.
+ * Represents an amount of money. `Money` fields can be signed or unsigned.
+ * Fields that do not explicitly define whether they are signed or unsigned are
+ * considered unsigned and can only hold positive amounts. For signed fields, the
+ * sign of the value indicates the purpose of the money transfer. See
+ * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-
+ * monetary-amounts)
+ * for more information.
+ *
+ * @maps declared_cash_tip_money
+ */
+ public function setDeclaredCashTipMoney(?Money $declaredCashTipMoney): void
+ {
+ $this->declaredCashTipMoney = $declaredCashTipMoney;
+ }
+
/**
* Encode this object to JSON
*
@@ -459,41 +486,42 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->id)) {
- $json['id'] = $this->id;
+ $json['id'] = $this->id;
}
if (!empty($this->employeeId)) {
- $json['employee_id'] = $this->employeeId['value'];
- }
- if (!empty($this->locationId)) {
- $json['location_id'] = $this->locationId['value'];
+ $json['employee_id'] = $this->employeeId['value'];
}
+ $json['location_id'] = $this->locationId;
if (!empty($this->timezone)) {
- $json['timezone'] = $this->timezone['value'];
+ $json['timezone'] = $this->timezone['value'];
}
- $json['start_at'] = $this->startAt;
+ $json['start_at'] = $this->startAt;
if (!empty($this->endAt)) {
- $json['end_at'] = $this->endAt['value'];
+ $json['end_at'] = $this->endAt['value'];
}
if (isset($this->wage)) {
- $json['wage'] = $this->wage;
+ $json['wage'] = $this->wage;
}
if (!empty($this->breaks)) {
- $json['breaks'] = $this->breaks['value'];
+ $json['breaks'] = $this->breaks['value'];
}
if (isset($this->status)) {
- $json['status'] = $this->status;
+ $json['status'] = $this->status;
}
if (isset($this->version)) {
- $json['version'] = $this->version;
+ $json['version'] = $this->version;
}
if (isset($this->createdAt)) {
- $json['created_at'] = $this->createdAt;
+ $json['created_at'] = $this->createdAt;
}
if (isset($this->updatedAt)) {
- $json['updated_at'] = $this->updatedAt;
+ $json['updated_at'] = $this->updatedAt;
}
if (!empty($this->teamMemberId)) {
- $json['team_member_id'] = $this->teamMemberId['value'];
+ $json['team_member_id'] = $this->teamMemberId['value'];
+ }
+ if (isset($this->declaredCashTipMoney)) {
+ $json['declared_cash_tip_money'] = $this->declaredCashTipMoney;
}
$json = array_filter($json, function ($val) {
return $val !== null;
diff --git a/src/Models/ShiftWage.php b/src/Models/ShiftWage.php
index 3749312b..51dca13e 100644
--- a/src/Models/ShiftWage.php
+++ b/src/Models/ShiftWage.php
@@ -26,6 +26,11 @@ class ShiftWage implements \JsonSerializable
*/
private $jobId;
+ /**
+ * @var array
+ */
+ private $tipEligible = [];
+
/**
* Returns Title.
* The name of the job performed during this shift.
@@ -112,6 +117,38 @@ public function setJobId(?string $jobId): void
$this->jobId = $jobId;
}
+ /**
+ * Returns Tip Eligible.
+ * Whether team members are eligible for tips when working this job.
+ */
+ public function getTipEligible(): ?bool
+ {
+ if (count($this->tipEligible) == 0) {
+ return null;
+ }
+ return $this->tipEligible['value'];
+ }
+
+ /**
+ * Sets Tip Eligible.
+ * Whether team members are eligible for tips when working this job.
+ *
+ * @maps tip_eligible
+ */
+ public function setTipEligible(?bool $tipEligible): void
+ {
+ $this->tipEligible['value'] = $tipEligible;
+ }
+
+ /**
+ * Unsets Tip Eligible.
+ * Whether team members are eligible for tips when working this job.
+ */
+ public function unsetTipEligible(): void
+ {
+ $this->tipEligible = [];
+ }
+
/**
* Encode this object to JSON
*
@@ -125,13 +162,16 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (!empty($this->title)) {
- $json['title'] = $this->title['value'];
+ $json['title'] = $this->title['value'];
}
if (isset($this->hourlyRate)) {
- $json['hourly_rate'] = $this->hourlyRate;
+ $json['hourly_rate'] = $this->hourlyRate;
}
if (isset($this->jobId)) {
- $json['job_id'] = $this->jobId;
+ $json['job_id'] = $this->jobId;
+ }
+ if (!empty($this->tipEligible)) {
+ $json['tip_eligible'] = $this->tipEligible['value'];
}
$json = array_filter($json, function ($val) {
return $val !== null;
diff --git a/src/Models/TeamMemberWage.php b/src/Models/TeamMemberWage.php
index f738fbe3..a61d8293 100644
--- a/src/Models/TeamMemberWage.php
+++ b/src/Models/TeamMemberWage.php
@@ -37,6 +37,11 @@ class TeamMemberWage implements \JsonSerializable
*/
private $jobId = [];
+ /**
+ * @var array
+ */
+ private $tipEligible = [];
+
/**
* Returns Id.
* The UUID for this object.
@@ -188,6 +193,38 @@ public function unsetJobId(): void
$this->jobId = [];
}
+ /**
+ * Returns Tip Eligible.
+ * Whether team members are eligible for tips when working this job.
+ */
+ public function getTipEligible(): ?bool
+ {
+ if (count($this->tipEligible) == 0) {
+ return null;
+ }
+ return $this->tipEligible['value'];
+ }
+
+ /**
+ * Sets Tip Eligible.
+ * Whether team members are eligible for tips when working this job.
+ *
+ * @maps tip_eligible
+ */
+ public function setTipEligible(?bool $tipEligible): void
+ {
+ $this->tipEligible['value'] = $tipEligible;
+ }
+
+ /**
+ * Unsets Tip Eligible.
+ * Whether team members are eligible for tips when working this job.
+ */
+ public function unsetTipEligible(): void
+ {
+ $this->tipEligible = [];
+ }
+
/**
* Encode this object to JSON
*
@@ -215,6 +252,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
if (!empty($this->jobId)) {
$json['job_id'] = $this->jobId['value'];
}
+ if (!empty($this->tipEligible)) {
+ $json['tip_eligible'] = $this->tipEligible['value'];
+ }
$json = array_filter($json, function ($val) {
return $val !== null;
});
diff --git a/src/SquareClient.php b/src/SquareClient.php
index 6bf6d0ca..65b1bbca 100644
--- a/src/SquareClient.php
+++ b/src/SquareClient.php
@@ -162,7 +162,7 @@ public function __construct(array $config = [])
->jsonHelper(ApiHelper::getJsonHelper())
->apiCallback($this->config['httpCallback'] ?? null)
->userAgent(
- 'Square-PHP-SDK/32.0.0.20231018 ({api-version}) {engine}/{engine-version} ({os-' .
+ 'Square-PHP-SDK/33.0.0.20231115 ({api-version}) {engine}/{engine-version} ({os-' .
'info}) {detail}'
)
->userAgentConfig(
@@ -304,7 +304,7 @@ public function withConfiguration(array $config): self
*/
public function getSdkVersion(): string
{
- return '32.0.0.20231018';
+ return '33.0.0.20231115';
}
/**