Skip to content

Commit

Permalink
Merge pull request #42 from square/release/10.0.0.20210421
Browse files Browse the repository at this point in the history
Generated PR for Release: 10.0.0.20210421
  • Loading branch information
Wolfgang Schuster authored Apr 22, 2021
2 parents 02de209 + 9a45613 commit 9395bf1
Show file tree
Hide file tree
Showing 508 changed files with 3,415 additions and 2,369 deletions.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Change Log

## Version 10.0.0.20210421 (2021-04-21)
## New API releases

## Existing API updates

* **Subscriptions API:**
* [ResumeSubscription.](https://developer.squareup.com/reference/square_2021-04-21/subscriptions-api/resume-subscription) This new endpoint enables applications to resume [deactivated subscriptions.](https://developer.squareup.com/docs/subscriptions-api/overview#deactivated-subscriptions) After a subscription is created, there are events that can make a subscription non-billable, causing Square to deactivate the subscription. A seller can also resume deactivated subscriptions in the Seller Dashboard. Applications can call [ListSubscriptionEvents](https://developer.squareup.com/reference/square_2021-04-21/subscriptions-api/list-subscription-events) to determine why Square deactivated a subscription.

* **Customers API:**

* [Customer](https://developer.squareup.com/reference/square_2021-04-21/objects/Customer) object:
* New `version` field (beta). This field represents the current version of the customer profile. You can include it in your `UpdateCustomer` and `DeleteCustomer` requests to enable optimistic concurrency. For more information, see [Customer profile versions and optimistic concurrency support.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-profile-versions-and-optimistic-concurrency-support)
* The `groups` field and corresponding `CustomerGroupInfo` object are retired.

* [Customer webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks) have moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. Event notifications now include the `version` field (beta).

* **Invoices API:**

* The [Invoices API](https://developer.squareup.com/docs/invoices-api/overview) has moved to the GA state.

* [Invoice](https://developer.squareup.com/reference/square_2021-04-21/objects/Invoice) object:
* A new required `accepted_payment_methods` field that defines the methods of payment that customers can use to pay an invoice on the Square-hosted invoice page. Valid values are defined in the new [InvoiceAcceptedPaymentMethods](https://developer.squareup.com/reference/square_2021-04-21/objects/InvoiceAcceptedPaymentMethods) enum. For more information, see the [migration notes.](https://developer.squareup.com/docs/invoices-api/overview#migration-notes)
* A new `subscription_id` field, which is included in invoices created for subscription billing.

* **Loyalty API:** (beta)

* [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-04-21/loyalty-api/retrieve-loyalty-program) endpoint. This new endpoint accepts a program ID or the `main` keyword and returns the loyalty program in a seller's account. For more information, see [Retrieve a loyalty program.](https://developer.squareup.com/docs/loyalty-api/overview#retrieve-loyalty-program) This endpoint is preferred over the `ListLoyaltyPrograms` endpoint.

* Introduced a new mapping implementation for loyalty accounts:
* [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-04-21/objects/LoyaltyAccount) object. Added the `mapping` field (of type `LoyaltyAccountMapping`), which is used to associate the loyalty account with a buyer. This field is recommended over the `mappings` field.
* [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-04-21/objects/LoyaltyAccountMapping) object. Added the `phone_number` field to represent a phone number mapping. This field is recommended over the `type` and `value` fields.

* A new [loyalty.program.created](https://developer.squareup.com/reference/square_2021-04-21/webhooks/loyalty.program.created) webhook. Square now publishes an event notification when a loyalty program is created in the Square Seller Dashboard.

* **Inventory API:**
* [InventoryChange](https://developer.squareup.com/reference/square_2021-04-21/objects/InventoryChange) can now have its own measurement unit.

* **Catalog API:**
* [CatalogItem](https://developer.squareup.com/reference/square_2021-04-21/objects/CatalogItem) introduces the `sort_name` attribute that can take Japanese writing scripts to sort items by. When it is unspecified, the regular `name` attribute is used for sorting.
* [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-04-21/objects/CatalogCatalogPricingRule) has the new `customer_group_ids_any` attribute included to support automatic application of discounts to specified product set purchased by members of any of the customer groups identified by the `customer_group_ids_any` attribute values.
* **Team API**
* New [Team webhooks](https://developer.squareup.com/reference/square_2021-04-21/team-api/webhooks): `team_member.created`, `team_member.updated`, `team_member.wage_setting.updated` to notify on created and updated team members and wage settings.




## Version 9.1.0.20210317 (2021-03-17)

## Existing API updates
Expand Down
8 changes: 4 additions & 4 deletions 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": "9.1.0.20210317",
"version": "10.0.0.20210421",
"type": "library",
"keywords": [
"Square",
Expand All @@ -18,16 +18,16 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"apimatic/unirest-php": "^2.0",
"apimatic/jsonmapper": "^2.0.1"
"apimatic/jsonmapper": "^2.0.2"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
"phan/phan": "^2.5",
"phan/phan": "^3.0",
"phpunit/phpunit": "^7.5 || ^8.5"
},
"autoload": {
Expand Down
6 changes: 3 additions & 3 deletions doc/apis/bank-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $bankAccountsApi = $client->getBankAccountsApi();

# List Bank Accounts

Returns a list of [BankAccount](#type-bankaccount) objects linked to a Square account.
Returns a list of [BankAccount](/doc/models/bank-account.md) objects linked to a Square account.

```php
function listBankAccounts(?string $cursor = null, ?int $limit = null, ?string $locationId = null): ApiResponse
Expand Down Expand Up @@ -58,7 +58,7 @@ if ($apiResponse->isSuccess()) {

# Get Bank Account by V1 Id

Returns details of a [BankAccount](#type-bankaccount) identified by V1 bank account ID.
Returns details of a [BankAccount](/doc/models/bank-account.md) identified by V1 bank account ID.

```php
function getBankAccountByV1Id(string $v1BankAccountId): ApiResponse
Expand Down Expand Up @@ -95,7 +95,7 @@ if ($apiResponse->isSuccess()) {

# Get Bank Account

Returns details of a [BankAccount](#type-bankaccount)
Returns details of a [BankAccount](/doc/models/bank-account.md)
linked to a Square account.

```php
Expand Down
6 changes: 3 additions & 3 deletions doc/apis/bookings.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function retrieveBooking(string $bookingId): ApiResponse

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `bookingId` | `string` | Template, Required | The ID of the [Booking](#type-booking) object representing the to-be-retrieved booking. |
| `bookingId` | `string` | Template, Required | The ID of the [Booking](/doc/models/booking.md) object representing the to-be-retrieved booking. |

## Response Type

Expand Down Expand Up @@ -300,7 +300,7 @@ function updateBooking(string $bookingId, UpdateBookingRequest $body): ApiRespon

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `bookingId` | `string` | Template, Required | The ID of the [Booking](#type-booking) object representing the to-be-updated booking. |
| `bookingId` | `string` | Template, Required | The ID of the [Booking](/doc/models/booking.md) object representing the to-be-updated booking. |
| `body` | [`UpdateBookingRequest`](/doc/models/update-booking-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |

## Response Type
Expand Down Expand Up @@ -348,7 +348,7 @@ function cancelBooking(string $bookingId, CancelBookingRequest $body): ApiRespon

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `bookingId` | `string` | Template, Required | The ID of the [Booking](#type-booking) object representing the to-be-cancelled booking. |
| `bookingId` | `string` | Template, Required | The ID of the [Booking](/doc/models/booking.md) object representing the to-be-cancelled booking. |
| `body` | [`CancelBookingRequest`](/doc/models/cancel-booking-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |

## Response Type
Expand Down
2 changes: 1 addition & 1 deletion doc/apis/cash-drawers.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if ($apiResponse->isSuccess()) {
# Retrieve Cash Drawer Shift

Provides the summary details for a single cash drawer shift. See
[ListCashDrawerShiftEvents](#endpoint-CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events.
[ListCashDrawerShiftEvents](/doc/apis/cash-drawers.md#list-cash-drawer-shift-events) for a list of cash drawer shift events.

```php
function retrieveCashDrawerShift(string $locationId, string $shiftId): ApiResponse
Expand Down
64 changes: 32 additions & 32 deletions doc/apis/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ $catalogApi = $client->getCatalogApi();

# Batch Delete Catalog Objects

Deletes a set of [CatalogItem](#type-catalogitem)s based on the
Deletes a set of [CatalogItem](/doc/models/catalog-item.md)s based on the
provided list of target IDs and returns a set of successfully deleted IDs in
the response. Deletion is a cascading event such that all children of the
targeted object are also deleted. For example, deleting a CatalogItem will
also delete all of its [CatalogItemVariation](#type-catalogitemvariation)
also delete all of its [CatalogItemVariation](/doc/models/catalog-item-variation.md)
children.

`BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted
Expand Down Expand Up @@ -75,11 +75,11 @@ if ($apiResponse->isSuccess()) {
# Batch Retrieve Catalog Objects

Returns a set of objects based on the provided ID.
Each [CatalogItem](#type-catalogitem) returned in the set includes all of its
Each [CatalogItem](/doc/models/catalog-item.md) returned in the set includes all of its
child information including: all of its
[CatalogItemVariation](#type-catalogitemvariation) objects, references to
its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of
any [CatalogTax](#type-catalogtax) objects that apply to it.
[CatalogItemVariation](/doc/models/catalog-item-variation.md) objects, references to
its [CatalogModifierList](/doc/models/catalog-modifier-list.md) objects, and the ids of
any [CatalogTax](/doc/models/catalog-tax.md) objects that apply to it.

```php
function batchRetrieveCatalogObjects(BatchRetrieveCatalogObjectsRequest $body): ApiResponse
Expand Down Expand Up @@ -469,8 +469,8 @@ if ($apiResponse->isSuccess()) {

# Create Catalog Image

Uploads an image file to be represented by a [CatalogImage](#type-catalogimage) object linked to an existing
[CatalogObject](#type-catalogobject) instance. A call to this endpoint can upload an image, link an image to
Uploads an image file to be represented by a [CatalogImage](/doc/models/catalog-image.md) object linked to an existing
[CatalogObject](/doc/models/catalog-object.md) instance. A call to this endpoint can upload an image, link an image to
a catalog object, or do both.

This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in
Expand Down Expand Up @@ -573,14 +573,14 @@ if ($apiResponse->isSuccess()) {

# List Catalog

Returns a list of [CatalogObject](#type-catalogobject)s that includes
all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem)
and [CatalogTax](#type-catalogtax) objects) in the catalog. The `types` parameter
is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types:
Returns a list of [CatalogObject](/doc/models/catalog-object.md)s that includes
all objects of a set of desired types (for example, all [CatalogItem](/doc/models/catalog-item.md)
and [CatalogTax](/doc/models/catalog-tax.md) objects) in the catalog. The `types` parameter
is specified as a comma-separated list of valid [CatalogObject](/doc/models/catalog-object.md) types:
`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`.

__Important:__ ListCatalog does not return deleted catalog items. To retrieve
deleted catalog items, use [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects)
deleted catalog items, use [SearchCatalogObjects](/doc/apis/catalog.md#search-catalog-objects)
and set the `include_deleted_objects` attribute value to `true`.

```php
Expand All @@ -593,7 +593,7 @@ function listCatalog(?string $cursor = null, ?string $types = null, ?int $catalo
| --- | --- | --- | --- |
| `cursor` | `?string` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.<br>See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. |
| `types` | `?string` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve, for example<br>`ITEM,ITEM_VARIATION,CATEGORY,IMAGE`.<br><br>The legal values are taken from the CatalogObjectType enum:<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. |
| `catalogVersion` | `?int` | Query, Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical<br>versions of objects. The specified version value is matched against<br>the [CatalogObject](#type-catalogobject)s' `version` attribute. |
| `catalogVersion` | `?int` | Query, Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical<br>versions of objects. The specified version value is matched against<br>the [CatalogObject](/doc/models/catalog-object.md)s' `version` attribute. |

## Response Type

Expand Down Expand Up @@ -622,7 +622,7 @@ if ($apiResponse->isSuccess()) {

# Upsert Catalog Object

Creates or updates the target [CatalogObject](#type-catalogobject).
Creates or updates the target [CatalogObject](/doc/models/catalog-object.md).

```php
function upsertCatalogObject(UpsertCatalogObjectRequest $body): ApiResponse
Expand Down Expand Up @@ -702,12 +702,12 @@ if ($apiResponse->isSuccess()) {

# Delete Catalog Object

Deletes a single [CatalogObject](#type-catalogobject) based on the
Deletes a single [CatalogObject](/doc/models/catalog-object.md) based on the
provided ID and returns the set of successfully deleted IDs in the response.
Deletion is a cascading event such that all children of the targeted object
are also deleted. For example, deleting a [CatalogItem](#type-catalogitem)
are also deleted. For example, deleting a [CatalogItem](/doc/models/catalog-item.md)
will also delete all of its
[CatalogItemVariation](#type-catalogitemvariation) children.
[CatalogItemVariation](/doc/models/catalog-item-variation.md) children.

```php
function deleteCatalogObject(string $objectId): ApiResponse
Expand Down Expand Up @@ -744,13 +744,13 @@ if ($apiResponse->isSuccess()) {

# Retrieve Catalog Object

Returns a single [CatalogItem](#type-catalogitem) as a
[CatalogObject](#type-catalogobject) based on the provided ID. The returned
object includes all of the relevant [CatalogItem](#type-catalogitem)
information including: [CatalogItemVariation](#type-catalogitemvariation)
Returns a single [CatalogItem](/doc/models/catalog-item.md) as a
[CatalogObject](/doc/models/catalog-object.md) based on the provided ID. The returned
object includes all of the relevant [CatalogItem](/doc/models/catalog-item.md)
information including: [CatalogItemVariation](/doc/models/catalog-item-variation.md)
children, references to its
[CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of
any [CatalogTax](#type-catalogtax) objects that apply to it.
[CatalogModifierList](/doc/models/catalog-modifier-list.md) objects, and the ids of
any [CatalogTax](/doc/models/catalog-tax.md) objects that apply to it.

```php
function retrieveCatalogObject(
Expand All @@ -766,7 +766,7 @@ function retrieveCatalogObject(
| --- | --- | --- | --- |
| `objectId` | `string` | Template, Required | The object ID of any type of catalog objects to be retrieved. |
| `includeRelatedObjects` | `?bool` | Query, Optional | If `true`, the response will include additional objects that are related to the<br>requested object, as follows:<br><br>If the `object` field of the response contains a `CatalogItem`, its associated<br>`CatalogCategory`, `CatalogTax`, `CatalogImage` and `CatalogModifierList` objects will<br>be returned in the `related_objects` field of the response. If the `object` field of<br>the response contains a `CatalogItemVariation`, its parent `CatalogItem` will be returned<br>in the `related_objects` field of the response.<br><br>Default value: `false`<br>**Default**: `false` |
| `catalogVersion` | `?int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](#type-catalogobject)s. |
| `catalogVersion` | `?int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical<br>versions of objects. The value to retrieve a specific version of an object can be found<br>in the version field of [CatalogObject](/doc/models/catalog-object.md)s. |

## Response Type

Expand Down Expand Up @@ -795,10 +795,10 @@ if ($apiResponse->isSuccess()) {

# Search Catalog Objects

Searches for [CatalogObject](#type-CatalogObject) of any type by matching supported search attribute values,
Searches for [CatalogObject](/doc/models/catalog-object.md) of any type by matching supported search attribute values,
excluding custom attribute values on items or item variations, against one or more of the specified query expressions.

This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems)
This (`SearchCatalogObjects`) endpoint differs from the [SearchCatalogItems](/doc/apis/catalog.md#search-catalog-items)
endpoint in the following aspects:

- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.
Expand Down Expand Up @@ -881,7 +881,7 @@ if ($apiResponse->isSuccess()) {
Searches for catalog items or item variations by matching supported search attribute values, including
custom attribute values, against one or more of the specified query expressions.

This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects)
This (`SearchCatalogItems`) endpoint differs from the [SearchCatalogObjects](/doc/apis/catalog.md#search-catalog-objects)
endpoint in the following aspects:

- `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` can search for any type of catalog objects.
Expand Down Expand Up @@ -972,8 +972,8 @@ if ($apiResponse->isSuccess()) {

# Update Item Modifier Lists

Updates the [CatalogModifierList](#type-catalogmodifierlist) objects
that apply to the targeted [CatalogItem](#type-catalogitem) without having
Updates the [CatalogModifierList](/doc/models/catalog-modifier-list.md) objects
that apply to the targeted [CatalogItem](/doc/models/catalog-item.md) without having
to perform an upsert on the entire item.

```php
Expand Down Expand Up @@ -1016,8 +1016,8 @@ if ($apiResponse->isSuccess()) {

# Update Item Taxes

Updates the [CatalogTax](#type-catalogtax) objects that apply to the
targeted [CatalogItem](#type-catalogitem) without having to perform an
Updates the [CatalogTax](/doc/models/catalog-tax.md) objects that apply to the
targeted [CatalogItem](/doc/models/catalog-item.md) without having to perform an
upsert on the entire item.

```php
Expand Down
Loading

0 comments on commit 9395bf1

Please sign in to comment.