diff --git a/CHANGELOG.md b/CHANGELOG.md index 575713d3..ac96497f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/composer.json b/composer.json index daaffbb6..f688d870 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": "9.1.0.20210317", + "version": "10.0.0.20210421", "type": "library", "keywords": [ "Square", @@ -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": { diff --git a/doc/apis/bank-accounts.md b/doc/apis/bank-accounts.md index 2353ddd8..35413c10 100644 --- a/doc/apis/bank-accounts.md +++ b/doc/apis/bank-accounts.md @@ -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 @@ -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 @@ -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 diff --git a/doc/apis/bookings.md b/doc/apis/bookings.md index 95a2407b..4ecdbd00 100644 --- a/doc/apis/bookings.md +++ b/doc/apis/bookings.md @@ -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 @@ -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.

See the corresponding object definition for field details. | ## Response Type @@ -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.

See the corresponding object definition for field details. | ## Response Type diff --git a/doc/apis/cash-drawers.md b/doc/apis/cash-drawers.md index 142ec098..a52ee815 100644 --- a/doc/apis/cash-drawers.md +++ b/doc/apis/cash-drawers.md @@ -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 diff --git a/doc/apis/catalog.md b/doc/apis/catalog.md index 30494fcd..b06cbf88 100644 --- a/doc/apis/catalog.md +++ b/doc/apis/catalog.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -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.
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
`ITEM,ITEM_VARIATION,CATEGORY,IMAGE`.

The legal values are taken from the CatalogObjectType enum:
`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,
`MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. | -| `catalogVersion` | `?int` | Query, Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical
versions of objects. The specified version value is matched against
the [CatalogObject](#type-catalogobject)s' `version` attribute. | +| `catalogVersion` | `?int` | Query, Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical
versions of objects. The specified version value is matched against
the [CatalogObject](/doc/models/catalog-object.md)s' `version` attribute. | ## Response Type @@ -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 @@ -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 @@ -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( @@ -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
requested object, as follows:

If the `object` field of the response contains a `CatalogItem`, its associated
`CatalogCategory`, `CatalogTax`, `CatalogImage` and `CatalogModifierList` objects will
be returned in the `related_objects` field of the response. If the `object` field of
the response contains a `CatalogItemVariation`, its parent `CatalogItem` will be returned
in the `related_objects` field of the response.

Default value: `false`
**Default**: `false` | -| `catalogVersion` | `?int` | Query, Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
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
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](/doc/models/catalog-object.md)s. | ## Response Type @@ -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. @@ -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. @@ -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 @@ -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 diff --git a/doc/apis/customer-groups.md b/doc/apis/customer-groups.md index e774486e..afb474c1 100644 --- a/doc/apis/customer-groups.md +++ b/doc/apis/customer-groups.md @@ -29,7 +29,7 @@ function listCustomerGroups(?string $cursor = null): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | +| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | ## Response Type diff --git a/doc/apis/customer-segments.md b/doc/apis/customer-segments.md index ac098153..e241d837 100644 --- a/doc/apis/customer-segments.md +++ b/doc/apis/customer-segments.md @@ -26,7 +26,7 @@ function listCustomerSegments(?string $cursor = null): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by previous calls to __ListCustomerSegments__.
Used to retrieve the next set of query results.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | +| `cursor` | `?string` | Query, Optional | A pagination cursor returned by previous calls to `ListCustomerSegments`.
This cursor is used to retrieve the next set of query results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | ## Response Type diff --git a/doc/apis/customers.md b/doc/apis/customers.md index b7d997d4..a1d5c819 100644 --- a/doc/apis/customers.md +++ b/doc/apis/customers.md @@ -38,9 +38,9 @@ function listCustomers(?string $cursor = null, ?string $sortField = null, ?strin | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | -| `sortField` | [`?string (CustomerSortField)`](/doc/models/customer-sort-field.md) | Query, Optional | Indicates how Customers should be sorted.

Default: `DEFAULT`. | -| `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Query, Optional | Indicates whether Customers should be sorted in ascending (`ASC`) or
descending (`DESC`) order.

Default: `ASC`. | +| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | +| `sortField` | [`?string (CustomerSortField)`](/doc/models/customer-sort-field.md) | Query, Optional | Indicates how customers should be sorted.

Default: `DEFAULT`. | +| `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Query, Optional | Indicates whether customers should be sorted in ascending (`ASC`) or
descending (`DESC`) order.

Default: `ASC`. | ## Response Type @@ -71,7 +71,7 @@ if ($apiResponse->isSuccess()) { Creates a new customer for a business, which can have associated cards on file. -You must provide __at least one__ of the following values in your request to this +You must provide at least one of the following values in your request to this endpoint: - `given_name` @@ -204,12 +204,14 @@ if ($apiResponse->isSuccess()) { # Delete Customer -Deletes a customer from a business, along with any linked cards on file. When two profiles -are merged into a single profile, that profile is assigned a new `customer_id`. You must use the -new `customer_id` to delete merged profiles. +Deletes a customer profile from a business, including any linked cards on file. + +As a best practice, you should include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. The value must be set to the current version of the customer profile. + +To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. ```php -function deleteCustomer(string $customerId): ApiResponse +function deleteCustomer(string $customerId, ?int $version = null): ApiResponse ``` ## Parameters @@ -217,6 +219,7 @@ function deleteCustomer(string $customerId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `customerId` | `string` | Template, Required | The ID of the customer to delete. | +| `version` | `?int` | Query, Optional | The current version of the customer profile.

As a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). | ## Response Type @@ -226,8 +229,9 @@ function deleteCustomer(string $customerId): ApiResponse ```php $customerId = 'customer_id8'; +$version = 172; -$apiResponse = $customersApi->deleteCustomer($customerId); +$apiResponse = $customersApi->deleteCustomer($customerId, $version); if ($apiResponse->isSuccess()) { $deleteCustomerResponse = $apiResponse->getResult(); @@ -280,14 +284,13 @@ if ($apiResponse->isSuccess()) { # Update Customer -Updates the details of an existing customer. When two profiles are merged -into a single profile, that profile is assigned a new `customer_id`. You must use -the new `customer_id` to update merged profiles. +Updates a customer profile. To change an attribute, specify the new value. To remove an attribute, specify the value as an empty string or empty object. + +As a best practice, you should include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. The value must be set to the current version of the customer profile. + +To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. -You cannot edit a customer's cards on file with this endpoint. To make changes -to a card on file, you must delete the existing card on file with the -[DeleteCustomerCard](#endpoint-Customers-deletecustomercard) endpoint, then create a new one with the -[CreateCustomerCard](#endpoint-Customers-createcustomercard) endpoint. +You cannot use this endpoint to change cards on file. To change a card on file, call [DeleteCustomerCard](/doc/apis/customers.md#delete-customer-card) to delete the existing card and then call [CreateCustomerCard](/doc/apis/customers.md#create-customer-card) to create a new card. ```php function updateCustomer(string $customerId, UpdateCustomerRequest $body): ApiResponse @@ -316,6 +319,7 @@ $body->setNickname('nickname2'); $body->setEmailAddress('New.Amelia.Earhart@example.com'); $body->setPhoneNumber(''); $body->setNote('updated customer note'); +$body->setVersion(2); $apiResponse = $customersApi->updateCustomer($customerId, $body); diff --git a/doc/apis/devices.md b/doc/apis/devices.md index f24a0075..4006470c 100644 --- a/doc/apis/devices.md +++ b/doc/apis/devices.md @@ -32,7 +32,7 @@ function listDeviceCodes( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](#paginatingresults) for more information. | +| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | | `locationId` | `?string` | Query, Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | | `productType` | [`?string (ProductType)`](/doc/models/product-type.md) | Query, Optional | If specified, only returns DeviceCodes targeting the specified product type.
Returns DeviceCodes of all product types if empty. | | `status` | [`?string (DeviceCodeStatus)`](/doc/models/device-code-status.md) | Query, Optional | If specified, returns DeviceCodes with the specified statuses.
Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. | diff --git a/doc/apis/disputes.md b/doc/apis/disputes.md index a09acb22..5fcbd8f4 100644 --- a/doc/apis/disputes.md +++ b/doc/apis/disputes.md @@ -182,7 +182,7 @@ if ($apiResponse->isSuccess()) { Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed. Also, you cannot remove evidence after -submitting it to the bank using [SubmitEvidence](https://developer.squareup.com/docs/reference/square/disputes-api/submit-evidence). +submitting it to the bank using [SubmitEvidence](/doc/apis/disputes.md#submit-evidence). ```php function removeDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse @@ -362,8 +362,8 @@ if ($apiResponse->isSuccess()) { Submits evidence to the cardholder's bank. Before submitting evidence, Square compiles all available evidence. This includes evidence uploaded -using the [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and -[CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints and +using the [CreateDisputeEvidenceFile](/doc/apis/disputes.md#create-dispute-evidence-file) and +[CreateDisputeEvidenceText](/doc/apis/disputes.md#create-dispute-evidence-text) endpoints and evidence automatically provided by Square, when available. ```php diff --git a/doc/apis/inventory.md b/doc/apis/inventory.md index 90340207..07f128ea 100644 --- a/doc/apis/inventory.md +++ b/doc/apis/inventory.md @@ -21,7 +21,7 @@ $inventoryApi = $client->getInventoryApi(); # Retrieve Inventory Adjustment -Returns the [InventoryAdjustment](#type-inventoryadjustment) object +Returns the [InventoryAdjustment](/doc/models/inventory-adjustment.md) object with the provided `adjustment_id`. ```php @@ -32,7 +32,7 @@ function retrieveInventoryAdjustment(string $adjustmentId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `adjustmentId` | `string` | Template, Required | ID of the [InventoryAdjustment](#type-inventoryadjustment) to retrieve. | +| `adjustmentId` | `string` | Template, Required | ID of the [InventoryAdjustment](/doc/models/inventory-adjustment.md) to retrieve. | ## Response Type @@ -110,6 +110,19 @@ $body_changes[0]->getTransfer()->setReferenceId('reference_id8'); $body_changes[0]->getTransfer()->setState(Models\InventoryState::SOLD); $body_changes[0]->getTransfer()->setFromLocationId('from_location_id2'); $body_changes[0]->getTransfer()->setToLocationId('to_location_id2'); +$body_changes[0]->setMeasurementUnit(new Models\CatalogMeasurementUnit); +$body_changes[0]->getMeasurementUnit()->setMeasurementUnit(new Models\MeasurementUnit); +$body_changes_0_measurementUnit_measurementUnit_customUnit_name = 'name0'; +$body_changes_0_measurementUnit_measurementUnit_customUnit_abbreviation = 'abbreviation2'; +$body_changes[0]->getMeasurementUnit()->getMeasurementUnit()->setCustomUnit(new Models\MeasurementUnitCustom( + $body_changes_0_measurementUnit_measurementUnit_customUnit_name, + $body_changes_0_measurementUnit_measurementUnit_customUnit_abbreviation +)); +$body_changes[0]->getMeasurementUnit()->getMeasurementUnit()->setAreaUnit(Models\MeasurementUnitArea::IMPERIAL_SQUARE_FOOT); +$body_changes[0]->getMeasurementUnit()->getMeasurementUnit()->setLengthUnit(Models\MeasurementUnitLength::METRIC_METER); +$body_changes[0]->getMeasurementUnit()->getMeasurementUnit()->setVolumeUnit(Models\MeasurementUnitVolume::METRIC_MILLILITER); +$body_changes[0]->getMeasurementUnit()->getMeasurementUnit()->setWeightUnit(Models\MeasurementUnitWeight::IMPERIAL_WEIGHT_OUNCE); +$body_changes[0]->getMeasurementUnit()->setPrecision(26); $body->setChanges($body_changes); $body->setIgnoreUnchangedCounts(true); @@ -181,8 +194,8 @@ if ($apiResponse->isSuccess()) { # Batch Retrieve Inventory Counts Returns current counts for the provided -[CatalogObject](#type-catalogobject)s at the requested -[Location](#type-location)s. +[CatalogObject](/doc/models/catalog-object.md)s at the requested +[Location](/doc/models/location.md)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). @@ -232,7 +245,7 @@ if ($apiResponse->isSuccess()) { # Retrieve Inventory Physical Count -Returns the [InventoryPhysicalCount](#type-inventoryphysicalcount) +Returns the [InventoryPhysicalCount](/doc/models/inventory-physical-count.md) object with the provided `physical_count_id`. ```php @@ -243,7 +256,7 @@ function retrieveInventoryPhysicalCount(string $physicalCountId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `physicalCountId` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](#type-inventoryphysicalcount) to retrieve. | +| `physicalCountId` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](/doc/models/inventory-physical-count.md) to retrieve. | ## Response Type @@ -271,8 +284,8 @@ if ($apiResponse->isSuccess()) { # Retrieve Inventory Count Retrieves the current calculated stock count for a given -[CatalogObject](#type-catalogobject) at a given set of -[Location](#type-location)s. Responses are paginated and unsorted. +[CatalogObject](/doc/models/catalog-object.md) at a given set of +[Location](/doc/models/location.md)s. Responses are paginated and unsorted. For more sophisticated queries, use a batch endpoint. ```php @@ -287,8 +300,8 @@ function retrieveInventoryCount( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](#type-catalogobject) to retrieve. | -| `locationIds` | `?string` | Query, Optional | The [Location](#type-location) IDs to look up as a comma-separated
list. An empty list queries all locations. | +| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](/doc/models/catalog-object.md) to retrieve. | +| `locationIds` | `?string` | Query, Optional | The [Location](/doc/models/location.md) IDs to look up as a comma-separated
list. An empty list queries all locations. | | `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | ## Response Type @@ -319,8 +332,8 @@ if ($apiResponse->isSuccess()) { # Retrieve Inventory Changes Returns a set of physical counts and inventory adjustments for the -provided [CatalogObject](#type-catalogobject) at the requested -[Location](#type-location)s. +provided [CatalogObject](/doc/models/catalog-object.md) at the requested +[Location](/doc/models/location.md)s. Results are paginated and sorted in descending order according to their `occurred_at` timestamp (newest first). @@ -341,8 +354,8 @@ function retrieveInventoryChanges( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](#type-catalogobject) to retrieve. | -| `locationIds` | `?string` | Query, Optional | The [Location](#type-location) IDs to look up as a comma-separated
list. An empty list queries all locations. | +| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](/doc/models/catalog-object.md) to retrieve. | +| `locationIds` | `?string` | Query, Optional | The [Location](/doc/models/location.md) IDs to look up as a comma-separated
list. An empty list queries all locations. | | `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | ## Response Type diff --git a/doc/apis/invoices.md b/doc/apis/invoices.md index 3e35ece7..d915cfa7 100644 --- a/doc/apis/invoices.md +++ b/doc/apis/invoices.md @@ -24,7 +24,7 @@ $invoicesApi = $client->getInvoicesApi(); Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you -use in a subsequent request to fetch the next set of invoices. +use in a subsequent request to retrieve the next set of invoices. ```php function listInvoices(string $locationId, ?string $cursor = null, ?int $limit = null): ApiResponse @@ -36,7 +36,7 @@ function listInvoices(string $locationId, ?string $cursor = null, ?int $limit = | --- | --- | --- | --- | | `locationId` | `string` | Query, Required | The ID of the location for which to list invoices. | | `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | -| `limit` | `?int` | Query, Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server
uses a default limit of 100 invoices. | +| `limit` | `?int` | Query, Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | ## Response Type @@ -65,7 +65,7 @@ if ($apiResponse->isSuccess()) { # Create Invoice -Creates a draft [invoice](#type-invoice) +Creates a draft [invoice](/doc/models/invoice.md) for an order created using the Orders API. A draft invoice remains in your account and no action is taken. @@ -133,6 +133,10 @@ $body_invoice->setInvoiceNumber('inv-100'); $body_invoice->setTitle('Event Planning Services'); $body_invoice->setDescription('We appreciate your business!'); $body_invoice->setScheduledAt('2030-01-13T10:00:00Z'); +$body_invoice->setAcceptedPaymentMethods(new Models\InvoiceAcceptedPaymentMethods); +$body_invoice->getAcceptedPaymentMethods()->setCard(true); +$body_invoice->getAcceptedPaymentMethods()->setSquareGiftCard(false); +$body_invoice->getAcceptedPaymentMethods()->setBankAccount(false); $body_invoice_customFields = []; $body_invoice_customFields[0] = new Models\InvoiceCustomField; @@ -173,7 +177,7 @@ retrieve invoices. In the current implementation, you can only specify one locat optionally one customer. The response is paginated. If truncated, the response includes a `cursor` -that you use in a subsequent request to fetch the next set of invoices. +that you use in a subsequent request to retrieve the next set of invoices. ```php function searchInvoices(SearchInvoicesRequest $body): ApiResponse @@ -228,7 +232,7 @@ if ($apiResponse->isSuccess()) { # Delete Invoice Deletes the specified invoice. When an invoice is deleted, the -associated Order status changes to CANCELED. You can only delete a draft +associated order status changes to CANCELED. You can only delete a draft invoice (you cannot delete a published invoice, including one that is scheduled for processing). ```php @@ -240,7 +244,7 @@ function deleteInvoice(string $invoiceId, ?int $version = null): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoiceId` | `string` | Template, Required | The ID of the invoice to delete. | -| `version` | `?int` | Query, Optional | The version of the [invoice](#type-invoice) to delete.
If you do not know the version, you can call [GetInvoice](#endpoint-Invoices-GetInvoice) or
[ListInvoices](#endpoint-Invoices-ListInvoices). | +| `version` | `?int` | Query, Optional | The version of the [invoice](/doc/models/invoice.md) to delete.
If you do not know the version, you can call [GetInvoice](/doc/apis/invoices.md#get-invoice) or
[ListInvoices](/doc/apis/invoices.md#list-invoices). | ## Response Type @@ -278,7 +282,7 @@ function getInvoice(string $invoiceId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The id of the invoice to retrieve. | +| `invoiceId` | `string` | Template, Required | The ID of the invoice to retrieve. | ## Response Type @@ -306,8 +310,8 @@ if ($apiResponse->isSuccess()) { # Update Invoice Updates an invoice by modifying fields, clearing fields, or both. For most updates, you can use a sparse -`Invoice` object to add fields or change values, and use the `fields_to_clear` field to specify fields to clear. -However, some restrictions apply. For example, you cannot change the `order_id` or `location_id` field, and you +`Invoice` object to add fields or change values and use the `fields_to_clear` field to specify fields to clear. +However, some restrictions apply. For example, you cannot change the `order_id` or `location_id` field and you must provide the complete `custom_fields` list to update a custom field. Published invoices have additional restrictions. ```php @@ -393,7 +397,7 @@ function cancelInvoice(string $invoiceId, CancelInvoiceRequest $body): ApiRespon | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The ID of the [invoice](#type-invoice) to cancel. | +| `invoiceId` | `string` | Template, Required | The ID of the [invoice](/doc/models/invoice.md) to cancel. | | `body` | [`CancelInvoiceRequest`](/doc/models/cancel-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ## Response Type @@ -435,7 +439,7 @@ nothing. Square also makes the invoice available on a Square-hosted invoice page The invoice `status` also changes from `DRAFT` to a status based on the invoice configuration. For example, the status changes to `UNPAID` if Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the -invoice amount). +invoice amount. ```php function publishInvoice(string $invoiceId, PublishInvoiceRequest $body): ApiResponse @@ -445,7 +449,7 @@ function publishInvoice(string $invoiceId, PublishInvoiceRequest $body): ApiResp | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `invoiceId` | `string` | Template, Required | The id of the invoice to publish. | +| `invoiceId` | `string` | Template, Required | The ID of the invoice to publish. | | `body` | [`PublishInvoiceRequest`](/doc/models/publish-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ## Response Type diff --git a/doc/apis/locations.md b/doc/apis/locations.md index c9ffd1b3..b0251282 100644 --- a/doc/apis/locations.md +++ b/doc/apis/locations.md @@ -21,7 +21,7 @@ $locationsApi = $client->getLocationsApi(); Provides information of all locations of a business. Many Square API endpoints require a `location_id` parameter. -The `id` field of the [`Location`](#type-location) objects returned by this +The `id` field of the [`Location`](/doc/models/location.md) objects returned by this endpoint correspond to that `location_id` parameter. ```php @@ -83,7 +83,7 @@ $body->getLocation()->getAddress()->setSublocality('sublocality6'); $body->getLocation()->getAddress()->setAdministrativeDistrictLevel1('GA'); $body->getLocation()->getAddress()->setPostalCode('30309'); $body->getLocation()->setTimezone('timezone0'); -$body->getLocation()->setCapabilities([Models\LocationCapability::CREDIT_CARD_PROCESSING, Models\LocationCapability::CREDIT_CARD_PROCESSING, Models\LocationCapability::CREDIT_CARD_PROCESSING]); +$body->getLocation()->setCapabilities([Models\LocationCapability::AUTOMATIC_TRANSFERS, Models\LocationCapability::CREDIT_CARD_PROCESSING, Models\LocationCapability::AUTOMATIC_TRANSFERS]); $body->getLocation()->setDescription('My new location.'); $body->getLocation()->setFacebookUrl('null'); @@ -176,7 +176,7 @@ $body->getLocation()->getAddress()->setSublocality('sublocality6'); $body->getLocation()->getAddress()->setAdministrativeDistrictLevel1('GA'); $body->getLocation()->getAddress()->setPostalCode('30309'); $body->getLocation()->setTimezone('timezone0'); -$body->getLocation()->setCapabilities([Models\LocationCapability::CREDIT_CARD_PROCESSING, Models\LocationCapability::CREDIT_CARD_PROCESSING, Models\LocationCapability::CREDIT_CARD_PROCESSING]); +$body->getLocation()->setCapabilities([Models\LocationCapability::AUTOMATIC_TRANSFERS, Models\LocationCapability::CREDIT_CARD_PROCESSING, Models\LocationCapability::AUTOMATIC_TRANSFERS]); $body->getLocation()->setBusinessHours(new Models\BusinessHours); $body_location_businessHours_periods = []; diff --git a/doc/apis/loyalty.md b/doc/apis/loyalty.md index 0fd72f0b..9d38f95f 100644 --- a/doc/apis/loyalty.md +++ b/doc/apis/loyalty.md @@ -17,6 +17,7 @@ $loyaltyApi = $client->getLoyaltyApi(); * [Adjust Loyalty Points](/doc/apis/loyalty.md#adjust-loyalty-points) * [Search Loyalty Events](/doc/apis/loyalty.md#search-loyalty-events) * [List Loyalty Programs](/doc/apis/loyalty.md#list-loyalty-programs) +* [Retrieve Loyalty Program](/doc/apis/loyalty.md#retrieve-loyalty-program) * [Calculate Loyalty Points](/doc/apis/loyalty.md#calculate-loyalty-points) * [Create Loyalty Reward](/doc/apis/loyalty.md#create-loyalty-reward) * [Search Loyalty Rewards](/doc/apis/loyalty.md#search-loyalty-rewards) @@ -27,7 +28,7 @@ $loyaltyApi = $client->getLoyaltyApi(); # Create Loyalty Account -Creates a loyalty account. +Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and either the `mapping` field (preferred) or the `mappings` field. ```php function createLoyaltyAccount(CreateLoyaltyAccountRequest $body): ApiResponse @@ -46,27 +47,30 @@ function createLoyaltyAccount(CreateLoyaltyAccountRequest $body): ApiResponse ## Example Usage ```php -$body_loyaltyAccount_mappings = []; - -$body_loyaltyAccount_mappings_0_type = 'PHONE'; -$body_loyaltyAccount_mappings_0_value = '+14155551234'; -$body_loyaltyAccount_mappings[0] = new Models\LoyaltyAccountMapping( - $body_loyaltyAccount_mappings_0_type, - $body_loyaltyAccount_mappings_0_value -); -$body_loyaltyAccount_mappings[0]->setId('id0'); -$body_loyaltyAccount_mappings[0]->setCreatedAt('created_at8'); - $body_loyaltyAccount_programId = 'd619f755-2d17-41f3-990d-c04ecedd64dd'; $body_loyaltyAccount = new Models\LoyaltyAccount( - $body_loyaltyAccount_mappings, $body_loyaltyAccount_programId ); $body_loyaltyAccount->setId('id2'); +$body_loyaltyAccount_mappings = []; + +$body_loyaltyAccount_mappings[0] = new Models\LoyaltyAccountMapping; +$body_loyaltyAccount_mappings[0]->setId('id0'); +$body_loyaltyAccount_mappings[0]->setType(Models\LoyaltyAccountMappingType::PHONE); +$body_loyaltyAccount_mappings[0]->setValue('value2'); +$body_loyaltyAccount_mappings[0]->setCreatedAt('created_at8'); +$body_loyaltyAccount_mappings[0]->setPhoneNumber('phone_number8'); +$body_loyaltyAccount->setMappings($body_loyaltyAccount_mappings); + $body_loyaltyAccount->setBalance(14); $body_loyaltyAccount->setLifetimePoints(38); $body_loyaltyAccount->setCustomerId('customer_id0'); -$body_loyaltyAccount->setEnrolledAt('enrolled_at2'); +$body_loyaltyAccount->setMapping(new Models\LoyaltyAccountMapping); +$body_loyaltyAccount->getMapping()->setId('id6'); +$body_loyaltyAccount->getMapping()->setType(Models\LoyaltyAccountMappingType::PHONE); +$body_loyaltyAccount->getMapping()->setValue('value8'); +$body_loyaltyAccount->getMapping()->setCreatedAt('created_at4'); +$body_loyaltyAccount->getMapping()->setPhoneNumber('+14155551234'); $body_idempotencyKey = 'ec78c477-b1c3-4899-a209-a4e71337c996'; $body = new Models\CreateLoyaltyAccountRequest( $body_loyaltyAccount, @@ -116,14 +120,12 @@ $body = new Models\SearchLoyaltyAccountsRequest; $body->setQuery(new Models\SearchLoyaltyAccountsRequestLoyaltyAccountQuery); $body_query_mappings = []; -$body_query_mappings_0_type = 'PHONE'; -$body_query_mappings_0_value = '+14155551234'; -$body_query_mappings[0] = new Models\LoyaltyAccountMapping( - $body_query_mappings_0_type, - $body_query_mappings_0_value -); +$body_query_mappings[0] = new Models\LoyaltyAccountMapping; $body_query_mappings[0]->setId('id4'); +$body_query_mappings[0]->setType(Models\LoyaltyAccountMappingType::PHONE); +$body_query_mappings[0]->setValue('value6'); $body_query_mappings[0]->setCreatedAt('created_at8'); +$body_query_mappings[0]->setPhoneNumber('+14155551234'); $body->getQuery()->setMappings($body_query_mappings); $body->getQuery()->setCustomerIds(['customer_ids5', 'customer_ids4']); @@ -156,7 +158,7 @@ function retrieveLoyaltyAccount(string $accountId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `accountId` | `string` | Template, Required | The ID of the [loyalty account](#type-LoyaltyAccount) to retrieve. | +| `accountId` | `string` | Template, Required | The ID of the [loyalty account](/doc/models/loyalty-account.md) to retrieve. | ## Response Type @@ -190,7 +192,7 @@ Adds points to a loyalty account. - If you are not using the Orders API to manage orders, you first perform a client-side computation to compute the points. For spend-based and visit-based programs, you can call - [CalculateLoyaltyPoints](#endpoint-Loyalty-CalculateLoyaltyPoints) to compute the points. For more information, + [CalculateLoyaltyPoints](/doc/apis/loyalty.md#calculate-loyalty-points) to compute the points. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). You then provide the points in a request to this endpoint. @@ -202,7 +204,7 @@ function accumulateLoyaltyPoints(string $accountId, AccumulateLoyaltyPointsReque | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `accountId` | `string` | Template, Required | The [loyalty account](#type-LoyaltyAccount) ID to which to add the points. | +| `accountId` | `string` | Template, Required | The [loyalty account](/doc/models/loyalty-account.md) ID to which to add the points. | | `body` | [`AccumulateLoyaltyPointsRequest`](/doc/models/accumulate-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ## Response Type @@ -244,7 +246,7 @@ if ($apiResponse->isSuccess()) { Adds points to or subtracts points from a buyer's account. Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call -[AccumulateLoyaltyPoints](#endpoint-Loyalty-AccumulateLoyaltyPoints) +[AccumulateLoyaltyPoints](/doc/apis/loyalty.md#accumulate-loyalty-points) to add points when a buyer pays for the purchase. ```php @@ -255,7 +257,7 @@ function adjustLoyaltyPoints(string $accountId, AdjustLoyaltyPointsRequest $body | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `accountId` | `string` | Template, Required | The ID of the [loyalty account](#type-LoyaltyAccount) in which to adjust the points. | +| `accountId` | `string` | Template, Required | The ID of the [loyalty account](/doc/models/loyalty-account.md) in which to adjust the points. | | `body` | [`AdjustLoyaltyPointsRequest`](/doc/models/adjust-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ## Response Type @@ -266,13 +268,13 @@ function adjustLoyaltyPoints(string $accountId, AdjustLoyaltyPointsRequest $body ```php $accountId = 'account_id2'; -$body_idempotencyKey = 'idempotency_key2'; -$body_adjustPoints_points = 112; +$body_idempotencyKey = 'bc29a517-3dc9-450e-aa76-fae39ee849d1'; +$body_adjustPoints_points = 10; $body_adjustPoints = new Models\LoyaltyEventAdjustPoints( $body_adjustPoints_points ); $body_adjustPoints->setLoyaltyProgramId('loyalty_program_id4'); -$body_adjustPoints->setReason('reason0'); +$body_adjustPoints->setReason('Complimentary points'); $body = new Models\AdjustLoyaltyPointsRequest( $body_idempotencyKey, $body_adjustPoints @@ -301,6 +303,8 @@ buyer's loyalty account. Each change in the point balance (for example, points earned, points redeemed, and points expired) is recorded in the ledger. Using this endpoint, you can search the ledger for events. +Search results are sorted by `created_at` in descending order. + ```php function searchLoyaltyEvents(SearchLoyaltyEventsRequest $body): ApiResponse ``` @@ -390,6 +394,45 @@ if ($apiResponse->isSuccess()) { ``` +# Retrieve Loyalty Program + +Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`. + +Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). + +```php +function retrieveLoyaltyProgram(string $programId): ApiResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `programId` | `string` | Template, Required | The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller. | + +## Response Type + +[`RetrieveLoyaltyProgramResponse`](/doc/models/retrieve-loyalty-program-response.md) + +## Example Usage + +```php +$programId = 'program_id0'; + +$apiResponse = $loyaltyApi->retrieveLoyaltyProgram($programId); + +if ($apiResponse->isSuccess()) { + $retrieveLoyaltyProgramResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Get more response info... +// $statusCode = $apiResponse->getStatusCode(); +// $headers = $apiResponse->getHeaders(); +``` + + # Calculate Loyalty Points Calculates the points a purchase earns. @@ -410,7 +453,7 @@ function calculateLoyaltyPoints(string $programId, CalculateLoyaltyPointsRequest | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `programId` | `string` | Template, Required | The [loyalty program](#type-LoyaltyProgram) ID, which defines the rules for accruing points. | +| `programId` | `string` | Template, Required | The [loyalty program](/doc/models/loyalty-program.md) ID, which defines the rules for accruing points. | | `body` | [`CalculateLoyaltyPointsRequest`](/doc/models/calculate-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ## Response Type @@ -507,7 +550,9 @@ Searches for loyalty rewards in a loyalty account. In the current implementation, the endpoint supports search by the reward `status`. If you know a reward ID, use the -[RetrieveLoyaltyReward](#endpoint-Loyalty-RetrieveLoyaltyReward) endpoint. +[RetrieveLoyaltyReward](/doc/apis/loyalty.md#retrieve-loyalty-reward) endpoint. + +Search results are sorted by `updated_at` in descending order. ```php function searchLoyaltyRewards(SearchLoyaltyRewardsRequest $body): ApiResponse @@ -555,7 +600,7 @@ Deletes a loyalty reward by doing the following: - Returns the loyalty points back to the loyalty account. - If an order ID was specified when the reward was created - (see [CreateLoyaltyReward](#endpoint-Loyalty-CreateLoyaltyReward)), + (see [CreateLoyaltyReward](/doc/apis/loyalty.md#create-loyalty-reward)), it updates the order by removing the reward and related discounts. @@ -569,7 +614,7 @@ function deleteLoyaltyReward(string $rewardId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](#type-LoyaltyReward) to delete. | +| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](/doc/models/loyalty-reward.md) to delete. | ## Response Type @@ -606,7 +651,7 @@ function retrieveLoyaltyReward(string $rewardId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](#type-LoyaltyReward) to retrieve. | +| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](/doc/models/loyalty-reward.md) to retrieve. | ## Response Type @@ -653,7 +698,7 @@ function redeemLoyaltyReward(string $rewardId, RedeemLoyaltyRewardRequest $body) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](#type-LoyaltyReward) to redeem. | +| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](/doc/models/loyalty-reward.md) to redeem. | | `body` | [`RedeemLoyaltyRewardRequest`](/doc/models/redeem-loyalty-reward-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | ## Response Type diff --git a/doc/apis/merchants.md b/doc/apis/merchants.md index 1c099b03..3a41f666 100644 --- a/doc/apis/merchants.md +++ b/doc/apis/merchants.md @@ -22,7 +22,7 @@ If you don't know a `Merchant` ID, you can use this endpoint to retrieve the mer You can specify your personal access token to get your own merchant information or specify an OAuth token to get the information for the merchant that granted you access. -If you know the merchant ID, you can also use the [RetrieveMerchant](#endpoint-merchants-retrievemerchant) +If you know the merchant ID, you can also use the [RetrieveMerchant](/doc/apis/merchants.md#retrieve-merchant) endpoint to get the merchant information. ```php diff --git a/doc/apis/orders.md b/doc/apis/orders.md index 2e1543af..585ff3f1 100644 --- a/doc/apis/orders.md +++ b/doc/apis/orders.md @@ -21,13 +21,14 @@ $ordersApi = $client->getOrdersApi(); # Create Order -Creates a new [Order](#type-order) which can include information on products for +Creates a new [Order](/doc/models/order.md) which can include information on products for purchase and settings to apply to the purchase. -To pay for a created order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) +To pay for a created order, please refer to the +[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. -You can modify open orders using the [UpdateOrder](#endpoint-orders-updateorder) endpoint. +You can modify open orders using the [UpdateOrder](/doc/apis/orders.md#update-order) endpoint. ```php function createOrder(CreateOrderRequest $body): ApiResponse @@ -191,7 +192,7 @@ if ($apiResponse->isSuccess()) { # Batch Retrieve Orders -Retrieves a set of [Order](#type-order)s by their IDs. +Retrieves a set of [Order](/doc/models/order.md)s by their IDs. If a given Order ID does not exist, the ID is ignored instead of generating an error. @@ -234,7 +235,7 @@ if ($apiResponse->isSuccess()) { # Calculate Order -Calculates an [Order](#type-order). +Enables applications to preview order pricing without creating an order. ```php function calculateOrder(CalculateOrderRequest $body): ApiResponse @@ -375,13 +376,13 @@ returns, and exchanges regardless of how or when they entered the Square Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc). SearchOrders requests need to specify which locations to search and define a -[`SearchOrdersQuery`](#type-searchordersquery) object which controls +[`SearchOrdersQuery`](/doc/models/search-orders-query.md) object which controls how to sort or filter the results. Your SearchOrdersQuery can: Set filter criteria. Set sort order. Determine whether to return results as complete Order objects, or as -[OrderEntry](#type-orderentry) objects. +[OrderEntry](/doc/models/order-entry.md) objects. Note that details for orders processed with Square Point of Sale while in offline mode may not be transmitted to Square for up to 72 hours. Offline @@ -455,7 +456,7 @@ if ($apiResponse->isSuccess()) { # Retrieve Order -Retrieves an [Order](#type-order) by ID. +Retrieves an [Order](/doc/models/order.md) by ID. ```php function retrieveOrder(string $orderId): ApiResponse @@ -492,7 +493,7 @@ if ($apiResponse->isSuccess()) { # Update Order -Updates an open [Order](#type-order) by adding, replacing, or deleting +Updates an open [Order](/doc/models/order.md) by adding, replacing, or deleting fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. An UpdateOrder request requires the following: @@ -505,7 +506,8 @@ An UpdateOrder request requires the following: - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation) identifying fields to clear. -To pay for an order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. +To pay for an order, please refer to the +[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. ```php function updateOrder(string $orderId, UpdateOrderRequest $body): ApiResponse @@ -602,7 +604,7 @@ if ($apiResponse->isSuccess()) { # Pay Order -Pay for an [order](#type-order) using one or more approved [payments](#type-payment), +Pay for an [order](/doc/models/order.md) using one or more approved [payments](/doc/models/payment.md), or settle an order with a total of `0`. The total of the `payment_ids` listed in the request must be equal to the order @@ -611,7 +613,7 @@ array of `payment_ids` in the request. To be used with PayOrder, a payment must: -- Reference the order by specifying the `order_id` when [creating the payment](#endpoint-payments-createpayment). +- Reference the order by specifying the `order_id` when [creating the payment](/doc/apis/payments.md#create-payment). Any approved payments that reference the same `order_id` not specified in the `payment_ids` will be canceled. - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture). diff --git a/doc/apis/payments.md b/doc/apis/payments.md index 8b9501c5..ddc76ee1 100644 --- a/doc/apis/payments.md +++ b/doc/apis/payments.md @@ -23,6 +23,9 @@ $paymentsApi = $client->getPaymentsApi(); Retrieves a list of payments taken by the account making the request. +Results are eventually consistent, and new payments or changes to payments might take several +seconds to appear. + The maximum results per page is 100. ```php @@ -90,7 +93,7 @@ Creates a payment using the provided source. You can use this endpoint to charge a card (credit/debit card or Square gift card) or record a payment that the seller received outside of Square (cash payment from a buyer or a payment that an external entity -procesed on behalf of the seller). +processed on behalf of the seller). The endpoint creates a `Payment` object and returns it in the response. diff --git a/doc/apis/refunds.md b/doc/apis/refunds.md index 8a70f47e..dc631d05 100644 --- a/doc/apis/refunds.md +++ b/doc/apis/refunds.md @@ -19,6 +19,9 @@ $refundsApi = $client->getRefundsApi(); Retrieves a list of refunds for the account making the request. +Results are eventually consistent, and new refunds or changes to refunds might take several +seconds to appear. + The maximum results per page is 100. ```php @@ -43,7 +46,7 @@ function listPaymentRefunds( | `sortOrder` | `?string` | Query, Optional | The order in which results are listed:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | | `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | | `locationId` | `?string` | Query, Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | -| `status` | `?string` | Query, Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](#type-paymentrefund).

Default: If omitted, refunds are returned regardless of their status. | +| `status` | `?string` | Query, Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](/doc/models/payment-refund.md).

Default: If omitted, refunds are returned regardless of their status. | | `sourceType` | `?string` | Query, Optional | If provided, only refunds with the given source type are returned.

- `CARD` - List refunds only for payments where `CARD` was specified as the payment
source.

Default: If omitted, refunds are returned regardless of the source type. | | `limit` | `?int` | Query, Optional | The maximum number of results to be returned in a single page.

It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, no more than 100 results are returned.

Default: 100 | diff --git a/doc/apis/subscriptions.md b/doc/apis/subscriptions.md index e15ed613..3471ac03 100644 --- a/doc/apis/subscriptions.md +++ b/doc/apis/subscriptions.md @@ -16,6 +16,7 @@ $subscriptionsApi = $client->getSubscriptionsApi(); * [Update Subscription](/doc/apis/subscriptions.md#update-subscription) * [Cancel Subscription](/doc/apis/subscriptions.md#cancel-subscription) * [List Subscription Events](/doc/apis/subscriptions.md#list-subscription-events) +* [Resume Subscription](/doc/apis/subscriptions.md#resume-subscription) # Create Subscription @@ -302,3 +303,40 @@ if ($apiResponse->isSuccess()) { // $headers = $apiResponse->getHeaders(); ``` + +# Resume Subscription + +Resumes a deactivated subscription. + +```php +function resumeSubscription(string $subscriptionId): ApiResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to resume. | + +## Response Type + +[`ResumeSubscriptionResponse`](/doc/models/resume-subscription-response.md) + +## Example Usage + +```php +$subscriptionId = 'subscription_id0'; + +$apiResponse = $subscriptionsApi->resumeSubscription($subscriptionId); + +if ($apiResponse->isSuccess()) { + $resumeSubscriptionResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Get more response info... +// $statusCode = $apiResponse->getStatusCode(); +// $headers = $apiResponse->getHeaders(); +``` + diff --git a/doc/apis/team.md b/doc/apis/team.md index 4c1b5045..a2b80e0b 100644 --- a/doc/apis/team.md +++ b/doc/apis/team.md @@ -83,7 +83,7 @@ This process is non-transactional and will process as much of the request as is the request cannot be successfully processed, the request will NOT be marked as failed, but the body of the response will contain explicit error information for this particular create. -Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#bulkcreateteammembers). +Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). ```php function bulkCreateTeamMembers(BulkCreateTeamMembersRequest $body): ApiResponse @@ -132,7 +132,7 @@ Updates multiple `TeamMember` objects. The updated `TeamMember` objects will be This process is non-transactional and will process as much of the request as is possible. If one of the updates in the request cannot be successfully processed, the request will NOT be marked as failed, but the body of the response will contain explicit error information for this particular update. -Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#bulkupdateteammembers). +Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). ```php function bulkUpdateTeamMembers(BulkUpdateTeamMembersRequest $body): ApiResponse @@ -225,7 +225,7 @@ if ($apiResponse->isSuccess()) { # Retrieve Team Member Retrieve a `TeamMember` object for the given `TeamMember.id`. -Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#retrieveteammember). +Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). ```php function retrieveTeamMember(string $teamMemberId): ApiResponse @@ -263,7 +263,7 @@ if ($apiResponse->isSuccess()) { # Update Team Member Updates a single `TeamMember` object. The `TeamMember` will be returned on successful updates. -Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#updateteammember). +Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). ```php function updateTeamMember(string $teamMemberId, UpdateTeamMemberRequest $body): ApiResponse @@ -357,7 +357,7 @@ Creates or updates a `WageSetting` object. The object is created if a `WageSetting` with the specified `team_member_id` does not exist. Otherwise, it fully replaces the `WageSetting` object for the team member. The `WageSetting` will be returned upon successful update. -Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#updatewagesetting). +Learn about [Troubleshooting the Teams API](https://developer.squareup.com/docs/team/troubleshooting#create-or-update-a-wage-setting). ```php function updateWageSetting(string $teamMemberId, UpdateWageSettingRequest $body): ApiResponse diff --git a/doc/apis/transactions.md b/doc/apis/transactions.md index 089be722..82db8352 100644 --- a/doc/apis/transactions.md +++ b/doc/apis/transactions.md @@ -32,7 +32,7 @@ Point of Sale applications. Refunds with a `status` of `PENDING` are not currently included in this endpoint's response. -Max results per [page](#paginatingresults): 50 +Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 ```php function listRefunds( @@ -49,10 +49,10 @@ function listRefunds( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `locationId` | `string` | Template, Required | The ID of the location to list refunds for. | -| `beginTime` | `?string` | Query, Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | -| `endTime` | `?string` | Query, Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time. | +| `beginTime` | `?string` | Query, Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | +| `endTime` | `?string` | Query, Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | | `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Query, Optional | The order in which results are listed in the response (`ASC` for
oldest first, `DESC` for newest first).

Default value: `DESC` | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](#paginatingresults) for more information. | +| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | ## Response Type @@ -90,7 +90,7 @@ Lists transactions for a particular location. Transactions include payment information from sales and exchanges and refund information from returns and exchanges. -Max results per [page](#paginatingresults): 50 +Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 ```php function listTransactions( @@ -107,10 +107,10 @@ function listTransactions( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `locationId` | `string` | Template, Required | The ID of the location to list transactions for. | -| `beginTime` | `?string` | Query, Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | -| `endTime` | `?string` | Query, Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time. | +| `beginTime` | `?string` | Query, Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | +| `endTime` | `?string` | Query, Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | | `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Query, Optional | The order in which results are listed in the response (`ASC` for
oldest first, `DESC` for newest first).

Default value: `DESC` | -| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](#paginatingresults) for more information. | +| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | ## Response Type @@ -161,8 +161,8 @@ _must_ provide values for the following parameters in your request: When this response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, wait about ten seconds and call -[RetrieveTransaction](#endpoint-retrievetransaction). See the `processing_fee_money` -field of each [Tender included](#type-tender) in the transaction. +[RetrieveTransaction](/doc/apis/transactions.md#retrieve-transaction). See the `processing_fee_money` +field of each [Tender included](/doc/models/tender.md) in the transaction. ```php function charge(string $locationId, ChargeRequest $body): ApiResponse @@ -288,7 +288,7 @@ if ($apiResponse->isSuccess()) { **This endpoint is deprecated. ** -Captures a transaction that was created with the [Charge](#endpoint-charge) +Captures a transaction that was created with the [Charge](/doc/apis/transactions.md#charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) @@ -394,7 +394,7 @@ if ($apiResponse->isSuccess()) { **This endpoint is deprecated. ** -Cancels a transaction that was created with the [Charge](#endpoint-charge) +Cancels a transaction that was created with the [Charge](/doc/apis/transactions.md#charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) diff --git a/doc/apis/v1-employees.md b/doc/apis/v1-employees.md index b61b17df..12a70ba4 100644 --- a/doc/apis/v1-employees.md +++ b/doc/apis/v1-employees.md @@ -274,7 +274,7 @@ employee with that role. For example, an employee with a "Shift Manager" role might be able to issue refunds in Square Point of Sale, whereas an employee with a "Clerk" role might not. -Roles are assigned with the [V1UpdateEmployee](#endpoint-v1updateemployee) +Roles are assigned with the [V1UpdateEmployee](/doc/apis/v1-employees.md#update-employee-role) endpoint. An employee can have only one role at a time. If an employee has no role, they have none of the permissions associated diff --git a/doc/client.md b/doc/client.md index 62edec52..e2a1fa03 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*: `'2021-03-17'` | +| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2021-04-21'` | | `accessToken` | `string` | The OAuth 2.0 Access Token to use for API requests. | | `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`** | @@ -17,7 +17,7 @@ The API client can be initialized as follows: ```php $client = new Square\SquareClient([ // Set authentication parameters - 'squareVersion' => '2021-03-17', + 'squareVersion' => '2021-04-21', 'accessToken' => 'AccessToken', // Set the environment @@ -44,7 +44,7 @@ API calls return an `ApiResponse` object that includes the following fields: require_once "vendor/autoload.php"; $client = new Square\SquareClient([ - 'squareVersion' => '2021-03-17', + 'squareVersion' => '2021-04-21', 'accessToken' => 'AccessToken', ]); diff --git a/doc/models/accumulate-loyalty-points-request.md b/doc/models/accumulate-loyalty-points-request.md index 810fe5c8..0cdca343 100644 --- a/doc/models/accumulate-loyalty-points-request.md +++ b/doc/models/accumulate-loyalty-points-request.md @@ -13,7 +13,7 @@ A request to accumulate points for a purchase. | --- | --- | --- | --- | --- | --- | | `accumulatePoints` | [`LoyaltyEventAccumulatePoints`](/doc/models/loyalty-event-accumulate-points.md) | Required | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | getAccumulatePoints(): LoyaltyEventAccumulatePoints | setAccumulatePoints(LoyaltyEventAccumulatePoints accumulatePoints): void | | `idempotencyKey` | `string` | Required | A unique string that identifies the `AccumulateLoyaltyPoints` request.
Keys can be any valid string but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `locationId` | `string` | Required | The [location](#type-Location) where the purchase was made. | getLocationId(): string | setLocationId(string locationId): void | +| `locationId` | `string` | Required | The [location](/doc/models/location.md) where the purchase was made. | getLocationId(): string | setLocationId(string locationId): void | ## Example (as JSON) diff --git a/doc/models/add-group-to-customer-response.md b/doc/models/add-group-to-customer-response.md index 674bba36..0ed329b5 100644 --- a/doc/models/add-group-to-customer-response.md +++ b/doc/models/add-group-to-customer-response.md @@ -2,7 +2,7 @@ # Add Group to Customer Response Defines the fields that are included in the response body of -a request to the [AddGroupToCustomer](#endpoint-addgrouptocustomer) endpoint. +a request to the [AddGroupToCustomer](/doc/apis/customers.md#add-group-to-customer) endpoint. ## Structure diff --git a/doc/models/additional-recipient.md b/doc/models/additional-recipient.md index 447c1e2c..9f4f1ea5 100644 --- a/doc/models/additional-recipient.md +++ b/doc/models/additional-recipient.md @@ -12,9 +12,9 @@ Represents an additional recipient (other than the merchant) receiving a portion | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `locationId` | `string` | Required | The location ID for a recipient (other than the merchant) receiving a portion of this tender.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | getLocationId(): string | setLocationId(string locationId): void | -| `description` | `string` | Required | The description of the additional recipient.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100` | getDescription(): string | setDescription(string description): void | +| `description` | `?string` | Optional | The description of the additional recipient.
**Constraints**: *Maximum Length*: `100` | getDescription(): ?string | setDescription(?string description): void | | `amountMoney` | [`Money`](/doc/models/money.md) | Required | 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. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | -| `receivableId` | `?string` | Optional | The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server.
**Constraints**: *Maximum Length*: `192` | getReceivableId(): ?string | setReceivableId(?string receivableId): void | +| `receivableId` | `?string` | Optional | The unique ID for this [AdditionalRecipientReceivable]($m/AdditionalRecipientReceivable), assigned by the server.
**Constraints**: *Maximum Length*: `192` | getReceivableId(): ?string | setReceivableId(?string receivableId): void | ## Example (as JSON) diff --git a/doc/models/adjust-loyalty-points-request.md b/doc/models/adjust-loyalty-points-request.md index 52a0e743..1ee33298 100644 --- a/doc/models/adjust-loyalty-points-request.md +++ b/doc/models/adjust-loyalty-points-request.md @@ -18,12 +18,11 @@ A request to adjust (add or subtract) points manually. ```json { - "idempotency_key": "idempotency_key6", "adjust_points": { - "loyalty_program_id": "loyalty_program_id2", - "points": 96, - "reason": "reason2" - } + "points": 10, + "reason": "Complimentary points" + }, + "idempotency_key": "bc29a517-3dc9-450e-aa76-fae39ee849d1" } ``` diff --git a/doc/models/appointment-segment.md b/doc/models/appointment-segment.md index 9ecb2476..03471bcf 100644 --- a/doc/models/appointment-segment.md +++ b/doc/models/appointment-segment.md @@ -12,8 +12,8 @@ Defines an appointment segment of a booking. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `durationMinutes` | `int` | Required | The time span in minutes of an appointment segment.
**Constraints**: `<= 1500` | getDurationMinutes(): int | setDurationMinutes(int durationMinutes): void | -| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](#type-CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1` | getServiceVariationId(): string | setServiceVariationId(string serviceVariationId): void | -| `teamMemberId` | `string` | Required | The ID of the [TeamMember](#type-TeamMember) object representing the team member booked in this segment.
**Constraints**: *Minimum Length*: `1` | getTeamMemberId(): string | setTeamMemberId(string teamMemberId): void | +| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](/doc/models/catalog-item-variation.md) object representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1` | getServiceVariationId(): string | setServiceVariationId(string serviceVariationId): void | +| `teamMemberId` | `string` | Required | The ID of the [TeamMember](/doc/models/team-member.md) object representing the team member booked in this segment.
**Constraints**: *Minimum Length*: `1` | getTeamMemberId(): string | setTeamMemberId(string teamMemberId): void | | `serviceVariationVersion` | `int` | Required | The current version of the item variation representing the service booked in this segment. | getServiceVariationVersion(): int | setServiceVariationVersion(int serviceVariationVersion): void | ## Example (as JSON) diff --git a/doc/models/availability.md b/doc/models/availability.md index bf562d5e..9492f13c 100644 --- a/doc/models/availability.md +++ b/doc/models/availability.md @@ -11,7 +11,7 @@ Describes a slot available for booking, encapsulating appointment segments, the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `startAt` | `?string` | Optional | The RFC-3339 timestamp specifying the beginning time of the slot available for booking. | getStartAt(): ?string | setStartAt(?string startAt): void | +| `startAt` | `?string` | Optional | The RFC 3339 timestamp specifying the beginning time of the slot available for booking. | getStartAt(): ?string | setStartAt(?string startAt): void | | `locationId` | `?string` | Optional | The ID of the location available for booking. | getLocationId(): ?string | setLocationId(?string locationId): void | | `appointmentSegments` | [`?(AppointmentSegment[])`](/doc/models/appointment-segment.md) | Optional | The list of appointment segments available for booking | getAppointmentSegments(): ?array | setAppointmentSegments(?array appointmentSegments): void | diff --git a/doc/models/batch-retrieve-catalog-objects-request.md b/doc/models/batch-retrieve-catalog-objects-request.md index 1de30b14..5f7e0acd 100644 --- a/doc/models/batch-retrieve-catalog-objects-request.md +++ b/doc/models/batch-retrieve-catalog-objects-request.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `objectIds` | `string[]` | Required | The IDs of the CatalogObjects to be retrieved. | getObjectIds(): array | setObjectIds(array objectIds): void | | `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the
requested objects, as follows:

If the `objects` field of the response contains a CatalogItem, its associated
CatalogCategory objects, CatalogTax objects, CatalogImage objects and
CatalogModifierLists will be returned in the `related_objects` field of the
response. If the `objects` field of the response contains a CatalogItemVariation,
its parent CatalogItem will be returned in the `related_objects` field of
the response. | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void | -| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical versions of objects. The specified version value is matched against
the [CatalogObject](#type-catalogobject)s' `version` attribute. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | +| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical versions of objects. The specified version value is matched against
the [CatalogObject](/doc/models/catalog-object.md)s' `version` attribute. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | ## Example (as JSON) diff --git a/doc/models/batch-retrieve-catalog-objects-response.md b/doc/models/batch-retrieve-catalog-objects-response.md index 75857bcd..3066dbb9 100644 --- a/doc/models/batch-retrieve-catalog-objects-response.md +++ b/doc/models/batch-retrieve-catalog-objects-response.md @@ -10,8 +10,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `objects` | [`?(CatalogObject[])`](/doc/models/catalog-object.md) | Optional | A list of [CatalogObject](#type-catalogobject)s returned. | getObjects(): ?array | setObjects(?array objects): void | -| `relatedObjects` | [`?(CatalogObject[])`](/doc/models/catalog-object.md) | Optional | A list of [CatalogObject](#type-catalogobject)s referenced by the object in the `objects` field. | getRelatedObjects(): ?array | setRelatedObjects(?array relatedObjects): void | +| `objects` | [`?(CatalogObject[])`](/doc/models/catalog-object.md) | Optional | A list of [CatalogObject](/doc/models/catalog-object.md)s returned. | getObjects(): ?array | setObjects(?array objects): void | +| `relatedObjects` | [`?(CatalogObject[])`](/doc/models/catalog-object.md) | Optional | A list of [CatalogObject](/doc/models/catalog-object.md)s referenced by the object in the `objects` field. | getRelatedObjects(): ?array | setRelatedObjects(?array relatedObjects): void | ## Example (as JSON) diff --git a/doc/models/booking.md b/doc/models/booking.md index 362a91bf..4a45bcd2 100644 --- a/doc/models/booking.md +++ b/doc/models/booking.md @@ -15,13 +15,13 @@ at a given location to a requesting customer in one or more appointment segments | `id` | `?string` | Optional | A unique ID of this object representing a booking. | getId(): ?string | setId(?string id): void | | `version` | `?int` | Optional | The revision number for the booking used for optimistic concurrency. | getVersion(): ?int | setVersion(?int version): void | | `status` | [`?string (BookingStatus)`](/doc/models/booking-status.md) | Optional | Supported booking statuses. | getStatus(): ?string | setStatus(?string status): void | -| `createdAt` | `?string` | Optional | The timestamp specifying the creation time of this booking. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | The timestamp specifying the most recent update time of this booking. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `startAt` | `?string` | Optional | The timestamp specifying the starting time of this booking. | getStartAt(): ?string | setStartAt(?string startAt): void | -| `locationId` | `?string` | Optional | The ID of the [Location](#type-location) object representing the location where the booked service is provided. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `customerId` | `?string` | Optional | The ID of the [Customer](#type-Customer) object representing the customer attending this booking | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `customerNote` | `?string` | Optional | The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](#type-CatalogObject) instance.
**Constraints**: *Maximum Length*: `4096` | getCustomerNote(): ?string | setCustomerNote(?string customerNote): void | -| `sellerNote` | `?string` | Optional | The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](#type-CatalogObject) instance.
This field should not be visible to customers.
**Constraints**: *Maximum Length*: `4096` | getSellerNote(): ?string | setSellerNote(?string sellerNote): void | +| `createdAt` | `?string` | Optional | The timestamp specifying the creation time of this booking, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `updatedAt` | `?string` | Optional | The timestamp specifying the most recent update time of this booking, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | +| `startAt` | `?string` | Optional | The timestamp specifying the starting time of this booking, in RFC 3339 format. | getStartAt(): ?string | setStartAt(?string startAt): void | +| `locationId` | `?string` | Optional | The ID of the [Location](/doc/models/location.md) object representing the location where the booked service is provided. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `customerId` | `?string` | Optional | The ID of the [Customer](/doc/models/customer.md) object representing the customer attending this booking | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `customerNote` | `?string` | Optional | The free-text field for the customer to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](/doc/models/catalog-object.md) instance.
**Constraints**: *Maximum Length*: `4096` | getCustomerNote(): ?string | setCustomerNote(?string customerNote): void | +| `sellerNote` | `?string` | Optional | The free-text field for the seller to supply notes about the booking. For example, the note can be preferences that cannot be expressed by supported attributes of a specific [CatalogObject](/doc/models/catalog-object.md) instance.
This field should not be visible to customers.
**Constraints**: *Maximum Length*: `4096` | getSellerNote(): ?string | setSellerNote(?string sellerNote): void | | `appointmentSegments` | [`?(AppointmentSegment[])`](/doc/models/appointment-segment.md) | Optional | A list of appointment segments for this booking. | getAppointmentSegments(): ?array | setAppointmentSegments(?array appointmentSegments): void | ## Example (as JSON) diff --git a/doc/models/business-booking-profile.md b/doc/models/business-booking-profile.md index 7390dede..5cb915e8 100644 --- a/doc/models/business-booking-profile.md +++ b/doc/models/business-booking-profile.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `sellerId` | `?string` | Optional | The ID of the seller, obtainable using the Merchants API. | getSellerId(): ?string | setSellerId(?string sellerId): void | -| `createdAt` | `?string` | Optional | The RFC-3339 timestamp specifying the booking's creation time. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `createdAt` | `?string` | Optional | The RFC 3339 timestamp specifying the booking's creation time. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `bookingEnabled` | `?bool` | Optional | Indicates whether the seller is open for booking. | getBookingEnabled(): ?bool | setBookingEnabled(?bool bookingEnabled): void | | `customerTimezoneChoice` | [`?string (BusinessBookingProfileCustomerTimezoneChoice)`](/doc/models/business-booking-profile-customer-timezone-choice.md) | Optional | Choices of customer-facing time zone used for bookings. | getCustomerTimezoneChoice(): ?string | setCustomerTimezoneChoice(?string customerTimezoneChoice): void | | `bookingPolicy` | [`?string (BusinessBookingProfileBookingPolicy)`](/doc/models/business-booking-profile-booking-policy.md) | Optional | Policies for accepting bookings. | getBookingPolicy(): ?string | setBookingPolicy(?string bookingPolicy): void | diff --git a/doc/models/calculate-loyalty-points-request.md b/doc/models/calculate-loyalty-points-request.md index 7b2d86cb..5c1ef2a0 100644 --- a/doc/models/calculate-loyalty-points-request.md +++ b/doc/models/calculate-loyalty-points-request.md @@ -12,7 +12,7 @@ a specified purchase. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The [order](#type-Order) ID for which to calculate the points.
Specify this field if your application uses the Orders API to process orders.
Otherwise, specify the `transaction_amount`. | getOrderId(): ?string | setOrderId(?string orderId): void | +| `orderId` | `?string` | Optional | The [order](/doc/models/order.md) ID for which to calculate the points.
Specify this field if your application uses the Orders API to process orders.
Otherwise, specify the `transaction_amount`. | getOrderId(): ?string | setOrderId(?string orderId): void | | `transactionAmountMoney` | [`?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. | getTransactionAmountMoney(): ?Money | setTransactionAmountMoney(?Money transactionAmountMoney): void | ## Example (as JSON) diff --git a/doc/models/cancel-invoice-request.md b/doc/models/cancel-invoice-request.md index d2b3fddc..9c1edd84 100644 --- a/doc/models/cancel-invoice-request.md +++ b/doc/models/cancel-invoice-request.md @@ -11,7 +11,7 @@ Describes a `CancelInvoice` request. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `version` | `int` | Required | The version of the [invoice](#type-invoice) to cancel.
If you do not know the version, you can call
[GetInvoice](#endpoint-Invoices-GetInvoice) or [ListInvoices](#endpoint-Invoices-ListInvoices). | getVersion(): int | setVersion(int version): void | +| `version` | `int` | Required | The version of the [invoice](/doc/models/invoice.md) to cancel.
If you do not know the version, you can call
[GetInvoice](/doc/apis/invoices.md#get-invoice) or [ListInvoices](/doc/apis/invoices.md#list-invoices). | getVersion(): int | setVersion(int version): void | ## Example (as JSON) diff --git a/doc/models/cancel-invoice-response.md b/doc/models/cancel-invoice-response.md index fa8c59bc..7a859984 100644 --- a/doc/models/cancel-invoice-response.md +++ b/doc/models/cancel-invoice-response.md @@ -19,6 +19,11 @@ The response returned by the `CancelInvoice` request. ```json { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/cancel-payment-by-idempotency-key-request.md b/doc/models/cancel-payment-by-idempotency-key-request.md index 950e5887..217590d8 100644 --- a/doc/models/cancel-payment-by-idempotency-key-request.md +++ b/doc/models/cancel-payment-by-idempotency-key-request.md @@ -2,7 +2,7 @@ # Cancel Payment by Idempotency Key Request Describes a request to cancel a payment using -[CancelPaymentByIdempotencyKey](#endpoint-payments-cancelpaymentbyidempotencykey). +[CancelPaymentByIdempotencyKey](/doc/apis/payments.md#cancel-payment-by-idempotency-key). ## Structure diff --git a/doc/models/cancel-payment-by-idempotency-key-response.md b/doc/models/cancel-payment-by-idempotency-key-response.md index 64ddf977..1eb76716 100644 --- a/doc/models/cancel-payment-by-idempotency-key-response.md +++ b/doc/models/cancel-payment-by-idempotency-key-response.md @@ -2,7 +2,7 @@ # Cancel Payment by Idempotency Key Response Defines the response returned by -[CancelPaymentByIdempotencyKey](#endpoint-payments-cancelpaymentbyidempotencykey). +[CancelPaymentByIdempotencyKey](/doc/apis/payments.md#cancel-payment-by-idempotency-key). On success, `errors` is empty. ## Structure diff --git a/doc/models/cancel-payment-response.md b/doc/models/cancel-payment-response.md index be8f0661..f458ea63 100644 --- a/doc/models/cancel-payment-response.md +++ b/doc/models/cancel-payment-response.md @@ -1,7 +1,7 @@ # Cancel Payment Response -Defines the response returned by [CancelPayment](#endpoint-payments-cancelpayment). +Defines the response returned by [CancelPayment](/doc/apis/payments.md#cancel-payment). ## Structure diff --git a/doc/models/cancel-subscription-response.md b/doc/models/cancel-subscription-response.md index 5e0de01b..7e5032e4 100644 --- a/doc/models/cancel-subscription-response.md +++ b/doc/models/cancel-subscription-response.md @@ -2,7 +2,7 @@ # Cancel Subscription Response Defines fields that are included in a -[CancelSubscription](#endpoint-subscriptions-cancelsubscription) response. +[CancelSubscription](/doc/apis/subscriptions.md#cancel-subscription) response. ## Structure diff --git a/doc/models/capture-transaction-response.md b/doc/models/capture-transaction-response.md index 7c10877f..a5b09e0d 100644 --- a/doc/models/capture-transaction-response.md +++ b/doc/models/capture-transaction-response.md @@ -2,7 +2,7 @@ # Capture Transaction Response Defines the fields that are included in the response body of -a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint. +a request to the [CaptureTransaction](/doc/apis/transactions.md#capture-transaction) endpoint. ## Structure diff --git a/doc/models/catalog-custom-attribute-value.md b/doc/models/catalog-custom-attribute-value.md index 838a440d..b31b52a6 100644 --- a/doc/models/catalog-custom-attribute-value.md +++ b/doc/models/catalog-custom-attribute-value.md @@ -15,7 +15,7 @@ added to `ITEM` and `ITEM_VARIATION` type catalog objects. | --- | --- | --- | --- | --- | --- | | `name` | `?string` | Optional | The name of the custom attribute. | getName(): ?string | setName(?string name): void | | `stringValue` | `?string` | Optional | The string value of the custom attribute. Populated if `type` = `STRING`. | getStringValue(): ?string | setStringValue(?string stringValue): void | -| `customAttributeDefinitionId` | `?string` | Optional | __Read-only.__ The id of the [CatalogCustomAttributeDefinition](#type-CatalogCustomAttributeDefinition) this value belongs to. | getCustomAttributeDefinitionId(): ?string | setCustomAttributeDefinitionId(?string customAttributeDefinitionId): void | +| `customAttributeDefinitionId` | `?string` | Optional | __Read-only.__ The id of the [CatalogCustomAttributeDefinition](/doc/models/catalog-custom-attribute-definition.md) this value belongs to. | getCustomAttributeDefinitionId(): ?string | setCustomAttributeDefinitionId(?string customAttributeDefinitionId): void | | `type` | [`?string (CatalogCustomAttributeDefinitionType)`](/doc/models/catalog-custom-attribute-definition-type.md) | Optional | Defines the possible types for a custom attribute. | getType(): ?string | setType(?string type): void | | `numberValue` | `?string` | Optional | Populated if `type` = `NUMBER`. Contains a string
representation of a decimal number, using a `.` as the decimal separator. | getNumberValue(): ?string | setNumberValue(?string numberValue): void | | `booleanValue` | `?bool` | Optional | A `true` or `false` value. Populated if `type` = `BOOLEAN`. | getBooleanValue(): ?bool | setBooleanValue(?bool booleanValue): void | diff --git a/doc/models/catalog-id-mapping.md b/doc/models/catalog-id-mapping.md index 4260e04b..88a29b0e 100644 --- a/doc/models/catalog-id-mapping.md +++ b/doc/models/catalog-id-mapping.md @@ -3,9 +3,9 @@ A mapping between a temporary client-supplied ID and a permanent server-generated ID. -When calling [UpsertCatalogObject](#endpoint-Catalog-UpsertCatalogObject) or -[BatchUpsertCatalogObjects](#endpoint-Catalog-BatchUpsertCatalogObjects) to -create a [CatalogObject](#type-CatalogObject) instance, you can supply +When calling [UpsertCatalogObject](/doc/apis/catalog.md#upsert-catalog-object) or +[BatchUpsertCatalogObjects](/doc/apis/catalog.md#batch-upsert-catalog-objects) to +create a [CatalogObject](/doc/models/catalog-object.md) instance, you can supply a temporary ID for the to-be-created object, especially when the object is to be referenced elsewhere in the same request body. This temporary ID can be any string unique within the call, but must be prefixed by "#". diff --git a/doc/models/catalog-image.md b/doc/models/catalog-image.md index 9110209a..03e5a02b 100644 --- a/doc/models/catalog-image.md +++ b/doc/models/catalog-image.md @@ -13,7 +13,7 @@ items, item variations, and categories. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `name` | `?string` | Optional | The internal name to identify this image in calls to the Square API. | getName(): ?string | setName(?string name): void | -| `url` | `?string` | Optional | The URL of this image, generated by Square after an image is uploaded
using the [CreateCatalogImage](#endpoint-Catalog-CreateCatalogImage) endpoint. | getUrl(): ?string | setUrl(?string url): void | +| `url` | `?string` | Optional | The URL of this image, generated by Square after an image is uploaded
using the [CreateCatalogImage](/doc/apis/catalog.md#create-catalog-image) endpoint. | getUrl(): ?string | setUrl(?string url): void | | `caption` | `?string` | Optional | A caption that describes what is shown in the image. Displayed in the
Square Online Store. This is a searchable attribute for use in applicable query filters. | getCaption(): ?string | setCaption(?string caption): void | ## Example (as JSON) diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md index ec287e50..26ff090d 100644 --- a/doc/models/catalog-item.md +++ b/doc/models/catalog-item.md @@ -1,7 +1,7 @@ # Catalog Item -A [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. +A [CatalogObject](/doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. ## Structure @@ -25,6 +25,7 @@ A [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referre | `productType` | [`?string (CatalogItemProductType)`](/doc/models/catalog-item-product-type.md) | Optional | The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. | getProductType(): ?string | setProductType(?string productType): void | | `skipModifierScreen` | `?bool` | Optional | If `false`, the Square Point of Sale app will present the `CatalogItem`'s
details screen immediately, allowing the merchant to choose `CatalogModifier`s
before adding the item to the cart. This is the default behavior.

If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected
modifiers, and merchants can edit modifiers by drilling down onto the item's details.

Third-party clients are encouraged to implement similar behaviors. | getSkipModifierScreen(): ?bool | setSkipModifierScreen(?bool skipModifierScreen): void | | `itemOptions` | [`?(CatalogItemOptionForItem[])`](/doc/models/catalog-item-option-for-item.md) | Optional | List of item options IDs for this item. Used to manage and group item
variations in a specified order.

Maximum: 6 item options. | getItemOptions(): ?array | setItemOptions(?array itemOptions): void | +| `sortName` | `?string` | Optional | A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, the regular `name` field is used for sorting.

It is currently supported for sellers of the Japanese locale only. | getSortName(): ?string | setSortName(?string sortName): void | ## Example (as JSON) diff --git a/doc/models/catalog-object-type.md b/doc/models/catalog-object-type.md index 6158bcbe..9ec9b481 100644 --- a/doc/models/catalog-object-type.md +++ b/doc/models/catalog-object-type.md @@ -24,7 +24,7 @@ containing type-specific properties in the `*_data` field corresponding to the o | `PRODUCT_SET` | A product set, corresponding to `CatalogProductSet`.
The product-set-specific data will be stored in the `product_set_data` field. | | `TIME_PERIOD` | A time period, corresponding to `CatalogTimePeriod`.
The time-period-specific data will be stored in the `time_period_data` field. | | `MEASUREMENT_UNIT` | A measurement unit, corresponding to `CatalogMeasurementUnit`. The unit of
measure and precision in which an item variation should be sold. | -| `SUBSCRIPTION_PLAN` | A subscription plan, corresponding to
[CatalogSubscriptionPlan](#type-CatalogSubscriptionPlan).

The subscription plan data is stored in the `subscription_plan_data` field of the
[CatalogObject](#type-CatalogObject). | +| `SUBSCRIPTION_PLAN` | A subscription plan, corresponding to
[CatalogSubscriptionPlan](/doc/models/catalog-subscription-plan.md).

The subscription plan data is stored in the `subscription_plan_data` field of the
[CatalogObject](/doc/models/catalog-object.md). | | `ITEM_OPTION` | Represents a list of item option values that can be assigned to item
variations. For example, a color option or size option for a t-shirt. | | `ITEM_OPTION_VAL` | Represents an option value associated with one or more item options.
For example, an item option of "Size" may have item option values such as
"Small" or "Medium". | | `CUSTOM_ATTRIBUTE_DEFINITION` | Represents the definition of a custom attribute | diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md index 677e0c1c..748fd5ec 100644 --- a/doc/models/catalog-object.md +++ b/doc/models/catalog-object.md @@ -38,13 +38,13 @@ For a more detailed discussion of the Catalog data model, please see the | `updatedAt` | `?string` | Optional | Last modification [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) in RFC 3339 format, e.g., `"2016-08-15T23:59:33.123Z"`
would indicate the UTC time (denoted by `Z`) of August 15, 2016 at 23:59:33 and 123 milliseconds. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | | `version` | `?int` | Optional | The version of the object. When updating an object, the version supplied
must match the version in the database, otherwise the write will be rejected as conflicting. | getVersion(): ?int | setVersion(?int version): void | | `isDeleted` | `?bool` | Optional | If `true`, the object has been deleted from the database. Must be `false` for new objects
being inserted. When deleted, the `updated_at` field will equal the deletion time. | getIsDeleted(): ?bool | setIsDeleted(?bool isDeleted): void | -| `customAttributeValues` | [`?array`](/doc/models/catalog-custom-attribute-value.md) | Optional | A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair
is a [CatalogCustomAttributeValue](#type-CatalogCustomAttributeValue) object. The key is the `key` attribute
value defined in the associated [CatalogCustomAttributeDefinition](#type-CatalogCustomAttributeDefinition)
object defined by the application making the request.

If the `CatalogCustomAttributeDefinition` object is
defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by
the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of
`"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"`
if the application making the request is different from the application defining the custom attribute definition.
Otherwise, the key used in the map is simply `"cocoa_brand"`.

Application-defined custom attributes that are set at a global (location-independent) level.
Custom attribute values are intended to store additional information about a catalog object
or associations with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.). | getCustomAttributeValues(): ?array | setCustomAttributeValues(?array customAttributeValues): void | +| `customAttributeValues` | [`?array`](/doc/models/catalog-custom-attribute-value.md) | Optional | A map (key-value pairs) of application-defined custom attribute values. The value of a key-value pair
is a [CatalogCustomAttributeValue](/doc/models/catalog-custom-attribute-value.md) object. The key is the `key` attribute
value defined in the associated [CatalogCustomAttributeDefinition](/doc/models/catalog-custom-attribute-definition.md)
object defined by the application making the request.

If the `CatalogCustomAttributeDefinition` object is
defined by another application, the `CatalogCustomAttributeDefinition`'s key attribute value is prefixed by
the defining application ID. For example, if the `CatalogCustomAttributeDefinition` has a `key` attribute of
`"cocoa_brand"` and the defining application ID is `"abcd1234"`, the key in the map is `"abcd1234:cocoa_brand"`
if the application making the request is different from the application defining the custom attribute definition.
Otherwise, the key used in the map is simply `"cocoa_brand"`.

Application-defined custom attributes that are set at a global (location-independent) level.
Custom attribute values are intended to store additional information about a catalog object
or associations with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.). | getCustomAttributeValues(): ?array | setCustomAttributeValues(?array customAttributeValues): void | | `catalogV1Ids` | [`?(CatalogV1Id[])`](/doc/models/catalog-v1-id.md) | Optional | The Connect v1 IDs for this object at each location where it is present, where they
differ from the object's Connect V2 ID. The field will only be present for objects that
have been created or modified by legacy APIs. | getCatalogV1Ids(): ?array | setCatalogV1Ids(?array catalogV1Ids): void | | `presentAtAllLocations` | `?bool` | Optional | If `true`, this object is present at all locations (including future locations), except where specified in
the `absent_at_location_ids` field. If `false`, this object is not present at any locations (including future locations),
except where specified in the `present_at_location_ids` field. If not specified, defaults to `true`. | getPresentAtAllLocations(): ?bool | setPresentAtAllLocations(?bool presentAtAllLocations): void | -| `presentAtLocationIds` | `?(string[])` | Optional | A list of locations where the object is present, even if `present_at_all_locations` is `false`. | getPresentAtLocationIds(): ?array | setPresentAtLocationIds(?array presentAtLocationIds): void | -| `absentAtLocationIds` | `?(string[])` | Optional | A list of locations where the object is not present, even if `present_at_all_locations` is `true`. | getAbsentAtLocationIds(): ?array | setAbsentAtLocationIds(?array absentAtLocationIds): void | +| `presentAtLocationIds` | `?(string[])` | Optional | A list of locations where the object is present, even if `present_at_all_locations` is `false`.
This can include locations that are deactivated. | getPresentAtLocationIds(): ?array | setPresentAtLocationIds(?array presentAtLocationIds): void | +| `absentAtLocationIds` | `?(string[])` | Optional | A list of locations where the object is not present, even if `present_at_all_locations` is `true`.
This can include locations that are deactivated. | getAbsentAtLocationIds(): ?array | setAbsentAtLocationIds(?array absentAtLocationIds): void | | `imageId` | `?string` | Optional | Identifies the `CatalogImage` attached to this `CatalogObject`. | getImageId(): ?string | setImageId(?string imageId): void | -| `itemData` | [`?CatalogItem`](/doc/models/catalog-item.md) | Optional | A [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. | getItemData(): ?CatalogItem | setItemData(?CatalogItem itemData): void | +| `itemData` | [`?CatalogItem`](/doc/models/catalog-item.md) | Optional | A [CatalogObject](/doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. | getItemData(): ?CatalogItem | setItemData(?CatalogItem itemData): void | | `categoryData` | [`?CatalogCategory`](/doc/models/catalog-category.md) | Optional | A category to which a `CatalogItem` instance belongs. | getCategoryData(): ?CatalogCategory | setCategoryData(?CatalogCategory categoryData): void | | `itemVariationData` | [`?CatalogItemVariation`](/doc/models/catalog-item-variation.md) | Optional | An item variation (i.e., product) in the Catalog object model. Each item
may have a maximum of 250 item variations. | getItemVariationData(): ?CatalogItemVariation | setItemVariationData(?CatalogItemVariation itemVariationData): void | | `taxData` | [`?CatalogTax`](/doc/models/catalog-tax.md) | Optional | A tax applicable to an item. | getTaxData(): ?CatalogTax | setTaxData(?CatalogTax taxData): void | diff --git a/doc/models/catalog-pricing-rule.md b/doc/models/catalog-pricing-rule.md index 22721b33..50fa7bf6 100644 --- a/doc/models/catalog-pricing-rule.md +++ b/doc/models/catalog-pricing-rule.md @@ -23,6 +23,7 @@ during the active time period. | `validUntilDate` | `?string` | Optional | Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD). | getValidUntilDate(): ?string | setValidUntilDate(?string validUntilDate): void | | `validUntilLocalTime` | `?string` | Optional | Represents the local time the pricing rule should be valid until. Represented in RFC 3339 partial-time format
(HH:MM:SS). Partial seconds will be truncated. | getValidUntilLocalTime(): ?string | setValidUntilLocalTime(?string validUntilLocalTime): void | | `excludeStrategy` | [`?string (ExcludeStrategy)`](/doc/models/exclude-strategy.md) | Optional | Indicates which products matched by a CatalogPricingRule
will be excluded if the pricing rule uses an exclude set. | getExcludeStrategy(): ?string | setExcludeStrategy(?string excludeStrategy): void | +| `customerGroupIdsAny` | `?(string[])` | Optional | A list of IDs of customer groups, the members of which are eligible for discounts specified in this pricing rule.
Notice that a group ID is generated by the Customers API.
If this field is not set, the specified discount applies to matched products sold to anyone whether the buyer
has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified discount
applies only to matched products sold to customers belonging to the specified customer groups. | getCustomerGroupIdsAny(): ?array | setCustomerGroupIdsAny(?array customerGroupIdsAny): void | ## Example (as JSON) diff --git a/doc/models/catalog-query.md b/doc/models/catalog-query.md index 035047d9..3ffb8be2 100644 --- a/doc/models/catalog-query.md +++ b/doc/models/catalog-query.md @@ -3,14 +3,14 @@ A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint. -Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects). +Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](/doc/apis/catalog.md#search-catalog-objects). Any combination of the following types may be used together: -- [exact_query](#type-CatalogExactQuery) -- [prefix_query](#type-CatalogPrefixQuery) -- [range_query](#type-CatalogRangeQuery) -- [sorted_attribute_query](#type-CatalogSortedAttribute) -- [text_query](#type-CatalogTextQuery) +- [exact_query](/doc/models/catalog-query-exact.md) +- [prefix_query](/doc/models/catalog-query-prefix.md) +- [range_query](/doc/models/catalog-query-range.md) +- [sorted_attribute_query](/doc/models/catalog-query-sorted-attribute.md) +- [text_query](/doc/models/catalog-query-text.md) All other query types cannot be combined with any others. When a query filter is based on an attribute, the attribute must be searchable. @@ -26,7 +26,7 @@ Searchable attributes are listed as follows, along their parent types that can b - `caption`: `CatalogImage` - `display_name`: `CatalogItemOption` -For example, to search for [CatalogItem](#type-CatalogItem) objects by searchable attributes, you can use +For example, to search for [CatalogItem](/doc/models/catalog-item.md) objects by searchable attributes, you can use the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. ## Structure diff --git a/doc/models/catalog-subscription-plan.md b/doc/models/catalog-subscription-plan.md index bfbd2116..8eab6023 100644 --- a/doc/models/catalog-subscription-plan.md +++ b/doc/models/catalog-subscription-plan.md @@ -13,7 +13,7 @@ Describes a subscription plan. For more information, see | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `name` | `?string` | Optional | The name of the plan. | getName(): ?string | setName(?string name): void | -| `phases` | [`?(SubscriptionPhase[])`](/doc/models/subscription-phase.md) | Optional | A list of SubscriptionPhase containing the [SubscriptionPhase](#type-SubscriptionPhase) for this plan. | getPhases(): ?array | setPhases(?array phases): void | +| `phases` | [`?(SubscriptionPhase[])`](/doc/models/subscription-phase.md) | Optional | A list of SubscriptionPhase containing the [SubscriptionPhase](/doc/models/subscription-phase.md) for this plan. | getPhases(): ?array | setPhases(?array phases): void | ## Example (as JSON) diff --git a/doc/models/charge-request.md b/doc/models/charge-request.md index 314fb3fa..45f9c248 100644 --- a/doc/models/charge-request.md +++ b/doc/models/charge-request.md @@ -2,9 +2,9 @@ # Charge Request Defines the parameters that can be included in the body of -a request to the [Charge](#endpoint-charge) endpoint. +a request to the [Charge](/doc/apis/transactions.md#charge) endpoint. -Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) +Deprecated - recommend using [CreatePayment](/doc/apis/payments.md#create-payment) ## Structure @@ -14,11 +14,11 @@ Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
transaction among transactions you've created.

If you're unsure whether a particular transaction succeeded,
you can reattempt it with the same idempotency key without
worrying about double-charging the buyer.

See [Idempotency keys](#idempotencykeys) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | +| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
transaction among transactions you've created.

If you're unsure whether a particular transaction succeeded,
you can reattempt it with the same idempotency key without
worrying about double-charging the buyer.

See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | | `amountMoney` | [`Money`](/doc/models/money.md) | Required | 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. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | | `cardNonce` | `?string` | Optional | A nonce generated from the `SqPaymentForm` that represents the card
to charge.

The application that provides a nonce to this endpoint must be the
_same application_ that generated the nonce with the `SqPaymentForm`.
Otherwise, the nonce is invalid.

Do not provide a value for this field if you provide a value for
`customer_card_id`.
**Constraints**: *Maximum Length*: `192` | getCardNonce(): ?string | setCardNonce(?string cardNonce): void | | `customerCardId` | `?string` | Optional | The ID of the customer card on file to charge. Do
not provide a value for this field if you provide a value for `card_nonce`.

If you provide this value, you _must_ also provide a value for
`customer_id`.
**Constraints**: *Maximum Length*: `192` | getCustomerCardId(): ?string | setCustomerCardId(?string customerCardId): void | -| `delayCapture` | `?bool` | Optional | If `true`, the request will only perform an Auth on the provided
card. You can then later perform either a Capture (with the
[CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void
(with the [VoidTransaction](#endpoint-voidtransaction) endpoint).

Default value: `false` | getDelayCapture(): ?bool | setDelayCapture(?bool delayCapture): void | +| `delayCapture` | `?bool` | Optional | If `true`, the request will only perform an Auth on the provided
card. You can then later perform either a Capture (with the
[CaptureTransaction](/doc/apis/transactions.md#capture-transaction) endpoint) or a Void
(with the [VoidTransaction](/doc/apis/transactions.md#void-transaction) endpoint).

Default value: `false` | getDelayCapture(): ?bool | setDelayCapture(?bool delayCapture): void | | `referenceId` | `?string` | Optional | An optional ID you can associate with the transaction for your own
purposes (such as to associate the transaction with an entity ID in your
own database).

This value cannot exceed 40 characters.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `note` | `?string` | Optional | An optional note to associate with the transaction.

This value cannot exceed 60 characters.
**Constraints**: *Maximum Length*: `60` | getNote(): ?string | setNote(?string note): void | | `customerId` | `?string` | Optional | The ID of the customer to associate this transaction with. This field
is required if you provide a value for `customer_card_id`, and optional
otherwise.
**Constraints**: *Maximum Length*: `50` | getCustomerId(): ?string | setCustomerId(?string customerId): void | diff --git a/doc/models/charge-response.md b/doc/models/charge-response.md index c48f1511..e79561ad 100644 --- a/doc/models/charge-response.md +++ b/doc/models/charge-response.md @@ -2,7 +2,7 @@ # Charge Response Defines the fields that are included in the response body of -a request to the [Charge](#endpoint-charge) endpoint. +a request to the [Charge](/doc/apis/transactions.md#charge) endpoint. One of `errors` or `transaction` is present in a given response (never both). diff --git a/doc/models/check-appointments-onboarded-response.md b/doc/models/check-appointments-onboarded-response.md deleted file mode 100644 index 1a80fbe3..00000000 --- a/doc/models/check-appointments-onboarded-response.md +++ /dev/null @@ -1,42 +0,0 @@ - -# Check Appointments Onboarded Response - -## Structure - -`CheckAppointmentsOnboardedResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `appointmentsOnboarded` | `?bool` | Optional | Indicates whether the seller has enabled the Square Appointments service (`true`) or not (`false`). | getAppointmentsOnboarded(): ?bool | setAppointmentsOnboarded(?bool appointmentsOnboarded): void | -| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "appointments_onboarded": false, - "errors": [ - { - "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", - "detail": "detail1", - "field": "field9" - }, - { - "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", - "detail": "detail2", - "field": "field0" - }, - { - "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", - "detail": "detail3", - "field": "field1" - } - ] -} -``` - diff --git a/doc/models/complete-payment-response.md b/doc/models/complete-payment-response.md index 8682e0d1..b32bb735 100644 --- a/doc/models/complete-payment-response.md +++ b/doc/models/complete-payment-response.md @@ -1,7 +1,7 @@ # Complete Payment Response -Defines the response returned by[CompletePayment](#endpoint-payments-completepayment). +Defines the response returned by[CompletePayment](/doc/apis/payments.md#complete-payment). ## Structure diff --git a/doc/models/create-customer-card-request.md b/doc/models/create-customer-card-request.md index e6966ebf..1110e6b2 100644 --- a/doc/models/create-customer-card-request.md +++ b/doc/models/create-customer-card-request.md @@ -2,7 +2,7 @@ # Create Customer Card Request Defines the fields that are included in the request body of a request -to the CreateCustomerCard endpoint. +to the `CreateCustomerCard` endpoint. ## Structure @@ -12,7 +12,7 @@ to the CreateCustomerCard endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cardNonce` | `string` | Required | A card nonce representing the credit card to link to the customer.

Card nonces are generated by the Square Payment Form when customers enter
their card information. See
[Embedding the payment form](https://developer.squareup.com/docs/payment-form/payment-form-walkthrough) for
more information.

__NOTE:__ Card nonces generated by digital wallets (e.g., Apple Pay)
cannot be used to create a customer card. | getCardNonce(): string | setCardNonce(string cardNonce): void | +| `cardNonce` | `string` | Required | A card nonce representing the credit card to link to the customer.

Card nonces are generated by the Square payment form when customers enter
their card information. For more information, see
[Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/payment-form/payment-form-walkthrough).

__NOTE:__ Card nonces generated by digital wallets (such as Apple Pay)
cannot be used to create a customer card. | getCardNonce(): string | setCardNonce(string cardNonce): void | | `billingAddress` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getBillingAddress(): ?Address | setBillingAddress(?Address billingAddress): void | | `cardholderName` | `?string` | Optional | The full name printed on the credit card. | getCardholderName(): ?string | setCardholderName(?string cardholderName): void | | `verificationToken` | `?string` | Optional | An identifying token generated by `SqPaymentForm.verifyBuyer()`.
Verification tokens encapsulate customer device information and 3-D Secure
challenge results to indicate that Square has verified the buyer identity. | getVerificationToken(): ?string | setVerificationToken(?string verificationToken): void | diff --git a/doc/models/create-customer-card-response.md b/doc/models/create-customer-card-response.md index 977daf87..71580790 100644 --- a/doc/models/create-customer-card-response.md +++ b/doc/models/create-customer-card-response.md @@ -2,9 +2,9 @@ # Create Customer Card Response Defines the fields that are included in the response body of -a request to the CreateCustomerCard endpoint. +a request to the `CreateCustomerCard` endpoint. -One of `errors` or `card` is present in a given response (never both). +Either `errors` or `card` is present in a given response (never both). ## Structure diff --git a/doc/models/create-customer-group-request.md b/doc/models/create-customer-group-request.md index 77a7ec9e..bb5f22c7 100644 --- a/doc/models/create-customer-group-request.md +++ b/doc/models/create-customer-group-request.md @@ -1,8 +1,8 @@ # Create Customer Group Request -Defines the body parameters that can be provided in a request to the -[CreateCustomerGroup](#endpoint-createcustomegroup) endpoint. +Defines the body parameters that can be included in a request to the +[CreateCustomerGroup](/doc/apis/customer-groups.md#create-customer-group) endpoint. ## Structure @@ -12,8 +12,8 @@ Defines the body parameters that can be provided in a request to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | The idempotency key for the request. See the [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency)
guide for more information. | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `group` | [`CustomerGroup`](/doc/models/customer-group.md) | Required | Represents a group of customer profiles.

Customer groups can be created, modified, and have their membership defined either via
the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. | getGroup(): CustomerGroup | setGroup(CustomerGroup group): void | +| `idempotencyKey` | `?string` | Optional | The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | +| `group` | [`CustomerGroup`](/doc/models/customer-group.md) | Required | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): CustomerGroup | setGroup(CustomerGroup group): void | ## Example (as JSON) diff --git a/doc/models/create-customer-group-response.md b/doc/models/create-customer-group-response.md index dd0c49fd..a380dc01 100644 --- a/doc/models/create-customer-group-response.md +++ b/doc/models/create-customer-group-response.md @@ -2,9 +2,9 @@ # Create Customer Group Response Defines the fields that are included in the response body of -a request to the [CreateCustomerGroup](#endpoint-createcustomergroup) endpoint. +a request to the [CreateCustomerGroup](/doc/apis/customer-groups.md#create-customer-group) endpoint. -One of `errors` or `group` is present in a given response (never both). +Either `errors` or `group` is present in a given response (never both). ## Structure @@ -15,7 +15,7 @@ One of `errors` or `group` is present in a given response (never both). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `group` | [`?CustomerGroup`](/doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, modified, and have their membership defined either via
the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | +| `group` | [`?CustomerGroup`](/doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | ## Example (as JSON) diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index 6e03e0b9..ac9a712d 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -1,8 +1,8 @@ # Create Customer Request -Defines the body parameters that can be provided in a request to the -CreateCustomer endpoint. +Defines the body parameters that can be included in a request to the +`CreateCustomer` endpoint. ## Structure @@ -12,17 +12,17 @@ CreateCustomer endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | The idempotency key for the request. See the
[Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) guide for more information. | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | -| `givenName` | `?string` | Optional | The given (i.e., first) name associated with the customer profile. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family (i.e., last) name associated with the customer profile. | getFamilyName(): ?string | setFamilyName(?string familyName): void | +| `idempotencyKey` | `?string` | Optional | The idempotency key for the request. For more information, see
[Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | +| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile. | getGivenName(): ?string | setGivenName(?string givenName): void | +| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile. | getFamilyName(): ?string | setFamilyName(?string familyName): void | | `companyName` | `?string` | Optional | A business name associated with the customer profile. | getCompanyName(): ?string | setCompanyName(?string companyName): void | | `nickname` | `?string` | Optional | A nickname for the customer profile. | getNickname(): ?string | setNickname(?string nickname): void | | `emailAddress` | `?string` | Optional | The email address associated with the customer profile. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | | `address` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getAddress(): ?Address | setAddress(?Address address): void | | `phoneNumber` | `?string` | Optional | The 11-digit phone number associated with the customer profile. | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `referenceId` | `?string` | Optional | An optional, second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | +| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in RFC 3339 format.
Year is optional, timezone and times are not allowed.
For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st.
`1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. | getBirthday(): ?string | setBirthday(?string birthday): void | +| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The timezone and time are not allowed.
For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00:00-00:00` represents a birthday on September 21, 1998.
You can also specify this value in `YYYY-MM-DD` format. | getBirthday(): ?string | setBirthday(?string birthday): void | ## Example (as JSON) diff --git a/doc/models/create-customer-response.md b/doc/models/create-customer-response.md index c18f142e..937d047b 100644 --- a/doc/models/create-customer-response.md +++ b/doc/models/create-customer-response.md @@ -2,9 +2,9 @@ # Create Customer Response Defines the fields that are included in the response body of -a request to the CreateCustomer endpoint. +a request to the `CreateCustomer` endpoint. -One of `errors` or `customer` is present in a given response (never both). +Either `errors` or `customer` is present in a given response (never both). ## Structure @@ -31,14 +31,19 @@ One of `errors` or `customer` is present in a given response (never both). "postal_code": "10003" }, "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", "email_address": "Amelia.Earhart@example.com", "family_name": "Earhart", "given_name": "Amelia", "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", "note": "a customer", "phone_number": "1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, "reference_id": "YOUR_REFERENCE_ID", - "updated_at": "2016-03-23T20:21:54.859Z" + "updated_at": "2016-03-23T20:21:54.859Z", + "version": 0 } } ``` diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index 23d41211..95695018 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -20,6 +20,11 @@ Describes a `CreateInvoice` request. { "idempotency_key": "ce3748f9-5fc1-4762-aa12-aae5e843f1f4", "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "custom_fields": [ { "label": "Event Reference Number", diff --git a/doc/models/create-invoice-response.md b/doc/models/create-invoice-response.md index 20a86483..eec0dad9 100644 --- a/doc/models/create-invoice-response.md +++ b/doc/models/create-invoice-response.md @@ -19,6 +19,11 @@ The response returned by the `CreateInvoice` request. ```json { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/create-location-request.md b/doc/models/create-location-request.md index b64c6273..79b1ddc9 100644 --- a/doc/models/create-location-request.md +++ b/doc/models/create-location-request.md @@ -1,7 +1,7 @@ # Create Location Request -Request object for the [CreateLocation](#endpoint-createlocation) endpoint. +Request object for the [CreateLocation](/doc/apis/locations.md#create-location) endpoint. ## Structure diff --git a/doc/models/create-location-response.md b/doc/models/create-location-response.md index e3ac9f7a..624e657f 100644 --- a/doc/models/create-location-response.md +++ b/doc/models/create-location-response.md @@ -1,7 +1,7 @@ # Create Location Response -Response object returned by the [CreateLocation](#endpoint-createlocation) endpoint. +Response object returned by the [CreateLocation](/doc/apis/locations.md#create-location) endpoint. ## Structure diff --git a/doc/models/create-loyalty-account-request.md b/doc/models/create-loyalty-account-request.md index 72dd6a6f..9ee870d5 100644 --- a/doc/models/create-loyalty-account-request.md +++ b/doc/models/create-loyalty-account-request.md @@ -20,12 +20,9 @@ A request to create a new loyalty account. { "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", "loyalty_account": { - "mappings": [ - { - "type": "PHONE", - "value": "+14155551234" - } - ], + "mapping": { + "phone_number": "+14155551234" + }, "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd" } } diff --git a/doc/models/create-loyalty-account-response.md b/doc/models/create-loyalty-account-response.md index 6d2151e2..5ccf410b 100644 --- a/doc/models/create-loyalty-account-response.md +++ b/doc/models/create-loyalty-account-response.md @@ -23,10 +23,18 @@ A response that includes loyalty account created. "created_at": "2020-05-08T21:44:32Z", "id": "79b807d2-d786-46a9-933b-918028d7a8c5", "lifetime_points": 0, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234", + "type": "PHONE", + "value": "+14155551234" + }, "mappings": [ { "created_at": "2020-05-08T21:44:32Z", "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234", "type": "PHONE", "value": "+14155551234" } diff --git a/doc/models/create-loyalty-reward-request.md b/doc/models/create-loyalty-reward-request.md index cd058267..128e376c 100644 --- a/doc/models/create-loyalty-reward-request.md +++ b/doc/models/create-loyalty-reward-request.md @@ -11,7 +11,7 @@ A request to create a loyalty reward. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `reward` | [`LoyaltyReward`](/doc/models/loyalty-reward.md) | Required | - | getReward(): LoyaltyReward | setReward(LoyaltyReward reward): void | +| `reward` | [`LoyaltyReward`](/doc/models/loyalty-reward.md) | Required | Represents a contract to redeem loyalty points for a [reward tier](/doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty-rewards). | getReward(): LoyaltyReward | setReward(LoyaltyReward reward): void | | `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateLoyaltyReward` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | ## Example (as JSON) diff --git a/doc/models/create-loyalty-reward-response.md b/doc/models/create-loyalty-reward-response.md index a605839c..572a0a54 100644 --- a/doc/models/create-loyalty-reward-response.md +++ b/doc/models/create-loyalty-reward-response.md @@ -12,7 +12,7 @@ A response that includes the loyalty reward created. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `reward` | [`?LoyaltyReward`](/doc/models/loyalty-reward.md) | Optional | - | getReward(): ?LoyaltyReward | setReward(?LoyaltyReward reward): void | +| `reward` | [`?LoyaltyReward`](/doc/models/loyalty-reward.md) | Optional | Represents a contract to redeem loyalty points for a [reward tier](/doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty-rewards). | getReward(): ?LoyaltyReward | setReward(?LoyaltyReward reward): void | ## Example (as JSON) diff --git a/doc/models/create-mobile-authorization-code-request.md b/doc/models/create-mobile-authorization-code-request.md index 6852dd30..41b0f76e 100644 --- a/doc/models/create-mobile-authorization-code-request.md +++ b/doc/models/create-mobile-authorization-code-request.md @@ -12,7 +12,7 @@ __CreateMobileAuthorizationCode__ endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The Square location ID the authorization code should be tied to. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `locationId` | `?string` | Optional | The Square location ID the authorization code should be tied to.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getLocationId(): ?string | setLocationId(?string locationId): void | ## Example (as JSON) diff --git a/doc/models/create-mobile-authorization-code-response.md b/doc/models/create-mobile-authorization-code-response.md index 5770dcfa..c0fba70e 100644 --- a/doc/models/create-mobile-authorization-code-response.md +++ b/doc/models/create-mobile-authorization-code-response.md @@ -12,9 +12,9 @@ a request to the __CreateMobileAuthorizationCode__ endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `authorizationCode` | `?string` | Optional | Generated authorization code that connects a mobile application instance
to a Square account. | getAuthorizationCode(): ?string | setAuthorizationCode(?string authorizationCode): void | -| `expiresAt` | `?string` | Optional | The timestamp when `authorization_code` expires in
[RFC 3339](https://tools.ietf.org/html/rfc3339) format, e.g., "2016-09-04T23:59:33.123Z". | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `error` | [`?Error`](/doc/models/error.md) | Optional | Represents an error encountered during a request to the Connect API.

See [Handling errors](#handlingerrors) for more information. | getError(): ?Error | setError(?Error error): void | +| `authorizationCode` | `?string` | Optional | Generated authorization code that connects a mobile application instance
to a Square account.
**Constraints**: *Maximum Length*: `191` | getAuthorizationCode(): ?string | setAuthorizationCode(?string authorizationCode): void | +| `expiresAt` | `?string` | Optional | The timestamp when `authorization_code` expires in
[RFC 3339](https://tools.ietf.org/html/rfc3339) format, e.g., "2016-09-04T23:59:33.123Z".
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | +| `error` | [`?Error`](/doc/models/error.md) | Optional | Represents an error encountered during a request to the Connect API.

See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. | getError(): ?Error | setError(?Error error): void | ## Example (as JSON) diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md index 871ddc81..faeed98f 100644 --- a/doc/models/create-payment-request.md +++ b/doc/models/create-payment-request.md @@ -2,7 +2,7 @@ # Create Payment Request Describes a request to create a payment using -[CreatePayment](#endpoint-payments-createpayment). +[CreatePayment](/doc/apis/payments.md#create-payment). ## Structure @@ -18,9 +18,9 @@ Describes a request to create a payment using | `tipMoney` | [`?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. | getTipMoney(): ?Money | setTipMoney(?Money tipMoney): void | | `appFeeMoney` | [`?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. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | | `delayDuration` | `?string` | Optional | The duration of time after the payment's creation when Square automatically cancels the
payment. This automatic cancellation applies only to payments that do not reach a terminal state
(COMPLETED, CANCELED, or FAILED) before the `delay_duration` time period.

This parameter should be specified as a time duration, in RFC 3339 format, with a minimum value
of 1 minute.

Note: This feature is only supported for card payments. This parameter can only be set for a delayed
capture payment (`autocomplete=false`).

Default:

- Card-present payments: "PT36H" (36 hours) from the creation time.
- Card-not-present payments: "P7D" (7 days) from the creation time. | getDelayDuration(): ?string | setDelayDuration(?string delayDuration): void | -| `autocomplete` | `?bool` | Optional | If set to `true`, this payment will be completed when possible. If
set to `false`, this payment is held in an approved state until either
explicitly completed (captured) or canceled (voided). For more information, see
[Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments).

Default: true | getAutocomplete(): ?bool | setAutocomplete(?bool autocomplete): void | +| `autocomplete` | `?bool` | Optional | If set to `true`, this payment will be completed when possible. If
set to `false`, this payment is held in an approved state until either
explicitly completed (captured) or canceled (voided). For more information, see
[Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment).

Default: true | getAutocomplete(): ?bool | setAutocomplete(?bool autocomplete): void | | `orderId` | `?string` | Optional | Associates a previously created order with this payment. | getOrderId(): ?string | setOrderId(?string orderId): void | -| `customerId` | `?string` | Optional | The [Customer](#type-customer) ID of the customer associated with the payment.

This is required if the `source_id` refers to a card on file created using the Customers API. | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `customerId` | `?string` | Optional | The [Customer](/doc/models/customer.md) ID of the customer associated with the payment.

This is required if the `source_id` refers to a card on file created using the Customers API. | getCustomerId(): ?string | setCustomerId(?string customerId): void | | `locationId` | `?string` | Optional | The location ID to associate with the payment. If not specified, the default location is
used. | getLocationId(): ?string | setLocationId(?string locationId): void | | `referenceId` | `?string` | Optional | A user-defined ID to associate with the payment.

You can use this field to associate the payment to an entity in an external system
(for example, you might specify an order ID that is generated by a third-party shopping cart).

Limit 40 characters.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `verificationToken` | `?string` | Optional | An identifying token generated by `SqPaymentForm.verifyBuyer()`.
Verification tokens encapsulate customer device information and 3-D Secure
challenge results to indicate that Square has verified the buyer identity.

For more information, see [SCA Overview](https://developer.squareup.com/docs/sca-overview). | getVerificationToken(): ?string | setVerificationToken(?string verificationToken): void | diff --git a/doc/models/create-payment-response.md b/doc/models/create-payment-response.md index f6a23e4f..41bf28f4 100644 --- a/doc/models/create-payment-response.md +++ b/doc/models/create-payment-response.md @@ -1,7 +1,7 @@ # Create Payment Response -Defines the response returned by [CreatePayment](#endpoint-payments-createpayment). +Defines the response returned by [CreatePayment](/doc/apis/payments.md#create-payment). If there are errors processing the request, the `payment` field might not be present, or it might be present with a status of `FAILED`. diff --git a/doc/models/create-refund-request.md b/doc/models/create-refund-request.md index 5d57208e..4a93d359 100644 --- a/doc/models/create-refund-request.md +++ b/doc/models/create-refund-request.md @@ -2,9 +2,9 @@ # Create Refund Request Defines the body parameters that can be included in -a request to the [CreateRefund](#endpoint-createrefund) endpoint. +a request to the [CreateRefund](/doc/apis/transactions.md#create-refund) endpoint. -Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) +Deprecated - recommend using [RefundPayment](/doc/apis/refunds.md#refund-payment) ## Structure @@ -14,8 +14,8 @@ Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
refund among refunds you've created for the tender.

If you're unsure whether a particular refund succeeded,
you can reattempt it with the same idempotency key without
worrying about duplicating the refund.

See [Idempotency keys](#idempotencykeys) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `tenderId` | `string` | Required | The ID of the tender to refund.

A [`Transaction`](#type-transaction) has one or more `tenders` (i.e., methods
of payment) associated with it, and you refund each tender separately with
the Connect API.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getTenderId(): string | setTenderId(string tenderId): void | +| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
refund among refunds you've created for the tender.

If you're unsure whether a particular refund succeeded,
you can reattempt it with the same idempotency key without
worrying about duplicating the refund.

See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | +| `tenderId` | `string` | Required | The ID of the tender to refund.

A [`Transaction`](/doc/models/transaction.md) has one or more `tenders` (i.e., methods
of payment) associated with it, and you refund each tender separately with
the Connect API.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getTenderId(): string | setTenderId(string tenderId): void | | `reason` | `?string` | Optional | A description of the reason for the refund.

Default value: `Refund via API`
**Constraints**: *Maximum Length*: `192` | getReason(): ?string | setReason(?string reason): void | | `amountMoney` | [`Money`](/doc/models/money.md) | Required | 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. | getAmountMoney(): Money | setAmountMoney(Money amountMoney): void | diff --git a/doc/models/create-refund-response.md b/doc/models/create-refund-response.md index 0ad0aa3d..faaaa25f 100644 --- a/doc/models/create-refund-response.md +++ b/doc/models/create-refund-response.md @@ -2,7 +2,7 @@ # Create Refund Response Defines the fields that are included in the response body of -a request to the [CreateRefund](#endpoint-createrefund) endpoint. +a request to the [CreateRefund](/doc/apis/transactions.md#create-refund) endpoint. One of `errors` or `refund` is present in a given response (never both). diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index e6854cc9..257b13b3 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -2,7 +2,7 @@ # Create Subscription Request Defines parameters in a -[CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint request. +[CreateSubscription](/doc/apis/subscriptions.md#create-subscription) endpoint request. ## Structure @@ -15,12 +15,12 @@ Defines parameters in a | `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateSubscription` request.
If you do not provide a unique string (or provide an empty string as the value),
the endpoint treats each request as independent.

For more information, see [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | | `locationId` | `string` | Required | The ID of the location the subscription is associated with.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | | `planId` | `string` | Required | The ID of the subscription plan. For more information, see
[Subscription Plan Overview](https://developer.squareup.com/docs/subscriptions/overview).
**Constraints**: *Minimum Length*: `1` | getPlanId(): string | setPlanId(string planId): void | -| `customerId` | `string` | Required | The ID of the [customer](#type-customer) profile.
**Constraints**: *Minimum Length*: `1` | getCustomerId(): string | setCustomerId(string customerId): void | +| `customerId` | `string` | Required | The ID of the [customer](/doc/models/customer.md) profile.
**Constraints**: *Minimum Length*: `1` | getCustomerId(): string | setCustomerId(string customerId): void | | `startDate` | `?string` | Optional | The start date of the subscription, in YYYY-MM-DD format. For example,
2013-01-15. If the start date is left empty, the subscription begins
immediately. | getStartDate(): ?string | setStartDate(?string startDate): void | | `canceledDate` | `?string` | Optional | The date when the subscription should be canceled, in
YYYY-MM-DD format (for example, 2025-02-29). This overrides the plan configuration
if it comes before the date the subscription would otherwise end. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | | `taxPercentage` | `?string` | Optional | The tax to add when billing the subscription.
The percentage is expressed in decimal form, using a `'.'` as the decimal
separator and without a `'%'` sign. For example, a value of 7.5
corresponds to 7.5%.
**Constraints**: *Maximum Length*: `10` | getTaxPercentage(): ?string | setTaxPercentage(?string taxPercentage): void | | `priceOverrideMoney` | [`?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. | getPriceOverrideMoney(): ?Money | setPriceOverrideMoney(?Money priceOverrideMoney): void | -| `cardId` | `?string` | Optional | The ID of the [customer](#type-customer) [card](#type-card) to charge.
If not specified, Square sends an invoice via email. For an example to
create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). | getCardId(): ?string | setCardId(?string cardId): void | +| `cardId` | `?string` | Optional | The ID of the [customer](/doc/models/customer.md) [card](/doc/models/card.md) to charge.
If not specified, Square sends an invoice via email. For an example to
create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). | getCardId(): ?string | setCardId(?string cardId): void | | `timezone` | `?string` | Optional | The timezone that is used in date calculations for the subscription. If unset, defaults to
the location timezone. If a timezone is not configured for the location, defaults to "America/New_York".
Format: the IANA Timezone Database identifier for the location timezone. For
a list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | getTimezone(): ?string | setTimezone(?string timezone): void | ## Example (as JSON) diff --git a/doc/models/create-subscription-response.md b/doc/models/create-subscription-response.md index c96c62ca..e8ba2b6e 100644 --- a/doc/models/create-subscription-response.md +++ b/doc/models/create-subscription-response.md @@ -2,7 +2,7 @@ # Create Subscription Response Defines the fields that are included in the response from the -[CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint. +[CreateSubscription](/doc/apis/subscriptions.md#create-subscription) endpoint. ## Structure diff --git a/doc/models/custom-attribute-filter.md b/doc/models/custom-attribute-filter.md index 851c787a..3c26bcac 100644 --- a/doc/models/custom-attribute-filter.md +++ b/doc/models/custom-attribute-filter.md @@ -2,7 +2,7 @@ # Custom Attribute Filter Supported custom attribute query expressions for calling the -[SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) +[SearchCatalogItems](/doc/apis/catalog.md#search-catalog-items) endpoint to search for items or item variations. ## Structure diff --git a/doc/models/customer-creation-source-filter.md b/doc/models/customer-creation-source-filter.md index a3e4ab51..d8882c94 100644 --- a/doc/models/customer-creation-source-filter.md +++ b/doc/models/customer-creation-source-filter.md @@ -1,11 +1,10 @@ # Customer Creation Source Filter -Creation source filter. +The creation source filter. If one or more creation sources are set, customer profiles are included in, -or excluded from, the result if they match at least one of the filter -criteria. +or excluded from, the result if they match at least one of the filter criteria. ## Structure diff --git a/doc/models/customer-creation-source.md b/doc/models/customer-creation-source.md index 53c41999..8a4997f5 100644 --- a/doc/models/customer-creation-source.md +++ b/doc/models/customer-creation-source.md @@ -11,23 +11,23 @@ Indicates the method used to create the customer profile. | Name | Description | | --- | --- | -| `OTHER` | Default creation source. Typically used for backward/future
compatibility when the original source of a customer profile is
unrecognized. For example, when older clients do not support newer
source types. | -| `APPOINTMENTS` | Customer profile created automatically when an appointment
was scheduled. | -| `COUPON` | Customer profile created automatically when a coupon was issued
using Square Point of Sale. | -| `DELETION_RECOVERY` | Customer profile restored through Square's deletion recovery
process. | -| `DIRECTORY` | Customer profile created manually through Square Dashboard or
Point of Sale application. | -| `EGIFTING` | Customer profile created automatically when a gift card was
issued using Square Point of Sale. Customer profiles are created for
both the purchaser and the recipient of the gift card. | -| `EMAIL_COLLECTION` | Customer profile created through Square Point of Sale when
signing up for marketing emails during checkout. | -| `FEEDBACK` | Customer profile created automatically when providing feedback
through a digital receipt. | -| `IMPORT` | Customer profile created automatically when importing customer
data through Square Dashboard. | -| `INVOICES` | Customer profile created automatically during an invoice payment. | -| `LOYALTY` | Customer profile created automatically when customers provide a
phone number for loyalty reward programs during checkout. | -| `MARKETING` | Customer profile created as the result of a campaign managed
through Square’s Facebook integration. | -| `MERGE` | Customer profile created as the result of explicitly merging
multiple customer profiles through the Square Dashboard or Point of
Sale application. | -| `ONLINE_STORE` | Customer profile created through Square's Online Store solution
(legacy service). | -| `INSTANT_PROFILE` | Customer profile created automatically as the result of a successful
transaction that did not explicitly link to an existing customer profile. | -| `TERMINAL` | Customer profile created through Square's Virtual Terminal. | -| `THIRD_PARTY` | Customer profile created through a Square API call. | -| `THIRD_PARTY_IMPORT` | Customer profile created by a third-party product and imported
through an official integration. | -| `UNMERGE_RECOVERY` | Customer profile restored through Square's unmerge recovery
process. | +| `OTHER` | The default creation source. This source is typically used for backward/future
compatibility when the original source of a customer profile is
unrecognized. For example, when older clients do not support newer
source types. | +| `APPOINTMENTS` | The customer profile was created automatically when an appointment
was scheduled. | +| `COUPON` | The customer profile was created automatically when a coupon was issued
using Square Point of Sale. | +| `DELETION_RECOVERY` | The customer profile was restored through Square's deletion recovery
process. | +| `DIRECTORY` | The customer profile was created manually through Square Seller Dashboard or the
Point of Sale application. | +| `EGIFTING` | The customer profile was created automatically when a gift card was
issued using Square Point of Sale. Customer profiles are created for
both the buyer and the recipient of the gift card. | +| `EMAIL_COLLECTION` | The customer profile was created through Square Point of Sale when
signing up for marketing emails during checkout. | +| `FEEDBACK` | The customer profile was created automatically when providing feedback
through a digital receipt. | +| `IMPORT` | The customer profile was created automatically when importing customer
data through Square Seller Dashboard. | +| `INVOICES` | The customer profile was created automatically during an invoice payment. | +| `LOYALTY` | The customer profile was created automatically when customers provide a
phone number for loyalty reward programs during checkout. | +| `MARKETING` | The customer profile was created as the result of a campaign managed
through Square’s Facebook integration. | +| `MERGE` | The customer profile was created as the result of explicitly merging
multiple customer profiles through the Square Seller Dashboard or the Point of
Sale application. | +| `ONLINE_STORE` | The customer profile was created through Square's Online Store solution
(legacy service). | +| `INSTANT_PROFILE` | The customer profile was created automatically as the result of a successful
transaction that did not explicitly link to an existing customer profile. | +| `TERMINAL` | The customer profile was created through Square's Virtual Terminal. | +| `THIRD_PARTY` | The customer profile was created through a Square API call. | +| `THIRD_PARTY_IMPORT` | The customer profile was created by a third-party product and imported
through an official integration. | +| `UNMERGE_RECOVERY` | The customer profile was restored through Square's unmerge recovery
process. | diff --git a/doc/models/customer-filter.md b/doc/models/customer-filter.md index ee9acd18..eb5497ba 100644 --- a/doc/models/customer-filter.md +++ b/doc/models/customer-filter.md @@ -12,12 +12,12 @@ Represents a set of `CustomerQuery` filters used to limit the set of | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `creationSource` | [`?CustomerCreationSourceFilter`](/doc/models/customer-creation-source-filter.md) | Optional | Creation source filter.

If one or more creation sources are set, customer profiles are included in,
or excluded from, the result if they match at least one of the filter
criteria. | getCreationSource(): ?CustomerCreationSourceFilter | setCreationSource(?CustomerCreationSourceFilter creationSource): void | +| `creationSource` | [`?CustomerCreationSourceFilter`](/doc/models/customer-creation-source-filter.md) | Optional | The creation source filter.

If one or more creation sources are set, customer profiles are included in,
or excluded from, the result if they match at least one of the filter criteria. | getCreationSource(): ?CustomerCreationSourceFilter | setCreationSource(?CustomerCreationSourceFilter creationSource): void | | `createdAt` | [`?TimeRange`](/doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getCreatedAt(): ?TimeRange | setCreatedAt(?TimeRange createdAt): void | | `updatedAt` | [`?TimeRange`](/doc/models/time-range.md) | Optional | Represents a generic time range. The start and end values are
represented in RFC 3339 format. Time ranges are customized to be
inclusive or exclusive based on the needs of a particular endpoint.
Refer to the relevant endpoint-specific documentation to determine
how time ranges are handled. | getUpdatedAt(): ?TimeRange | setUpdatedAt(?TimeRange updatedAt): void | -| `emailAddress` | [`?CustomerTextFilter`](/doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on customer attributes,
the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. | getEmailAddress(): ?CustomerTextFilter | setEmailAddress(?CustomerTextFilter emailAddress): void | -| `phoneNumber` | [`?CustomerTextFilter`](/doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on customer attributes,
the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. | getPhoneNumber(): ?CustomerTextFilter | setPhoneNumber(?CustomerTextFilter phoneNumber): void | -| `referenceId` | [`?CustomerTextFilter`](/doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on customer attributes,
the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. | getReferenceId(): ?CustomerTextFilter | setReferenceId(?CustomerTextFilter referenceId): void | +| `emailAddress` | [`?CustomerTextFilter`](/doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getEmailAddress(): ?CustomerTextFilter | setEmailAddress(?CustomerTextFilter emailAddress): void | +| `phoneNumber` | [`?CustomerTextFilter`](/doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. | getPhoneNumber(): ?CustomerTextFilter | setPhoneNumber(?CustomerTextFilter phoneNumber): void | +| `referenceId` | [`?CustomerTextFilter`](/doc/models/customer-text-filter.md) | Optional | A filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
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
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field. | getGroupIds(): ?FilterValue | setGroupIds(?FilterValue groupIds): void | ## Example (as JSON) diff --git a/doc/models/customer-group-info.md b/doc/models/customer-group-info.md deleted file mode 100644 index 32b52528..00000000 --- a/doc/models/customer-group-info.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Customer Group Info - -Contains some brief information about a Customer Group with its identifier included. - -## Structure - -`CustomerGroupInfo` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `id` | `string` | Required | The ID of the Customer Group. | getId(): string | setId(string id): void | -| `name` | `string` | Required | The name of the Customer Group. | getName(): string | setName(string name): void | - -## Example (as JSON) - -```json -{ - "id": "id0", - "name": "name0" -} -``` - diff --git a/doc/models/customer-group.md b/doc/models/customer-group.md index e2829a89..c7d84ae6 100644 --- a/doc/models/customer-group.md +++ b/doc/models/customer-group.md @@ -3,8 +3,8 @@ Represents a group of customer profiles. -Customer groups can be created, modified, and have their membership defined either via -the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. +Customer groups can be created, be modified, and have their membership defined using +the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. ## Structure @@ -14,8 +14,8 @@ the Customers API or within Customer Directory in the Square Dashboard or Point | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | Unique Square-generated ID for the customer group.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `name` | `string` | Required | Name of the customer group. | getName(): string | setName(string name): void | +| `id` | `?string` | Optional | A unique Square-generated ID for the customer group.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | +| `name` | `string` | Required | The name of the customer group. | getName(): string | setName(string name): void | | `createdAt` | `?string` | Optional | The timestamp when the customer group was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | The timestamp when the customer group was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | diff --git a/doc/models/customer-preferences.md b/doc/models/customer-preferences.md index 9107c36a..fda0d22c 100644 --- a/doc/models/customer-preferences.md +++ b/doc/models/customer-preferences.md @@ -11,7 +11,7 @@ Represents communication preferences for the customer profile. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `emailUnsubscribed` | `?bool` | Optional | The customer has unsubscribed from receiving marketing campaign emails. | getEmailUnsubscribed(): ?bool | setEmailUnsubscribed(?bool emailUnsubscribed): void | +| `emailUnsubscribed` | `?bool` | Optional | Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` means that the customer chose to opt out of email marketing from the current Square seller or from all Square sellers. This value is read-only from the Customers API. | getEmailUnsubscribed(): ?bool | setEmailUnsubscribed(?bool emailUnsubscribed): void | ## Example (as JSON) diff --git a/doc/models/customer-segment.md b/doc/models/customer-segment.md index 0daa04b9..64cacd89 100644 --- a/doc/models/customer-segment.md +++ b/doc/models/customer-segment.md @@ -3,7 +3,8 @@ Represents a group of customer profiles that match one or more predefined filter criteria. -Segments (also known as Smart Groups) are defined and created within Customer Directory in the Square Dashboard or Point of Sale. +Segments (also known as Smart Groups) are defined and created within the Customer Directory in the +Square Seller Dashboard or Point of Sale. ## Structure @@ -13,8 +14,8 @@ Segments (also known as Smart Groups) are defined and created within Customer Di | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | Unique Square-generated ID for the segment.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | -| `name` | `string` | Required | Name of the segment. | getName(): string | setName(string name): void | +| `id` | `?string` | Optional | A unique Square-generated ID for the segment.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | +| `name` | `string` | Required | The name of the segment. | getName(): string | setName(string name): void | | `createdAt` | `?string` | Optional | The timestamp when the segment was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | The timestamp when the segment was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | diff --git a/doc/models/customer-text-filter.md b/doc/models/customer-text-filter.md index 8d9ea3ef..220399a8 100644 --- a/doc/models/customer-text-filter.md +++ b/doc/models/customer-text-filter.md @@ -2,8 +2,8 @@ # Customer Text Filter A filter to select customers based on exact or fuzzy matching of -customer attributes against a specified query. Depending on customer attributes, -the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. +customer attributes against a specified query. Depending on the customer attributes, +the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. ## Structure diff --git a/doc/models/customer.md b/doc/models/customer.md index be50f5a1..a653dae8 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -15,7 +15,7 @@ cards on file associated with it. | `id` | `?string` | Optional | A unique Square-assigned ID for the customer profile. | getId(): ?string | setId(?string id): void | | `createdAt` | `?string` | Optional | The timestamp when the customer profile was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | The timestamp when the customer profile was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `cards` | [`?(Card[])`](/doc/models/card.md) | Optional | Payment details of cards stored on file for the customer profile. | getCards(): ?array | setCards(?array cards): void | +| `cards` | [`?(Card[])`](/doc/models/card.md) | Optional | Payment details of the credit, debit, and gift cards stored on file for the customer profile. | getCards(): ?array | setCards(?array cards): void | | `givenName` | `?string` | Optional | The given (i.e., first) name associated with the customer profile. | getGivenName(): ?string | setGivenName(?string givenName): void | | `familyName` | `?string` | Optional | The family (i.e., last) name associated with the customer profile. | getFamilyName(): ?string | setFamilyName(?string familyName): void | | `nickname` | `?string` | Optional | A nickname for the customer profile. | getNickname(): ?string | setNickname(?string nickname): void | @@ -23,14 +23,14 @@ cards on file associated with it. | `emailAddress` | `?string` | Optional | The email address associated with the customer profile. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | | `address` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getAddress(): ?Address | setAddress(?Address address): void | | `phoneNumber` | `?string` | Optional | The 11-digit phone number associated with the customer profile. | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in RFC 3339 format.
Year is optional, timezone and times are not allowed.
For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st.
`1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. | getBirthday(): ?string | setBirthday(?string birthday): void | -| `referenceId` | `?string` | Optional | An optional, second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | +| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The timezone and time are not allowed.
For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00:00-00:00` represents a birthday on September 21, 1998. | getBirthday(): ?string | setBirthday(?string birthday): void | +| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `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 | -| `groups` | [`?(CustomerGroupInfo[])`](/doc/models/customer-group-info.md) | Optional | The customer groups and segments the customer belongs to. This deprecated field has been replaced with the dedicated `group_ids` for customer groups and the dedicated `segment_ids` field for customer segments. You can retrieve information about a given customer group and segment respectively using the Customer Groups API and Customer Segments API. | getGroups(): ?array | setGroups(?array groups): 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 | +| `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 | ## Example (as JSON) diff --git a/doc/models/delete-customer-card-response.md b/doc/models/delete-customer-card-response.md index e4dfe3cd..7e6f778d 100644 --- a/doc/models/delete-customer-card-response.md +++ b/doc/models/delete-customer-card-response.md @@ -2,7 +2,7 @@ # Delete Customer Card Response Defines the fields that are included in the response body of -a request to the DeleteCustomerCard endpoint. +a request to the `DeleteCustomerCard` endpoint. ## Structure diff --git a/doc/models/delete-customer-group-response.md b/doc/models/delete-customer-group-response.md index ff129f4f..da5dcfd1 100644 --- a/doc/models/delete-customer-group-response.md +++ b/doc/models/delete-customer-group-response.md @@ -2,7 +2,7 @@ # Delete Customer Group Response Defines the fields that are included in the response body of -a request to the [DeleteCustomerGroup](#endpoint-deletecustomergroup) endpoint. +a request to the [DeleteCustomerGroup](/doc/apis/customer-groups.md#delete-customer-group) endpoint. ## Structure diff --git a/doc/models/delete-customer-request.md b/doc/models/delete-customer-request.md new file mode 100644 index 00000000..eb7ede69 --- /dev/null +++ b/doc/models/delete-customer-request.md @@ -0,0 +1,24 @@ + +# Delete Customer Request + +Defines the fields that are included in a request to the `DeleteCustomer` +endpoint. + +## Structure + +`DeleteCustomerRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `version` | `?int` | Optional | The current version of the customer profile.

As a best practice, you should include this parameter to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. For more information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile). | getVersion(): ?int | setVersion(?int version): void | + +## Example (as JSON) + +```json +{ + "version": 172 +} +``` + diff --git a/doc/models/delete-customer-response.md b/doc/models/delete-customer-response.md index 6e009bc1..f0a11dcd 100644 --- a/doc/models/delete-customer-response.md +++ b/doc/models/delete-customer-response.md @@ -2,7 +2,7 @@ # Delete Customer Response Defines the fields that are included in the response body of -a request to the DeleteCustomer endpoint. +a request to the `DeleteCustomer` endpoint. ## Structure diff --git a/doc/models/delete-invoice-request.md b/doc/models/delete-invoice-request.md index 56d218a8..7dc4e2f7 100644 --- a/doc/models/delete-invoice-request.md +++ b/doc/models/delete-invoice-request.md @@ -11,7 +11,7 @@ Describes a `DeleteInvoice` request. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `version` | `?int` | Optional | The version of the [invoice](#type-invoice) to delete.
If you do not know the version, you can call [GetInvoice](#endpoint-Invoices-GetInvoice) or
[ListInvoices](#endpoint-Invoices-ListInvoices). | getVersion(): ?int | setVersion(?int version): void | +| `version` | `?int` | Optional | The version of the [invoice](/doc/models/invoice.md) to delete.
If you do not know the version, you can call [GetInvoice](/doc/apis/invoices.md#get-invoice) or
[ListInvoices](/doc/apis/invoices.md#list-invoices). | getVersion(): ?int | setVersion(?int version): void | ## Example (as JSON) diff --git a/doc/models/dispute-evidence.md b/doc/models/dispute-evidence.md index cf036100..2440676c 100644 --- a/doc/models/dispute-evidence.md +++ b/doc/models/dispute-evidence.md @@ -11,6 +11,8 @@ | --- | --- | --- | --- | --- | --- | | `evidenceId` | `?string` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getEvidenceId(): ?string | setEvidenceId(?string evidenceId): void | | `disputeId` | `?string` | Optional | The ID of the dispute the evidence is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getDisputeId(): ?string | setDisputeId(?string disputeId): void | +| `evidenceFile` | [`?DisputeEvidenceFile`](/doc/models/dispute-evidence-file.md) | Optional | A file to be uploaded as dispute evidence. | getEvidenceFile(): ?DisputeEvidenceFile | setEvidenceFile(?DisputeEvidenceFile evidenceFile): void | +| `evidenceText` | `?string` | Optional | Raw text
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | getEvidenceText(): ?string | setEvidenceText(?string evidenceText): void | | `uploadedAt` | `?string` | Optional | The time when the next action is due, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getUploadedAt(): ?string | setUploadedAt(?string uploadedAt): void | | `evidenceType` | [`?string (DisputeEvidenceType)`](/doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | getEvidenceType(): ?string | setEvidenceType(?string evidenceType): void | @@ -20,8 +22,12 @@ { "evidence_id": "evidence_id2", "dispute_id": "dispute_id2", - "uploaded_at": "uploaded_at4", - "evidence_type": "RECEIPT" + "evidence_file": { + "filename": "filename8", + "filetype": "filetype8" + }, + "evidence_text": "evidence_text6", + "uploaded_at": "uploaded_at4" } ``` diff --git a/doc/models/employee-wage.md b/doc/models/employee-wage.md index 27b905de..7dac0fe8 100644 --- a/doc/models/employee-wage.md +++ b/doc/models/employee-wage.md @@ -2,7 +2,7 @@ # Employee Wage The hourly wage rate that an employee will earn on a `Shift` for doing the job -specified by the `title` property of this object. Deprecated at verison 2020-08-26. Use `TeamMemberWage` instead. +specified by the `title` property of this object. Deprecated at version 2020-08-26. Use `TeamMemberWage` instead. ## Structure diff --git a/doc/models/error-code.md b/doc/models/error-code.md index 5b53ce69..abae729a 100644 --- a/doc/models/error-code.md +++ b/doc/models/error-code.md @@ -69,10 +69,10 @@ Square API. | `UNSUPPORTED_ENTRY_METHOD` | The entry method for the credit card (swipe, dip, tap) is not supported. | | `INVALID_ENCRYPTED_CARD` | The encrypted card information is invalid. | | `INVALID_CARD` | The credit card cannot be validated based on the provided details. | -| `GENERIC_DECLINE` | Square received a decline from the cardholder's bank without any
additional information. If the card information seems correct, the card
holder can contact their card issuer to ask for more information. | +| `GENERIC_DECLINE` | Square received a decline without any additional information.
If the payment information seems correct, the buyer can contact their
issuer to ask for more information. | | `CVV_FAILURE` | The card issuer declined the request because the CVV value is invalid. | | `ADDRESS_VERIFICATION_FAILURE` | The card issuer declined the request because the postal code is invalid. | -| `INVALID_ACCOUNT` | The card issuer was not able to locate account on record. | +| `INVALID_ACCOUNT` | The issuer was not able to locate the account on record. | | `CURRENCY_MISMATCH` | The currency associated with the payment is not valid for the provided
funding source. For example, a gift card funded in USD cannot be used to process
payments in GBP. | | `INSUFFICIENT_FUNDS` | The funding source has insufficient funds to cover the payment. | | `INSUFFICIENT_PERMISSIONS` | The Square account does not have the permissions to accept
this payment. For example, Square may limit which merchants are
allowed to receive gift card payments. | @@ -82,13 +82,15 @@ Square API. | `VOICE_FAILURE` | The card issuer declined the request because the issuer requires voice authorization from the cardholder. | | `PAN_FAILURE` | The specified card number is invalid. For example, it is of
incorrect length or is incorrectly formatted. | | `EXPIRATION_FAILURE` | The card expiration date is either invalid or indicates that the
card is expired. | -| `CARD_NOT_SUPPORTED` | The card is not supported either in the geographic region or by
the MCC [merchant category code](https://developer.squareup.com/docs/api/connect/v2#navsection-connectapibasics) | +| `CARD_NOT_SUPPORTED` | The card is not supported either in the geographic region or by
the [merchant category code](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) (MCC). | | `INVALID_PIN` | The card issuer declined the request because the PIN is invalid. | | `INVALID_POSTAL_CODE` | The postal code is incorrectly formatted. | | `INVALID_FEES` | The app_fee_money on a payment is too high. | | `MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED` | The card must be swiped, tapped, or dipped. Payments attempted by manually entering the card number are declined. | | `PAYMENT_LIMIT_EXCEEDED` | Square declined the request because the payment amount exceeded the processing limit for this merchant. | | `GIFT_CARD_AVAILABLE_AMOUNT` | When a Gift Card is a payment source, you can allow taking a partial payment
by adding the `accept_partial_authorization` parameter in the request.
However, taking such a partial payment does not work if your request also includes
`tip_money`, `app_fee_money`, or both. Square declines such payments and returns
the `GIFT_CARD_AVAILABLE_AMOUNT` error.
For more information, see
[CreatePayment errors (additional information)](https://developer.squareup.com/docs/payments-api/error-codes#createpayment-errors-additional-information). | +| `ACCOUNT_UNUSABLE` | The account provided cannot carry out transactions. | +| `BUYER_REFUSED_PAYMENT` | Bank account rejected or was not authorized for the payment. | | `DELAYED_TRANSACTION_EXPIRED` | The application tried to update a delayed-capture payment that has expired. | | `DELAYED_TRANSACTION_CANCELED` | The application tried to cancel a delayed-capture payment that was already cancelled. | | `DELAYED_TRANSACTION_CAPTURED` | The application tried to capture a delayed-capture payment that was already captured. | diff --git a/doc/models/error.md b/doc/models/error.md index 8ecf1a0e..f31fa7dc 100644 --- a/doc/models/error.md +++ b/doc/models/error.md @@ -3,7 +3,7 @@ Represents an error encountered during a request to the Connect API. -See [Handling errors](#handlingerrors) for more information. +See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. ## Structure @@ -23,7 +23,7 @@ See [Handling errors](#handlingerrors) for more information. ```json { "category": "INVALID_REQUEST_ERROR", - "code": "ACCESS_TOKEN_EXPIRED", + "code": "CARD_DECLINED_CALL_ISSUER", "detail": "detail6", "field": "field6" } diff --git a/doc/models/get-employee-wage-response.md b/doc/models/get-employee-wage-response.md index aaa04290..647e8369 100644 --- a/doc/models/get-employee-wage-response.md +++ b/doc/models/get-employee-wage-response.md @@ -13,7 +13,7 @@ the request resulted in errors. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `employeeWage` | [`?EmployeeWage`](/doc/models/employee-wage.md) | Optional | The hourly wage rate that an employee will earn on a `Shift` for doing the job
specified by the `title` property of this object. Deprecated at verison 2020-08-26. Use `TeamMemberWage` instead. | getEmployeeWage(): ?EmployeeWage | setEmployeeWage(?EmployeeWage employeeWage): void | +| `employeeWage` | [`?EmployeeWage`](/doc/models/employee-wage.md) | Optional | The hourly wage rate that an employee will earn on a `Shift` for doing the job
specified by the `title` property of this object. Deprecated at version 2020-08-26. Use `TeamMemberWage` instead. | getEmployeeWage(): ?EmployeeWage | setEmployeeWage(?EmployeeWage employeeWage): void | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | ## Example (as JSON) diff --git a/doc/models/get-invoice-response.md b/doc/models/get-invoice-response.md index ff185946..5aaff4c3 100644 --- a/doc/models/get-invoice-response.md +++ b/doc/models/get-invoice-response.md @@ -19,6 +19,11 @@ Describes a `GetInvoice` response. ```json { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/get-payment-refund-response.md b/doc/models/get-payment-refund-response.md index d845ec23..d9a81222 100644 --- a/doc/models/get-payment-refund-response.md +++ b/doc/models/get-payment-refund-response.md @@ -1,7 +1,7 @@ # Get Payment Refund Response -Defines the response returned by [GetRefund](#endpoint-refunds-getpaymentrefund). +Defines the response returned by [GetRefund](/doc/apis/refunds.md#get-payment-refund). Note: If there are errors processing the request, the refund field might not be present or it might be present in a FAILED state. diff --git a/doc/models/get-payment-response.md b/doc/models/get-payment-response.md index 2e0e1956..3b87ad4a 100644 --- a/doc/models/get-payment-response.md +++ b/doc/models/get-payment-response.md @@ -1,7 +1,7 @@ # Get Payment Response -Defines the response returned by [GetPayment](#endpoint-payments-getpayment). +Defines the response returned by [GetPayment](/doc/apis/payments.md#get-payment). ## Structure diff --git a/doc/models/inventory-adjustment.md b/doc/models/inventory-adjustment.md index ac8624e8..ee805493 100644 --- a/doc/models/inventory-adjustment.md +++ b/doc/models/inventory-adjustment.md @@ -16,7 +16,7 @@ particular time and location. | `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
`InventoryAdjustment` to an external
system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `fromState` | [`?string (InventoryState)`](/doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getFromState(): ?string | setFromState(?string fromState): void | | `toState` | [`?string (InventoryState)`](/doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getToState(): ?string | setToState(?string toState): void | -| `locationId` | `?string` | Optional | The Square ID of the [Location](#type-location) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | +| `locationId` | `?string` | Optional | The Square ID of the [Location](/doc/models/location.md) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | | `catalogObjectId` | `?string` | Optional | The Square generated ID of the
`CatalogObject` being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `catalogObjectType` | `?string` | Optional | The `CatalogObjectType` of the
`CatalogObject` being tracked. Tracking is only
supported for the `ITEM_VARIATION` type.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | | `quantity` | `?string` | Optional | The number of items affected by the adjustment as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | @@ -24,7 +24,7 @@ particular time and location. | `occurredAt` | `?string` | Optional | A client-generated timestamp in RFC 3339 format that indicates when
the adjustment took place. For write actions, the `occurred_at`
timestamp cannot be older than 24 hours or in the future relative to the
time of the request.
**Constraints**: *Maximum Length*: `34` | getOccurredAt(): ?string | setOccurredAt(?string occurredAt): void | | `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format that indicates when Square
received the adjustment.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `source` | [`?SourceApplication`](/doc/models/source-application.md) | Optional | Provides information about the application used to generate a change. | getSource(): ?SourceApplication | setSource(?SourceApplication source): void | -| `employeeId` | `?string` | Optional | The Square ID of the [Employee](#type-employee) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | +| `employeeId` | `?string` | Optional | The Square ID of the [Employee](/doc/models/employee.md) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | | `transactionId` | `?string` | Optional | The read-only Square ID of the [Transaction][#type-transaction] that
caused the adjustment. Only relevant for payment-related state
transitions.
**Constraints**: *Maximum Length*: `255` | getTransactionId(): ?string | setTransactionId(?string transactionId): void | | `refundId` | `?string` | Optional | The read-only Square ID of the [Refund][#type-refund] that
caused the adjustment. Only relevant for refund-related state
transitions.
**Constraints**: *Maximum Length*: `255` | getRefundId(): ?string | setRefundId(?string refundId): void | | `purchaseOrderId` | `?string` | Optional | The read-only Square ID of the purchase order that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | getPurchaseOrderId(): ?string | setPurchaseOrderId(?string purchaseOrderId): void | diff --git a/doc/models/inventory-change.md b/doc/models/inventory-change.md index 41de5e1d..40df97fb 100644 --- a/doc/models/inventory-change.md +++ b/doc/models/inventory-change.md @@ -17,6 +17,8 @@ that is part of the history of inventory changes for a particular | `physicalCount` | [`?InventoryPhysicalCount`](/doc/models/inventory-physical-count.md) | Optional | Represents the quantity of an item variation that is physically present
at a specific location, verified by a seller or a seller's employee. For example,
a physical count might come from an employee counting the item variations on
hand or from syncing with an external system. | getPhysicalCount(): ?InventoryPhysicalCount | setPhysicalCount(?InventoryPhysicalCount physicalCount): void | | `adjustment` | [`?InventoryAdjustment`](/doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | getAdjustment(): ?InventoryAdjustment | setAdjustment(?InventoryAdjustment adjustment): void | | `transfer` | [`?InventoryTransfer`](/doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | getTransfer(): ?InventoryTransfer | setTransfer(?InventoryTransfer transfer): void | +| `measurementUnit` | [`?CatalogMeasurementUnit`](/doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | getMeasurementUnit(): ?CatalogMeasurementUnit | setMeasurementUnit(?CatalogMeasurementUnit measurementUnit): void | +| `measurementUnitId` | `?string` | Optional | The ID of the [CatalogMeasurementUnit](/doc/models/catalog-measurement-unit.md) object representing the catalog measurement unit associated with the inventory change. | getMeasurementUnitId(): ?string | setMeasurementUnitId(?string measurementUnitId): void | ## Example (as JSON) @@ -43,6 +45,19 @@ that is part of the history of inventory changes for a particular "state": "RESERVED_FOR_SALE", "from_location_id": "from_location_id0", "to_location_id": "to_location_id0" + }, + "measurement_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_SQUARE_MILE", + "length_unit": "METRIC_MILLIMETER", + "volume_unit": "GENERIC_CUP", + "weight_unit": "IMPERIAL_STONE" + }, + "precision": 184 } } ``` diff --git a/doc/models/inventory-count.md b/doc/models/inventory-count.md index f66ce93b..d1e2f4aa 100644 --- a/doc/models/inventory-count.md +++ b/doc/models/inventory-count.md @@ -16,7 +16,7 @@ inventory adjustments. | `catalogObjectId` | `?string` | Optional | The Square generated ID of the
`CatalogObject` being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `catalogObjectType` | `?string` | Optional | The `CatalogObjectType` of the
`CatalogObject` being tracked. Tracking is only
supported for the `ITEM_VARIATION` type.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | | `state` | [`?string (InventoryState)`](/doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getState(): ?string | setState(?string state): void | -| `locationId` | `?string` | Optional | The Square ID of the [Location](#type-location) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | +| `locationId` | `?string` | Optional | The Square ID of the [Location](/doc/models/location.md) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | | `quantity` | `?string` | Optional | The number of items affected by the estimated count as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | | `calculatedAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format that indicates when Square
received the most recent physical count or adjustment that had an affect
on the estimated count.
**Constraints**: *Maximum Length*: `34` | getCalculatedAt(): ?string | setCalculatedAt(?string calculatedAt): void | diff --git a/doc/models/inventory-physical-count.md b/doc/models/inventory-physical-count.md index 8f2609ea..24450b49 100644 --- a/doc/models/inventory-physical-count.md +++ b/doc/models/inventory-physical-count.md @@ -14,15 +14,15 @@ hand or from syncing with an external system. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `id` | `?string` | Optional | A unique ID generated by Square for the
[InventoryPhysicalCount](#type-inventoryphysicalcount).
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | -| `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
[InventoryPhysicalCount](#type-inventoryphysicalcount) to an external
system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | +| `id` | `?string` | Optional | A unique ID generated by Square for the
[InventoryPhysicalCount](/doc/models/inventory-physical-count.md).
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | +| `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
[InventoryPhysicalCount](/doc/models/inventory-physical-count.md) to an external
system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `catalogObjectId` | `?string` | Optional | The Square generated ID of the
`CatalogObject` being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `catalogObjectType` | `?string` | Optional | The `CatalogObjectType` of the
`CatalogObject` being tracked. Tracking is only
supported for the `ITEM_VARIATION` type.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | | `state` | [`?string (InventoryState)`](/doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getState(): ?string | setState(?string state): void | -| `locationId` | `?string` | Optional | The Square ID of the [Location](#type-location) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | +| `locationId` | `?string` | Optional | The Square ID of the [Location](/doc/models/location.md) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | | `quantity` | `?string` | Optional | The number of items affected by the physical count as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | | `source` | [`?SourceApplication`](/doc/models/source-application.md) | Optional | Provides information about the application used to generate a change. | getSource(): ?SourceApplication | setSource(?SourceApplication source): void | -| `employeeId` | `?string` | Optional | The Square ID of the [Employee](#type-employee) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | +| `employeeId` | `?string` | Optional | The Square ID of the [Employee](/doc/models/employee.md) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | | `occurredAt` | `?string` | Optional | A client-generated timestamp in RFC 3339 format that indicates when
the physical count took place. For write actions, the `occurred_at`
timestamp cannot be older than 24 hours or in the future relative to the
time of the request.
**Constraints**: *Maximum Length*: `34` | getOccurredAt(): ?string | setOccurredAt(?string occurredAt): void | | `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format that indicates when Square
received the physical count.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | diff --git a/doc/models/inventory-transfer.md b/doc/models/inventory-transfer.md index c627dbdd..eb00cb93 100644 --- a/doc/models/inventory-transfer.md +++ b/doc/models/inventory-transfer.md @@ -15,15 +15,15 @@ particular time from one location to another. | `id` | `?string` | Optional | A unique ID generated by Square for the
`InventoryTransfer`.
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | | `referenceId` | `?string` | Optional | An optional ID provided by the application to tie the
`InventoryTransfer` to an external system.
**Constraints**: *Maximum Length*: `255` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `state` | [`?string (InventoryState)`](/doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | getState(): ?string | setState(?string state): void | -| `fromLocationId` | `?string` | Optional | The Square ID of the [Location](#type-location) where the related
quantity of items were tracked before the transfer.
**Constraints**: *Maximum Length*: `100` | getFromLocationId(): ?string | setFromLocationId(?string fromLocationId): void | -| `toLocationId` | `?string` | Optional | The Square ID of the [Location](#type-location) where the related
quantity of items were tracked after the transfer.
**Constraints**: *Maximum Length*: `100` | getToLocationId(): ?string | setToLocationId(?string toLocationId): void | +| `fromLocationId` | `?string` | Optional | The Square ID of the [Location](/doc/models/location.md) where the related
quantity of items were tracked before the transfer.
**Constraints**: *Maximum Length*: `100` | getFromLocationId(): ?string | setFromLocationId(?string fromLocationId): void | +| `toLocationId` | `?string` | Optional | The Square ID of the [Location](/doc/models/location.md) where the related
quantity of items were tracked after the transfer.
**Constraints**: *Maximum Length*: `100` | getToLocationId(): ?string | setToLocationId(?string toLocationId): void | | `catalogObjectId` | `?string` | Optional | The Square generated ID of the
`CatalogObject` being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `catalogObjectType` | `?string` | Optional | The `CatalogObjectType` of the
`CatalogObject` being tracked.Tracking is only
supported for the `ITEM_VARIATION` type.
**Constraints**: *Maximum Length*: `14` | getCatalogObjectType(): ?string | setCatalogObjectType(?string catalogObjectType): void | | `quantity` | `?string` | Optional | The number of items affected by the transfer as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | getQuantity(): ?string | setQuantity(?string quantity): void | | `occurredAt` | `?string` | Optional | A client-generated timestamp in RFC 3339 format that indicates when
the transfer took place. For write actions, the `occurred_at` timestamp
cannot be older than 24 hours or in the future relative to the time of the
request.
**Constraints**: *Maximum Length*: `34` | getOccurredAt(): ?string | setOccurredAt(?string occurredAt): void | | `createdAt` | `?string` | Optional | A read-only timestamp in RFC 3339 format that indicates when Square
received the transfer request.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `source` | [`?SourceApplication`](/doc/models/source-application.md) | Optional | Provides information about the application used to generate a change. | getSource(): ?SourceApplication | setSource(?SourceApplication source): void | -| `employeeId` | `?string` | Optional | The Square ID of the [Employee](#type-employee) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | +| `employeeId` | `?string` | Optional | The Square ID of the [Employee](/doc/models/employee.md) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | ## Example (as JSON) diff --git a/doc/models/invoice-accepted-payment-methods.md b/doc/models/invoice-accepted-payment-methods.md new file mode 100644 index 00000000..4af099eb --- /dev/null +++ b/doc/models/invoice-accepted-payment-methods.md @@ -0,0 +1,27 @@ + +# Invoice Accepted Payment Methods + +The payment methods that customers can use to pay an invoice on the Square-hosted invoice page. + +## Structure + +`InvoiceAcceptedPaymentMethods` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `card` | `?bool` | Optional | Indicates whether credit card or debit card payments are accepted. The default value is `false`. | getCard(): ?bool | setCard(?bool card): void | +| `squareGiftCard` | `?bool` | Optional | Indicates whether Square gift card payments are accepted. The default value is `false`. | getSquareGiftCard(): ?bool | setSquareGiftCard(?bool squareGiftCard): void | +| `bankAccount` | `?bool` | Optional | Indicates whether bank transfer payments are accepted. The default value is `false`.

This option is allowed only for invoices that have a single payment request of type `BALANCE`. | getBankAccount(): ?bool | setBankAccount(?bool bankAccount): void | + +## Example (as JSON) + +```json +{ + "card": false, + "square_gift_card": false, + "bank_account": false +} +``` + diff --git a/doc/models/invoice-automatic-payment-source.md b/doc/models/invoice-automatic-payment-source.md index e3c1d944..b28f0565 100644 --- a/doc/models/invoice-automatic-payment-source.md +++ b/doc/models/invoice-automatic-payment-source.md @@ -1,7 +1,7 @@ # Invoice Automatic Payment Source -Indicates the automatic payment method for an [invoice payment request](#type-InvoicePaymentRequest). +Indicates the automatic payment method for an [invoice payment request](/doc/models/invoice-payment-request.md). ## Enumeration @@ -13,5 +13,5 @@ Indicates the automatic payment method for an [invoice payment request](#type-In | --- | --- | | `NONE` | An automatic payment is not configured for the payment request. | | `CARD_ON_FILE` | Use a card on file as the automatic payment method. On the due date, Square charges the card
for the amount of the payment request.

For `CARD_ON_FILE` payments, the invoice delivery method must be `EMAIL` and `card_id` must be
specified for the payment request before the invoice can be published. | -| `BANK_ON_FILE` | Use a bank account on file as the automatic payment method. On the due date, Square charges the bank
account for the amount of the payment request.

This payment method applies only to recurring invoices that sellers create in the Seller Dashboard or other
Square first-party application. The bank account is provided by the customer during the payment flow.

You cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a `BANK_ON_FILE`
payment method to `NONE` or `CARD_ON_FILE`. For `BANK_ON_FILE` payments, the invoice delivery method must be `EMAIL`. | +| `BANK_ON_FILE` | Use a bank account on file as the automatic payment method. On the due date, Square charges the bank
account for the amount of the payment request.

This payment method applies only to recurring invoices that sellers create in the Seller Dashboard or other
Square first-party applications. The bank account is provided by the customer during the payment flow.

You cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a `BANK_ON_FILE`
payment method to `NONE` or `CARD_ON_FILE`. For `BANK_ON_FILE` payments, the invoice delivery method must be `EMAIL`. | diff --git a/doc/models/invoice-delivery-method.md b/doc/models/invoice-delivery-method.md index bb928f67..63b8262f 100644 --- a/doc/models/invoice-delivery-method.md +++ b/doc/models/invoice-delivery-method.md @@ -1,7 +1,7 @@ # Invoice Delivery Method -Indicates how Square delivers the [invoice](#type-Invoice) to the customer. +Indicates how Square delivers the [invoice](/doc/models/invoice.md) to the customer. ## Enumeration diff --git a/doc/models/invoice-payment-reminder-status.md b/doc/models/invoice-payment-reminder-status.md index ccd32f82..cc78753c 100644 --- a/doc/models/invoice-payment-reminder-status.md +++ b/doc/models/invoice-payment-reminder-status.md @@ -11,7 +11,7 @@ The status of a payment request reminder. | Name | Description | | --- | --- | -| `PENDING` | The reminder is to be sent on the `relative_scheduled_date` (if the invoice is published). | +| `PENDING` | The reminder will be sent on the `relative_scheduled_date` (if the invoice is published). | | `NOT_APPLICABLE` | The reminder is not applicable and is not sent. The following are examples
of when reminders are not applicable and are not sent:

- You schedule a reminder to be sent before the invoice is published.
- The invoice is configured with multiple payment requests and a payment request reminder
is configured to be sent after the next payment request `due_date`.
- Two reminders (for different payment requests) are configured to be sent on the
same date. Therefore, only one reminder is sent.
- You configure a reminder to be sent on the date that the invoice is scheduled to be sent.
- The payment request is already paid.
- The invoice status is `CANCELED` or `FAILED`. | | `SENT` | The reminder is sent. | diff --git a/doc/models/invoice-payment-request.md b/doc/models/invoice-payment-request.md index f3f2f292..b96d3579 100644 --- a/doc/models/invoice-payment-request.md +++ b/doc/models/invoice-payment-request.md @@ -1,7 +1,7 @@ # Invoice Payment Request -Represents a payment request for an [invoice](#type-Invoice). Invoices can specify a maximum +Represents a payment request for an [invoice](/doc/models/invoice.md). Invoices can specify a maximum of 13 payment requests, with up to 12 `INSTALLMENT` request types. For more information, @@ -15,15 +15,15 @@ see [Payment requests](https://developer.squareup.com/docs/invoices-api/overview | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | The Square-generated ID of the payment request in an [invoice](#type-invoice).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getUid(): ?string | setUid(?string uid): void | -| `requestMethod` | [`?string (InvoiceRequestMethod)`](/doc/models/invoice-request-method.md) | Optional | Specifies the action for Square to take for processing the invoice. For example,
email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at version 2021-01-21. The corresponding `request_method` field is replaced by the `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. | getRequestMethod(): ?string | setRequestMethod(?string requestMethod): void | +| `uid` | `?string` | Optional | The Square-generated ID of the payment request in an [invoice](/doc/models/invoice.md).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getUid(): ?string | setUid(?string uid): void | +| `requestMethod` | [`?string (InvoiceRequestMethod)`](/doc/models/invoice-request-method.md) | Optional | Specifies the action for Square to take for processing the invoice. For example,
email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at
version 2021-01-21. The corresponding `request_method` field is replaced by the
`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. | getRequestMethod(): ?string | setRequestMethod(?string requestMethod): void | | `requestType` | [`?string (InvoiceRequestType)`](/doc/models/invoice-request-type.md) | Optional | Indicates the type of the payment request. An invoice supports the following payment request combinations:

- 1 balance
- 1 deposit with 1 balance
- 2 - 12 installments
- 1 deposit with 2 - 12 installments

For more information,
see [Payment requests](https://developer.squareup.com/docs/invoices-api/overview#payment-requests). | getRequestType(): ?string | setRequestType(?string requestType): void | -| `dueDate` | `?string` | Optional | The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This field is required to create a payment request.

After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). | getDueDate(): ?string | setDueDate(?string dueDate): void | +| `dueDate` | `?string` | Optional | The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This field
is required to create a payment request.

After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone`
of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC
timestamp of 2021-03-10T08:00:00Z). | getDueDate(): ?string | setDueDate(?string dueDate): void | | `fixedAmountRequestedMoney` | [`?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. | getFixedAmountRequestedMoney(): ?Money | setFixedAmountRequestedMoney(?Money fixedAmountRequestedMoney): void | -| `percentageRequested` | `?string` | Optional | Specifies the amount for the payment request in percentage:

- When the payment `request_type` is `DEPOSIT`, it is the percentage of the order total amount.
- When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order total less
the deposit, if requested. The sum of the `percentage_requested` in all installment
payment requests must be equal to 100.

You cannot specify this when the payment `request_type` is `BALANCE` or when the
payment request specifies the `fixed_amount_requested_money` field. | getPercentageRequested(): ?string | setPercentageRequested(?string percentageRequested): void | +| `percentageRequested` | `?string` | Optional | Specifies the amount for the payment request in percentage:

- When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount.
- When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less
the deposit, if requested. The sum of the `percentage_requested` in all installment
payment requests must be equal to 100.

You cannot specify this when the payment `request_type` is `BALANCE` or when the
payment request specifies the `fixed_amount_requested_money` field. | getPercentageRequested(): ?string | setPercentageRequested(?string percentageRequested): void | | `tippingEnabled` | `?bool` | Optional | If set to true, the Square-hosted invoice page (the `public_url` field of the invoice)
provides a place for the customer to pay a tip.

This field is allowed only on the final payment request
and the payment `request_type` must be `BALANCE` or `INSTALLMENT`. | getTippingEnabled(): ?bool | setTippingEnabled(?bool tippingEnabled): void | -| `automaticPaymentSource` | [`?string (InvoiceAutomaticPaymentSource)`](/doc/models/invoice-automatic-payment-source.md) | Optional | Indicates the automatic payment method for an [invoice payment request](#type-InvoicePaymentRequest). | getAutomaticPaymentSource(): ?string | setAutomaticPaymentSource(?string automaticPaymentSource): void | -| `cardId` | `?string` | Optional | The ID of the card on file to charge for the payment request. To get the customer’s card on file,
use the `customer_id` of the invoice recipient to call [RetrieveCustomer](#endpoint-Customers-RetrieveCustomer)
in the Customers API. Then, get the ID of the target card from the `cards` field in the response.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getCardId(): ?string | setCardId(?string cardId): void | +| `automaticPaymentSource` | [`?string (InvoiceAutomaticPaymentSource)`](/doc/models/invoice-automatic-payment-source.md) | Optional | Indicates the automatic payment method for an [invoice payment request](/doc/models/invoice-payment-request.md). | getAutomaticPaymentSource(): ?string | setAutomaticPaymentSource(?string automaticPaymentSource): void | +| `cardId` | `?string` | Optional | The ID of the card on file to charge for the payment request. To get the customer’s card on file,
use the `customer_id` of the invoice recipient to call [RetrieveCustomer](/doc/apis/customers.md#retrieve-customer)
in the Customers API. Then, get the ID of the target card from the `cards` field in the response.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getCardId(): ?string | setCardId(?string cardId): void | | `reminders` | [`?(InvoicePaymentReminder[])`](/doc/models/invoice-payment-reminder.md) | Optional | A list of one or more reminders to send for the payment request. | getReminders(): ?array | setReminders(?array reminders): void | | `computedAmountMoney` | [`?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. | getComputedAmountMoney(): ?Money | setComputedAmountMoney(?Money computedAmountMoney): void | | `totalCompletedAmountMoney` | [`?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. | getTotalCompletedAmountMoney(): ?Money | setTotalCompletedAmountMoney(?Money totalCompletedAmountMoney): void | diff --git a/doc/models/invoice-query.md b/doc/models/invoice-query.md index 0da6b30e..b9583282 100644 --- a/doc/models/invoice-query.md +++ b/doc/models/invoice-query.md @@ -12,7 +12,7 @@ Describes query criteria for searching invoices. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `filter` | [`InvoiceFilter`](/doc/models/invoice-filter.md) | Required | Describes query filters to apply. | getFilter(): InvoiceFilter | setFilter(InvoiceFilter filter): void | -| `sort` | [`?InvoiceSort`](/doc/models/invoice-sort.md) | Optional | Identifies the sort field and sort order. | getSort(): ?InvoiceSort | setSort(?InvoiceSort sort): void | +| `sort` | [`?InvoiceSort`](/doc/models/invoice-sort.md) | Optional | Identifies the sort field and sort order. | getSort(): ?InvoiceSort | setSort(?InvoiceSort sort): void | ## Example (as JSON) diff --git a/doc/models/invoice-request-method.md b/doc/models/invoice-request-method.md index c53e99a5..336689a3 100644 --- a/doc/models/invoice-request-method.md +++ b/doc/models/invoice-request-method.md @@ -2,7 +2,9 @@ # Invoice Request Method Specifies the action for Square to take for processing the invoice. For example, -email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at version 2021-01-21. The corresponding `request_method` field is replaced by the `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. +email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at +version 2021-01-21. The corresponding `request_method` field is replaced by the +`Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. ## Enumeration @@ -12,11 +14,11 @@ email the invoice, charge a customer's card on file, or do nothing. DEPRECATED a | Name | Description | | --- | --- | -| `EMAIL` | Directs Square to send invoices, reminders, and receipts to the customer using email. Square sends the invoice after it is published
(either immediately or at the `scheduled_at` time, if specified in the [invoice](#type-invoice)). | -| `CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request and to use email to send invoices, reminders, and receipts. | +| `EMAIL` | Directs Square to send invoices, reminders, and receipts to the customer using email.
Square sends the invoice after it is published (either immediately or at the `scheduled_at`
time, if specified in the [invoice](/doc/models/invoice.md)). | +| `CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request
and to use email to send invoices, reminders, and receipts. | | `SHARE_MANUALLY` | Directs Square to take no specific action on the invoice. In this case, the seller
(or the application developer) follows up with the customer for payment. For example,
a seller might collect a payment in the Seller Dashboard or use the Point of Sale (POS) application.
The seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer requesting payment. | | `CHARGE_BANK_ON_FILE` | Directs Square to charge the bank account on file on the `due_date` specified in the
payment request and to use email to send invoices, reminders, and receipts.

The bank on file payment method applies only to recurring invoices that sellers create in the Seller Dashboard or other
Square first-party applications. The bank account is provided by the customer during the payment flow. You
cannot set `CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | -| `SMS` | Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends the invoice after it is published (either immediately or at the `scheduled_at` time, if specified in the [invoice](#type-invoice)).

You cannot set `SMS` as a request method using the Invoices API. | -| `SMS_CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request and to use SMS (text message) to send invoices and receipts.

You cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API. | -| `SMS_CHARGE_BANK_ON_FILE` | Directs Square to charge the bank account on file on the `due_date` specified in the payment request and to use SMS (text message) to send invoices and receipts.

The bank on file payment method applies only to recurring invoices that sellers create in the Seller Dashboard or other Square first-party applications. The bank account is provided by the customer during the payment flow. You cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | +| `SMS` | Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends the invoice
after it is published (either immediately or at the `scheduled_at` time, if specified in the [invoice](/doc/models/invoice.md)).

You cannot set `SMS` as a request method using the Invoices API. | +| `SMS_CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request and to
use SMS (text message) to send invoices and receipts.

You cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API. | +| `SMS_CHARGE_BANK_ON_FILE` | Directs Square to charge the bank account on file on the `due_date` specified in the payment request
and to use SMS (text message) to send invoices and receipts.

The bank on file payment method applies only to recurring invoices that sellers create in the Seller Dashboard
or other Square first-party applications. The bank account is provided by the customer during the payment flow.
You cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | diff --git a/doc/models/invoice-request-type.md b/doc/models/invoice-request-type.md index 9a551561..58fbe2a9 100644 --- a/doc/models/invoice-request-type.md +++ b/doc/models/invoice-request-type.md @@ -21,5 +21,5 @@ see [Payment requests](https://developer.squareup.com/docs/invoices-api/overview | --- | --- | | `BALANCE` | Identifies that the payment request is for the balance amount, after accounting for any
other payment requests in the invoice:

- If the invoice specifies only a balance payment request, it refers to the
total amount identified by the associated order.
- If the invoice also specifies a deposit request, the balance payment request refers to
the remaining amount.
- `INSTALLMENT` and `BALANCE` are not allowed together. | | `DEPOSIT` | Identifies that the payment request is for a deposit. You have the option of specifying
an exact amount or a percentage of the total order amount. If you request a deposit,
it must be due before any other payment requests. | -| `INSTALLMENT` | Identifies that the payment request is for an installment. An invoice can request payments in installments.
Along with installments, you can request an optional deposit. All these payment requests must add to the total order amount. | +| `INSTALLMENT` | Identifies that the payment request is for an installment. An invoice can request payments in installments.
Along with installments, you can request an optional deposit. All these payment requests must equal the total order amount. | diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md index 71458de1..6e3bbf54 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -1,7 +1,7 @@ # Invoice Sort Field -Field to use for sorting. +The field to use for sorting. ## Enumeration diff --git a/doc/models/invoice-sort.md b/doc/models/invoice-sort.md index 085891c5..9be71713 100644 --- a/doc/models/invoice-sort.md +++ b/doc/models/invoice-sort.md @@ -1,7 +1,7 @@ # Invoice Sort -Identifies the sort field and sort order. +Identifies the sort field and sort order. ## Structure @@ -11,7 +11,7 @@ Identifies the sort field and sort order. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `field` | `string` | Required | Field to use for sorting.
**Default**: `'INVOICE_SORT_DATE'`
*Default: `'INVOICE_SORT_DATE'`* | getField(): string | setField(string field): void | +| `field` | `string` | Required | The field to use for sorting.
**Default**: `'INVOICE_SORT_DATE'`
*Default: `'INVOICE_SORT_DATE'`* | getField(): string | setField(string field): void | | `order` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getOrder(): ?string | setOrder(?string order): void | ## Example (as JSON) diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index e4e546f9..ec13bb97 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -13,12 +13,12 @@ Indicates the status of an invoice. | --- | --- | | `DRAFT` | The invoice is a draft. You must publish a draft invoice before Square can process it.
A draft invoice has no `public_url`, so it is not available to customers. | | `UNPAID` | The invoice is published but not yet paid. | -| `SCHEDULED` | The invoice is scheduled to be processed. On the scheduled date,
Square sends the invoice, initiates an automatic payment, or takes no action, depending on the delivery method and payment request settings. Square also sets the invoice status to the appropriate state:
`UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`. | +| `SCHEDULED` | The invoice is scheduled to be processed. On the scheduled date,
Square sends the invoice, initiates an automatic payment, or takes no action, depending on
the delivery method and payment request settings. Square also sets the invoice status to the
appropriate state: `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`. | | `PARTIALLY_PAID` | A partial payment is received for the invoice. | | `PAID` | The customer paid the invoice in full. | | `PARTIALLY_REFUNDED` | The invoice is paid (or partially paid) and some but not all the amount paid is
refunded. | | `REFUNDED` | The full amount that the customer paid for the invoice is refunded. | -| `CANCELED` | The invoice is canceled. Square no longer requests payments from the customer.
The `public_url` page remains and is accessible, but it displays the invoice
as cancelled and does not accept payment. | +| `CANCELED` | The invoice is canceled. Square no longer requests payments from the customer.
The `public_url` page remains and is accessible, but it displays the invoice
as canceled and does not accept payment. | | `FAILED` | Square canceled the invoice due to suspicious activity. | | `PAYMENT_PENDING` | A payment on the invoice was initiated but has not yet been processed.

When in this state, invoices cannot be updated and other payments cannot be initiated. | diff --git a/doc/models/invoice.md b/doc/models/invoice.md index 747e9f2e..e2667228 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,21 +15,23 @@ invoices. For more information, see [Manage Invoices Using the Invoices API](htt | `id` | `?string` | Optional | The Square-assigned ID of the invoice. | getId(): ?string | setId(?string id): void | | `version` | `?int` | Optional | The Square-assigned version number, which is incremented each time an update is committed to the invoice. | getVersion(): ?int | setVersion(?int version): void | | `locationId` | `?string` | Optional | The ID of the location that this invoice is associated with.
This field is required when creating an invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getLocationId(): ?string | setLocationId(?string locationId): void | -| `orderId` | `?string` | Optional | The ID of the [order](#type-order) for which the invoice is created.

This order must be in the `OPEN` state and must belong to the `location_id`
specified for this invoice. This field is required when creating an invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getOrderId(): ?string | setOrderId(?string orderId): void | +| `orderId` | `?string` | Optional | The ID of the [order](/doc/models/order.md) for which the invoice is created.

This order must be in the `OPEN` state and must belong to the `location_id`
specified for this invoice. This field is required when creating an invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getOrderId(): ?string | setOrderId(?string orderId): void | | `primaryRecipient` | [`?InvoiceRecipient`](/doc/models/invoice-recipient.md) | Optional | Provides customer data that Square uses to deliver an invoice. | getPrimaryRecipient(): ?InvoiceRecipient | setPrimaryRecipient(?InvoiceRecipient primaryRecipient): void | | `paymentRequests` | [`?(InvoicePaymentRequest[])`](/doc/models/invoice-payment-request.md) | Optional | The payment schedule for the invoice, represented by one or more payment requests that
define payment settings, such as amount due and due date. You can specify a maximum of 13
payment requests, with up to 12 `INSTALLMENT` request types. For more information, see
[Payment requests](https://developer.squareup.com/docs/invoices-api/overview#payment-requests).

This field is required when creating an invoice. It must contain at least one payment request. | getPaymentRequests(): ?array | setPaymentRequests(?array paymentRequests): void | -| `deliveryMethod` | [`?string (InvoiceDeliveryMethod)`](/doc/models/invoice-delivery-method.md) | Optional | Indicates how Square delivers the [invoice](#type-Invoice) to the customer. | getDeliveryMethod(): ?string | setDeliveryMethod(?string deliveryMethod): void | -| `invoiceNumber` | `?string` | Optional | A user-friendly invoice number. The value is unique within a location.
If not provided when creating an invoice, Square assigns a value.
It increments from 1 and padded with zeros making it 7 characters long
for example, 0000001, 0000002.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getInvoiceNumber(): ?string | setInvoiceNumber(?string invoiceNumber): void | +| `deliveryMethod` | [`?string (InvoiceDeliveryMethod)`](/doc/models/invoice-delivery-method.md) | Optional | Indicates how Square delivers the [invoice](/doc/models/invoice.md) to the customer. | getDeliveryMethod(): ?string | setDeliveryMethod(?string deliveryMethod): void | +| `invoiceNumber` | `?string` | Optional | A user-friendly invoice number. The value is unique within a location.
If not provided when creating an invoice, Square assigns a value.
It increments from 1 and padded with zeros making it 7 characters long
(for example, 0000001 and 0000002).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | getInvoiceNumber(): ?string | setInvoiceNumber(?string invoiceNumber): void | | `title` | `?string` | Optional | The title of the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getTitle(): ?string | setTitle(?string title): void | | `description` | `?string` | Optional | The description of the invoice. This is visible to the customer receiving the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65536` | getDescription(): ?string | setDescription(?string description): void | -| `scheduledAt` | `?string` | Optional | The timestamp when the invoice is scheduled for processing, in RFC 3339 format.
After the invoice is published, Square processes the invoice on the specified date, according to the delivery method and payment request settings.

If the field is not set, Square processes the invoice immediately after it is published. | getScheduledAt(): ?string | setScheduledAt(?string scheduledAt): void | +| `scheduledAt` | `?string` | Optional | The timestamp when the invoice is scheduled for processing, in RFC 3339 format.
After the invoice is published, Square processes the invoice on the specified date,
according to the delivery method and payment request settings.

If the field is not set, Square processes the invoice immediately after it is published. | getScheduledAt(): ?string | setScheduledAt(?string scheduledAt): void | | `publicUrl` | `?string` | Optional | The URL of the Square-hosted invoice page.
After you publish the invoice using the `PublishInvoice` endpoint, Square hosts the invoice
page and returns the page URL in the response. | getPublicUrl(): ?string | setPublicUrl(?string publicUrl): void | | `nextPaymentAmountMoney` | [`?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. | getNextPaymentAmountMoney(): ?Money | setNextPaymentAmountMoney(?Money nextPaymentAmountMoney): void | | `status` | [`?string (InvoiceStatus)`](/doc/models/invoice-status.md) | Optional | Indicates the status of an invoice. | getStatus(): ?string | setStatus(?string status): void | -| `timezone` | `?string` | Optional | The time zone used to interpret calendar dates on the invoice, such as `due_date`. When an invoice is created, this field is set to the `timezone` specified for the seller location. The value cannot be changed.

For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). | getTimezone(): ?string | setTimezone(?string timezone): void | +| `timezone` | `?string` | Optional | The time zone used to interpret calendar dates on the invoice, such as `due_date`.
When an invoice is created, this field is set to the `timezone` specified for the seller
location. The value cannot be changed.

For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles
becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp
of 2021-03-10T08:00:00Z). | getTimezone(): ?string | setTimezone(?string timezone): void | | `createdAt` | `?string` | Optional | The timestamp when the invoice was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | The timestamp when the invoice was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | +| `acceptedPaymentMethods` | [`?InvoiceAcceptedPaymentMethods`](/doc/models/invoice-accepted-payment-methods.md) | Optional | The payment methods that customers can use to pay an invoice on the Square-hosted invoice page. | getAcceptedPaymentMethods(): ?InvoiceAcceptedPaymentMethods | setAcceptedPaymentMethods(?InvoiceAcceptedPaymentMethods acceptedPaymentMethods): void | | `customFields` | [`?(InvoiceCustomField[])`](/doc/models/invoice-custom-field.md) | Optional | Additional seller-defined fields to render on the invoice. These fields are visible to sellers and buyers
on the Square-hosted invoice page and in emailed or PDF copies of invoices. For more information, see
[Custom fields](https://developer.squareup.com/docs/invoices-api/overview#custom-fields).

Max: 2 custom fields | getCustomFields(): ?array | setCustomFields(?array customFields): void | +| `subscriptionId` | `?string` | Optional | The ID of the [subscription](/doc/models/subscription.md) associated with the invoice.
This field is present only on subscription billing invoices. | getSubscriptionId(): ?string | setSubscriptionId(?string subscriptionId): void | ## Example (as JSON) diff --git a/doc/models/item-variation-location-overrides.md b/doc/models/item-variation-location-overrides.md index a0d54773..7699e71d 100644 --- a/doc/models/item-variation-location-overrides.md +++ b/doc/models/item-variation-location-overrides.md @@ -11,7 +11,7 @@ Price and inventory alerting overrides for a `CatalogItemVariation` at a specifi | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `locationId` | `?string` | Optional | The ID of the `Location`. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `locationId` | `?string` | Optional | The ID of the `Location`. This can include locations that are deactivated. | getLocationId(): ?string | setLocationId(?string locationId): void | | `priceMoney` | [`?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. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | | `pricingType` | [`?string (CatalogPricingType)`](/doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | getPricingType(): ?string | setPricingType(?string pricingType): void | | `trackInventory` | `?bool` | Optional | If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. | getTrackInventory(): ?bool | setTrackInventory(?bool trackInventory): void | diff --git a/doc/models/list-catalog-request.md b/doc/models/list-catalog-request.md index 3abe8d9c..c41e0af8 100644 --- a/doc/models/list-catalog-request.md +++ b/doc/models/list-catalog-request.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `cursor` | `?string` | Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.
See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | | `types` | `?string` | Optional | An optional case-insensitive, comma-separated list of object types to retrieve, for example
`ITEM,ITEM_VARIATION,CATEGORY,IMAGE`.

The legal values are taken from the CatalogObjectType enum:
`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,
`MODIFIER`, `MODIFIER_LIST`, or `IMAGE`. | getTypes(): ?string | setTypes(?string types): void | -| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical
versions of objects. The specified version value is matched against
the [CatalogObject](#type-catalogobject)s' `version` attribute. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | +| `catalogVersion` | `?int` | Optional | The specific version of the catalog objects to be included in the response.
This allows you to retrieve historical
versions of objects. The specified version value is matched against
the [CatalogObject](/doc/models/catalog-object.md)s' `version` attribute. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | ## Example (as JSON) diff --git a/doc/models/list-customer-groups-request.md b/doc/models/list-customer-groups-request.md index 34a20b51..ed991562 100644 --- a/doc/models/list-customer-groups-request.md +++ b/doc/models/list-customer-groups-request.md @@ -1,8 +1,8 @@ # List Customer Groups Request -Defines the query parameters that can be provided in a request to the -[ListCustomerGroups](#endpoint-listcustomergroups) endpoint. +Defines the query parameters that can be included in a request to the +[ListCustomerGroups](/doc/apis/customer-groups.md#list-customer-groups) endpoint. ## Structure @@ -12,7 +12,7 @@ Defines the query parameters that can be provided in a request to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-customer-groups-response.md b/doc/models/list-customer-groups-response.md index 06e666b9..d22a020a 100644 --- a/doc/models/list-customer-groups-response.md +++ b/doc/models/list-customer-groups-response.md @@ -2,9 +2,9 @@ # List Customer Groups Response Defines the fields that are included in the response body of -a request to the [ListCustomerGroups](#endpoint-listcustomergroups) endpoint. +a request to the [ListCustomerGroups](/doc/apis/customer-groups.md#list-customer-groups) endpoint. -One of `errors` or `groups` is present in a given response (never both). +Either `errors` or `groups` is present in a given response (never both). ## Structure @@ -15,8 +15,8 @@ One of `errors` or `groups` is present in a given response (never both). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `groups` | [`?(CustomerGroup[])`](/doc/models/customer-group.md) | Optional | A list of customer groups belonging to the current merchant. | getGroups(): ?array | setGroups(?array groups): void | -| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. This value is present only if the request
succeeded and additional results are available.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `groups` | [`?(CustomerGroup[])`](/doc/models/customer-group.md) | Optional | A list of customer groups belonging to the current seller. | getGroups(): ?array | setGroups(?array groups): void | +| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. This value is present only if the request
succeeded and additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-customer-segments-request.md b/doc/models/list-customer-segments-request.md index 32baf41e..54e6379a 100644 --- a/doc/models/list-customer-segments-request.md +++ b/doc/models/list-customer-segments-request.md @@ -1,7 +1,7 @@ # List Customer Segments Request -Defines the valid parameters for requests to __ListCustomerSegments__. +Defines the valid parameters for requests to the `ListCustomerSegments` endpoint. ## Structure @@ -11,7 +11,7 @@ Defines the valid parameters for requests to __ListCustomerSegments__. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by previous calls to __ListCustomerSegments__.
Used to retrieve the next set of query results.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by previous calls to `ListCustomerSegments`.
This cursor is used to retrieve the next set of query results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-customer-segments-response.md b/doc/models/list-customer-segments-response.md index 3e794eb1..7b2ef7fe 100644 --- a/doc/models/list-customer-segments-response.md +++ b/doc/models/list-customer-segments-response.md @@ -1,9 +1,9 @@ # List Customer Segments Response -Defines the fields included in the response body for requests to __ListCustomerSegments__. +Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint. -One of `errors` or `segments` is present in a given response (never both). +Either `errors` or `segments` is present in a given response (never both). ## Structure @@ -15,7 +15,7 @@ One of `errors` or `segments` is present in a given response (never both). | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | | `segments` | [`?(CustomerSegment[])`](/doc/models/customer-segment.md) | Optional | The list of customer segments belonging to the associated Square account. | getSegments(): ?array | setSegments(?array segments): void | -| `cursor` | `?string` | Optional | A pagination cursor to be used in subsequent calls to __ListCustomerSegments__
to retrieve the next set of query results. Only present only if the request succeeded and
additional results are available.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor to be used in subsequent calls to `ListCustomerSegments`
to retrieve the next set of query results. The cursor is only present if the request succeeded and
additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-customers-request.md b/doc/models/list-customers-request.md index a3c6e010..a34758a5 100644 --- a/doc/models/list-customers-request.md +++ b/doc/models/list-customers-request.md @@ -1,8 +1,8 @@ # List Customers Request -Defines the query parameters that can be provided in a request to the -ListCustomers endpoint. +Defines the query parameters that can be included in a request to the +`ListCustomers` endpoint. ## Structure @@ -12,7 +12,7 @@ ListCustomers endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | | `sortField` | [`?string (CustomerSortField)`](/doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | getSortField(): ?string | setSortField(?string sortField): void | | `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | diff --git a/doc/models/list-customers-response.md b/doc/models/list-customers-response.md index f718767a..b3b96dca 100644 --- a/doc/models/list-customers-response.md +++ b/doc/models/list-customers-response.md @@ -2,9 +2,9 @@ # List Customers Response Defines the fields that are included in the response body of -a request to the ListCustomers endpoint. +a request to the `ListCustomers` endpoint. -One of `errors` or `customers` is present in a given response (never both). +Either `errors` or `customers` is present in a given response (never both). ## Structure @@ -16,7 +16,7 @@ One of `errors` or `customers` is present in a given response (never both). | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | | `customers` | [`?(Customer[])`](/doc/models/customer.md) | Optional | An array of `Customer` objects that match the provided query. | getCustomers(): ?array | setCustomers(?array customers): void | -| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for the
original query. Only present if the request succeeded and additional results
are available.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for the
original query. A cursor is only present if the request succeeded and additional results
are available.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) @@ -33,30 +33,25 @@ One of `errors` or `customers` is present in a given response (never both). "postal_code": "10003" }, "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", "email_address": "Amelia.Earhart@example.com", "family_name": "Earhart", "given_name": "Amelia", "group_ids": [ "545AXB44B4XXWMVQ4W8SBT3HHF" ], - "groups": [ - { - "id": "545AXB44B4XXWMVQ4W8SBT3HHF", - "name": "Aviation Enthusiasts" - }, - { - "id": "1KB9JE5EGJXCW.REACHABLE", - "name": "Reachable" - } - ], "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", "note": "a customer", "phone_number": "1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, "reference_id": "YOUR_REFERENCE_ID", "segment_ids": [ "1KB9JE5EGJXCW.REACHABLE" ], - "updated_at": "2016-03-23T20:21:55Z" + "updated_at": "2016-03-23T20:21:55Z", + "version": 1 } ] } diff --git a/doc/models/list-device-codes-request.md b/doc/models/list-device-codes-request.md index 285cb589..640d067d 100644 --- a/doc/models/list-device-codes-request.md +++ b/doc/models/list-device-codes-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](#paginatingresults) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | | `locationId` | `?string` | Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | getLocationId(): ?string | setLocationId(?string locationId): void | | `productType` | [`?string (ProductType)`](/doc/models/product-type.md) | Optional | - | getProductType(): ?string | setProductType(?string productType): void | | `status` | [`?(string[]) (DeviceCodeStatus)`](/doc/models/device-code-status.md) | Optional | If specified, returns DeviceCodes with the specified statuses.
Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.
See [DeviceCodeStatus](#type-devicecodestatus) for possible values | getStatus(): ?array | setStatus(?array status): void | diff --git a/doc/models/list-device-codes-response.md b/doc/models/list-device-codes-response.md index ee9dff76..994662b8 100644 --- a/doc/models/list-device-codes-response.md +++ b/doc/models/list-device-codes-response.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | | `deviceCodes` | [`?(DeviceCode[])`](/doc/models/device-code.md) | Optional | The queried DeviceCode. | getDeviceCodes(): ?array | setDeviceCodes(?array deviceCodes): void | -| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. This value is present only if the request
succeeded and additional results are available.

See [Paginating results](#paginatingresults) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. This value is present only if the request
succeeded and additional results are available.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-employees-response.md b/doc/models/list-employees-response.md index 82e2d327..173fc48a 100644 --- a/doc/models/list-employees-response.md +++ b/doc/models/list-employees-response.md @@ -30,19 +30,19 @@ "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", + "code": "UNPROCESSABLE_ENTITY", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", + "code": "RATE_LIMITED", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", + "code": "NOT_IMPLEMENTED", "detail": "detail3", "field": "field1" } diff --git a/doc/models/list-invoices-request.md b/doc/models/list-invoices-request.md index 6c0c2875..416fafb4 100644 --- a/doc/models/list-invoices-request.md +++ b/doc/models/list-invoices-request.md @@ -13,7 +13,7 @@ Describes a `ListInvoice` request. | --- | --- | --- | --- | --- | --- | | `locationId` | `string` | Required | The ID of the location for which to list invoices.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getLocationId(): string | setLocationId(string locationId): void | | `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server
uses a default limit of 100 invoices. | getLimit(): ?int | setLimit(?int limit): void | +| `limit` | `?int` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | getLimit(): ?int | setLimit(?int limit): void | ## Example (as JSON) diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 6f8a0333..a5d64bb4 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -12,7 +12,7 @@ Describes a `ListInvoice` response. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `invoices` | [`?(Invoice[])`](/doc/models/invoice.md) | Optional | The invoices retrieved. | getInvoices(): ?array | setInvoices(?array invoices): void | -| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a
subsequent request to fetch the next set of invoices. If empty, this is the final
response.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | When a response is truncated, it includes a cursor that you can use in a
subsequent request to retrieve the next set of invoices. If empty, this is the final
response.
For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | ## Example (as JSON) @@ -23,6 +23,11 @@ Describes a `ListInvoice` response. "invoices": [ { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/list-merchants-request.md b/doc/models/list-merchants-request.md index 204b4eae..b924e6f9 100644 --- a/doc/models/list-merchants-request.md +++ b/doc/models/list-merchants-request.md @@ -1,7 +1,7 @@ # List Merchants Request -Request object for the [ListMerchant](#endpoint-listmerchant) endpoint. +Request object for the [ListMerchant](/doc/apis/merchants.md#list-merchants) endpoint. ## Structure diff --git a/doc/models/list-merchants-response.md b/doc/models/list-merchants-response.md index a0780b19..f58a4527 100644 --- a/doc/models/list-merchants-response.md +++ b/doc/models/list-merchants-response.md @@ -1,7 +1,7 @@ # List Merchants Response -The response object returned by the [ListMerchant](#endpoint-listmerchant) endpoint. +The response object returned by the [ListMerchant](/doc/apis/merchants.md#list-merchants) endpoint. ## Structure diff --git a/doc/models/list-payment-refunds-request.md b/doc/models/list-payment-refunds-request.md index 7a68be23..567a201c 100644 --- a/doc/models/list-payment-refunds-request.md +++ b/doc/models/list-payment-refunds-request.md @@ -2,7 +2,7 @@ # List Payment Refunds Request Describes a request to list refunds using -[ListPaymentRefunds](#endpoint-payments-listpaymentrefunds). +[ListPaymentRefunds](/doc/apis/refunds.md#list-payment-refunds). The maximum results per page is 100. @@ -19,7 +19,7 @@ The maximum results per page is 100. | `sortOrder` | `?string` | Optional | The order in which results are listed:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | | `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | getCursor(): ?string | setCursor(?string cursor): void | | `locationId` | `?string` | Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `status` | `?string` | Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](#type-paymentrefund).

Default: If omitted, refunds are returned regardless of their status. | getStatus(): ?string | setStatus(?string status): void | +| `status` | `?string` | Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](/doc/models/payment-refund.md).

Default: If omitted, refunds are returned regardless of their status. | getStatus(): ?string | setStatus(?string status): void | | `sourceType` | `?string` | Optional | If provided, only refunds with the given source type are returned.

- `CARD` - List refunds only for payments where `CARD` was specified as the payment
source.

Default: If omitted, refunds are returned regardless of the source type. | getSourceType(): ?string | setSourceType(?string sourceType): void | | `limit` | `?int` | Optional | The maximum number of results to be returned in a single page.

It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, no more than 100 results are returned.

Default: 100 | getLimit(): ?int | setLimit(?int limit): void | diff --git a/doc/models/list-payment-refunds-response.md b/doc/models/list-payment-refunds-response.md index 00d09b19..122efef1 100644 --- a/doc/models/list-payment-refunds-response.md +++ b/doc/models/list-payment-refunds-response.md @@ -1,7 +1,7 @@ # List Payment Refunds Response -Defines the response returned by [ListPaymentRefunds](#endpoint-refunds-listpaymentrefunds). +Defines the response returned by [ListPaymentRefunds](/doc/apis/refunds.md#list-payment-refunds). Either `errors` or `refunds` is present in a given response (never both). diff --git a/doc/models/list-payments-request.md b/doc/models/list-payments-request.md index 87af588b..fc98487f 100644 --- a/doc/models/list-payments-request.md +++ b/doc/models/list-payments-request.md @@ -2,7 +2,7 @@ # List Payments Request Describes a request to list payments using -[ListPayments](#endpoint-payments-listpayments). +[ListPayments](/doc/apis/payments.md#list-payments). The maximum results per page is 100. diff --git a/doc/models/list-payments-response.md b/doc/models/list-payments-response.md index d1a6592a..2fb53c60 100644 --- a/doc/models/list-payments-response.md +++ b/doc/models/list-payments-response.md @@ -1,7 +1,7 @@ # List Payments Response -Defines the response returned by [ListPayments](#endpoint-payments-listpayments). +Defines the response returned by [ListPayments](/doc/apis/payments.md#list-payments). ## Structure diff --git a/doc/models/list-refunds-request.md b/doc/models/list-refunds-request.md index d6757113..39a1b8c5 100644 --- a/doc/models/list-refunds-request.md +++ b/doc/models/list-refunds-request.md @@ -2,9 +2,9 @@ # List Refunds Request Defines the query parameters that can be included in -a request to the [ListRefunds](#endpoint-listrefunds) endpoint. +a request to the [ListRefunds](/doc/apis/transactions.md#list-refunds) endpoint. -Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) +Deprecated - recommend using [SearchOrders](/doc/apis/orders.md#search-orders) ## Structure @@ -14,10 +14,10 @@ Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `beginTime` | `?string` | Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | +| `beginTime` | `?string` | Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | +| `endTime` | `?string` | Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | | `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](#paginatingresults) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-refunds-response.md b/doc/models/list-refunds-response.md index 9e65e7d0..678e11c6 100644 --- a/doc/models/list-refunds-response.md +++ b/doc/models/list-refunds-response.md @@ -2,7 +2,7 @@ # List Refunds Response Defines the fields that are included in the response body of -a request to the [ListRefunds](#endpoint-listrefunds) endpoint. +a request to the [ListRefunds](/doc/apis/transactions.md#list-refunds) endpoint. One of `errors` or `refunds` is present in a given response (never both). @@ -16,7 +16,7 @@ One of `errors` or `refunds` is present in a given response (never both). | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | | `refunds` | [`?(Refund[])`](/doc/models/refund.md) | Optional | An array of refunds that match your query. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `cursor` | `?string` | Optional | A pagination cursor for retrieving the next set of results,
if any remain. Provide this value as the `cursor` parameter in a subsequent
request to this endpoint.

See [Paginating results](#paginatingresults) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor for retrieving the next set of results,
if any remain. Provide this value as the `cursor` parameter in a subsequent
request to this endpoint.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-subscription-events-request.md b/doc/models/list-subscription-events-request.md index 78de7c0d..b24f5068 100644 --- a/doc/models/list-subscription-events-request.md +++ b/doc/models/list-subscription-events-request.md @@ -2,7 +2,7 @@ # List Subscription Events Request Defines parameters in a -[ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) +[ListSubscriptionEvents](/doc/apis/subscriptions.md#list-subscription-events) endpoint request. ## Structure diff --git a/doc/models/list-subscription-events-response.md b/doc/models/list-subscription-events-response.md index 23736c6f..fecc4f4f 100644 --- a/doc/models/list-subscription-events-response.md +++ b/doc/models/list-subscription-events-response.md @@ -2,7 +2,7 @@ # List Subscription Events Response Defines the fields that are included in the response from the -[ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) +[ListSubscriptionEvents](/doc/apis/subscriptions.md#list-subscription-events) endpoint. ## Structure diff --git a/doc/models/list-transactions-request.md b/doc/models/list-transactions-request.md index a875e39c..5476cca4 100644 --- a/doc/models/list-transactions-request.md +++ b/doc/models/list-transactions-request.md @@ -2,9 +2,9 @@ # List Transactions Request Defines the query parameters that can be included in -a request to the [ListTransactions](#endpoint-listtransactions) endpoint. +a request to the [ListTransactions](/doc/apis/transactions.md#list-transactions) endpoint. -Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) +Deprecated - recommend using [SearchOrders](/doc/apis/orders.md#search-orders) ## Structure @@ -14,10 +14,10 @@ Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `beginTime` | `?string` | Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `endTime` | `?string` | Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](#dateranges) for details on date inclusivity/exclusivity.

Default value: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | +| `beginTime` | `?string` | Optional | The beginning of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time minus one year. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | +| `endTime` | `?string` | Optional | The end of the requested reporting period, in RFC 3339 format.

See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details on date inclusivity/exclusivity.

Default value: The current time. | getEndTime(): ?string | setEndTime(?string endTime): void | | `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](#paginatingresults) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/list-transactions-response.md b/doc/models/list-transactions-response.md index 28c4bee3..4a51e77e 100644 --- a/doc/models/list-transactions-response.md +++ b/doc/models/list-transactions-response.md @@ -2,7 +2,7 @@ # List Transactions Response Defines the fields that are included in the response body of -a request to the [ListTransactions](#endpoint-listtransactions) endpoint. +a request to the [ListTransactions](/doc/apis/transactions.md#list-transactions) endpoint. One of `errors` or `transactions` is present in a given response (never both). @@ -16,7 +16,7 @@ One of `errors` or `transactions` is present in a given response (never both). | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | | `transactions` | [`?(Transaction[])`](/doc/models/transaction.md) | Optional | An array of transactions that match your query. | getTransactions(): ?array | setTransactions(?array transactions): void | -| `cursor` | `?string` | Optional | A pagination cursor for retrieving the next set of results,
if any remain. Provide this value as the `cursor` parameter in a subsequent
request to this endpoint.

See [Paginating results](#paginatingresults) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor for retrieving the next set of results,
if any remain. Provide this value as the `cursor` parameter in a subsequent
request to this endpoint.

See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/location-capability.md b/doc/models/location-capability.md index feb0bd26..422b11d3 100644 --- a/doc/models/location-capability.md +++ b/doc/models/location-capability.md @@ -12,4 +12,5 @@ The capabilities a location may have. | Name | Description | | --- | --- | | `CREDIT_CARD_PROCESSING` | The permission to process credit card transactions with Square.

The location can process credit cards if this value is present
in the `capabilities` array of the `Location`. | +| `AUTOMATIC_TRANSFERS` | The capability to receive automatic transfers from Square.

The location can receive automatic transfers of their balance from Square if this value
is present in the `capabilities` array of the `Location`. | diff --git a/doc/models/location.md b/doc/models/location.md index 8e95b351..131fb63b 100644 --- a/doc/models/location.md +++ b/doc/models/location.md @@ -13,7 +13,7 @@ | `name` | `?string` | Optional | The name of the location.
This information appears in the dashboard as the nickname.
A location name must be unique within a seller account. | getName(): ?string | setName(?string name): void | | `address` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getAddress(): ?Address | setAddress(?Address address): void | | `timezone` | `?string` | Optional | The [IANA Timezone](https://www.iana.org/time-zones) identifier for
the timezone of the location. | getTimezone(): ?string | setTimezone(?string timezone): void | -| `capabilities` | [`?(string[]) (LocationCapability)`](/doc/models/location-capability.md) | Optional | The Square features that are enabled for the location.
See [LocationCapability](#type-locationcapability) for possible values.
See [LocationCapability](#type-locationcapability) for possible values | getCapabilities(): ?array | setCapabilities(?array capabilities): void | +| `capabilities` | [`?(string[]) (LocationCapability)`](/doc/models/location-capability.md) | Optional | The Square features that are enabled for the location.
See [LocationCapability](/doc/models/location-capability.md) for possible values.
See [LocationCapability](#type-locationcapability) for possible values | getCapabilities(): ?array | setCapabilities(?array capabilities): void | | `status` | [`?string (LocationStatus)`](/doc/models/location-status.md) | Optional | The status of the location, whether a location is active or inactive. | getStatus(): ?string | setStatus(?string status): void | | `createdAt` | `?string` | Optional | The time when the location was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `merchantId` | `?string` | Optional | The ID of the merchant that owns the location. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | @@ -51,7 +51,7 @@ }, "timezone": "timezone0", "capabilities": [ - "CREDIT_CARD_PROCESSING" + "AUTOMATIC_TRANSFERS" ] } ``` diff --git a/doc/models/loyalty-account-mapping.md b/doc/models/loyalty-account-mapping.md index 30e647eb..eec05c84 100644 --- a/doc/models/loyalty-account-mapping.md +++ b/doc/models/loyalty-account-mapping.md @@ -1,8 +1,9 @@ # Loyalty Account Mapping -Associates a loyalty account with the buyer's phone number. -For more information, see +Represents the mapping that associates a loyalty account with a buyer. + +Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, see [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). ## Structure @@ -14,18 +15,20 @@ For more information, see | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | The Square-assigned ID of the mapping.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `type` | `string` | Required | The type of mapping.
**Default**: `'PHONE'`
*Default: `'PHONE'`* | getType(): string | setType(string type): void | -| `value` | `string` | Required | The phone number, in E.164 format. For example, "+14155551111".
**Constraints**: *Minimum Length*: `1` | getValue(): string | setValue(string value): void | +| `type` | [`?string (LoyaltyAccountMappingType)`](/doc/models/loyalty-account-mapping-type.md) | Optional | The type of mapping. | getType(): ?string | setType(?string type): void | +| `value` | `?string` | Optional | The mapping value, which is used with `type` to represent a phone number mapping. The value can be a phone number in E.164 format. For example, "+14155551111".

When specifying a mapping, the `phone_number` field is preferred to using `type` and `value`. | getValue(): ?string | setValue(?string value): void | | `createdAt` | `?string` | Optional | The timestamp when the mapping was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `phoneNumber` | `?string` | Optional | The phone number of the buyer, in E.164 format. For example, "+14155551111".

When specifying a mapping, this `phone_number` field is preferred to using `type` and `value`. | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | ## Example (as JSON) ```json { "id": "id0", - "type": "type0", + "type": "PHONE", "value": "value2", - "created_at": "created_at2" + "created_at": "created_at2", + "phone_number": "phone_number2" } ``` diff --git a/doc/models/loyalty-account.md b/doc/models/loyalty-account.md index 3d8f2b04..cad5d961 100644 --- a/doc/models/loyalty-account.md +++ b/doc/models/loyalty-account.md @@ -13,14 +13,15 @@ Describes a loyalty account. For more information, see | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | The Square-assigned ID of the loyalty account.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | -| `mappings` | [`LoyaltyAccountMapping[]`](/doc/models/loyalty-account-mapping.md) | Required | The list of mappings that the account is associated with.
Currently, a buyer can only be mapped to a loyalty account using
a phone number. Therefore, the list can only have one mapping. | getMappings(): array | setMappings(array mappings): void | -| `programId` | `string` | Required | The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram) to which the account belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getProgramId(): string | setProgramId(string programId): void | +| `mappings` | [`?(LoyaltyAccountMapping[])`](/doc/models/loyalty-account-mapping.md) | Optional | The list of mappings that the account is associated with.
Currently, a buyer can only be mapped to a loyalty account using
a phone number. Therefore, the list can only have one mapping.

One of the following is required when creating a loyalty account:

- (Preferred) The `mapping` field, with the buyer's phone number specified in the `phone_number` field.
- This `mappings` field. | getMappings(): ?array | setMappings(?array mappings): void | +| `programId` | `string` | Required | The Square-assigned ID of the [loyalty program](/doc/models/loyalty-program.md) to which the account belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getProgramId(): string | setProgramId(string programId): void | | `balance` | `?int` | Optional | The available point balance in the loyalty account.

Your application should be able to handle loyalty accounts that have a negative point balance (`balance` is less than 0). This might occur if a seller makes a manual adjustment or as a result of a refund or exchange. | getBalance(): ?int | setBalance(?int balance): void | | `lifetimePoints` | `?int` | Optional | The total points accrued during the lifetime of the account. | getLifetimePoints(): ?int | setLifetimePoints(?int lifetimePoints): void | -| `customerId` | `?string` | Optional | The Square-assigned ID of the [customer](#type-Customer) that is associated with the account. | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `customerId` | `?string` | Optional | The Square-assigned ID of the [customer](/doc/models/customer.md) that is associated with the account. | getCustomerId(): ?string | setCustomerId(?string customerId): void | | `enrolledAt` | `?string` | Optional | The timestamp when enrollment occurred, in RFC 3339 format. | getEnrolledAt(): ?string | setEnrolledAt(?string enrolledAt): void | | `createdAt` | `?string` | Optional | The timestamp when the loyalty account was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | The timestamp when the loyalty account was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | +| `mapping` | [`?LoyaltyAccountMapping`](/doc/models/loyalty-account-mapping.md) | Optional | Represents the mapping that associates a loyalty account with a buyer.

Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, see
[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). | getMapping(): ?LoyaltyAccountMapping | setMapping(?LoyaltyAccountMapping mapping): void | ## Example (as JSON) @@ -30,16 +31,16 @@ Describes a loyalty account. For more information, see "mappings": [ { "id": "id4", - "type": "type6", + "type": "PHONE", "value": "value6", - "created_at": "created_at8" + "created_at": "created_at8", + "phone_number": "phone_number8" } ], "program_id": "program_id0", "balance": 64, "lifetime_points": 88, - "customer_id": "customer_id8", - "enrolled_at": "enrolled_at0" + "customer_id": "customer_id8" } ``` diff --git a/doc/models/loyalty-event-accumulate-points.md b/doc/models/loyalty-event-accumulate-points.md index 1fc0a22a..90205df2 100644 --- a/doc/models/loyalty-event-accumulate-points.md +++ b/doc/models/loyalty-event-accumulate-points.md @@ -11,9 +11,9 @@ Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `?string` | Optional | The ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | +| `loyaltyProgramId` | `?string` | Optional | The ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | | `points` | `?int` | Optional | The number of points accumulated by the event.
**Constraints**: `>= 1` | getPoints(): ?int | setPoints(?int points): void | -| `orderId` | `?string` | Optional | The ID of the [order](#type-Order) for which the buyer accumulated the points.
This field is returned only if the Orders API is used to process orders. | getOrderId(): ?string | setOrderId(?string orderId): void | +| `orderId` | `?string` | Optional | The ID of the [order](/doc/models/order.md) for which the buyer accumulated the points.
This field is returned only if the Orders API is used to process orders. | getOrderId(): ?string | setOrderId(?string orderId): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-adjust-points.md b/doc/models/loyalty-event-adjust-points.md index fff21bd3..768336c5 100644 --- a/doc/models/loyalty-event-adjust-points.md +++ b/doc/models/loyalty-event-adjust-points.md @@ -11,7 +11,7 @@ Provides metadata when the event `type` is `ADJUST_POINTS`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `?string` | Optional | The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | +| `loyaltyProgramId` | `?string` | Optional | The Square-assigned ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Maximum Length*: `36` | getLoyaltyProgramId(): ?string | setLoyaltyProgramId(?string loyaltyProgramId): void | | `points` | `int` | Required | The number of points added or removed. | getPoints(): int | setPoints(int points): void | | `reason` | `?string` | Optional | The reason for the adjustment of points. | getReason(): ?string | setReason(?string reason): void | diff --git a/doc/models/loyalty-event-create-reward.md b/doc/models/loyalty-event-create-reward.md index 50652f9f..d47f6aa4 100644 --- a/doc/models/loyalty-event-create-reward.md +++ b/doc/models/loyalty-event-create-reward.md @@ -11,8 +11,8 @@ Provides metadata when the event `type` is `CREATE_REWARD`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `rewardId` | `?string` | Optional | The Square-assigned ID of the created [loyalty reward](#type-LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | +| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | +| `rewardId` | `?string` | Optional | The Square-assigned ID of the created [loyalty reward](/doc/models/loyalty-reward.md).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | | `points` | `int` | Required | The loyalty points used to create the reward. | getPoints(): int | setPoints(int points): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-delete-reward.md b/doc/models/loyalty-event-delete-reward.md index f530948d..0c4fa71f 100644 --- a/doc/models/loyalty-event-delete-reward.md +++ b/doc/models/loyalty-event-delete-reward.md @@ -11,8 +11,8 @@ Provides metadata when the event `type` is `DELETE_REWARD`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `rewardId` | `?string` | Optional | The ID of the deleted [loyalty reward](#type-LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | +| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | +| `rewardId` | `?string` | Optional | The ID of the deleted [loyalty reward](/doc/models/loyalty-reward.md).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | | `points` | `int` | Required | The number of points returned to the loyalty account. | getPoints(): int | setPoints(int points): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-expire-points.md b/doc/models/loyalty-event-expire-points.md index 67b592d7..1f8b4d42 100644 --- a/doc/models/loyalty-event-expire-points.md +++ b/doc/models/loyalty-event-expire-points.md @@ -11,7 +11,7 @@ Provides metadata when the event `type` is `EXPIRE_POINTS`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | +| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | | `points` | `int` | Required | The number of points expired. | getPoints(): int | setPoints(int points): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-location-filter.md b/doc/models/loyalty-event-location-filter.md index 01c76e13..c9a2ae99 100644 --- a/doc/models/loyalty-event-location-filter.md +++ b/doc/models/loyalty-event-location-filter.md @@ -11,7 +11,7 @@ Filter events by location. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `locationIds` | `string[]` | Required | The [location](#type-Location) IDs for loyalty events to query.
If multiple values are specified, the endpoint uses
a logical OR to combine them. | getLocationIds(): array | setLocationIds(array locationIds): void | +| `locationIds` | `string[]` | Required | The [location](/doc/models/location.md) IDs for loyalty events to query.
If multiple values are specified, the endpoint uses
a logical OR to combine them. | getLocationIds(): array | setLocationIds(array locationIds): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-loyalty-account-filter.md b/doc/models/loyalty-event-loyalty-account-filter.md index d8dc8729..d0f60da2 100644 --- a/doc/models/loyalty-event-loyalty-account-filter.md +++ b/doc/models/loyalty-event-loyalty-account-filter.md @@ -11,7 +11,7 @@ Filter events by loyalty account. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](#type-LoyaltyAccount) associated with loyalty events.
**Constraints**: *Minimum Length*: `1` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | +| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](/doc/models/loyalty-account.md) associated with loyalty events.
**Constraints**: *Minimum Length*: `1` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-order-filter.md b/doc/models/loyalty-event-order-filter.md index 92aae624..383fffcd 100644 --- a/doc/models/loyalty-event-order-filter.md +++ b/doc/models/loyalty-event-order-filter.md @@ -11,7 +11,7 @@ Filter events by the order associated with the event. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `orderId` | `string` | Required | The ID of the [order](#type-Order) associated with the event.
**Constraints**: *Minimum Length*: `1` | getOrderId(): string | setOrderId(string orderId): void | +| `orderId` | `string` | Required | The ID of the [order](/doc/models/order.md) associated with the event.
**Constraints**: *Minimum Length*: `1` | getOrderId(): string | setOrderId(string orderId): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-other.md b/doc/models/loyalty-event-other.md index 87db53c6..0b857a9a 100644 --- a/doc/models/loyalty-event-other.md +++ b/doc/models/loyalty-event-other.md @@ -11,7 +11,7 @@ Provides metadata when the event `type` is `OTHER`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | +| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | | `points` | `int` | Required | The number of points added or removed. | getPoints(): int | setPoints(int points): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event-redeem-reward.md b/doc/models/loyalty-event-redeem-reward.md index 87c5f0c3..2f1f3e74 100644 --- a/doc/models/loyalty-event-redeem-reward.md +++ b/doc/models/loyalty-event-redeem-reward.md @@ -11,9 +11,9 @@ Provides metadata when the event `type` is `REDEEM_REWARD`. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](#type-LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | -| `rewardId` | `?string` | Optional | The ID of the redeemed [loyalty reward](#type-LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | -| `orderId` | `?string` | Optional | The ID of the [order](#type-Order) that redeemed the reward.
This field is returned only if the Orders API is used to process orders. | getOrderId(): ?string | setOrderId(?string orderId): void | +| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](/doc/models/loyalty-program.md).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyProgramId(): string | setLoyaltyProgramId(string loyaltyProgramId): void | +| `rewardId` | `?string` | Optional | The ID of the redeemed [loyalty reward](/doc/models/loyalty-reward.md).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | getRewardId(): ?string | setRewardId(?string rewardId): void | +| `orderId` | `?string` | Optional | The ID of the [order](/doc/models/order.md) that redeemed the reward.
This field is returned only if the Orders API is used to process orders. | getOrderId(): ?string | setOrderId(?string orderId): void | ## Example (as JSON) diff --git a/doc/models/loyalty-event.md b/doc/models/loyalty-event.md index ae0774b2..873d1016 100644 --- a/doc/models/loyalty-event.md +++ b/doc/models/loyalty-event.md @@ -20,8 +20,8 @@ For more information, see [Loyalty events](https://developer.squareup.com/docs/l | `redeemReward` | [`?LoyaltyEventRedeemReward`](/doc/models/loyalty-event-redeem-reward.md) | Optional | Provides metadata when the event `type` is `REDEEM_REWARD`. | getRedeemReward(): ?LoyaltyEventRedeemReward | setRedeemReward(?LoyaltyEventRedeemReward redeemReward): void | | `deleteReward` | [`?LoyaltyEventDeleteReward`](/doc/models/loyalty-event-delete-reward.md) | Optional | Provides metadata when the event `type` is `DELETE_REWARD`. | getDeleteReward(): ?LoyaltyEventDeleteReward | setDeleteReward(?LoyaltyEventDeleteReward deleteReward): void | | `adjustPoints` | [`?LoyaltyEventAdjustPoints`](/doc/models/loyalty-event-adjust-points.md) | Optional | Provides metadata when the event `type` is `ADJUST_POINTS`. | getAdjustPoints(): ?LoyaltyEventAdjustPoints | setAdjustPoints(?LoyaltyEventAdjustPoints adjustPoints): void | -| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](#type-LoyaltyAccount) in which the event occurred.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | -| `locationId` | `?string` | Optional | The ID of the [location](#type-Location) where the event occurred. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](/doc/models/loyalty-account.md) in which the event occurred.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | +| `locationId` | `?string` | Optional | The ID of the [location](/doc/models/location.md) where the event occurred. | getLocationId(): ?string | setLocationId(?string locationId): void | | `source` | [`string (LoyaltyEventSource)`](/doc/models/loyalty-event-source.md) | Required | Defines whether the event was generated by the Square Point of Sale. | getSource(): string | setSource(string source): void | | `expirePoints` | [`?LoyaltyEventExpirePoints`](/doc/models/loyalty-event-expire-points.md) | Optional | Provides metadata when the event `type` is `EXPIRE_POINTS`. | getExpirePoints(): ?LoyaltyEventExpirePoints | setExpirePoints(?LoyaltyEventExpirePoints expirePoints): void | | `otherEvent` | [`?LoyaltyEventOther`](/doc/models/loyalty-event-other.md) | Optional | Provides metadata when the event `type` is `OTHER`. | getOtherEvent(): ?LoyaltyEventOther | setOtherEvent(?LoyaltyEventOther otherEvent): void | diff --git a/doc/models/loyalty-program-accrual-rule.md b/doc/models/loyalty-program-accrual-rule.md index 0417a2dc..6eba086c 100644 --- a/doc/models/loyalty-program-accrual-rule.md +++ b/doc/models/loyalty-program-accrual-rule.md @@ -15,7 +15,7 @@ Defines an accrual rule, which is how buyers can earn points. | `points` | `?int` | Optional | The number of points that
buyers earn based on the `accrual_type`.
**Constraints**: `>= 1` | getPoints(): ?int | setPoints(?int points): void | | `visitMinimumAmountMoney` | [`?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. | getVisitMinimumAmountMoney(): ?Money | setVisitMinimumAmountMoney(?Money visitMinimumAmountMoney): void | | `spendAmountMoney` | [`?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. | getSpendAmountMoney(): ?Money | setSpendAmountMoney(?Money spendAmountMoney): void | -| `catalogObjectId` | `?string` | Optional | The ID of the [catalog object](#type-CatalogObject) to purchase to earn the number of points defined by the
rule. This is either an item variation or a category, depending on the type. This is defined on
`ITEM_VARIATION` rules and `CATEGORY` rules. | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The ID of the [catalog object](/doc/models/catalog-object.md) to purchase to earn the number of points defined by the
rule. This is either an item variation or a category, depending on the type. This is defined on
`ITEM_VARIATION` rules and `CATEGORY` rules. | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | ## Example (as JSON) diff --git a/doc/models/loyalty-program-reward-tier.md b/doc/models/loyalty-program-reward-tier.md index 32b2eed1..cc15e47a 100644 --- a/doc/models/loyalty-program-reward-tier.md +++ b/doc/models/loyalty-program-reward-tier.md @@ -1,7 +1,7 @@ # Loyalty Program Reward Tier -Describes a loyalty program reward tier. +Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers. ## Structure diff --git a/doc/models/loyalty-program.md b/doc/models/loyalty-program.md index c233fd18..cbe2db9d 100644 --- a/doc/models/loyalty-program.md +++ b/doc/models/loyalty-program.md @@ -14,7 +14,7 @@ | `rewardTiers` | [`LoyaltyProgramRewardTier[]`](/doc/models/loyalty-program-reward-tier.md) | Required | The list of rewards for buyers, sorted by ascending points. | getRewardTiers(): array | setRewardTiers(array rewardTiers): void | | `expirationPolicy` | [`?LoyaltyProgramExpirationPolicy`](/doc/models/loyalty-program-expiration-policy.md) | Optional | Describes when the loyalty program expires. | getExpirationPolicy(): ?LoyaltyProgramExpirationPolicy | setExpirationPolicy(?LoyaltyProgramExpirationPolicy expirationPolicy): void | | `terminology` | [`LoyaltyProgramTerminology`](/doc/models/loyalty-program-terminology.md) | Required | - | getTerminology(): LoyaltyProgramTerminology | setTerminology(LoyaltyProgramTerminology terminology): void | -| `locationIds` | `string[]` | Required | The [locations](#type-Location) at which the program is active. | getLocationIds(): array | setLocationIds(array locationIds): void | +| `locationIds` | `string[]` | Required | The [locations](/doc/models/location.md) at which the program is active. | getLocationIds(): array | setLocationIds(array locationIds): void | | `createdAt` | `string` | Required | The timestamp when the program was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | getCreatedAt(): string | setCreatedAt(string createdAt): void | | `updatedAt` | `string` | Required | The timestamp when the reward was last updated, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | getUpdatedAt(): string | setUpdatedAt(string updatedAt): void | | `accrualRules` | [`LoyaltyProgramAccrualRule[]`](/doc/models/loyalty-program-accrual-rule.md) | Required | Defines how buyers can earn loyalty points. | getAccrualRules(): array | setAccrualRules(array accrualRules): void | diff --git a/doc/models/loyalty-reward.md b/doc/models/loyalty-reward.md index ecf1f32f..3391f593 100644 --- a/doc/models/loyalty-reward.md +++ b/doc/models/loyalty-reward.md @@ -1,6 +1,8 @@ # Loyalty Reward +Represents a contract to redeem loyalty points for a [reward tier](/doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty-rewards). + ## Structure `LoyaltyReward` @@ -11,10 +13,10 @@ | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | The Square-assigned ID of the loyalty reward.
**Constraints**: *Maximum Length*: `36` | getId(): ?string | setId(?string id): void | | `status` | [`?string (LoyaltyRewardStatus)`](/doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | getStatus(): ?string | setStatus(?string status): void | -| `loyaltyAccountId` | `string` | Required | The Square-assigned ID of the [loyalty account](#type-LoyaltyAccount) to which the reward belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | -| `rewardTierId` | `string` | Required | The Square-assigned ID of the [reward tier](#type-LoyaltyProgramRewardTier) used to create the reward.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getRewardTierId(): string | setRewardTierId(string rewardTierId): void | +| `loyaltyAccountId` | `string` | Required | The Square-assigned ID of the [loyalty account](/doc/models/loyalty-account.md) to which the reward belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | +| `rewardTierId` | `string` | Required | The Square-assigned ID of the [reward tier](/doc/models/loyalty-program-reward-tier.md) used to create the reward.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | getRewardTierId(): string | setRewardTierId(string rewardTierId): void | | `points` | `?int` | Optional | The number of loyalty points used for the reward.
**Constraints**: `>= 1` | getPoints(): ?int | setPoints(?int points): void | -| `orderId` | `?string` | Optional | The Square-assigned ID of the [order](#type-Order) to which the reward is attached. | getOrderId(): ?string | setOrderId(?string orderId): void | +| `orderId` | `?string` | Optional | The Square-assigned ID of the [order](/doc/models/order.md) to which the reward is attached. | getOrderId(): ?string | setOrderId(?string orderId): void | | `createdAt` | `?string` | Optional | The timestamp when the reward was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | | `redeemedAt` | `?string` | Optional | The timestamp when the reward was redeemed, in RFC 3339 format. | getRedeemedAt(): ?string | setRedeemedAt(?string redeemedAt): void | diff --git a/doc/models/obtain-token-request.md b/doc/models/obtain-token-request.md index f23b673e..ca4e51bb 100644 --- a/doc/models/obtain-token-request.md +++ b/doc/models/obtain-token-request.md @@ -9,13 +9,13 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `clientId` | `string` | Required | The Square-issued ID of your application, available from the
[application dashboard](https://connect.squareup.com/apps). | getClientId(): string | setClientId(string clientId): void | -| `clientSecret` | `string` | Required | The Square-issued application secret for your application, available
from the [application dashboard](https://connect.squareup.com/apps). | getClientSecret(): string | setClientSecret(string clientSecret): void | -| `code` | `?string` | Optional | The authorization code to exchange.
This is required if `grant_type` is set to `authorization_code`, to indicate that
the application wants to exchange an authorization code for an OAuth access token. | getCode(): ?string | setCode(?string code): void | -| `redirectUri` | `?string` | Optional | The redirect URL assigned in the [application dashboard](https://connect.squareup.com/apps). | getRedirectUri(): ?string | setRedirectUri(?string redirectUri): void | -| `grantType` | `string` | Required | Specifies the method to request an OAuth access token.
Valid values are: `authorization_code`, `refresh_token`, and `migration_token` | getGrantType(): string | setGrantType(string grantType): void | -| `refreshToken` | `?string` | Optional | A valid refresh token for generating a new OAuth access token.
A valid refresh token is required if `grant_type` is set to `refresh_token` ,
to indicate the application wants a replacement for an expired OAuth access token. | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | -| `migrationToken` | `?string` | Optional | Legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if `grant_type` is set to
`migration_token` to indicate that the application wants to get a replacement
OAuth access token. The response also returns a refresh token.
For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/authz/oauth/migration). | getMigrationToken(): ?string | setMigrationToken(?string migrationToken): void | +| `clientId` | `string` | Required | The Square-issued ID of your application, available from the
[application dashboard](https://connect.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): string | setClientId(string clientId): void | +| `clientSecret` | `string` | Required | The Square-issued application secret for your application, available
from the [application dashboard](https://connect.squareup.com/apps).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getClientSecret(): string | setClientSecret(string clientSecret): void | +| `code` | `?string` | Optional | The authorization code to exchange.
This is required if `grant_type` is set to `authorization_code`, to indicate that
the application wants to exchange an authorization code for an OAuth access token.
**Constraints**: *Maximum Length*: `191` | getCode(): ?string | setCode(?string code): void | +| `redirectUri` | `?string` | Optional | The redirect URL assigned in the [application dashboard](https://connect.squareup.com/apps).
**Constraints**: *Maximum Length*: `2048` | getRedirectUri(): ?string | setRedirectUri(?string redirectUri): void | +| `grantType` | `string` | Required | Specifies the method to request an OAuth access token.
Valid values are: `authorization_code`, `refresh_token`, and `migration_token`
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `20` | getGrantType(): string | setGrantType(string grantType): void | +| `refreshToken` | `?string` | Optional | A valid refresh token for generating a new OAuth access token.
A valid refresh token is required if `grant_type` is set to `refresh_token` ,
to indicate the application wants a replacement for an expired OAuth access token.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | +| `migrationToken` | `?string` | Optional | Legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if `grant_type` is set to
`migration_token` to indicate that the application wants to get a replacement
OAuth access token. The response also returns a refresh token.
For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getMigrationToken(): ?string | setMigrationToken(?string migrationToken): void | | `scopes` | `?(string[])` | Optional | __OPTIONAL__

A JSON list of strings representing the permissions the application is requesting.
For example: "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`"
The access token returned in the response is granted the permissions
that comprise the intersection between the requested list of permissions, and those
that belong to the provided refresh token. | getScopes(): ?array | setScopes(?array scopes): void | | `shortLived` | `?bool` | Optional | __OPTIONAL__

A boolean indicating a request for a short-lived access token.
The short-lived access token returned in the response will expire in 24 hours. | getShortLived(): ?bool | setShortLived(?bool shortLived): void | diff --git a/doc/models/obtain-token-response.md b/doc/models/obtain-token-response.md index 0fae4c70..116f9470 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. See [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough)
for more information. | getAccessToken(): ?string | setAccessToken(?string accessToken): void | -| `tokenType` | `?string` | Optional | This value is always _bearer_. | getTokenType(): ?string | setTokenType(?string tokenType): void | -| `expiresAt` | `?string` | Optional | The date when access_token expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `merchantId` | `?string` | Optional | The ID of the authorizing merchant's business. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | +| `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. See [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough)
for more information.
**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 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. Only present if the merchant signed up for a subscription during authorization. | getSubscriptionId(): ?string | setSubscriptionId(?string subscriptionId): void | | `planId` | `?string` | Optional | __LEGACY FIELD__. The ID of the subscription plan the merchant signed
up for. Only present if the merchant signed up for a subscription during
authorization. | getPlanId(): ?string | setPlanId(?string planId): void | | `idToken` | `?string` | Optional | Then OpenID token belonging to this this person. Only present if the
OPENID scope is included in the authorize request. | getIdToken(): ?string | setIdToken(?string idToken): void | -| `refreshToken` | `?string` | Optional | A refresh token. OAuth refresh tokens are 64 bytes long.
For more information, see [OAuth access token management](https://developer.squareup.com/docs/authz/oauth/how-it-works#oauth-access-token-management). | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | +| `refreshToken` | `?string` | Optional | A refresh token. OAuth refresh tokens are 64 bytes long.
For more information, see [OAuth access token management](https://developer.squareup.com/docs/oauth-api/how-it-works#oauth-access-token-management).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | | `shortLived` | `?bool` | Optional | A boolean indicating the access token is a short-lived access token.
The short-lived access token returned in the response will expire in 24 hours. | getShortLived(): ?bool | setShortLived(?bool shortLived): void | ## Example (as JSON) diff --git a/doc/models/onboard-appointments-response.md b/doc/models/onboard-appointments-response.md deleted file mode 100644 index 9c0944fd..00000000 --- a/doc/models/onboard-appointments-response.md +++ /dev/null @@ -1,40 +0,0 @@ - -# Onboard Appointments Response - -## Structure - -`OnboardAppointmentsResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "errors": [ - { - "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", - "detail": "detail1", - "field": "field9" - }, - { - "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", - "detail": "detail2", - "field": "field0" - }, - { - "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", - "detail": "detail3", - "field": "field1" - } - ] -} -``` - diff --git a/doc/models/order-entry.md b/doc/models/order-entry.md index fd76fc72..ec5ec7da 100644 --- a/doc/models/order-entry.md +++ b/doc/models/order-entry.md @@ -1,8 +1,8 @@ # Order Entry -A lightweight description of an [Order](#type-order) that is returned when `returned_entries` is true on a -[SearchOrderRequest](#type-searchorderrequest) +A lightweight description of an [Order](/doc/models/order.md) that is returned when +`returned_entries` is true on a [SearchOrdersRequest](/doc/apis/orders.md#search-orders) ## Structure diff --git a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md b/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md index 76dc3597..9abb2cd6 100644 --- a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md +++ b/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md @@ -12,7 +12,7 @@ Specific details for curbside pickup. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `curbsideDetails` | `?string` | Optional | Specific details for curbside pickup, such as parking number, vehicle model, etc.
**Constraints**: *Maximum Length*: `250` | getCurbsideDetails(): ?string | setCurbsideDetails(?string curbsideDetails): void | -| `buyerArrivedAt` | `?string` | Optional | The [timestamp](#workingwithdates) in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z",
indicating when the buyer arrived and is waiting for pickup. | getBuyerArrivedAt(): ?string | setBuyerArrivedAt(?string buyerArrivedAt): void | +| `buyerArrivedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", indicating when the buyer
arrived and is waiting for pickup. | getBuyerArrivedAt(): ?string | setBuyerArrivedAt(?string buyerArrivedAt): void | ## Example (as JSON) diff --git a/doc/models/order-fulfillment-pickup-details.md b/doc/models/order-fulfillment-pickup-details.md index 42ddecc3..19b1b51c 100644 --- a/doc/models/order-fulfillment-pickup-details.md +++ b/doc/models/order-fulfillment-pickup-details.md @@ -12,20 +12,20 @@ Contains details necessary to fulfill a pickup order. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `recipient` | [`?OrderFulfillmentRecipient`](/doc/models/order-fulfillment-recipient.md) | Optional | Contains information on the recipient of a fulfillment. | getRecipient(): ?OrderFulfillmentRecipient | setRecipient(?OrderFulfillmentRecipient recipient): void | -| `expiresAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when this fulfillment
will expire if it is not accepted. Must be in RFC 3339 format
e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7
days in the future. If `expires_at` is not set, this pickup fulfillment
will be automatically accepted when placed. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | +| `expiresAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment will expire if it is not accepted. Must be in RFC 3339 format
e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7 days in the future.
If `expires_at` is not set, this pickup fulfillment will be automatically accepted when
placed. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | | `autoCompleteDuration` | `?string` | Optional | The duration of time after which an open and accepted pickup fulfillment
will automatically move to the `COMPLETED` state. Must be in RFC3339
duration format e.g., "P1W3D".

If not set, this pickup fulfillment will remain accepted until it is canceled or completed. | getAutoCompleteDuration(): ?string | setAutoCompleteDuration(?string autoCompleteDuration): void | | `scheduleType` | [`?string (OrderFulfillmentPickupDetailsScheduleType)`](/doc/models/order-fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | getScheduleType(): ?string | setScheduleType(?string scheduleType): void | -| `pickupAt` | `?string` | Optional | The [timestamp](#workingwithdates) that represents the start of the pickup window.
Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z".
For fulfillments with the schedule type `ASAP`, this is automatically set
to the current time plus the expected duration to prepare the fulfillment. | getPickupAt(): ?string | setPickupAt(?string pickupAt): void | +| `pickupAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
that represents the start of the pickup window. Must be in RFC3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z".

For fulfillments with the schedule type `ASAP`, this is automatically set
to the current time plus the expected duration to prepare the fulfillment. | getPickupAt(): ?string | setPickupAt(?string pickupAt): void | | `pickupWindowDuration` | `?string` | Optional | The window of time in which the order should be picked up after the `pickup_at` timestamp.
Must be in RFC3339 duration format, e.g., "P1W3D". Can be used as an
informational guideline for merchants. | getPickupWindowDuration(): ?string | setPickupWindowDuration(?string pickupWindowDuration): void | | `prepTimeDuration` | `?string` | Optional | The duration of time it takes to prepare this fulfillment.
Must be in RFC3339 duration format, e.g., "P1W3D". | getPrepTimeDuration(): ?string | setPrepTimeDuration(?string prepTimeDuration): void | | `note` | `?string` | Optional | A note meant to provide additional instructions about the pickup
fulfillment displayed in the Square Point of Sale and set by the API.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | -| `placedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the fulfillment
was placed. Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `acceptedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the fulfillment
was accepted. In RFC3339 timestamp format,
e.g., "2016-09-04T23:59:33.123Z". | getAcceptedAt(): ?string | setAcceptedAt(?string acceptedAt): void | -| `rejectedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the fulfillment
was rejected. In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getRejectedAt(): ?string | setRejectedAt(?string rejectedAt): void | -| `readyAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the fulfillment is
marked as ready for pickup. In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getReadyAt(): ?string | setReadyAt(?string readyAt): void | -| `expiredAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the fulfillment expired.
In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getExpiredAt(): ?string | setExpiredAt(?string expiredAt): void | -| `pickedUpAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the fulfillment
was picked up by the recipient. In RFC3339 timestamp format,
e.g., "2016-09-04T23:59:33.123Z". | getPickedUpAt(): ?string | setPickedUpAt(?string pickedUpAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z",
indicating when the fulfillment was canceled. | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | +| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was placed. Must be in RFC3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z". | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | +| `acceptedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was accepted. In RFC3339 timestamp format,
e.g., "2016-09-04T23:59:33.123Z". | getAcceptedAt(): ?string | setAcceptedAt(?string acceptedAt): void | +| `rejectedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was rejected. In RFC3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z". | getRejectedAt(): ?string | setRejectedAt(?string rejectedAt): void | +| `readyAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment is marked as ready for pickup. In RFC3339 timestamp format,
e.g., "2016-09-04T23:59:33.123Z". | getReadyAt(): ?string | setReadyAt(?string readyAt): void | +| `expiredAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the fulfillment expired.
In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getExpiredAt(): ?string | setExpiredAt(?string expiredAt): void | +| `pickedUpAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was picked up by the recipient. In RFC3339 timestamp format,
e.g., "2016-09-04T23:59:33.123Z". | getPickedUpAt(): ?string | setPickedUpAt(?string pickedUpAt): void | +| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", indicating when the
fulfillment was canceled. | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | | `cancelReason` | `?string` | Optional | A description of why the pickup was canceled. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | | `isCurbsidePickup` | `?bool` | Optional | If true, indicates this pickup order is for curbside pickup, not in-store pickup. | getIsCurbsidePickup(): ?bool | setIsCurbsidePickup(?bool isCurbsidePickup): void | | `curbsidePickupDetails` | [`?OrderFulfillmentPickupDetailsCurbsidePickupDetails`](/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md) | Optional | Specific details for curbside pickup. | getCurbsidePickupDetails(): ?OrderFulfillmentPickupDetailsCurbsidePickupDetails | setCurbsidePickupDetails(?OrderFulfillmentPickupDetailsCurbsidePickupDetails curbsidePickupDetails): void | diff --git a/doc/models/order-fulfillment-shipment-details.md b/doc/models/order-fulfillment-shipment-details.md index 9e601abc..bbeb09d0 100644 --- a/doc/models/order-fulfillment-shipment-details.md +++ b/doc/models/order-fulfillment-shipment-details.md @@ -17,14 +17,14 @@ Contains details necessary to fulfill a shipment order. | `shippingType` | `?string` | Optional | A description of the type of shipping product purchased from the carrier.
e.g. First Class, Priority, Express
**Constraints**: *Maximum Length*: `50` | getShippingType(): ?string | setShippingType(?string shippingType): void | | `trackingNumber` | `?string` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | getTrackingNumber(): ?string | setTrackingNumber(?string trackingNumber): void | | `trackingUrl` | `?string` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | getTrackingUrl(): ?string | setTrackingUrl(?string trackingUrl): void | -| `placedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the shipment was
requested. Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | -| `inProgressAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when this fulfillment was
moved to the `RESERVED` state. Indicates that preparation of this shipment has begun.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getInProgressAt(): ?string | setInProgressAt(?string inProgressAt): void | -| `packagedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when this fulfillment
was moved to the `PREPARED` state. Indicates that the fulfillment is packaged.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPackagedAt(): ?string | setPackagedAt(?string packagedAt): void | -| `expectedShippedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the shipment is
expected to be delivered to the shipping carrier. Must be in RFC 3339 timestamp
format, e.g., "2016-09-04T23:59:33.123Z". | getExpectedShippedAt(): ?string | setExpectedShippedAt(?string expectedShippedAt): void | -| `shippedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when this fulfillment
was moved to the `COMPLETED`state. Indicates that the fulfillment has been given
to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getShippedAt(): ?string | setShippedAt(?string shippedAt): void | -| `canceledAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating the shipment was canceled.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | +| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment was requested.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPlacedAt(): ?string | setPlacedAt(?string placedAt): void | +| `inProgressAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment wasmoved to the `RESERVED` state. Indicates that preparation
of this shipment has begun.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getInProgressAt(): ?string | setInProgressAt(?string inProgressAt): void | +| `packagedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when this fulfillment
was moved to the `PREPARED` state. Indicates that the fulfillment is packaged.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getPackagedAt(): ?string | setPackagedAt(?string packagedAt): void | +| `expectedShippedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment is expected to be delivered to the shipping carrier. Must be in
RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getExpectedShippedAt(): ?string | setExpectedShippedAt(?string expectedShippedAt): void | +| `shippedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment was moved to the `COMPLETED`state. Indicates that the fulfillment
has been given to the shipping carrier. Must be in RFC 3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z". | getShippedAt(): ?string | setShippedAt(?string shippedAt): void | +| `canceledAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating the shipment was canceled.
Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | | `cancelReason` | `?string` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | -| `failedAt` | `?string` | Optional | The [timestamp](#workingwithdates) indicating when the shipment
failed to be completed. Must be in RFC 3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z". | getFailedAt(): ?string | setFailedAt(?string failedAt): void | +| `failedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when the shipment
failed to be completed. Must be in RFC 3339 timestamp format, e.g.,
"2016-09-04T23:59:33.123Z". | getFailedAt(): ?string | setFailedAt(?string failedAt): void | | `failureReason` | `?string` | Optional | A description of why the shipment failed to be completed.
**Constraints**: *Maximum Length*: `100` | getFailureReason(): ?string | setFailureReason(?string failureReason): void | ## Example (as JSON) diff --git a/doc/models/order-fulfillment-type.md b/doc/models/order-fulfillment-type.md index e88cd165..a52c8d68 100644 --- a/doc/models/order-fulfillment-type.md +++ b/doc/models/order-fulfillment-type.md @@ -11,6 +11,6 @@ The type of fulfillment. | Name | Description | | --- | --- | -| `PICKUP` | A fulfillment to be picked up from a physical [location](#type-location)
by a recipient. | +| `PICKUP` | A fulfillment to be picked up from a physical [location](/doc/models/location.md)
by a recipient. | | `SHIPMENT` | A fulfillment to be shipped by a shipping carrier. | diff --git a/doc/models/order-line-item-discount.md b/doc/models/order-line-item-discount.md index 1b883722..2f49f988 100644 --- a/doc/models/order-line-item-discount.md +++ b/doc/models/order-line-item-discount.md @@ -17,16 +17,16 @@ amount contributed by the item to the order subtotal. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogDiscount](#type-catalogdiscount).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogDiscount](/doc/models/catalog-discount.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `name` | `?string` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | | `type` | [`?string (OrderLineItemDiscountType)`](/doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | | `percentage` | `?string` | Optional | The percentage of the discount, as a string representation of a decimal number.
A value of `7.25` corresponds to a percentage of 7.25%.

`percentage` is not set for amount-based discounts.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | | `amountMoney` | [`?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. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | | `appliedMoney` | [`?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. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this discount. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. | getMetadata(): ?array | setMetadata(?array metadata): void | +| `metadata` | `?array` | Optional | Application-defined data attached to this discount. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more
information. | getMetadata(): ?array | setMetadata(?array metadata): void | | `scope` | [`?string (OrderLineItemDiscountScope)`](/doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line item or order level discount. | getScope(): ?string | setScope(?string scope): void | | `rewardIds` | `?(string[])` | Optional | The reward identifiers corresponding to this discount. The application and
specification of discounts that have `reward_ids` are completely controlled by the backing
criteria corresponding to the reward tiers of the rewards that are added to the order
through the Loyalty API. To manually unapply discounts that are the result of added rewards,
the rewards must be removed from the order through the Loyalty API. | getRewardIds(): ?array | setRewardIds(?array rewardIds): void | -| `pricingRuleId` | `?string` | Optional | The object identifier of a [pricing rule](#type-CatalogPricingRule) to be applied automatically
to this discount. The specification and application of the discounts, to which a `pricing_rule_id` is
assigned, are completely controlled by the corresponding pricing rule. | getPricingRuleId(): ?string | setPricingRuleId(?string pricingRuleId): void | +| `pricingRuleId` | `?string` | Optional | The object identifier of a [pricing rule](/doc/models/catalog-pricing-rule.md) to be applied
automatically to this discount. The specification and application of the discounts, to
which a `pricing_rule_id` is assigned, are completely controlled by the corresponding
pricing rule. | getPricingRuleId(): ?string | setPricingRuleId(?string pricingRuleId): void | ## Example (as JSON) diff --git a/doc/models/order-line-item-modifier.md b/doc/models/order-line-item-modifier.md index c33b0ddb..6899f5df 100644 --- a/doc/models/order-line-item-modifier.md +++ b/doc/models/order-line-item-modifier.md @@ -1,7 +1,7 @@ # Order Line Item Modifier -A [CatalogModifier](#type-catalogmodifier). +A [CatalogModifier](/doc/models/catalog-modifier.md). ## Structure @@ -12,7 +12,7 @@ A [CatalogModifier](#type-catalogmodifier). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the modifier only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogModifier](#type-catalogmodifier).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogModifier](/doc/models/catalog-modifier.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `name` | `?string` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | | `basePriceMoney` | [`?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. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | | `totalPriceMoney` | [`?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. | getTotalPriceMoney(): ?Money | setTotalPriceMoney(?Money totalPriceMoney): void | diff --git a/doc/models/order-line-item-tax.md b/doc/models/order-line-item-tax.md index 75f89477..170b0bed 100644 --- a/doc/models/order-line-item-tax.md +++ b/doc/models/order-line-item-tax.md @@ -16,11 +16,11 @@ contributes to the order subtotal. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogTax](#type-catalogtax).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogTax](/doc/models/catalog-tax.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `name` | `?string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | | `type` | [`?string (OrderLineItemTaxType)`](/doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | | `percentage` | `?string` | Optional | The percentage of the tax, as a string representation of a decimal
number. For example, a value of `"7.25"` corresponds to a percentage of
7.25%.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this tax. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. | getMetadata(): ?array | setMetadata(?array metadata): void | +| `metadata` | `?array` | Optional | Application-defined data attached to this tax. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more
information. | getMetadata(): ?array | setMetadata(?array metadata): void | | `appliedMoney` | [`?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. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | | `scope` | [`?string (OrderLineItemTaxScope)`](/doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line item or order level tax. | getScope(): ?string | setScope(?string scope): void | | `autoApplied` | `?bool` | Optional | Determines whether the tax was automatically applied to the order based on
the catalog configuration. For an example, see
[Automatically Apply Taxes to an Order](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes). | getAutoApplied(): ?bool | setAutoApplied(?bool autoApplied): void | diff --git a/doc/models/order-line-item.md b/doc/models/order-line-item.md index dc3e909f..ffffa4fb 100644 --- a/doc/models/order-line-item.md +++ b/doc/models/order-line-item.md @@ -17,10 +17,10 @@ product to purchase, with its own quantity and price details. | `quantity` | `string` | Required | The quantity purchased, formatted as a decimal number.
For example: `"3"`.

Line items with a quantity of `"0"` will be automatically removed
upon paying for or otherwise completing the order.

Line items with a `quantity_unit` can have non-integer quantities.
For example: `"1.70000"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | getQuantity(): string | setQuantity(string quantity): void | | `quantityUnit` | [`?OrderQuantityUnit`](/doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision which
specifies the number of digits after the decimal point for decimal quantities. | getQuantityUnit(): ?OrderQuantityUnit | setQuantityUnit(?OrderQuantityUnit quantityUnit): void | | `note` | `?string` | Optional | The note of the line item.
**Constraints**: *Maximum Length*: `2000` | getNote(): ?string | setNote(?string note): void | -| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](/doc/models/catalog-item-variation.md) id applied to this line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `variationName` | `?string` | Optional | The name of the variation applied to this line item.
**Constraints**: *Maximum Length*: `255` | getVariationName(): ?string | setVariationName(?string variationName): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this line item. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. | getMetadata(): ?array | setMetadata(?array metadata): void | -| `modifiers` | [`?(OrderLineItemModifier[])`](/doc/models/order-line-item-modifier.md) | Optional | The [CatalogModifier](#type-catalogmodifier)s applied to this line item. | getModifiers(): ?array | setModifiers(?array modifiers): void | +| `metadata` | `?array` | Optional | Application-defined data attached to this line item. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more
information. | getMetadata(): ?array | setMetadata(?array metadata): void | +| `modifiers` | [`?(OrderLineItemModifier[])`](/doc/models/order-line-item-modifier.md) | Optional | The [CatalogModifier](/doc/models/catalog-modifier.md)s applied to this line item. | getModifiers(): ?array | setModifiers(?array modifiers): void | | `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to taxes applied to this line item. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a
top-level `OrderLineItemTax` applied to the line item. On reads, the
amount applied is populated.

An `OrderLineItemAppliedTax` will be automatically created on every line
item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax`
records for `LINE_ITEM` scoped taxes must be added in requests for the tax
to apply to any line items.

To change the amount of a tax, modify the referenced top-level tax. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | | `appliedDiscounts` | [`?(OrderLineItemAppliedDiscount[])`](/doc/models/order-line-item-applied-discount.md) | Optional | The list of references to discounts applied to this line item. Each
`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level
`OrderLineItemDiscounts` applied to the line item. On reads, the amount
applied is populated.

An `OrderLineItemAppliedDiscount` will be automatically created on every line item for all
`ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records
for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any
line items.

To change the amount of a discount, modify the referenced top-level discount. | getAppliedDiscounts(): ?array | setAppliedDiscounts(?array appliedDiscounts): void | | `basePriceMoney` | [`?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. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | diff --git a/doc/models/order-pricing-options.md b/doc/models/order-pricing-options.md index 43909dae..aa1c65a9 100644 --- a/doc/models/order-pricing-options.md +++ b/doc/models/order-pricing-options.md @@ -3,7 +3,7 @@ Pricing options for an order. The options affect how the order's price is calculated. They can be used, for example, to apply automatic price adjustments that are based on pre-configured -[pricing rules](https://developer.squareup.com/docs/reference/square/objects/CatalogPricingRule). +[pricing rules](/doc/models/catalog-pricing-rule.md). ## Structure diff --git a/doc/models/order-return-discount.md b/doc/models/order-return-discount.md index 9226c7a5..6cf37b41 100644 --- a/doc/models/order-return-discount.md +++ b/doc/models/order-return-discount.md @@ -18,7 +18,7 @@ order subtotal. | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the return discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `sourceDiscountUid` | `?string` | Optional | `uid` of the Discount from the Order which contains the original application of this discount.
**Constraints**: *Maximum Length*: `60` | getSourceDiscountUid(): ?string | setSourceDiscountUid(?string sourceDiscountUid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogDiscount](#type-catalogdiscount).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogDiscount](/doc/models/catalog-discount.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `name` | `?string` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | | `type` | [`?string (OrderLineItemDiscountType)`](/doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | | `percentage` | `?string` | Optional | The percentage of the tax, as a string representation of a decimal number.
A value of `7.25` corresponds to a percentage of 7.25%.

`percentage` is not set for amount-based discounts.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | diff --git a/doc/models/order-return-line-item-modifier.md b/doc/models/order-return-line-item-modifier.md index 4519ffde..c2ba61e8 100644 --- a/doc/models/order-return-line-item-modifier.md +++ b/doc/models/order-return-line-item-modifier.md @@ -13,7 +13,7 @@ A line item modifier being returned. | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the return modifier only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `sourceModifierUid` | `?string` | Optional | `uid` of the Modifier from the LineItem from the Order which contains the
original sale of this line item modifier.
**Constraints**: *Maximum Length*: `60` | getSourceModifierUid(): ?string | setSourceModifierUid(?string sourceModifierUid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogModifier](#type-catalogmodifier).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogModifier](/doc/models/catalog-modifier.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `name` | `?string` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | | `basePriceMoney` | [`?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. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | | `totalPriceMoney` | [`?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. | getTotalPriceMoney(): ?Money | setTotalPriceMoney(?Money totalPriceMoney): void | diff --git a/doc/models/order-return-line-item.md b/doc/models/order-return-line-item.md index 4d1e84cb..58c0f07b 100644 --- a/doc/models/order-return-line-item.md +++ b/doc/models/order-return-line-item.md @@ -17,9 +17,9 @@ The line item being returned in an Order. | `quantity` | `string` | Required | The quantity returned, formatted as a decimal number.
For example: `"3"`.

Line items with a `quantity_unit` can have non-integer quantities.
For example: `"1.70000"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | getQuantity(): string | setQuantity(string quantity): void | | `quantityUnit` | [`?OrderQuantityUnit`](/doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision which
specifies the number of digits after the decimal point for decimal quantities. | getQuantityUnit(): ?OrderQuantityUnit | setQuantityUnit(?OrderQuantityUnit quantityUnit): void | | `note` | `?string` | Optional | The note of the returned line item.
**Constraints**: *Maximum Length*: `2000` | getNote(): ?string | setNote(?string note): void | -| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](#type-catalogitemvariation) id applied to this returned line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](/doc/models/catalog-item-variation.md) id applied to this returned line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `variationName` | `?string` | Optional | The name of the variation applied to this returned line item.
**Constraints**: *Maximum Length*: `255` | getVariationName(): ?string | setVariationName(?string variationName): void | -| `returnModifiers` | [`?(OrderReturnLineItemModifier[])`](/doc/models/order-return-line-item-modifier.md) | Optional | The [CatalogModifier](#type-catalogmodifier)s applied to this line item. | getReturnModifiers(): ?array | setReturnModifiers(?array returnModifiers): void | +| `returnModifiers` | [`?(OrderReturnLineItemModifier[])`](/doc/models/order-return-line-item-modifier.md) | Optional | The [CatalogModifier](/doc/models/catalog-modifier.md)s applied to this line item. | getReturnModifiers(): ?array | setReturnModifiers(?array returnModifiers): void | | `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to `OrderReturnTax` entities applied to the returned line item. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level
`OrderReturnTax` applied to the returned line item. On reads, the amount applied
is populated. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | | `appliedDiscounts` | [`?(OrderLineItemAppliedDiscount[])`](/doc/models/order-line-item-applied-discount.md) | Optional | The list of references to `OrderReturnDiscount` entities applied to the returned line item. Each
`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level
`OrderReturnDiscount` applied to the returned line item. On reads, the amount
applied is populated. | getAppliedDiscounts(): ?array | setAppliedDiscounts(?array appliedDiscounts): void | | `basePriceMoney` | [`?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. | getBasePriceMoney(): ?Money | setBasePriceMoney(?Money basePriceMoney): void | diff --git a/doc/models/order-return-service-charge.md b/doc/models/order-return-service-charge.md index 0785853f..79bee3ec 100644 --- a/doc/models/order-return-service-charge.md +++ b/doc/models/order-return-service-charge.md @@ -14,7 +14,7 @@ Represents the service charge applied to the original order. | `uid` | `?string` | Optional | Unique ID that identifies the return service charge only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `sourceServiceChargeUid` | `?string` | Optional | `uid` of the Service Charge from the Order containing the original
charge of the service charge. `source_service_charge_uid` is `null` for
unlinked returns.
**Constraints**: *Maximum Length*: `60` | getSourceServiceChargeUid(): ?string | setSourceServiceChargeUid(?string sourceServiceChargeUid): void | | `name` | `?string` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID of the associated [CatalogServiceCharge](#type-catalogservicecharge).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object ID of the associated [OrderServiceCharge](/doc/models/order-service-charge.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `percentage` | `?string` | Optional | The percentage of the service charge, as a string representation of
a decimal number. For example, a value of `"7.25"` corresponds to a
percentage of 7.25%.

Exactly one of `percentage` or `amount_money` should be set.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | | `amountMoney` | [`?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. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | | `appliedMoney` | [`?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. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | diff --git a/doc/models/order-return-tax.md b/doc/models/order-return-tax.md index 9237148c..61df2f7f 100644 --- a/doc/models/order-return-tax.md +++ b/doc/models/order-return-tax.md @@ -17,7 +17,7 @@ order subtotal. | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the return tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `sourceTaxUid` | `?string` | Optional | `uid` of the Tax from the Order which contains the original charge of this tax.
**Constraints**: *Maximum Length*: `60` | getSourceTaxUid(): ?string | setSourceTaxUid(?string sourceTaxUid): void | -| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogTax](#type-catalogtax).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object id referencing [CatalogTax](/doc/models/catalog-tax.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `name` | `?string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | | `type` | [`?string (OrderLineItemTaxType)`](/doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | getType(): ?string | setType(?string type): void | | `percentage` | `?string` | Optional | The percentage of the tax, as a string representation of a decimal number.
For example, a value of `"7.25"` corresponds to a percentage of 7.25%.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | diff --git a/doc/models/order-service-charge.md b/doc/models/order-service-charge.md index 6842756f..d73d290a 100644 --- a/doc/models/order-service-charge.md +++ b/doc/models/order-service-charge.md @@ -13,7 +13,7 @@ Represents a service charge applied to an order. | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | Unique ID that identifies the service charge only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `name` | `?string` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | getName(): ?string | setName(?string name): void | -| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing the service charge [CatalogObject](#type-catalogobject).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectId` | `?string` | Optional | The catalog object ID referencing the service charge [CatalogObject](/doc/models/catalog-object.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | | `percentage` | `?string` | Optional | The service charge percentage as a string representation of a
decimal number. For example, `"7.25"` indicates a service charge of 7.25%.

Exactly 1 of `percentage` or `amount_money` should be set.
**Constraints**: *Maximum Length*: `10` | getPercentage(): ?string | setPercentage(?string percentage): void | | `amountMoney` | [`?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. | getAmountMoney(): ?Money | setAmountMoney(?Money amountMoney): void | | `appliedMoney` | [`?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. | getAppliedMoney(): ?Money | setAppliedMoney(?Money appliedMoney): void | diff --git a/doc/models/order.md b/doc/models/order.md index 87301084..82c4fc2b 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -20,7 +20,7 @@ itemization data. | `locationId` | `string` | Required | The ID of the merchant location this order is associated with.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | | `referenceId` | `?string` | Optional | A client specified identifier to associate an entity in another system
with this order.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `source` | [`?OrderSource`](/doc/models/order-source.md) | Optional | Represents the origination details of an order. | getSource(): ?OrderSource | setSource(?OrderSource source): void | -| `customerId` | `?string` | Optional | The [Customer](#type-customer) ID of the customer associated with the order.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `customerId` | `?string` | Optional | The [Customer](/doc/models/customer.md) ID of the customer associated with the order.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | | `lineItems` | [`?(OrderLineItem[])`](/doc/models/order-line-item.md) | Optional | The line items included in the order. | getLineItems(): ?array | setLineItems(?array lineItems): void | | `taxes` | [`?(OrderLineItemTax[])`](/doc/models/order-line-item-tax.md) | Optional | The list of all taxes associated with the order.

Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an
`OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes
with `ORDER` scope, the server will generate an `OrderLineItemAppliedTax` for every line item.

On reads, each tax in the list will include the total amount of that tax applied to the order.

__IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, usage of the deprecated
`line_items.taxes` field will result in an error. Please use `line_items.applied_taxes`
instead. | getTaxes(): ?array | setTaxes(?array taxes): void | | `discounts` | [`?(OrderLineItemDiscount[])`](/doc/models/order-line-item-discount.md) | Optional | The list of all discounts associated with the order.

Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`,
an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to.
For discounts with `ORDER` scope, the server will generate an `OrderLineItemAppliedDiscount`
for every line item.

__IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, usage of the deprecated
`line_items.discounts` field will result in an error. Please use `line_items.applied_discounts`
instead. | getDiscounts(): ?array | setDiscounts(?array discounts): void | @@ -35,7 +35,7 @@ itemization data. | `metadata` | `?array` | Optional | Application-defined data attached to this order. Metadata fields are intended
to store descriptive references or associations with an entity in another system or store brief
information about the object. Square does not process this field; it only stores and returns it
in relevant API calls. Do not use metadata to store any sensitive information (personally
identifiable information, card details, etc.).

Keys written by applications must be 60 characters or less and must be in the character set
`[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed
with a namespace, separated from the key with a ':' character.

Values have a max length of 255 characters.

An application may have up to 10 entries per metadata field.

Entries written by applications are private and can only be read or modified by the same
application.

See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. | getMetadata(): ?array | setMetadata(?array metadata): void | | `createdAt` | `?string` | Optional | Timestamp for when the order was created. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `updatedAt` | `?string` | Optional | Timestamp for when the order was last updated. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | -| `closedAt` | `?string` | Optional | Timestamp for when the order reached a terminal [state](#property-state). In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getClosedAt(): ?string | setClosedAt(?string closedAt): void | +| `closedAt` | `?string` | Optional | Timestamp for when the order reached a terminal [state](/doc/models/order-state.md). In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getClosedAt(): ?string | setClosedAt(?string closedAt): void | | `state` | [`?string (OrderState)`](/doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | | `version` | `?int` | Optional | Version number which is incremented each time an update is committed to the order.
Orders that were not created through the API will not include a version and
thus cannot be updated.

[Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders#update-orders). | getVersion(): ?int | setVersion(?int version): void | | `totalMoney` | [`?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. | getTotalMoney(): ?Money | setTotalMoney(?Money totalMoney): void | @@ -43,7 +43,7 @@ itemization data. | `totalDiscountMoney` | [`?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. | getTotalDiscountMoney(): ?Money | setTotalDiscountMoney(?Money totalDiscountMoney): void | | `totalTipMoney` | [`?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. | getTotalTipMoney(): ?Money | setTotalTipMoney(?Money totalTipMoney): void | | `totalServiceChargeMoney` | [`?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. | getTotalServiceChargeMoney(): ?Money | setTotalServiceChargeMoney(?Money totalServiceChargeMoney): void | -| `pricingOptions` | [`?OrderPricingOptions`](/doc/models/order-pricing-options.md) | Optional | Pricing options for an order. The options affect how the order's price is calculated.
They can be used, for example, to apply automatic price adjustments that are based on pre-configured
[pricing rules](https://developer.squareup.com/docs/reference/square/objects/CatalogPricingRule). | getPricingOptions(): ?OrderPricingOptions | setPricingOptions(?OrderPricingOptions pricingOptions): void | +| `pricingOptions` | [`?OrderPricingOptions`](/doc/models/order-pricing-options.md) | Optional | Pricing options for an order. The options affect how the order's price is calculated.
They can be used, for example, to apply automatic price adjustments that are based on pre-configured
[pricing rules](/doc/models/catalog-pricing-rule.md). | getPricingOptions(): ?OrderPricingOptions | setPricingOptions(?OrderPricingOptions pricingOptions): void | | `rewards` | [`?(OrderReward[])`](/doc/models/order-reward.md) | Optional | A set-like list of rewards that have been added to the order. | getRewards(): ?array | setRewards(?array rewards): void | ## Example (as JSON) diff --git a/doc/models/pay-order-request.md b/doc/models/pay-order-request.md index 5b8d25f1..a36795bb 100644 --- a/doc/models/pay-order-request.md +++ b/doc/models/pay-order-request.md @@ -2,7 +2,7 @@ # Pay Order Request Defines the fields that are included in requests to the -[PayOrder](#endpoint-payorder) endpoint. +[PayOrder](/doc/apis/orders.md#pay-order) endpoint. ## Structure @@ -12,9 +12,9 @@ Defines the fields that are included in requests to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this request among requests you've sent. If
you're unsure whether a particular payment request was completed successfully, you can reattempt
it with the same idempotency key without worrying about duplicate payments.

See [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | +| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this request among requests you've sent. If
you're unsure whether a particular payment request was completed successfully, you can reattempt
it with the same idempotency key without worrying about duplicate payments.

See [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) for more
information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | | `orderVersion` | `?int` | Optional | The version of the order being paid. If not supplied, the latest version will be paid. | getOrderVersion(): ?int | setOrderVersion(?int orderVersion): void | -| `paymentIds` | `?(string[])` | Optional | The IDs of the [payments](#type-payment) to collect.
The payment total must match the order total. | getPaymentIds(): ?array | setPaymentIds(?array paymentIds): void | +| `paymentIds` | `?(string[])` | Optional | The IDs of the [payments](/doc/models/payment.md) to collect.
The payment total must match the order total. | getPaymentIds(): ?array | setPaymentIds(?array paymentIds): void | ## Example (as JSON) diff --git a/doc/models/pay-order-response.md b/doc/models/pay-order-response.md index bd54c07d..6a44bf96 100644 --- a/doc/models/pay-order-response.md +++ b/doc/models/pay-order-response.md @@ -2,7 +2,7 @@ # Pay Order Response Defines the fields that are included in the response body of a request to the -[PayOrder](#endpoint-payorder) endpoint. +[PayOrder](/doc/apis/orders.md#pay-order) endpoint. ## Structure diff --git a/doc/models/payment.md b/doc/models/payment.md index 2aca8feb..54f4b439 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -32,7 +32,7 @@ Represents a payment processed by the Square API. | `locationId` | `?string` | Optional | The ID of the location associated with the payment.
**Constraints**: *Maximum Length*: `50` | getLocationId(): ?string | setLocationId(?string locationId): void | | `orderId` | `?string` | Optional | The ID of the order associated with the payment.
**Constraints**: *Maximum Length*: `192` | getOrderId(): ?string | setOrderId(?string orderId): void | | `referenceId` | `?string` | Optional | An optional ID that associates the payment with an entity in
another system.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | -| `customerId` | `?string` | Optional | The [Customer](#type-customer) ID of the customer associated with the payment.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `customerId` | `?string` | Optional | The [Customer](/doc/models/customer.md) ID of the customer associated with the payment.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | | `employeeId` | `?string` | Optional | An optional ID of the employee associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | | `refundIds` | `?(string[])` | Optional | A list of `refund_id`s identifying refunds for the payment. | getRefundIds(): ?array | setRefundIds(?array refundIds): void | | `riskEvaluation` | [`?RiskEvaluation`](/doc/models/risk-evaluation.md) | Optional | Represents fraud risk information for the associated payment.

When you take a payment through Square's Payments API (using the `CreatePayment`
endpoint), Square evaluates it and assigns a risk level to the payment. Sellers
can use this information to determine the course of action (for example,
provide the goods/services or refund the payment). | getRiskEvaluation(): ?RiskEvaluation | setRiskEvaluation(?RiskEvaluation riskEvaluation): void | diff --git a/doc/models/publish-invoice-request.md b/doc/models/publish-invoice-request.md index d4401785..884fe254 100644 --- a/doc/models/publish-invoice-request.md +++ b/doc/models/publish-invoice-request.md @@ -11,7 +11,7 @@ Describes a `PublishInvoice` request. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `version` | `int` | Required | The version of the [Invoice](#type-invoice) to publish.
This must match the current version of the invoice,
otherwise the request is rejected. | getVersion(): int | setVersion(int version): void | +| `version` | `int` | Required | The version of the [invoice](/doc/models/invoice.md) to publish.
This must match the current version of the invoice; otherwise, the request is rejected. | getVersion(): int | setVersion(int version): void | | `idempotencyKey` | `?string` | Optional | A unique string that identifies the `PublishInvoice` request. If you do not
provide `idempotency_key` (or provide an empty string as the value), the endpoint
treats each request as independent.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Maximum Length*: `128` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | ## Example (as JSON) diff --git a/doc/models/publish-invoice-response.md b/doc/models/publish-invoice-response.md index a394b71c..049c5724 100644 --- a/doc/models/publish-invoice-response.md +++ b/doc/models/publish-invoice-response.md @@ -19,6 +19,11 @@ Describes a `PublishInvoice` response. ```json { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/redeem-loyalty-reward-request.md b/doc/models/redeem-loyalty-reward-request.md index bff2b8d0..b4fd7efe 100644 --- a/doc/models/redeem-loyalty-reward-request.md +++ b/doc/models/redeem-loyalty-reward-request.md @@ -12,7 +12,7 @@ A request to redeem a loyalty reward. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `idempotencyKey` | `string` | Required | A unique string that identifies this `RedeemLoyaltyReward` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | -| `locationId` | `string` | Required | The ID of the [location](#type-Location) where the reward is redeemed.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | +| `locationId` | `string` | Required | The ID of the [location](/doc/models/location.md) where the reward is redeemed.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | ## Example (as JSON) diff --git a/doc/models/refund-payment-request.md b/doc/models/refund-payment-request.md index 198a80a8..805caed8 100644 --- a/doc/models/refund-payment-request.md +++ b/doc/models/refund-payment-request.md @@ -1,7 +1,7 @@ # Refund Payment Request -Describes a request to refund a payment using [RefundPayment](#endpoint-payments-refundpayment). +Describes a request to refund a payment using [RefundPayment](/doc/apis/refunds.md#refund-payment). ## Structure diff --git a/doc/models/refund-payment-response.md b/doc/models/refund-payment-response.md index ff48964d..bdbd4503 100644 --- a/doc/models/refund-payment-response.md +++ b/doc/models/refund-payment-response.md @@ -2,7 +2,7 @@ # Refund Payment Response Defines the response returned by -[RefundPayment](#endpoint-payments-refundpayment). +[RefundPayment](/doc/apis/refunds.md#refund-payment). If there are errors processing the request, the `refund` field might not be present, or it might be present with a status of `FAILED`. diff --git a/doc/models/register-domain-request.md b/doc/models/register-domain-request.md index bf77f56a..0e7547c6 100644 --- a/doc/models/register-domain-request.md +++ b/doc/models/register-domain-request.md @@ -2,7 +2,7 @@ # Register Domain Request Defines the parameters that can be included in the body of -a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. +a request to the [RegisterDomain](/doc/apis/apple-pay.md#register-domain) endpoint. ## Structure @@ -12,7 +12,7 @@ a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `domainName` | `string` | Required | A domain name as described in RFC-1034 that will be registered with ApplePay
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getDomainName(): string | setDomainName(string domainName): void | +| `domainName` | `string` | Required | A domain name as described in RFC-1034 that will be registered with ApplePay.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | getDomainName(): string | setDomainName(string domainName): void | ## Example (as JSON) diff --git a/doc/models/register-domain-response.md b/doc/models/register-domain-response.md index 23cc0bb2..fe113ded 100644 --- a/doc/models/register-domain-response.md +++ b/doc/models/register-domain-response.md @@ -2,7 +2,7 @@ # Register Domain Response Defines the fields that are included in the response body of -a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. +a request to the [RegisterDomain](/doc/apis/apple-pay.md#register-domain) endpoint. Either `errors` or `status` are present in a given response (never both). diff --git a/doc/models/remove-group-from-customer-response.md b/doc/models/remove-group-from-customer-response.md index 7de119f7..499b4bf9 100644 --- a/doc/models/remove-group-from-customer-response.md +++ b/doc/models/remove-group-from-customer-response.md @@ -2,7 +2,7 @@ # Remove Group From Customer Response Defines the fields that are included in the response body of -a request to the [RemoveGroupFromCustomer](#endpoint-removegroupfromcustomer) +a request to the [RemoveGroupFromCustomer](/doc/apis/customers.md#remove-group-from-customer) endpoint. ## Structure diff --git a/doc/models/renew-token-request.md b/doc/models/renew-token-request.md index 730633b2..5434e907 100644 --- a/doc/models/renew-token-request.md +++ b/doc/models/renew-token-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `accessToken` | `?string` | Optional | The token you want to renew. | getAccessToken(): ?string | setAccessToken(?string accessToken): void | +| `accessToken` | `?string` | Optional | The token you want to renew.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void | ## Example (as JSON) diff --git a/doc/models/renew-token-response.md b/doc/models/renew-token-response.md index 7a00875e..68466021 100644 --- a/doc/models/renew-token-response.md +++ b/doc/models/renew-token-response.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `accessToken` | `?string` | Optional | The renewed access token.
This value might be different from the `access_token` you provided in your request.
You provide this token in a header with every request to Connect API endpoints.
See [Request and response headers](https://developer.squareup.com/docs/api/connect/v2/#requestandresponseheaders) for the format of this header. | getAccessToken(): ?string | setAccessToken(?string accessToken): void | -| `tokenType` | `?string` | Optional | This value is always _bearer_. | getTokenType(): ?string | setTokenType(?string tokenType): void | -| `expiresAt` | `?string` | Optional | The date when access_token expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `merchantId` | `?string` | Optional | The ID of the authorizing merchant's business. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | +| `accessToken` | `?string` | Optional | The renewed access token.
This value might be different from the `access_token` you provided in your request.
You provide this token in a header with every request to Connect API endpoints.
See [Request and response headers](https://developer.squareup.com/docs/api/connect/v2/#requestandresponseheaders) for the format of this header.
**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 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 the merchant subscription associated with
the authorization. Only present if the merchant signed up for a subscription
during authorization.. | getSubscriptionId(): ?string | setSubscriptionId(?string subscriptionId): void | | `planId` | `?string` | Optional | __LEGACY FIELD__. The ID of the subscription plan the merchant signed
up for. Only present if the merchant signed up for a subscription during
authorization. | getPlanId(): ?string | setPlanId(?string planId): void | diff --git a/doc/models/resume-subscription-response.md b/doc/models/resume-subscription-response.md new file mode 100644 index 00000000..f9c0389d --- /dev/null +++ b/doc/models/resume-subscription-response.md @@ -0,0 +1,39 @@ + +# Resume Subscription Response + +Defines parameters in a +[ResumeSubscription](/doc/apis/subscriptions.md#resume-subscription) endpoint +response. + +## Structure + +`ResumeSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | +| `subscription` | [`?Subscription`](/doc/models/subscription.md) | Optional | Represents a customer subscription to a subscription plan.
For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | + +## Example (as JSON) + +```json +{ + "subscription": { + "created_at": "2020-08-03T21:53:10Z", + "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", + "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", + "location_id": "S8GWD5R9QB376", + "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", + "price_override_money": { + "amount": 2000, + "currency": "USD" + }, + "status": "ACTIVE", + "timezone": "America/Los_Angeles", + "version": 1594311617331 + } +} +``` + diff --git a/doc/models/retrieve-catalog-object-request.md b/doc/models/retrieve-catalog-object-request.md index 0a1f9e08..ae48a1ca 100644 --- a/doc/models/retrieve-catalog-object-request.md +++ b/doc/models/retrieve-catalog-object-request.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the
requested object, as follows:

If the `object` field of the response contains a `CatalogItem`, its associated
`CatalogCategory`, `CatalogTax`, `CatalogImage` and `CatalogModifierList` objects will
be returned in the `related_objects` field of the response. If the `object` field of
the response contains a `CatalogItemVariation`, its parent `CatalogItem` will be returned
in the `related_objects` field of the response.

Default value: `false` | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void | -| `catalogVersion` | `?int` | Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](#type-catalogobject)s. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | +| `catalogVersion` | `?int` | Optional | Requests objects as of a specific version of the catalog. This allows you to retrieve historical
versions of objects. The value to retrieve a specific version of an object can be found
in the version field of [CatalogObject](/doc/models/catalog-object.md)s. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | ## Example (as JSON) diff --git a/doc/models/retrieve-customer-group-response.md b/doc/models/retrieve-customer-group-response.md index 144f9ff5..fef65c0c 100644 --- a/doc/models/retrieve-customer-group-response.md +++ b/doc/models/retrieve-customer-group-response.md @@ -2,9 +2,9 @@ # Retrieve Customer Group Response Defines the fields that are included in the response body of -a request to the [RetrieveCustomerGroup](#endpoint-retrievecustomergroup) endpoint. +a request to the [RetrieveCustomerGroup](/doc/apis/customer-groups.md#retrieve-customer-group) endpoint. -One of `errors` or `group` is present in a given response (never both). +Either `errors` or `group` is present in a given response (never both). ## Structure @@ -15,7 +15,7 @@ One of `errors` or `group` is present in a given response (never both). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `group` | [`?CustomerGroup`](/doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, modified, and have their membership defined either via
the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | +| `group` | [`?CustomerGroup`](/doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | ## Example (as JSON) diff --git a/doc/models/retrieve-customer-response.md b/doc/models/retrieve-customer-response.md index d4c7b211..90dfebfb 100644 --- a/doc/models/retrieve-customer-response.md +++ b/doc/models/retrieve-customer-response.md @@ -2,9 +2,9 @@ # Retrieve Customer Response Defines the fields that are included in the response body of -a request to the RetrieveCustomer endpoint. +a request to the `RetrieveCustomer` endpoint. -One of `errors` or `customer` is present in a given response (never both). +Either `errors` or `customer` is present in a given response (never both). ## Structure @@ -31,30 +31,25 @@ One of `errors` or `customer` is present in a given response (never both). "postal_code": "10003" }, "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", "email_address": "Amelia.Earhart@example.com", "family_name": "Earhart", "given_name": "Amelia", "group_ids": [ "545AXB44B4XXWMVQ4W8SBT3HHF" ], - "groups": [ - { - "id": "545AXB44B4XXWMVQ4W8SBT3HHF", - "name": "Aviation Enthusiasts" - }, - { - "id": "1KB9JE5EGJXCW.REACHABLE", - "name": "Reachable" - } - ], "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", "note": "a customer", "phone_number": "1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, "reference_id": "YOUR_REFERENCE_ID", "segment_ids": [ "1KB9JE5EGJXCW.REACHABLE" ], - "updated_at": "2016-03-23T20:21:54.859Z" + "updated_at": "2016-03-23T20:21:54.859Z", + "version": 1 } } ``` diff --git a/doc/models/retrieve-customer-segment-response.md b/doc/models/retrieve-customer-segment-response.md index fcd0d426..30d34de1 100644 --- a/doc/models/retrieve-customer-segment-response.md +++ b/doc/models/retrieve-customer-segment-response.md @@ -1,9 +1,9 @@ # Retrieve Customer Segment Response -Defines the fields included in the response body for requests to __RetrieveCustomerSegment__. +Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint. -One of `errors` or `segment` is present in a given response (never both). +Either `errors` or `segment` is present in a given response (never both). ## Structure @@ -14,7 +14,7 @@ One of `errors` or `segment` is present in a given response (never both). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `segment` | [`?CustomerSegment`](/doc/models/customer-segment.md) | Optional | Represents a group of customer profiles that match one or more predefined filter criteria.

Segments (also known as Smart Groups) are defined and created within Customer Directory in the Square Dashboard or Point of Sale. | getSegment(): ?CustomerSegment | setSegment(?CustomerSegment segment): void | +| `segment` | [`?CustomerSegment`](/doc/models/customer-segment.md) | Optional | Represents a group of customer profiles that match one or more predefined filter criteria.

Segments (also known as Smart Groups) are defined and created within the Customer Directory in the
Square Seller Dashboard or Point of Sale. | getSegment(): ?CustomerSegment | setSegment(?CustomerSegment segment): void | ## Example (as JSON) diff --git a/doc/models/retrieve-employee-response.md b/doc/models/retrieve-employee-response.md index 94f577c6..b0f998c6 100644 --- a/doc/models/retrieve-employee-response.md +++ b/doc/models/retrieve-employee-response.md @@ -26,19 +26,19 @@ "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", + "code": "UNPROCESSABLE_ENTITY", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", + "code": "RATE_LIMITED", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", + "code": "NOT_IMPLEMENTED", "detail": "detail3", "field": "field1" } diff --git a/doc/models/retrieve-inventory-changes-request.md b/doc/models/retrieve-inventory-changes-request.md index 50fdf8aa..3b17fd9d 100644 --- a/doc/models/retrieve-inventory-changes-request.md +++ b/doc/models/retrieve-inventory-changes-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `locationIds` | `?string` | Optional | The [Location](#type-location) IDs to look up as a comma-separated
list. An empty list queries all locations. | getLocationIds(): ?string | setLocationIds(?string locationIds): void | +| `locationIds` | `?string` | Optional | The [Location](/doc/models/location.md) IDs to look up as a comma-separated
list. An empty list queries all locations. | getLocationIds(): ?string | setLocationIds(?string locationIds): void | | `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/retrieve-inventory-count-request.md b/doc/models/retrieve-inventory-count-request.md index 6916cbc4..a5e1c538 100644 --- a/doc/models/retrieve-inventory-count-request.md +++ b/doc/models/retrieve-inventory-count-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `locationIds` | `?string` | Optional | The [Location](#type-location) IDs to look up as a comma-separated
list. An empty list queries all locations. | getLocationIds(): ?string | setLocationIds(?string locationIds): void | +| `locationIds` | `?string` | Optional | The [Location](/doc/models/location.md) IDs to look up as a comma-separated
list. An empty list queries all locations. | getLocationIds(): ?string | setLocationIds(?string locationIds): void | | `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/retrieve-location-response.md b/doc/models/retrieve-location-response.md index b9033c56..aa8ffd9a 100644 --- a/doc/models/retrieve-location-response.md +++ b/doc/models/retrieve-location-response.md @@ -2,7 +2,7 @@ # Retrieve Location Response Defines the fields that the -[RetrieveLocation](#endpoint-retrievelocation) endpoint returns +[RetrieveLocation](/doc/apis/locations.md#retrieve-location) endpoint returns in a response. ## Structure diff --git a/doc/models/retrieve-loyalty-account-response.md b/doc/models/retrieve-loyalty-account-response.md index a78e9917..f1eeb755 100644 --- a/doc/models/retrieve-loyalty-account-response.md +++ b/doc/models/retrieve-loyalty-account-response.md @@ -24,10 +24,18 @@ A response that includes the loyalty account. "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", "id": "79b807d2-d786-46a9-933b-918028d7a8c5", "lifetime_points": 20, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234", + "type": "PHONE", + "value": "+14155551234" + }, "mappings": [ { "created_at": "2020-05-08T21:44:32Z", "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234", "type": "PHONE", "value": "+14155551234" } diff --git a/doc/models/retrieve-loyalty-program-response.md b/doc/models/retrieve-loyalty-program-response.md new file mode 100644 index 00000000..6ef88abb --- /dev/null +++ b/doc/models/retrieve-loyalty-program-response.md @@ -0,0 +1,62 @@ + +# Retrieve Loyalty Program Response + +A response that contains the loyalty program. + +## Structure + +`RetrieveLoyaltyProgramResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | +| `program` | [`?LoyaltyProgram`](/doc/models/loyalty-program.md) | Optional | - | getProgram(): ?LoyaltyProgram | setProgram(?LoyaltyProgram program): void | + +## Example (as JSON) + +```json +{ + "program": { + "accrual_rules": [ + { + "accrual_type": "SPEND", + "points": 1, + "spend_amount_money": { + "amount": 100 + } + } + ], + "created_at": "\"2020-04-20T16:55:11Z\"", + "id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "location_ids": [ + "P034NEENMD09F" + ], + "reward_tiers": [ + { + "created_at": "\"2020-04-20T16:55:11Z\"", + "definition": { + "discount_type": "FIXED_PERCENTAGE", + "percentage_discount": "10", + "scope": "ORDER" + }, + "id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f", + "name": "10% off entire sale", + "points": 10, + "pricing_rule_reference": { + "catalog_version": 1605486402527, + "object_id": "74C4JSHESNLTB2A7ITO5HO6F" + } + } + ], + "status": "ACTIVE", + "terminology": { + "one": "Point", + "other": "Points" + }, + "updated_at": "\"2020-05-01T02:00:02Z\"" + } +} +``` + diff --git a/doc/models/retrieve-loyalty-reward-response.md b/doc/models/retrieve-loyalty-reward-response.md index 817d4f36..f245e890 100644 --- a/doc/models/retrieve-loyalty-reward-response.md +++ b/doc/models/retrieve-loyalty-reward-response.md @@ -12,7 +12,7 @@ A response that includes the loyalty reward. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `reward` | [`?LoyaltyReward`](/doc/models/loyalty-reward.md) | Optional | - | getReward(): ?LoyaltyReward | setReward(?LoyaltyReward reward): void | +| `reward` | [`?LoyaltyReward`](/doc/models/loyalty-reward.md) | Optional | Represents a contract to redeem loyalty points for a [reward tier](/doc/models/loyalty-program-reward-tier.md) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty-rewards). | getReward(): ?LoyaltyReward | setReward(?LoyaltyReward reward): void | ## Example (as JSON) diff --git a/doc/models/retrieve-merchant-response.md b/doc/models/retrieve-merchant-response.md index 8380ceea..bc406c92 100644 --- a/doc/models/retrieve-merchant-response.md +++ b/doc/models/retrieve-merchant-response.md @@ -1,7 +1,7 @@ # Retrieve Merchant Response -The response object returned by the [RetrieveMerchant](#endpoint-retrieveMerchant) endpoint. +The response object returned by the [RetrieveMerchant](/doc/apis/merchants.md#retrieve-merchant) endpoint. ## Structure diff --git a/doc/models/retrieve-obs-migration-profile-response.md b/doc/models/retrieve-obs-migration-profile-response.md deleted file mode 100644 index 142d9fca..00000000 --- a/doc/models/retrieve-obs-migration-profile-response.md +++ /dev/null @@ -1,48 +0,0 @@ - -# Retrieve Obs Migration Profile Response - -## Structure - -`RetrieveObsMigrationProfileResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `bannerEnabled` | `?bool` | Optional | Indicates whether the seller has enabled the COVID banner (`true`) or not (`false`). | getBannerEnabled(): ?bool | setBannerEnabled(?bool bannerEnabled): void | -| `bannerText` | `?string` | Optional | The text appearing on the COVID banner. | getBannerText(): ?string | setBannerText(?string bannerText): void | -| `bannerCtaText` | `?string` | Optional | The text of the label of the CTA button beneath the banner. | getBannerCtaText(): ?string | setBannerCtaText(?string bannerCtaText): void | -| `bannerCtaUrl` | `?string` | Optional | The URL to link to when the CTA button is clicked. | getBannerCtaUrl(): ?string | setBannerCtaUrl(?string bannerCtaUrl): void | -| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | - -## Example (as JSON) - -```json -{ - "banner_enabled": false, - "banner_text": "banner_text6", - "banner_cta_text": "banner_cta_text0", - "banner_cta_url": "banner_cta_url8", - "errors": [ - { - "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", - "detail": "detail1", - "field": "field9" - }, - { - "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", - "detail": "detail2", - "field": "field0" - }, - { - "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", - "detail": "detail3", - "field": "field1" - } - ] -} -``` - diff --git a/doc/models/retrieve-subscription-response.md b/doc/models/retrieve-subscription-response.md index b3e223ab..01c08244 100644 --- a/doc/models/retrieve-subscription-response.md +++ b/doc/models/retrieve-subscription-response.md @@ -2,7 +2,7 @@ # Retrieve Subscription Response Defines the fields that are included in the response from the -[RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint. +[RetrieveSubscription](/doc/apis/subscriptions.md#retrieve-subscription) endpoint. ## Structure diff --git a/doc/models/retrieve-transaction-response.md b/doc/models/retrieve-transaction-response.md index 6ded40ee..c994da92 100644 --- a/doc/models/retrieve-transaction-response.md +++ b/doc/models/retrieve-transaction-response.md @@ -2,7 +2,7 @@ # Retrieve Transaction Response Defines the fields that are included in the response body of -a request to the [RetrieveTransaction](#endpont-retrievetransaction) endpoint. +a request to the [RetrieveTransaction](/doc/apis/transactions.md#retrieve-transaction) endpoint. One of `errors` or `transaction` is present in a given response (never both). diff --git a/doc/models/revoke-token-request.md b/doc/models/revoke-token-request.md index cbf54204..b5d695e5 100644 --- a/doc/models/revoke-token-request.md +++ b/doc/models/revoke-token-request.md @@ -9,8 +9,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `clientId` | `?string` | Optional | The Square issued ID for your application, available from the
[application dashboard](https://connect.squareup.com/apps). | getClientId(): ?string | setClientId(?string clientId): void | -| `accessToken` | `?string` | Optional | The access token of the merchant whose token you want to revoke.
Do not provide a value for merchant_id if you provide this parameter. | getAccessToken(): ?string | setAccessToken(?string accessToken): void | +| `clientId` | `?string` | Optional | The Square issued ID for your application, available from the
[application dashboard](https://connect.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): ?string | setClientId(?string clientId): void | +| `accessToken` | `?string` | Optional | The access token of the merchant whose token you want to revoke.
Do not provide a value for merchant_id if you provide this parameter.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void | | `merchantId` | `?string` | Optional | The ID of the merchant whose token you want to revoke.
Do not provide a value for access_token if you provide this parameter. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | | `revokeOnlyAccessToken` | `?bool` | Optional | If `true`, terminate the given single access token, but do not
terminate the entire authorization.
Default: `false` | getRevokeOnlyAccessToken(): ?bool | setRevokeOnlyAccessToken(?bool revokeOnlyAccessToken): void | diff --git a/doc/models/search-catalog-items-request.md b/doc/models/search-catalog-items-request.md index 10578c6d..7b293392 100644 --- a/doc/models/search-catalog-items-request.md +++ b/doc/models/search-catalog-items-request.md @@ -1,7 +1,7 @@ # Search Catalog Items Request -Defines the request body for the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. +Defines the request body for the [SearchCatalogItems](/doc/apis/catalog.md#search-catalog-items) endpoint. ## Structure @@ -19,7 +19,7 @@ Defines the request body for the [SearchCatalogItems](#endpoint-Catalog-SearchCa | `limit` | `?int` | Optional | The maximum number of results to return per page. The default value is 100.
**Constraints**: `<= 100` | getLimit(): ?int | setLimit(?int limit): void | | `sortOrder` | [`?string (SortOrder)`](/doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | getSortOrder(): ?string | setSortOrder(?string sortOrder): void | | `productTypes` | [`?(string[]) (CatalogItemProductType)`](/doc/models/catalog-item-product-type.md) | Optional | The product types query expression to return items or item variations having the specified product types. | getProductTypes(): ?array | setProductTypes(?array productTypes): void | -| `customAttributeFilters` | [`?(CustomAttributeFilter[])`](/doc/models/custom-attribute-filter.md) | Optional | The customer-attribute filter to return items or item variations matching the specified
custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in
a single call to the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. | getCustomAttributeFilters(): ?array | setCustomAttributeFilters(?array customAttributeFilters): void | +| `customAttributeFilters` | [`?(CustomAttributeFilter[])`](/doc/models/custom-attribute-filter.md) | Optional | The customer-attribute filter to return items or item variations matching the specified
custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in
a single call to the [SearchCatalogItems](/doc/apis/catalog.md#search-catalog-items) endpoint. | getCustomAttributeFilters(): ?array | setCustomAttributeFilters(?array customAttributeFilters): void | ## Example (as JSON) diff --git a/doc/models/search-catalog-items-response.md b/doc/models/search-catalog-items-response.md index 1525352e..dc85e2cc 100644 --- a/doc/models/search-catalog-items-response.md +++ b/doc/models/search-catalog-items-response.md @@ -1,7 +1,7 @@ # Search Catalog Items Response -Defines the response body returned from the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. +Defines the response body returned from the [SearchCatalogItems](/doc/apis/catalog.md#search-catalog-items) endpoint. ## Structure @@ -23,19 +23,19 @@ Defines the response body returned from the [SearchCatalogItems](#endpoint-Catal "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", + "code": "UNPROCESSABLE_ENTITY", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", + "code": "RATE_LIMITED", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", + "code": "NOT_IMPLEMENTED", "detail": "detail3", "field": "field1" } diff --git a/doc/models/search-catalog-objects-request.md b/doc/models/search-catalog-objects-request.md index 573f8825..b7b50e27 100644 --- a/doc/models/search-catalog-objects-request.md +++ b/doc/models/search-catalog-objects-request.md @@ -14,7 +14,7 @@ | `includeDeletedObjects` | `?bool` | Optional | If `true`, deleted objects will be included in the results. Deleted objects will have their
`is_deleted` field set to `true`. | getIncludeDeletedObjects(): ?bool | setIncludeDeletedObjects(?bool includeDeletedObjects): void | | `includeRelatedObjects` | `?bool` | Optional | If `true`, the response will include additional objects that are related to the
requested object, as follows:

If a CatalogItem is returned in the object field of the response,
its associated CatalogCategory, CatalogTax objects,
CatalogImage objects and CatalogModifierList objects
will be included in the `related_objects` field of the response.

If a CatalogItemVariation is returned in the object field of the
response, its parent CatalogItem will be included in the `related_objects` field of
the response. | getIncludeRelatedObjects(): ?bool | setIncludeRelatedObjects(?bool includeRelatedObjects): void | | `beginTime` | `?string` | Optional | Return objects modified after this [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates), in RFC 3339
format, e.g., `2016-09-04T23:59:33.123Z`. The timestamp is exclusive - objects with a
timestamp equal to `begin_time` will not be included in the response. | getBeginTime(): ?string | setBeginTime(?string beginTime): void | -| `query` | [`?CatalogQuery`](/doc/models/catalog-query.md) | Optional | A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects).
Any combination of the following types may be used together:

- [exact_query](#type-CatalogExactQuery)
- [prefix_query](#type-CatalogPrefixQuery)
- [range_query](#type-CatalogRangeQuery)
- [sorted_attribute_query](#type-CatalogSortedAttribute)
- [text_query](#type-CatalogTextQuery)
All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

* Searchable attribute and objects queryable by searchable attributes **

- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, 'CatalogModifierList`,`CatalogItemOption`,`CatalogItemOptionValue`
- `description`: `CatalogItem`, `CatalogItemOptionValue`
- `abbreviation`: `CatalogItem`
- `upc`: `CatalogItemVariation`
- `sku`: `CatalogItemVariation`
- `caption`: `CatalogImage`
- `display_name`: `CatalogItemOption`

For example, to search for [CatalogItem](#type-CatalogItem) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. | getQuery(): ?CatalogQuery | setQuery(?CatalogQuery query): void | +| `query` | [`?CatalogQuery`](/doc/models/catalog-query.md) | Optional | A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint.

Although a query can have multiple filters, only certain query types can be combined per call to [SearchCatalogObjects](/doc/apis/catalog.md#search-catalog-objects).
Any combination of the following types may be used together:

- [exact_query](/doc/models/catalog-query-exact.md)
- [prefix_query](/doc/models/catalog-query-prefix.md)
- [range_query](/doc/models/catalog-query-range.md)
- [sorted_attribute_query](/doc/models/catalog-query-sorted-attribute.md)
- [text_query](/doc/models/catalog-query-text.md)
All other query types cannot be combined with any others.

When a query filter is based on an attribute, the attribute must be searchable.
Searchable attributes are listed as follows, along their parent types that can be searched for with applicable query filters.

* Searchable attribute and objects queryable by searchable attributes **

- `name`: `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, `CatalogTax`, `CatalogDiscount`, `CatalogModifier`, 'CatalogModifierList`,`CatalogItemOption`,`CatalogItemOptionValue`
- `description`: `CatalogItem`, `CatalogItemOptionValue`
- `abbreviation`: `CatalogItem`
- `upc`: `CatalogItemVariation`
- `sku`: `CatalogItemVariation`
- `caption`: `CatalogImage`
- `display_name`: `CatalogItemOption`

For example, to search for [CatalogItem](/doc/models/catalog-item.md) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. | getQuery(): ?CatalogQuery | setQuery(?CatalogQuery query): void | | `limit` | `?int` | Optional | A limit on the number of results to be returned in a single page. The limit is advisory -
the implementation may return more or fewer results. If the supplied limit is negative, zero, or
is higher than the maximum limit of 1,000, it will be ignored. | getLimit(): ?int | setLimit(?int limit): void | ## Example (as JSON) diff --git a/doc/models/search-customers-request.md b/doc/models/search-customers-request.md index 5483e56d..2db13a00 100644 --- a/doc/models/search-customers-request.md +++ b/doc/models/search-customers-request.md @@ -1,8 +1,8 @@ # Search Customers Request -Defines the fields included in the request body for the -SearchCustomers endpoint. +Defines the fields that are included in the request body of a request to the +`SearchCustomers` endpoint. ## Structure @@ -12,8 +12,8 @@ SearchCustomers endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | Include the pagination cursor in subsequent calls to this endpoint to retrieve
the next set of results associated with the original query.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `limit` | `?int` | Optional | A limit on the number of results to be returned in a single page.
The limit is advisory - the implementation may return more or fewer results.
If the supplied limit is negative, zero, or is higher than the maximum limit
of 100, it will be ignored.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | +| `cursor` | `?string` | Optional | Include the pagination cursor in subsequent calls to this endpoint to retrieve
the next set of results associated with the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | +| `limit` | `?int` | Optional | A limit on the number of results to be returned in a single page.
The limit is advisory. The implementation might return more or fewer results.
If the supplied limit is negative, zero, or higher than the maximum limit
of 100, it is ignored.
**Constraints**: `>= 1`, `<= 100` | getLimit(): ?int | setLimit(?int limit): void | | `query` | [`?CustomerQuery`](/doc/models/customer-query.md) | Optional | Represents a query (including filtering criteria, sorting criteria, or both) used to search
for customer profiles. | getQuery(): ?CustomerQuery | setQuery(?CustomerQuery query): void | ## Example (as JSON) diff --git a/doc/models/search-customers-response.md b/doc/models/search-customers-response.md index 46504f22..36293229 100644 --- a/doc/models/search-customers-response.md +++ b/doc/models/search-customers-response.md @@ -2,9 +2,9 @@ # Search Customers Response Defines the fields that are included in the response body of -a request to the SearchCustomers endpoint. +a request to the `SearchCustomers` endpoint. -One of `errors` or `customers` is present in a given response (never both). +Either `errors` or `customers` is present in a given response (never both). ## Structure @@ -16,7 +16,7 @@ One of `errors` or `customers` is present in a given response (never both). | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | | `customers` | [`?(Customer[])`](/doc/models/customer.md) | Optional | An array of `Customer` objects that match a query. | getCustomers(): ?array | setCustomers(?array customers): void | -| `cursor` | `?string` | Optional | A pagination cursor that can be used during subsequent calls
to SearchCustomers to retrieve the next set of results associated
with the original query. Pagination cursors are only present when
a request succeeds and additional results are available.

See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor that can be used during subsequent calls
to `SearchCustomers` to retrieve the next set of results associated
with the original query. Pagination cursors are only present when
a request succeeds and additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) @@ -34,30 +34,24 @@ One of `errors` or `customers` is present in a given response (never both). "postal_code": "10003" }, "created_at": "2018-01-23T20:21:54.859Z", - "creation_source": "THIRD_PARTY", + "creation_source": "DIRECTORY", "email_address": "james.bond@example.com", "family_name": "Bond", "given_name": "James", "group_ids": [ "545AXB44B4XXWMVQ4W8SBT3HHF" ], - "groups": [ - { - "id": "545AXB44B4XXWMVQ4W8SBT3HHF", - "name": "Aviation Enthusiasts" - }, - { - "id": "1KB9JE5EGJXCW.REACHABLE", - "name": "Reachable" - } - ], "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", "phone_number": "1-212-555-4250", + "preferences": { + "email_unsubscribed": false + }, "reference_id": "YOUR_REFERENCE_ID_2", "segment_ids": [ "1KB9JE5EGJXCW.REACHABLE" ], - "updated_at": "2018-04-20T10:02:43.083Z" + "updated_at": "2020-04-20T10:02:43.083Z", + "version": 7 }, { "address": { @@ -76,24 +70,18 @@ One of `errors` or `customers` is present in a given response (never both). "group_ids": [ "545AXB44B4XXWMVQ4W8SBT3HHF" ], - "groups": [ - { - "id": "545AXB44B4XXWMVQ4W8SBT3HHF", - "name": "Aviation Enthusiasts" - }, - { - "id": "1KB9JE5EGJXCW.REACHABLE", - "name": "Reachable" - } - ], "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", "note": "a customer", "phone_number": "1-212-555-4240", + "preferences": { + "email_unsubscribed": false + }, "reference_id": "YOUR_REFERENCE_ID_1", "segment_ids": [ "1KB9JE5EGJXCW.REACHABLE" ], - "updated_at": "2018-03-08T18:25:54.859Z" + "updated_at": "2018-03-08T18:25:21.342Z", + "version": 1 } ] } diff --git a/doc/models/search-invoices-request.md b/doc/models/search-invoices-request.md index 0fd18b7f..ccc25257 100644 --- a/doc/models/search-invoices-request.md +++ b/doc/models/search-invoices-request.md @@ -12,7 +12,7 @@ Describes a `SearchInvoices` request. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `query` | [`InvoiceQuery`](/doc/models/invoice-query.md) | Required | Describes query criteria for searching invoices. | getQuery(): InvoiceQuery | setQuery(InvoiceQuery query): void | -| `limit` | `?int` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server
uses a default limit of 100 invoices. | getLimit(): ?int | setLimit(?int limit): void | +| `limit` | `?int` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | getLimit(): ?int | setLimit(?int limit): void | | `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this cursor to retrieve the next set of results for your original query.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) diff --git a/doc/models/search-invoices-response.md b/doc/models/search-invoices-response.md index ca5d0c08..85493f0b 100644 --- a/doc/models/search-invoices-response.md +++ b/doc/models/search-invoices-response.md @@ -23,6 +23,11 @@ Describes a `SearchInvoices` response. "invoices": [ { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/search-loyalty-accounts-request-loyalty-account-query.md b/doc/models/search-loyalty-accounts-request-loyalty-account-query.md index 9309a93f..ff1b95c2 100644 --- a/doc/models/search-loyalty-accounts-request-loyalty-account-query.md +++ b/doc/models/search-loyalty-accounts-request-loyalty-account-query.md @@ -21,9 +21,10 @@ The search criteria for the loyalty accounts. "mappings": [ { "id": "id4", - "type": "type6", + "type": "PHONE", "value": "value6", - "created_at": "created_at8" + "created_at": "created_at8", + "phone_number": "phone_number8" } ], "customer_ids": [ diff --git a/doc/models/search-loyalty-accounts-request.md b/doc/models/search-loyalty-accounts-request.md index c10efb4a..6582f56f 100644 --- a/doc/models/search-loyalty-accounts-request.md +++ b/doc/models/search-loyalty-accounts-request.md @@ -23,8 +23,7 @@ A request to search for loyalty accounts. "query": { "mappings": [ { - "type": "PHONE", - "value": "+14155551234" + "phone_number": "+14155551234" } ] } diff --git a/doc/models/search-loyalty-accounts-response.md b/doc/models/search-loyalty-accounts-response.md index 5276c7d2..f9354b97 100644 --- a/doc/models/search-loyalty-accounts-response.md +++ b/doc/models/search-loyalty-accounts-response.md @@ -26,10 +26,18 @@ A response that includes loyalty accounts that satisfy the search criteria. "customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0", "id": "79b807d2-d786-46a9-933b-918028d7a8c5", "lifetime_points": 20, + "mapping": { + "created_at": "2020-05-08T21:44:32Z", + "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234", + "type": "PHONE", + "value": "+14155551234" + }, "mappings": [ { "created_at": "2020-05-08T21:44:32Z", "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", + "phone_number": "+14155551234", "type": "PHONE", "value": "+14155551234" } diff --git a/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md b/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md index ea1029ee..10e24905 100644 --- a/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md +++ b/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md @@ -11,7 +11,7 @@ The set of search requirements. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](#type-LoyaltyAccount) to which the loyalty reward belongs. | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | +| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](/doc/models/loyalty-account.md) to which the loyalty reward belongs. | getLoyaltyAccountId(): string | setLoyaltyAccountId(string loyaltyAccountId): void | | `status` | [`?string (LoyaltyRewardStatus)`](/doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | getStatus(): ?string | setStatus(?string status): void | ## Example (as JSON) diff --git a/doc/models/search-orders-customer-filter.md b/doc/models/search-orders-customer-filter.md index 5f94ce9a..ef0808a8 100644 --- a/doc/models/search-orders-customer-filter.md +++ b/doc/models/search-orders-customer-filter.md @@ -3,7 +3,7 @@ Filter based on Order `customer_id` and any Tender `customer_id` associated with the Order. Does not filter based on the -[FulfillmentRecipient](#type-orderfulfillmentrecipient) `customer_id`. +[FulfillmentRecipient](/doc/models/order-fulfillment-recipient.md) `customer_id`. ## Structure diff --git a/doc/models/search-orders-date-time-filter.md b/doc/models/search-orders-date-time-filter.md index 55f4cc34..fbc0702e 100644 --- a/doc/models/search-orders-date-time-filter.md +++ b/doc/models/search-orders-date-time-filter.md @@ -10,7 +10,7 @@ For each time range, the start time and end time are inclusive. If the end time is absent, it defaults to the time of the first request for the cursor. __Important:__ If you use the DateTimeFilter in a SearchOrders query, -you must also set the `sort_field` in [OrdersSort](#type-searchorderordersort) +you must also set the `sort_field` in [OrdersSort](/doc/models/search-orders-sort.md) to the same field you filter for. For example, if you set the `CLOSED_AT` field in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to `CLOSED_AT`. Otherwise, SearchOrders will throw an error. diff --git a/doc/models/search-orders-filter.md b/doc/models/search-orders-filter.md index 5150cb4d..32999e8b 100644 --- a/doc/models/search-orders-filter.md +++ b/doc/models/search-orders-filter.md @@ -13,10 +13,10 @@ will be ANDed together. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `stateFilter` | [`?SearchOrdersStateFilter`](/doc/models/search-orders-state-filter.md) | Optional | Filter by current Order `state`. | getStateFilter(): ?SearchOrdersStateFilter | setStateFilter(?SearchOrdersStateFilter stateFilter): void | -| `dateTimeFilter` | [`?SearchOrdersDateTimeFilter`](/doc/models/search-orders-date-time-filter.md) | Optional | Filter for `Order` objects based on whether their `CREATED_AT`,
`CLOSED_AT` or `UPDATED_AT` timestamps fall within a specified time range.
You can specify the time range and which timestamp to filter for. You can filter
for only one time range at a time.

For each time range, the start time and end time are inclusive. If the end time
is absent, it defaults to the time of the first request for the cursor.

__Important:__ If you use the DateTimeFilter in a SearchOrders query,
you must also set the `sort_field` in [OrdersSort](#type-searchorderordersort)
to the same field you filter for. For example, if you set the `CLOSED_AT` field
in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to
`CLOSED_AT`. Otherwise, SearchOrders will throw an error.
[Learn more about filtering orders by time range](https://developer.squareup.com/docs/orders-api/manage-orders#important-note-on-filtering-orders-by-time-range). | getDateTimeFilter(): ?SearchOrdersDateTimeFilter | setDateTimeFilter(?SearchOrdersDateTimeFilter dateTimeFilter): void | -| `fulfillmentFilter` | [`?SearchOrdersFulfillmentFilter`](/doc/models/search-orders-fulfillment-filter.md) | Optional | Filter based on [Order Fulfillment](#type-orderfulfillment) information. | getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter | setFulfillmentFilter(?SearchOrdersFulfillmentFilter fulfillmentFilter): void | +| `dateTimeFilter` | [`?SearchOrdersDateTimeFilter`](/doc/models/search-orders-date-time-filter.md) | Optional | Filter for `Order` objects based on whether their `CREATED_AT`,
`CLOSED_AT` or `UPDATED_AT` timestamps fall within a specified time range.
You can specify the time range and which timestamp to filter for. You can filter
for only one time range at a time.

For each time range, the start time and end time are inclusive. If the end time
is absent, it defaults to the time of the first request for the cursor.

__Important:__ If you use the DateTimeFilter in a SearchOrders query,
you must also set the `sort_field` in [OrdersSort](/doc/models/search-orders-sort.md)
to the same field you filter for. For example, if you set the `CLOSED_AT` field
in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to
`CLOSED_AT`. Otherwise, SearchOrders will throw an error.
[Learn more about filtering orders by time range](https://developer.squareup.com/docs/orders-api/manage-orders#important-note-on-filtering-orders-by-time-range). | getDateTimeFilter(): ?SearchOrdersDateTimeFilter | setDateTimeFilter(?SearchOrdersDateTimeFilter dateTimeFilter): void | +| `fulfillmentFilter` | [`?SearchOrdersFulfillmentFilter`](/doc/models/search-orders-fulfillment-filter.md) | Optional | Filter based on [Order Fulfillment](/doc/models/order-fulfillment.md) information. | getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter | setFulfillmentFilter(?SearchOrdersFulfillmentFilter fulfillmentFilter): void | | `sourceFilter` | [`?SearchOrdersSourceFilter`](/doc/models/search-orders-source-filter.md) | Optional | Filter based on order `source` information. | getSourceFilter(): ?SearchOrdersSourceFilter | setSourceFilter(?SearchOrdersSourceFilter sourceFilter): void | -| `customerFilter` | [`?SearchOrdersCustomerFilter`](/doc/models/search-orders-customer-filter.md) | Optional | Filter based on Order `customer_id` and any Tender `customer_id`
associated with the Order. Does not filter based on the
[FulfillmentRecipient](#type-orderfulfillmentrecipient) `customer_id`. | getCustomerFilter(): ?SearchOrdersCustomerFilter | setCustomerFilter(?SearchOrdersCustomerFilter customerFilter): void | +| `customerFilter` | [`?SearchOrdersCustomerFilter`](/doc/models/search-orders-customer-filter.md) | Optional | Filter based on Order `customer_id` and any Tender `customer_id`
associated with the Order. Does not filter based on the
[FulfillmentRecipient](/doc/models/order-fulfillment-recipient.md) `customer_id`. | getCustomerFilter(): ?SearchOrdersCustomerFilter | setCustomerFilter(?SearchOrdersCustomerFilter customerFilter): void | ## Example (as JSON) diff --git a/doc/models/search-orders-fulfillment-filter.md b/doc/models/search-orders-fulfillment-filter.md index 667d21e3..64dfc3cf 100644 --- a/doc/models/search-orders-fulfillment-filter.md +++ b/doc/models/search-orders-fulfillment-filter.md @@ -1,7 +1,7 @@ # Search Orders Fulfillment Filter -Filter based on [Order Fulfillment](#type-orderfulfillment) information. +Filter based on [Order Fulfillment](/doc/models/order-fulfillment.md) information. ## Structure @@ -11,8 +11,8 @@ Filter based on [Order Fulfillment](#type-orderfulfillment) information. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `fulfillmentTypes` | [`?(string[]) (OrderFulfillmentType)`](/doc/models/order-fulfillment-type.md) | Optional | List of [fulfillment types](#type-orderfulfillmenttype) to filter
for. Will return orders if any of its fulfillments match any of the fulfillment types
listed in this field.
See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values | getFulfillmentTypes(): ?array | setFulfillmentTypes(?array fulfillmentTypes): void | -| `fulfillmentStates` | [`?(string[]) (OrderFulfillmentState)`](/doc/models/order-fulfillment-state.md) | Optional | List of [fulfillment states](#type-orderfulfillmentstate) to filter
for. Will return orders if any of its fulfillments match any of the
fulfillment states listed in this field.
See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values | getFulfillmentStates(): ?array | setFulfillmentStates(?array fulfillmentStates): void | +| `fulfillmentTypes` | [`?(string[]) (OrderFulfillmentType)`](/doc/models/order-fulfillment-type.md) | Optional | List of [fulfillment types](/doc/models/order-fulfillment-type.md) to filter
for. Will return orders if any of its fulfillments match any of the fulfillment types
listed in this field.
See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values | getFulfillmentTypes(): ?array | setFulfillmentTypes(?array fulfillmentTypes): void | +| `fulfillmentStates` | [`?(string[]) (OrderFulfillmentState)`](/doc/models/order-fulfillment-state.md) | Optional | List of [fulfillment states](/doc/models/order-fulfillment-state.md) to filter
for. Will return orders if any of its fulfillments match any of the
fulfillment states listed in this field.
See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values | getFulfillmentStates(): ?array | setFulfillmentStates(?array fulfillmentStates): void | ## Example (as JSON) diff --git a/doc/models/search-orders-request.md b/doc/models/search-orders-request.md index 5f1c64ca..9c13f6f9 100644 --- a/doc/models/search-orders-request.md +++ b/doc/models/search-orders-request.md @@ -15,10 +15,10 @@ results. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `locationIds` | `?(string[])` | Optional | The location IDs for the orders to query. All locations must belong to
the same merchant.

Min: 1 location IDs.

Max: 10 location IDs. | getLocationIds(): ?array | setLocationIds(?array locationIds): void | -| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.
See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.
See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more
information. | getCursor(): ?string | setCursor(?string cursor): void | | `query` | [`?SearchOrdersQuery`](/doc/models/search-orders-query.md) | Optional | Contains query criteria for the search. | getQuery(): ?SearchOrdersQuery | setQuery(?SearchOrdersQuery query): void | | `limit` | `?int` | Optional | Maximum number of results to be returned in a single page. It is
possible to receive fewer results than the specified limit on a given page.

Default: `500`
**Constraints**: `>= 1` | getLimit(): ?int | setLimit(?int limit): void | -| `returnEntries` | `?bool` | Optional | Boolean that controls the format of the search results. If `true`,
SearchOrders will return [`OrderEntry`](#type-orderentry) objects. If `false`, SearchOrders
will return complete Order objects.

Default: `false`. | getReturnEntries(): ?bool | setReturnEntries(?bool returnEntries): void | +| `returnEntries` | `?bool` | Optional | Boolean that controls the format of the search results. If `true`,
SearchOrders will return [`OrderEntry`](/doc/models/order-entry.md) objects. If `false`, SearchOrders
will return complete Order objects.

Default: `false`. | getReturnEntries(): ?bool | setReturnEntries(?bool returnEntries): void | ## Example (as JSON) diff --git a/doc/models/search-orders-response.md b/doc/models/search-orders-response.md index e4818277..943eee2b 100644 --- a/doc/models/search-orders-response.md +++ b/doc/models/search-orders-response.md @@ -2,7 +2,7 @@ # Search Orders Response Only one of `order_entries` or `orders` fields will be set, depending on whether -`return_entries` was set on the [SearchOrdersRequest](#type-searchorderrequest). +`return_entries` was set on the [SearchOrdersRequest](/doc/apis/orders.md#search-orders). ## Structure @@ -12,10 +12,10 @@ Only one of `order_entries` or `orders` fields will be set, depending on whether | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `orderEntries` | [`?(OrderEntry[])`](/doc/models/order-entry.md) | Optional | List of [OrderEntries](#type-orderentry) that fit the query
conditions. Populated only if `return_entries` was set to `true` in the request. | getOrderEntries(): ?array | setOrderEntries(?array orderEntries): void | -| `orders` | [`?(Order[])`](/doc/models/order.md) | Optional | List of
[Order](#type-order) objects that match query conditions. Populated only if
`return_entries` in the request is set to `false`. | getOrders(): ?array | setOrders(?array orders): void | -| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. | getCursor(): ?string | setCursor(?string cursor): void | -| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | [Errors](#type-error) encountered during the search. | getErrors(): ?array | setErrors(?array errors): void | +| `orderEntries` | [`?(OrderEntry[])`](/doc/models/order-entry.md) | Optional | List of [OrderEntries](/doc/models/order-entry.md) that fit the query
conditions. Populated only if `return_entries` was set to `true` in the request. | getOrderEntries(): ?array | setOrderEntries(?array orderEntries): void | +| `orders` | [`?(Order[])`](/doc/models/order.md) | Optional | List of
[Order](/doc/models/order.md) objects that match query conditions. Populated only if
`return_entries` in the request is set to `false`. | getOrders(): ?array | setOrders(?array orders): void | +| `cursor` | `?string` | Optional | The pagination cursor to be used in a subsequent request. If unset,
this is the final response.
See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more
information. | getCursor(): ?string | setCursor(?string cursor): void | +| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | [Errors](/doc/models/error.md) encountered during the search. | getErrors(): ?array | setErrors(?array errors): void | ## Example (as JSON) diff --git a/doc/models/search-orders-source-filter.md b/doc/models/search-orders-source-filter.md index e91bba0d..13128823 100644 --- a/doc/models/search-orders-source-filter.md +++ b/doc/models/search-orders-source-filter.md @@ -11,7 +11,7 @@ Filter based on order `source` information. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `sourceNames` | `?(string[])` | Optional | Filters by [Source](#type-ordersource) `name`. Will return any orders
with with a `source.name` that matches any of the listed source names.

Max: 10 source names. | getSourceNames(): ?array | setSourceNames(?array sourceNames): void | +| `sourceNames` | `?(string[])` | Optional | Filters by [Source](/doc/models/order-source.md) `name`. Will return any orders
with with a `source.name` that matches any of the listed source names.

Max: 10 source names. | getSourceNames(): ?array | setSourceNames(?array sourceNames): void | ## Example (as JSON) diff --git a/doc/models/search-subscriptions-request.md b/doc/models/search-subscriptions-request.md index 92f6ea89..4fa06b08 100644 --- a/doc/models/search-subscriptions-request.md +++ b/doc/models/search-subscriptions-request.md @@ -2,7 +2,7 @@ # Search Subscriptions Request Defines parameters in a -[SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint +[SearchSubscriptions](/doc/apis/subscriptions.md#search-subscriptions) endpoint request. ## Structure diff --git a/doc/models/search-subscriptions-response.md b/doc/models/search-subscriptions-response.md index e46961e6..3527b841 100644 --- a/doc/models/search-subscriptions-response.md +++ b/doc/models/search-subscriptions-response.md @@ -2,7 +2,7 @@ # Search Subscriptions Response Defines the fields that are included in the response from the -[SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint. +[SearchSubscriptions](/doc/apis/subscriptions.md#search-subscriptions) endpoint. ## Structure diff --git a/doc/models/segment-filter.md b/doc/models/segment-filter.md index 1096e529..dd536fcf 100644 --- a/doc/models/segment-filter.md +++ b/doc/models/segment-filter.md @@ -11,7 +11,7 @@ A query filter to search for appointment segments by. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](#type-CatalogItemVariation) representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1` | getServiceVariationId(): string | setServiceVariationId(string serviceVariationId): void | +| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](/doc/models/catalog-item-variation.md) representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1` | getServiceVariationId(): string | setServiceVariationId(string serviceVariationId): void | | `teamMemberIdFilter` | [`?FilterValue`](/doc/models/filter-value.md) | Optional | A filter to select resources based on an exact field value. For any given
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field. | getTeamMemberIdFilter(): ?FilterValue | setTeamMemberIdFilter(?FilterValue teamMemberIdFilter): void | ## Example (as JSON) diff --git a/doc/models/source-application.md b/doc/models/source-application.md index fe33c4c6..781e024b 100644 --- a/doc/models/source-application.md +++ b/doc/models/source-application.md @@ -12,7 +12,7 @@ Provides information about the application used to generate a change. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `product` | [`?string (Product)`](/doc/models/product.md) | Optional | Indicates the Square product used to generate an inventory change. | getProduct(): ?string | setProduct(?string product): void | -| `applicationId` | `?string` | Optional | Read-only Square ID assigned to the application. Only used for
[Product](#type-product) type `EXTERNAL_API`. | getApplicationId(): ?string | setApplicationId(?string applicationId): void | +| `applicationId` | `?string` | Optional | Read-only Square ID assigned to the application. Only used for
[Product](/doc/models/product.md) type `EXTERNAL_API`. | getApplicationId(): ?string | setApplicationId(?string applicationId): void | | `name` | `?string` | Optional | Read-only display name assigned to the application
(e.g. `"Custom Application"`, `"Square POS 4.74 for Android"`). | getName(): ?string | setName(?string name): void | ## Example (as JSON) diff --git a/doc/models/subscription-cadence.md b/doc/models/subscription-cadence.md index e5f236b6..e90ef146 100644 --- a/doc/models/subscription-cadence.md +++ b/doc/models/subscription-cadence.md @@ -1,7 +1,7 @@ # Subscription Cadence -Determines the billing cadence of a [Subscription](#type-Subscription) +Determines the billing cadence of a [Subscription](/doc/models/subscription.md) ## Enumeration diff --git a/doc/models/subscription-event-info-code.md b/doc/models/subscription-event-info-code.md new file mode 100644 index 00000000..cdca5556 --- /dev/null +++ b/doc/models/subscription-event-info-code.md @@ -0,0 +1,19 @@ + +# Subscription Event Info Code + +The possible subscription event info codes. + +## Enumeration + +`SubscriptionEventInfoCode` + +## Fields + +| Name | Description | +| --- | --- | +| `LOCATION_NOT_ACTIVE` | The location is not active. | +| `LOCATION_CANNOT_ACCEPT_PAYMENT` | The location cannot accept payments. | +| `CUSTOMER_DELETED` | The customer has been deleted. | +| `CUSTOMER_NO_EMAIL` | The customer doesn't have an email. | +| `CUSTOMER_NO_NAME` | The customer doesn't have a name. | + diff --git a/doc/models/subscription-event-info.md b/doc/models/subscription-event-info.md new file mode 100644 index 00000000..077228e9 --- /dev/null +++ b/doc/models/subscription-event-info.md @@ -0,0 +1,25 @@ + +# Subscription Event Info + +Provides information about the subscription event. + +## Structure + +`SubscriptionEventInfo` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `detail` | `?string` | Optional | A human-readable explanation for the event. | getDetail(): ?string | setDetail(?string detail): void | +| `code` | [`?string (SubscriptionEventInfoCode)`](/doc/models/subscription-event-info-code.md) | Optional | The possible subscription event info codes. | getCode(): ?string | setCode(?string code): void | + +## Example (as JSON) + +```json +{ + "detail": "detail6", + "code": "CUSTOMER_NO_EMAIL" +} +``` + diff --git a/doc/models/subscription-event-subscription-event-type.md b/doc/models/subscription-event-subscription-event-type.md index 862be470..99b3503e 100644 --- a/doc/models/subscription-event-subscription-event-type.md +++ b/doc/models/subscription-event-subscription-event-type.md @@ -14,4 +14,6 @@ The possible subscription event types. | `START_SUBSCRIPTION` | The subscription started. | | `PLAN_CHANGE` | The subscription plan changed. | | `STOP_SUBSCRIPTION` | The subscription stopped. | +| `DEACTIVATE_SUBSCRIPTION` | The subscription deactivated | +| `RESUME_SUBSCRIPTION` | The subscription resumed. | diff --git a/doc/models/subscription-event.md b/doc/models/subscription-event.md index 6d2da2c0..25738eb0 100644 --- a/doc/models/subscription-event.md +++ b/doc/models/subscription-event.md @@ -15,15 +15,20 @@ Describes changes to subscription and billing states. | `subscriptionEventType` | [`string (SubscriptionEventSubscriptionEventType)`](/doc/models/subscription-event-subscription-event-type.md) | Required | The possible subscription event types. | getSubscriptionEventType(): string | setSubscriptionEventType(string subscriptionEventType): void | | `effectiveDate` | `string` | Required | The date, in YYYY-MM-DD format (for
example, 2013-01-15), when the subscription event went into effect. | getEffectiveDate(): string | setEffectiveDate(string effectiveDate): void | | `planId` | `string` | Required | The ID of the subscription plan associated with the subscription. | getPlanId(): string | setPlanId(string planId): void | +| `info` | [`?SubscriptionEventInfo`](/doc/models/subscription-event-info.md) | Optional | Provides information about the subscription event. | getInfo(): ?SubscriptionEventInfo | setInfo(?SubscriptionEventInfo info): void | ## Example (as JSON) ```json { "id": "id0", - "subscription_event_type": "PLAN_CHANGE", + "subscription_event_type": "STOP_SUBSCRIPTION", "effective_date": "effective_date0", - "plan_id": "plan_id8" + "plan_id": "plan_id8", + "info": { + "detail": "detail6", + "code": "CUSTOMER_NO_EMAIL" + } } ``` diff --git a/doc/models/subscription-phase.md b/doc/models/subscription-phase.md index 011f1a79..a0454daa 100644 --- a/doc/models/subscription-phase.md +++ b/doc/models/subscription-phase.md @@ -13,7 +13,7 @@ Describes a phase in a subscription plan. For more information, see | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `uid` | `?string` | Optional | The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created. | getUid(): ?string | setUid(?string uid): void | -| `cadence` | [`string (SubscriptionCadence)`](/doc/models/subscription-cadence.md) | Required | Determines the billing cadence of a [Subscription](#type-Subscription) | getCadence(): string | setCadence(string cadence): void | +| `cadence` | [`string (SubscriptionCadence)`](/doc/models/subscription-cadence.md) | Required | Determines the billing cadence of a [Subscription](/doc/models/subscription.md) | getCadence(): string | setCadence(string cadence): void | | `periods` | `?int` | Optional | The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. | getPeriods(): ?int | setPeriods(?int periods): void | | `recurringPriceMoney` | [`Money`](/doc/models/money.md) | Required | 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. | getRecurringPriceMoney(): Money | setRecurringPriceMoney(Money recurringPriceMoney): void | | `ordinal` | `?int` | Optional | The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | diff --git a/doc/models/subscription-status.md b/doc/models/subscription-status.md index 2bb4552c..bbccc399 100644 --- a/doc/models/subscription-status.md +++ b/doc/models/subscription-status.md @@ -14,4 +14,5 @@ Possible subscription status values. | `PENDING` | The subscription starts in the future. | | `ACTIVE` | The subscription is active. | | `CANCELED` | The subscription is canceled. | +| `DEACTIVATED` | The subscription is deactivated. | diff --git a/doc/models/subscription.md b/doc/models/subscription.md index b999dbbe..1b6b7f99 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -15,17 +15,17 @@ For an overview of the `Subscription` type, see | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | The Square-assigned ID of the subscription.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | | `locationId` | `?string` | Optional | The ID of the location associated with the subscription. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `planId` | `?string` | Optional | The ID of the associated [subscription plan](#type-catalogsubscriptionplan). | getPlanId(): ?string | setPlanId(?string planId): void | -| `customerId` | `?string` | Optional | The ID of the associated [customer](#type-customer) profile. | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `planId` | `?string` | Optional | The ID of the associated [subscription plan](/doc/models/catalog-subscription-plan.md). | getPlanId(): ?string | setPlanId(?string planId): void | +| `customerId` | `?string` | Optional | The ID of the associated [customer](/doc/models/customer.md) profile. | getCustomerId(): ?string | setCustomerId(?string customerId): void | | `startDate` | `?string` | Optional | The start date of the subscription, in YYYY-MM-DD format (for example,
2013-01-15). | getStartDate(): ?string | setStartDate(?string startDate): void | | `canceledDate` | `?string` | Optional | The subscription cancellation date, in YYYY-MM-DD format (for
example, 2013-01-15). On this date, the subscription status changes
to `CANCELED` and the subscription billing stops.
If you don't set this field, the subscription plan dictates if and
when subscription ends.

You cannot update this field, you can only clear it. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | | `status` | [`?string (SubscriptionStatus)`](/doc/models/subscription-status.md) | Optional | Possible subscription status values. | getStatus(): ?string | setStatus(?string status): void | | `taxPercentage` | `?string` | Optional | The tax amount applied when billing the subscription. The
percentage is expressed in decimal form, using a `'.'` as the decimal
separator and without a `'%'` sign. For example, a value of `7.5`
corresponds to 7.5%. | getTaxPercentage(): ?string | setTaxPercentage(?string taxPercentage): void | -| `invoiceIds` | `?(string[])` | Optional | The IDs of the [invoices](#type-invoice) created for the
subscription, listed in order when the invoices were created
(oldest invoices appear first). | getInvoiceIds(): ?array | setInvoiceIds(?array invoiceIds): void | +| `invoiceIds` | `?(string[])` | Optional | The IDs of the [invoices](/doc/models/invoice.md) created for the
subscription, listed in order when the invoices were created
(oldest invoices appear first). | getInvoiceIds(): ?array | setInvoiceIds(?array invoiceIds): void | | `priceOverrideMoney` | [`?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. | getPriceOverrideMoney(): ?Money | setPriceOverrideMoney(?Money priceOverrideMoney): void | | `version` | `?int` | Optional | The version of the object. When updating an object, the version
supplied must match the version in the database, otherwise the write will
be rejected as conflicting. | getVersion(): ?int | setVersion(?int version): void | | `createdAt` | `?string` | Optional | The timestamp when the subscription was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `cardId` | `?string` | Optional | The ID of the [customer](#type-customer) [card](#type-card)
that is charged for the subscription. | getCardId(): ?string | setCardId(?string cardId): void | +| `cardId` | `?string` | Optional | The ID of the [customer](/doc/models/customer.md) [card](/doc/models/card.md)
that is charged for the subscription. | getCardId(): ?string | setCardId(?string cardId): void | | `paidUntilDate` | `?string` | Optional | The date up to which the customer is invoiced for the
subscription, in YYYY-MM-DD format (for example, 2013-01-15).

After the invoice is paid for a given billing period,
this date will be the last day of the billing period.
For example,
suppose for the month of May a customer gets an invoice
(or charged the card) on May 1. For the monthly billing scenario,
this date is then set to May 31. | getPaidUntilDate(): ?string | setPaidUntilDate(?string paidUntilDate): void | | `timezone` | `?string` | Optional | Timezone that will be used in date calculations for the subscription.
Defaults to the timezone of the location based on `location_id`.
Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). | getTimezone(): ?string | setTimezone(?string timezone): void | diff --git a/doc/models/team-member-assigned-locations-assignment-type.md b/doc/models/team-member-assigned-locations-assignment-type.md index 7b3dddcc..aead881a 100644 --- a/doc/models/team-member-assigned-locations-assignment-type.md +++ b/doc/models/team-member-assigned-locations-assignment-type.md @@ -11,6 +11,6 @@ Enumerates the possible assignment types the team member can have | Name | Description | | --- | --- | -| `ALL_CURRENT_AND_FUTURE_LOCATIONS` | The team member is assigned to all curent and future locations - the location_ids field
is empty if the team member has this assignment type. | +| `ALL_CURRENT_AND_FUTURE_LOCATIONS` | The team member is assigned to all current and future locations - the location_ids field
is empty if the team member has this assignment type. | | `EXPLICIT_LOCATIONS` | The team member is assigned to an explicit subset of locations - the location_ids field
is the list of locations that the team member is assigned to. | diff --git a/doc/models/team-member-booking-profile.md b/doc/models/team-member-booking-profile.md index d4db922f..d87ff923 100644 --- a/doc/models/team-member-booking-profile.md +++ b/doc/models/team-member-booking-profile.md @@ -11,7 +11,7 @@ The booking profile of a seller's team member, including the team member's ID, d | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `teamMemberId` | `?string` | Optional | The ID of the [TeamMember](#type-TeamMember) object for the team member associated with the booking profile. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | +| `teamMemberId` | `?string` | Optional | The ID of the [TeamMember](/doc/models/team-member.md) object for the team member associated with the booking profile. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | | `description` | `?string` | Optional | The description of the team member. | getDescription(): ?string | setDescription(?string description): void | | `displayName` | `?string` | Optional | The display name of the team member. | getDisplayName(): ?string | setDisplayName(?string displayName): void | | `isBookable` | `?bool` | Optional | Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true) or not (`false`). | getIsBookable(): ?bool | setIsBookable(?bool isBookable): void | diff --git a/doc/models/tender.md b/doc/models/tender.md index a6316469..d49ff84b 100644 --- a/doc/models/tender.md +++ b/doc/models/tender.md @@ -24,7 +24,7 @@ Represents a tender (i.e., a method of payment) used in a Square transaction. | `cardDetails` | [`?TenderCardDetails`](/doc/models/tender-card-details.md) | Optional | Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` | getCardDetails(): ?TenderCardDetails | setCardDetails(?TenderCardDetails cardDetails): void | | `cashDetails` | [`?TenderCashDetails`](/doc/models/tender-cash-details.md) | Optional | Represents the details of a tender with `type` `CASH`. | getCashDetails(): ?TenderCashDetails | setCashDetails(?TenderCashDetails cashDetails): void | | `additionalRecipients` | [`?(AdditionalRecipient[])`](/doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this tender.
For example, fees assessed on the purchase by a third party integration. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | -| `paymentId` | `?string` | Optional | The ID of the [Payment](#type-payment) that corresponds to this tender.
This value is only present for payments created with the v2 Payments API.
**Constraints**: *Maximum Length*: `192` | getPaymentId(): ?string | setPaymentId(?string paymentId): void | +| `paymentId` | `?string` | Optional | The ID of the [Payment](/doc/models/payment.md) that corresponds to this tender.
This value is only present for payments created with the v2 Payments API.
**Constraints**: *Maximum Length*: `192` | getPaymentId(): ?string | setPaymentId(?string paymentId): void | ## Example (as JSON) diff --git a/doc/models/transaction.md b/doc/models/transaction.md index 49b8b2ba..2007aef8 100644 --- a/doc/models/transaction.md +++ b/doc/models/transaction.md @@ -20,7 +20,7 @@ the transaction. | `createdAt` | `?string` | Optional | The timestamp for when the transaction was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `tenders` | [`?(Tender[])`](/doc/models/tender.md) | Optional | The tenders used to pay in the transaction. | getTenders(): ?array | setTenders(?array tenders): void | | `refunds` | [`?(Refund[])`](/doc/models/refund.md) | Optional | Refunds that have been applied to any tender in the transaction. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `referenceId` | `?string` | Optional | If the transaction was created with the [Charge](#endpoint-charge)
endpoint, this value is the same as the value provided for the `reference_id`
parameter in the request to that endpoint. Otherwise, it is not set.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | +| `referenceId` | `?string` | Optional | If the transaction was created with the [Charge](/doc/apis/transactions.md#charge)
endpoint, this value is the same as the value provided for the `reference_id`
parameter in the request to that endpoint. Otherwise, it is not set.
**Constraints**: *Maximum Length*: `40` | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `product` | [`?string (TransactionProduct)`](/doc/models/transaction-product.md) | Optional | Indicates the Square product used to process a transaction. | getProduct(): ?string | setProduct(?string product): void | | `clientId` | `?string` | Optional | If the transaction was created in the Square Point of Sale app, this value
is the ID generated for the transaction by Square Point of Sale.

This ID has no relationship to the transaction's canonical `id`, which is
generated by Square's backend servers. This value is generated for bookkeeping
purposes, in case the transaction cannot immediately be completed (for example,
if the transaction is processed in offline mode).

It is not currently possible with the Connect API to perform a transaction
lookup by this value.
**Constraints**: *Maximum Length*: `192` | getClientId(): ?string | setClientId(?string clientId): void | | `shippingAddress` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getShippingAddress(): ?Address | setShippingAddress(?Address shippingAddress): void | diff --git a/doc/models/update-customer-group-request.md b/doc/models/update-customer-group-request.md index 4c642f21..19e99b3d 100644 --- a/doc/models/update-customer-group-request.md +++ b/doc/models/update-customer-group-request.md @@ -1,8 +1,8 @@ # Update Customer Group Request -Defines the body parameters that can be provided in a request to the -[UpdateCustomerGroup](#endpoint-updatecustomergroup) endpoint. +Defines the body parameters that can be included in a request to the +[UpdateCustomerGroup](/doc/apis/customer-groups.md#update-customer-group) endpoint. ## Structure @@ -12,7 +12,7 @@ Defines the body parameters that can be provided in a request to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `group` | [`CustomerGroup`](/doc/models/customer-group.md) | Required | Represents a group of customer profiles.

Customer groups can be created, modified, and have their membership defined either via
the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. | getGroup(): CustomerGroup | setGroup(CustomerGroup group): void | +| `group` | [`CustomerGroup`](/doc/models/customer-group.md) | Required | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): CustomerGroup | setGroup(CustomerGroup group): void | ## Example (as JSON) diff --git a/doc/models/update-customer-group-response.md b/doc/models/update-customer-group-response.md index f985be4d..400a4575 100644 --- a/doc/models/update-customer-group-response.md +++ b/doc/models/update-customer-group-response.md @@ -2,9 +2,9 @@ # Update Customer Group Response Defines the fields that are included in the response body of -a request to the [UpdateCustomerGroup](#endpoint-updatecustomergroup) endpoint. +a request to the [UpdateCustomerGroup](/doc/apis/customer-groups.md#update-customer-group) endpoint. -One of `errors` or `group` is present in a given response (never both). +Either `errors` or `group` is present in a given response (never both). ## Structure @@ -15,7 +15,7 @@ One of `errors` or `group` is present in a given response (never both). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `group` | [`?CustomerGroup`](/doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, modified, and have their membership defined either via
the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | +| `group` | [`?CustomerGroup`](/doc/models/customer-group.md) | Optional | Represents a group of customer profiles.

Customer groups can be created, be modified, and have their membership defined using
the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. | getGroup(): ?CustomerGroup | setGroup(?CustomerGroup group): void | ## Example (as JSON) diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 0668ef2f..e25353d9 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -1,8 +1,8 @@ # Update Customer Request -Defines the body parameters that can be provided in a request to the -UpdateCustomer endpoint. +Defines the body parameters that can be included in a request to the +`UpdateCustomer` endpoint. ## Structure @@ -12,16 +12,17 @@ UpdateCustomer endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `givenName` | `?string` | Optional | The given (i.e., first) name associated with the customer profile. | getGivenName(): ?string | setGivenName(?string givenName): void | -| `familyName` | `?string` | Optional | The family (i.e., last) name associated with the customer profile. | getFamilyName(): ?string | setFamilyName(?string familyName): void | +| `givenName` | `?string` | Optional | The given name (that is, the first name) associated with the customer profile. | getGivenName(): ?string | setGivenName(?string givenName): void | +| `familyName` | `?string` | Optional | The family name (that is, the last name) associated with the customer profile. | getFamilyName(): ?string | setFamilyName(?string familyName): void | | `companyName` | `?string` | Optional | A business name associated with the customer profile. | getCompanyName(): ?string | setCompanyName(?string companyName): void | | `nickname` | `?string` | Optional | A nickname for the customer profile. | getNickname(): ?string | setNickname(?string nickname): void | | `emailAddress` | `?string` | Optional | The email address associated with the customer profile. | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | | `address` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getAddress(): ?Address | setAddress(?Address address): void | | `phoneNumber` | `?string` | Optional | The 11-digit phone number associated with the customer profile. | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | -| `referenceId` | `?string` | Optional | An optional, second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | +| `referenceId` | `?string` | Optional | An optional second ID used to associate the customer profile with an
entity in another system. | getReferenceId(): ?string | setReferenceId(?string referenceId): void | | `note` | `?string` | Optional | A custom note associated with the customer profile. | getNote(): ?string | setNote(?string note): void | -| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in RFC 3339 format.
Year is optional, timezone and times are not allowed.
For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st.
`1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. | getBirthday(): ?string | setBirthday(?string birthday): void | +| `birthday` | `?string` | Optional | The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The timezone and time are not allowed.
For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00:00-00:00` represents a birthday on September 21, 1998.
You can also specify this value in `YYYY-MM-DD` format. | getBirthday(): ?string | setBirthday(?string birthday): void | +| `version` | `?int` | Optional | The current version of the customer profile.

As a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile). | getVersion(): ?int | setVersion(?int version): void | ## Example (as JSON) @@ -29,7 +30,8 @@ UpdateCustomer endpoint. { "email_address": "New.Amelia.Earhart@example.com", "note": "updated customer note", - "phone_number": "" + "phone_number": "", + "version": 2 } ``` diff --git a/doc/models/update-customer-response.md b/doc/models/update-customer-response.md index 65b54633..ed9fb05b 100644 --- a/doc/models/update-customer-response.md +++ b/doc/models/update-customer-response.md @@ -2,9 +2,9 @@ # Update Customer Response Defines the fields that are included in the response body of -a request to the UpdateCustomer endpoint. +a request to the `UpdateCustomer` endpoint. -One of `errors` or `customer` is present in a given response (never both). +Either `errors` or `customer` is present in a given response (never both). ## Structure @@ -31,19 +31,18 @@ One of `errors` or `customer` is present in a given response (never both). "postal_code": "10003" }, "created_at": "2016-03-23T20:21:54.859Z", + "creation_source": "THIRD_PARTY", "email_address": "New.Amelia.Earhart@example.com", "family_name": "Earhart", "given_name": "Amelia", - "groups": [ - { - "id": "16894e93-96eb-4ced-b24b-f71d42bf084c", - "name": "Aviation Enthusiasts" - } - ], "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", "note": "updated customer note", + "preferences": { + "email_unsubscribed": false + }, "reference_id": "YOUR_REFERENCE_ID", - "updated_at": "2016-03-25T20:21:55Z" + "updated_at": "2016-05-15T20:21:55Z", + "version": 3 } } ``` diff --git a/doc/models/update-invoice-response.md b/doc/models/update-invoice-response.md index 9782c781..a2382d10 100644 --- a/doc/models/update-invoice-response.md +++ b/doc/models/update-invoice-response.md @@ -19,6 +19,11 @@ Describes a `UpdateInvoice` response. ```json { "invoice": { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, "created_at": "2020-06-18T17:45:13Z", "custom_fields": [ { diff --git a/doc/models/update-location-request.md b/doc/models/update-location-request.md index 60d68eff..73c0714d 100644 --- a/doc/models/update-location-request.md +++ b/doc/models/update-location-request.md @@ -1,7 +1,7 @@ # Update Location Request -Request object for the [UpdateLocation](#endpoint-updatelocation) endpoint. +Request object for the [UpdateLocation](/doc/apis/locations.md#update-location) endpoint. ## Structure diff --git a/doc/models/update-location-response.md b/doc/models/update-location-response.md index ea1ebdc9..d2c0e08e 100644 --- a/doc/models/update-location-response.md +++ b/doc/models/update-location-response.md @@ -1,7 +1,7 @@ # Update Location Response -Response object returned by the [UpdateLocation](#endpoint-updatelocation) endpoint. +Response object returned by the [UpdateLocation](/doc/apis/locations.md#update-location) endpoint. ## Structure diff --git a/doc/models/update-order-request.md b/doc/models/update-order-request.md index 0dbc0c12..03b017db 100644 --- a/doc/models/update-order-request.md +++ b/doc/models/update-order-request.md @@ -2,7 +2,7 @@ # Update Order Request Defines the fields that are included in requests to the -[UpdateOrder](#endpoint-orders-updateorder) endpoint. +[UpdateOrder](/doc/apis/orders.md#update-order) endpoint. ## Structure diff --git a/doc/models/update-order-response.md b/doc/models/update-order-response.md index fb9cc5fe..d8d9cb21 100644 --- a/doc/models/update-order-response.md +++ b/doc/models/update-order-response.md @@ -2,7 +2,7 @@ # Update Order Response Defines the fields that are included in the response body of -a request to the [UpdateOrder](#endpoint-orders-updateorder) endpoint. +a request to the [UpdateOrder](/doc/apis/orders.md#update-order) endpoint. ## Structure diff --git a/doc/models/update-payment-request.md b/doc/models/update-payment-request.md index c385853d..3ea34b94 100644 --- a/doc/models/update-payment-request.md +++ b/doc/models/update-payment-request.md @@ -2,7 +2,7 @@ # Update Payment Request Describes a request to update a payment using -[UpdatePayment](#endpoint-payments-updatepayment). +[UpdatePayment](/doc/apis/payments.md#update-payment). ## Structure diff --git a/doc/models/update-payment-response.md b/doc/models/update-payment-response.md index 8b2a2373..98ed9015 100644 --- a/doc/models/update-payment-response.md +++ b/doc/models/update-payment-response.md @@ -2,7 +2,7 @@ # Update Payment Response Defines the response returned by -[UpdatePayment](#endpoint-payments-update). +[UpdatePayment](/doc/apis/payments.md#update-payment). ## Structure diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index 31f7e438..57b76902 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -2,7 +2,7 @@ # Update Subscription Request Defines parameters in a -[UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint +[UpdateSubscription](/doc/apis/subscriptions.md#update-subscription) endpoint request. ## Structure diff --git a/doc/models/update-subscription-response.md b/doc/models/update-subscription-response.md index c6f1fcb9..eafb523e 100644 --- a/doc/models/update-subscription-response.md +++ b/doc/models/update-subscription-response.md @@ -2,7 +2,7 @@ # Update Subscription Response Defines the fields that are included in the response from the -[UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint. +[UpdateSubscription](/doc/apis/subscriptions.md#update-subscription) endpoint. ## Structure diff --git a/doc/models/v1-list-orders-response.md b/doc/models/v1-list-orders-response.md index 2907088d..f962d14c 100644 --- a/doc/models/v1-list-orders-response.md +++ b/doc/models/v1-list-orders-response.md @@ -20,19 +20,19 @@ "errors": [ { "category": "PAYMENT_METHOD_ERROR", - "code": "CARD_TOKEN_USED", + "code": "REFUND_DECLINED", "detail": "detail8", "field": "field6" }, { "category": "REFUND_ERROR", - "code": "AMOUNT_TOO_HIGH", + "code": "INVALID_CARD_DATA", "detail": "detail9", "field": "field7" }, { "category": "API_ERROR", - "code": "UNSUPPORTED_INSTRUMENT_TYPE", + "code": "SOURCE_USED", "detail": "detail0", "field": "field8" } @@ -46,7 +46,7 @@ "errors": [ { "category": "REFUND_ERROR", - "code": "AMOUNT_TOO_HIGH", + "code": "INVALID_CARD_DATA", "detail": "detail9", "field": "field7" } diff --git a/doc/models/v1-order.md b/doc/models/v1-order.md index 414bd1a0..62a380f3 100644 --- a/doc/models/v1-order.md +++ b/doc/models/v1-order.md @@ -44,19 +44,19 @@ V1Order "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", + "code": "UNPROCESSABLE_ENTITY", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", + "code": "RATE_LIMITED", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", + "code": "NOT_IMPLEMENTED", "detail": "detail3", "field": "field1" } diff --git a/doc/models/v1-payment-tax.md b/doc/models/v1-payment-tax.md index 86bc2e94..ef7d741f 100644 --- a/doc/models/v1-payment-tax.md +++ b/doc/models/v1-payment-tax.md @@ -25,19 +25,19 @@ V1PaymentTax "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "VALUE_TOO_SHORT", + "code": "UNPROCESSABLE_ENTITY", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "VALUE_TOO_LONG", + "code": "RATE_LIMITED", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "VALUE_TOO_LOW", + "code": "NOT_IMPLEMENTED", "detail": "detail3", "field": "field1" } diff --git a/doc/models/void-transaction-response.md b/doc/models/void-transaction-response.md index 31ac78ef..b12da29b 100644 --- a/doc/models/void-transaction-response.md +++ b/doc/models/void-transaction-response.md @@ -2,7 +2,7 @@ # Void Transaction Response Defines the fields that are included in the response body of -a request to the [VoidTransaction](#endpoint-voidtransaction) endpoint. +a request to the [VoidTransaction](/doc/apis/transactions.md#void-transaction) endpoint. ## Structure diff --git a/src/ApiHelper.php b/src/ApiHelper.php index 57c246ea..aa61118a 100644 --- a/src/ApiHelper.php +++ b/src/ApiHelper.php @@ -62,10 +62,10 @@ public static function appendUrlWithQueryParameters(string &$queryBuilder, array $hasParams = (strrpos($queryBuilder, '?') > 0); //if already has parameters, use the & to append new parameters - $queryBuilder = $queryBuilder . (($hasParams) ? '&' : '?'); + $queryBuilder .= (($hasParams) ? '&' : '?'); //append parameters - $queryBuilder = $queryBuilder . http_build_query($parameters); + $queryBuilder .= http_build_query($parameters); } /** @@ -159,8 +159,7 @@ public static function prepareFormFields(JsonSerializable $model): array foreach ($arr as $key => $value) { if ($value instanceof JsonSerializable) { $arr[$key] = static::prepareFormFields($value); - } elseif ( - is_array($value) && !empty($value) && !static::isAssociative($value) && + } elseif (is_array($value) && !empty($value) && !static::isAssociative($value) && $value[0] instanceof JsonSerializable ) { $temp = []; diff --git a/src/Apis/BankAccountsApi.php b/src/Apis/BankAccountsApi.php index 39f9946f..ece56ee7 100644 --- a/src/Apis/BankAccountsApi.php +++ b/src/Apis/BankAccountsApi.php @@ -23,7 +23,7 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * Returns a list of [BankAccount](#type-bankaccount) objects linked to a Square account. + * Returns a list of [BankAccount]($m/BankAccount) objects linked to a Square account. * * @param string|null $cursor The pagination cursor returned by a previous call to this * endpoint. @@ -107,7 +107,7 @@ public function listBankAccounts( } /** - * Returns details of a [BankAccount](#type-bankaccount) identified by V1 bank account ID. + * Returns details of a [BankAccount]($m/BankAccount) identified by V1 bank account ID. * * @param string $v1BankAccountId Connect V1 ID of the desired `BankAccount`. For more * information, see @@ -128,7 +128,7 @@ public function getBankAccountByV1Id(string $v1BankAccountId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'v1_bank_account_id' => $v1BankAccountId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -176,7 +176,7 @@ public function getBankAccountByV1Id(string $v1BankAccountId): ApiResponse } /** - * Returns details of a [BankAccount](#type-bankaccount) + * Returns details of a [BankAccount]($m/BankAccount) * linked to a Square account. * * @param string $bankAccountId Square-issued ID of the desired `BankAccount`. @@ -193,7 +193,7 @@ public function getBankAccount(string $bankAccountId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'bank_account_id' => $bankAccountId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/BaseApi.php b/src/Apis/BaseApi.php index 29312a44..24dfbb02 100644 --- a/src/Apis/BaseApi.php +++ b/src/Apis/BaseApi.php @@ -19,7 +19,7 @@ class BaseApi * * @var string */ - protected const USER_AGENT = 'Square-PHP-SDK/9.1.0.20210317'; + protected const USER_AGENT = 'Square-PHP-SDK/10.0.0.20210421'; /** * HttpCallBack instance associated with this controller diff --git a/src/Apis/BookingsApi.php b/src/Apis/BookingsApi.php index a061e77b..1cd795fa 100644 --- a/src/Apis/BookingsApi.php +++ b/src/Apis/BookingsApi.php @@ -241,7 +241,8 @@ public function listTeamMemberBookingProfiles( //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ - 'bookable_only' => (null != $bookableOnly) ? var_export($bookableOnly, true) : false, + 'bookable_only' => (null != $bookableOnly) ? + var_export($bookableOnly, true) : false, 'limit' => $limit, 'cursor' => $cursor, 'location_id' => $locationId, @@ -312,7 +313,7 @@ public function retrieveTeamMemberBookingProfile(string $teamMemberId): ApiRespo //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'team_member_id' => $teamMemberId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -365,8 +366,8 @@ public function retrieveTeamMemberBookingProfile(string $teamMemberId): ApiRespo /** * Retrieves a booking. * - * @param string $bookingId The ID of the [Booking](#type-booking) object representing the to- - * be-retrieved booking. + * @param string $bookingId The ID of the [Booking]($m/Booking) object representing the to-be- + * retrieved booking. * * @return ApiResponse Response from the API call * @@ -380,7 +381,7 @@ public function retrieveBooking(string $bookingId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'booking_id' => $bookingId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -430,8 +431,8 @@ public function retrieveBooking(string $bookingId): ApiResponse /** * Updates a booking. * - * @param string $bookingId The ID of the [Booking](#type-booking) object representing the to- - * be-updated booking. + * @param string $bookingId The ID of the [Booking]($m/Booking) object representing the to-be- + * updated booking. * @param \Square\Models\UpdateBookingRequest $body An object containing the fields to POST * for the request. * @@ -450,7 +451,7 @@ public function updateBooking(string $bookingId, \Square\Models\UpdateBookingReq //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'booking_id' => $bookingId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -504,8 +505,8 @@ public function updateBooking(string $bookingId, \Square\Models\UpdateBookingReq /** * Cancels an existing booking. * - * @param string $bookingId The ID of the [Booking](#type-booking) object representing the to- - * be-cancelled booking. + * @param string $bookingId The ID of the [Booking]($m/Booking) object representing the to-be- + * cancelled booking. * @param \Square\Models\CancelBookingRequest $body An object containing the fields to POST * for the request. * @@ -524,7 +525,7 @@ public function cancelBooking(string $bookingId, \Square\Models\CancelBookingReq //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'booking_id' => $bookingId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/CashDrawersApi.php b/src/Apis/CashDrawersApi.php index 89483e40..d6f19f74 100644 --- a/src/Apis/CashDrawersApi.php +++ b/src/Apis/CashDrawersApi.php @@ -110,8 +110,8 @@ public function listCashDrawerShifts( /** * Provides the summary details for a single cash drawer shift. See - * [ListCashDrawerShiftEvents](#endpoint-CashDrawers-ListCashDrawerShiftEvents) for a list of cash - * drawer shift events. + * [ListCashDrawerShiftEvents]($e/CashDrawers/ListCashDrawerShiftEvents) for a list of cash drawer + * shift events. * * @param string $locationId The ID of the location to retrieve cash drawer shifts from. * @param string $shiftId The shift ID. @@ -128,7 +128,7 @@ public function retrieveCashDrawerShift(string $locationId, string $shiftId): Ap //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'shift_id' => $shiftId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -205,7 +205,7 @@ public function listCashDrawerShiftEvents( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'shift_id' => $shiftId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ diff --git a/src/Apis/CatalogApi.php b/src/Apis/CatalogApi.php index 498b6ad1..fb6c6aaa 100644 --- a/src/Apis/CatalogApi.php +++ b/src/Apis/CatalogApi.php @@ -23,11 +23,11 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * Deletes a set of [CatalogItem](#type-catalogitem)s based on the + * Deletes a set of [CatalogItem]($m/CatalogItem)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]($m/CatalogItemVariation) * children. * * `BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted @@ -100,11 +100,11 @@ public function batchDeleteCatalogObjects(\Square\Models\BatchDeleteCatalogObjec /** * Returns a set of objects based on the provided ID. - * Each [CatalogItem](#type-catalogitem) returned in the set includes all of its + * Each [CatalogItem]($m/CatalogItem) 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]($m/CatalogItemVariation) objects, references to + * its [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of + * any [CatalogTax]($m/CatalogTax) objects that apply to it. * * @param \Square\Models\BatchRetrieveCatalogObjectsRequest $body An object containing the * fields to POST for the @@ -250,9 +250,9 @@ public function batchUpsertCatalogObjects(\Square\Models\BatchUpsertCatalogObjec } /** - * Uploads an image file to be represented by a [CatalogImage](#type-catalogimage) object linked to an + * Uploads an image file to be represented by a [CatalogImage]($m/CatalogImage) object linked to an * existing - * [CatalogObject](#type-catalogobject) instance. A call to this endpoint can upload an image, link an + * [CatalogObject]($m/CatalogObject) instance. A call to this endpoint can upload an image, link an * image to * a catalog object, or do both. * @@ -384,14 +384,14 @@ public function catalogInfo(): ApiResponse } /** - * 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]($m/CatalogObject)s that includes + * all objects of a set of desired types (for example, all [CatalogItem]($m/CatalogItem) + * and [CatalogTax]($m/CatalogTax) objects) in the catalog. The `types` parameter + * is specified as a comma-separated list of valid [CatalogObject]($m/CatalogObject) 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]($e/Catalog/SearchCatalogObjects) * and set the `include_deleted_objects` attribute value to `true`. * * @param string|null $cursor The pagination cursor returned in the previous response. Leave @@ -410,8 +410,7 @@ public function catalogInfo(): ApiResponse * This allows you to retrieve historical * versions of objects. The specified version value is matched * against - * the [CatalogObject](#type-catalogobject)s' `version` - * attribute. + * the [CatalogObject]($m/CatalogObject)s' `version` attribute. * * @return ApiResponse Response from the API call * @@ -475,7 +474,7 @@ public function listCatalog(?string $cursor = null, ?string $types = null, ?int } /** - * Creates or updates the target [CatalogObject](#type-catalogobject). + * Creates or updates the target [CatalogObject]($m/CatalogObject). * * @param \Square\Models\UpsertCatalogObjectRequest $body An object containing the fields to * POST for the request. @@ -542,12 +541,12 @@ public function upsertCatalogObject(\Square\Models\UpsertCatalogObjectRequest $b } /** - * Deletes a single [CatalogObject](#type-catalogobject) based on the + * Deletes a single [CatalogObject]($m/CatalogObject) 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]($m/CatalogItem) * will also delete all of its - * [CatalogItemVariation](#type-catalogitemvariation) children. + * [CatalogItemVariation]($m/CatalogItemVariation) children. * * @param string $objectId The ID of the catalog object to be deleted. When an object is * deleted, other @@ -567,7 +566,7 @@ public function deleteCatalogObject(string $objectId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'object_id' => $objectId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -615,13 +614,13 @@ public function deleteCatalogObject(string $objectId): ApiResponse } /** - * 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]($m/CatalogItem) as a + * [CatalogObject]($m/CatalogObject) based on the provided ID. The returned + * object includes all of the relevant [CatalogItem]($m/CatalogItem) + * information including: [CatalogItemVariation]($m/CatalogItemVariation) * children, references to its - * [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of - * any [CatalogTax](#type-catalogtax) objects that apply to it. + * [CatalogModifierList]($m/CatalogModifierList) objects, and the ids of + * any [CatalogTax]($m/CatalogTax) objects that apply to it. * * @param string $objectId The object ID of any type of catalog objects to be retrieved. * @param bool|null $includeRelatedObjects If `true`, the response will include additional @@ -643,8 +642,7 @@ public function deleteCatalogObject(string $objectId): ApiResponse * This allows you to retrieve historical * versions of objects. The value to retrieve a specific * version of an object can be found - * in the version field of [CatalogObject](#type- - * catalogobject)s. + * in the version field of [CatalogObject]($m/CatalogObject)s. * * @return ApiResponse Response from the API call * @@ -661,11 +659,12 @@ public function retrieveCatalogObject( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'object_id' => $objectId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ - 'include_related_objects' => (null != $includeRelatedObjects) ? var_export($includeRelatedObjects, true) : false, + 'include_related_objects' => (null != $includeRelatedObjects) ? + var_export($includeRelatedObjects, true) : false, 'catalog_version' => $catalogVersion, ]); @@ -715,13 +714,13 @@ public function retrieveCatalogObject( } /** - * Searches for [CatalogObject](#type-CatalogObject) of any type by matching supported search - * attribute values, + * Searches for [CatalogObject]($m/CatalogObject) 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]($e/Catalog/SearchCatalogItems) * endpoint in the following aspects: * * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` @@ -801,8 +800,8 @@ public function searchCatalogObjects(\Square\Models\SearchCatalogObjectsRequest * 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]($e/Catalog/SearchCatalogObjects) * endpoint in the following aspects: * * - `SearchCatalogItems` can only search for items or item variations, whereas `SearchCatalogObjects` @@ -878,8 +877,8 @@ public function searchCatalogItems(\Square\Models\SearchCatalogItemsRequest $bod } /** - * Updates the [CatalogModifierList](#type-catalogmodifierlist) objects - * that apply to the targeted [CatalogItem](#type-catalogitem) without having + * Updates the [CatalogModifierList]($m/CatalogModifierList) objects + * that apply to the targeted [CatalogItem]($m/CatalogItem) without having * to perform an upsert on the entire item. * * @param \Square\Models\UpdateItemModifierListsRequest $body An object containing the fields @@ -947,8 +946,8 @@ public function updateItemModifierLists(\Square\Models\UpdateItemModifierListsRe } /** - * Updates the [CatalogTax](#type-catalogtax) objects that apply to the - * targeted [CatalogItem](#type-catalogitem) without having to perform an + * Updates the [CatalogTax]($m/CatalogTax) objects that apply to the + * targeted [CatalogItem]($m/CatalogItem) without having to perform an * upsert on the entire item. * * @param \Square\Models\UpdateItemTaxesRequest $body An object containing the fields to POST diff --git a/src/Apis/CheckoutApi.php b/src/Apis/CheckoutApi.php index 128c55f1..6108e6bf 100644 --- a/src/Apis/CheckoutApi.php +++ b/src/Apis/CheckoutApi.php @@ -46,7 +46,7 @@ public function createCheckout(string $locationId, \Square\Models\CreateCheckout //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/CustomerGroupsApi.php b/src/Apis/CustomerGroupsApi.php index f251ec64..b12e4d37 100644 --- a/src/Apis/CustomerGroupsApi.php +++ b/src/Apis/CustomerGroupsApi.php @@ -26,11 +26,11 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * Retrieves the list of customer groups of a business. * * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your + * Provide this cursor to retrieve the next set of results for your * original query. * - * See the [Pagination guide](https://developer.squareup. - * com/docs/working-with-apis/pagination) for more information. + * For more information, see [Pagination](https://developer. + * squareup.com/docs/working-with-apis/pagination). * * @return ApiResponse Response from the API call * @@ -177,7 +177,7 @@ public function deleteCustomerGroup(string $groupId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'group_id' => $groupId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -241,7 +241,7 @@ public function retrieveCustomerGroup(string $groupId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'group_id' => $groupId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -310,7 +310,7 @@ public function updateCustomerGroup(string $groupId, \Square\Models\UpdateCustom //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'group_id' => $groupId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/CustomerSegmentsApi.php b/src/Apis/CustomerSegmentsApi.php index 37a1f052..e56a7786 100644 --- a/src/Apis/CustomerSegmentsApi.php +++ b/src/Apis/CustomerSegmentsApi.php @@ -26,11 +26,11 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * Retrieves the list of customer segments of a business. * * @param string|null $cursor A pagination cursor returned by previous calls to - * __ListCustomerSegments__. - * Used to retrieve the next set of query results. + * `ListCustomerSegments`. + * This cursor is used to retrieve the next set of query results. * - * See the [Pagination guide](https://developer.squareup. - * com/docs/working-with-apis/pagination) for more information. + * For more information, see [Pagination](https://developer. + * squareup.com/docs/working-with-apis/pagination). * * @return ApiResponse Response from the API call * @@ -108,7 +108,7 @@ public function retrieveCustomerSegment(string $segmentId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'segment_id' => $segmentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/CustomersApi.php b/src/Apis/CustomersApi.php index def8a456..0d9891c1 100644 --- a/src/Apis/CustomersApi.php +++ b/src/Apis/CustomersApi.php @@ -30,15 +30,15 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * profiles can take closer to one minute or longer, especially during network incidents and outages. * * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your + * Provide this cursor to retrieve the next set of results for your * original query. * - * See the [Pagination guide](https://developer.squareup. - * com/docs/working-with-apis/pagination) for more information. - * @param string|null $sortField Indicates how Customers should be sorted. + * For more information, see [Pagination](https://developer. + * squareup.com/docs/working-with-apis/pagination). + * @param string|null $sortField Indicates how customers should be sorted. * * Default: `DEFAULT`. - * @param string|null $sortOrder Indicates whether Customers should be sorted in ascending + * @param string|null $sortOrder Indicates whether customers should be sorted in ascending * (`ASC`) or * descending (`DESC`) order. * @@ -111,7 +111,7 @@ public function listCustomers( /** * Creates a new customer for a business, which can have associated cards on file. * - * You must provide __at least one__ of the following values in your request to this + * You must provide at least one of the following values in your request to this * endpoint: * * - `given_name` @@ -260,17 +260,30 @@ public function searchCustomers(\Square\Models\SearchCustomersRequest $body): Ap } /** - * Deletes a customer from a business, along with any linked cards on file. When two profiles - * are merged into a single profile, that profile is assigned a new `customer_id`. You must use the - * new `customer_id` to delete merged profiles. + * Deletes a customer profile from a business, including any linked cards on file. + * + * As a best practice, you should include the `version` field in the request to enable [optimistic + * concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. + * The value must be set to the current version of the customer profile. + * + * To delete a customer profile that was created by merging existing profiles, you must use the ID of + * the newly created profile. * * @param string $customerId The ID of the customer to delete. + * @param int|null $version The current version of the customer profile. + * + * As a best practice, you should include this parameter to enable + * [optimistic concurrency](https://developer.squareup. + * com/docs/working-with-apis/optimistic-concurrency) control. For + * more information, see [Delete a customer profile](https: + * //developer.squareup.com/docs/customers-api/use-the-api/keep- + * records#delete-customer-profile). * * @return ApiResponse Response from the API call * * @throws ApiException Thrown if API call fails */ - public function deleteCustomer(string $customerId): ApiResponse + public function deleteCustomer(string $customerId, ?int $version = null): ApiResponse { //prepare query string for API call $_queryBuilder = '/v2/customers/{customer_id}'; @@ -278,7 +291,12 @@ public function deleteCustomer(string $customerId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, - ]); + ]); + + //process optional query parameters + ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ + 'version' => $version, + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -342,7 +360,7 @@ public function retrieveCustomer(string $customerId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -390,15 +408,19 @@ public function retrieveCustomer(string $customerId): ApiResponse } /** - * Updates the details of an existing customer. When two profiles are merged - * into a single profile, that profile is assigned a new `customer_id`. You must use - * the new `customer_id` to update merged profiles. + * Updates a customer profile. To change an attribute, specify the new value. To remove an attribute, + * specify the value as an empty string or empty object. + * + * As a best practice, you should include the `version` field in the request to enable [optimistic + * concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. + * The value must be set to the current version of the customer profile. * - * You cannot edit a customer's cards on file with this endpoint. To make changes - * to a card on file, you must delete the existing card on file with the - * [DeleteCustomerCard](#endpoint-Customers-deletecustomercard) endpoint, then create a new one with - * the - * [CreateCustomerCard](#endpoint-Customers-createcustomercard) endpoint. + * To update a customer profile that was created by merging existing profiles, you must use the ID of + * the newly created profile. + * + * You cannot use this endpoint to change cards on file. To change a card on file, call + * [DeleteCustomerCard]($e/Customers/DeleteCustomerCard) to delete the existing card and then call + * [CreateCustomerCard]($e/Customers/CreateCustomerCard) to create a new card. * * @param string $customerId The ID of the customer to update. * @param \Square\Models\UpdateCustomerRequest $body An object containing the fields to POST @@ -419,7 +441,7 @@ public function updateCustomer(string $customerId, \Square\Models\UpdateCustomer //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -496,7 +518,7 @@ public function createCustomerCard(string $customerId, \Square\Models\CreateCust //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -566,7 +588,7 @@ public function deleteCustomerCard(string $customerId, string $cardId): ApiRespo $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, 'card_id' => $cardId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -635,7 +657,7 @@ public function removeGroupFromCustomer(string $customerId, string $groupId): Ap $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, 'group_id' => $groupId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -704,7 +726,7 @@ public function addGroupToCustomer(string $customerId, string $groupId): ApiResp $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'customer_id' => $customerId, 'group_id' => $groupId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/DevicesApi.php b/src/Apis/DevicesApi.php index f3acbd2a..b867d9ac 100644 --- a/src/Apis/DevicesApi.php +++ b/src/Apis/DevicesApi.php @@ -29,8 +29,8 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * Provide this to retrieve the next set of results for your * original query. * - * See [Paginating results](#paginatingresults) for more - * information. + * See [Paginating results](https://developer.squareup. + * com/docs/working-with-apis/pagination) for more information. * @param string|null $locationId If specified, only returns DeviceCodes of the specified * location. * Returns DeviceCodes of all locations if empty. @@ -191,7 +191,7 @@ public function getDeviceCode(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/DisputesApi.php b/src/Apis/DisputesApi.php index e5038db8..57005f66 100644 --- a/src/Apis/DisputesApi.php +++ b/src/Apis/DisputesApi.php @@ -121,7 +121,7 @@ public function retrieveDispute(string $disputeId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -189,7 +189,7 @@ public function acceptDispute(string $disputeId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -253,7 +253,7 @@ public function listDisputeEvidence(string $disputeId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -304,8 +304,7 @@ public function listDisputeEvidence(string $disputeId): ApiResponse * Removes specified evidence from a dispute. * * Square does not send the bank any evidence that is removed. Also, you cannot remove evidence after - * submitting it to the bank using [SubmitEvidence](https://developer.squareup. - * com/docs/reference/square/disputes-api/submit-evidence). + * submitting it to the bank using [SubmitEvidence]($e/Disputes/SubmitEvidence). * * @param string $disputeId The ID of the dispute you want to remove evidence from. * @param string $evidenceId The ID of the evidence you want to remove. @@ -323,7 +322,7 @@ public function removeDisputeEvidence(string $disputeId, string $evidenceId): Ap $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, 'evidence_id' => $evidenceId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -392,7 +391,7 @@ public function retrieveDisputeEvidence(string $disputeId, string $evidenceId): $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, 'evidence_id' => $evidenceId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -465,7 +464,7 @@ public function createDisputeEvidenceFile( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -542,7 +541,7 @@ public function createDisputeEvidenceText( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -597,10 +596,8 @@ public function createDisputeEvidenceText( * Submits evidence to the cardholder's bank. * * Before submitting evidence, Square compiles all available evidence. This includes evidence uploaded - * using the [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes- - * api/create-dispute-evidence-file) and - * [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create- - * dispute-evidence-text) endpoints and + * using the [CreateDisputeEvidenceFile]($e/Disputes/CreateDisputeEvidenceFile) and + * [CreateDisputeEvidenceText]($e/Disputes/CreateDisputeEvidenceText) endpoints and * evidence automatically provided by Square, when available. * * @param string $disputeId The ID of the dispute that you want to submit evidence for. @@ -617,7 +614,7 @@ public function submitEvidence(string $disputeId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'dispute_id' => $disputeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/EmployeesApi.php b/src/Apis/EmployeesApi.php index 879f39e1..fddfec42 100644 --- a/src/Apis/EmployeesApi.php +++ b/src/Apis/EmployeesApi.php @@ -121,7 +121,7 @@ public function retrieveEmployee(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/InventoryApi.php b/src/Apis/InventoryApi.php index c54370fb..aa91fa1c 100644 --- a/src/Apis/InventoryApi.php +++ b/src/Apis/InventoryApi.php @@ -23,10 +23,10 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * Returns the [InventoryAdjustment](#type-inventoryadjustment) object + * Returns the [InventoryAdjustment]($m/InventoryAdjustment) object * with the provided `adjustment_id`. * - * @param string $adjustmentId ID of the [InventoryAdjustment](#type-inventoryadjustment) to + * @param string $adjustmentId ID of the [InventoryAdjustment]($m/InventoryAdjustment) to * retrieve. * * @return ApiResponse Response from the API call @@ -41,7 +41,7 @@ public function retrieveInventoryAdjustment(string $adjustmentId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'adjustment_id' => $adjustmentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -244,8 +244,8 @@ public function batchRetrieveInventoryChanges( /** * Returns current counts for the provided - * [CatalogObject](#type-catalogobject)s at the requested - * [Location](#type-location)s. + * [CatalogObject]($m/CatalogObject)s at the requested + * [Location]($m/Location)s. * * Results are paginated and sorted in descending order according to their * `calculated_at` timestamp (newest first). @@ -325,11 +325,11 @@ public function batchRetrieveInventoryCounts(\Square\Models\BatchRetrieveInvento } /** - * Returns the [InventoryPhysicalCount](#type-inventoryphysicalcount) + * Returns the [InventoryPhysicalCount]($m/InventoryPhysicalCount) * object with the provided `physical_count_id`. * * @param string $physicalCountId ID of the - * [InventoryPhysicalCount](#type-inventoryphysicalcount) to + * [InventoryPhysicalCount]($m/InventoryPhysicalCount) to * retrieve. * * @return ApiResponse Response from the API call @@ -344,7 +344,7 @@ public function retrieveInventoryPhysicalCount(string $physicalCountId): ApiResp //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'physical_count_id' => $physicalCountId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -396,12 +396,12 @@ public function retrieveInventoryPhysicalCount(string $physicalCountId): ApiResp /** * Retrieves the current calculated stock count for a given - * [CatalogObject](#type-catalogobject) at a given set of - * [Location](#type-location)s. Responses are paginated and unsorted. + * [CatalogObject]($m/CatalogObject) at a given set of + * [Location]($m/Location)s. Responses are paginated and unsorted. * For more sophisticated queries, use a batch endpoint. * - * @param string $catalogObjectId ID of the [CatalogObject](#type-catalogobject) to retrieve. - * @param string|null $locationIds The [Location](#type-location) IDs to look up as a comma- + * @param string $catalogObjectId ID of the [CatalogObject]($m/CatalogObject) to retrieve. + * @param string|null $locationIds The [Location]($m/Location) IDs to look up as a comma- * separated * list. An empty list queries all locations. * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. @@ -426,7 +426,7 @@ public function retrieveInventoryCount( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'catalog_object_id' => $catalogObjectId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -481,8 +481,8 @@ public function retrieveInventoryCount( /** * Returns a set of physical counts and inventory adjustments for the - * provided [CatalogObject](#type-catalogobject) at the requested - * [Location](#type-location)s. + * provided [CatalogObject]($m/CatalogObject) at the requested + * [Location]($m/Location)s. * * Results are paginated and sorted in descending order according to their * `occurred_at` timestamp (newest first). @@ -491,8 +491,8 @@ public function retrieveInventoryCount( * used to display recent changes for a specific item. For more * sophisticated queries, use a batch endpoint. * - * @param string $catalogObjectId ID of the [CatalogObject](#type-catalogobject) to retrieve. - * @param string|null $locationIds The [Location](#type-location) IDs to look up as a comma- + * @param string $catalogObjectId ID of the [CatalogObject]($m/CatalogObject) to retrieve. + * @param string|null $locationIds The [Location]($m/Location) IDs to look up as a comma- * separated * list. An empty list queries all locations. * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. @@ -517,7 +517,7 @@ public function retrieveInventoryChanges( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'catalog_object_id' => $catalogObjectId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ diff --git a/src/Apis/InvoicesApi.php b/src/Apis/InvoicesApi.php index 3249c4c4..46e38bd2 100644 --- a/src/Apis/InvoicesApi.php +++ b/src/Apis/InvoicesApi.php @@ -25,7 +25,7 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC /** * Returns a list of invoices for a given location. The response * is paginated. If truncated, the response includes a `cursor` that you - * use in a subsequent request to fetch the next set of invoices. + * use in a subsequent request to retrieve the next set of invoices. * * @param string $locationId The ID of the location for which to list invoices. * @param string|null $cursor A pagination cursor returned by a previous call to this endpoint. @@ -37,8 +37,7 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * squareup.com/docs/working-with-apis/pagination). * @param int|null $limit The maximum number of invoices to return (200 is the maximum * `limit`). - * If not provided, the server - * uses a default limit of 100 invoices. + * If not provided, the server uses a default limit of 100 invoices. * * @return ApiResponse Response from the API call * @@ -102,7 +101,7 @@ public function listInvoices(string $locationId, ?string $cursor = null, ?int $l } /** - * Creates a draft [invoice](#type-invoice) + * Creates a draft [invoice]($m/Invoice) * for an order created using the Orders API. * * A draft invoice remains in your account and no action is taken. @@ -180,7 +179,7 @@ public function createInvoice(\Square\Models\CreateInvoiceRequest $body): ApiRes * optionally one customer. * * The response is paginated. If truncated, the response includes a `cursor` - * that you use in a subsequent request to fetch the next set of invoices. + * that you use in a subsequent request to retrieve the next set of invoices. * * @param \Square\Models\SearchInvoicesRequest $body An object containing the fields to POST * for the request. @@ -248,14 +247,14 @@ public function searchInvoices(\Square\Models\SearchInvoicesRequest $body): ApiR /** * Deletes the specified invoice. When an invoice is deleted, the - * associated Order status changes to CANCELED. You can only delete a draft + * associated order status changes to CANCELED. You can only delete a draft * invoice (you cannot delete a published invoice, including one that is scheduled for processing). * * @param string $invoiceId The ID of the invoice to delete. - * @param int|null $version The version of the [invoice](#type-invoice) to delete. + * @param int|null $version The version of the [invoice]($m/Invoice) to delete. * If you do not know the version, you can call - * [GetInvoice](#endpoint-Invoices-GetInvoice) or - * [ListInvoices](#endpoint-Invoices-ListInvoices). + * [GetInvoice]($e/Invoices/GetInvoice) or + * [ListInvoices]($e/Invoices/ListInvoices). * * @return ApiResponse Response from the API call * @@ -269,7 +268,7 @@ public function deleteInvoice(string $invoiceId, ?int $version = null): ApiRespo //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'invoice_id' => $invoiceId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -324,7 +323,7 @@ public function deleteInvoice(string $invoiceId, ?int $version = null): ApiRespo /** * Retrieves an invoice by invoice ID. * - * @param string $invoiceId The id of the invoice to retrieve. + * @param string $invoiceId The ID of the invoice to retrieve. * * @return ApiResponse Response from the API call * @@ -338,7 +337,7 @@ public function getInvoice(string $invoiceId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'invoice_id' => $invoiceId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -388,10 +387,10 @@ public function getInvoice(string $invoiceId): ApiResponse /** * Updates an invoice by modifying fields, clearing fields, or both. For most updates, you can use a * sparse - * `Invoice` object to add fields or change values, and use the `fields_to_clear` field to specify + * `Invoice` object to add fields or change values and use the `fields_to_clear` field to specify * fields to clear. * However, some restrictions apply. For example, you cannot change the `order_id` or `location_id` - * field, and you + * field and you * must provide the complete `custom_fields` list to update a custom field. Published invoices have * additional restrictions. * @@ -414,7 +413,7 @@ public function updateInvoice(string $invoiceId, \Square\Models\UpdateInvoiceReq //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'invoice_id' => $invoiceId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -472,7 +471,7 @@ public function updateInvoice(string $invoiceId, \Square\Models\UpdateInvoiceReq * You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, * `CANCELED`, or `FAILED`. * - * @param string $invoiceId The ID of the [invoice](#type-invoice) to cancel. + * @param string $invoiceId The ID of the [invoice]($m/Invoice) to cancel. * @param \Square\Models\CancelInvoiceRequest $body An object containing the fields to POST * for the request. * @@ -491,7 +490,7 @@ public function cancelInvoice(string $invoiceId, \Square\Models\CancelInvoiceReq //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'invoice_id' => $invoiceId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -553,9 +552,9 @@ public function cancelInvoice(string $invoiceId, \Square\Models\CancelInvoiceReq * The invoice `status` also changes from `DRAFT` to a status * based on the invoice configuration. For example, the status changes to `UNPAID` if * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the - * invoice amount). + * invoice amount. * - * @param string $invoiceId The id of the invoice to publish. + * @param string $invoiceId The ID of the invoice to publish. * @param \Square\Models\PublishInvoiceRequest $body An object containing the fields to POST * for the request. * @@ -574,7 +573,7 @@ public function publishInvoice(string $invoiceId, \Square\Models\PublishInvoiceR //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'invoice_id' => $invoiceId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/LaborApi.php b/src/Apis/LaborApi.php index bac775e8..f1575c09 100644 --- a/src/Apis/LaborApi.php +++ b/src/Apis/LaborApi.php @@ -193,7 +193,7 @@ public function deleteBreakType(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -257,7 +257,7 @@ public function getBreakType(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -326,7 +326,7 @@ public function updateBreakType(string $id, \Square\Models\UpdateBreakTypeReques //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -476,7 +476,7 @@ public function getEmployeeWage(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -704,7 +704,7 @@ public function deleteShift(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -768,7 +768,7 @@ public function getShift(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -843,7 +843,7 @@ public function updateShift(string $id, \Square\Models\UpdateShiftRequest $body) //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -986,7 +986,7 @@ public function getTeamMemberWage(string $id): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -1121,7 +1121,7 @@ public function updateWorkweekConfig(string $id, \Square\Models\UpdateWorkweekCo //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'id' => $id, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/LocationsApi.php b/src/Apis/LocationsApi.php index eb76059e..a0345034 100644 --- a/src/Apis/LocationsApi.php +++ b/src/Apis/LocationsApi.php @@ -26,7 +26,7 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * Provides information of all locations of a business. * * Many Square API endpoints require a `location_id` parameter. - * The `id` field of the [`Location`](#type-location) objects returned by this + * The `id` field of the [`Location`]($m/Location) objects returned by this * endpoint correspond to that `location_id` parameter. * * @return ApiResponse Response from the API call @@ -171,7 +171,7 @@ public function retrieveLocation(string $locationId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -240,7 +240,7 @@ public function updateLocation(string $locationId, \Square\Models\UpdateLocation //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/LoyaltyApi.php b/src/Apis/LoyaltyApi.php index 289d00a4..d34b1ef4 100644 --- a/src/Apis/LoyaltyApi.php +++ b/src/Apis/LoyaltyApi.php @@ -23,7 +23,8 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * Creates a loyalty account. + * Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and + * either the `mapping` field (preferred) or the `mappings` field. * * @param \Square\Models\CreateLoyaltyAccountRequest $body An object containing the fields to * POST for the request. @@ -164,7 +165,7 @@ public function searchLoyaltyAccounts(\Square\Models\SearchLoyaltyAccountsReques /** * Retrieves a loyalty account. * - * @param string $accountId The ID of the [loyalty account](#type-LoyaltyAccount) to retrieve. + * @param string $accountId The ID of the [loyalty account]($m/LoyaltyAccount) to retrieve. * * @return ApiResponse Response from the API call * @@ -178,7 +179,7 @@ public function retrieveLoyaltyAccount(string $accountId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'account_id' => $accountId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -233,12 +234,12 @@ public function retrieveLoyaltyAccount(string $accountId): ApiResponse * - If you are not using the Orders API to manage orders, * you first perform a client-side computation to compute the points. * For spend-based and visit-based programs, you can call - * [CalculateLoyaltyPoints](#endpoint-Loyalty-CalculateLoyaltyPoints) to compute the points. For more + * [CalculateLoyaltyPoints]($e/Loyalty/CalculateLoyaltyPoints) to compute the points. For more * information, * see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). * You then provide the points in a request to this endpoint. * - * @param string $accountId The [loyalty account](#type-LoyaltyAccount) ID to which to add the + * @param string $accountId The [loyalty account]($m/LoyaltyAccount) ID to which to add the * points. * @param \Square\Models\AccumulateLoyaltyPointsRequest $body An object containing the fields * to POST for the request. @@ -260,7 +261,7 @@ public function accumulateLoyaltyPoints( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'account_id' => $accountId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -316,10 +317,10 @@ public function accumulateLoyaltyPoints( * * Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, * you call - * [AccumulateLoyaltyPoints](#endpoint-Loyalty-AccumulateLoyaltyPoints) + * [AccumulateLoyaltyPoints]($e/Loyalty/AccumulateLoyaltyPoints) * to add points when a buyer pays for the purchase. * - * @param string $accountId The ID of the [loyalty account](#type-LoyaltyAccount) in which to + * @param string $accountId The ID of the [loyalty account]($m/LoyaltyAccount) in which to * adjust the points. * @param \Square\Models\AdjustLoyaltyPointsRequest $body An object containing the fields to * POST for the request. @@ -339,7 +340,7 @@ public function adjustLoyaltyPoints(string $accountId, \Square\Models\AdjustLoya //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'account_id' => $accountId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -398,6 +399,8 @@ public function adjustLoyaltyPoints(string $accountId, \Square\Models\AdjustLoya * (for example, points earned, points redeemed, and points expired) is * recorded in the ledger. Using this endpoint, you can search the ledger for events. * + * Search results are sorted by `created_at` in descending order. + * * @param \Square\Models\SearchLoyaltyEventsRequest $body An object containing the fields to * POST for the request. * @@ -520,6 +523,77 @@ public function listLoyaltyPrograms(): ApiResponse return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); } + /** + * Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword + * `main`. + * + * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can + * have only one loyalty program, which is created and managed from the Seller Dashboard. For more + * information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). + * + * @param string $programId The ID of the loyalty program or the keyword `main`. Either value + * can be used to retrieve the single loyalty program that belongs to + * the seller. + * + * @return ApiResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function retrieveLoyaltyProgram(string $programId): ApiResponse + { + //prepare query string for API call + $_queryBuilder = '/v2/loyalty/programs/{program_id}'; + + //process optional query parameters + $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ + 'program_id' => $programId, + ]); + + //validate and preprocess url + $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); + + //prepare headers + $_headers = [ + 'user-agent' => BaseApi::USER_AGENT, + 'Accept' => 'application/json', + 'Square-Version' => $this->config->getSquareVersion(), + 'Authorization' => sprintf('Bearer %1$s', $this->config->getAccessToken()) + ]; + $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders()); + + $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); + + //call on-before Http callback + if ($this->getHttpCallBack() != null) { + $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); + } + // Set request timeout + Request::timeout($this->config->getTimeout()); + + // and invoke the API call request to fetch the response + try { + $response = Request::get($_queryUrl, $_headers); + } catch (\Unirest\Exception $ex) { + throw new ApiException($ex->getMessage(), $_httpRequest); + } + + $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); + $_httpContext = new HttpContext($_httpRequest, $_httpResponse); + + //call on-after Http callback + if ($this->getHttpCallBack() != null) { + $this->getHttpCallBack()->callOnAfterRequest($_httpContext); + } + + if (!$this->isValidResponse($_httpResponse)) { + return ApiResponse::createFromContext($response->body, null, $_httpContext); + } + + $mapper = $this->getJsonMapper(); + $deserializedResponse = $mapper->mapClass($response->body, 'Square\\Models\\RetrieveLoyaltyProgramResponse'); + return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); + } + /** * Calculates the points a purchase earns. * @@ -531,7 +605,7 @@ public function listLoyaltyPrograms(): ApiResponse * An application might call this endpoint to show the points that a buyer can earn with the * specific purchase. * - * @param string $programId The [loyalty program](#type-LoyaltyProgram) ID, which defines the + * @param string $programId The [loyalty program]($m/LoyaltyProgram) ID, which defines the * rules for accruing points. * @param \Square\Models\CalculateLoyaltyPointsRequest $body An object containing the fields * to POST for the request. @@ -553,7 +627,7 @@ public function calculateLoyaltyPoints( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'program_id' => $programId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -684,7 +758,9 @@ public function createLoyaltyReward(\Square\Models\CreateLoyaltyRewardRequest $b * In the current implementation, the endpoint supports search by the reward `status`. * * If you know a reward ID, use the - * [RetrieveLoyaltyReward](#endpoint-Loyalty-RetrieveLoyaltyReward) endpoint. + * [RetrieveLoyaltyReward]($e/Loyalty/RetrieveLoyaltyReward) endpoint. + * + * Search results are sorted by `updated_at` in descending order. * * @param \Square\Models\SearchLoyaltyRewardsRequest $body An object containing the fields to * POST for the request. @@ -755,13 +831,13 @@ public function searchLoyaltyRewards(\Square\Models\SearchLoyaltyRewardsRequest * * - Returns the loyalty points back to the loyalty account. * - If an order ID was specified when the reward was created - * (see [CreateLoyaltyReward](#endpoint-Loyalty-CreateLoyaltyReward)), + * (see [CreateLoyaltyReward]($e/Loyalty/CreateLoyaltyReward)), * it updates the order by removing the reward and related * discounts. * * You cannot delete a reward that has reached the terminal state (REDEEMED). * - * @param string $rewardId The ID of the [loyalty reward](#type-LoyaltyReward) to delete. + * @param string $rewardId The ID of the [loyalty reward]($m/LoyaltyReward) to delete. * * @return ApiResponse Response from the API call * @@ -775,7 +851,7 @@ public function deleteLoyaltyReward(string $rewardId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'reward_id' => $rewardId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -825,7 +901,7 @@ public function deleteLoyaltyReward(string $rewardId): ApiResponse /** * Retrieves a loyalty reward. * - * @param string $rewardId The ID of the [loyalty reward](#type-LoyaltyReward) to retrieve. + * @param string $rewardId The ID of the [loyalty reward]($m/LoyaltyReward) to retrieve. * * @return ApiResponse Response from the API call * @@ -839,7 +915,7 @@ public function retrieveLoyaltyReward(string $rewardId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'reward_id' => $rewardId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -899,7 +975,7 @@ public function retrieveLoyaltyReward(string $rewardId): ApiResponse * In other words, points used for the reward cannot be returned * to the account. * - * @param string $rewardId The ID of the [loyalty reward](#type-LoyaltyReward) to redeem. + * @param string $rewardId The ID of the [loyalty reward]($m/LoyaltyReward) to redeem. * @param \Square\Models\RedeemLoyaltyRewardRequest $body An object containing the fields to * POST for the request. * @@ -918,7 +994,7 @@ public function redeemLoyaltyReward(string $rewardId, \Square\Models\RedeemLoyal //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'reward_id' => $rewardId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/MerchantsApi.php b/src/Apis/MerchantsApi.php index 994f97e1..2ec824fd 100644 --- a/src/Apis/MerchantsApi.php +++ b/src/Apis/MerchantsApi.php @@ -31,8 +31,7 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * token * to get the information for the merchant that granted you access. * - * If you know the merchant ID, you can also use the [RetrieveMerchant](#endpoint-merchants- - * retrievemerchant) + * If you know the merchant ID, you can also use the [RetrieveMerchant]($e/Merchants/RetrieveMerchant) * endpoint to get the merchant information. * * @param int|null $cursor The cursor generated by the previous response. @@ -116,7 +115,7 @@ public function retrieveMerchant(string $merchantId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'merchant_id' => $merchantId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/OAuthApi.php b/src/Apis/OAuthApi.php index 84522dc3..8a6c18b2 100644 --- a/src/Apis/OAuthApi.php +++ b/src/Apis/OAuthApi.php @@ -72,7 +72,7 @@ public function renewToken( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'client_id' => $clientId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/OrdersApi.php b/src/Apis/OrdersApi.php index 297c24cb..0e8fce1d 100644 --- a/src/Apis/OrdersApi.php +++ b/src/Apis/OrdersApi.php @@ -23,14 +23,14 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * Creates a new [Order](#type-order) which can include information on products for + * Creates a new [Order]($m/Order) which can include information on products for * purchase and settings to apply to the purchase. * - * To pay for a created order, please refer to the [Pay for Orders](https://developer.squareup. - * com/docs/orders-api/pay-for-orders) + * To pay for a created order, please refer to the + * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) * guide. * - * You can modify open orders using the [UpdateOrder](#endpoint-orders-updateorder) endpoint. + * You can modify open orders using the [UpdateOrder]($e/Orders/UpdateOrder) endpoint. * * @param \Square\Models\CreateOrderRequest $body An object containing the fields to POST for * the request. @@ -97,7 +97,7 @@ public function createOrder(\Square\Models\CreateOrderRequest $body): ApiRespons } /** - * Retrieves a set of [Order](#type-order)s by their IDs. + * Retrieves a set of [Order]($m/Order)s by their IDs. * * If a given Order ID does not exist, the ID is ignored instead of generating an error. * @@ -166,7 +166,7 @@ public function batchRetrieveOrders(\Square\Models\BatchRetrieveOrdersRequest $b } /** - * Calculates an [Order](#type-order). + * Enables applications to preview order pricing without creating an order. * * @param \Square\Models\CalculateOrderRequest $body An object containing the fields to POST * for the request. @@ -238,13 +238,13 @@ public function calculateOrder(\Square\Models\CalculateOrderRequest $body): ApiR * Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc). * * SearchOrders requests need to specify which locations to search and define a - * [`SearchOrdersQuery`](#type-searchordersquery) object which controls + * [`SearchOrdersQuery`]($m/SearchOrdersQuery) object which controls * how to sort or filter the results. Your SearchOrdersQuery can: * * Set filter criteria. * Set sort order. * Determine whether to return results as complete Order objects, or as - * [OrderEntry](#type-orderentry) objects. + * [OrderEntry]($m/OrderEntry) objects. * * Note that details for orders processed with Square Point of Sale while in * offline mode may not be transmitted to Square for up to 72 hours. Offline @@ -316,7 +316,7 @@ public function searchOrders(\Square\Models\SearchOrdersRequest $body): ApiRespo } /** - * Retrieves an [Order](#type-order) by ID. + * Retrieves an [Order]($m/Order) by ID. * * @param string $orderId The ID of the order to retrieve. * @@ -332,7 +332,7 @@ public function retrieveOrder(string $orderId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'order_id' => $orderId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -380,7 +380,7 @@ public function retrieveOrder(string $orderId): ApiResponse } /** - * Updates an open [Order](#type-order) by adding, replacing, or deleting + * Updates an open [Order]($m/Order) by adding, replacing, or deleting * fields. Orders with a `COMPLETED` or `CANCELED` state cannot be updated. * * An UpdateOrder request requires the following: @@ -395,8 +395,8 @@ public function retrieveOrder(string $orderId): ApiResponse * orders#on-dot-notation) * identifying fields to clear. * - * To pay for an order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders- - * api/pay-for-orders) guide. + * To pay for an order, please refer to the + * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. * * @param string $orderId The ID of the order to update. * @param \Square\Models\UpdateOrderRequest $body An object containing the fields to POST for @@ -417,7 +417,7 @@ public function updateOrder(string $orderId, \Square\Models\UpdateOrderRequest $ //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'order_id' => $orderId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -469,7 +469,7 @@ public function updateOrder(string $orderId, \Square\Models\UpdateOrderRequest $ } /** - * Pay for an [order](#type-order) using one or more approved [payments](#type-payment), + * Pay for an [order]($m/Order) using one or more approved [payments]($m/Payment), * or settle an order with a total of `0`. * * The total of the `payment_ids` listed in the request must be equal to the order @@ -478,8 +478,8 @@ public function updateOrder(string $orderId, \Square\Models\UpdateOrderRequest $ * * To be used with PayOrder, a payment must: * - * - Reference the order by specifying the `order_id` when [creating the payment](#endpoint-payments- - * createpayment). + * - Reference the order by specifying the `order_id` when [creating the + * payment]($e/Payments/CreatePayment). * Any approved payments that reference the same `order_id` not specified in the * `payment_ids` will be canceled. * - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take- @@ -505,7 +505,7 @@ public function payOrder(string $orderId, \Square\Models\PayOrderRequest $body): //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'order_id' => $orderId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/PaymentsApi.php b/src/Apis/PaymentsApi.php index b168dc9d..019de92d 100644 --- a/src/Apis/PaymentsApi.php +++ b/src/Apis/PaymentsApi.php @@ -25,6 +25,9 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC /** * Retrieves a list of payments taken by the account making the request. * + * Results are eventually consistent, and new payments or changes to payments might take several + * seconds to appear. + * * The maximum results per page is 100. * * @param string|null $beginTime The timestamp for the beginning of the reporting period, in @@ -141,7 +144,7 @@ public function listPayments( * to charge a card (credit/debit card or * Square gift card) or record a payment that the seller received outside of Square * (cash payment from a buyer or a payment that an external entity - * procesed on behalf of the seller). + * processed on behalf of the seller). * * The endpoint creates a * `Payment` object and returns it in the response. @@ -313,7 +316,7 @@ public function getPayment(string $paymentId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'payment_id' => $paymentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -383,7 +386,7 @@ public function updatePayment(string $paymentId, \Square\Models\UpdatePaymentReq //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'payment_id' => $paymentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -452,7 +455,7 @@ public function cancelPayment(string $paymentId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'payment_id' => $paymentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -519,7 +522,7 @@ public function completePayment(string $paymentId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'payment_id' => $paymentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/RefundsApi.php b/src/Apis/RefundsApi.php index 5f71eb39..bed1eca0 100644 --- a/src/Apis/RefundsApi.php +++ b/src/Apis/RefundsApi.php @@ -25,6 +25,9 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC /** * Retrieves a list of refunds for the account making the request. * + * Results are eventually consistent, and new refunds or changes to refunds might take several + * seconds to appear. + * * The maximum results per page is 100. * * @param string|null $beginTime The timestamp for the beginning of the requested reporting @@ -48,8 +51,8 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * are returned * for all locations associated with the seller. * @param string|null $status If provided, only refunds with the given status are returned. - * For a list of refund status values, see [PaymentRefund](#type- - * paymentrefund). + * For a list of refund status values, see + * [PaymentRefund]($m/PaymentRefund). * * Default: If omitted, refunds are returned regardless of their * status. @@ -232,7 +235,7 @@ public function getPaymentRefund(string $refundId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'refund_id' => $refundId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/SubscriptionsApi.php b/src/Apis/SubscriptionsApi.php index 7c032c70..ff6cc041 100644 --- a/src/Apis/SubscriptionsApi.php +++ b/src/Apis/SubscriptionsApi.php @@ -194,7 +194,7 @@ public function retrieveSubscription(string $subscriptionId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'subscription_id' => $subscriptionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -266,7 +266,7 @@ public function updateSubscription( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'subscription_id' => $subscriptionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -335,7 +335,7 @@ public function cancelSubscription(string $subscriptionId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'subscription_id' => $subscriptionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -414,7 +414,7 @@ public function listSubscriptionEvents( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'subscription_id' => $subscriptionId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -466,4 +466,68 @@ public function listSubscriptionEvents( $deserializedResponse = $mapper->mapClass($response->body, 'Square\\Models\\ListSubscriptionEventsResponse'); return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); } + + /** + * Resumes a deactivated subscription. + * + * @param string $subscriptionId The ID of the subscription to resume. + * + * @return ApiResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function resumeSubscription(string $subscriptionId): ApiResponse + { + //prepare query string for API call + $_queryBuilder = '/v2/subscriptions/{subscription_id}/resume'; + + //process optional query parameters + $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ + 'subscription_id' => $subscriptionId, + ]); + + //validate and preprocess url + $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); + + //prepare headers + $_headers = [ + 'user-agent' => BaseApi::USER_AGENT, + 'Accept' => 'application/json', + 'Square-Version' => $this->config->getSquareVersion(), + 'Authorization' => sprintf('Bearer %1$s', $this->config->getAccessToken()) + ]; + $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders()); + + $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl); + + //call on-before Http callback + if ($this->getHttpCallBack() != null) { + $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); + } + // Set request timeout + Request::timeout($this->config->getTimeout()); + + // and invoke the API call request to fetch the response + try { + $response = Request::post($_queryUrl, $_headers); + } catch (\Unirest\Exception $ex) { + throw new ApiException($ex->getMessage(), $_httpRequest); + } + + $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); + $_httpContext = new HttpContext($_httpRequest, $_httpResponse); + + //call on-after Http callback + if ($this->getHttpCallBack() != null) { + $this->getHttpCallBack()->callOnAfterRequest($_httpContext); + } + + if (!$this->isValidResponse($_httpResponse)) { + return ApiResponse::createFromContext($response->body, null, $_httpContext); + } + + $mapper = $this->getJsonMapper(); + $deserializedResponse = $mapper->mapClass($response->body, 'Square\\Models\\ResumeSubscriptionResponse'); + return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); + } } diff --git a/src/Apis/TeamApi.php b/src/Apis/TeamApi.php index aab6e12a..9745a2c8 100644 --- a/src/Apis/TeamApi.php +++ b/src/Apis/TeamApi.php @@ -105,7 +105,7 @@ public function createTeamMember(\Square\Models\CreateTeamMemberRequest $body): * will contain explicit error information for this particular create. * * Learn about [Troubleshooting the Teams API](https://developer.squareup. - * com/docs/team/troubleshooting#bulkcreateteammembers). + * com/docs/team/troubleshooting#bulk-create-team-members). * * @param \Square\Models\BulkCreateTeamMembersRequest $body An object containing the fields to * POST for the request. @@ -180,7 +180,7 @@ public function bulkCreateTeamMembers(\Square\Models\BulkCreateTeamMembersReques * of the response * will contain explicit error information for this particular update. * Learn about [Troubleshooting the Teams API](https://developer.squareup. - * com/docs/team/troubleshooting#bulkupdateteammembers). + * com/docs/team/troubleshooting#bulk-update-team-members). * * @param \Square\Models\BulkUpdateTeamMembersRequest $body An object containing the fields to * POST for the request. @@ -319,7 +319,7 @@ public function searchTeamMembers(\Square\Models\SearchTeamMembersRequest $body) /** * Retrieve a `TeamMember` object for the given `TeamMember.id`. * Learn about [Troubleshooting the Teams API](https://developer.squareup. - * com/docs/team/troubleshooting#retrieveteammember). + * com/docs/team/troubleshooting#retrieve-a-team-member). * * @param string $teamMemberId The ID of the team member to retrieve. * @@ -335,7 +335,7 @@ public function retrieveTeamMember(string $teamMemberId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'team_member_id' => $teamMemberId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -385,7 +385,7 @@ public function retrieveTeamMember(string $teamMemberId): ApiResponse /** * Updates a single `TeamMember` object. The `TeamMember` will be returned on successful updates. * Learn about [Troubleshooting the Teams API](https://developer.squareup. - * com/docs/team/troubleshooting#updateteammember). + * com/docs/team/troubleshooting#update-a-team-member). * * @param string $teamMemberId The ID of the team member to update. * @param \Square\Models\UpdateTeamMemberRequest $body An object containing the fields to POST @@ -406,7 +406,7 @@ public function updateTeamMember(string $teamMemberId, \Square\Models\UpdateTeam //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'team_member_id' => $teamMemberId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -477,7 +477,7 @@ public function retrieveWageSetting(string $teamMemberId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'team_member_id' => $teamMemberId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -530,7 +530,7 @@ public function retrieveWageSetting(string $teamMemberId): ApiResponse * it fully replaces the `WageSetting` object for the team member. * The `WageSetting` will be returned upon successful update. * Learn about [Troubleshooting the Teams API](https://developer.squareup. - * com/docs/team/troubleshooting#updatewagesetting). + * com/docs/team/troubleshooting#create-or-update-a-wage-setting). * * @param string $teamMemberId The ID of the team member to update the `WageSetting` object * for. @@ -552,7 +552,7 @@ public function updateWageSetting(string $teamMemberId, \Square\Models\UpdateWag //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'team_member_id' => $teamMemberId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/TerminalApi.php b/src/Apis/TerminalApi.php index 2f0ebbfa..03df20ef 100644 --- a/src/Apis/TerminalApi.php +++ b/src/Apis/TerminalApi.php @@ -174,7 +174,7 @@ public function getTerminalCheckout(string $checkoutId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'checkout_id' => $checkoutId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -238,7 +238,7 @@ public function cancelTerminalCheckout(string $checkoutId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'checkout_id' => $checkoutId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -437,7 +437,7 @@ public function getTerminalRefund(string $terminalRefundId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'terminal_refund_id' => $terminalRefundId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -502,7 +502,7 @@ public function cancelTerminalRefund(string $terminalRefundId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'terminal_refund_id' => $terminalRefundId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/TransactionsApi.php b/src/Apis/TransactionsApi.php index b195e549..ea57d204 100644 --- a/src/Apis/TransactionsApi.php +++ b/src/Apis/TransactionsApi.php @@ -32,7 +32,7 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * Refunds with a `status` of `PENDING` are not currently included in this * endpoint's response. * - * Max results per [page](#paginatingresults): 50 + * Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 * * @deprecated * @@ -40,13 +40,15 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * @param string|null $beginTime The beginning of the requested reporting period, in RFC 3339 * format. * - * See [Date ranges](#dateranges) for details on date + * See [Date ranges](https://developer.squareup.com/docs/build- + * basics/working-with-dates) for details on date * inclusivity/exclusivity. * * Default value: The current time minus one year. * @param string|null $endTime The end of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date + * See [Date ranges](https://developer.squareup.com/docs/build- + * basics/working-with-dates) for details on date * inclusivity/exclusivity. * * Default value: The current time. @@ -59,8 +61,8 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC * Provide this to retrieve the next set of results for your * original query. * - * See [Paginating results](#paginatingresults) for more - * information. + * See [Paginating results](https://developer.squareup. + * com/docs/working-with-apis/pagination) for more information. * * @return ApiResponse Response from the API call * @@ -81,7 +83,7 @@ public function listRefunds( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -142,7 +144,7 @@ public function listRefunds( * Transactions include payment information from sales and exchanges and refund * information from returns and exchanges. * - * Max results per [page](#paginatingresults): 50 + * Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 * * @deprecated * @@ -150,13 +152,15 @@ public function listRefunds( * @param string|null $beginTime The beginning of the requested reporting period, in RFC 3339 * format. * - * See [Date ranges](#dateranges) for details on date + * See [Date ranges](https://developer.squareup.com/docs/build- + * basics/working-with-dates) for details on date * inclusivity/exclusivity. * * Default value: The current time minus one year. * @param string|null $endTime The end of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date + * See [Date ranges](https://developer.squareup.com/docs/build- + * basics/working-with-dates) for details on date * inclusivity/exclusivity. * * Default value: The current time. @@ -169,8 +173,8 @@ public function listRefunds( * Provide this to retrieve the next set of results for your * original query. * - * See [Paginating results](#paginatingresults) for more - * information. + * See [Paginating results](https://developer.squareup. + * com/docs/working-with-apis/pagination) for more information. * * @return ApiResponse Response from the API call * @@ -191,7 +195,7 @@ public function listTransactions( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -265,8 +269,8 @@ public function listTransactions( * * When this response is returned, the amount of Square's processing fee might not yet be * calculated. To obtain the processing fee, wait about ten seconds and call - * [RetrieveTransaction](#endpoint-retrievetransaction). See the `processing_fee_money` - * field of each [Tender included](#type-tender) in the transaction. + * [RetrieveTransaction]($e/Transactions/RetrieveTransaction). See the `processing_fee_money` + * field of each [Tender included]($m/Tender) in the transaction. * * @deprecated * @@ -291,7 +295,7 @@ public function charge(string $locationId, \Square\Models\ChargeRequest $body): //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -365,7 +369,7 @@ public function retrieveTransaction(string $locationId, string $transactionId): $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'transaction_id' => $transactionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -413,7 +417,7 @@ public function retrieveTransaction(string $locationId, string $transactionId): } /** - * Captures a transaction that was created with the [Charge](#endpoint-charge) + * Captures a transaction that was created with the [Charge]($e/Transactions/Charge) * endpoint with a `delay_capture` value of `true`. * * @@ -441,7 +445,7 @@ public function captureTransaction(string $locationId, string $transactionId): A $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'transaction_id' => $transactionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -528,7 +532,7 @@ public function createRefund( $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'transaction_id' => $transactionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -580,7 +584,7 @@ public function createRefund( } /** - * Cancels a transaction that was created with the [Charge](#endpoint-charge) + * Cancels a transaction that was created with the [Charge]($e/Transactions/Charge) * endpoint with a `delay_capture` value of `true`. * * @@ -608,7 +612,7 @@ public function voidTransaction(string $locationId, string $transactionId): ApiR $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'transaction_id' => $transactionId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/V1EmployeesApi.php b/src/Apis/V1EmployeesApi.php index 97ce69ec..ac4e3bb8 100644 --- a/src/Apis/V1EmployeesApi.php +++ b/src/Apis/V1EmployeesApi.php @@ -214,7 +214,7 @@ public function retrieveEmployee(string $employeeId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'employee_id' => $employeeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -283,7 +283,7 @@ public function updateEmployee(string $employeeId, \Square\Models\V1Employee $bo //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'employee_id' => $employeeId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -418,7 +418,7 @@ public function listEmployeeRoles( * role might be able to issue refunds in Square Point of Sale, whereas an * employee with a "Clerk" role might not. * - * Roles are assigned with the [V1UpdateEmployee](#endpoint-v1updateemployee) + * Roles are assigned with the [V1UpdateEmployee]($e/V1Employees/UpdateEmployeeRole) * endpoint. An employee can have only one role at a time. * * If an employee has no role, they have none of the permissions associated @@ -502,7 +502,7 @@ public function retrieveEmployeeRole(string $roleId): ApiResponse //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'role_id' => $roleId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -571,7 +571,7 @@ public function updateEmployeeRole(string $roleId, \Square\Models\V1EmployeeRole //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'role_id' => $roleId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/Apis/V1TransactionsApi.php b/src/Apis/V1TransactionsApi.php index 7913e7b2..f2cbce5a 100644 --- a/src/Apis/V1TransactionsApi.php +++ b/src/Apis/V1TransactionsApi.php @@ -49,7 +49,7 @@ public function listOrders( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -123,7 +123,7 @@ public function retrieveOrder(string $locationId, string $orderId): ApiResponse $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'order_id' => $orderId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -199,7 +199,7 @@ public function updateOrder( $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'order_id' => $orderId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -303,7 +303,7 @@ public function listPayments( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -312,7 +312,8 @@ public function listPayments( 'end_time' => $endTime, 'limit' => $limit, 'batch_token' => $batchToken, - 'include_partial' => (null != $includePartial) ? var_export($includePartial, true) : false, + 'include_partial' => (null != $includePartial) ? + var_export($includePartial, true) : false, ]); //validate and preprocess url @@ -382,7 +383,7 @@ public function retrievePayment(string $locationId, string $paymentId): ApiRespo $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'payment_id' => $paymentId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -469,7 +470,7 @@ public function listRefunds( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -558,7 +559,7 @@ public function createRefund(string $locationId, \Square\Models\V1CreateRefundRe //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); @@ -655,7 +656,7 @@ public function listSettlements( //process optional query parameters $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, - ]); + ]); //process optional query parameters ApiHelper::appendUrlWithQueryParameters($_queryBuilder, [ @@ -748,7 +749,7 @@ public function retrieveSettlement(string $locationId, string $settlementId): Ap $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ 'location_id' => $locationId, 'settlement_id' => $settlementId, - ]); + ]); //validate and preprocess url $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php index 1b88ece0..efc8ed84 100644 --- a/src/ConfigurationDefaults.php +++ b/src/ConfigurationDefaults.php @@ -11,7 +11,7 @@ class ConfigurationDefaults { public const TIMEOUT = 60; - public const SQUARE_VERSION = '2021-03-17'; + public const SQUARE_VERSION = '2021-04-21'; public const ACCESS_TOKEN = 'TODO: Replace'; diff --git a/src/Models/AccumulateLoyaltyPointsRequest.php b/src/Models/AccumulateLoyaltyPointsRequest.php index efd441f6..d2b1aab6 100644 --- a/src/Models/AccumulateLoyaltyPointsRequest.php +++ b/src/Models/AccumulateLoyaltyPointsRequest.php @@ -90,7 +90,7 @@ public function setIdempotencyKey(string $idempotencyKey): void /** * Returns Location Id. * - * The [location](#type-Location) where the purchase was made. + * The [location]($m/Location) where the purchase was made. */ public function getLocationId(): string { @@ -100,7 +100,7 @@ public function getLocationId(): string /** * Sets Location Id. * - * The [location](#type-Location) where the purchase was made. + * The [location]($m/Location) where the purchase was made. * * @required * @maps location_id diff --git a/src/Models/AddGroupToCustomerResponse.php b/src/Models/AddGroupToCustomerResponse.php index 9e38569e..e5cde2e0 100644 --- a/src/Models/AddGroupToCustomerResponse.php +++ b/src/Models/AddGroupToCustomerResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [AddGroupToCustomer](#endpoint-addgrouptocustomer) endpoint. + * a request to the [AddGroupToCustomer]($e/Customers/AddGroupToCustomer) endpoint. */ class AddGroupToCustomerResponse implements \JsonSerializable { diff --git a/src/Models/AdditionalRecipient.php b/src/Models/AdditionalRecipient.php index 50572280..eda18bd9 100644 --- a/src/Models/AdditionalRecipient.php +++ b/src/Models/AdditionalRecipient.php @@ -15,7 +15,7 @@ class AdditionalRecipient implements \JsonSerializable private $locationId; /** - * @var string + * @var string|null */ private $description; @@ -31,13 +31,11 @@ class AdditionalRecipient implements \JsonSerializable /** * @param string $locationId - * @param string $description * @param Money $amountMoney */ - public function __construct(string $locationId, string $description, Money $amountMoney) + public function __construct(string $locationId, Money $amountMoney) { $this->locationId = $locationId; - $this->description = $description; $this->amountMoney = $amountMoney; } @@ -69,7 +67,7 @@ public function setLocationId(string $locationId): void * * The description of the additional recipient. */ - public function getDescription(): string + public function getDescription(): ?string { return $this->description; } @@ -79,10 +77,9 @@ public function getDescription(): string * * The description of the additional recipient. * - * @required * @maps description */ - public function setDescription(string $description): void + public function setDescription(?string $description): void { $this->description = $description; } @@ -125,8 +122,8 @@ public function setAmountMoney(Money $amountMoney): void /** * Returns Receivable Id. * - * The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), - * assigned by the server. + * The unique ID for this [AdditionalRecipientReceivable]($m/AdditionalRecipientReceivable), assigned + * by the server. */ public function getReceivableId(): ?string { @@ -136,8 +133,8 @@ public function getReceivableId(): ?string /** * Sets Receivable Id. * - * The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), - * assigned by the server. + * The unique ID for this [AdditionalRecipientReceivable]($m/AdditionalRecipientReceivable), assigned + * by the server. * * @maps receivable_id */ diff --git a/src/Models/AppointmentSegment.php b/src/Models/AppointmentSegment.php index a62b8f91..22616beb 100644 --- a/src/Models/AppointmentSegment.php +++ b/src/Models/AppointmentSegment.php @@ -73,8 +73,8 @@ public function setDurationMinutes(int $durationMinutes): void /** * Returns Service Variation Id. * - * The ID of the [CatalogItemVariation](#type-CatalogItemVariation) object representing the service - * booked in this segment. + * The ID of the [CatalogItemVariation]($m/CatalogItemVariation) object representing the service booked + * in this segment. */ public function getServiceVariationId(): string { @@ -84,8 +84,8 @@ public function getServiceVariationId(): string /** * Sets Service Variation Id. * - * The ID of the [CatalogItemVariation](#type-CatalogItemVariation) object representing the service - * booked in this segment. + * The ID of the [CatalogItemVariation]($m/CatalogItemVariation) object representing the service booked + * in this segment. * * @required * @maps service_variation_id @@ -98,8 +98,7 @@ public function setServiceVariationId(string $serviceVariationId): void /** * Returns Team Member Id. * - * The ID of the [TeamMember](#type-TeamMember) object representing the team member booked in this - * segment. + * The ID of the [TeamMember]($m/TeamMember) object representing the team member booked in this segment. */ public function getTeamMemberId(): string { @@ -109,8 +108,7 @@ public function getTeamMemberId(): string /** * Sets Team Member Id. * - * The ID of the [TeamMember](#type-TeamMember) object representing the team member booked in this - * segment. + * The ID of the [TeamMember]($m/TeamMember) object representing the team member booked in this segment. * * @required * @maps team_member_id diff --git a/src/Models/Availability.php b/src/Models/Availability.php index 38537bbc..540e90dc 100644 --- a/src/Models/Availability.php +++ b/src/Models/Availability.php @@ -28,7 +28,7 @@ class Availability implements \JsonSerializable /** * Returns Start At. * - * The RFC-3339 timestamp specifying the beginning time of the slot available for booking. + * The RFC 3339 timestamp specifying the beginning time of the slot available for booking. */ public function getStartAt(): ?string { @@ -38,7 +38,7 @@ public function getStartAt(): ?string /** * Sets Start At. * - * The RFC-3339 timestamp specifying the beginning time of the slot available for booking. + * The RFC 3339 timestamp specifying the beginning time of the slot available for booking. * * @maps start_at */ diff --git a/src/Models/BatchRetrieveCatalogObjectsRequest.php b/src/Models/BatchRetrieveCatalogObjectsRequest.php index 33bd32e6..fbf2ca8e 100644 --- a/src/Models/BatchRetrieveCatalogObjectsRequest.php +++ b/src/Models/BatchRetrieveCatalogObjectsRequest.php @@ -100,7 +100,7 @@ public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void * The specific version of the catalog objects to be included in the response. * This allows you to retrieve historical versions of objects. The specified version value is matched * against - * the [CatalogObject](#type-catalogobject)s' `version` attribute. + * the [CatalogObject]($m/CatalogObject)s' `version` attribute. */ public function getCatalogVersion(): ?int { @@ -113,7 +113,7 @@ public function getCatalogVersion(): ?int * The specific version of the catalog objects to be included in the response. * This allows you to retrieve historical versions of objects. The specified version value is matched * against - * the [CatalogObject](#type-catalogobject)s' `version` attribute. + * the [CatalogObject]($m/CatalogObject)s' `version` attribute. * * @maps catalog_version */ diff --git a/src/Models/BatchRetrieveCatalogObjectsResponse.php b/src/Models/BatchRetrieveCatalogObjectsResponse.php index cafea7da..23a47c59 100644 --- a/src/Models/BatchRetrieveCatalogObjectsResponse.php +++ b/src/Models/BatchRetrieveCatalogObjectsResponse.php @@ -50,7 +50,7 @@ public function setErrors(?array $errors): void /** * Returns Objects. * - * A list of [CatalogObject](#type-catalogobject)s returned. + * A list of [CatalogObject]($m/CatalogObject)s returned. * * @return CatalogObject[]|null */ @@ -62,7 +62,7 @@ public function getObjects(): ?array /** * Sets Objects. * - * A list of [CatalogObject](#type-catalogobject)s returned. + * A list of [CatalogObject]($m/CatalogObject)s returned. * * @maps objects * @@ -76,7 +76,7 @@ public function setObjects(?array $objects): void /** * Returns Related Objects. * - * A list of [CatalogObject](#type-catalogobject)s referenced by the object in the `objects` field. + * A list of [CatalogObject]($m/CatalogObject)s referenced by the object in the `objects` field. * * @return CatalogObject[]|null */ @@ -88,7 +88,7 @@ public function getRelatedObjects(): ?array /** * Sets Related Objects. * - * A list of [CatalogObject](#type-catalogobject)s referenced by the object in the `objects` field. + * A list of [CatalogObject]($m/CatalogObject)s referenced by the object in the `objects` field. * * @maps related_objects * diff --git a/src/Models/Booking.php b/src/Models/Booking.php index db611a26..da6e5ca9 100644 --- a/src/Models/Booking.php +++ b/src/Models/Booking.php @@ -135,7 +135,7 @@ public function setStatus(?string $status): void /** * Returns Created At. * - * The timestamp specifying the creation time of this booking. + * The timestamp specifying the creation time of this booking, in RFC 3339 format. */ public function getCreatedAt(): ?string { @@ -145,7 +145,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * The timestamp specifying the creation time of this booking. + * The timestamp specifying the creation time of this booking, in RFC 3339 format. * * @maps created_at */ @@ -157,7 +157,7 @@ public function setCreatedAt(?string $createdAt): void /** * Returns Updated At. * - * The timestamp specifying the most recent update time of this booking. + * The timestamp specifying the most recent update time of this booking, in RFC 3339 format. */ public function getUpdatedAt(): ?string { @@ -167,7 +167,7 @@ public function getUpdatedAt(): ?string /** * Sets Updated At. * - * The timestamp specifying the most recent update time of this booking. + * The timestamp specifying the most recent update time of this booking, in RFC 3339 format. * * @maps updated_at */ @@ -179,7 +179,7 @@ public function setUpdatedAt(?string $updatedAt): void /** * Returns Start At. * - * The timestamp specifying the starting time of this booking. + * The timestamp specifying the starting time of this booking, in RFC 3339 format. */ public function getStartAt(): ?string { @@ -189,7 +189,7 @@ public function getStartAt(): ?string /** * Sets Start At. * - * The timestamp specifying the starting time of this booking. + * The timestamp specifying the starting time of this booking, in RFC 3339 format. * * @maps start_at */ @@ -201,8 +201,8 @@ public function setStartAt(?string $startAt): void /** * Returns Location Id. * - * The ID of the [Location](#type-location) object representing the location where the booked service - * is provided. + * The ID of the [Location]($m/Location) object representing the location where the booked service is + * provided. */ public function getLocationId(): ?string { @@ -212,8 +212,8 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The ID of the [Location](#type-location) object representing the location where the booked service - * is provided. + * The ID of the [Location]($m/Location) object representing the location where the booked service is + * provided. * * @maps location_id */ @@ -225,7 +225,7 @@ public function setLocationId(?string $locationId): void /** * Returns Customer Id. * - * The ID of the [Customer](#type-Customer) object representing the customer attending this booking + * The ID of the [Customer]($m/Customer) object representing the customer attending this booking */ public function getCustomerId(): ?string { @@ -235,7 +235,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The ID of the [Customer](#type-Customer) object representing the customer attending this booking + * The ID of the [Customer]($m/Customer) object representing the customer attending this booking * * @maps customer_id */ @@ -248,8 +248,8 @@ public function setCustomerId(?string $customerId): void * Returns Customer Note. * * The free-text field for the customer to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](#type- - * CatalogObject) instance. + * preferences that cannot be expressed by supported attributes of a relevant + * [CatalogObject]($m/CatalogObject) instance. */ public function getCustomerNote(): ?string { @@ -260,8 +260,8 @@ public function getCustomerNote(): ?string * Sets Customer Note. * * The free-text field for the customer to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a relevant [CatalogObject](#type- - * CatalogObject) instance. + * preferences that cannot be expressed by supported attributes of a relevant + * [CatalogObject]($m/CatalogObject) instance. * * @maps customer_note */ @@ -274,8 +274,8 @@ public function setCustomerNote(?string $customerNote): void * Returns Seller Note. * * The free-text field for the seller to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a specific [CatalogObject](#type- - * CatalogObject) instance. + * preferences that cannot be expressed by supported attributes of a specific + * [CatalogObject]($m/CatalogObject) instance. * This field should not be visible to customers. */ public function getSellerNote(): ?string @@ -287,8 +287,8 @@ public function getSellerNote(): ?string * Sets Seller Note. * * The free-text field for the seller to supply notes about the booking. For example, the note can be - * preferences that cannot be expressed by supported attributes of a specific [CatalogObject](#type- - * CatalogObject) instance. + * preferences that cannot be expressed by supported attributes of a specific + * [CatalogObject]($m/CatalogObject) instance. * This field should not be visible to customers. * * @maps seller_note diff --git a/src/Models/BusinessBookingProfile.php b/src/Models/BusinessBookingProfile.php index d3333fda..04e14799 100644 --- a/src/Models/BusinessBookingProfile.php +++ b/src/Models/BusinessBookingProfile.php @@ -66,7 +66,7 @@ public function setSellerId(?string $sellerId): void /** * Returns Created At. * - * The RFC-3339 timestamp specifying the booking's creation time. + * The RFC 3339 timestamp specifying the booking's creation time. */ public function getCreatedAt(): ?string { @@ -76,7 +76,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * The RFC-3339 timestamp specifying the booking's creation time. + * The RFC 3339 timestamp specifying the booking's creation time. * * @maps created_at */ diff --git a/src/Models/CalculateLoyaltyPointsRequest.php b/src/Models/CalculateLoyaltyPointsRequest.php index c47e6222..0cec0e30 100644 --- a/src/Models/CalculateLoyaltyPointsRequest.php +++ b/src/Models/CalculateLoyaltyPointsRequest.php @@ -23,7 +23,7 @@ class CalculateLoyaltyPointsRequest implements \JsonSerializable /** * Returns Order Id. * - * The [order](#type-Order) ID for which to calculate the points. + * The [order]($m/Order) ID for which to calculate the points. * Specify this field if your application uses the Orders API to process orders. * Otherwise, specify the `transaction_amount`. */ @@ -35,7 +35,7 @@ public function getOrderId(): ?string /** * Sets Order Id. * - * The [order](#type-Order) ID for which to calculate the points. + * The [order]($m/Order) ID for which to calculate the points. * Specify this field if your application uses the Orders API to process orders. * Otherwise, specify the `transaction_amount`. * diff --git a/src/Models/CancelInvoiceRequest.php b/src/Models/CancelInvoiceRequest.php index 5e556e27..360ba8ae 100644 --- a/src/Models/CancelInvoiceRequest.php +++ b/src/Models/CancelInvoiceRequest.php @@ -25,9 +25,9 @@ public function __construct(int $version) /** * Returns Version. * - * The version of the [invoice](#type-invoice) to cancel. + * The version of the [invoice]($m/Invoice) to cancel. * If you do not know the version, you can call - * [GetInvoice](#endpoint-Invoices-GetInvoice) or [ListInvoices](#endpoint-Invoices-ListInvoices). + * [GetInvoice]($e/Invoices/GetInvoice) or [ListInvoices]($e/Invoices/ListInvoices). */ public function getVersion(): int { @@ -37,9 +37,9 @@ public function getVersion(): int /** * Sets Version. * - * The version of the [invoice](#type-invoice) to cancel. + * The version of the [invoice]($m/Invoice) to cancel. * If you do not know the version, you can call - * [GetInvoice](#endpoint-Invoices-GetInvoice) or [ListInvoices](#endpoint-Invoices-ListInvoices). + * [GetInvoice]($e/Invoices/GetInvoice) or [ListInvoices]($e/Invoices/ListInvoices). * * @required * @maps version diff --git a/src/Models/CancelPaymentByIdempotencyKeyRequest.php b/src/Models/CancelPaymentByIdempotencyKeyRequest.php index 64405243..6b97977d 100644 --- a/src/Models/CancelPaymentByIdempotencyKeyRequest.php +++ b/src/Models/CancelPaymentByIdempotencyKeyRequest.php @@ -6,7 +6,7 @@ /** * Describes a request to cancel a payment using - * [CancelPaymentByIdempotencyKey](#endpoint-payments-cancelpaymentbyidempotencykey). + * [CancelPaymentByIdempotencyKey]($e/Payments/CancelPaymentByIdempotencyKey). */ class CancelPaymentByIdempotencyKeyRequest implements \JsonSerializable { diff --git a/src/Models/CancelPaymentByIdempotencyKeyResponse.php b/src/Models/CancelPaymentByIdempotencyKeyResponse.php index 4ed99cc2..4959c0b2 100644 --- a/src/Models/CancelPaymentByIdempotencyKeyResponse.php +++ b/src/Models/CancelPaymentByIdempotencyKeyResponse.php @@ -6,7 +6,7 @@ /** * Defines the response returned by - * [CancelPaymentByIdempotencyKey](#endpoint-payments-cancelpaymentbyidempotencykey). + * [CancelPaymentByIdempotencyKey]($e/Payments/CancelPaymentByIdempotencyKey). * On success, `errors` is empty. */ class CancelPaymentByIdempotencyKeyResponse implements \JsonSerializable diff --git a/src/Models/CancelPaymentResponse.php b/src/Models/CancelPaymentResponse.php index a3d28836..a749a56a 100644 --- a/src/Models/CancelPaymentResponse.php +++ b/src/Models/CancelPaymentResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by [CancelPayment](#endpoint-payments-cancelpayment). + * Defines the response returned by [CancelPayment]($e/Payments/CancelPayment). */ class CancelPaymentResponse implements \JsonSerializable { diff --git a/src/Models/CancelSubscriptionResponse.php b/src/Models/CancelSubscriptionResponse.php index aa567a31..743338e4 100644 --- a/src/Models/CancelSubscriptionResponse.php +++ b/src/Models/CancelSubscriptionResponse.php @@ -6,7 +6,7 @@ /** * Defines fields that are included in a - * [CancelSubscription](#endpoint-subscriptions-cancelsubscription) response. + * [CancelSubscription]($e/Subscriptions/CancelSubscription) response. */ class CancelSubscriptionResponse implements \JsonSerializable { diff --git a/src/Models/CaptureTransactionResponse.php b/src/Models/CaptureTransactionResponse.php index c7be06d4..e016a5da 100644 --- a/src/Models/CaptureTransactionResponse.php +++ b/src/Models/CaptureTransactionResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint. + * a request to the [CaptureTransaction]($e/Transactions/CaptureTransaction) endpoint. */ class CaptureTransactionResponse implements \JsonSerializable { diff --git a/src/Models/CatalogCustomAttributeValue.php b/src/Models/CatalogCustomAttributeValue.php index 1f30a82e..189b71a5 100644 --- a/src/Models/CatalogCustomAttributeValue.php +++ b/src/Models/CatalogCustomAttributeValue.php @@ -99,8 +99,8 @@ public function setStringValue(?string $stringValue): void /** * Returns Custom Attribute Definition Id. * - * __Read-only.__ The id of the [CatalogCustomAttributeDefinition](#type- - * CatalogCustomAttributeDefinition) this value belongs to. + * __Read-only.__ The id of the [CatalogCustomAttributeDefinition]($m/CatalogCustomAttributeDefinition) + * this value belongs to. */ public function getCustomAttributeDefinitionId(): ?string { @@ -110,8 +110,8 @@ public function getCustomAttributeDefinitionId(): ?string /** * Sets Custom Attribute Definition Id. * - * __Read-only.__ The id of the [CatalogCustomAttributeDefinition](#type- - * CatalogCustomAttributeDefinition) this value belongs to. + * __Read-only.__ The id of the [CatalogCustomAttributeDefinition]($m/CatalogCustomAttributeDefinition) + * this value belongs to. * * @maps custom_attribute_definition_id */ diff --git a/src/Models/CatalogIdMapping.php b/src/Models/CatalogIdMapping.php index 788a0c14..771d138b 100644 --- a/src/Models/CatalogIdMapping.php +++ b/src/Models/CatalogIdMapping.php @@ -7,9 +7,9 @@ /** * A mapping between a temporary client-supplied ID and a permanent server-generated ID. * - * When calling [UpsertCatalogObject](#endpoint-Catalog-UpsertCatalogObject) or - * [BatchUpsertCatalogObjects](#endpoint-Catalog-BatchUpsertCatalogObjects) to - * create a [CatalogObject](#type-CatalogObject) instance, you can supply + * When calling [UpsertCatalogObject]($e/Catalog/UpsertCatalogObject) or + * [BatchUpsertCatalogObjects]($e/Catalog/BatchUpsertCatalogObjects) to + * create a [CatalogObject]($m/CatalogObject) instance, you can supply * a temporary ID for the to-be-created object, especially when the object is to be referenced * elsewhere in the same request body. This temporary ID can be any string unique within * the call, but must be prefixed by "#". diff --git a/src/Models/CatalogImage.php b/src/Models/CatalogImage.php index 9d7e5399..522ac718 100644 --- a/src/Models/CatalogImage.php +++ b/src/Models/CatalogImage.php @@ -51,7 +51,7 @@ public function setName(?string $name): void * Returns Url. * * The URL of this image, generated by Square after an image is uploaded - * using the [CreateCatalogImage](#endpoint-Catalog-CreateCatalogImage) endpoint. + * using the [CreateCatalogImage]($e/Catalog/CreateCatalogImage) endpoint. */ public function getUrl(): ?string { @@ -62,7 +62,7 @@ public function getUrl(): ?string * Sets Url. * * The URL of this image, generated by Square after an image is uploaded - * using the [CreateCatalogImage](#endpoint-Catalog-CreateCatalogImage) endpoint. + * using the [CreateCatalogImage]($e/Catalog/CreateCatalogImage) endpoint. * * @maps url */ diff --git a/src/Models/CatalogItem.php b/src/Models/CatalogItem.php index 15c6dff7..b25c105f 100644 --- a/src/Models/CatalogItem.php +++ b/src/Models/CatalogItem.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * A [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referred to as an item, in + * A [CatalogObject]($m/CatalogObject) instance of the `ITEM` type, also referred to as an item, in * the catalog. */ class CatalogItem implements \JsonSerializable @@ -80,6 +80,11 @@ class CatalogItem implements \JsonSerializable */ private $itemOptions; + /** + * @var string|null + */ + private $sortName; + /** * Returns Name. * @@ -448,6 +453,34 @@ public function setItemOptions(?array $itemOptions): void $this->itemOptions = $itemOptions; } + /** + * Returns Sort Name. + * + * A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, + * the regular `name` field is used for sorting. + * + * It is currently supported for sellers of the Japanese locale only. + */ + public function getSortName(): ?string + { + return $this->sortName; + } + + /** + * Sets Sort Name. + * + * A name to sort the item by. If this name is unspecified, namely, the `sort_name` field is absent, + * the regular `name` field is used for sorting. + * + * It is currently supported for sellers of the Japanese locale only. + * + * @maps sort_name + */ + public function setSortName(?string $sortName): void + { + $this->sortName = $sortName; + } + /** * Encode this object to JSON * @@ -470,6 +503,7 @@ public function jsonSerialize() $json['product_type'] = $this->productType; $json['skip_modifier_screen'] = $this->skipModifierScreen; $json['item_options'] = $this->itemOptions; + $json['sort_name'] = $this->sortName; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/CatalogObject.php b/src/Models/CatalogObject.php index 9a512bac..5da5d080 100644 --- a/src/Models/CatalogObject.php +++ b/src/Models/CatalogObject.php @@ -334,10 +334,10 @@ public function setIsDeleted(?bool $isDeleted): void * * A map (key-value pairs) of application-defined custom attribute values. The value of a key-value * pair - * is a [CatalogCustomAttributeValue](#type-CatalogCustomAttributeValue) object. The key is the `key` + * is a [CatalogCustomAttributeValue]($m/CatalogCustomAttributeValue) object. The key is the `key` * attribute - * value defined in the associated [CatalogCustomAttributeDefinition](#type- - * CatalogCustomAttributeDefinition) + * value defined in the associated + * [CatalogCustomAttributeDefinition]($m/CatalogCustomAttributeDefinition) * object defined by the application making the request. * * If the `CatalogCustomAttributeDefinition` object is @@ -366,10 +366,10 @@ public function getCustomAttributeValues(): ?array * * A map (key-value pairs) of application-defined custom attribute values. The value of a key-value * pair - * is a [CatalogCustomAttributeValue](#type-CatalogCustomAttributeValue) object. The key is the `key` + * is a [CatalogCustomAttributeValue]($m/CatalogCustomAttributeValue) object. The key is the `key` * attribute - * value defined in the associated [CatalogCustomAttributeDefinition](#type- - * CatalogCustomAttributeDefinition) + * value defined in the associated + * [CatalogCustomAttributeDefinition]($m/CatalogCustomAttributeDefinition) * object defined by the application making the request. * * If the `CatalogCustomAttributeDefinition` object is @@ -459,6 +459,7 @@ public function setPresentAtAllLocations(?bool $presentAtAllLocations): void * Returns Present at Location Ids. * * A list of locations where the object is present, even if `present_at_all_locations` is `false`. + * This can include locations that are deactivated. * * @return string[]|null */ @@ -471,6 +472,7 @@ public function getPresentAtLocationIds(): ?array * Sets Present at Location Ids. * * A list of locations where the object is present, even if `present_at_all_locations` is `false`. + * This can include locations that are deactivated. * * @maps present_at_location_ids * @@ -485,6 +487,7 @@ public function setPresentAtLocationIds(?array $presentAtLocationIds): void * Returns Absent at Location Ids. * * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + * This can include locations that are deactivated. * * @return string[]|null */ @@ -497,6 +500,7 @@ public function getAbsentAtLocationIds(): ?array * Sets Absent at Location Ids. * * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. + * This can include locations that are deactivated. * * @maps absent_at_location_ids * @@ -532,8 +536,8 @@ public function setImageId(?string $imageId): void /** * Returns Item Data. * - * A [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referred to as an item, in - * the catalog. + * A [CatalogObject]($m/CatalogObject) instance of the `ITEM` type, also referred to as an item, in the + * catalog. */ public function getItemData(): ?CatalogItem { @@ -543,8 +547,8 @@ public function getItemData(): ?CatalogItem /** * Sets Item Data. * - * A [CatalogObject](#type-CatalogObject) instance of the `ITEM` type, also referred to as an item, in - * the catalog. + * A [CatalogObject]($m/CatalogObject) instance of the `ITEM` type, also referred to as an item, in the + * catalog. * * @maps item_data */ diff --git a/src/Models/CatalogObjectType.php b/src/Models/CatalogObjectType.php index 7cc8986d..99323546 100644 --- a/src/Models/CatalogObjectType.php +++ b/src/Models/CatalogObjectType.php @@ -84,10 +84,10 @@ class CatalogObjectType /** * A subscription plan, corresponding to - * [CatalogSubscriptionPlan](#type-CatalogSubscriptionPlan). + * [CatalogSubscriptionPlan]($m/CatalogSubscriptionPlan). * * The subscription plan data is stored in the `subscription_plan_data` field of the - * [CatalogObject](#type-CatalogObject). + * [CatalogObject]($m/CatalogObject). */ public const SUBSCRIPTION_PLAN = 'SUBSCRIPTION_PLAN'; diff --git a/src/Models/CatalogPricingRule.php b/src/Models/CatalogPricingRule.php index 5a51e540..ece8ddea 100644 --- a/src/Models/CatalogPricingRule.php +++ b/src/Models/CatalogPricingRule.php @@ -65,6 +65,11 @@ class CatalogPricingRule implements \JsonSerializable */ private $excludeStrategy; + /** + * @var string[]|null + */ + private $customerGroupIdsAny; + /** * Returns Name. * @@ -359,6 +364,46 @@ public function setExcludeStrategy(?string $excludeStrategy): void $this->excludeStrategy = $excludeStrategy; } + /** + * Returns Customer Group Ids Any. + * + * A list of IDs of customer groups, the members of which are eligible for discounts specified in this + * pricing rule. + * Notice that a group ID is generated by the Customers API. + * If this field is not set, the specified discount applies to matched products sold to anyone whether + * the buyer + * has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified + * discount + * applies only to matched products sold to customers belonging to the specified customer groups. + * + * @return string[]|null + */ + public function getCustomerGroupIdsAny(): ?array + { + return $this->customerGroupIdsAny; + } + + /** + * Sets Customer Group Ids Any. + * + * A list of IDs of customer groups, the members of which are eligible for discounts specified in this + * pricing rule. + * Notice that a group ID is generated by the Customers API. + * If this field is not set, the specified discount applies to matched products sold to anyone whether + * the buyer + * has a customer profile created or not. If this `customer_group_ids_any` field is set, the specified + * discount + * applies only to matched products sold to customers belonging to the specified customer groups. + * + * @maps customer_group_ids_any + * + * @param string[]|null $customerGroupIdsAny + */ + public function setCustomerGroupIdsAny(?array $customerGroupIdsAny): void + { + $this->customerGroupIdsAny = $customerGroupIdsAny; + } + /** * Encode this object to JSON * @@ -378,6 +423,7 @@ public function jsonSerialize() $json['valid_until_date'] = $this->validUntilDate; $json['valid_until_local_time'] = $this->validUntilLocalTime; $json['exclude_strategy'] = $this->excludeStrategy; + $json['customer_group_ids_any'] = $this->customerGroupIdsAny; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/CatalogQuery.php b/src/Models/CatalogQuery.php index 3a38e17f..484348fc 100644 --- a/src/Models/CatalogQuery.php +++ b/src/Models/CatalogQuery.php @@ -9,13 +9,13 @@ * when calling the `SearchCatalogObjects` endpoint. * * Although a query can have multiple filters, only certain query types can be combined per call to - * [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects). + * [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects). * Any combination of the following types may be used together: - * - [exact_query](#type-CatalogExactQuery) - * - [prefix_query](#type-CatalogPrefixQuery) - * - [range_query](#type-CatalogRangeQuery) - * - [sorted_attribute_query](#type-CatalogSortedAttribute) - * - [text_query](#type-CatalogTextQuery) + * - [exact_query]($m/CatalogQueryExact) + * - [prefix_query]($m/CatalogQueryPrefix) + * - [range_query]($m/CatalogQueryRange) + * - [sorted_attribute_query]($m/CatalogQuerySortedAttribute) + * - [text_query]($m/CatalogQueryText) * All other query types cannot be combined with any others. * * When a query filter is based on an attribute, the attribute must be searchable. @@ -32,8 +32,8 @@ * - `caption`: `CatalogImage` * - `display_name`: `CatalogItemOption` * - * For example, to search for [CatalogItem](#type-CatalogItem) objects by searchable attributes, you - * can use + * For example, to search for [CatalogItem]($m/CatalogItem) objects by searchable attributes, you can + * use * the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. */ class CatalogQuery implements \JsonSerializable diff --git a/src/Models/CatalogSubscriptionPlan.php b/src/Models/CatalogSubscriptionPlan.php index a42997b3..6427940f 100644 --- a/src/Models/CatalogSubscriptionPlan.php +++ b/src/Models/CatalogSubscriptionPlan.php @@ -46,8 +46,7 @@ public function setName(?string $name): void /** * Returns Phases. * - * A list of SubscriptionPhase containing the [SubscriptionPhase](#type-SubscriptionPhase) for this - * plan. + * A list of SubscriptionPhase containing the [SubscriptionPhase]($m/SubscriptionPhase) for this plan. * * @return SubscriptionPhase[]|null */ @@ -59,8 +58,7 @@ public function getPhases(): ?array /** * Sets Phases. * - * A list of SubscriptionPhase containing the [SubscriptionPhase](#type-SubscriptionPhase) for this - * plan. + * A list of SubscriptionPhase containing the [SubscriptionPhase]($m/SubscriptionPhase) for this plan. * * @maps phases * diff --git a/src/Models/ChargeRequest.php b/src/Models/ChargeRequest.php index 13c515c9..c1da3239 100644 --- a/src/Models/ChargeRequest.php +++ b/src/Models/ChargeRequest.php @@ -6,9 +6,9 @@ /** * Defines the parameters that can be included in the body of - * a request to the [Charge](#endpoint-charge) endpoint. + * a request to the [Charge]($e/Transactions/Charge) endpoint. * - * Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment) + * Deprecated - recommend using [CreatePayment]($e/Payments/CreatePayment) */ class ChargeRequest implements \JsonSerializable { @@ -102,7 +102,8 @@ public function __construct(string $idempotencyKey, Money $amountMoney) * you can reattempt it with the same idempotency key without * worrying about double-charging the buyer. * - * See [Idempotency keys](#idempotencykeys) for more information. + * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more + * information. */ public function getIdempotencyKey(): string { @@ -119,7 +120,8 @@ public function getIdempotencyKey(): string * you can reattempt it with the same idempotency key without * worrying about double-charging the buyer. * - * See [Idempotency keys](#idempotencykeys) for more information. + * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more + * information. * * @required * @maps idempotency_key @@ -237,8 +239,8 @@ public function setCustomerCardId(?string $customerCardId): void * * If `true`, the request will only perform an Auth on the provided * card. You can then later perform either a Capture (with the - * [CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void - * (with the [VoidTransaction](#endpoint-voidtransaction) endpoint). + * [CaptureTransaction]($e/Transactions/CaptureTransaction) endpoint) or a Void + * (with the [VoidTransaction]($e/Transactions/VoidTransaction) endpoint). * * Default value: `false` */ @@ -252,8 +254,8 @@ public function getDelayCapture(): ?bool * * If `true`, the request will only perform an Auth on the provided * card. You can then later perform either a Capture (with the - * [CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void - * (with the [VoidTransaction](#endpoint-voidtransaction) endpoint). + * [CaptureTransaction]($e/Transactions/CaptureTransaction) endpoint) or a Void + * (with the [VoidTransaction]($e/Transactions/VoidTransaction) endpoint). * * Default value: `false` * diff --git a/src/Models/ChargeResponse.php b/src/Models/ChargeResponse.php index 77b89d1d..3b63ea72 100644 --- a/src/Models/ChargeResponse.php +++ b/src/Models/ChargeResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [Charge](#endpoint-charge) endpoint. + * a request to the [Charge]($e/Transactions/Charge) endpoint. * * One of `errors` or `transaction` is present in a given response (never both). */ diff --git a/src/Models/CheckAppointmentsOnboardedResponse.php b/src/Models/CheckAppointmentsOnboardedResponse.php deleted file mode 100644 index e79d22ae..00000000 --- a/src/Models/CheckAppointmentsOnboardedResponse.php +++ /dev/null @@ -1,82 +0,0 @@ -appointmentsOnboarded; - } - - /** - * Sets Appointments Onboarded. - * - * Indicates whether the seller has enabled the Square Appointments service (`true`) or not (`false`). - * - * @maps appointments_onboarded - */ - public function setAppointmentsOnboarded(?bool $appointmentsOnboarded): void - { - $this->appointmentsOnboarded = $appointmentsOnboarded; - } - - /** - * Returns Errors. - * - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @return mixed - */ - public function jsonSerialize() - { - $json = []; - $json['appointments_onboarded'] = $this->appointmentsOnboarded; - $json['errors'] = $this->errors; - - return array_filter($json, function ($val) { - return $val !== null; - }); - } -} diff --git a/src/Models/CompletePaymentResponse.php b/src/Models/CompletePaymentResponse.php index 9c102df9..46e389b8 100644 --- a/src/Models/CompletePaymentResponse.php +++ b/src/Models/CompletePaymentResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by[CompletePayment](#endpoint-payments-completepayment). + * Defines the response returned by[CompletePayment]($e/Payments/CompletePayment). */ class CompletePaymentResponse implements \JsonSerializable { diff --git a/src/Models/CreateCustomerCardRequest.php b/src/Models/CreateCustomerCardRequest.php index 0a178737..c083e021 100644 --- a/src/Models/CreateCustomerCardRequest.php +++ b/src/Models/CreateCustomerCardRequest.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the request body of a request - * to the CreateCustomerCard endpoint. + * to the `CreateCustomerCard` endpoint. */ class CreateCustomerCardRequest implements \JsonSerializable { @@ -43,13 +43,12 @@ public function __construct(string $cardNonce) * * A card nonce representing the credit card to link to the customer. * - * Card nonces are generated by the Square Payment Form when customers enter - * their card information. See - * [Embedding the payment form](https://developer.squareup.com/docs/payment-form/payment-form- - * walkthrough) for - * more information. + * Card nonces are generated by the Square payment form when customers enter + * their card information. For more information, see + * [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/payment- + * form/payment-form-walkthrough). * - * __NOTE:__ Card nonces generated by digital wallets (e.g., Apple Pay) + * __NOTE:__ Card nonces generated by digital wallets (such as Apple Pay) * cannot be used to create a customer card. */ public function getCardNonce(): string @@ -62,13 +61,12 @@ public function getCardNonce(): string * * A card nonce representing the credit card to link to the customer. * - * Card nonces are generated by the Square Payment Form when customers enter - * their card information. See - * [Embedding the payment form](https://developer.squareup.com/docs/payment-form/payment-form- - * walkthrough) for - * more information. + * Card nonces are generated by the Square payment form when customers enter + * their card information. For more information, see + * [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/payment- + * form/payment-form-walkthrough). * - * __NOTE:__ Card nonces generated by digital wallets (e.g., Apple Pay) + * __NOTE:__ Card nonces generated by digital wallets (such as Apple Pay) * cannot be used to create a customer card. * * @required diff --git a/src/Models/CreateCustomerCardResponse.php b/src/Models/CreateCustomerCardResponse.php index 305fc7d8..807d66f9 100644 --- a/src/Models/CreateCustomerCardResponse.php +++ b/src/Models/CreateCustomerCardResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the CreateCustomerCard endpoint. + * a request to the `CreateCustomerCard` endpoint. * - * One of `errors` or `card` is present in a given response (never both). + * Either `errors` or `card` is present in a given response (never both). */ class CreateCustomerCardResponse implements \JsonSerializable { diff --git a/src/Models/CreateCustomerGroupRequest.php b/src/Models/CreateCustomerGroupRequest.php index 92449633..9cd9871a 100644 --- a/src/Models/CreateCustomerGroupRequest.php +++ b/src/Models/CreateCustomerGroupRequest.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Defines the body parameters that can be provided in a request to the - * [CreateCustomerGroup](#endpoint-createcustomegroup) endpoint. + * Defines the body parameters that can be included in a request to the + * [CreateCustomerGroup]($e/CustomerGroups/CreateCustomerGroup) endpoint. */ class CreateCustomerGroupRequest implements \JsonSerializable { @@ -31,9 +31,8 @@ public function __construct(CustomerGroup $group) /** * Returns Idempotency Key. * - * The idempotency key for the request. See the [Idempotency](https://developer.squareup. - * com/docs/basics/api101/idempotency) - * guide for more information. + * The idempotency key for the request. For more information, see [Idempotency](https://developer. + * squareup.com/docs/basics/api101/idempotency). */ public function getIdempotencyKey(): ?string { @@ -43,9 +42,8 @@ public function getIdempotencyKey(): ?string /** * Sets Idempotency Key. * - * The idempotency key for the request. See the [Idempotency](https://developer.squareup. - * com/docs/basics/api101/idempotency) - * guide for more information. + * The idempotency key for the request. For more information, see [Idempotency](https://developer. + * squareup.com/docs/basics/api101/idempotency). * * @maps idempotency_key */ @@ -59,8 +57,8 @@ public function setIdempotencyKey(?string $idempotencyKey): void * * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. */ public function getGroup(): CustomerGroup { @@ -72,8 +70,8 @@ public function getGroup(): CustomerGroup * * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. * * @required * @maps group diff --git a/src/Models/CreateCustomerGroupResponse.php b/src/Models/CreateCustomerGroupResponse.php index 4531c367..0ded23d2 100644 --- a/src/Models/CreateCustomerGroupResponse.php +++ b/src/Models/CreateCustomerGroupResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the [CreateCustomerGroup](#endpoint-createcustomergroup) endpoint. + * a request to the [CreateCustomerGroup]($e/CustomerGroups/CreateCustomerGroup) endpoint. * - * One of `errors` or `group` is present in a given response (never both). + * Either `errors` or `group` is present in a given response (never both). */ class CreateCustomerGroupResponse implements \JsonSerializable { @@ -53,8 +53,8 @@ public function setErrors(?array $errors): void * * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. */ public function getGroup(): ?CustomerGroup { @@ -66,8 +66,8 @@ public function getGroup(): ?CustomerGroup * * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. * * @maps group */ diff --git a/src/Models/CreateCustomerRequest.php b/src/Models/CreateCustomerRequest.php index cb3df020..a77a25b3 100644 --- a/src/Models/CreateCustomerRequest.php +++ b/src/Models/CreateCustomerRequest.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Defines the body parameters that can be provided in a request to the - * CreateCustomer endpoint. + * Defines the body parameters that can be included in a request to the + * `CreateCustomer` endpoint. */ class CreateCustomerRequest implements \JsonSerializable { @@ -68,9 +68,8 @@ class CreateCustomerRequest implements \JsonSerializable /** * Returns Idempotency Key. * - * The idempotency key for the request. See the - * [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) guide for more - * information. + * The idempotency key for the request. For more information, see + * [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). */ public function getIdempotencyKey(): ?string { @@ -80,9 +79,8 @@ public function getIdempotencyKey(): ?string /** * Sets Idempotency Key. * - * The idempotency key for the request. See the - * [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency) guide for more - * information. + * The idempotency key for the request. For more information, see + * [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). * * @maps idempotency_key */ @@ -94,7 +92,7 @@ public function setIdempotencyKey(?string $idempotencyKey): void /** * Returns Given Name. * - * The given (i.e., first) name associated with the customer profile. + * The given name (that is, the first name) associated with the customer profile. */ public function getGivenName(): ?string { @@ -104,7 +102,7 @@ public function getGivenName(): ?string /** * Sets Given Name. * - * The given (i.e., first) name associated with the customer profile. + * The given name (that is, the first name) associated with the customer profile. * * @maps given_name */ @@ -116,7 +114,7 @@ public function setGivenName(?string $givenName): void /** * Returns Family Name. * - * The family (i.e., last) name associated with the customer profile. + * The family name (that is, the last name) associated with the customer profile. */ public function getFamilyName(): ?string { @@ -126,7 +124,7 @@ public function getFamilyName(): ?string /** * Sets Family Name. * - * The family (i.e., last) name associated with the customer profile. + * The family name (that is, the last name) associated with the customer profile. * * @maps family_name */ @@ -248,7 +246,7 @@ public function setPhoneNumber(?string $phoneNumber): void /** * Returns Reference Id. * - * An optional, second ID used to associate the customer profile with an + * An optional second ID used to associate the customer profile with an * entity in another system. */ public function getReferenceId(): ?string @@ -259,7 +257,7 @@ public function getReferenceId(): ?string /** * Sets Reference Id. * - * An optional, second ID used to associate the customer profile with an + * An optional second ID used to associate the customer profile with an * entity in another system. * * @maps reference_id @@ -294,10 +292,11 @@ public function setNote(?string $note): void /** * Returns Birthday. * - * The birthday associated with the customer profile, in RFC 3339 format. - * Year is optional, timezone and times are not allowed. - * For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. - * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. + * The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The + * timezone and time are not allowed. + * For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00: + * 00-00:00` represents a birthday on September 21, 1998. + * You can also specify this value in `YYYY-MM-DD` format. */ public function getBirthday(): ?string { @@ -307,10 +306,11 @@ public function getBirthday(): ?string /** * Sets Birthday. * - * The birthday associated with the customer profile, in RFC 3339 format. - * Year is optional, timezone and times are not allowed. - * For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. - * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. + * The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The + * timezone and time are not allowed. + * For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00: + * 00-00:00` represents a birthday on September 21, 1998. + * You can also specify this value in `YYYY-MM-DD` format. * * @maps birthday */ diff --git a/src/Models/CreateCustomerResponse.php b/src/Models/CreateCustomerResponse.php index f0b191dd..93552b06 100644 --- a/src/Models/CreateCustomerResponse.php +++ b/src/Models/CreateCustomerResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the CreateCustomer endpoint. + * a request to the `CreateCustomer` endpoint. * - * One of `errors` or `customer` is present in a given response (never both). + * Either `errors` or `customer` is present in a given response (never both). */ class CreateCustomerResponse implements \JsonSerializable { diff --git a/src/Models/CreateLocationRequest.php b/src/Models/CreateLocationRequest.php index 97a99f4c..428da1bc 100644 --- a/src/Models/CreateLocationRequest.php +++ b/src/Models/CreateLocationRequest.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Request object for the [CreateLocation](#endpoint-createlocation) endpoint. + * Request object for the [CreateLocation]($e/Locations/CreateLocation) endpoint. */ class CreateLocationRequest implements \JsonSerializable { diff --git a/src/Models/CreateLocationResponse.php b/src/Models/CreateLocationResponse.php index 71b59e73..3fe5efa0 100644 --- a/src/Models/CreateLocationResponse.php +++ b/src/Models/CreateLocationResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Response object returned by the [CreateLocation](#endpoint-createlocation) endpoint. + * Response object returned by the [CreateLocation]($e/Locations/CreateLocation) endpoint. */ class CreateLocationResponse implements \JsonSerializable { diff --git a/src/Models/CreateLoyaltyRewardRequest.php b/src/Models/CreateLoyaltyRewardRequest.php index 2e0cc380..334c29c7 100644 --- a/src/Models/CreateLoyaltyRewardRequest.php +++ b/src/Models/CreateLoyaltyRewardRequest.php @@ -31,6 +31,11 @@ public function __construct(LoyaltyReward $reward, string $idempotencyKey) /** * Returns Reward. + * + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). */ public function getReward(): LoyaltyReward { @@ -40,6 +45,11 @@ public function getReward(): LoyaltyReward /** * Sets Reward. * + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). + * * @required * @maps reward */ diff --git a/src/Models/CreateLoyaltyRewardResponse.php b/src/Models/CreateLoyaltyRewardResponse.php index fd6e5ae0..7836d00a 100644 --- a/src/Models/CreateLoyaltyRewardResponse.php +++ b/src/Models/CreateLoyaltyRewardResponse.php @@ -47,6 +47,11 @@ public function setErrors(?array $errors): void /** * Returns Reward. + * + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). */ public function getReward(): ?LoyaltyReward { @@ -56,6 +61,11 @@ public function getReward(): ?LoyaltyReward /** * Sets Reward. * + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). + * * @maps reward */ public function setReward(?LoyaltyReward $reward): void diff --git a/src/Models/CreateMobileAuthorizationCodeResponse.php b/src/Models/CreateMobileAuthorizationCodeResponse.php index 4ea1e383..480c0b46 100644 --- a/src/Models/CreateMobileAuthorizationCodeResponse.php +++ b/src/Models/CreateMobileAuthorizationCodeResponse.php @@ -78,7 +78,8 @@ public function setExpiresAt(?string $expiresAt): void * * Represents an error encountered during a request to the Connect API. * - * See [Handling errors](#handlingerrors) for more information. + * See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more + * information. */ public function getError(): ?Error { @@ -90,7 +91,8 @@ public function getError(): ?Error * * Represents an error encountered during a request to the Connect API. * - * See [Handling errors](#handlingerrors) for more information. + * See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more + * information. * * @maps error */ diff --git a/src/Models/CreatePaymentRequest.php b/src/Models/CreatePaymentRequest.php index ec5f96c0..398c5867 100644 --- a/src/Models/CreatePaymentRequest.php +++ b/src/Models/CreatePaymentRequest.php @@ -6,7 +6,7 @@ /** * Describes a request to create a payment using - * [CreatePayment](#endpoint-payments-createpayment). + * [CreatePayment]($e/Payments/CreatePayment). */ class CreatePaymentRequest implements \JsonSerializable { @@ -355,7 +355,8 @@ public function setDelayDuration(?string $delayDuration): void * If set to `true`, this payment will be completed when possible. If * set to `false`, this payment is held in an approved state until either * explicitly completed (captured) or canceled (voided). For more information, see - * [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card- + * payments#delayed-capture-of-a-card-payment). * * Default: true */ @@ -370,7 +371,8 @@ public function getAutocomplete(): ?bool * If set to `true`, this payment will be completed when possible. If * set to `false`, this payment is held in an approved state until either * explicitly completed (captured) or canceled (voided). For more information, see - * [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * [Delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card- + * payments#delayed-capture-of-a-card-payment). * * Default: true * @@ -406,7 +408,7 @@ public function setOrderId(?string $orderId): void /** * Returns Customer Id. * - * The [Customer](#type-customer) ID of the customer associated with the payment. + * The [Customer]($m/Customer) ID of the customer associated with the payment. * * This is required if the `source_id` refers to a card on file created using the Customers API. */ @@ -418,7 +420,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The [Customer](#type-customer) ID of the customer associated with the payment. + * The [Customer]($m/Customer) ID of the customer associated with the payment. * * This is required if the `source_id` refers to a card on file created using the Customers API. * diff --git a/src/Models/CreatePaymentResponse.php b/src/Models/CreatePaymentResponse.php index 9e9e85be..1431f8cb 100644 --- a/src/Models/CreatePaymentResponse.php +++ b/src/Models/CreatePaymentResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by [CreatePayment](#endpoint-payments-createpayment). + * Defines the response returned by [CreatePayment]($e/Payments/CreatePayment). * * If there are errors processing the request, the `payment` field might not be * present, or it might be present with a status of `FAILED`. diff --git a/src/Models/CreateRefundRequest.php b/src/Models/CreateRefundRequest.php index 88463566..94299eb8 100644 --- a/src/Models/CreateRefundRequest.php +++ b/src/Models/CreateRefundRequest.php @@ -6,9 +6,9 @@ /** * Defines the body parameters that can be included in - * a request to the [CreateRefund](#endpoint-createrefund) endpoint. + * a request to the [CreateRefund]($e/Transactions/CreateRefund) endpoint. * - * Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment) + * Deprecated - recommend using [RefundPayment]($e/Refunds/RefundPayment) */ class CreateRefundRequest implements \JsonSerializable { @@ -54,7 +54,8 @@ public function __construct(string $idempotencyKey, string $tenderId, Money $amo * you can reattempt it with the same idempotency key without * worrying about duplicating the refund. * - * See [Idempotency keys](#idempotencykeys) for more information. + * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more + * information. */ public function getIdempotencyKey(): string { @@ -71,7 +72,8 @@ public function getIdempotencyKey(): string * you can reattempt it with the same idempotency key without * worrying about duplicating the refund. * - * See [Idempotency keys](#idempotencykeys) for more information. + * See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more + * information. * * @required * @maps idempotency_key @@ -86,7 +88,7 @@ public function setIdempotencyKey(string $idempotencyKey): void * * The ID of the tender to refund. * - * A [`Transaction`](#type-transaction) has one or more `tenders` (i.e., methods + * A [`Transaction`]($m/Transaction) has one or more `tenders` (i.e., methods * of payment) associated with it, and you refund each tender separately with * the Connect API. */ @@ -100,7 +102,7 @@ public function getTenderId(): string * * The ID of the tender to refund. * - * A [`Transaction`](#type-transaction) has one or more `tenders` (i.e., methods + * A [`Transaction`]($m/Transaction) has one or more `tenders` (i.e., methods * of payment) associated with it, and you refund each tender separately with * the Connect API. * diff --git a/src/Models/CreateRefundResponse.php b/src/Models/CreateRefundResponse.php index 7927c386..de1b67e8 100644 --- a/src/Models/CreateRefundResponse.php +++ b/src/Models/CreateRefundResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [CreateRefund](#endpoint-createrefund) endpoint. + * a request to the [CreateRefund]($e/Transactions/CreateRefund) endpoint. * * One of `errors` or `refund` is present in a given response (never both). */ diff --git a/src/Models/CreateSubscriptionRequest.php b/src/Models/CreateSubscriptionRequest.php index 2dc6409a..739aa5ca 100644 --- a/src/Models/CreateSubscriptionRequest.php +++ b/src/Models/CreateSubscriptionRequest.php @@ -6,7 +6,7 @@ /** * Defines parameters in a - * [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint request. + * [CreateSubscription]($e/Subscriptions/CreateSubscription) endpoint request. */ class CreateSubscriptionRequest implements \JsonSerializable { @@ -158,7 +158,7 @@ public function setPlanId(string $planId): void /** * Returns Customer Id. * - * The ID of the [customer](#type-customer) profile. + * The ID of the [customer]($m/Customer) profile. */ public function getCustomerId(): string { @@ -168,7 +168,7 @@ public function getCustomerId(): string /** * Sets Customer Id. * - * The ID of the [customer](#type-customer) profile. + * The ID of the [customer]($m/Customer) profile. * * @required * @maps customer_id @@ -295,7 +295,7 @@ public function setPriceOverrideMoney(?Money $priceOverrideMoney): void /** * Returns Card Id. * - * The ID of the [customer](#type-customer) [card](#type-card) to charge. + * The ID of the [customer]($m/Customer) [card]($m/Card) to charge. * If not specified, Square sends an invoice via email. For an example to * create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup. * com/docs/subscriptions-api/walkthrough). @@ -308,7 +308,7 @@ public function getCardId(): ?string /** * Sets Card Id. * - * The ID of the [customer](#type-customer) [card](#type-card) to charge. + * The ID of the [customer]($m/Customer) [card]($m/Card) to charge. * If not specified, Square sends an invoice via email. For an example to * create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup. * com/docs/subscriptions-api/walkthrough). diff --git a/src/Models/CreateSubscriptionResponse.php b/src/Models/CreateSubscriptionResponse.php index 07e3e7bf..e24eee7f 100644 --- a/src/Models/CreateSubscriptionResponse.php +++ b/src/Models/CreateSubscriptionResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response from the - * [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint. + * [CreateSubscription]($e/Subscriptions/CreateSubscription) endpoint. */ class CreateSubscriptionResponse implements \JsonSerializable { diff --git a/src/Models/CustomAttributeFilter.php b/src/Models/CustomAttributeFilter.php index ee122edc..16f961dc 100644 --- a/src/Models/CustomAttributeFilter.php +++ b/src/Models/CustomAttributeFilter.php @@ -6,7 +6,7 @@ /** * Supported custom attribute query expressions for calling the - * [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) + * [SearchCatalogItems]($e/Catalog/SearchCatalogItems) * endpoint to search for items or item variations. */ class CustomAttributeFilter implements \JsonSerializable diff --git a/src/Models/Customer.php b/src/Models/Customer.php index fb992f8e..85fec34d 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -85,11 +85,6 @@ class Customer implements \JsonSerializable */ private $preferences; - /** - * @var CustomerGroupInfo[]|null - */ - private $groups; - /** * @var string|null */ @@ -105,6 +100,11 @@ class Customer implements \JsonSerializable */ private $segmentIds; + /** + * @var int|null + */ + private $version; + /** * Returns Id. * @@ -174,7 +174,7 @@ public function setUpdatedAt(?string $updatedAt): void /** * Returns Cards. * - * Payment details of cards stored on file for the customer profile. + * Payment details of the credit, debit, and gift cards stored on file for the customer profile. * * @return Card[]|null */ @@ -186,7 +186,7 @@ public function getCards(): ?array /** * Sets Cards. * - * Payment details of cards stored on file for the customer profile. + * Payment details of the credit, debit, and gift cards stored on file for the customer profile. * * @maps cards * @@ -354,10 +354,10 @@ public function setPhoneNumber(?string $phoneNumber): void /** * Returns Birthday. * - * The birthday associated with the customer profile, in RFC 3339 format. - * Year is optional, timezone and times are not allowed. - * For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. - * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. + * The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The + * timezone and time are not allowed. + * For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00: + * 00-00:00` represents a birthday on September 21, 1998. */ public function getBirthday(): ?string { @@ -367,10 +367,10 @@ public function getBirthday(): ?string /** * Sets Birthday. * - * The birthday associated with the customer profile, in RFC 3339 format. - * Year is optional, timezone and times are not allowed. - * For example: `0000-09-01T00:00:00-00:00` indicates a birthday on September 1st. - * `1998-09-01T00:00:00-00:00` indications a birthday on September 1st __1998__. + * The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The + * timezone and time are not allowed. + * For example, `0000-09-21T00:00:00-00:00` represents a birthday on September 21 and `1998-09-21T00:00: + * 00-00:00` represents a birthday on September 21, 1998. * * @maps birthday */ @@ -382,7 +382,7 @@ public function setBirthday(?string $birthday): void /** * Returns Reference Id. * - * An optional, second ID used to associate the customer profile with an + * An optional second ID used to associate the customer profile with an * entity in another system. */ public function getReferenceId(): ?string @@ -393,7 +393,7 @@ public function getReferenceId(): ?string /** * Sets Reference Id. * - * An optional, second ID used to associate the customer profile with an + * An optional second ID used to associate the customer profile with an * entity in another system. * * @maps reference_id @@ -447,38 +447,6 @@ public function setPreferences(?CustomerPreferences $preferences): void $this->preferences = $preferences; } - /** - * Returns Groups. - * - * The customer groups and segments the customer belongs to. This deprecated field has been replaced - * with the dedicated `group_ids` for customer groups and the dedicated `segment_ids` field for - * customer segments. You can retrieve information about a given customer group and segment - * respectively using the Customer Groups API and Customer Segments API. - * - * @return CustomerGroupInfo[]|null - */ - public function getGroups(): ?array - { - return $this->groups; - } - - /** - * Sets Groups. - * - * The customer groups and segments the customer belongs to. This deprecated field has been replaced - * with the dedicated `group_ids` for customer groups and the dedicated `segment_ids` field for - * customer segments. You can retrieve information about a given customer group and segment - * respectively using the Customer Groups API and Customer Segments API. - * - * @maps groups - * - * @param CustomerGroupInfo[]|null $groups - */ - public function setGroups(?array $groups): void - { - $this->groups = $groups; - } - /** * Returns Creation Source. * @@ -553,6 +521,32 @@ public function setSegmentIds(?array $segmentIds): void $this->segmentIds = $segmentIds; } + /** + * Returns Version. + * + * 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. + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * Sets Version. + * + * 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. + * + * @maps version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + /** * Encode this object to JSON * @@ -576,10 +570,10 @@ public function jsonSerialize() $json['reference_id'] = $this->referenceId; $json['note'] = $this->note; $json['preferences'] = $this->preferences; - $json['groups'] = $this->groups; $json['creation_source'] = $this->creationSource; $json['group_ids'] = $this->groupIds; $json['segment_ids'] = $this->segmentIds; + $json['version'] = $this->version; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/CustomerCreationSource.php b/src/Models/CustomerCreationSource.php index 8c164321..8037bdcf 100644 --- a/src/Models/CustomerCreationSource.php +++ b/src/Models/CustomerCreationSource.php @@ -10,7 +10,7 @@ class CustomerCreationSource { /** - * Default creation source. Typically used for backward/future + * The default creation source. This source is typically used for backward/future * compatibility when the original source of a customer profile is * unrecognized. For example, when older clients do not support newer * source types. @@ -18,108 +18,108 @@ class CustomerCreationSource public const OTHER = 'OTHER'; /** - * Customer profile created automatically when an appointment + * The customer profile was created automatically when an appointment * was scheduled. */ public const APPOINTMENTS = 'APPOINTMENTS'; /** - * Customer profile created automatically when a coupon was issued + * The customer profile was created automatically when a coupon was issued * using Square Point of Sale. */ public const COUPON = 'COUPON'; /** - * Customer profile restored through Square's deletion recovery + * The customer profile was restored through Square's deletion recovery * process. */ public const DELETION_RECOVERY = 'DELETION_RECOVERY'; /** - * Customer profile created manually through Square Dashboard or + * The customer profile was created manually through Square Seller Dashboard or the * Point of Sale application. */ public const DIRECTORY = 'DIRECTORY'; /** - * Customer profile created automatically when a gift card was + * The customer profile was created automatically when a gift card was * issued using Square Point of Sale. Customer profiles are created for - * both the purchaser and the recipient of the gift card. + * both the buyer and the recipient of the gift card. */ public const EGIFTING = 'EGIFTING'; /** - * Customer profile created through Square Point of Sale when + * The customer profile was created through Square Point of Sale when * signing up for marketing emails during checkout. */ public const EMAIL_COLLECTION = 'EMAIL_COLLECTION'; /** - * Customer profile created automatically when providing feedback + * The customer profile was created automatically when providing feedback * through a digital receipt. */ public const FEEDBACK = 'FEEDBACK'; /** - * Customer profile created automatically when importing customer - * data through Square Dashboard. + * The customer profile was created automatically when importing customer + * data through Square Seller Dashboard. */ public const IMPORT = 'IMPORT'; /** - * Customer profile created automatically during an invoice payment. + * The customer profile was created automatically during an invoice payment. */ public const INVOICES = 'INVOICES'; /** - * Customer profile created automatically when customers provide a + * The customer profile was created automatically when customers provide a * phone number for loyalty reward programs during checkout. */ public const LOYALTY = 'LOYALTY'; /** - * Customer profile created as the result of a campaign managed + * The customer profile was created as the result of a campaign managed * through Square’s Facebook integration. */ public const MARKETING = 'MARKETING'; /** - * Customer profile created as the result of explicitly merging - * multiple customer profiles through the Square Dashboard or Point of + * The customer profile was created as the result of explicitly merging + * multiple customer profiles through the Square Seller Dashboard or the Point of * Sale application. */ public const MERGE = 'MERGE'; /** - * Customer profile created through Square's Online Store solution + * The customer profile was created through Square's Online Store solution * (legacy service). */ public const ONLINE_STORE = 'ONLINE_STORE'; /** - * Customer profile created automatically as the result of a successful + * The customer profile was created automatically as the result of a successful * transaction that did not explicitly link to an existing customer profile. */ public const INSTANT_PROFILE = 'INSTANT_PROFILE'; /** - * Customer profile created through Square's Virtual Terminal. + * The customer profile was created through Square's Virtual Terminal. */ public const TERMINAL = 'TERMINAL'; /** - * Customer profile created through a Square API call. + * The customer profile was created through a Square API call. */ public const THIRD_PARTY = 'THIRD_PARTY'; /** - * Customer profile created by a third-party product and imported + * The customer profile was created by a third-party product and imported * through an official integration. */ public const THIRD_PARTY_IMPORT = 'THIRD_PARTY_IMPORT'; /** - * Customer profile restored through Square's unmerge recovery + * The customer profile was restored through Square's unmerge recovery * process. */ public const UNMERGE_RECOVERY = 'UNMERGE_RECOVERY'; diff --git a/src/Models/CustomerCreationSourceFilter.php b/src/Models/CustomerCreationSourceFilter.php index 9c52a5f0..37ffc764 100644 --- a/src/Models/CustomerCreationSourceFilter.php +++ b/src/Models/CustomerCreationSourceFilter.php @@ -5,11 +5,10 @@ namespace Square\Models; /** - * Creation source filter. + * The creation source filter. * * If one or more creation sources are set, customer profiles are included in, - * or excluded from, the result if they match at least one of the filter - * criteria. + * or excluded from, the result if they match at least one of the filter criteria. */ class CustomerCreationSourceFilter implements \JsonSerializable { diff --git a/src/Models/CustomerFilter.php b/src/Models/CustomerFilter.php index 20996726..ae5e2d59 100644 --- a/src/Models/CustomerFilter.php +++ b/src/Models/CustomerFilter.php @@ -48,11 +48,10 @@ class CustomerFilter implements \JsonSerializable /** * Returns Creation Source. * - * Creation source filter. + * The creation source filter. * * If one or more creation sources are set, customer profiles are included in, - * or excluded from, the result if they match at least one of the filter - * criteria. + * or excluded from, the result if they match at least one of the filter criteria. */ public function getCreationSource(): ?CustomerCreationSourceFilter { @@ -62,11 +61,10 @@ public function getCreationSource(): ?CustomerCreationSourceFilter /** * Sets Creation Source. * - * Creation source filter. + * The creation source filter. * * If one or more creation sources are set, customer profiles are included in, - * or excluded from, the result if they match at least one of the filter - * criteria. + * or excluded from, the result if they match at least one of the filter criteria. * * @maps creation_source */ @@ -139,8 +137,8 @@ public function setUpdatedAt(?TimeRange $updatedAt): void * Returns Email Address. * * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. */ public function getEmailAddress(): ?CustomerTextFilter { @@ -151,8 +149,8 @@ public function getEmailAddress(): ?CustomerTextFilter * Sets Email Address. * * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. * * @maps email_address */ @@ -165,8 +163,8 @@ public function setEmailAddress(?CustomerTextFilter $emailAddress): void * Returns Phone Number. * * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. */ public function getPhoneNumber(): ?CustomerTextFilter { @@ -177,8 +175,8 @@ public function getPhoneNumber(): ?CustomerTextFilter * Sets Phone Number. * * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. * * @maps phone_number */ @@ -191,8 +189,8 @@ public function setPhoneNumber(?CustomerTextFilter $phoneNumber): void * Returns Reference Id. * * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. */ public function getReferenceId(): ?CustomerTextFilter { @@ -203,8 +201,8 @@ public function getReferenceId(): ?CustomerTextFilter * Sets Reference Id. * * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. * * @maps reference_id */ diff --git a/src/Models/CustomerGroup.php b/src/Models/CustomerGroup.php index 23102c71..a025900c 100644 --- a/src/Models/CustomerGroup.php +++ b/src/Models/CustomerGroup.php @@ -7,8 +7,8 @@ /** * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. */ class CustomerGroup implements \JsonSerializable { @@ -43,7 +43,7 @@ public function __construct(string $name) /** * Returns Id. * - * Unique Square-generated ID for the customer group. + * A unique Square-generated ID for the customer group. */ public function getId(): ?string { @@ -53,7 +53,7 @@ public function getId(): ?string /** * Sets Id. * - * Unique Square-generated ID for the customer group. + * A unique Square-generated ID for the customer group. * * @maps id */ @@ -65,7 +65,7 @@ public function setId(?string $id): void /** * Returns Name. * - * Name of the customer group. + * The name of the customer group. */ public function getName(): string { @@ -75,7 +75,7 @@ public function getName(): string /** * Sets Name. * - * Name of the customer group. + * The name of the customer group. * * @required * @maps name diff --git a/src/Models/CustomerGroupInfo.php b/src/Models/CustomerGroupInfo.php deleted file mode 100644 index c974069d..00000000 --- a/src/Models/CustomerGroupInfo.php +++ /dev/null @@ -1,93 +0,0 @@ -id = $id; - $this->name = $name; - } - - /** - * Returns Id. - * - * The ID of the Customer Group. - */ - public function getId(): string - { - return $this->id; - } - - /** - * Sets Id. - * - * The ID of the Customer Group. - * - * @required - * @maps id - */ - public function setId(string $id): void - { - $this->id = $id; - } - - /** - * Returns Name. - * - * The name of the Customer Group. - */ - public function getName(): string - { - return $this->name; - } - - /** - * Sets Name. - * - * The name of the Customer Group. - * - * @required - * @maps name - */ - public function setName(string $name): void - { - $this->name = $name; - } - - /** - * Encode this object to JSON - * - * @return mixed - */ - public function jsonSerialize() - { - $json = []; - $json['id'] = $this->id; - $json['name'] = $this->name; - - return array_filter($json, function ($val) { - return $val !== null; - }); - } -} diff --git a/src/Models/CustomerPreferences.php b/src/Models/CustomerPreferences.php index 08f343d2..51b8a298 100644 --- a/src/Models/CustomerPreferences.php +++ b/src/Models/CustomerPreferences.php @@ -17,7 +17,9 @@ class CustomerPreferences implements \JsonSerializable /** * Returns Email Unsubscribed. * - * The customer has unsubscribed from receiving marketing campaign emails. + * Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` + * means that the customer chose to opt out of email marketing from the current Square seller or from + * all Square sellers. This value is read-only from the Customers API. */ public function getEmailUnsubscribed(): ?bool { @@ -27,7 +29,9 @@ public function getEmailUnsubscribed(): ?bool /** * Sets Email Unsubscribed. * - * The customer has unsubscribed from receiving marketing campaign emails. + * Indicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` + * means that the customer chose to opt out of email marketing from the current Square seller or from + * all Square sellers. This value is read-only from the Customers API. * * @maps email_unsubscribed */ diff --git a/src/Models/CustomerSegment.php b/src/Models/CustomerSegment.php index 92473e93..644b16e1 100644 --- a/src/Models/CustomerSegment.php +++ b/src/Models/CustomerSegment.php @@ -7,8 +7,8 @@ /** * Represents a group of customer profiles that match one or more predefined filter criteria. * - * Segments (also known as Smart Groups) are defined and created within Customer Directory in the - * Square Dashboard or Point of Sale. + * Segments (also known as Smart Groups) are defined and created within the Customer Directory in the + * Square Seller Dashboard or Point of Sale. */ class CustomerSegment implements \JsonSerializable { @@ -43,7 +43,7 @@ public function __construct(string $name) /** * Returns Id. * - * Unique Square-generated ID for the segment. + * A unique Square-generated ID for the segment. */ public function getId(): ?string { @@ -53,7 +53,7 @@ public function getId(): ?string /** * Sets Id. * - * Unique Square-generated ID for the segment. + * A unique Square-generated ID for the segment. * * @maps id */ @@ -65,7 +65,7 @@ public function setId(?string $id): void /** * Returns Name. * - * Name of the segment. + * The name of the segment. */ public function getName(): string { @@ -75,7 +75,7 @@ public function getName(): string /** * Sets Name. * - * Name of the segment. + * The name of the segment. * * @required * @maps name diff --git a/src/Models/CustomerTextFilter.php b/src/Models/CustomerTextFilter.php index 57c7eafc..2cd1e986 100644 --- a/src/Models/CustomerTextFilter.php +++ b/src/Models/CustomerTextFilter.php @@ -6,8 +6,8 @@ /** * A filter to select customers based on exact or fuzzy matching of - * customer attributes against a specified query. Depending on customer attributes, - * the filter can be case sensitive. This filter can be either exact or fuzzy. It cannot be both. + * customer attributes against a specified query. Depending on the customer attributes, + * the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both. */ class CustomerTextFilter implements \JsonSerializable { diff --git a/src/Models/DeleteCustomerCardResponse.php b/src/Models/DeleteCustomerCardResponse.php index aa200636..dbc3f450 100644 --- a/src/Models/DeleteCustomerCardResponse.php +++ b/src/Models/DeleteCustomerCardResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the DeleteCustomerCard endpoint. + * a request to the `DeleteCustomerCard` endpoint. */ class DeleteCustomerCardResponse implements \JsonSerializable { diff --git a/src/Models/DeleteCustomerGroupResponse.php b/src/Models/DeleteCustomerGroupResponse.php index 409cf1de..fafd2819 100644 --- a/src/Models/DeleteCustomerGroupResponse.php +++ b/src/Models/DeleteCustomerGroupResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [DeleteCustomerGroup](#endpoint-deletecustomergroup) endpoint. + * a request to the [DeleteCustomerGroup]($e/CustomerGroups/DeleteCustomerGroup) endpoint. */ class DeleteCustomerGroupResponse implements \JsonSerializable { diff --git a/src/Models/DeleteCustomerRequest.php b/src/Models/DeleteCustomerRequest.php new file mode 100644 index 00000000..d8697564 --- /dev/null +++ b/src/Models/DeleteCustomerRequest.php @@ -0,0 +1,64 @@ +version; + } + + /** + * Sets Version. + * + * The current version of the customer profile. + * + * As a best practice, you should include this parameter to enable [optimistic concurrency](https: + * //developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. For more + * information, see [Delete a customer profile](https://developer.squareup.com/docs/customers-api/use- + * the-api/keep-records#delete-customer-profile). + * + * @maps version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['version'] = $this->version; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/DeleteCustomerResponse.php b/src/Models/DeleteCustomerResponse.php index ebf4eba5..62eec02d 100644 --- a/src/Models/DeleteCustomerResponse.php +++ b/src/Models/DeleteCustomerResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the DeleteCustomer endpoint. + * a request to the `DeleteCustomer` endpoint. */ class DeleteCustomerResponse implements \JsonSerializable { diff --git a/src/Models/DeleteInvoiceRequest.php b/src/Models/DeleteInvoiceRequest.php index af5b7473..2070fffc 100644 --- a/src/Models/DeleteInvoiceRequest.php +++ b/src/Models/DeleteInvoiceRequest.php @@ -17,9 +17,9 @@ class DeleteInvoiceRequest implements \JsonSerializable /** * Returns Version. * - * The version of the [invoice](#type-invoice) to delete. - * If you do not know the version, you can call [GetInvoice](#endpoint-Invoices-GetInvoice) or - * [ListInvoices](#endpoint-Invoices-ListInvoices). + * The version of the [invoice]($m/Invoice) to delete. + * If you do not know the version, you can call [GetInvoice]($e/Invoices/GetInvoice) or + * [ListInvoices]($e/Invoices/ListInvoices). */ public function getVersion(): ?int { @@ -29,9 +29,9 @@ public function getVersion(): ?int /** * Sets Version. * - * The version of the [invoice](#type-invoice) to delete. - * If you do not know the version, you can call [GetInvoice](#endpoint-Invoices-GetInvoice) or - * [ListInvoices](#endpoint-Invoices-ListInvoices). + * The version of the [invoice]($m/Invoice) to delete. + * If you do not know the version, you can call [GetInvoice]($e/Invoices/GetInvoice) or + * [ListInvoices]($e/Invoices/ListInvoices). * * @maps version */ diff --git a/src/Models/DisputeEvidence.php b/src/Models/DisputeEvidence.php index 2a35ec23..59e0352a 100644 --- a/src/Models/DisputeEvidence.php +++ b/src/Models/DisputeEvidence.php @@ -16,6 +16,16 @@ class DisputeEvidence implements \JsonSerializable */ private $disputeId; + /** + * @var DisputeEvidenceFile|null + */ + private $evidenceFile; + + /** + * @var string|null + */ + private $evidenceText; + /** * @var string|null */ @@ -70,6 +80,50 @@ public function setDisputeId(?string $disputeId): void $this->disputeId = $disputeId; } + /** + * Returns Evidence File. + * + * A file to be uploaded as dispute evidence. + */ + public function getEvidenceFile(): ?DisputeEvidenceFile + { + return $this->evidenceFile; + } + + /** + * Sets Evidence File. + * + * A file to be uploaded as dispute evidence. + * + * @maps evidence_file + */ + public function setEvidenceFile(?DisputeEvidenceFile $evidenceFile): void + { + $this->evidenceFile = $evidenceFile; + } + + /** + * Returns Evidence Text. + * + * Raw text + */ + public function getEvidenceText(): ?string + { + return $this->evidenceText; + } + + /** + * Sets Evidence Text. + * + * Raw text + * + * @maps evidence_text + */ + public function setEvidenceText(?string $evidenceText): void + { + $this->evidenceText = $evidenceText; + } + /** * Returns Uploaded At. * @@ -124,6 +178,8 @@ public function jsonSerialize() $json = []; $json['evidence_id'] = $this->evidenceId; $json['dispute_id'] = $this->disputeId; + $json['evidence_file'] = $this->evidenceFile; + $json['evidence_text'] = $this->evidenceText; $json['uploaded_at'] = $this->uploadedAt; $json['evidence_type'] = $this->evidenceType; diff --git a/src/Models/EmployeeWage.php b/src/Models/EmployeeWage.php index 8040ed2a..df7b755b 100644 --- a/src/Models/EmployeeWage.php +++ b/src/Models/EmployeeWage.php @@ -6,7 +6,7 @@ /** * The hourly wage rate that an employee will earn on a `Shift` for doing the job - * specified by the `title` property of this object. Deprecated at verison 2020-08-26. Use + * specified by the `title` property of this object. Deprecated at version 2020-08-26. Use * `TeamMemberWage` instead. */ class EmployeeWage implements \JsonSerializable diff --git a/src/Models/Error.php b/src/Models/Error.php index 41e17adf..c4ed7b58 100644 --- a/src/Models/Error.php +++ b/src/Models/Error.php @@ -7,7 +7,8 @@ /** * Represents an error encountered during a request to the Connect API. * - * See [Handling errors](#handlingerrors) for more information. + * See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more + * information. */ class Error implements \JsonSerializable { diff --git a/src/Models/ErrorCode.php b/src/Models/ErrorCode.php index b902879a..d37fafcf 100644 --- a/src/Models/ErrorCode.php +++ b/src/Models/ErrorCode.php @@ -330,9 +330,9 @@ class ErrorCode public const INVALID_CARD = 'INVALID_CARD'; /** - * Square received a decline from the cardholder's bank without any - * additional information. If the card information seems correct, the card - * holder can contact their card issuer to ask for more information. + * Square received a decline without any additional information. + * If the payment information seems correct, the buyer can contact their + * issuer to ask for more information. */ public const GENERIC_DECLINE = 'GENERIC_DECLINE'; @@ -347,7 +347,7 @@ class ErrorCode public const ADDRESS_VERIFICATION_FAILURE = 'ADDRESS_VERIFICATION_FAILURE'; /** - * The card issuer was not able to locate account on record. + * The issuer was not able to locate the account on record. */ public const INVALID_ACCOUNT = 'INVALID_ACCOUNT'; @@ -410,8 +410,8 @@ class ErrorCode /** * The card is not supported either in the geographic region or by - * the MCC [merchant category code](https://developer.squareup.com/docs/api/connect/v2#navsection- - * connectapibasics) + * the [merchant category code](https://developer.squareup.com/docs/locations-api#initialize-a-merchant- + * category-code) (MCC). */ public const CARD_NOT_SUPPORTED = 'CARD_NOT_SUPPORTED'; @@ -454,6 +454,16 @@ class ErrorCode */ public const GIFT_CARD_AVAILABLE_AMOUNT = 'GIFT_CARD_AVAILABLE_AMOUNT'; + /** + * The account provided cannot carry out transactions. + */ + public const ACCOUNT_UNUSABLE = 'ACCOUNT_UNUSABLE'; + + /** + * Bank account rejected or was not authorized for the payment. + */ + public const BUYER_REFUSED_PAYMENT = 'BUYER_REFUSED_PAYMENT'; + /** * The application tried to update a delayed-capture payment that has expired. */ diff --git a/src/Models/GetEmployeeWageResponse.php b/src/Models/GetEmployeeWageResponse.php index 1e7af3ac..73c3d9f5 100644 --- a/src/Models/GetEmployeeWageResponse.php +++ b/src/Models/GetEmployeeWageResponse.php @@ -25,7 +25,7 @@ class GetEmployeeWageResponse implements \JsonSerializable * Returns Employee Wage. * * The hourly wage rate that an employee will earn on a `Shift` for doing the job - * specified by the `title` property of this object. Deprecated at verison 2020-08-26. Use + * specified by the `title` property of this object. Deprecated at version 2020-08-26. Use * `TeamMemberWage` instead. */ public function getEmployeeWage(): ?EmployeeWage @@ -37,7 +37,7 @@ public function getEmployeeWage(): ?EmployeeWage * Sets Employee Wage. * * The hourly wage rate that an employee will earn on a `Shift` for doing the job - * specified by the `title` property of this object. Deprecated at verison 2020-08-26. Use + * specified by the `title` property of this object. Deprecated at version 2020-08-26. Use * `TeamMemberWage` instead. * * @maps employee_wage diff --git a/src/Models/GetPaymentRefundResponse.php b/src/Models/GetPaymentRefundResponse.php index 16ed9f4f..93d7be1c 100644 --- a/src/Models/GetPaymentRefundResponse.php +++ b/src/Models/GetPaymentRefundResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by [GetRefund](#endpoint-refunds-getpaymentrefund). + * Defines the response returned by [GetRefund]($e/Refunds/GetPaymentRefund). * * Note: If there are errors processing the request, the refund field might not be * present or it might be present in a FAILED state. diff --git a/src/Models/GetPaymentResponse.php b/src/Models/GetPaymentResponse.php index 63547e4f..63b1c868 100644 --- a/src/Models/GetPaymentResponse.php +++ b/src/Models/GetPaymentResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by [GetPayment](#endpoint-payments-getpayment). + * Defines the response returned by [GetPayment]($e/Payments/GetPayment). */ class GetPaymentResponse implements \JsonSerializable { diff --git a/src/Models/InventoryAdjustment.php b/src/Models/InventoryAdjustment.php index 67662659..28802f0e 100644 --- a/src/Models/InventoryAdjustment.php +++ b/src/Models/InventoryAdjustment.php @@ -192,7 +192,7 @@ public function setToState(?string $toState): void /** * Returns Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items are being tracked. */ public function getLocationId(): ?string @@ -203,7 +203,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items are being tracked. * * @maps location_id @@ -398,7 +398,7 @@ public function setSource(?SourceApplication $source): void /** * Returns Employee Id. * - * The Square ID of the [Employee](#type-employee) responsible for the + * The Square ID of the [Employee]($m/Employee) responsible for the * inventory adjustment. */ public function getEmployeeId(): ?string @@ -409,7 +409,7 @@ public function getEmployeeId(): ?string /** * Sets Employee Id. * - * The Square ID of the [Employee](#type-employee) responsible for the + * The Square ID of the [Employee]($m/Employee) responsible for the * inventory adjustment. * * @maps employee_id diff --git a/src/Models/InventoryChange.php b/src/Models/InventoryChange.php index 40c04311..330ab9fd 100644 --- a/src/Models/InventoryChange.php +++ b/src/Models/InventoryChange.php @@ -31,6 +31,16 @@ class InventoryChange implements \JsonSerializable */ private $transfer; + /** + * @var CatalogMeasurementUnit|null + */ + private $measurementUnit; + + /** + * @var string|null + */ + private $measurementUnitId; + /** * Returns Type. * @@ -129,6 +139,54 @@ public function setTransfer(?InventoryTransfer $transfer): void $this->transfer = $transfer; } + /** + * Returns Measurement Unit. + * + * Represents the unit used to measure a `CatalogItemVariation` and + * specifies the precision for decimal quantities. + */ + public function getMeasurementUnit(): ?CatalogMeasurementUnit + { + return $this->measurementUnit; + } + + /** + * Sets Measurement Unit. + * + * Represents the unit used to measure a `CatalogItemVariation` and + * specifies the precision for decimal quantities. + * + * @maps measurement_unit + */ + public function setMeasurementUnit(?CatalogMeasurementUnit $measurementUnit): void + { + $this->measurementUnit = $measurementUnit; + } + + /** + * Returns Measurement Unit Id. + * + * The ID of the [CatalogMeasurementUnit]($m/CatalogMeasurementUnit) object representing the catalog + * measurement unit associated with the inventory change. + */ + public function getMeasurementUnitId(): ?string + { + return $this->measurementUnitId; + } + + /** + * Sets Measurement Unit Id. + * + * The ID of the [CatalogMeasurementUnit]($m/CatalogMeasurementUnit) object representing the catalog + * measurement unit associated with the inventory change. + * + * @maps measurement_unit_id + */ + public function setMeasurementUnitId(?string $measurementUnitId): void + { + $this->measurementUnitId = $measurementUnitId; + } + /** * Encode this object to JSON * @@ -137,10 +195,12 @@ public function setTransfer(?InventoryTransfer $transfer): void public function jsonSerialize() { $json = []; - $json['type'] = $this->type; - $json['physical_count'] = $this->physicalCount; - $json['adjustment'] = $this->adjustment; - $json['transfer'] = $this->transfer; + $json['type'] = $this->type; + $json['physical_count'] = $this->physicalCount; + $json['adjustment'] = $this->adjustment; + $json['transfer'] = $this->transfer; + $json['measurement_unit'] = $this->measurementUnit; + $json['measurement_unit_id'] = $this->measurementUnitId; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/InventoryCount.php b/src/Models/InventoryCount.php index 0216336f..795702de 100644 --- a/src/Models/InventoryCount.php +++ b/src/Models/InventoryCount.php @@ -116,7 +116,7 @@ public function setState(?string $state): void /** * Returns Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items are being tracked. */ public function getLocationId(): ?string @@ -127,7 +127,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items are being tracked. * * @maps location_id diff --git a/src/Models/InventoryPhysicalCount.php b/src/Models/InventoryPhysicalCount.php index e478874b..e726ef04 100644 --- a/src/Models/InventoryPhysicalCount.php +++ b/src/Models/InventoryPhysicalCount.php @@ -71,7 +71,7 @@ class InventoryPhysicalCount implements \JsonSerializable * Returns Id. * * A unique ID generated by Square for the - * [InventoryPhysicalCount](#type-inventoryphysicalcount). + * [InventoryPhysicalCount]($m/InventoryPhysicalCount). */ public function getId(): ?string { @@ -82,7 +82,7 @@ public function getId(): ?string * Sets Id. * * A unique ID generated by Square for the - * [InventoryPhysicalCount](#type-inventoryphysicalcount). + * [InventoryPhysicalCount]($m/InventoryPhysicalCount). * * @maps id */ @@ -95,7 +95,7 @@ public function setId(?string $id): void * Returns Reference Id. * * An optional ID provided by the application to tie the - * [InventoryPhysicalCount](#type-inventoryphysicalcount) to an external + * [InventoryPhysicalCount]($m/InventoryPhysicalCount) to an external * system. */ public function getReferenceId(): ?string @@ -107,7 +107,7 @@ public function getReferenceId(): ?string * Sets Reference Id. * * An optional ID provided by the application to tie the - * [InventoryPhysicalCount](#type-inventoryphysicalcount) to an external + * [InventoryPhysicalCount]($m/InventoryPhysicalCount) to an external * system. * * @maps reference_id @@ -192,7 +192,7 @@ public function setState(?string $state): void /** * Returns Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items are being tracked. */ public function getLocationId(): ?string @@ -203,7 +203,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items are being tracked. * * @maps location_id @@ -262,7 +262,7 @@ public function setSource(?SourceApplication $source): void /** * Returns Employee Id. * - * The Square ID of the [Employee](#type-employee) responsible for the + * The Square ID of the [Employee]($m/Employee) responsible for the * physical count. */ public function getEmployeeId(): ?string @@ -273,7 +273,7 @@ public function getEmployeeId(): ?string /** * Sets Employee Id. * - * The Square ID of the [Employee](#type-employee) responsible for the + * The Square ID of the [Employee]($m/Employee) responsible for the * physical count. * * @maps employee_id diff --git a/src/Models/InventoryTransfer.php b/src/Models/InventoryTransfer.php index 53651ec0..e12f34d5 100644 --- a/src/Models/InventoryTransfer.php +++ b/src/Models/InventoryTransfer.php @@ -143,7 +143,7 @@ public function setState(?string $state): void /** * Returns From Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items were tracked before the transfer. */ public function getFromLocationId(): ?string @@ -154,7 +154,7 @@ public function getFromLocationId(): ?string /** * Sets From Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items were tracked before the transfer. * * @maps from_location_id @@ -167,7 +167,7 @@ public function setFromLocationId(?string $fromLocationId): void /** * Returns To Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items were tracked after the transfer. */ public function getToLocationId(): ?string @@ -178,7 +178,7 @@ public function getToLocationId(): ?string /** * Sets To Location Id. * - * The Square ID of the [Location](#type-location) where the related + * The Square ID of the [Location]($m/Location) where the related * quantity of items were tracked after the transfer. * * @maps to_location_id @@ -339,7 +339,7 @@ public function setSource(?SourceApplication $source): void /** * Returns Employee Id. * - * The Square ID of the [Employee](#type-employee) responsible for the + * The Square ID of the [Employee]($m/Employee) responsible for the * inventory transfer. */ public function getEmployeeId(): ?string @@ -350,7 +350,7 @@ public function getEmployeeId(): ?string /** * Sets Employee Id. * - * The Square ID of the [Employee](#type-employee) responsible for the + * The Square ID of the [Employee]($m/Employee) responsible for the * inventory transfer. * * @maps employee_id diff --git a/src/Models/Invoice.php b/src/Models/Invoice.php index 9498714b..ea72a83c 100644 --- a/src/Models/Invoice.php +++ b/src/Models/Invoice.php @@ -96,11 +96,21 @@ class Invoice implements \JsonSerializable */ private $updatedAt; + /** + * @var InvoiceAcceptedPaymentMethods|null + */ + private $acceptedPaymentMethods; + /** * @var InvoiceCustomField[]|null */ private $customFields; + /** + * @var string|null + */ + private $subscriptionId; + /** * Returns Id. * @@ -174,7 +184,7 @@ public function setLocationId(?string $locationId): void /** * Returns Order Id. * - * The ID of the [order](#type-order) for which the invoice is created. + * The ID of the [order]($m/Order) for which the invoice is created. * * This order must be in the `OPEN` state and must belong to the `location_id` * specified for this invoice. This field is required when creating an invoice. @@ -187,7 +197,7 @@ public function getOrderId(): ?string /** * Sets Order Id. * - * The ID of the [order](#type-order) for which the invoice is created. + * The ID of the [order]($m/Order) for which the invoice is created. * * This order must be in the `OPEN` state and must belong to the `location_id` * specified for this invoice. This field is required when creating an invoice. @@ -260,7 +270,7 @@ public function setPaymentRequests(?array $paymentRequests): void /** * Returns Delivery Method. * - * Indicates how Square delivers the [invoice](#type-Invoice) to the customer. + * Indicates how Square delivers the [invoice]($m/Invoice) to the customer. */ public function getDeliveryMethod(): ?string { @@ -270,7 +280,7 @@ public function getDeliveryMethod(): ?string /** * Sets Delivery Method. * - * Indicates how Square delivers the [invoice](#type-Invoice) to the customer. + * Indicates how Square delivers the [invoice]($m/Invoice) to the customer. * * @maps delivery_method */ @@ -285,7 +295,7 @@ public function setDeliveryMethod(?string $deliveryMethod): void * A user-friendly invoice number. The value is unique within a location. * If not provided when creating an invoice, Square assigns a value. * It increments from 1 and padded with zeros making it 7 characters long - * for example, 0000001, 0000002. + * (for example, 0000001 and 0000002). */ public function getInvoiceNumber(): ?string { @@ -298,7 +308,7 @@ public function getInvoiceNumber(): ?string * A user-friendly invoice number. The value is unique within a location. * If not provided when creating an invoice, Square assigns a value. * It increments from 1 and padded with zeros making it 7 characters long - * for example, 0000001, 0000002. + * (for example, 0000001 and 0000002). * * @maps invoice_number */ @@ -355,8 +365,8 @@ public function setDescription(?string $description): void * Returns Scheduled At. * * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. - * After the invoice is published, Square processes the invoice on the specified date, according to the - * delivery method and payment request settings. + * After the invoice is published, Square processes the invoice on the specified date, + * according to the delivery method and payment request settings. * * If the field is not set, Square processes the invoice immediately after it is published. */ @@ -369,8 +379,8 @@ public function getScheduledAt(): ?string * Sets Scheduled At. * * The timestamp when the invoice is scheduled for processing, in RFC 3339 format. - * After the invoice is published, Square processes the invoice on the specified date, according to the - * delivery method and payment request settings. + * After the invoice is published, Square processes the invoice on the specified date, + * according to the delivery method and payment request settings. * * If the field is not set, Square processes the invoice immediately after it is published. * @@ -466,13 +476,13 @@ public function setStatus(?string $status): void /** * Returns Timezone. * - * The time zone used to interpret calendar dates on the invoice, such as `due_date`. When an invoice - * is created, this field is set to the `timezone` specified for the seller location. The value cannot - * be changed. + * The time zone used to interpret calendar dates on the invoice, such as `due_date`. + * When an invoice is created, this field is set to the `timezone` specified for the seller + * location. The value cannot be changed. * - * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles becomes - * overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03- - * 10T08:00:00Z). + * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles + * becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp + * of 2021-03-10T08:00:00Z). */ public function getTimezone(): ?string { @@ -482,13 +492,13 @@ public function getTimezone(): ?string /** * Sets Timezone. * - * The time zone used to interpret calendar dates on the invoice, such as `due_date`. When an invoice - * is created, this field is set to the `timezone` specified for the seller location. The value cannot - * be changed. + * The time zone used to interpret calendar dates on the invoice, such as `due_date`. + * When an invoice is created, this field is set to the `timezone` specified for the seller + * location. The value cannot be changed. * - * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles becomes - * overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp of 2021-03- - * 10T08:00:00Z). + * For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles + * becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp + * of 2021-03-10T08:00:00Z). * * @maps timezone */ @@ -541,6 +551,28 @@ public function setUpdatedAt(?string $updatedAt): void $this->updatedAt = $updatedAt; } + /** + * Returns Accepted Payment Methods. + * + * The payment methods that customers can use to pay an invoice on the Square-hosted invoice page. + */ + public function getAcceptedPaymentMethods(): ?InvoiceAcceptedPaymentMethods + { + return $this->acceptedPaymentMethods; + } + + /** + * Sets Accepted Payment Methods. + * + * The payment methods that customers can use to pay an invoice on the Square-hosted invoice page. + * + * @maps accepted_payment_methods + */ + public function setAcceptedPaymentMethods(?InvoiceAcceptedPaymentMethods $acceptedPaymentMethods): void + { + $this->acceptedPaymentMethods = $acceptedPaymentMethods; + } + /** * Returns Custom Fields. * @@ -579,6 +611,30 @@ public function setCustomFields(?array $customFields): void $this->customFields = $customFields; } + /** + * Returns Subscription Id. + * + * The ID of the [subscription]($m/Subscription) associated with the invoice. + * This field is present only on subscription billing invoices. + */ + public function getSubscriptionId(): ?string + { + return $this->subscriptionId; + } + + /** + * Sets Subscription Id. + * + * The ID of the [subscription]($m/Subscription) associated with the invoice. + * This field is present only on subscription billing invoices. + * + * @maps subscription_id + */ + public function setSubscriptionId(?string $subscriptionId): void + { + $this->subscriptionId = $subscriptionId; + } + /** * Encode this object to JSON * @@ -604,7 +660,9 @@ public function jsonSerialize() $json['timezone'] = $this->timezone; $json['created_at'] = $this->createdAt; $json['updated_at'] = $this->updatedAt; + $json['accepted_payment_methods'] = $this->acceptedPaymentMethods; $json['custom_fields'] = $this->customFields; + $json['subscription_id'] = $this->subscriptionId; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/InvoiceAcceptedPaymentMethods.php b/src/Models/InvoiceAcceptedPaymentMethods.php new file mode 100644 index 00000000..37c9b8d0 --- /dev/null +++ b/src/Models/InvoiceAcceptedPaymentMethods.php @@ -0,0 +1,113 @@ +card; + } + + /** + * Sets Card. + * + * Indicates whether credit card or debit card payments are accepted. The default value is `false`. + * + * @maps card + */ + public function setCard(?bool $card): void + { + $this->card = $card; + } + + /** + * Returns Square Gift Card. + * + * Indicates whether Square gift card payments are accepted. The default value is `false`. + */ + public function getSquareGiftCard(): ?bool + { + return $this->squareGiftCard; + } + + /** + * Sets Square Gift Card. + * + * Indicates whether Square gift card payments are accepted. The default value is `false`. + * + * @maps square_gift_card + */ + public function setSquareGiftCard(?bool $squareGiftCard): void + { + $this->squareGiftCard = $squareGiftCard; + } + + /** + * Returns Bank Account. + * + * Indicates whether bank transfer payments are accepted. The default value is `false`. + * + * This option is allowed only for invoices that have a single payment request of type `BALANCE`. + */ + public function getBankAccount(): ?bool + { + return $this->bankAccount; + } + + /** + * Sets Bank Account. + * + * Indicates whether bank transfer payments are accepted. The default value is `false`. + * + * This option is allowed only for invoices that have a single payment request of type `BALANCE`. + * + * @maps bank_account + */ + public function setBankAccount(?bool $bankAccount): void + { + $this->bankAccount = $bankAccount; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['card'] = $this->card; + $json['square_gift_card'] = $this->squareGiftCard; + $json['bank_account'] = $this->bankAccount; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/InvoiceAutomaticPaymentSource.php b/src/Models/InvoiceAutomaticPaymentSource.php index 2f221099..537ace78 100644 --- a/src/Models/InvoiceAutomaticPaymentSource.php +++ b/src/Models/InvoiceAutomaticPaymentSource.php @@ -5,8 +5,7 @@ namespace Square\Models; /** - * Indicates the automatic payment method for an [invoice payment request](#type- - * InvoicePaymentRequest). + * Indicates the automatic payment method for an [invoice payment request]($m/InvoicePaymentRequest). */ class InvoiceAutomaticPaymentSource { @@ -31,8 +30,8 @@ class InvoiceAutomaticPaymentSource * * This payment method applies only to recurring invoices that sellers create in the Seller Dashboard * or other - * Square first-party application. The bank account is provided by the customer during the payment flow. - * + * Square first-party applications. The bank account is provided by the customer during the payment + * flow. * * You cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a * `BANK_ON_FILE` diff --git a/src/Models/InvoiceDeliveryMethod.php b/src/Models/InvoiceDeliveryMethod.php index d71f8082..0d3ef7da 100644 --- a/src/Models/InvoiceDeliveryMethod.php +++ b/src/Models/InvoiceDeliveryMethod.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Indicates how Square delivers the [invoice](#type-Invoice) to the customer. + * Indicates how Square delivers the [invoice]($m/Invoice) to the customer. */ class InvoiceDeliveryMethod { diff --git a/src/Models/InvoicePaymentReminderStatus.php b/src/Models/InvoicePaymentReminderStatus.php index 96eefa2d..122eb192 100644 --- a/src/Models/InvoicePaymentReminderStatus.php +++ b/src/Models/InvoicePaymentReminderStatus.php @@ -10,7 +10,7 @@ class InvoicePaymentReminderStatus { /** - * The reminder is to be sent on the `relative_scheduled_date` (if the invoice is published). + * The reminder will be sent on the `relative_scheduled_date` (if the invoice is published). */ public const PENDING = 'PENDING'; diff --git a/src/Models/InvoicePaymentRequest.php b/src/Models/InvoicePaymentRequest.php index 9289e6a7..72b00f15 100644 --- a/src/Models/InvoicePaymentRequest.php +++ b/src/Models/InvoicePaymentRequest.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Represents a payment request for an [invoice](#type-Invoice). Invoices can specify a maximum + * Represents a payment request for an [invoice]($m/Invoice). Invoices can specify a maximum * of 13 payment requests, with up to 12 `INSTALLMENT` request types. * * For more information, @@ -81,7 +81,7 @@ class InvoicePaymentRequest implements \JsonSerializable /** * Returns Uid. * - * The Square-generated ID of the payment request in an [invoice](#type-invoice). + * The Square-generated ID of the payment request in an [invoice]($m/Invoice). */ public function getUid(): ?string { @@ -91,7 +91,7 @@ public function getUid(): ?string /** * Sets Uid. * - * The Square-generated ID of the payment request in an [invoice](#type-invoice). + * The Square-generated ID of the payment request in an [invoice]($m/Invoice). * * @maps uid */ @@ -104,9 +104,9 @@ public function setUid(?string $uid): void * Returns Request Method. * * Specifies the action for Square to take for processing the invoice. For example, - * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at version 2021-01-21. - * The corresponding `request_method` field is replaced by the `Invoice.delivery_method` and - * `InvoicePaymentRequest.automatic_payment_source` fields. + * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at + * version 2021-01-21. The corresponding `request_method` field is replaced by the + * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. */ public function getRequestMethod(): ?string { @@ -117,9 +117,9 @@ public function getRequestMethod(): ?string * Sets Request Method. * * Specifies the action for Square to take for processing the invoice. For example, - * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at version 2021-01-21. - * The corresponding `request_method` field is replaced by the `Invoice.delivery_method` and - * `InvoicePaymentRequest.automatic_payment_source` fields. + * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at + * version 2021-01-21. The corresponding `request_method` field is replaced by the + * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. * * @maps request_method */ @@ -170,11 +170,14 @@ public function setRequestType(?string $requestType): void * Returns Due Date. * * The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This - * field is required to create a payment request. + * field + * is required to create a payment request. * * After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a - * `timezone` of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles - * (which equals a UTC timestamp of 2021-03-10T08:00:00Z). + * `timezone` + * of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals + * a UTC + * timestamp of 2021-03-10T08:00:00Z). */ public function getDueDate(): ?string { @@ -185,11 +188,14 @@ public function getDueDate(): ?string * Sets Due Date. * * The due date (in the invoice's time zone) for the payment request, in `YYYY-MM-DD` format. This - * field is required to create a payment request. + * field + * is required to create a payment request. * * After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a - * `timezone` of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles - * (which equals a UTC timestamp of 2021-03-10T08:00:00Z). + * `timezone` + * of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals + * a UTC + * timestamp of 2021-03-10T08:00:00Z). * * @maps due_date */ @@ -237,8 +243,8 @@ public function setFixedAmountRequestedMoney(?Money $fixedAmountRequestedMoney): * * Specifies the amount for the payment request in percentage: * - * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order total amount. - * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order total less + * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount. + * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less * the deposit, if requested. The sum of the `percentage_requested` in all installment * payment requests must be equal to 100. * @@ -255,8 +261,8 @@ public function getPercentageRequested(): ?string * * Specifies the amount for the payment request in percentage: * - * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order total amount. - * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order total less + * - When the payment `request_type` is `DEPOSIT`, it is the percentage of the order's total amount. + * - When the payment `request_type` is `INSTALLMENT`, it is the percentage of the order's total less * the deposit, if requested. The sum of the `percentage_requested` in all installment * payment requests must be equal to 100. * @@ -303,7 +309,7 @@ public function setTippingEnabled(?bool $tippingEnabled): void /** * Returns Automatic Payment Source. * - * Indicates the automatic payment method for an [invoice payment request](#type-InvoicePaymentRequest). + * Indicates the automatic payment method for an [invoice payment request]($m/InvoicePaymentRequest). */ public function getAutomaticPaymentSource(): ?string { @@ -313,7 +319,7 @@ public function getAutomaticPaymentSource(): ?string /** * Sets Automatic Payment Source. * - * Indicates the automatic payment method for an [invoice payment request](#type-InvoicePaymentRequest). + * Indicates the automatic payment method for an [invoice payment request]($m/InvoicePaymentRequest). * * @maps automatic_payment_source */ @@ -326,8 +332,8 @@ public function setAutomaticPaymentSource(?string $automaticPaymentSource): void * Returns Card Id. * * The ID of the card on file to charge for the payment request. To get the customer’s card on file, - * use the `customer_id` of the invoice recipient to call [RetrieveCustomer](#endpoint-Customers- - * RetrieveCustomer) + * use the `customer_id` of the invoice recipient to call + * [RetrieveCustomer]($e/Customers/RetrieveCustomer) * in the Customers API. Then, get the ID of the target card from the `cards` field in the response. */ public function getCardId(): ?string @@ -339,8 +345,8 @@ public function getCardId(): ?string * Sets Card Id. * * The ID of the card on file to charge for the payment request. To get the customer’s card on file, - * use the `customer_id` of the invoice recipient to call [RetrieveCustomer](#endpoint-Customers- - * RetrieveCustomer) + * use the `customer_id` of the invoice recipient to call + * [RetrieveCustomer]($e/Customers/RetrieveCustomer) * in the Customers API. Then, get the ID of the target card from the `cards` field in the response. * * @maps card_id diff --git a/src/Models/InvoiceQuery.php b/src/Models/InvoiceQuery.php index 3ce4341a..7368a8c7 100644 --- a/src/Models/InvoiceQuery.php +++ b/src/Models/InvoiceQuery.php @@ -53,7 +53,7 @@ public function setFilter(InvoiceFilter $filter): void /** * Returns Sort. * - * Identifies the sort field and sort order. + * Identifies the sort field and sort order. */ public function getSort(): ?InvoiceSort { @@ -63,7 +63,7 @@ public function getSort(): ?InvoiceSort /** * Sets Sort. * - * Identifies the sort field and sort order. + * Identifies the sort field and sort order. * * @maps sort */ diff --git a/src/Models/InvoiceRequestMethod.php b/src/Models/InvoiceRequestMethod.php index ee690ddd..f2c49358 100644 --- a/src/Models/InvoiceRequestMethod.php +++ b/src/Models/InvoiceRequestMethod.php @@ -6,22 +6,22 @@ /** * Specifies the action for Square to take for processing the invoice. For example, - * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at version 2021-01-21. - * The corresponding `request_method` field is replaced by the `Invoice.delivery_method` and - * `InvoicePaymentRequest.automatic_payment_source` fields. + * email the invoice, charge a customer's card on file, or do nothing. DEPRECATED at + * version 2021-01-21. The corresponding `request_method` field is replaced by the + * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. */ class InvoiceRequestMethod { /** - * Directs Square to send invoices, reminders, and receipts to the customer using email. Square sends - * the invoice after it is published - * (either immediately or at the `scheduled_at` time, if specified in the [invoice](#type-invoice)). + * Directs Square to send invoices, reminders, and receipts to the customer using email. + * Square sends the invoice after it is published (either immediately or at the `scheduled_at` + * time, if specified in the [invoice]($m/Invoice)). */ public const EMAIL = 'EMAIL'; /** - * Directs Square to charge the card on file on the `due_date` specified in the payment request and to - * use email to send invoices, reminders, and receipts. + * Directs Square to charge the card on file on the `due_date` specified in the payment request + * and to use email to send invoices, reminders, and receipts. */ public const CHARGE_CARD_ON_FILE = 'CHARGE_CARD_ON_FILE'; @@ -48,15 +48,17 @@ class InvoiceRequestMethod /** * Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends - * the invoice after it is published (either immediately or at the `scheduled_at` time, if specified in - * the [invoice](#type-invoice)). + * the invoice + * after it is published (either immediately or at the `scheduled_at` time, if specified in the + * [invoice]($m/Invoice)). * * You cannot set `SMS` as a request method using the Invoices API. */ public const SMS = 'SMS'; /** - * Directs Square to charge the card on file on the `due_date` specified in the payment request and to + * Directs Square to charge the card on file on the `due_date` specified in the payment request and + * to * use SMS (text message) to send invoices and receipts. * * You cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API. @@ -65,12 +67,14 @@ class InvoiceRequestMethod /** * Directs Square to charge the bank account on file on the `due_date` specified in the payment - * request and to use SMS (text message) to send invoices and receipts. + * request + * and to use SMS (text message) to send invoices and receipts. * * The bank on file payment method applies only to recurring invoices that sellers create in the Seller - * Dashboard or other Square first-party applications. The bank account is provided by the customer - * during the payment flow. You cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the - * Invoices API. + * Dashboard + * or other Square first-party applications. The bank account is provided by the customer during the + * payment flow. + * You cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API. */ public const SMS_CHARGE_BANK_ON_FILE = 'SMS_CHARGE_BANK_ON_FILE'; } diff --git a/src/Models/InvoiceRequestType.php b/src/Models/InvoiceRequestType.php index 31f0aa8a..b5301a4d 100644 --- a/src/Models/InvoiceRequestType.php +++ b/src/Models/InvoiceRequestType.php @@ -39,7 +39,7 @@ class InvoiceRequestType /** * Identifies that the payment request is for an installment. An invoice can request payments in * installments. - * Along with installments, you can request an optional deposit. All these payment requests must add to + * Along with installments, you can request an optional deposit. All these payment requests must equal * the total order amount. */ public const INSTALLMENT = 'INSTALLMENT'; diff --git a/src/Models/InvoiceSort.php b/src/Models/InvoiceSort.php index ea155def..c5dd1dcf 100644 --- a/src/Models/InvoiceSort.php +++ b/src/Models/InvoiceSort.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Identifies the sort field and sort order. + * Identifies the sort field and sort order. */ class InvoiceSort implements \JsonSerializable { @@ -30,7 +30,7 @@ public function __construct(string $field) /** * Returns Field. * - * Field to use for sorting. + * The field to use for sorting. */ public function getField(): string { @@ -40,7 +40,7 @@ public function getField(): string /** * Sets Field. * - * Field to use for sorting. + * The field to use for sorting. * * @required * @maps field diff --git a/src/Models/InvoiceSortField.php b/src/Models/InvoiceSortField.php index 89971c2e..4b1579c5 100644 --- a/src/Models/InvoiceSortField.php +++ b/src/Models/InvoiceSortField.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Field to use for sorting. + * The field to use for sorting. */ class InvoiceSortField { diff --git a/src/Models/InvoiceStatus.php b/src/Models/InvoiceStatus.php index 09e0e49e..266169c6 100644 --- a/src/Models/InvoiceStatus.php +++ b/src/Models/InvoiceStatus.php @@ -22,10 +22,9 @@ class InvoiceStatus /** * The invoice is scheduled to be processed. On the scheduled date, - * Square sends the invoice, initiates an automatic payment, or takes no action, depending on the - * delivery method and payment request settings. Square also sets the invoice status to the appropriate - * state: - * `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`. + * Square sends the invoice, initiates an automatic payment, or takes no action, depending on + * the delivery method and payment request settings. Square also sets the invoice status to the + * appropriate state: `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`. */ public const SCHEDULED = 'SCHEDULED'; @@ -53,7 +52,7 @@ class InvoiceStatus /** * The invoice is canceled. Square no longer requests payments from the customer. * The `public_url` page remains and is accessible, but it displays the invoice - * as cancelled and does not accept payment. + * as canceled and does not accept payment. */ public const CANCELED = 'CANCELED'; diff --git a/src/Models/ItemVariationLocationOverrides.php b/src/Models/ItemVariationLocationOverrides.php index 6e881b96..1c1fe419 100644 --- a/src/Models/ItemVariationLocationOverrides.php +++ b/src/Models/ItemVariationLocationOverrides.php @@ -42,7 +42,7 @@ class ItemVariationLocationOverrides implements \JsonSerializable /** * Returns Location Id. * - * The ID of the `Location`. + * The ID of the `Location`. This can include locations that are deactivated. */ public function getLocationId(): ?string { @@ -52,7 +52,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The ID of the `Location`. + * The ID of the `Location`. This can include locations that are deactivated. * * @maps location_id */ diff --git a/src/Models/ListCatalogRequest.php b/src/Models/ListCatalogRequest.php index 238a28d9..c25cdcfa 100644 --- a/src/Models/ListCatalogRequest.php +++ b/src/Models/ListCatalogRequest.php @@ -83,7 +83,7 @@ public function setTypes(?string $types): void * The specific version of the catalog objects to be included in the response. * This allows you to retrieve historical * versions of objects. The specified version value is matched against - * the [CatalogObject](#type-catalogobject)s' `version` attribute. + * the [CatalogObject]($m/CatalogObject)s' `version` attribute. */ public function getCatalogVersion(): ?int { @@ -96,7 +96,7 @@ public function getCatalogVersion(): ?int * The specific version of the catalog objects to be included in the response. * This allows you to retrieve historical * versions of objects. The specified version value is matched against - * the [CatalogObject](#type-catalogobject)s' `version` attribute. + * the [CatalogObject]($m/CatalogObject)s' `version` attribute. * * @maps catalog_version */ diff --git a/src/Models/ListCustomerGroupsRequest.php b/src/Models/ListCustomerGroupsRequest.php index 662f03be..98ed7f10 100644 --- a/src/Models/ListCustomerGroupsRequest.php +++ b/src/Models/ListCustomerGroupsRequest.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Defines the query parameters that can be provided in a request to the - * [ListCustomerGroups](#endpoint-listcustomergroups) endpoint. + * Defines the query parameters that can be included in a request to the + * [ListCustomerGroups]($e/CustomerGroups/ListCustomerGroups) endpoint. */ class ListCustomerGroupsRequest implements \JsonSerializable { @@ -19,10 +19,10 @@ class ListCustomerGroupsRequest implements \JsonSerializable * Returns Cursor. * * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. + * Provide this cursor to retrieve the next set of results for your original query. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -33,10 +33,10 @@ public function getCursor(): ?string * Sets Cursor. * * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. + * Provide this cursor to retrieve the next set of results for your original query. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/ListCustomerGroupsResponse.php b/src/Models/ListCustomerGroupsResponse.php index e776908d..23261093 100644 --- a/src/Models/ListCustomerGroupsResponse.php +++ b/src/Models/ListCustomerGroupsResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the [ListCustomerGroups](#endpoint-listcustomergroups) endpoint. + * a request to the [ListCustomerGroups]($e/CustomerGroups/ListCustomerGroups) endpoint. * - * One of `errors` or `groups` is present in a given response (never both). + * Either `errors` or `groups` is present in a given response (never both). */ class ListCustomerGroupsResponse implements \JsonSerializable { @@ -56,7 +56,7 @@ public function setErrors(?array $errors): void /** * Returns Groups. * - * A list of customer groups belonging to the current merchant. + * A list of customer groups belonging to the current seller. * * @return CustomerGroup[]|null */ @@ -68,7 +68,7 @@ public function getGroups(): ?array /** * Sets Groups. * - * A list of customer groups belonging to the current merchant. + * A list of customer groups belonging to the current seller. * * @maps groups * @@ -86,8 +86,8 @@ public function setGroups(?array $groups): void * original query to the endpoint. This value is present only if the request * succeeded and additional results are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -101,8 +101,8 @@ public function getCursor(): ?string * original query to the endpoint. This value is present only if the request * succeeded and additional results are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/ListCustomerSegmentsRequest.php b/src/Models/ListCustomerSegmentsRequest.php index 76332e13..e0a8a7a9 100644 --- a/src/Models/ListCustomerSegmentsRequest.php +++ b/src/Models/ListCustomerSegmentsRequest.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the valid parameters for requests to __ListCustomerSegments__. + * Defines the valid parameters for requests to the `ListCustomerSegments` endpoint. */ class ListCustomerSegmentsRequest implements \JsonSerializable { @@ -17,11 +17,11 @@ class ListCustomerSegmentsRequest implements \JsonSerializable /** * Returns Cursor. * - * A pagination cursor returned by previous calls to __ListCustomerSegments__. - * Used to retrieve the next set of query results. + * A pagination cursor returned by previous calls to `ListCustomerSegments`. + * This cursor is used to retrieve the next set of query results. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -31,11 +31,11 @@ public function getCursor(): ?string /** * Sets Cursor. * - * A pagination cursor returned by previous calls to __ListCustomerSegments__. - * Used to retrieve the next set of query results. + * A pagination cursor returned by previous calls to `ListCustomerSegments`. + * This cursor is used to retrieve the next set of query results. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/ListCustomerSegmentsResponse.php b/src/Models/ListCustomerSegmentsResponse.php index 98092fab..8b144815 100644 --- a/src/Models/ListCustomerSegmentsResponse.php +++ b/src/Models/ListCustomerSegmentsResponse.php @@ -5,9 +5,10 @@ namespace Square\Models; /** - * Defines the fields included in the response body for requests to __ListCustomerSegments__. + * Defines the fields that are included in the response body for requests to the + * `ListCustomerSegments` endpoint. * - * One of `errors` or `segments` is present in a given response (never both). + * Either `errors` or `segments` is present in a given response (never both). */ class ListCustomerSegmentsResponse implements \JsonSerializable { @@ -81,12 +82,12 @@ public function setSegments(?array $segments): void /** * Returns Cursor. * - * A pagination cursor to be used in subsequent calls to __ListCustomerSegments__ - * to retrieve the next set of query results. Only present only if the request succeeded and + * A pagination cursor to be used in subsequent calls to `ListCustomerSegments` + * to retrieve the next set of query results. The cursor is only present if the request succeeded and * additional results are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -96,12 +97,12 @@ public function getCursor(): ?string /** * Sets Cursor. * - * A pagination cursor to be used in subsequent calls to __ListCustomerSegments__ - * to retrieve the next set of query results. Only present only if the request succeeded and + * A pagination cursor to be used in subsequent calls to `ListCustomerSegments` + * to retrieve the next set of query results. The cursor is only present if the request succeeded and * additional results are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/ListCustomersRequest.php b/src/Models/ListCustomersRequest.php index 3bddc2a4..edde41d5 100644 --- a/src/Models/ListCustomersRequest.php +++ b/src/Models/ListCustomersRequest.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Defines the query parameters that can be provided in a request to the - * ListCustomers endpoint. + * Defines the query parameters that can be included in a request to the + * `ListCustomers` endpoint. */ class ListCustomersRequest implements \JsonSerializable { @@ -29,10 +29,10 @@ class ListCustomersRequest implements \JsonSerializable * Returns Cursor. * * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. + * Provide this cursor to retrieve the next set of results for your original query. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -43,10 +43,10 @@ public function getCursor(): ?string * Sets Cursor. * * A pagination cursor returned by a previous call to this endpoint. - * Provide this to retrieve the next set of results for your original query. + * Provide this cursor to retrieve the next set of results for your original query. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/ListCustomersResponse.php b/src/Models/ListCustomersResponse.php index 970637b0..9a50809d 100644 --- a/src/Models/ListCustomersResponse.php +++ b/src/Models/ListCustomersResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the ListCustomers endpoint. + * a request to the `ListCustomers` endpoint. * - * One of `errors` or `customers` is present in a given response (never both). + * Either `errors` or `customers` is present in a given response (never both). */ class ListCustomersResponse implements \JsonSerializable { @@ -83,11 +83,11 @@ public function setCustomers(?array $customers): void * Returns Cursor. * * A pagination cursor to retrieve the next set of results for the - * original query. Only present if the request succeeded and additional results + * original query. A cursor is only present if the request succeeded and additional results * are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -98,11 +98,11 @@ public function getCursor(): ?string * Sets Cursor. * * A pagination cursor to retrieve the next set of results for the - * original query. Only present if the request succeeded and additional results + * original query. A cursor is only present if the request succeeded and additional results * are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/ListDeviceCodesRequest.php b/src/Models/ListDeviceCodesRequest.php index 774c65a5..2aa4c4af 100644 --- a/src/Models/ListDeviceCodesRequest.php +++ b/src/Models/ListDeviceCodesRequest.php @@ -32,7 +32,8 @@ class ListDeviceCodesRequest implements \JsonSerializable * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. */ public function getCursor(): ?string { @@ -45,7 +46,8 @@ public function getCursor(): ?string * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. * * @maps cursor */ diff --git a/src/Models/ListDeviceCodesResponse.php b/src/Models/ListDeviceCodesResponse.php index 67b3b62b..daf5e811 100644 --- a/src/Models/ListDeviceCodesResponse.php +++ b/src/Models/ListDeviceCodesResponse.php @@ -80,7 +80,8 @@ public function setDeviceCodes(?array $deviceCodes): void * original query to the endpoint. This value is present only if the request * succeeded and additional results are available. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. */ public function getCursor(): ?string { @@ -94,7 +95,8 @@ public function getCursor(): ?string * original query to the endpoint. This value is present only if the request * succeeded and additional results are available. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. * * @maps cursor */ diff --git a/src/Models/ListInvoicesRequest.php b/src/Models/ListInvoicesRequest.php index 05b04eb3..8d389d8a 100644 --- a/src/Models/ListInvoicesRequest.php +++ b/src/Models/ListInvoicesRequest.php @@ -89,8 +89,7 @@ public function setCursor(?string $cursor): void * Returns Limit. * * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server - * uses a default limit of 100 invoices. + * If not provided, the server uses a default limit of 100 invoices. */ public function getLimit(): ?int { @@ -101,8 +100,7 @@ public function getLimit(): ?int * Sets Limit. * * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server - * uses a default limit of 100 invoices. + * If not provided, the server uses a default limit of 100 invoices. * * @maps limit */ diff --git a/src/Models/ListInvoicesResponse.php b/src/Models/ListInvoicesResponse.php index 5d32ef91..858396cf 100644 --- a/src/Models/ListInvoicesResponse.php +++ b/src/Models/ListInvoicesResponse.php @@ -54,7 +54,7 @@ public function setInvoices(?array $invoices): void * Returns Cursor. * * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to fetch the next set of invoices. If empty, this is the final + * subsequent request to retrieve the next set of invoices. If empty, this is the final * response. * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- * apis/pagination). @@ -68,7 +68,7 @@ public function getCursor(): ?string * Sets Cursor. * * When a response is truncated, it includes a cursor that you can use in a - * subsequent request to fetch the next set of invoices. If empty, this is the final + * subsequent request to retrieve the next set of invoices. If empty, this is the final * response. * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- * apis/pagination). diff --git a/src/Models/ListMerchantsRequest.php b/src/Models/ListMerchantsRequest.php index 11317f03..42516dc2 100644 --- a/src/Models/ListMerchantsRequest.php +++ b/src/Models/ListMerchantsRequest.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Request object for the [ListMerchant](#endpoint-listmerchant) endpoint. + * Request object for the [ListMerchant]($e/Merchants/ListMerchants) endpoint. */ class ListMerchantsRequest implements \JsonSerializable { diff --git a/src/Models/ListMerchantsResponse.php b/src/Models/ListMerchantsResponse.php index a5733518..9256c062 100644 --- a/src/Models/ListMerchantsResponse.php +++ b/src/Models/ListMerchantsResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * The response object returned by the [ListMerchant](#endpoint-listmerchant) endpoint. + * The response object returned by the [ListMerchant]($e/Merchants/ListMerchants) endpoint. */ class ListMerchantsResponse implements \JsonSerializable { diff --git a/src/Models/ListPaymentRefundsRequest.php b/src/Models/ListPaymentRefundsRequest.php index 480c30ba..fa00a9d5 100644 --- a/src/Models/ListPaymentRefundsRequest.php +++ b/src/Models/ListPaymentRefundsRequest.php @@ -6,7 +6,7 @@ /** * Describes a request to list refunds using - * [ListPaymentRefunds](#endpoint-payments-listpaymentrefunds). + * [ListPaymentRefunds]($e/Refunds/ListPaymentRefunds). * * The maximum results per page is 100. */ @@ -186,7 +186,7 @@ public function setLocationId(?string $locationId): void * Returns Status. * * If provided, only refunds with the given status are returned. - * For a list of refund status values, see [PaymentRefund](#type-paymentrefund). + * For a list of refund status values, see [PaymentRefund]($m/PaymentRefund). * * Default: If omitted, refunds are returned regardless of their status. */ @@ -199,7 +199,7 @@ public function getStatus(): ?string * Sets Status. * * If provided, only refunds with the given status are returned. - * For a list of refund status values, see [PaymentRefund](#type-paymentrefund). + * For a list of refund status values, see [PaymentRefund]($m/PaymentRefund). * * Default: If omitted, refunds are returned regardless of their status. * diff --git a/src/Models/ListPaymentRefundsResponse.php b/src/Models/ListPaymentRefundsResponse.php index 426c839d..92121d21 100644 --- a/src/Models/ListPaymentRefundsResponse.php +++ b/src/Models/ListPaymentRefundsResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by [ListPaymentRefunds](#endpoint-refunds-listpaymentrefunds). + * Defines the response returned by [ListPaymentRefunds]($e/Refunds/ListPaymentRefunds). * * Either `errors` or `refunds` is present in a given response (never both). */ diff --git a/src/Models/ListPaymentsRequest.php b/src/Models/ListPaymentsRequest.php index 5c9f40b2..b613f14b 100644 --- a/src/Models/ListPaymentsRequest.php +++ b/src/Models/ListPaymentsRequest.php @@ -6,7 +6,7 @@ /** * Describes a request to list payments using - * [ListPayments](#endpoint-payments-listpayments). + * [ListPayments]($e/Payments/ListPayments). * * The maximum results per page is 100. */ diff --git a/src/Models/ListPaymentsResponse.php b/src/Models/ListPaymentsResponse.php index 10c71b3c..9b19b582 100644 --- a/src/Models/ListPaymentsResponse.php +++ b/src/Models/ListPaymentsResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Defines the response returned by [ListPayments](#endpoint-payments-listpayments). + * Defines the response returned by [ListPayments]($e/Payments/ListPayments). */ class ListPaymentsResponse implements \JsonSerializable { diff --git a/src/Models/ListRefundsRequest.php b/src/Models/ListRefundsRequest.php index d00504bc..314d78a5 100644 --- a/src/Models/ListRefundsRequest.php +++ b/src/Models/ListRefundsRequest.php @@ -6,9 +6,9 @@ /** * Defines the query parameters that can be included in - * a request to the [ListRefunds](#endpoint-listrefunds) endpoint. + * a request to the [ListRefunds]($e/Transactions/ListRefunds) endpoint. * - * Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + * Deprecated - recommend using [SearchOrders]($e/Orders/SearchOrders) */ class ListRefundsRequest implements \JsonSerializable { @@ -37,7 +37,8 @@ class ListRefundsRequest implements \JsonSerializable * * The beginning of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time minus one year. */ @@ -51,7 +52,8 @@ public function getBeginTime(): ?string * * The beginning of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time minus one year. * @@ -67,7 +69,8 @@ public function setBeginTime(?string $beginTime): void * * The end of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time. */ @@ -81,7 +84,8 @@ public function getEndTime(): ?string * * The end of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time. * @@ -120,7 +124,8 @@ public function setSortOrder(?string $sortOrder): void * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. */ public function getCursor(): ?string { @@ -133,7 +138,8 @@ public function getCursor(): ?string * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. * * @maps cursor */ diff --git a/src/Models/ListRefundsResponse.php b/src/Models/ListRefundsResponse.php index a47afe88..92170777 100644 --- a/src/Models/ListRefundsResponse.php +++ b/src/Models/ListRefundsResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [ListRefunds](#endpoint-listrefunds) endpoint. + * a request to the [ListRefunds]($e/Transactions/ListRefunds) endpoint. * * One of `errors` or `refunds` is present in a given response (never both). */ @@ -86,7 +86,8 @@ public function setRefunds(?array $refunds): void * if any remain. Provide this value as the `cursor` parameter in a subsequent * request to this endpoint. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. */ public function getCursor(): ?string { @@ -100,7 +101,8 @@ public function getCursor(): ?string * if any remain. Provide this value as the `cursor` parameter in a subsequent * request to this endpoint. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. * * @maps cursor */ diff --git a/src/Models/ListSubscriptionEventsRequest.php b/src/Models/ListSubscriptionEventsRequest.php index 474520b9..acc8e857 100644 --- a/src/Models/ListSubscriptionEventsRequest.php +++ b/src/Models/ListSubscriptionEventsRequest.php @@ -6,7 +6,7 @@ /** * Defines parameters in a - * [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) + * [ListSubscriptionEvents]($e/Subscriptions/ListSubscriptionEvents) * endpoint request. */ class ListSubscriptionEventsRequest implements \JsonSerializable diff --git a/src/Models/ListSubscriptionEventsResponse.php b/src/Models/ListSubscriptionEventsResponse.php index 2d021180..b20d8a12 100644 --- a/src/Models/ListSubscriptionEventsResponse.php +++ b/src/Models/ListSubscriptionEventsResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response from the - * [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) + * [ListSubscriptionEvents]($e/Subscriptions/ListSubscriptionEvents) * endpoint. */ class ListSubscriptionEventsResponse implements \JsonSerializable diff --git a/src/Models/ListTransactionsRequest.php b/src/Models/ListTransactionsRequest.php index 1aaee06d..6b46bf98 100644 --- a/src/Models/ListTransactionsRequest.php +++ b/src/Models/ListTransactionsRequest.php @@ -6,9 +6,9 @@ /** * Defines the query parameters that can be included in - * a request to the [ListTransactions](#endpoint-listtransactions) endpoint. + * a request to the [ListTransactions]($e/Transactions/ListTransactions) endpoint. * - * Deprecated - recommend using [SearchOrders](#endpoint-orders-searchorders) + * Deprecated - recommend using [SearchOrders]($e/Orders/SearchOrders) */ class ListTransactionsRequest implements \JsonSerializable { @@ -37,7 +37,8 @@ class ListTransactionsRequest implements \JsonSerializable * * The beginning of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time minus one year. */ @@ -51,7 +52,8 @@ public function getBeginTime(): ?string * * The beginning of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time minus one year. * @@ -67,7 +69,8 @@ public function setBeginTime(?string $beginTime): void * * The end of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time. */ @@ -81,7 +84,8 @@ public function getEndTime(): ?string * * The end of the requested reporting period, in RFC 3339 format. * - * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. + * See [Date ranges](https://developer.squareup.com/docs/build-basics/working-with-dates) for details + * on date inclusivity/exclusivity. * * Default value: The current time. * @@ -120,7 +124,8 @@ public function setSortOrder(?string $sortOrder): void * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. */ public function getCursor(): ?string { @@ -133,7 +138,8 @@ public function getCursor(): ?string * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. * * @maps cursor */ diff --git a/src/Models/ListTransactionsResponse.php b/src/Models/ListTransactionsResponse.php index ab4af71f..ed43147d 100644 --- a/src/Models/ListTransactionsResponse.php +++ b/src/Models/ListTransactionsResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [ListTransactions](#endpoint-listtransactions) endpoint. + * a request to the [ListTransactions]($e/Transactions/ListTransactions) endpoint. * * One of `errors` or `transactions` is present in a given response (never both). */ @@ -86,7 +86,8 @@ public function setTransactions(?array $transactions): void * if any remain. Provide this value as the `cursor` parameter in a subsequent * request to this endpoint. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. */ public function getCursor(): ?string { @@ -100,7 +101,8 @@ public function getCursor(): ?string * if any remain. Provide this value as the `cursor` parameter in a subsequent * request to this endpoint. * - * See [Paginating results](#paginatingresults) for more information. + * See [Paginating results](https://developer.squareup.com/docs/working-with-apis/pagination) for more + * information. * * @maps cursor */ diff --git a/src/Models/Location.php b/src/Models/Location.php index e2b1e596..ad25539a 100644 --- a/src/Models/Location.php +++ b/src/Models/Location.php @@ -234,7 +234,7 @@ public function setTimezone(?string $timezone): void * Returns Capabilities. * * The Square features that are enabled for the location. - * See [LocationCapability](#type-locationcapability) for possible values. + * See [LocationCapability]($m/LocationCapability) for possible values. * See [LocationCapability](#type-locationcapability) for possible values * * @return string[]|null @@ -248,7 +248,7 @@ public function getCapabilities(): ?array * Sets Capabilities. * * The Square features that are enabled for the location. - * See [LocationCapability](#type-locationcapability) for possible values. + * See [LocationCapability]($m/LocationCapability) for possible values. * See [LocationCapability](#type-locationcapability) for possible values * * @maps capabilities diff --git a/src/Models/LocationCapability.php b/src/Models/LocationCapability.php index 3d6e2f3a..efd8da11 100644 --- a/src/Models/LocationCapability.php +++ b/src/Models/LocationCapability.php @@ -16,4 +16,12 @@ class LocationCapability * in the `capabilities` array of the `Location`. */ public const CREDIT_CARD_PROCESSING = 'CREDIT_CARD_PROCESSING'; + + /** + * The capability to receive automatic transfers from Square. + * + * The location can receive automatic transfers of their balance from Square if this value + * is present in the `capabilities` array of the `Location`. + */ + public const AUTOMATIC_TRANSFERS = 'AUTOMATIC_TRANSFERS'; } diff --git a/src/Models/LoyaltyAccount.php b/src/Models/LoyaltyAccount.php index 87769b59..44b6a40f 100644 --- a/src/Models/LoyaltyAccount.php +++ b/src/Models/LoyaltyAccount.php @@ -16,7 +16,7 @@ class LoyaltyAccount implements \JsonSerializable private $id; /** - * @var LoyaltyAccountMapping[] + * @var LoyaltyAccountMapping[]|null */ private $mappings; @@ -56,12 +56,15 @@ class LoyaltyAccount implements \JsonSerializable private $updatedAt; /** - * @param LoyaltyAccountMapping[] $mappings + * @var LoyaltyAccountMapping|null + */ + private $mapping; + + /** * @param string $programId */ - public function __construct(array $mappings, string $programId) + public function __construct(string $programId) { - $this->mappings = $mappings; $this->programId = $programId; } @@ -94,9 +97,14 @@ public function setId(?string $id): void * Currently, a buyer can only be mapped to a loyalty account using * a phone number. Therefore, the list can only have one mapping. * - * @return LoyaltyAccountMapping[] + * One of the following is required when creating a loyalty account: + * - (Preferred) The `mapping` field, with the buyer's phone number specified in the `phone_number` + * field. + * - This `mappings` field. + * + * @return LoyaltyAccountMapping[]|null */ - public function getMappings(): array + public function getMappings(): ?array { return $this->mappings; } @@ -108,12 +116,16 @@ public function getMappings(): array * Currently, a buyer can only be mapped to a loyalty account using * a phone number. Therefore, the list can only have one mapping. * - * @required + * One of the following is required when creating a loyalty account: + * - (Preferred) The `mapping` field, with the buyer's phone number specified in the `phone_number` + * field. + * - This `mappings` field. + * * @maps mappings * - * @param LoyaltyAccountMapping[] $mappings + * @param LoyaltyAccountMapping[]|null $mappings */ - public function setMappings(array $mappings): void + public function setMappings(?array $mappings): void { $this->mappings = $mappings; } @@ -121,7 +133,7 @@ public function setMappings(array $mappings): void /** * Returns Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram) to which the account belongs. + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram) to which the account belongs. */ public function getProgramId(): string { @@ -131,7 +143,7 @@ public function getProgramId(): string /** * Sets Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram) to which the account belongs. + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram) to which the account belongs. * * @required * @maps program_id @@ -196,7 +208,7 @@ public function setLifetimePoints(?int $lifetimePoints): void /** * Returns Customer Id. * - * The Square-assigned ID of the [customer](#type-Customer) that is associated with the account. + * The Square-assigned ID of the [customer]($m/Customer) that is associated with the account. */ public function getCustomerId(): ?string { @@ -206,7 +218,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The Square-assigned ID of the [customer](#type-Customer) that is associated with the account. + * The Square-assigned ID of the [customer]($m/Customer) that is associated with the account. * * @maps customer_id */ @@ -281,6 +293,36 @@ public function setUpdatedAt(?string $updatedAt): void $this->updatedAt = $updatedAt; } + /** + * Returns Mapping. + * + * Represents the mapping that associates a loyalty account with a buyer. + * + * Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, + * see + * [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). + */ + public function getMapping(): ?LoyaltyAccountMapping + { + return $this->mapping; + } + + /** + * Sets Mapping. + * + * Represents the mapping that associates a loyalty account with a buyer. + * + * Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, + * see + * [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). + * + * @maps mapping + */ + public function setMapping(?LoyaltyAccountMapping $mapping): void + { + $this->mapping = $mapping; + } + /** * Encode this object to JSON * @@ -298,6 +340,7 @@ public function jsonSerialize() $json['enrolled_at'] = $this->enrolledAt; $json['created_at'] = $this->createdAt; $json['updated_at'] = $this->updatedAt; + $json['mapping'] = $this->mapping; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/LoyaltyAccountMapping.php b/src/Models/LoyaltyAccountMapping.php index 406379b2..d09c655c 100644 --- a/src/Models/LoyaltyAccountMapping.php +++ b/src/Models/LoyaltyAccountMapping.php @@ -5,8 +5,10 @@ namespace Square\Models; /** - * Associates a loyalty account with the buyer's phone number. - * For more information, see + * Represents the mapping that associates a loyalty account with a buyer. + * + * Currently, a loyalty account can only be mapped to a buyer by phone number. For more information, + * see * [Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). */ class LoyaltyAccountMapping implements \JsonSerializable @@ -17,12 +19,12 @@ class LoyaltyAccountMapping implements \JsonSerializable private $id; /** - * @var string + * @var string|null */ private $type; /** - * @var string + * @var string|null */ private $value; @@ -32,14 +34,9 @@ class LoyaltyAccountMapping implements \JsonSerializable private $createdAt; /** - * @param string $type - * @param string $value + * @var string|null */ - public function __construct(string $type, string $value) - { - $this->type = $type; - $this->value = $value; - } + private $phoneNumber; /** * Returns Id. @@ -68,7 +65,7 @@ public function setId(?string $id): void * * The type of mapping. */ - public function getType(): string + public function getType(): ?string { return $this->type; } @@ -78,10 +75,9 @@ public function getType(): string * * The type of mapping. * - * @required * @maps type */ - public function setType(string $type): void + public function setType(?string $type): void { $this->type = $type; } @@ -89,9 +85,12 @@ public function setType(string $type): void /** * Returns Value. * - * The phone number, in E.164 format. For example, "+14155551111". + * The mapping value, which is used with `type` to represent a phone number mapping. The value can be a + * phone number in E.164 format. For example, "+14155551111". + * + * When specifying a mapping, the `phone_number` field is preferred to using `type` and `value`. */ - public function getValue(): string + public function getValue(): ?string { return $this->value; } @@ -99,12 +98,14 @@ public function getValue(): string /** * Sets Value. * - * The phone number, in E.164 format. For example, "+14155551111". + * The mapping value, which is used with `type` to represent a phone number mapping. The value can be a + * phone number in E.164 format. For example, "+14155551111". + * + * When specifying a mapping, the `phone_number` field is preferred to using `type` and `value`. * - * @required * @maps value */ - public function setValue(string $value): void + public function setValue(?string $value): void { $this->value = $value; } @@ -131,6 +132,32 @@ public function setCreatedAt(?string $createdAt): void $this->createdAt = $createdAt; } + /** + * Returns Phone Number. + * + * The phone number of the buyer, in E.164 format. For example, "+14155551111". + * + * When specifying a mapping, this `phone_number` field is preferred to using `type` and `value`. + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * Sets Phone Number. + * + * The phone number of the buyer, in E.164 format. For example, "+14155551111". + * + * When specifying a mapping, this `phone_number` field is preferred to using `type` and `value`. + * + * @maps phone_number + */ + public function setPhoneNumber(?string $phoneNumber): void + { + $this->phoneNumber = $phoneNumber; + } + /** * Encode this object to JSON * @@ -139,10 +166,11 @@ public function setCreatedAt(?string $createdAt): void public function jsonSerialize() { $json = []; - $json['id'] = $this->id; - $json['type'] = $this->type; - $json['value'] = $this->value; - $json['created_at'] = $this->createdAt; + $json['id'] = $this->id; + $json['type'] = $this->type; + $json['value'] = $this->value; + $json['created_at'] = $this->createdAt; + $json['phone_number'] = $this->phoneNumber; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/LoyaltyEvent.php b/src/Models/LoyaltyEvent.php index 8844dea3..28d87b6f 100644 --- a/src/Models/LoyaltyEvent.php +++ b/src/Models/LoyaltyEvent.php @@ -274,7 +274,7 @@ public function setAdjustPoints(?LoyaltyEventAdjustPoints $adjustPoints): void /** * Returns Loyalty Account Id. * - * The ID of the [loyalty account](#type-LoyaltyAccount) in which the event occurred. + * The ID of the [loyalty account]($m/LoyaltyAccount) in which the event occurred. */ public function getLoyaltyAccountId(): string { @@ -284,7 +284,7 @@ public function getLoyaltyAccountId(): string /** * Sets Loyalty Account Id. * - * The ID of the [loyalty account](#type-LoyaltyAccount) in which the event occurred. + * The ID of the [loyalty account]($m/LoyaltyAccount) in which the event occurred. * * @required * @maps loyalty_account_id @@ -297,7 +297,7 @@ public function setLoyaltyAccountId(string $loyaltyAccountId): void /** * Returns Location Id. * - * The ID of the [location](#type-Location) where the event occurred. + * The ID of the [location]($m/Location) where the event occurred. */ public function getLocationId(): ?string { @@ -307,7 +307,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The ID of the [location](#type-Location) where the event occurred. + * The ID of the [location]($m/Location) where the event occurred. * * @maps location_id */ diff --git a/src/Models/LoyaltyEventAccumulatePoints.php b/src/Models/LoyaltyEventAccumulatePoints.php index 2ca0be5b..6d089169 100644 --- a/src/Models/LoyaltyEventAccumulatePoints.php +++ b/src/Models/LoyaltyEventAccumulatePoints.php @@ -27,7 +27,7 @@ class LoyaltyEventAccumulatePoints implements \JsonSerializable /** * Returns Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): ?string { @@ -37,7 +37,7 @@ public function getLoyaltyProgramId(): ?string /** * Sets Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). * * @maps loyalty_program_id */ @@ -71,7 +71,7 @@ public function setPoints(?int $points): void /** * Returns Order Id. * - * The ID of the [order](#type-Order) for which the buyer accumulated the points. + * The ID of the [order]($m/Order) for which the buyer accumulated the points. * This field is returned only if the Orders API is used to process orders. */ public function getOrderId(): ?string @@ -82,7 +82,7 @@ public function getOrderId(): ?string /** * Sets Order Id. * - * The ID of the [order](#type-Order) for which the buyer accumulated the points. + * The ID of the [order]($m/Order) for which the buyer accumulated the points. * This field is returned only if the Orders API is used to process orders. * * @maps order_id diff --git a/src/Models/LoyaltyEventAdjustPoints.php b/src/Models/LoyaltyEventAdjustPoints.php index c8936f3d..f7297c12 100644 --- a/src/Models/LoyaltyEventAdjustPoints.php +++ b/src/Models/LoyaltyEventAdjustPoints.php @@ -35,7 +35,7 @@ public function __construct(int $points) /** * Returns Loyalty Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram). + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): ?string { @@ -45,7 +45,7 @@ public function getLoyaltyProgramId(): ?string /** * Sets Loyalty Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram). + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram). * * @maps loyalty_program_id */ diff --git a/src/Models/LoyaltyEventCreateReward.php b/src/Models/LoyaltyEventCreateReward.php index 2e45c2d5..fe02a7e9 100644 --- a/src/Models/LoyaltyEventCreateReward.php +++ b/src/Models/LoyaltyEventCreateReward.php @@ -37,7 +37,7 @@ public function __construct(string $loyaltyProgramId, int $points) /** * Returns Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): string { @@ -47,7 +47,7 @@ public function getLoyaltyProgramId(): string /** * Sets Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). * * @required * @maps loyalty_program_id @@ -60,7 +60,7 @@ public function setLoyaltyProgramId(string $loyaltyProgramId): void /** * Returns Reward Id. * - * The Square-assigned ID of the created [loyalty reward](#type-LoyaltyReward). + * The Square-assigned ID of the created [loyalty reward]($m/LoyaltyReward). * This field is returned only if the event source is `LOYALTY_API`. */ public function getRewardId(): ?string @@ -71,7 +71,7 @@ public function getRewardId(): ?string /** * Sets Reward Id. * - * The Square-assigned ID of the created [loyalty reward](#type-LoyaltyReward). + * The Square-assigned ID of the created [loyalty reward]($m/LoyaltyReward). * This field is returned only if the event source is `LOYALTY_API`. * * @maps reward_id diff --git a/src/Models/LoyaltyEventDeleteReward.php b/src/Models/LoyaltyEventDeleteReward.php index d37a5525..a80254fa 100644 --- a/src/Models/LoyaltyEventDeleteReward.php +++ b/src/Models/LoyaltyEventDeleteReward.php @@ -37,7 +37,7 @@ public function __construct(string $loyaltyProgramId, int $points) /** * Returns Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): string { @@ -47,7 +47,7 @@ public function getLoyaltyProgramId(): string /** * Sets Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). * * @required * @maps loyalty_program_id @@ -60,7 +60,7 @@ public function setLoyaltyProgramId(string $loyaltyProgramId): void /** * Returns Reward Id. * - * The ID of the deleted [loyalty reward](#type-LoyaltyReward). + * The ID of the deleted [loyalty reward]($m/LoyaltyReward). * This field is returned only if the event source is `LOYALTY_API`. */ public function getRewardId(): ?string @@ -71,7 +71,7 @@ public function getRewardId(): ?string /** * Sets Reward Id. * - * The ID of the deleted [loyalty reward](#type-LoyaltyReward). + * The ID of the deleted [loyalty reward]($m/LoyaltyReward). * This field is returned only if the event source is `LOYALTY_API`. * * @maps reward_id diff --git a/src/Models/LoyaltyEventExpirePoints.php b/src/Models/LoyaltyEventExpirePoints.php index cfae724c..fb8e40d6 100644 --- a/src/Models/LoyaltyEventExpirePoints.php +++ b/src/Models/LoyaltyEventExpirePoints.php @@ -32,7 +32,7 @@ public function __construct(string $loyaltyProgramId, int $points) /** * Returns Loyalty Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram). + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): string { @@ -42,7 +42,7 @@ public function getLoyaltyProgramId(): string /** * Sets Loyalty Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram). + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram). * * @required * @maps loyalty_program_id diff --git a/src/Models/LoyaltyEventLocationFilter.php b/src/Models/LoyaltyEventLocationFilter.php index 54933979..f076fb12 100644 --- a/src/Models/LoyaltyEventLocationFilter.php +++ b/src/Models/LoyaltyEventLocationFilter.php @@ -25,7 +25,7 @@ public function __construct(array $locationIds) /** * Returns Location Ids. * - * The [location](#type-Location) IDs for loyalty events to query. + * The [location]($m/Location) IDs for loyalty events to query. * If multiple values are specified, the endpoint uses * a logical OR to combine them. * @@ -39,7 +39,7 @@ public function getLocationIds(): array /** * Sets Location Ids. * - * The [location](#type-Location) IDs for loyalty events to query. + * The [location]($m/Location) IDs for loyalty events to query. * If multiple values are specified, the endpoint uses * a logical OR to combine them. * diff --git a/src/Models/LoyaltyEventLoyaltyAccountFilter.php b/src/Models/LoyaltyEventLoyaltyAccountFilter.php index 597ef7e6..28bbd068 100644 --- a/src/Models/LoyaltyEventLoyaltyAccountFilter.php +++ b/src/Models/LoyaltyEventLoyaltyAccountFilter.php @@ -25,7 +25,7 @@ public function __construct(string $loyaltyAccountId) /** * Returns Loyalty Account Id. * - * The ID of the [loyalty account](#type-LoyaltyAccount) associated with loyalty events. + * The ID of the [loyalty account]($m/LoyaltyAccount) associated with loyalty events. */ public function getLoyaltyAccountId(): string { @@ -35,7 +35,7 @@ public function getLoyaltyAccountId(): string /** * Sets Loyalty Account Id. * - * The ID of the [loyalty account](#type-LoyaltyAccount) associated with loyalty events. + * The ID of the [loyalty account]($m/LoyaltyAccount) associated with loyalty events. * * @required * @maps loyalty_account_id diff --git a/src/Models/LoyaltyEventOrderFilter.php b/src/Models/LoyaltyEventOrderFilter.php index 6b2fd785..0ae5558d 100644 --- a/src/Models/LoyaltyEventOrderFilter.php +++ b/src/Models/LoyaltyEventOrderFilter.php @@ -25,7 +25,7 @@ public function __construct(string $orderId) /** * Returns Order Id. * - * The ID of the [order](#type-Order) associated with the event. + * The ID of the [order]($m/Order) associated with the event. */ public function getOrderId(): string { @@ -35,7 +35,7 @@ public function getOrderId(): string /** * Sets Order Id. * - * The ID of the [order](#type-Order) associated with the event. + * The ID of the [order]($m/Order) associated with the event. * * @required * @maps order_id diff --git a/src/Models/LoyaltyEventOther.php b/src/Models/LoyaltyEventOther.php index 53ce1d48..e128aafd 100644 --- a/src/Models/LoyaltyEventOther.php +++ b/src/Models/LoyaltyEventOther.php @@ -32,7 +32,7 @@ public function __construct(string $loyaltyProgramId, int $points) /** * Returns Loyalty Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram). + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): string { @@ -42,7 +42,7 @@ public function getLoyaltyProgramId(): string /** * Sets Loyalty Program Id. * - * The Square-assigned ID of the [loyalty program](#type-LoyaltyProgram). + * The Square-assigned ID of the [loyalty program]($m/LoyaltyProgram). * * @required * @maps loyalty_program_id diff --git a/src/Models/LoyaltyEventRedeemReward.php b/src/Models/LoyaltyEventRedeemReward.php index 0d8f2da1..19d66c6c 100644 --- a/src/Models/LoyaltyEventRedeemReward.php +++ b/src/Models/LoyaltyEventRedeemReward.php @@ -35,7 +35,7 @@ public function __construct(string $loyaltyProgramId) /** * Returns Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). */ public function getLoyaltyProgramId(): string { @@ -45,7 +45,7 @@ public function getLoyaltyProgramId(): string /** * Sets Loyalty Program Id. * - * The ID of the [loyalty program](#type-LoyaltyProgram). + * The ID of the [loyalty program]($m/LoyaltyProgram). * * @required * @maps loyalty_program_id @@ -58,7 +58,7 @@ public function setLoyaltyProgramId(string $loyaltyProgramId): void /** * Returns Reward Id. * - * The ID of the redeemed [loyalty reward](#type-LoyaltyReward). + * The ID of the redeemed [loyalty reward]($m/LoyaltyReward). * This field is returned only if the event source is `LOYALTY_API`. */ public function getRewardId(): ?string @@ -69,7 +69,7 @@ public function getRewardId(): ?string /** * Sets Reward Id. * - * The ID of the redeemed [loyalty reward](#type-LoyaltyReward). + * The ID of the redeemed [loyalty reward]($m/LoyaltyReward). * This field is returned only if the event source is `LOYALTY_API`. * * @maps reward_id @@ -82,7 +82,7 @@ public function setRewardId(?string $rewardId): void /** * Returns Order Id. * - * The ID of the [order](#type-Order) that redeemed the reward. + * The ID of the [order]($m/Order) that redeemed the reward. * This field is returned only if the Orders API is used to process orders. */ public function getOrderId(): ?string @@ -93,7 +93,7 @@ public function getOrderId(): ?string /** * Sets Order Id. * - * The ID of the [order](#type-Order) that redeemed the reward. + * The ID of the [order]($m/Order) that redeemed the reward. * This field is returned only if the Orders API is used to process orders. * * @maps order_id diff --git a/src/Models/LoyaltyProgram.php b/src/Models/LoyaltyProgram.php index 6873ae97..acc4f85e 100644 --- a/src/Models/LoyaltyProgram.php +++ b/src/Models/LoyaltyProgram.php @@ -200,7 +200,7 @@ public function setTerminology(LoyaltyProgramTerminology $terminology): void /** * Returns Location Ids. * - * The [locations](#type-Location) at which the program is active. + * The [locations]($m/Location) at which the program is active. * * @return string[] */ @@ -212,7 +212,7 @@ public function getLocationIds(): array /** * Sets Location Ids. * - * The [locations](#type-Location) at which the program is active. + * The [locations]($m/Location) at which the program is active. * * @required * @maps location_ids diff --git a/src/Models/LoyaltyProgramAccrualRule.php b/src/Models/LoyaltyProgramAccrualRule.php index c4312248..bdc2de5b 100644 --- a/src/Models/LoyaltyProgramAccrualRule.php +++ b/src/Models/LoyaltyProgramAccrualRule.php @@ -160,8 +160,8 @@ public function setSpendAmountMoney(?Money $spendAmountMoney): void /** * Returns Catalog Object Id. * - * The ID of the [catalog object](#type-CatalogObject) to purchase to earn the number of points defined - * by the + * The ID of the [catalog object]($m/CatalogObject) to purchase to earn the number of points defined by + * the * rule. This is either an item variation or a category, depending on the type. This is defined on * `ITEM_VARIATION` rules and `CATEGORY` rules. */ @@ -173,8 +173,8 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The ID of the [catalog object](#type-CatalogObject) to purchase to earn the number of points defined - * by the + * The ID of the [catalog object]($m/CatalogObject) to purchase to earn the number of points defined by + * the * rule. This is either an item variation or a category, depending on the type. This is defined on * `ITEM_VARIATION` rules and `CATEGORY` rules. * diff --git a/src/Models/LoyaltyProgramRewardTier.php b/src/Models/LoyaltyProgramRewardTier.php index 3118c24e..dfee288e 100644 --- a/src/Models/LoyaltyProgramRewardTier.php +++ b/src/Models/LoyaltyProgramRewardTier.php @@ -5,7 +5,9 @@ namespace Square\Models; /** - * Describes a loyalty program reward tier. + * Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points + * for a reward, such as the number of points required and the value and scope of the discount. A + * loyalty program can offer multiple reward tiers. */ class LoyaltyProgramRewardTier implements \JsonSerializable { diff --git a/src/Models/LoyaltyReward.php b/src/Models/LoyaltyReward.php index 5463d645..7a1530cc 100644 --- a/src/Models/LoyaltyReward.php +++ b/src/Models/LoyaltyReward.php @@ -4,6 +4,12 @@ namespace Square\Models; +/** + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). + */ class LoyaltyReward implements \JsonSerializable { /** @@ -108,7 +114,7 @@ public function setStatus(?string $status): void /** * Returns Loyalty Account Id. * - * The Square-assigned ID of the [loyalty account](#type-LoyaltyAccount) to which the reward belongs. + * The Square-assigned ID of the [loyalty account]($m/LoyaltyAccount) to which the reward belongs. */ public function getLoyaltyAccountId(): string { @@ -118,7 +124,7 @@ public function getLoyaltyAccountId(): string /** * Sets Loyalty Account Id. * - * The Square-assigned ID of the [loyalty account](#type-LoyaltyAccount) to which the reward belongs. + * The Square-assigned ID of the [loyalty account]($m/LoyaltyAccount) to which the reward belongs. * * @required * @maps loyalty_account_id @@ -131,8 +137,7 @@ public function setLoyaltyAccountId(string $loyaltyAccountId): void /** * Returns Reward Tier Id. * - * The Square-assigned ID of the [reward tier](#type-LoyaltyProgramRewardTier) used to create the - * reward. + * The Square-assigned ID of the [reward tier]($m/LoyaltyProgramRewardTier) used to create the reward. */ public function getRewardTierId(): string { @@ -142,8 +147,7 @@ public function getRewardTierId(): string /** * Sets Reward Tier Id. * - * The Square-assigned ID of the [reward tier](#type-LoyaltyProgramRewardTier) used to create the - * reward. + * The Square-assigned ID of the [reward tier]($m/LoyaltyProgramRewardTier) used to create the reward. * * @required * @maps reward_tier_id @@ -178,7 +182,7 @@ public function setPoints(?int $points): void /** * Returns Order Id. * - * The Square-assigned ID of the [order](#type-Order) to which the reward is attached. + * The Square-assigned ID of the [order]($m/Order) to which the reward is attached. */ public function getOrderId(): ?string { @@ -188,7 +192,7 @@ public function getOrderId(): ?string /** * Sets Order Id. * - * The Square-assigned ID of the [order](#type-Order) to which the reward is attached. + * The Square-assigned ID of the [order]($m/Order) to which the reward is attached. * * @maps order_id */ diff --git a/src/Models/ObtainTokenRequest.php b/src/Models/ObtainTokenRequest.php index 5087dae1..7006a642 100644 --- a/src/Models/ObtainTokenRequest.php +++ b/src/Models/ObtainTokenRequest.php @@ -220,7 +220,7 @@ public function setRefreshToken(?string $refreshToken): void * `migration_token` to indicate that the application wants to get a replacement * OAuth access token. The response also returns a refresh token. * For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup. - * com/docs/authz/oauth/migration). + * com/docs/oauth-api/migrate-to-refresh-tokens). */ public function getMigrationToken(): ?string { @@ -235,7 +235,7 @@ public function getMigrationToken(): ?string * `migration_token` to indicate that the application wants to get a replacement * OAuth access token. The response also returns a refresh token. * For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup. - * com/docs/authz/oauth/migration). + * com/docs/oauth-api/migrate-to-refresh-tokens). * * @maps migration_token */ diff --git a/src/Models/ObtainTokenResponse.php b/src/Models/ObtainTokenResponse.php index 884ba641..5b6718b2 100644 --- a/src/Models/ObtainTokenResponse.php +++ b/src/Models/ObtainTokenResponse.php @@ -225,8 +225,8 @@ public function setIdToken(?string $idToken): void * Returns Refresh Token. * * A refresh token. OAuth refresh tokens are 64 bytes long. - * For more information, see [OAuth access token management](https://developer.squareup. - * com/docs/authz/oauth/how-it-works#oauth-access-token-management). + * For more information, see [OAuth access token management](https://developer.squareup.com/docs/oauth- + * api/how-it-works#oauth-access-token-management). */ public function getRefreshToken(): ?string { @@ -237,8 +237,8 @@ public function getRefreshToken(): ?string * Sets Refresh Token. * * A refresh token. OAuth refresh tokens are 64 bytes long. - * For more information, see [OAuth access token management](https://developer.squareup. - * com/docs/authz/oauth/how-it-works#oauth-access-token-management). + * For more information, see [OAuth access token management](https://developer.squareup.com/docs/oauth- + * api/how-it-works#oauth-access-token-management). * * @maps refresh_token */ diff --git a/src/Models/Order.php b/src/Models/Order.php index 7e74b639..3c3a0d28 100644 --- a/src/Models/Order.php +++ b/src/Models/Order.php @@ -261,7 +261,7 @@ public function setSource(?OrderSource $source): void /** * Returns Customer Id. * - * The [Customer](#type-customer) ID of the customer associated with the order. + * The [Customer]($m/Customer) ID of the customer associated with the order. */ public function getCustomerId(): ?string { @@ -271,7 +271,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The [Customer](#type-customer) ID of the customer associated with the order. + * The [Customer]($m/Customer) ID of the customer associated with the order. * * @maps customer_id */ @@ -707,7 +707,7 @@ public function setUpdatedAt(?string $updatedAt): void /** * Returns Closed At. * - * Timestamp for when the order reached a terminal [state](#property-state). In RFC 3339 format, e.g., + * Timestamp for when the order reached a terminal [state]($m/OrderState). In RFC 3339 format, e.g., * "2016-09-04T23:59:33.123Z". */ public function getClosedAt(): ?string @@ -718,7 +718,7 @@ public function getClosedAt(): ?string /** * Sets Closed At. * - * Timestamp for when the order reached a terminal [state](#property-state). In RFC 3339 format, e.g., + * Timestamp for when the order reached a terminal [state]($m/OrderState). In RFC 3339 format, e.g., * "2016-09-04T23:59:33.123Z". * * @maps closed_at @@ -958,7 +958,7 @@ public function setTotalServiceChargeMoney(?Money $totalServiceChargeMoney): voi * Pricing options for an order. The options affect how the order's price is calculated. * They can be used, for example, to apply automatic price adjustments that are based on pre- * configured - * [pricing rules](https://developer.squareup.com/docs/reference/square/objects/CatalogPricingRule). + * [pricing rules]($m/CatalogPricingRule). */ public function getPricingOptions(): ?OrderPricingOptions { @@ -971,7 +971,7 @@ public function getPricingOptions(): ?OrderPricingOptions * Pricing options for an order. The options affect how the order's price is calculated. * They can be used, for example, to apply automatic price adjustments that are based on pre- * configured - * [pricing rules](https://developer.squareup.com/docs/reference/square/objects/CatalogPricingRule). + * [pricing rules]($m/CatalogPricingRule). * * @maps pricing_options */ diff --git a/src/Models/OrderEntry.php b/src/Models/OrderEntry.php index 2cb32c11..735944e3 100644 --- a/src/Models/OrderEntry.php +++ b/src/Models/OrderEntry.php @@ -5,9 +5,8 @@ namespace Square\Models; /** - * A lightweight description of an [Order](#type-order) that is returned when `returned_entries` is - * true on a - * [SearchOrderRequest](#type-searchorderrequest) + * A lightweight description of an [Order]($m/Order) that is returned when + * `returned_entries` is true on a [SearchOrdersRequest]($e/Orders/SearchOrders) */ class OrderEntry implements \JsonSerializable { diff --git a/src/Models/OrderFulfillmentPickupDetails.php b/src/Models/OrderFulfillmentPickupDetails.php index 1c724b70..dcee4fab 100644 --- a/src/Models/OrderFulfillmentPickupDetails.php +++ b/src/Models/OrderFulfillmentPickupDetails.php @@ -124,11 +124,11 @@ public function setRecipient(?OrderFulfillmentRecipient $recipient): void /** * Returns Expires At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment - * will expire if it is not accepted. Must be in RFC 3339 format - * e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7 - * days in the future. If `expires_at` is not set, this pickup fulfillment - * will be automatically accepted when placed. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment will expire if it is not accepted. Must be in RFC 3339 format + * e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7 days in the future. + * If `expires_at` is not set, this pickup fulfillment will be automatically accepted when + * placed. */ public function getExpiresAt(): ?string { @@ -138,11 +138,11 @@ public function getExpiresAt(): ?string /** * Sets Expires At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment - * will expire if it is not accepted. Must be in RFC 3339 format - * e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7 - * days in the future. If `expires_at` is not set, this pickup fulfillment - * will be automatically accepted when placed. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment will expire if it is not accepted. Must be in RFC 3339 format + * e.g., "2016-09-04T23:59:33.123Z". Expiration time can only be set up to 7 days in the future. + * If `expires_at` is not set, this pickup fulfillment will be automatically accepted when + * placed. * * @maps expires_at */ @@ -206,8 +206,10 @@ public function setScheduleType(?string $scheduleType): void /** * Returns Pickup At. * - * The [timestamp](#workingwithdates) that represents the start of the pickup window. - * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * that represents the start of the pickup window. Must be in RFC3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". + * * For fulfillments with the schedule type `ASAP`, this is automatically set * to the current time plus the expected duration to prepare the fulfillment. */ @@ -219,8 +221,10 @@ public function getPickupAt(): ?string /** * Sets Pickup At. * - * The [timestamp](#workingwithdates) that represents the start of the pickup window. - * Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * that represents the start of the pickup window. Must be in RFC3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". + * * For fulfillments with the schedule type `ASAP`, this is automatically set * to the current time plus the expected duration to prepare the fulfillment. * @@ -308,8 +312,9 @@ public function setNote(?string $note): void /** * Returns Placed At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was placed. Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was placed. Must be in RFC3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". */ public function getPlacedAt(): ?string { @@ -319,8 +324,9 @@ public function getPlacedAt(): ?string /** * Sets Placed At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was placed. Must be in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was placed. Must be in RFC3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". * * @maps placed_at */ @@ -332,8 +338,8 @@ public function setPlacedAt(?string $placedAt): void /** * Returns Accepted At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was accepted. In RFC3339 timestamp format, + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was accepted. In RFC3339 timestamp format, * e.g., "2016-09-04T23:59:33.123Z". */ public function getAcceptedAt(): ?string @@ -344,8 +350,8 @@ public function getAcceptedAt(): ?string /** * Sets Accepted At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was accepted. In RFC3339 timestamp format, + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was accepted. In RFC3339 timestamp format, * e.g., "2016-09-04T23:59:33.123Z". * * @maps accepted_at @@ -358,8 +364,9 @@ public function setAcceptedAt(?string $acceptedAt): void /** * Returns Rejected At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was rejected. In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was rejected. In RFC3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". */ public function getRejectedAt(): ?string { @@ -369,8 +376,9 @@ public function getRejectedAt(): ?string /** * Sets Rejected At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was rejected. In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was rejected. In RFC3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". * * @maps rejected_at */ @@ -382,8 +390,9 @@ public function setRejectedAt(?string $rejectedAt): void /** * Returns Ready At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment is - * marked as ready for pickup. In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment is marked as ready for pickup. In RFC3339 timestamp format, + * e.g., "2016-09-04T23:59:33.123Z". */ public function getReadyAt(): ?string { @@ -393,8 +402,9 @@ public function getReadyAt(): ?string /** * Sets Ready At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment is - * marked as ready for pickup. In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment is marked as ready for pickup. In RFC3339 timestamp format, + * e.g., "2016-09-04T23:59:33.123Z". * * @maps ready_at */ @@ -406,7 +416,8 @@ public function setReadyAt(?string $readyAt): void /** * Returns Expired At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment expired. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when + * the fulfillment expired. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ public function getExpiredAt(): ?string @@ -417,7 +428,8 @@ public function getExpiredAt(): ?string /** * Sets Expired At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment expired. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when + * the fulfillment expired. * In RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". * * @maps expired_at @@ -430,8 +442,8 @@ public function setExpiredAt(?string $expiredAt): void /** * Returns Picked up At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was picked up by the recipient. In RFC3339 timestamp format, + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was picked up by the recipient. In RFC3339 timestamp format, * e.g., "2016-09-04T23:59:33.123Z". */ public function getPickedUpAt(): ?string @@ -442,8 +454,8 @@ public function getPickedUpAt(): ?string /** * Sets Picked up At. * - * The [timestamp](#workingwithdates) indicating when the fulfillment - * was picked up by the recipient. In RFC3339 timestamp format, + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment was picked up by the recipient. In RFC3339 timestamp format, * e.g., "2016-09-04T23:59:33.123Z". * * @maps picked_up_at @@ -456,8 +468,9 @@ public function setPickedUpAt(?string $pickedUpAt): void /** * Returns Canceled At. * - * The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", - * indicating when the fulfillment was canceled. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", indicating when the + * fulfillment was canceled. */ public function getCanceledAt(): ?string { @@ -467,8 +480,9 @@ public function getCanceledAt(): ?string /** * Sets Canceled At. * - * The [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", - * indicating when the fulfillment was canceled. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", indicating when the + * fulfillment was canceled. * * @maps canceled_at */ diff --git a/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php b/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php index f9cd1eca..d458b5b1 100644 --- a/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php +++ b/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php @@ -44,8 +44,9 @@ public function setCurbsideDetails(?string $curbsideDetails): void /** * Returns Buyer Arrived At. * - * The [timestamp](#workingwithdates) in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", - * indicating when the buyer arrived and is waiting for pickup. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", indicating when the buyer + * arrived and is waiting for pickup. */ public function getBuyerArrivedAt(): ?string { @@ -55,8 +56,9 @@ public function getBuyerArrivedAt(): ?string /** * Sets Buyer Arrived At. * - * The [timestamp](#workingwithdates) in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", - * indicating when the buyer arrived and is waiting for pickup. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z", indicating when the buyer + * arrived and is waiting for pickup. * * @maps buyer_arrived_at */ diff --git a/src/Models/OrderFulfillmentShipmentDetails.php b/src/Models/OrderFulfillmentShipmentDetails.php index f474f643..c1f4791e 100644 --- a/src/Models/OrderFulfillmentShipmentDetails.php +++ b/src/Models/OrderFulfillmentShipmentDetails.php @@ -223,8 +223,9 @@ public function setTrackingUrl(?string $trackingUrl): void /** * Returns Placed At. * - * The [timestamp](#workingwithdates) indicating when the shipment was - * requested. Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the shipment was requested. + * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ public function getPlacedAt(): ?string { @@ -234,8 +235,9 @@ public function getPlacedAt(): ?string /** * Sets Placed At. * - * The [timestamp](#workingwithdates) indicating when the shipment was - * requested. Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the shipment was requested. + * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". * * @maps placed_at */ @@ -247,8 +249,9 @@ public function setPlacedAt(?string $placedAt): void /** * Returns In Progress At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment was - * moved to the `RESERVED` state. Indicates that preparation of this shipment has begun. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment wasmoved to the `RESERVED` state. Indicates that preparation + * of this shipment has begun. * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ public function getInProgressAt(): ?string @@ -259,8 +262,9 @@ public function getInProgressAt(): ?string /** * Sets In Progress At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment was - * moved to the `RESERVED` state. Indicates that preparation of this shipment has begun. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment wasmoved to the `RESERVED` state. Indicates that preparation + * of this shipment has begun. * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". * * @maps in_progress_at @@ -273,7 +277,8 @@ public function setInProgressAt(?string $inProgressAt): void /** * Returns Packaged At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when + * this fulfillment * was moved to the `PREPARED` state. Indicates that the fulfillment is packaged. * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ @@ -285,7 +290,8 @@ public function getPackagedAt(): ?string /** * Sets Packaged At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when + * this fulfillment * was moved to the `PREPARED` state. Indicates that the fulfillment is packaged. * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". * @@ -299,9 +305,9 @@ public function setPackagedAt(?string $packagedAt): void /** * Returns Expected Shipped At. * - * The [timestamp](#workingwithdates) indicating when the shipment is - * expected to be delivered to the shipping carrier. Must be in RFC 3339 timestamp - * format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the shipment is expected to be delivered to the shipping carrier. Must be in + * RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ public function getExpectedShippedAt(): ?string { @@ -311,9 +317,9 @@ public function getExpectedShippedAt(): ?string /** * Sets Expected Shipped At. * - * The [timestamp](#workingwithdates) indicating when the shipment is - * expected to be delivered to the shipping carrier. Must be in RFC 3339 timestamp - * format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the shipment is expected to be delivered to the shipping carrier. Must be in + * RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". * * @maps expected_shipped_at */ @@ -325,9 +331,10 @@ public function setExpectedShippedAt(?string $expectedShippedAt): void /** * Returns Shipped At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment - * was moved to the `COMPLETED`state. Indicates that the fulfillment has been given - * to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment was moved to the `COMPLETED`state. Indicates that the fulfillment + * has been given to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". */ public function getShippedAt(): ?string { @@ -337,9 +344,10 @@ public function getShippedAt(): ?string /** * Sets Shipped At. * - * The [timestamp](#workingwithdates) indicating when this fulfillment - * was moved to the `COMPLETED`state. Indicates that the fulfillment has been given - * to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment was moved to the `COMPLETED`state. Indicates that the fulfillment + * has been given to the shipping carrier. Must be in RFC 3339 timestamp format, e.g., + * "2016-09-04T23:59:33.123Z". * * @maps shipped_at */ @@ -351,7 +359,8 @@ public function setShippedAt(?string $shippedAt): void /** * Returns Canceled At. * - * The [timestamp](#workingwithdates) indicating the shipment was canceled. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating the + * shipment was canceled. * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". */ public function getCanceledAt(): ?string @@ -362,7 +371,8 @@ public function getCanceledAt(): ?string /** * Sets Canceled At. * - * The [timestamp](#workingwithdates) indicating the shipment was canceled. + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating the + * shipment was canceled. * Must be in RFC 3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". * * @maps canceled_at @@ -397,7 +407,8 @@ public function setCancelReason(?string $cancelReason): void /** * Returns Failed At. * - * The [timestamp](#workingwithdates) indicating when the shipment + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when + * the shipment * failed to be completed. Must be in RFC 3339 timestamp format, e.g., * "2016-09-04T23:59:33.123Z". */ @@ -409,7 +420,8 @@ public function getFailedAt(): ?string /** * Sets Failed At. * - * The [timestamp](#workingwithdates) indicating when the shipment + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) indicating when + * the shipment * failed to be completed. Must be in RFC 3339 timestamp format, e.g., * "2016-09-04T23:59:33.123Z". * diff --git a/src/Models/OrderFulfillmentType.php b/src/Models/OrderFulfillmentType.php index 0efd8d64..0aa973e5 100644 --- a/src/Models/OrderFulfillmentType.php +++ b/src/Models/OrderFulfillmentType.php @@ -10,7 +10,7 @@ class OrderFulfillmentType { /** - * A fulfillment to be picked up from a physical [location](#type-location) + * A fulfillment to be picked up from a physical [location]($m/Location) * by a recipient. */ public const PICKUP = 'PICKUP'; diff --git a/src/Models/OrderLineItem.php b/src/Models/OrderLineItem.php index 8344438a..1459a41f 100644 --- a/src/Models/OrderLineItem.php +++ b/src/Models/OrderLineItem.php @@ -238,7 +238,7 @@ public function setNote(?string $note): void /** * Returns Catalog Object Id. * - * The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) id applied to this line item. */ public function getCatalogObjectId(): ?string { @@ -248,7 +248,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) id applied to this line item. * * @maps catalog_object_id */ @@ -299,7 +299,8 @@ public function setVariationName(?string $variationName): void * Entries written by applications are private and can only be read or modified by the same * application. * - * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. + * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more + * information. */ public function getMetadata(): ?array { @@ -326,7 +327,8 @@ public function getMetadata(): ?array * Entries written by applications are private and can only be read or modified by the same * application. * - * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. + * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more + * information. * * @maps metadata */ @@ -338,7 +340,7 @@ public function setMetadata(?array $metadata): void /** * Returns Modifiers. * - * The [CatalogModifier](#type-catalogmodifier)s applied to this line item. + * The [CatalogModifier]($m/CatalogModifier)s applied to this line item. * * @return OrderLineItemModifier[]|null */ @@ -350,7 +352,7 @@ public function getModifiers(): ?array /** * Sets Modifiers. * - * The [CatalogModifier](#type-catalogmodifier)s applied to this line item. + * The [CatalogModifier]($m/CatalogModifier)s applied to this line item. * * @maps modifiers * diff --git a/src/Models/OrderLineItemDiscount.php b/src/Models/OrderLineItemDiscount.php index 72e007f8..11426faa 100644 --- a/src/Models/OrderLineItemDiscount.php +++ b/src/Models/OrderLineItemDiscount.php @@ -94,7 +94,7 @@ public function setUid(?string $uid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogDiscount](#type-catalogdiscount). + * The catalog object id referencing [CatalogDiscount]($m/CatalogDiscount). */ public function getCatalogObjectId(): ?string { @@ -104,7 +104,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object id referencing [CatalogDiscount](#type-catalogdiscount). + * The catalog object id referencing [CatalogDiscount]($m/CatalogDiscount). * * @maps catalog_object_id */ @@ -273,7 +273,8 @@ public function setAppliedMoney(?Money $appliedMoney): void * Entries written by applications are private and can only be read or modified by the same * application. * - * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. + * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more + * information. */ public function getMetadata(): ?array { @@ -300,7 +301,8 @@ public function getMetadata(): ?array * Entries written by applications are private and can only be read or modified by the same * application. * - * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. + * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more + * information. * * @maps metadata */ @@ -368,10 +370,10 @@ public function setRewardIds(?array $rewardIds): void /** * Returns Pricing Rule Id. * - * The object identifier of a [pricing rule](#type-CatalogPricingRule) to be applied automatically - * to this discount. The specification and application of the discounts, to which a `pricing_rule_id` - * is - * assigned, are completely controlled by the corresponding pricing rule. + * The object identifier of a [pricing rule]($m/CatalogPricingRule) to be applied + * automatically to this discount. The specification and application of the discounts, to + * which a `pricing_rule_id` is assigned, are completely controlled by the corresponding + * pricing rule. */ public function getPricingRuleId(): ?string { @@ -381,10 +383,10 @@ public function getPricingRuleId(): ?string /** * Sets Pricing Rule Id. * - * The object identifier of a [pricing rule](#type-CatalogPricingRule) to be applied automatically - * to this discount. The specification and application of the discounts, to which a `pricing_rule_id` - * is - * assigned, are completely controlled by the corresponding pricing rule. + * The object identifier of a [pricing rule]($m/CatalogPricingRule) to be applied + * automatically to this discount. The specification and application of the discounts, to + * which a `pricing_rule_id` is assigned, are completely controlled by the corresponding + * pricing rule. * * @maps pricing_rule_id */ diff --git a/src/Models/OrderLineItemModifier.php b/src/Models/OrderLineItemModifier.php index ccc455c4..550a0f68 100644 --- a/src/Models/OrderLineItemModifier.php +++ b/src/Models/OrderLineItemModifier.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * A [CatalogModifier](#type-catalogmodifier). + * A [CatalogModifier]($m/CatalogModifier). */ class OrderLineItemModifier implements \JsonSerializable { @@ -59,7 +59,7 @@ public function setUid(?string $uid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogModifier](#type-catalogmodifier). + * The catalog object id referencing [CatalogModifier]($m/CatalogModifier). */ public function getCatalogObjectId(): ?string { @@ -69,7 +69,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object id referencing [CatalogModifier](#type-catalogmodifier). + * The catalog object id referencing [CatalogModifier]($m/CatalogModifier). * * @maps catalog_object_id */ diff --git a/src/Models/OrderLineItemTax.php b/src/Models/OrderLineItemTax.php index f9af44e0..67ba2f62 100644 --- a/src/Models/OrderLineItemTax.php +++ b/src/Models/OrderLineItemTax.php @@ -83,7 +83,7 @@ public function setUid(?string $uid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogTax](#type-catalogtax). + * The catalog object id referencing [CatalogTax]($m/CatalogTax). */ public function getCatalogObjectId(): ?string { @@ -93,7 +93,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object id referencing [CatalogTax](#type-catalogtax). + * The catalog object id referencing [CatalogTax]($m/CatalogTax). * * @maps catalog_object_id */ @@ -192,7 +192,8 @@ public function setPercentage(?string $percentage): void * Entries written by applications are private and can only be read or modified by the same * application. * - * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. + * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more + * information. */ public function getMetadata(): ?array { @@ -219,7 +220,8 @@ public function getMetadata(): ?array * Entries written by applications are private and can only be read or modified by the same * application. * - * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information. + * See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more + * information. * * @maps metadata */ diff --git a/src/Models/OrderPricingOptions.php b/src/Models/OrderPricingOptions.php index 1005cfc1..393b1393 100644 --- a/src/Models/OrderPricingOptions.php +++ b/src/Models/OrderPricingOptions.php @@ -8,7 +8,7 @@ * Pricing options for an order. The options affect how the order's price is calculated. * They can be used, for example, to apply automatic price adjustments that are based on pre- * configured - * [pricing rules](https://developer.squareup.com/docs/reference/square/objects/CatalogPricingRule). + * [pricing rules]($m/CatalogPricingRule). */ class OrderPricingOptions implements \JsonSerializable { diff --git a/src/Models/OrderReturnDiscount.php b/src/Models/OrderReturnDiscount.php index 63a544f6..73566abb 100644 --- a/src/Models/OrderReturnDiscount.php +++ b/src/Models/OrderReturnDiscount.php @@ -106,7 +106,7 @@ public function setSourceDiscountUid(?string $sourceDiscountUid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogDiscount](#type-catalogdiscount). + * The catalog object id referencing [CatalogDiscount]($m/CatalogDiscount). */ public function getCatalogObjectId(): ?string { @@ -116,7 +116,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object id referencing [CatalogDiscount](#type-catalogdiscount). + * The catalog object id referencing [CatalogDiscount]($m/CatalogDiscount). * * @maps catalog_object_id */ diff --git a/src/Models/OrderReturnLineItem.php b/src/Models/OrderReturnLineItem.php index 69f24038..9bc26f76 100644 --- a/src/Models/OrderReturnLineItem.php +++ b/src/Models/OrderReturnLineItem.php @@ -248,7 +248,7 @@ public function setNote(?string $note): void /** * Returns Catalog Object Id. * - * The [CatalogItemVariation](#type-catalogitemvariation) id applied to this returned line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) id applied to this returned line item. */ public function getCatalogObjectId(): ?string { @@ -258,7 +258,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The [CatalogItemVariation](#type-catalogitemvariation) id applied to this returned line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) id applied to this returned line item. * * @maps catalog_object_id */ @@ -292,7 +292,7 @@ public function setVariationName(?string $variationName): void /** * Returns Return Modifiers. * - * The [CatalogModifier](#type-catalogmodifier)s applied to this line item. + * The [CatalogModifier]($m/CatalogModifier)s applied to this line item. * * @return OrderReturnLineItemModifier[]|null */ @@ -304,7 +304,7 @@ public function getReturnModifiers(): ?array /** * Sets Return Modifiers. * - * The [CatalogModifier](#type-catalogmodifier)s applied to this line item. + * The [CatalogModifier]($m/CatalogModifier)s applied to this line item. * * @maps return_modifiers * diff --git a/src/Models/OrderReturnLineItemModifier.php b/src/Models/OrderReturnLineItemModifier.php index 55af508c..307e73ca 100644 --- a/src/Models/OrderReturnLineItemModifier.php +++ b/src/Models/OrderReturnLineItemModifier.php @@ -88,7 +88,7 @@ public function setSourceModifierUid(?string $sourceModifierUid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogModifier](#type-catalogmodifier). + * The catalog object id referencing [CatalogModifier]($m/CatalogModifier). */ public function getCatalogObjectId(): ?string { @@ -98,7 +98,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object id referencing [CatalogModifier](#type-catalogmodifier). + * The catalog object id referencing [CatalogModifier]($m/CatalogModifier). * * @maps catalog_object_id */ diff --git a/src/Models/OrderReturnServiceCharge.php b/src/Models/OrderReturnServiceCharge.php index 8de019b7..5b81ce5d 100644 --- a/src/Models/OrderReturnServiceCharge.php +++ b/src/Models/OrderReturnServiceCharge.php @@ -142,7 +142,7 @@ public function setName(?string $name): void /** * Returns Catalog Object Id. * - * The catalog object ID of the associated [CatalogServiceCharge](#type-catalogservicecharge). + * The catalog object ID of the associated [OrderServiceCharge]($m/OrderServiceCharge). */ public function getCatalogObjectId(): ?string { @@ -152,7 +152,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object ID of the associated [CatalogServiceCharge](#type-catalogservicecharge). + * The catalog object ID of the associated [OrderServiceCharge]($m/OrderServiceCharge). * * @maps catalog_object_id */ diff --git a/src/Models/OrderReturnTax.php b/src/Models/OrderReturnTax.php index c75f566f..643ea6d7 100644 --- a/src/Models/OrderReturnTax.php +++ b/src/Models/OrderReturnTax.php @@ -100,7 +100,7 @@ public function setSourceTaxUid(?string $sourceTaxUid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogTax](#type-catalogtax). + * The catalog object id referencing [CatalogTax]($m/CatalogTax). */ public function getCatalogObjectId(): ?string { @@ -110,7 +110,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object id referencing [CatalogTax](#type-catalogtax). + * The catalog object id referencing [CatalogTax]($m/CatalogTax). * * @maps catalog_object_id */ diff --git a/src/Models/OrderServiceCharge.php b/src/Models/OrderServiceCharge.php index 20677828..99a042f4 100644 --- a/src/Models/OrderServiceCharge.php +++ b/src/Models/OrderServiceCharge.php @@ -116,7 +116,7 @@ public function setName(?string $name): void /** * Returns Catalog Object Id. * - * The catalog object ID referencing the service charge [CatalogObject](#type-catalogobject). + * The catalog object ID referencing the service charge [CatalogObject]($m/CatalogObject). */ public function getCatalogObjectId(): ?string { @@ -126,7 +126,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The catalog object ID referencing the service charge [CatalogObject](#type-catalogobject). + * The catalog object ID referencing the service charge [CatalogObject]($m/CatalogObject). * * @maps catalog_object_id */ diff --git a/src/Models/PayOrderRequest.php b/src/Models/PayOrderRequest.php index 7b487b7f..61b08605 100644 --- a/src/Models/PayOrderRequest.php +++ b/src/Models/PayOrderRequest.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in requests to the - * [PayOrder](#endpoint-payorder) endpoint. + * [PayOrder]($e/Orders/PayOrder) endpoint. */ class PayOrderRequest implements \JsonSerializable { @@ -91,7 +91,7 @@ public function setOrderVersion(?int $orderVersion): void /** * Returns Payment Ids. * - * The IDs of the [payments](#type-payment) to collect. + * The IDs of the [payments]($m/Payment) to collect. * The payment total must match the order total. * * @return string[]|null @@ -104,7 +104,7 @@ public function getPaymentIds(): ?array /** * Sets Payment Ids. * - * The IDs of the [payments](#type-payment) to collect. + * The IDs of the [payments]($m/Payment) to collect. * The payment total must match the order total. * * @maps payment_ids diff --git a/src/Models/PayOrderResponse.php b/src/Models/PayOrderResponse.php index 9c808056..194fee8f 100644 --- a/src/Models/PayOrderResponse.php +++ b/src/Models/PayOrderResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of a request to the - * [PayOrder](#endpoint-payorder) endpoint. + * [PayOrder]($e/Orders/PayOrder) endpoint. */ class PayOrderResponse implements \JsonSerializable { diff --git a/src/Models/Payment.php b/src/Models/Payment.php index 4e1c72eb..8f6451f2 100644 --- a/src/Models/Payment.php +++ b/src/Models/Payment.php @@ -778,7 +778,7 @@ public function setReferenceId(?string $referenceId): void /** * Returns Customer Id. * - * The [Customer](#type-customer) ID of the customer associated with the payment. + * The [Customer]($m/Customer) ID of the customer associated with the payment. */ public function getCustomerId(): ?string { @@ -788,7 +788,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The [Customer](#type-customer) ID of the customer associated with the payment. + * The [Customer]($m/Customer) ID of the customer associated with the payment. * * @maps customer_id */ diff --git a/src/Models/PublishInvoiceRequest.php b/src/Models/PublishInvoiceRequest.php index 81ed4694..8e0cf638 100644 --- a/src/Models/PublishInvoiceRequest.php +++ b/src/Models/PublishInvoiceRequest.php @@ -30,9 +30,8 @@ public function __construct(int $version) /** * Returns Version. * - * The version of the [Invoice](#type-invoice) to publish. - * This must match the current version of the invoice, - * otherwise the request is rejected. + * The version of the [invoice]($m/Invoice) to publish. + * This must match the current version of the invoice; otherwise, the request is rejected. */ public function getVersion(): int { @@ -42,9 +41,8 @@ public function getVersion(): int /** * Sets Version. * - * The version of the [Invoice](#type-invoice) to publish. - * This must match the current version of the invoice, - * otherwise the request is rejected. + * The version of the [invoice]($m/Invoice) to publish. + * This must match the current version of the invoice; otherwise, the request is rejected. * * @required * @maps version diff --git a/src/Models/RedeemLoyaltyRewardRequest.php b/src/Models/RedeemLoyaltyRewardRequest.php index 34917e05..f2d5267a 100644 --- a/src/Models/RedeemLoyaltyRewardRequest.php +++ b/src/Models/RedeemLoyaltyRewardRequest.php @@ -57,7 +57,7 @@ public function setIdempotencyKey(string $idempotencyKey): void /** * Returns Location Id. * - * The ID of the [location](#type-Location) where the reward is redeemed. + * The ID of the [location]($m/Location) where the reward is redeemed. */ public function getLocationId(): string { @@ -67,7 +67,7 @@ public function getLocationId(): string /** * Sets Location Id. * - * The ID of the [location](#type-Location) where the reward is redeemed. + * The ID of the [location]($m/Location) where the reward is redeemed. * * @required * @maps location_id diff --git a/src/Models/RefundPaymentRequest.php b/src/Models/RefundPaymentRequest.php index f591d84a..d0f687ec 100644 --- a/src/Models/RefundPaymentRequest.php +++ b/src/Models/RefundPaymentRequest.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Describes a request to refund a payment using [RefundPayment](#endpoint-payments-refundpayment). + * Describes a request to refund a payment using [RefundPayment]($e/Refunds/RefundPayment). */ class RefundPaymentRequest implements \JsonSerializable { diff --git a/src/Models/RefundPaymentResponse.php b/src/Models/RefundPaymentResponse.php index 781a3bca..e37c961b 100644 --- a/src/Models/RefundPaymentResponse.php +++ b/src/Models/RefundPaymentResponse.php @@ -6,7 +6,7 @@ /** * Defines the response returned by - * [RefundPayment](#endpoint-payments-refundpayment). + * [RefundPayment]($e/Refunds/RefundPayment). * * If there are errors processing the request, the `refund` field might not be * present, or it might be present with a status of `FAILED`. diff --git a/src/Models/RegisterDomainRequest.php b/src/Models/RegisterDomainRequest.php index e0d0facc..a9c98256 100644 --- a/src/Models/RegisterDomainRequest.php +++ b/src/Models/RegisterDomainRequest.php @@ -6,7 +6,7 @@ /** * Defines the parameters that can be included in the body of - * a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. + * a request to the [RegisterDomain]($e/ApplePay/RegisterDomain) endpoint. */ class RegisterDomainRequest implements \JsonSerializable { @@ -26,7 +26,7 @@ public function __construct(string $domainName) /** * Returns Domain Name. * - * A domain name as described in RFC-1034 that will be registered with ApplePay + * A domain name as described in RFC-1034 that will be registered with ApplePay. */ public function getDomainName(): string { @@ -36,7 +36,7 @@ public function getDomainName(): string /** * Sets Domain Name. * - * A domain name as described in RFC-1034 that will be registered with ApplePay + * A domain name as described in RFC-1034 that will be registered with ApplePay. * * @required * @maps domain_name diff --git a/src/Models/RegisterDomainResponse.php b/src/Models/RegisterDomainResponse.php index 28fed20e..c699c59e 100644 --- a/src/Models/RegisterDomainResponse.php +++ b/src/Models/RegisterDomainResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [RegisterDomain](#endpoint-registerdomain) endpoint. + * a request to the [RegisterDomain]($e/ApplePay/RegisterDomain) endpoint. * * Either `errors` or `status` are present in a given response (never both). */ diff --git a/src/Models/RemoveGroupFromCustomerResponse.php b/src/Models/RemoveGroupFromCustomerResponse.php index 183a8898..b671150e 100644 --- a/src/Models/RemoveGroupFromCustomerResponse.php +++ b/src/Models/RemoveGroupFromCustomerResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [RemoveGroupFromCustomer](#endpoint-removegroupfromcustomer) + * a request to the [RemoveGroupFromCustomer]($e/Customers/RemoveGroupFromCustomer) * endpoint. */ class RemoveGroupFromCustomerResponse implements \JsonSerializable diff --git a/src/Models/ResumeSubscriptionResponse.php b/src/Models/ResumeSubscriptionResponse.php new file mode 100644 index 00000000..b4f28c83 --- /dev/null +++ b/src/Models/ResumeSubscriptionResponse.php @@ -0,0 +1,93 @@ +errors; + } + + /** + * Sets Errors. + * + * Information about errors encountered during the request. + * + * @maps errors + * + * @param Error[]|null $errors + */ + public function setErrors(?array $errors): void + { + $this->errors = $errors; + } + + /** + * Returns Subscription. + * + * Represents a customer subscription to a subscription plan. + * For an overview of the `Subscription` type, see + * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- + * object-overview). + */ + public function getSubscription(): ?Subscription + { + return $this->subscription; + } + + /** + * Sets Subscription. + * + * Represents a customer subscription to a subscription plan. + * For an overview of the `Subscription` type, see + * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- + * object-overview). + * + * @maps subscription + */ + public function setSubscription(?Subscription $subscription): void + { + $this->subscription = $subscription; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['errors'] = $this->errors; + $json['subscription'] = $this->subscription; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/RetrieveCatalogObjectRequest.php b/src/Models/RetrieveCatalogObjectRequest.php index 6a00d5c5..86dc4c56 100644 --- a/src/Models/RetrieveCatalogObjectRequest.php +++ b/src/Models/RetrieveCatalogObjectRequest.php @@ -61,7 +61,7 @@ public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void * * Requests objects as of a specific version of the catalog. This allows you to retrieve historical * versions of objects. The value to retrieve a specific version of an object can be found - * in the version field of [CatalogObject](#type-catalogobject)s. + * in the version field of [CatalogObject]($m/CatalogObject)s. */ public function getCatalogVersion(): ?int { @@ -73,7 +73,7 @@ public function getCatalogVersion(): ?int * * Requests objects as of a specific version of the catalog. This allows you to retrieve historical * versions of objects. The value to retrieve a specific version of an object can be found - * in the version field of [CatalogObject](#type-catalogobject)s. + * in the version field of [CatalogObject]($m/CatalogObject)s. * * @maps catalog_version */ diff --git a/src/Models/RetrieveCustomerGroupResponse.php b/src/Models/RetrieveCustomerGroupResponse.php index a0a896a2..e194e604 100644 --- a/src/Models/RetrieveCustomerGroupResponse.php +++ b/src/Models/RetrieveCustomerGroupResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the [RetrieveCustomerGroup](#endpoint-retrievecustomergroup) endpoint. + * a request to the [RetrieveCustomerGroup]($e/CustomerGroups/RetrieveCustomerGroup) endpoint. * - * One of `errors` or `group` is present in a given response (never both). + * Either `errors` or `group` is present in a given response (never both). */ class RetrieveCustomerGroupResponse implements \JsonSerializable { @@ -53,8 +53,8 @@ public function setErrors(?array $errors): void * * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. */ public function getGroup(): ?CustomerGroup { @@ -66,8 +66,8 @@ public function getGroup(): ?CustomerGroup * * Represents a group of customer profiles. * - * Customer groups can be created, modified, and have their membership defined either via - * the Customers API or within Customer Directory in the Square Dashboard or Point of Sale. + * Customer groups can be created, be modified, and have their membership defined using + * the Customers API or within the Customer Directory in the Square Seller Dashboard or Point of Sale. * * @maps group */ diff --git a/src/Models/RetrieveCustomerResponse.php b/src/Models/RetrieveCustomerResponse.php index 2bb7d033..249fc719 100644 --- a/src/Models/RetrieveCustomerResponse.php +++ b/src/Models/RetrieveCustomerResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the RetrieveCustomer endpoint. + * a request to the `RetrieveCustomer` endpoint. * - * One of `errors` or `customer` is present in a given response (never both). + * Either `errors` or `customer` is present in a given response (never both). */ class RetrieveCustomerResponse implements \JsonSerializable { diff --git a/src/Models/RetrieveCustomerSegmentResponse.php b/src/Models/RetrieveCustomerSegmentResponse.php index d965e13b..74e05ed2 100644 --- a/src/Models/RetrieveCustomerSegmentResponse.php +++ b/src/Models/RetrieveCustomerSegmentResponse.php @@ -5,9 +5,10 @@ namespace Square\Models; /** - * Defines the fields included in the response body for requests to __RetrieveCustomerSegment__. + * Defines the fields that are included in the response body for requests to the + * `RetrieveCustomerSegment` endpoint. * - * One of `errors` or `segment` is present in a given response (never both). + * Either `errors` or `segment` is present in a given response (never both). */ class RetrieveCustomerSegmentResponse implements \JsonSerializable { @@ -52,8 +53,8 @@ public function setErrors(?array $errors): void * * Represents a group of customer profiles that match one or more predefined filter criteria. * - * Segments (also known as Smart Groups) are defined and created within Customer Directory in the - * Square Dashboard or Point of Sale. + * Segments (also known as Smart Groups) are defined and created within the Customer Directory in the + * Square Seller Dashboard or Point of Sale. */ public function getSegment(): ?CustomerSegment { @@ -65,8 +66,8 @@ public function getSegment(): ?CustomerSegment * * Represents a group of customer profiles that match one or more predefined filter criteria. * - * Segments (also known as Smart Groups) are defined and created within Customer Directory in the - * Square Dashboard or Point of Sale. + * Segments (also known as Smart Groups) are defined and created within the Customer Directory in the + * Square Seller Dashboard or Point of Sale. * * @maps segment */ diff --git a/src/Models/RetrieveInventoryChangesRequest.php b/src/Models/RetrieveInventoryChangesRequest.php index cfb30939..9a0515b7 100644 --- a/src/Models/RetrieveInventoryChangesRequest.php +++ b/src/Models/RetrieveInventoryChangesRequest.php @@ -19,7 +19,7 @@ class RetrieveInventoryChangesRequest implements \JsonSerializable /** * Returns Location Ids. * - * The [Location](#type-location) IDs to look up as a comma-separated + * The [Location]($m/Location) IDs to look up as a comma-separated * list. An empty list queries all locations. */ public function getLocationIds(): ?string @@ -30,7 +30,7 @@ public function getLocationIds(): ?string /** * Sets Location Ids. * - * The [Location](#type-location) IDs to look up as a comma-separated + * The [Location]($m/Location) IDs to look up as a comma-separated * list. An empty list queries all locations. * * @maps location_ids diff --git a/src/Models/RetrieveInventoryCountRequest.php b/src/Models/RetrieveInventoryCountRequest.php index 2a12c462..1bae03a6 100644 --- a/src/Models/RetrieveInventoryCountRequest.php +++ b/src/Models/RetrieveInventoryCountRequest.php @@ -19,7 +19,7 @@ class RetrieveInventoryCountRequest implements \JsonSerializable /** * Returns Location Ids. * - * The [Location](#type-location) IDs to look up as a comma-separated + * The [Location]($m/Location) IDs to look up as a comma-separated * list. An empty list queries all locations. */ public function getLocationIds(): ?string @@ -30,7 +30,7 @@ public function getLocationIds(): ?string /** * Sets Location Ids. * - * The [Location](#type-location) IDs to look up as a comma-separated + * The [Location]($m/Location) IDs to look up as a comma-separated * list. An empty list queries all locations. * * @maps location_ids diff --git a/src/Models/RetrieveLocationResponse.php b/src/Models/RetrieveLocationResponse.php index 0fc8aec2..6bc0f736 100644 --- a/src/Models/RetrieveLocationResponse.php +++ b/src/Models/RetrieveLocationResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that the - * [RetrieveLocation](#endpoint-retrievelocation) endpoint returns + * [RetrieveLocation]($e/Locations/RetrieveLocation) endpoint returns * in a response. */ class RetrieveLocationResponse implements \JsonSerializable diff --git a/src/Models/OnboardAppointmentsResponse.php b/src/Models/RetrieveLoyaltyProgramResponse.php similarity index 59% rename from src/Models/OnboardAppointmentsResponse.php rename to src/Models/RetrieveLoyaltyProgramResponse.php index 5565aeaf..5c368bed 100644 --- a/src/Models/OnboardAppointmentsResponse.php +++ b/src/Models/RetrieveLoyaltyProgramResponse.php @@ -4,13 +4,21 @@ namespace Square\Models; -class OnboardAppointmentsResponse implements \JsonSerializable +/** + * A response that contains the loyalty program. + */ +class RetrieveLoyaltyProgramResponse implements \JsonSerializable { /** * @var Error[]|null */ private $errors; + /** + * @var LoyaltyProgram|null + */ + private $program; + /** * Returns Errors. * @@ -37,6 +45,24 @@ public function setErrors(?array $errors): void $this->errors = $errors; } + /** + * Returns Program. + */ + public function getProgram(): ?LoyaltyProgram + { + return $this->program; + } + + /** + * Sets Program. + * + * @maps program + */ + public function setProgram(?LoyaltyProgram $program): void + { + $this->program = $program; + } + /** * Encode this object to JSON * @@ -45,7 +71,8 @@ public function setErrors(?array $errors): void public function jsonSerialize() { $json = []; - $json['errors'] = $this->errors; + $json['errors'] = $this->errors; + $json['program'] = $this->program; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/RetrieveLoyaltyRewardResponse.php b/src/Models/RetrieveLoyaltyRewardResponse.php index 99bc3b11..9808bdae 100644 --- a/src/Models/RetrieveLoyaltyRewardResponse.php +++ b/src/Models/RetrieveLoyaltyRewardResponse.php @@ -47,6 +47,11 @@ public function setErrors(?array $errors): void /** * Returns Reward. + * + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). */ public function getReward(): ?LoyaltyReward { @@ -56,6 +61,11 @@ public function getReward(): ?LoyaltyReward /** * Sets Reward. * + * Represents a contract to redeem loyalty points for a [reward tier]($m/LoyaltyProgramRewardTier) + * discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. For more information, see + * [Redeem loyalty rewards](https://developer.squareup.com/docs/loyalty-api/overview#redeem-loyalty- + * rewards). + * * @maps reward */ public function setReward(?LoyaltyReward $reward): void diff --git a/src/Models/RetrieveMerchantResponse.php b/src/Models/RetrieveMerchantResponse.php index 8d2a85a0..00c5e67b 100644 --- a/src/Models/RetrieveMerchantResponse.php +++ b/src/Models/RetrieveMerchantResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * The response object returned by the [RetrieveMerchant](#endpoint-retrieveMerchant) endpoint. + * The response object returned by the [RetrieveMerchant]($e/Merchants/RetrieveMerchant) endpoint. */ class RetrieveMerchantResponse implements \JsonSerializable { diff --git a/src/Models/RetrieveObsMigrationProfileResponse.php b/src/Models/RetrieveObsMigrationProfileResponse.php deleted file mode 100644 index c0ad929e..00000000 --- a/src/Models/RetrieveObsMigrationProfileResponse.php +++ /dev/null @@ -1,166 +0,0 @@ -bannerEnabled; - } - - /** - * Sets Banner Enabled. - * - * Indicates whether the seller has enabled the COVID banner (`true`) or not (`false`). - * - * @maps banner_enabled - */ - public function setBannerEnabled(?bool $bannerEnabled): void - { - $this->bannerEnabled = $bannerEnabled; - } - - /** - * Returns Banner Text. - * - * The text appearing on the COVID banner. - */ - public function getBannerText(): ?string - { - return $this->bannerText; - } - - /** - * Sets Banner Text. - * - * The text appearing on the COVID banner. - * - * @maps banner_text - */ - public function setBannerText(?string $bannerText): void - { - $this->bannerText = $bannerText; - } - - /** - * Returns Banner Cta Text. - * - * The text of the label of the CTA button beneath the banner. - */ - public function getBannerCtaText(): ?string - { - return $this->bannerCtaText; - } - - /** - * Sets Banner Cta Text. - * - * The text of the label of the CTA button beneath the banner. - * - * @maps banner_cta_text - */ - public function setBannerCtaText(?string $bannerCtaText): void - { - $this->bannerCtaText = $bannerCtaText; - } - - /** - * Returns Banner Cta Url. - * - * The URL to link to when the CTA button is clicked. - */ - public function getBannerCtaUrl(): ?string - { - return $this->bannerCtaUrl; - } - - /** - * Sets Banner Cta Url. - * - * The URL to link to when the CTA button is clicked. - * - * @maps banner_cta_url - */ - public function setBannerCtaUrl(?string $bannerCtaUrl): void - { - $this->bannerCtaUrl = $bannerCtaUrl; - } - - /** - * Returns Errors. - * - * Any errors that occurred during the request. - * - * @return Error[]|null - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * Sets Errors. - * - * Any errors that occurred during the request. - * - * @maps errors - * - * @param Error[]|null $errors - */ - public function setErrors(?array $errors): void - { - $this->errors = $errors; - } - - /** - * Encode this object to JSON - * - * @return mixed - */ - public function jsonSerialize() - { - $json = []; - $json['banner_enabled'] = $this->bannerEnabled; - $json['banner_text'] = $this->bannerText; - $json['banner_cta_text'] = $this->bannerCtaText; - $json['banner_cta_url'] = $this->bannerCtaUrl; - $json['errors'] = $this->errors; - - return array_filter($json, function ($val) { - return $val !== null; - }); - } -} diff --git a/src/Models/RetrieveSubscriptionResponse.php b/src/Models/RetrieveSubscriptionResponse.php index 5e42a583..369fa6f3 100644 --- a/src/Models/RetrieveSubscriptionResponse.php +++ b/src/Models/RetrieveSubscriptionResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response from the - * [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint. + * [RetrieveSubscription]($e/Subscriptions/RetrieveSubscription) endpoint. */ class RetrieveSubscriptionResponse implements \JsonSerializable { diff --git a/src/Models/RetrieveTransactionResponse.php b/src/Models/RetrieveTransactionResponse.php index 3e41c2e1..ea6c3301 100644 --- a/src/Models/RetrieveTransactionResponse.php +++ b/src/Models/RetrieveTransactionResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [RetrieveTransaction](#endpont-retrievetransaction) endpoint. + * a request to the [RetrieveTransaction]($e/Transactions/RetrieveTransaction) endpoint. * * One of `errors` or `transaction` is present in a given response (never both). */ diff --git a/src/Models/SearchCatalogItemsRequest.php b/src/Models/SearchCatalogItemsRequest.php index c6b04f3d..fc63bbb6 100644 --- a/src/Models/SearchCatalogItemsRequest.php +++ b/src/Models/SearchCatalogItemsRequest.php @@ -5,8 +5,7 @@ namespace Square\Models; /** - * Defines the request body for the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) - * endpoint. + * Defines the request body for the [SearchCatalogItems]($e/Catalog/SearchCatalogItems) endpoint. */ class SearchCatalogItemsRequest implements \JsonSerializable { @@ -266,7 +265,7 @@ public function setProductTypes(?array $productTypes): void * * The customer-attribute filter to return items or item variations matching the specified * custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in - * a single call to the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. + * a single call to the [SearchCatalogItems]($e/Catalog/SearchCatalogItems) endpoint. * * @return CustomAttributeFilter[]|null */ @@ -280,7 +279,7 @@ public function getCustomAttributeFilters(): ?array * * The customer-attribute filter to return items or item variations matching the specified * custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in - * a single call to the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. + * a single call to the [SearchCatalogItems]($e/Catalog/SearchCatalogItems) endpoint. * * @maps custom_attribute_filters * diff --git a/src/Models/SearchCatalogItemsResponse.php b/src/Models/SearchCatalogItemsResponse.php index 7de21468..dd31239c 100644 --- a/src/Models/SearchCatalogItemsResponse.php +++ b/src/Models/SearchCatalogItemsResponse.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Defines the response body returned from the [SearchCatalogItems](#endpoint-Catalog- - * SearchCatalogItems) endpoint. + * Defines the response body returned from the [SearchCatalogItems]($e/Catalog/SearchCatalogItems) + * endpoint. */ class SearchCatalogItemsResponse implements \JsonSerializable { diff --git a/src/Models/SearchCatalogObjectsRequest.php b/src/Models/SearchCatalogObjectsRequest.php index cb3d5e2e..375ab26d 100644 --- a/src/Models/SearchCatalogObjectsRequest.php +++ b/src/Models/SearchCatalogObjectsRequest.php @@ -192,13 +192,13 @@ public function setBeginTime(?string $beginTime): void * when calling the `SearchCatalogObjects` endpoint. * * Although a query can have multiple filters, only certain query types can be combined per call to - * [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects). + * [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects). * Any combination of the following types may be used together: - * - [exact_query](#type-CatalogExactQuery) - * - [prefix_query](#type-CatalogPrefixQuery) - * - [range_query](#type-CatalogRangeQuery) - * - [sorted_attribute_query](#type-CatalogSortedAttribute) - * - [text_query](#type-CatalogTextQuery) + * - [exact_query]($m/CatalogQueryExact) + * - [prefix_query]($m/CatalogQueryPrefix) + * - [range_query]($m/CatalogQueryRange) + * - [sorted_attribute_query]($m/CatalogQuerySortedAttribute) + * - [text_query]($m/CatalogQueryText) * All other query types cannot be combined with any others. * * When a query filter is based on an attribute, the attribute must be searchable. @@ -215,8 +215,8 @@ public function setBeginTime(?string $beginTime): void * - `caption`: `CatalogImage` * - `display_name`: `CatalogItemOption` * - * For example, to search for [CatalogItem](#type-CatalogItem) objects by searchable attributes, you - * can use + * For example, to search for [CatalogItem]($m/CatalogItem) objects by searchable attributes, you can + * use * the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. */ public function getQuery(): ?CatalogQuery @@ -231,13 +231,13 @@ public function getQuery(): ?CatalogQuery * when calling the `SearchCatalogObjects` endpoint. * * Although a query can have multiple filters, only certain query types can be combined per call to - * [SearchCatalogObjects](#endpoint-Catalog-SearchCatalogObjects). + * [SearchCatalogObjects]($e/Catalog/SearchCatalogObjects). * Any combination of the following types may be used together: - * - [exact_query](#type-CatalogExactQuery) - * - [prefix_query](#type-CatalogPrefixQuery) - * - [range_query](#type-CatalogRangeQuery) - * - [sorted_attribute_query](#type-CatalogSortedAttribute) - * - [text_query](#type-CatalogTextQuery) + * - [exact_query]($m/CatalogQueryExact) + * - [prefix_query]($m/CatalogQueryPrefix) + * - [range_query]($m/CatalogQueryRange) + * - [sorted_attribute_query]($m/CatalogQuerySortedAttribute) + * - [text_query]($m/CatalogQueryText) * All other query types cannot be combined with any others. * * When a query filter is based on an attribute, the attribute must be searchable. @@ -254,8 +254,8 @@ public function getQuery(): ?CatalogQuery * - `caption`: `CatalogImage` * - `display_name`: `CatalogItemOption` * - * For example, to search for [CatalogItem](#type-CatalogItem) objects by searchable attributes, you - * can use + * For example, to search for [CatalogItem]($m/CatalogItem) objects by searchable attributes, you can + * use * the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. * * @maps query diff --git a/src/Models/SearchCustomersRequest.php b/src/Models/SearchCustomersRequest.php index bd9a9df6..50e1033c 100644 --- a/src/Models/SearchCustomersRequest.php +++ b/src/Models/SearchCustomersRequest.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Defines the fields included in the request body for the - * SearchCustomers endpoint. + * Defines the fields that are included in the request body of a request to the + * `SearchCustomers` endpoint. */ class SearchCustomersRequest implements \JsonSerializable { @@ -31,8 +31,8 @@ class SearchCustomersRequest implements \JsonSerializable * Include the pagination cursor in subsequent calls to this endpoint to retrieve * the next set of results associated with the original query. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -45,8 +45,8 @@ public function getCursor(): ?string * Include the pagination cursor in subsequent calls to this endpoint to retrieve * the next set of results associated with the original query. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ @@ -59,9 +59,9 @@ public function setCursor(?string $cursor): void * Returns Limit. * * A limit on the number of results to be returned in a single page. - * The limit is advisory - the implementation may return more or fewer results. - * If the supplied limit is negative, zero, or is higher than the maximum limit - * of 100, it will be ignored. + * The limit is advisory. The implementation might return more or fewer results. + * If the supplied limit is negative, zero, or higher than the maximum limit + * of 100, it is ignored. */ public function getLimit(): ?int { @@ -72,9 +72,9 @@ public function getLimit(): ?int * Sets Limit. * * A limit on the number of results to be returned in a single page. - * The limit is advisory - the implementation may return more or fewer results. - * If the supplied limit is negative, zero, or is higher than the maximum limit - * of 100, it will be ignored. + * The limit is advisory. The implementation might return more or fewer results. + * If the supplied limit is negative, zero, or higher than the maximum limit + * of 100, it is ignored. * * @maps limit */ diff --git a/src/Models/SearchCustomersResponse.php b/src/Models/SearchCustomersResponse.php index 96b1fcff..c1899af6 100644 --- a/src/Models/SearchCustomersResponse.php +++ b/src/Models/SearchCustomersResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the SearchCustomers endpoint. + * a request to the `SearchCustomers` endpoint. * - * One of `errors` or `customers` is present in a given response (never both). + * Either `errors` or `customers` is present in a given response (never both). */ class SearchCustomersResponse implements \JsonSerializable { @@ -83,12 +83,12 @@ public function setCustomers(?array $customers): void * Returns Cursor. * * A pagination cursor that can be used during subsequent calls - * to SearchCustomers to retrieve the next set of results associated + * to `SearchCustomers` to retrieve the next set of results associated * with the original query. Pagination cursors are only present when * a request succeeds and additional results are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). */ public function getCursor(): ?string { @@ -99,12 +99,12 @@ public function getCursor(): ?string * Sets Cursor. * * A pagination cursor that can be used during subsequent calls - * to SearchCustomers to retrieve the next set of results associated + * to `SearchCustomers` to retrieve the next set of results associated * with the original query. Pagination cursors are only present when * a request succeeds and additional results are available. * - * See the [Pagination guide](https://developer.squareup.com/docs/working-with-apis/pagination) for - * more information. + * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- + * apis/pagination). * * @maps cursor */ diff --git a/src/Models/SearchInvoicesRequest.php b/src/Models/SearchInvoicesRequest.php index be3970e9..162dd856 100644 --- a/src/Models/SearchInvoicesRequest.php +++ b/src/Models/SearchInvoicesRequest.php @@ -59,8 +59,7 @@ public function setQuery(InvoiceQuery $query): void * Returns Limit. * * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server - * uses a default limit of 100 invoices. + * If not provided, the server uses a default limit of 100 invoices. */ public function getLimit(): ?int { @@ -71,8 +70,7 @@ public function getLimit(): ?int * Sets Limit. * * The maximum number of invoices to return (200 is the maximum `limit`). - * If not provided, the server - * uses a default limit of 100 invoices. + * If not provided, the server uses a default limit of 100 invoices. * * @maps limit */ diff --git a/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php b/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php index ad3357dc..f853c1a5 100644 --- a/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php +++ b/src/Models/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.php @@ -30,7 +30,7 @@ public function __construct(string $loyaltyAccountId) /** * Returns Loyalty Account Id. * - * The ID of the [loyalty account](#type-LoyaltyAccount) to which the loyalty reward belongs. + * The ID of the [loyalty account]($m/LoyaltyAccount) to which the loyalty reward belongs. */ public function getLoyaltyAccountId(): string { @@ -40,7 +40,7 @@ public function getLoyaltyAccountId(): string /** * Sets Loyalty Account Id. * - * The ID of the [loyalty account](#type-LoyaltyAccount) to which the loyalty reward belongs. + * The ID of the [loyalty account]($m/LoyaltyAccount) to which the loyalty reward belongs. * * @required * @maps loyalty_account_id diff --git a/src/Models/SearchOrdersCustomerFilter.php b/src/Models/SearchOrdersCustomerFilter.php index fc4cfe4f..0a8ce949 100644 --- a/src/Models/SearchOrdersCustomerFilter.php +++ b/src/Models/SearchOrdersCustomerFilter.php @@ -7,7 +7,7 @@ /** * Filter based on Order `customer_id` and any Tender `customer_id` * associated with the Order. Does not filter based on the - * [FulfillmentRecipient](#type-orderfulfillmentrecipient) `customer_id`. + * [FulfillmentRecipient]($m/OrderFulfillmentRecipient) `customer_id`. */ class SearchOrdersCustomerFilter implements \JsonSerializable { diff --git a/src/Models/SearchOrdersDateTimeFilter.php b/src/Models/SearchOrdersDateTimeFilter.php index e341bc91..b9bd6f04 100644 --- a/src/Models/SearchOrdersDateTimeFilter.php +++ b/src/Models/SearchOrdersDateTimeFilter.php @@ -14,7 +14,7 @@ * is absent, it defaults to the time of the first request for the cursor. * * __Important:__ If you use the DateTimeFilter in a SearchOrders query, - * you must also set the `sort_field` in [OrdersSort](#type-searchorderordersort) + * you must also set the `sort_field` in [OrdersSort]($m/SearchOrdersSort) * to the same field you filter for. For example, if you set the `CLOSED_AT` field * in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to * `CLOSED_AT`. Otherwise, SearchOrders will throw an error. diff --git a/src/Models/SearchOrdersFilter.php b/src/Models/SearchOrdersFilter.php index dc8ab55f..f85d543e 100644 --- a/src/Models/SearchOrdersFilter.php +++ b/src/Models/SearchOrdersFilter.php @@ -69,7 +69,7 @@ public function setStateFilter(?SearchOrdersStateFilter $stateFilter): void * is absent, it defaults to the time of the first request for the cursor. * * __Important:__ If you use the DateTimeFilter in a SearchOrders query, - * you must also set the `sort_field` in [OrdersSort](#type-searchorderordersort) + * you must also set the `sort_field` in [OrdersSort]($m/SearchOrdersSort) * to the same field you filter for. For example, if you set the `CLOSED_AT` field * in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to * `CLOSED_AT`. Otherwise, SearchOrders will throw an error. @@ -93,7 +93,7 @@ public function getDateTimeFilter(): ?SearchOrdersDateTimeFilter * is absent, it defaults to the time of the first request for the cursor. * * __Important:__ If you use the DateTimeFilter in a SearchOrders query, - * you must also set the `sort_field` in [OrdersSort](#type-searchorderordersort) + * you must also set the `sort_field` in [OrdersSort]($m/SearchOrdersSort) * to the same field you filter for. For example, if you set the `CLOSED_AT` field * in DateTimeFilter, you must also set the `sort_field` in SearchOrdersSort to * `CLOSED_AT`. Otherwise, SearchOrders will throw an error. @@ -110,7 +110,7 @@ public function setDateTimeFilter(?SearchOrdersDateTimeFilter $dateTimeFilter): /** * Returns Fulfillment Filter. * - * Filter based on [Order Fulfillment](#type-orderfulfillment) information. + * Filter based on [Order Fulfillment]($m/OrderFulfillment) information. */ public function getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter { @@ -120,7 +120,7 @@ public function getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter /** * Sets Fulfillment Filter. * - * Filter based on [Order Fulfillment](#type-orderfulfillment) information. + * Filter based on [Order Fulfillment]($m/OrderFulfillment) information. * * @maps fulfillment_filter */ @@ -156,7 +156,7 @@ public function setSourceFilter(?SearchOrdersSourceFilter $sourceFilter): void * * Filter based on Order `customer_id` and any Tender `customer_id` * associated with the Order. Does not filter based on the - * [FulfillmentRecipient](#type-orderfulfillmentrecipient) `customer_id`. + * [FulfillmentRecipient]($m/OrderFulfillmentRecipient) `customer_id`. */ public function getCustomerFilter(): ?SearchOrdersCustomerFilter { @@ -168,7 +168,7 @@ public function getCustomerFilter(): ?SearchOrdersCustomerFilter * * Filter based on Order `customer_id` and any Tender `customer_id` * associated with the Order. Does not filter based on the - * [FulfillmentRecipient](#type-orderfulfillmentrecipient) `customer_id`. + * [FulfillmentRecipient]($m/OrderFulfillmentRecipient) `customer_id`. * * @maps customer_filter */ diff --git a/src/Models/SearchOrdersFulfillmentFilter.php b/src/Models/SearchOrdersFulfillmentFilter.php index 281c207b..2e7d92d8 100644 --- a/src/Models/SearchOrdersFulfillmentFilter.php +++ b/src/Models/SearchOrdersFulfillmentFilter.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Filter based on [Order Fulfillment](#type-orderfulfillment) information. + * Filter based on [Order Fulfillment]($m/OrderFulfillment) information. */ class SearchOrdersFulfillmentFilter implements \JsonSerializable { @@ -22,7 +22,7 @@ class SearchOrdersFulfillmentFilter implements \JsonSerializable /** * Returns Fulfillment Types. * - * List of [fulfillment types](#type-orderfulfillmenttype) to filter + * List of [fulfillment types]($m/OrderFulfillmentType) to filter * for. Will return orders if any of its fulfillments match any of the fulfillment types * listed in this field. * See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values @@ -37,7 +37,7 @@ public function getFulfillmentTypes(): ?array /** * Sets Fulfillment Types. * - * List of [fulfillment types](#type-orderfulfillmenttype) to filter + * List of [fulfillment types]($m/OrderFulfillmentType) to filter * for. Will return orders if any of its fulfillments match any of the fulfillment types * listed in this field. * See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values @@ -54,7 +54,7 @@ public function setFulfillmentTypes(?array $fulfillmentTypes): void /** * Returns Fulfillment States. * - * List of [fulfillment states](#type-orderfulfillmentstate) to filter + * List of [fulfillment states]($m/OrderFulfillmentState) to filter * for. Will return orders if any of its fulfillments match any of the * fulfillment states listed in this field. * See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values @@ -69,7 +69,7 @@ public function getFulfillmentStates(): ?array /** * Sets Fulfillment States. * - * List of [fulfillment states](#type-orderfulfillmentstate) to filter + * List of [fulfillment states]($m/OrderFulfillmentState) to filter * for. Will return orders if any of its fulfillments match any of the * fulfillment states listed in this field. * See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values diff --git a/src/Models/SearchOrdersRequest.php b/src/Models/SearchOrdersRequest.php index f1261787..d6c9d5f5 100644 --- a/src/Models/SearchOrdersRequest.php +++ b/src/Models/SearchOrdersRequest.php @@ -78,7 +78,8 @@ public function setLocationIds(?array $locationIds): void * * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. - * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. + * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more + * information. */ public function getCursor(): ?string { @@ -90,7 +91,8 @@ public function getCursor(): ?string * * A pagination cursor returned by a previous call to this endpoint. * Provide this to retrieve the next set of results for your original query. - * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. + * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more + * information. * * @maps cursor */ @@ -153,7 +155,7 @@ public function setLimit(?int $limit): void * Returns Return Entries. * * Boolean that controls the format of the search results. If `true`, - * SearchOrders will return [`OrderEntry`](#type-orderentry) objects. If `false`, SearchOrders + * SearchOrders will return [`OrderEntry`]($m/OrderEntry) objects. If `false`, SearchOrders * will return complete Order objects. * * Default: `false`. @@ -167,7 +169,7 @@ public function getReturnEntries(): ?bool * Sets Return Entries. * * Boolean that controls the format of the search results. If `true`, - * SearchOrders will return [`OrderEntry`](#type-orderentry) objects. If `false`, SearchOrders + * SearchOrders will return [`OrderEntry`]($m/OrderEntry) objects. If `false`, SearchOrders * will return complete Order objects. * * Default: `false`. diff --git a/src/Models/SearchOrdersResponse.php b/src/Models/SearchOrdersResponse.php index 46572309..58f712b5 100644 --- a/src/Models/SearchOrdersResponse.php +++ b/src/Models/SearchOrdersResponse.php @@ -6,7 +6,7 @@ /** * Only one of `order_entries` or `orders` fields will be set, depending on whether - * `return_entries` was set on the [SearchOrdersRequest](#type-searchorderrequest). + * `return_entries` was set on the [SearchOrdersRequest]($e/Orders/SearchOrders). */ class SearchOrdersResponse implements \JsonSerializable { @@ -33,7 +33,7 @@ class SearchOrdersResponse implements \JsonSerializable /** * Returns Order Entries. * - * List of [OrderEntries](#type-orderentry) that fit the query + * List of [OrderEntries]($m/OrderEntry) that fit the query * conditions. Populated only if `return_entries` was set to `true` in the request. * * @return OrderEntry[]|null @@ -46,7 +46,7 @@ public function getOrderEntries(): ?array /** * Sets Order Entries. * - * List of [OrderEntries](#type-orderentry) that fit the query + * List of [OrderEntries]($m/OrderEntry) that fit the query * conditions. Populated only if `return_entries` was set to `true` in the request. * * @maps order_entries @@ -62,7 +62,7 @@ public function setOrderEntries(?array $orderEntries): void * Returns Orders. * * List of - * [Order](#type-order) objects that match query conditions. Populated only if + * [Order]($m/Order) objects that match query conditions. Populated only if * `return_entries` in the request is set to `false`. * * @return Order[]|null @@ -76,7 +76,7 @@ public function getOrders(): ?array * Sets Orders. * * List of - * [Order](#type-order) objects that match query conditions. Populated only if + * [Order]($m/Order) objects that match query conditions. Populated only if * `return_entries` in the request is set to `false`. * * @maps orders @@ -93,7 +93,8 @@ public function setOrders(?array $orders): void * * The pagination cursor to be used in a subsequent request. If unset, * this is the final response. - * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. + * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more + * information. */ public function getCursor(): ?string { @@ -105,7 +106,8 @@ public function getCursor(): ?string * * The pagination cursor to be used in a subsequent request. If unset, * this is the final response. - * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. + * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more + * information. * * @maps cursor */ @@ -117,7 +119,7 @@ public function setCursor(?string $cursor): void /** * Returns Errors. * - * [Errors](#type-error) encountered during the search. + * [Errors]($m/Error) encountered during the search. * * @return Error[]|null */ @@ -129,7 +131,7 @@ public function getErrors(): ?array /** * Sets Errors. * - * [Errors](#type-error) encountered during the search. + * [Errors]($m/Error) encountered during the search. * * @maps errors * diff --git a/src/Models/SearchOrdersSourceFilter.php b/src/Models/SearchOrdersSourceFilter.php index f316d5be..ee08e876 100644 --- a/src/Models/SearchOrdersSourceFilter.php +++ b/src/Models/SearchOrdersSourceFilter.php @@ -17,7 +17,7 @@ class SearchOrdersSourceFilter implements \JsonSerializable /** * Returns Source Names. * - * Filters by [Source](#type-ordersource) `name`. Will return any orders + * Filters by [Source]($m/OrderSource) `name`. Will return any orders * with with a `source.name` that matches any of the listed source names. * * Max: 10 source names. @@ -32,7 +32,7 @@ public function getSourceNames(): ?array /** * Sets Source Names. * - * Filters by [Source](#type-ordersource) `name`. Will return any orders + * Filters by [Source]($m/OrderSource) `name`. Will return any orders * with with a `source.name` that matches any of the listed source names. * * Max: 10 source names. diff --git a/src/Models/SearchSubscriptionsRequest.php b/src/Models/SearchSubscriptionsRequest.php index 75786d8e..0cb4cad9 100644 --- a/src/Models/SearchSubscriptionsRequest.php +++ b/src/Models/SearchSubscriptionsRequest.php @@ -6,7 +6,7 @@ /** * Defines parameters in a - * [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint + * [SearchSubscriptions]($e/Subscriptions/SearchSubscriptions) endpoint * request. */ class SearchSubscriptionsRequest implements \JsonSerializable diff --git a/src/Models/SearchSubscriptionsResponse.php b/src/Models/SearchSubscriptionsResponse.php index edf13d8d..aea89944 100644 --- a/src/Models/SearchSubscriptionsResponse.php +++ b/src/Models/SearchSubscriptionsResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response from the - * [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint. + * [SearchSubscriptions]($e/Subscriptions/SearchSubscriptions) endpoint. */ class SearchSubscriptionsResponse implements \JsonSerializable { diff --git a/src/Models/SegmentFilter.php b/src/Models/SegmentFilter.php index c822d485..1ee7b4c2 100644 --- a/src/Models/SegmentFilter.php +++ b/src/Models/SegmentFilter.php @@ -30,7 +30,7 @@ public function __construct(string $serviceVariationId) /** * Returns Service Variation Id. * - * The ID of the [CatalogItemVariation](#type-CatalogItemVariation) representing the service booked in + * The ID of the [CatalogItemVariation]($m/CatalogItemVariation) representing the service booked in * this segment. */ public function getServiceVariationId(): string @@ -41,7 +41,7 @@ public function getServiceVariationId(): string /** * Sets Service Variation Id. * - * The ID of the [CatalogItemVariation](#type-CatalogItemVariation) representing the service booked in + * The ID of the [CatalogItemVariation]($m/CatalogItemVariation) representing the service booked in * this segment. * * @required diff --git a/src/Models/SourceApplication.php b/src/Models/SourceApplication.php index 01227aa7..7e4edcbb 100644 --- a/src/Models/SourceApplication.php +++ b/src/Models/SourceApplication.php @@ -50,7 +50,7 @@ public function setProduct(?string $product): void * Returns Application Id. * * Read-only Square ID assigned to the application. Only used for - * [Product](#type-product) type `EXTERNAL_API`. + * [Product]($m/Product) type `EXTERNAL_API`. */ public function getApplicationId(): ?string { @@ -61,7 +61,7 @@ public function getApplicationId(): ?string * Sets Application Id. * * Read-only Square ID assigned to the application. Only used for - * [Product](#type-product) type `EXTERNAL_API`. + * [Product]($m/Product) type `EXTERNAL_API`. * * @maps application_id */ diff --git a/src/Models/Subscription.php b/src/Models/Subscription.php index f64393ab..d74170e0 100644 --- a/src/Models/Subscription.php +++ b/src/Models/Subscription.php @@ -134,7 +134,7 @@ public function setLocationId(?string $locationId): void /** * Returns Plan Id. * - * The ID of the associated [subscription plan](#type-catalogsubscriptionplan). + * The ID of the associated [subscription plan]($m/CatalogSubscriptionPlan). */ public function getPlanId(): ?string { @@ -144,7 +144,7 @@ public function getPlanId(): ?string /** * Sets Plan Id. * - * The ID of the associated [subscription plan](#type-catalogsubscriptionplan). + * The ID of the associated [subscription plan]($m/CatalogSubscriptionPlan). * * @maps plan_id */ @@ -156,7 +156,7 @@ public function setPlanId(?string $planId): void /** * Returns Customer Id. * - * The ID of the associated [customer](#type-customer) profile. + * The ID of the associated [customer]($m/Customer) profile. */ public function getCustomerId(): ?string { @@ -166,7 +166,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The ID of the associated [customer](#type-customer) profile. + * The ID of the associated [customer]($m/Customer) profile. * * @maps customer_id */ @@ -286,7 +286,7 @@ public function setTaxPercentage(?string $taxPercentage): void /** * Returns Invoice Ids. * - * The IDs of the [invoices](#type-invoice) created for the + * The IDs of the [invoices]($m/Invoice) created for the * subscription, listed in order when the invoices were created * (oldest invoices appear first). * @@ -300,7 +300,7 @@ public function getInvoiceIds(): ?array /** * Sets Invoice Ids. * - * The IDs of the [invoices](#type-invoice) created for the + * The IDs of the [invoices]($m/Invoice) created for the * subscription, listed in order when the invoices were created * (oldest invoices appear first). * @@ -398,7 +398,7 @@ public function setCreatedAt(?string $createdAt): void /** * Returns Card Id. * - * The ID of the [customer](#type-customer) [card](#type-card) + * The ID of the [customer]($m/Customer) [card]($m/Card) * that is charged for the subscription. */ public function getCardId(): ?string @@ -409,7 +409,7 @@ public function getCardId(): ?string /** * Sets Card Id. * - * The ID of the [customer](#type-customer) [card](#type-card) + * The ID of the [customer]($m/Customer) [card]($m/Card) * that is charged for the subscription. * * @maps card_id diff --git a/src/Models/SubscriptionCadence.php b/src/Models/SubscriptionCadence.php index b3ff4b58..1bcdfcde 100644 --- a/src/Models/SubscriptionCadence.php +++ b/src/Models/SubscriptionCadence.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Determines the billing cadence of a [Subscription](#type-Subscription) + * Determines the billing cadence of a [Subscription]($m/Subscription) */ class SubscriptionCadence { diff --git a/src/Models/SubscriptionEvent.php b/src/Models/SubscriptionEvent.php index 34da8808..ae17232e 100644 --- a/src/Models/SubscriptionEvent.php +++ b/src/Models/SubscriptionEvent.php @@ -29,6 +29,11 @@ class SubscriptionEvent implements \JsonSerializable */ private $planId; + /** + * @var SubscriptionEventInfo|null + */ + private $info; + /** * @param string $id * @param string $subscriptionEventType @@ -137,6 +142,28 @@ public function setPlanId(string $planId): void $this->planId = $planId; } + /** + * Returns Info. + * + * Provides information about the subscription event. + */ + public function getInfo(): ?SubscriptionEventInfo + { + return $this->info; + } + + /** + * Sets Info. + * + * Provides information about the subscription event. + * + * @maps info + */ + public function setInfo(?SubscriptionEventInfo $info): void + { + $this->info = $info; + } + /** * Encode this object to JSON * @@ -149,6 +176,7 @@ public function jsonSerialize() $json['subscription_event_type'] = $this->subscriptionEventType; $json['effective_date'] = $this->effectiveDate; $json['plan_id'] = $this->planId; + $json['info'] = $this->info; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/SubscriptionEventInfo.php b/src/Models/SubscriptionEventInfo.php new file mode 100644 index 00000000..ca4485f9 --- /dev/null +++ b/src/Models/SubscriptionEventInfo.php @@ -0,0 +1,81 @@ +detail; + } + + /** + * Sets Detail. + * + * A human-readable explanation for the event. + * + * @maps detail + */ + public function setDetail(?string $detail): void + { + $this->detail = $detail; + } + + /** + * Returns Code. + * + * The possible subscription event info codes. + */ + public function getCode(): ?string + { + return $this->code; + } + + /** + * Sets Code. + * + * The possible subscription event info codes. + * + * @maps code + */ + public function setCode(?string $code): void + { + $this->code = $code; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['detail'] = $this->detail; + $json['code'] = $this->code; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/SubscriptionEventInfoCode.php b/src/Models/SubscriptionEventInfoCode.php new file mode 100644 index 00000000..08b09d3f --- /dev/null +++ b/src/Models/SubscriptionEventInfoCode.php @@ -0,0 +1,36 @@ +birthday = $birthday; } + /** + * Returns Version. + * + * The current version of the customer profile. + * + * As a best practice, you should include this field to enable [optimistic concurrency](https: + * //developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. For more + * information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use- + * the-api/keep-records#update-a-customer-profile). + */ + public function getVersion(): ?int + { + return $this->version; + } + + /** + * Sets Version. + * + * The current version of the customer profile. + * + * As a best practice, you should include this field to enable [optimistic concurrency](https: + * //developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. For more + * information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use- + * the-api/keep-records#update-a-customer-profile). + * + * @maps version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + /** * Encode this object to JSON * @@ -306,6 +345,7 @@ public function jsonSerialize() $json['reference_id'] = $this->referenceId; $json['note'] = $this->note; $json['birthday'] = $this->birthday; + $json['version'] = $this->version; return array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/UpdateCustomerResponse.php b/src/Models/UpdateCustomerResponse.php index 5f44b642..d7a878eb 100644 --- a/src/Models/UpdateCustomerResponse.php +++ b/src/Models/UpdateCustomerResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the UpdateCustomer endpoint. + * a request to the `UpdateCustomer` endpoint. * - * One of `errors` or `customer` is present in a given response (never both). + * Either `errors` or `customer` is present in a given response (never both). */ class UpdateCustomerResponse implements \JsonSerializable { diff --git a/src/Models/UpdateLocationRequest.php b/src/Models/UpdateLocationRequest.php index 6ce4335a..7de2b8ec 100644 --- a/src/Models/UpdateLocationRequest.php +++ b/src/Models/UpdateLocationRequest.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Request object for the [UpdateLocation](#endpoint-updatelocation) endpoint. + * Request object for the [UpdateLocation]($e/Locations/UpdateLocation) endpoint. */ class UpdateLocationRequest implements \JsonSerializable { diff --git a/src/Models/UpdateLocationResponse.php b/src/Models/UpdateLocationResponse.php index fcc7b71e..ef838877 100644 --- a/src/Models/UpdateLocationResponse.php +++ b/src/Models/UpdateLocationResponse.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Response object returned by the [UpdateLocation](#endpoint-updatelocation) endpoint. + * Response object returned by the [UpdateLocation]($e/Locations/UpdateLocation) endpoint. */ class UpdateLocationResponse implements \JsonSerializable { diff --git a/src/Models/UpdateOrderRequest.php b/src/Models/UpdateOrderRequest.php index aa829f39..e25d1d5a 100644 --- a/src/Models/UpdateOrderRequest.php +++ b/src/Models/UpdateOrderRequest.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in requests to the - * [UpdateOrder](#endpoint-orders-updateorder) endpoint. + * [UpdateOrder]($e/Orders/UpdateOrder) endpoint. */ class UpdateOrderRequest implements \JsonSerializable { diff --git a/src/Models/UpdateOrderResponse.php b/src/Models/UpdateOrderResponse.php index f33b52c5..46476c39 100644 --- a/src/Models/UpdateOrderResponse.php +++ b/src/Models/UpdateOrderResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [UpdateOrder](#endpoint-orders-updateorder) endpoint. + * a request to the [UpdateOrder]($e/Orders/UpdateOrder) endpoint. */ class UpdateOrderResponse implements \JsonSerializable { diff --git a/src/Models/UpdatePaymentRequest.php b/src/Models/UpdatePaymentRequest.php index 6b94be7a..f6fd0bfa 100644 --- a/src/Models/UpdatePaymentRequest.php +++ b/src/Models/UpdatePaymentRequest.php @@ -6,7 +6,7 @@ /** * Describes a request to update a payment using - * [UpdatePayment](#endpoint-payments-updatepayment). + * [UpdatePayment]($e/Payments/UpdatePayment). */ class UpdatePaymentRequest implements \JsonSerializable { diff --git a/src/Models/UpdatePaymentResponse.php b/src/Models/UpdatePaymentResponse.php index effdd1b8..ddcb9c96 100644 --- a/src/Models/UpdatePaymentResponse.php +++ b/src/Models/UpdatePaymentResponse.php @@ -6,7 +6,7 @@ /** * Defines the response returned by - * [UpdatePayment](#endpoint-payments-update). + * [UpdatePayment]($e/Payments/UpdatePayment). */ class UpdatePaymentResponse implements \JsonSerializable { diff --git a/src/Models/UpdateSubscriptionRequest.php b/src/Models/UpdateSubscriptionRequest.php index e64714b3..8ad8dbe5 100644 --- a/src/Models/UpdateSubscriptionRequest.php +++ b/src/Models/UpdateSubscriptionRequest.php @@ -6,7 +6,7 @@ /** * Defines parameters in a - * [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint + * [UpdateSubscription]($e/Subscriptions/UpdateSubscription) endpoint * request. */ class UpdateSubscriptionRequest implements \JsonSerializable diff --git a/src/Models/UpdateSubscriptionResponse.php b/src/Models/UpdateSubscriptionResponse.php index c4d08875..49a8a1de 100644 --- a/src/Models/UpdateSubscriptionResponse.php +++ b/src/Models/UpdateSubscriptionResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response from the - * [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint. + * [UpdateSubscription]($e/Subscriptions/UpdateSubscription) endpoint. */ class UpdateSubscriptionResponse implements \JsonSerializable { diff --git a/src/Models/VoidTransactionResponse.php b/src/Models/VoidTransactionResponse.php index 804e7854..44151d63 100644 --- a/src/Models/VoidTransactionResponse.php +++ b/src/Models/VoidTransactionResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the [VoidTransaction](#endpoint-voidtransaction) endpoint. + * a request to the [VoidTransaction]($e/Transactions/VoidTransaction) endpoint. */ class VoidTransactionResponse implements \JsonSerializable { diff --git a/src/SquareClient.php b/src/SquareClient.php index b0141681..5f0d881f 100644 --- a/src/SquareClient.php +++ b/src/SquareClient.php @@ -143,7 +143,7 @@ public function getCustomUrl(): string */ public function getSdkVersion(): string { - return '9.1.0.20210317'; + return '10.0.0.20210421'; } /** diff --git a/tests/Apis/LocationsApiTest.php b/tests/Apis/LocationsApiTest.php index c2f98dd5..08191975 100644 --- a/tests/Apis/LocationsApiTest.php +++ b/tests/Apis/LocationsApiTest.php @@ -34,7 +34,7 @@ public static function setUpBeforeClass(): void * Provides information of all locations of a business. Many Square API endpoints require a `location_id` parameter. -The `id` field of the [`Location`](#type-location) objects returned by this +The `id` field of the [`Location`]($m/Location) objects returned by this endpoint correspond to that `location_id` parameter. */ public function testListLocations()