From 2e8309c8f68fedd7889f1e589f1909896754a9af Mon Sep 17 00:00:00 2001 From: autobot Date: Thu, 13 May 2021 15:18:32 +0000 Subject: [PATCH] Generated PR for Release: 11.0.0.20210513 --- .github/workflows/php.yml | 47 ++++ CHANGELOG.md | 34 +++ README.md | 12 +- composer.json | 2 +- doc/apis/catalog.md | 2 +- doc/apis/inventory.md | 6 +- doc/apis/loyalty.md | 23 +- doc/apis/orders.md | 47 ++-- doc/apis/sites.md | 41 +++ doc/apis/snippets.md | 152 +++++++++++ doc/apis/v1-transactions.md | 18 ++ doc/client.md | 8 +- doc/models/ach-details.md | 27 ++ doc/models/bank-account-payment-details.md | 34 +++ doc/models/batch-change-inventory-request.md | 2 +- doc/models/batch-retrieve-orders-request.md | 2 +- doc/models/batch-retrieve-orders-response.md | 2 +- doc/models/calculate-order-request.md | 4 +- doc/models/calculate-order-response.md | 2 +- doc/models/catalog-subscription-plan.md | 4 +- doc/models/checkout.md | 2 +- doc/models/create-loyalty-account-response.md | 13 +- doc/models/create-order-request.md | 4 +- doc/models/create-order-response.md | 6 +- doc/models/delete-snippet-response.md | 21 ++ doc/models/external-payment-details.md | 2 +- doc/models/inventory-adjustment.md | 20 +- doc/models/inventory-change.md | 2 +- doc/models/inventory-count.md | 12 +- doc/models/inventory-physical-count.md | 16 +- doc/models/inventory-transfer.md | 14 +- doc/models/list-catalog-request.md | 2 +- doc/models/list-sites-response.md | 41 +++ doc/models/loyalty-account-mapping.md | 6 +- doc/models/loyalty-account.md | 13 +- doc/models/order-created.md | 6 +- doc/models/order-entry.md | 10 +- ...-pickup-details-curbside-pickup-details.md | 4 +- ...ulfillment-pickup-details-schedule-type.md | 4 +- .../order-fulfillment-pickup-details.md | 32 +-- doc/models/order-fulfillment-recipient.md | 10 +- .../order-fulfillment-shipment-details.md | 22 +- doc/models/order-fulfillment-state.md | 12 +- .../order-fulfillment-updated-update.md | 2 +- doc/models/order-fulfillment-updated.md | 8 +- doc/models/order-fulfillment.md | 8 +- .../order-line-item-applied-discount.md | 10 +- doc/models/order-line-item-applied-tax.md | 4 +- doc/models/order-line-item-discount-scope.md | 2 +- doc/models/order-line-item-discount-type.md | 4 +- doc/models/order-line-item-discount.md | 12 +- doc/models/order-line-item-modifier.md | 4 +- ...tem-pricing-blocklists-blocked-discount.md | 6 +- ...ine-item-pricing-blocklists-blocked-tax.md | 6 +- .../order-line-item-pricing-blocklists.md | 4 +- doc/models/order-line-item-tax-scope.md | 2 +- doc/models/order-line-item-tax-type.md | 4 +- doc/models/order-line-item-tax.md | 8 +- doc/models/order-line-item.md | 14 +- doc/models/order-pricing-options.md | 2 +- doc/models/order-quantity-unit.md | 4 +- doc/models/order-return-discount.md | 10 +- doc/models/order-return-line-item-modifier.md | 6 +- doc/models/order-return-line-item.md | 20 +- doc/models/order-return-service-charge.md | 10 +- doc/models/order-return-tax.md | 8 +- doc/models/order-return.md | 16 +- doc/models/order-reward.md | 2 +- doc/models/order-rounding-adjustment.md | 8 +- .../order-service-charge-calculation-phase.md | 6 +- doc/models/order-service-charge.md | 8 +- doc/models/order-state.md | 6 +- doc/models/order-updated.md | 8 +- doc/models/order.md | 38 +-- doc/models/pay-order-request.md | 2 +- doc/models/pay-order-response.md | 2 +- doc/models/payment.md | 5 +- .../retrieve-loyalty-account-response.md | 13 +- doc/models/retrieve-order-response.md | 2 +- doc/models/retrieve-snippet-response.md | 30 ++ ...-accounts-request-loyalty-account-query.md | 2 - .../search-loyalty-accounts-response.md | 13 +- doc/models/search-orders-customer-filter.md | 6 +- doc/models/search-orders-date-time-filter.md | 12 +- doc/models/search-orders-filter.md | 14 +- .../search-orders-fulfillment-filter.md | 6 +- doc/models/search-orders-query.md | 4 +- doc/models/search-orders-request.md | 12 +- doc/models/search-orders-response.md | 10 +- doc/models/search-orders-sort-field.md | 8 +- doc/models/search-orders-sort.md | 4 +- doc/models/search-orders-source-filter.md | 4 +- doc/models/search-orders-state-filter.md | 2 +- doc/models/site.md | 32 +++ doc/models/snippet-response.md | 48 ++++ doc/models/snippet.md | 31 +++ doc/models/update-order-request.md | 6 +- doc/models/update-order-response.md | 2 +- doc/models/upsert-snippet-request.md | 25 ++ doc/models/upsert-snippet-response.md | 30 ++ src/Apis/BaseApi.php | 2 +- src/Apis/CatalogApi.php | 1 + src/Apis/LoyaltyApi.php | 16 +- src/Apis/OrdersApi.php | 47 ++-- src/Apis/SitesApi.php | 86 ++++++ src/Apis/SnippetsApi.php | 249 +++++++++++++++++ src/Apis/V1TransactionsApi.php | 36 +++ src/ConfigurationDefaults.php | 2 +- src/Models/ACHDetails.php | 111 ++++++++ src/Models/BankAccountPaymentDetails.php | 257 ++++++++++++++++++ src/Models/BatchChangeInventoryRequest.php | 15 +- src/Models/BatchRetrieveOrdersRequest.php | 2 +- src/Models/BatchRetrieveOrdersResponse.php | 2 +- src/Models/CalculateOrderRequest.php | 20 +- src/Models/CalculateOrderResponse.php | 8 +- src/Models/CatalogSubscriptionPlan.php | 28 +- src/Models/Checkout.php | 8 +- src/Models/CreateOrderRequest.php | 28 +- src/Models/CreateOrderResponse.php | 12 +- src/Models/DeleteSnippetResponse.php | 57 ++++ src/Models/ExternalPaymentDetails.php | 4 +- src/Models/InventoryAdjustment.php | 58 ++-- src/Models/InventoryChange.php | 2 +- src/Models/InventoryCount.php | 40 +-- src/Models/InventoryPhysicalCount.php | 50 ++-- src/Models/InventoryTransfer.php | 44 +-- src/Models/ListCatalogRequest.php | 2 + src/Models/ListSitesResponse.php | 89 ++++++ src/Models/LoyaltyAccount.php | 46 ---- src/Models/LoyaltyAccountMapping.php | 66 ----- src/Models/Order.php | 144 +++++----- src/Models/OrderCreated.php | 24 +- src/Models/OrderEntry.php | 32 +-- src/Models/OrderFulfillment.php | 34 +-- src/Models/OrderFulfillmentPickupDetails.php | 120 ++++---- ...mentPickupDetailsCurbsidePickupDetails.php | 14 +- ...erFulfillmentPickupDetailsScheduleType.php | 4 +- src/Models/OrderFulfillmentRecipient.php | 32 ++- .../OrderFulfillmentShipmentDetails.php | 104 ++++--- src/Models/OrderFulfillmentState.php | 12 +- src/Models/OrderFulfillmentUpdated.php | 28 +- src/Models/OrderFulfillmentUpdatedUpdate.php | 4 +- src/Models/OrderLineItem.php | 62 ++--- src/Models/OrderLineItemAppliedDiscount.php | 14 +- src/Models/OrderLineItemAppliedTax.php | 16 +- src/Models/OrderLineItemDiscount.php | 46 ++-- src/Models/OrderLineItemDiscountScope.php | 2 +- src/Models/OrderLineItemDiscountType.php | 4 +- src/Models/OrderLineItemModifier.php | 8 +- src/Models/OrderLineItemPricingBlocklists.php | 8 +- ...neItemPricingBlocklistsBlockedDiscount.php | 12 +- ...derLineItemPricingBlocklistsBlockedTax.php | 12 +- src/Models/OrderLineItemTax.php | 38 ++- src/Models/OrderLineItemTaxScope.php | 2 +- src/Models/OrderLineItemTaxType.php | 6 +- src/Models/OrderPricingOptions.php | 3 +- src/Models/OrderQuantityUnit.php | 6 +- src/Models/OrderReturn.php | 37 +-- src/Models/OrderReturnDiscount.php | 20 +- src/Models/OrderReturnLineItem.php | 54 ++-- src/Models/OrderReturnLineItemModifier.php | 12 +- src/Models/OrderReturnServiceCharge.php | 24 +- src/Models/OrderReturnTax.php | 16 +- src/Models/OrderReward.php | 2 +- src/Models/OrderRoundingAdjustment.php | 13 +- src/Models/OrderServiceCharge.php | 44 +-- .../OrderServiceChargeCalculationPhase.php | 6 +- src/Models/OrderState.php | 6 +- src/Models/OrderUpdated.php | 28 +- src/Models/PayOrderRequest.php | 16 +- src/Models/PayOrderResponse.php | 8 +- src/Models/Payment.php | 36 ++- src/Models/RetrieveOrderResponse.php | 8 +- src/Models/RetrieveSnippetResponse.php | 87 ++++++ src/Models/SearchOrdersCustomerFilter.php | 8 +- src/Models/SearchOrdersDateTimeFilter.php | 14 +- src/Models/SearchOrdersFilter.php | 52 ++-- src/Models/SearchOrdersFulfillmentFilter.php | 18 +- src/Models/SearchOrdersQuery.php | 12 +- src/Models/SearchOrdersRequest.php | 34 ++- src/Models/SearchOrdersResponse.php | 30 +- src/Models/SearchOrdersSort.php | 6 +- src/Models/SearchOrdersSortField.php | 16 +- src/Models/SearchOrdersSourceFilter.php | 10 +- src/Models/SearchOrdersStateFilter.php | 2 +- src/Models/Site.php | 193 +++++++++++++ src/Models/Snippet.php | 175 ++++++++++++ src/Models/SnippetResponse.php | 84 ++++++ src/Models/UpdateOrderRequest.php | 36 +-- src/Models/UpdateOrderResponse.php | 8 +- src/Models/UpsertSnippetRequest.php | 64 +++++ src/Models/UpsertSnippetResponse.php | 87 ++++++ src/SquareClient.php | 26 +- 193 files changed, 3454 insertions(+), 1335 deletions(-) create mode 100644 .github/workflows/php.yml create mode 100644 doc/apis/sites.md create mode 100644 doc/apis/snippets.md create mode 100644 doc/models/ach-details.md create mode 100644 doc/models/bank-account-payment-details.md create mode 100644 doc/models/delete-snippet-response.md create mode 100644 doc/models/list-sites-response.md create mode 100644 doc/models/retrieve-snippet-response.md create mode 100644 doc/models/site.md create mode 100644 doc/models/snippet-response.md create mode 100644 doc/models/snippet.md create mode 100644 doc/models/upsert-snippet-request.md create mode 100644 doc/models/upsert-snippet-response.md create mode 100644 src/Apis/SitesApi.php create mode 100644 src/Apis/SnippetsApi.php create mode 100644 src/Models/ACHDetails.php create mode 100644 src/Models/BankAccountPaymentDetails.php create mode 100644 src/Models/DeleteSnippetResponse.php create mode 100644 src/Models/ListSitesResponse.php create mode 100644 src/Models/RetrieveSnippetResponse.php create mode 100644 src/Models/Site.php create mode 100644 src/Models/Snippet.php create mode 100644 src/Models/SnippetResponse.php create mode 100644 src/Models/UpsertSnippetRequest.php create mode 100644 src/Models/UpsertSnippetResponse.php diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 00000000..c5f1ff1e --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,47 @@ +name: PHP Composer + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + env: + SQUARE_ENVIRONMENT: sandbox + SQUARE_ACCESS_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }} + + runs-on: ubuntu-18.04 + + strategy: + matrix: + php-versions: ["7.2", "7.3", "7.4", "8.0"] + phpunit-versions: ["8.5.8"] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit:${{ matrix.phpunit-versions }} + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php-versions }}- + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: composer run test + + - name: Run test suite + run: composer run analyze diff --git a/CHANGELOG.md b/CHANGELOG.md index ac96497f..ffd2ed5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # Change Log +## Version 11.0.0.20210513 (2021-05-13) +## New API releases + +* **Sites API.** The [Sites API](https://developer.squareup.com/reference/square_2021-05-13/sites-api) lets you retrieve basic details about the Square Online sites that belong to a Square seller. For more information, see [Sites API Overview.](https://developer.squareup.com/docs/sites-api/overview) + + +* **Snippets API.** The [Snippets API](https://developer.squareup.com/reference/square_2021-05-13/snippets-api) lets you manage snippets that provide custom functionality on Square Online sites. A snippet is a script that is injected into all pages on a site, except for checkout pages. For more information, see [Snippets API Overview.](https://developer.squareup.com/docs/snippets-api/overview) + +The Sites API and Snippets API are publicly available to all developers as part of an early access program (EAP). For more information, see [Early access program for Square Online APIs.](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis) + +## API updates + +* **Payments API.** + * [CreatePayment.](https://developer.squareup.com/reference/square_2021-05-13/payments-api/create-payment) The endpoint now supports ACH bank transfer payments. For more information, see [ACH Payment](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments). + +* **Loyalty API:** + * The [Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. + + * The [ListLoyaltyPrograms](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/list-loyalty-programs) endpoint is deprecated and replaced by the [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/retrieve-loyalty-program) endpoint when used with the `main` keyword. + + * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccount)  object. The `mappings` field is retired and replaced by `mapping`. + + * [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccountMapping) object. The `type` and `value` fields are retired and replaced by `phone_number`. + + Starting in Square version 2021-05-13: + * `mappings` is not accepted in `CreateLoyaltyAccount` requests or returned in responses. + * `type` and `value` are not accepted in `CreateLoyaltyAccount` or `SearchLoyaltyAccounts` requests or returned in responses. + + For more information, see [Migration notes.](https://developer.squareup.com/docs/loyalty-api/overview#migration-notes) + +## Documentation updates +* **Getting Started** Added step that shows how to use the API Logs to examine a transaction. + + ## Version 10.0.0.20210421 (2021-04-21) ## New API releases diff --git a/README.md b/README.md index 3c4a3fc3..542d8204 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Square PHP SDK -[![Travis status](https://travis-ci.com/square/square-php-sdk.svg?branch=master)](https://travis-ci.com/square/square-php-sdk) +[![Build](https://github.com/square/square-php-sdk/actions/workflows/php.yml/badge.svg)](https://github.com/square/square-php-sdk/actions/workflows/php.yml) [![PHP version](https://badge.fury.io/ph/square%2Fsquare.svg)](https://badge.fury.io/ph/square%2Fsquare) [![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0) @@ -75,9 +75,13 @@ After downloading the SDK and its dependencies you'll need to write a custom `au ### Financials * [Bank Accounts] +### Online +* [Sites] +* [Snippets] + ### Authorization APIs * [Mobile Authorization] -* [O Auth] +* [OAuth] ### Deprecated APIs * [V1 Employees] @@ -409,9 +413,11 @@ You can also use the Square API to create applications or services that work wit [Refunds]: doc/apis/refunds.md [Subscriptions]: doc/apis/subscriptions.md [Mobile Authorization]: doc/apis/mobile-authorization.md -[O Auth]: doc/apis/o-auth.md +[OAuth]: doc/apis/o-auth.md [V1 Employees]: doc/apis/v1-employees.md [V1 Transactions]: doc/apis/v1-transactions.md [V1 Items]: doc/apis/v1-items.md [Team]: doc/apis/team.md [Transactions]: doc/apis/transactions.md +[Sites]: doc/api/sites.md +[Snippets]: doc/api/snippets.md diff --git a/composer.json b/composer.json index f688d870..2ed5ac18 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": "10.0.0.20210421", + "version": "11.0.0.20210513", "type": "library", "keywords": [ "Square", diff --git a/doc/apis/catalog.md b/doc/apis/catalog.md index b06cbf88..79034d5f 100644 --- a/doc/apis/catalog.md +++ b/doc/apis/catalog.md @@ -591,7 +591,7 @@ function listCatalog(?string $cursor = null, ?string $types = null, ?int $catalo | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `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. | +| `cursor` | `?string` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.
The page size is currently set to be 100.
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](/doc/models/catalog-object.md)s' `version` attribute. | diff --git a/doc/apis/inventory.md b/doc/apis/inventory.md index 07f128ea..5c29607a 100644 --- a/doc/apis/inventory.md +++ b/doc/apis/inventory.md @@ -82,8 +82,10 @@ function batchChangeInventory(BatchChangeInventoryRequest $body): ApiResponse ## Example Usage ```php -$body = new Models\BatchChangeInventoryRequest; -$body->setIdempotencyKey('8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe'); +$body_idempotencyKey = '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe'; +$body = new Models\BatchChangeInventoryRequest( + $body_idempotencyKey +); $body_changes = []; $body_changes[0] = new Models\InventoryChange; diff --git a/doc/apis/loyalty.md b/doc/apis/loyalty.md index 9d38f95f..a43694f7 100644 --- a/doc/apis/loyalty.md +++ b/doc/apis/loyalty.md @@ -28,7 +28,7 @@ $loyaltyApi = $client->getLoyaltyApi(); # Create 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. +Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer. ```php function createLoyaltyAccount(CreateLoyaltyAccountRequest $body): ApiResponse @@ -52,23 +52,12 @@ $body_loyaltyAccount = new Models\LoyaltyAccount( $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'; @@ -122,8 +111,6 @@ $body_query_mappings = []; $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); @@ -366,8 +353,12 @@ if ($apiResponse->isSuccess()) { # List Loyalty Programs +**This endpoint is deprecated. ** + Returns a list of loyalty programs in the seller's account. -Currently, a seller can only have one loyalty program. +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). + +Replaced with [RetrieveLoyaltyProgram](/doc/apis/loyalty.md#retrieve-loyalty-program) when used with the keyword `main`. ```php function listLoyaltyPrograms(): ApiResponse diff --git a/doc/apis/orders.md b/doc/apis/orders.md index 585ff3f1..301a81d2 100644 --- a/doc/apis/orders.md +++ b/doc/apis/orders.md @@ -21,12 +21,11 @@ $ordersApi = $client->getOrdersApi(); # Create Order -Creates a new [Order](/doc/models/order.md) which can include information on products for +Creates a new [order](/doc/models/order.md) that can include information about 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) -guide. +To pay for a created order, see +[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). You can modify open orders using the [UpdateOrder](/doc/apis/orders.md#update-order) endpoint. @@ -192,9 +191,9 @@ if ($apiResponse->isSuccess()) { # Batch Retrieve Orders -Retrieves a set of [Order](/doc/models/order.md)s by their IDs. +Retrieves a set of [orders](/doc/models/order.md) by their IDs. -If a given Order ID does not exist, the ID is ignored instead of generating an error. +If a given order ID does not exist, the ID is ignored instead of generating an error. ```php function batchRetrieveOrders(BatchRetrieveOrdersRequest $body): ApiResponse @@ -373,19 +372,19 @@ if ($apiResponse->isSuccess()) { Search all orders for one or more locations. Orders include all sales, returns, and exchanges regardless of how or when they entered the Square -Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc). +ecosystem (such as Point of Sale, Invoices, and Connect APIs). -SearchOrders requests need to specify which locations to search and define a -[`SearchOrdersQuery`](/doc/models/search-orders-query.md) object which controls -how to sort or filter the results. Your SearchOrdersQuery can: +`SearchOrders` requests need to specify which locations to search and define a +[SearchOrdersQuery](/doc/models/search-orders-query.md) object that 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 +Set the sort order. +Determine whether to return results as complete `Order` objects or as [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 +offline mode might not be transmitted to Square for up to 72 hours. Offline orders have a `created_at` value that reflects the time the order was created, not the time it was subsequently transmitted to Square. @@ -493,21 +492,21 @@ if ($apiResponse->isSuccess()) { # Update Order -Updates an open [Order](/doc/models/order.md) 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: +An `UpdateOrder` request requires the following: - The `order_id` in the endpoint path, identifying the order to update. - The latest `version` of the order to update. - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders#sparse-order-objects) - containing only the fields to update and the version the update is - being applied to. + containing only the fields to update and the version to which the update is + being applied. - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation) - identifying fields to clear. + identifying the 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, see +[Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). ```php function updateOrder(string $orderId, UpdateOrderRequest $body): ApiResponse @@ -604,20 +603,20 @@ if ($apiResponse->isSuccess()) { # Pay Order -Pay for an [order](/doc/models/order.md) using one or more approved [payments](/doc/models/payment.md), +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 total. Orders with a total amount of `0` can be marked as paid by specifying an empty array of `payment_ids` in the request. -To be used with PayOrder, a payment must: +To be used with `PayOrder`, a payment must: - 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. + `payment_ids` is canceled. - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture). - Using a delayed capture payment with PayOrder will complete the approved payment. + Using a delayed capture payment with `PayOrder` completes the approved payment. ```php function payOrder(string $orderId, PayOrderRequest $body): ApiResponse diff --git a/doc/apis/sites.md b/doc/apis/sites.md new file mode 100644 index 00000000..6f305616 --- /dev/null +++ b/doc/apis/sites.md @@ -0,0 +1,41 @@ +# Sites + +```php +$sitesApi = $client->getSitesApi(); +``` + +## Class Name + +`SitesApi` + + +# List Sites + +Lists the Square Online sites that belong to a seller. + +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + +```php +function listSites(): ApiResponse +``` + +## Response Type + +[`ListSitesResponse`](/doc/models/list-sites-response.md) + +## Example Usage + +```php +$apiResponse = $sitesApi->listSites(); + +if ($apiResponse->isSuccess()) { + $listSitesResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Get more response info... +// $statusCode = $apiResponse->getStatusCode(); +// $headers = $apiResponse->getHeaders(); +``` + diff --git a/doc/apis/snippets.md b/doc/apis/snippets.md new file mode 100644 index 00000000..3b126bd9 --- /dev/null +++ b/doc/apis/snippets.md @@ -0,0 +1,152 @@ +# Snippets + +```php +$snippetsApi = $client->getSnippetsApi(); +``` + +## Class Name + +`SnippetsApi` + +## Methods + +* [Delete Snippet](/doc/apis/snippets.md#delete-snippet) +* [Retrieve Snippet](/doc/apis/snippets.md#retrieve-snippet) +* [Upsert Snippet](/doc/apis/snippets.md#upsert-snippet) + + +# Delete Snippet + +Removes your snippet from a Square Online site. + +You can call [ListSites](/doc/apis/sites.md#list-sites) to get the IDs of the sites that belong to a seller. + +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + +```php +function deleteSnippet(string $siteId): ApiResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `siteId` | `string` | Template, Required | The ID of the site that contains the snippet. | + +## Response Type + +[`DeleteSnippetResponse`](/doc/models/delete-snippet-response.md) + +## Example Usage + +```php +$siteId = 'site_id6'; + +$apiResponse = $snippetsApi->deleteSnippet($siteId); + +if ($apiResponse->isSuccess()) { + $deleteSnippetResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Get more response info... +// $statusCode = $apiResponse->getStatusCode(); +// $headers = $apiResponse->getHeaders(); +``` + + +# Retrieve Snippet + +Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet applications, but you can retrieve only the snippet that was added by your application. + +You can call [ListSites](/doc/apis/sites.md#list-sites) to get the IDs of the sites that belong to a seller. + +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + +```php +function retrieveSnippet(string $siteId): ApiResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `siteId` | `string` | Template, Required | The ID of the site that contains the snippet. | + +## Response Type + +[`RetrieveSnippetResponse`](/doc/models/retrieve-snippet-response.md) + +## Example Usage + +```php +$siteId = 'site_id6'; + +$apiResponse = $snippetsApi->retrieveSnippet($siteId); + +if ($apiResponse->isSuccess()) { + $retrieveSnippetResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Get more response info... +// $statusCode = $apiResponse->getStatusCode(); +// $headers = $apiResponse->getHeaders(); +``` + + +# Upsert Snippet + +Adds a snippet to a Square Online site or updates the existing snippet on the site. +The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. + +You can call [ListSites](/doc/apis/sites.md#list-sites) to get the IDs of the sites that belong to a seller. + +__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). + +```php +function upsertSnippet(string $siteId, UpsertSnippetRequest $body): ApiResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `siteId` | `string` | Template, Required | The ID of the site where you want to add or update the snippet. | +| `body` | [`UpsertSnippetRequest`](/doc/models/upsert-snippet-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`UpsertSnippetResponse`](/doc/models/upsert-snippet-response.md) + +## Example Usage + +```php +$siteId = 'site_id6'; +$body_snippet_content = ''; +$body_snippet = new Models\Snippet( + $body_snippet_content +); +$body_snippet->setId('id4'); +$body_snippet->setSiteId('site_id0'); +$body_snippet->setCreatedAt('created_at8'); +$body_snippet->setUpdatedAt('updated_at0'); +$body = new Models\UpsertSnippetRequest( + $body_snippet +); + +$apiResponse = $snippetsApi->upsertSnippet($siteId, $body); + +if ($apiResponse->isSuccess()) { + $upsertSnippetResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Get more response info... +// $statusCode = $apiResponse->getStatusCode(); +// $headers = $apiResponse->getHeaders(); +``` + diff --git a/doc/apis/v1-transactions.md b/doc/apis/v1-transactions.md index 18d24819..824dce0b 100644 --- a/doc/apis/v1-transactions.md +++ b/doc/apis/v1-transactions.md @@ -23,6 +23,8 @@ $v1TransactionsApi = $client->getV1TransactionsApi(); # List Orders +**This endpoint is deprecated. ** + Provides summary information for a merchant's online store orders. ```php @@ -71,6 +73,8 @@ if ($apiResponse->isSuccess()) { # Retrieve Order +**This endpoint is deprecated. ** + Provides comprehensive information for a single online store order, including the order's history. ```php @@ -110,6 +114,8 @@ if ($apiResponse->isSuccess()) { # Update Order +**This endpoint is deprecated. ** + Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: ```php @@ -158,6 +164,8 @@ if ($apiResponse->isSuccess()) { # List Payments +**This endpoint is deprecated. ** + Provides summary information for all payments taken for a given Square account during a date range. Date ranges cannot exceed 1 year in length. See Date ranges for details of inclusive and exclusive dates. @@ -225,6 +233,8 @@ if ($apiResponse->isSuccess()) { # Retrieve Payment +**This endpoint is deprecated. ** + Provides comprehensive information for a single payment. ```php @@ -264,6 +274,8 @@ if ($apiResponse->isSuccess()) { # List Refunds +**This endpoint is deprecated. ** + Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length. ```php @@ -318,6 +330,8 @@ if ($apiResponse->isSuccess()) { # Create Refund +**This endpoint is deprecated. ** + Issues a refund for a previously processed payment. You must issue a refund within 60 days of the associated payment. @@ -379,6 +393,8 @@ if ($apiResponse->isSuccess()) { # List Settlements +**This endpoint is deprecated. ** + Provides summary information for all deposits and withdrawals initiated by Square to a linked bank account during a date range. Date ranges cannot exceed one year in length. @@ -441,6 +457,8 @@ if ($apiResponse->isSuccess()) { # Retrieve Settlement +**This endpoint is deprecated. ** + Provides comprehensive information for a single settlement. The returned `Settlement` objects include an `entries` field that lists diff --git a/doc/client.md b/doc/client.md index e2a1fa03..b4382297 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-04-21'` | +| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2021-05-13'` | | `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-04-21', + 'squareVersion' => '2021-05-13', '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-04-21', + 'squareVersion' => '2021-05-13', 'accessToken' => 'AccessToken', ]); @@ -97,6 +97,8 @@ The gateway for the SDK. This class acts as a factory for the Apis and also hold | getOrdersApi() | Gets OrdersApi | | getPaymentsApi() | Gets PaymentsApi | | getRefundsApi() | Gets RefundsApi | +| getSitesApi() | Gets SitesApi | +| getSnippetsApi() | Gets SnippetsApi | | getSubscriptionsApi() | Gets SubscriptionsApi | | getTeamApi() | Gets TeamApi | | getTerminalApi() | Gets TerminalApi | diff --git a/doc/models/ach-details.md b/doc/models/ach-details.md new file mode 100644 index 00000000..8735576c --- /dev/null +++ b/doc/models/ach-details.md @@ -0,0 +1,27 @@ + +# ACH Details + +ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. + +## Structure + +`ACHDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `routingNumber` | `?string` | Optional | The routing number for the bank account.
**Constraints**: *Maximum Length*: `50` | getRoutingNumber(): ?string | setRoutingNumber(?string routingNumber): void | +| `accountNumberSuffix` | `?string` | Optional | The last few digits of the bank account number.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4` | getAccountNumberSuffix(): ?string | setAccountNumberSuffix(?string accountNumberSuffix): void | +| `accountType` | `?string` | Optional | The type of the bank account performing the transfer. The account type can be `CHECKING`,
`SAVINGS`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getAccountType(): ?string | setAccountType(?string accountType): void | + +## Example (as JSON) + +```json +{ + "routing_number": "routing_number4", + "account_number_suffix": "account_number_suffix8", + "account_type": "account_type4" +} +``` + diff --git a/doc/models/bank-account-payment-details.md b/doc/models/bank-account-payment-details.md new file mode 100644 index 00000000..a3e00c80 --- /dev/null +++ b/doc/models/bank-account-payment-details.md @@ -0,0 +1,34 @@ + +# Bank Account Payment Details + +Additional details about BANK_ACCOUNT type payments. + +## Structure + +`BankAccountPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `bankName` | `?string` | Optional | The name of the bank associated with the bank account.
**Constraints**: *Maximum Length*: `100` | getBankName(): ?string | setBankName(?string bankName): void | +| `transferType` | `?string` | Optional | The type of the bank transfer. The type can be `ACH` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getTransferType(): ?string | setTransferType(?string transferType): void | +| `accountOwnershipType` | `?string` | Optional | The ownership type of the bank account performing the transfer.
The type can be `INDIVIDUAL`, `COMPANY`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | getAccountOwnershipType(): ?string | setAccountOwnershipType(?string accountOwnershipType): void | +| `fingerprint` | `?string` | Optional | Uniquely identifies the bank account for this seller and can be used
to determine if payments are from the same bank account.
**Constraints**: *Maximum Length*: `255` | getFingerprint(): ?string | setFingerprint(?string fingerprint): void | +| `country` | `?string` | Optional | The two-letter ISO code representing the country the bank account is located in.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2` | getCountry(): ?string | setCountry(?string country): void | +| `statementDescription` | `?string` | Optional | The statement description as sent to the bank.
**Constraints**: *Maximum Length*: `1000` | getStatementDescription(): ?string | setStatementDescription(?string statementDescription): void | +| `achDetails` | [`?ACHDetails`](/doc/models/ach-details.md) | Optional | ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. | getAchDetails(): ?ACHDetails | setAchDetails(?ACHDetails achDetails): void | +| `errors` | [`?(Error[])`](/doc/models/error.md) | Optional | Information about errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | + +## Example (as JSON) + +```json +{ + "bank_name": "bank_name4", + "transfer_type": "transfer_type8", + "account_ownership_type": "account_ownership_type8", + "fingerprint": "fingerprint6", + "country": "country4" +} +``` + diff --git a/doc/models/batch-change-inventory-request.md b/doc/models/batch-change-inventory-request.md index f70c6033..b79327bc 100644 --- a/doc/models/batch-change-inventory-request.md +++ b/doc/models/batch-change-inventory-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A client-supplied, universally unique identifier (UUID) for the
request.

See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) in the
[API Development 101](https://developer.squareup.com/docs/basics/api101/overview) section for more
information. | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | +| `idempotencyKey` | `string` | Required | A client-supplied, universally unique identifier (UUID) for the
request.

See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) in the
[API Development 101](https://developer.squareup.com/docs/basics/api101/overview) section for more
information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | getIdempotencyKey(): string | setIdempotencyKey(string idempotencyKey): void | | `changes` | [`?(InventoryChange[])`](/doc/models/inventory-change.md) | Optional | The set of physical counts and inventory adjustments to be made.
Changes are applied based on the client-supplied timestamp and may be sent
out of order. | getChanges(): ?array | setChanges(?array changes): void | | `ignoreUnchangedCounts` | `?bool` | Optional | Indicates whether the current physical count should be ignored if
the quantity is unchanged since the last physical count. Default: `true`. | getIgnoreUnchangedCounts(): ?bool | setIgnoreUnchangedCounts(?bool ignoreUnchangedCounts): void | diff --git a/doc/models/batch-retrieve-orders-request.md b/doc/models/batch-retrieve-orders-request.md index 5589be56..6afcf2c1 100644 --- a/doc/models/batch-retrieve-orders-request.md +++ b/doc/models/batch-retrieve-orders-request.md @@ -2,7 +2,7 @@ # Batch Retrieve Orders Request Defines the fields that are included in requests to the -BatchRetrieveOrders endpoint. +`BatchRetrieveOrders` endpoint. ## Structure diff --git a/doc/models/batch-retrieve-orders-response.md b/doc/models/batch-retrieve-orders-response.md index 35988dbf..ff4bda3a 100644 --- a/doc/models/batch-retrieve-orders-response.md +++ b/doc/models/batch-retrieve-orders-response.md @@ -2,7 +2,7 @@ # Batch Retrieve Orders Response Defines the fields that are included in the response body of -a request to the BatchRetrieveOrders endpoint. +a request to the `BatchRetrieveOrders` endpoint. ## Structure diff --git a/doc/models/calculate-order-request.md b/doc/models/calculate-order-request.md index b40448f6..12f4f472 100644 --- a/doc/models/calculate-order-request.md +++ b/doc/models/calculate-order-request.md @@ -9,8 +9,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`Order`](/doc/models/order.md) | Required | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): Order | setOrder(Order order): void | -| `proposedRewards` | [`?(OrderReward[])`](/doc/models/order-reward.md) | Optional | Identifies one or more loyalty reward tiers to apply during order calculation.
The discounts defined by the reward tiers are added to the order only to preview the
effect of applying the specified reward(s). The reward(s) do not correspond to actual
redemptions, that is, no `reward`s are created. Therefore, the reward `id`s are
random strings used only to reference the reward tier. | getProposedRewards(): ?array | setProposedRewards(?array proposedRewards): void | +| `order` | [`Order`](/doc/models/order.md) | Required | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): Order | setOrder(Order order): void | +| `proposedRewards` | [`?(OrderReward[])`](/doc/models/order-reward.md) | Optional | Identifies one or more loyalty reward tiers to apply during the order calculation.
The discounts defined by the reward tiers are added to the order only to preview the
effect of applying the specified rewards. The rewards do not correspond to actual
redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are
random strings used only to reference the reward tier. | getProposedRewards(): ?array | setProposedRewards(?array proposedRewards): void | ## Example (as JSON) diff --git a/doc/models/calculate-order-response.md b/doc/models/calculate-order-response.md index 2649e899..46f0f410 100644 --- a/doc/models/calculate-order-response.md +++ b/doc/models/calculate-order-response.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): 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/catalog-subscription-plan.md b/doc/models/catalog-subscription-plan.md index 8eab6023..9351b6b0 100644 --- a/doc/models/catalog-subscription-plan.md +++ b/doc/models/catalog-subscription-plan.md @@ -12,8 +12,8 @@ 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](/doc/models/subscription-phase.md) for this plan. | getPhases(): ?array | setPhases(?array phases): void | +| `name` | `string` | Required | The name of the plan. | getName(): string | setName(string name): void | +| `phases` | [`SubscriptionPhase[]`](/doc/models/subscription-phase.md) | Required | 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/checkout.md b/doc/models/checkout.md index 15425026..fc7e02a5 100644 --- a/doc/models/checkout.md +++ b/doc/models/checkout.md @@ -19,7 +19,7 @@ payment types using a checkout workflow hosted on squareup.com. | `prePopulateBuyerEmail` | `?string` | Optional | If provided, the buyer's email is pre-populated on the checkout page
as an editable text field.

Default: none; only exists if explicitly set. | getPrePopulateBuyerEmail(): ?string | setPrePopulateBuyerEmail(?string prePopulateBuyerEmail): void | | `prePopulateShippingAddress` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getPrePopulateShippingAddress(): ?Address | setPrePopulateShippingAddress(?Address prePopulateShippingAddress): void | | `redirectUrl` | `?string` | Optional | The URL to redirect to after checkout is completed with `checkoutId`,
Square's `orderId`, `transactionId`, and `referenceId` appended as URL
parameters. For example, if the provided redirect_url is
`http://www.example.com/order-complete`, a successful transaction redirects
the customer to:

http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx

If you do not provide a redirect URL, Square Checkout will display an order
confirmation page on your behalf; however Square strongly recommends that
you provide a redirect URL so you can verify the transaction results and
finalize the order through your existing/normal confirmation workflow. | getRedirectUrl(): ?string | setRedirectUrl(?string redirectUrl): void | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | | `createdAt` | `?string` | Optional | The time when the checkout was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | | `additionalRecipients` | [`?(AdditionalRecipient[])`](/doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this checkout.
For example, fees assessed on the purchase by a third party integration. | getAdditionalRecipients(): ?array | setAdditionalRecipients(?array additionalRecipients): void | diff --git a/doc/models/create-loyalty-account-response.md b/doc/models/create-loyalty-account-response.md index 5ccf410b..fd224bdc 100644 --- a/doc/models/create-loyalty-account-response.md +++ b/doc/models/create-loyalty-account-response.md @@ -26,19 +26,8 @@ A response that includes loyalty account created. "mapping": { "created_at": "2020-05-08T21:44:32Z", "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234", - "type": "PHONE", - "value": "+14155551234" + "phone_number": "+14155551234" }, - "mappings": [ - { - "created_at": "2020-05-08T21:44:32Z", - "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234", - "type": "PHONE", - "value": "+14155551234" - } - ], "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", "updated_at": "2020-05-08T21:44:32Z" } diff --git a/doc/models/create-order-request.md b/doc/models/create-order-request.md index 4f0288ab..a0a65575 100644 --- a/doc/models/create-order-request.md +++ b/doc/models/create-order-request.md @@ -9,8 +9,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this
order among orders you've created.

If you're unsure whether a particular order was created successfully,
you can reattempt it with the same idempotency key without
worrying about creating duplicate orders.

See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information.
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this
order among orders you have created.

If you are unsure whether a particular order was created successfully,
you can try it again with the same idempotency key without
worrying about creating duplicate orders.

For more information, see [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency).
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | ## Example (as JSON) diff --git a/doc/models/create-order-response.md b/doc/models/create-order-response.md index 286cbcfb..480f293b 100644 --- a/doc/models/create-order-response.md +++ b/doc/models/create-order-response.md @@ -2,9 +2,9 @@ # Create Order Response Defines the fields that are included in the response body of -a request to the CreateOrder endpoint. +a request to the `CreateOrder` endpoint. -One of `errors` or `order` is present in a given response (never both). +Either `errors` or `order` is present in a given response, but never both. ## Structure @@ -14,7 +14,7 @@ One of `errors` or `order` is present in a given response (never both). | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): 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/delete-snippet-response.md b/doc/models/delete-snippet-response.md new file mode 100644 index 00000000..b1b58252 --- /dev/null +++ b/doc/models/delete-snippet-response.md @@ -0,0 +1,21 @@ + +# Delete Snippet Response + +Represents a `DeleteSnippet` response. + +## Structure + +`DeleteSnippetResponse` + +## 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 +{} +``` + diff --git a/doc/models/external-payment-details.md b/doc/models/external-payment-details.md index 9d196114..f2e00d43 100644 --- a/doc/models/external-payment-details.md +++ b/doc/models/external-payment-details.md @@ -13,7 +13,7 @@ For more information, see | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `type` | `string` | Required | The type of external payment the seller received. It can be one of the following:

- CHECK - Paid using a physical check.
- BANK_TRANSFER - Paid using ACH or another bank transfer.
- OTHER\_GIFT\_CARD - Paid using a non-Square gift card.
- CRYPTO - Paid using a crypto currency.
- SQUARE_CASH - Paid using Square Cash App.
- SOCIAL - Paid using peer-to-peer payment applications.
- EXTERNAL - A third-party application gathered this payment outside of Square.
- EMONEY - Paid using an E-money provider.
- CARD - A credit or debit card that Square does not support.
- STORED_BALANCE - Use for house accounts, store credit, and so forth.
- OTHER - A type not listed here.
**Constraints**: *Maximum Length*: `50` | getType(): string | setType(string type): void | +| `type` | `string` | Required | The type of external payment the seller received. It can be one of the following:

- CHECK - Paid using a physical check.
- BANK_TRANSFER - Paid using external bank transfer.
- OTHER\_GIFT\_CARD - Paid using a non-Square gift card.
- CRYPTO - Paid using a crypto currency.
- SQUARE_CASH - Paid using Square Cash App.
- SOCIAL - Paid using peer-to-peer payment applications.
- EXTERNAL - A third-party application gathered this payment outside of Square.
- EMONEY - Paid using an E-money provider.
- CARD - A credit or debit card that Square does not support.
- STORED_BALANCE - Use for house accounts, store credit, and so forth.
- OTHER - A type not listed here.
**Constraints**: *Maximum Length*: `50` | getType(): string | setType(string type): void | | `source` | `string` | Required | A description of the external payment source. For example,
"Food Delivery Service".
**Constraints**: *Maximum Length*: `255` | getSource(): string | setSource(string source): void | | `sourceId` | `?string` | Optional | An ID to associate the payment to its originating source.
**Constraints**: *Maximum Length*: `255` | getSourceId(): ?string | setSourceId(?string sourceId): void | | `sourceFeeMoney` | [`?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. | getSourceFeeMoney(): ?Money | setSourceFeeMoney(?Money sourceFeeMoney): void | diff --git a/doc/models/inventory-adjustment.md b/doc/models/inventory-adjustment.md index ee805493..e734937b 100644 --- a/doc/models/inventory-adjustment.md +++ b/doc/models/inventory-adjustment.md @@ -16,19 +16,19 @@ 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](/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 | +| `locationId` | `?string` | Optional | The Square-generated ID of the [Location](/doc/models/location.md) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | +| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](/doc/models/catalog-object.md) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectType` | `?string` | Optional | The [type](entity:CatalogObjectType] of the
[CatalogObject](/doc/models/catalog-object.md) 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 | | `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 | -| `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 | +| `occurredAt` | `?string` | Optional | A client-generated RFC 3339-formatted timestamp that indicates when
the inventory adjustment took place. For inventory adjustment updates, 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 | An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.
**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](/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 | -| `goodsReceiptId` | `?string` | Optional | The read-only Square ID of the Square goods receipt that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | getGoodsReceiptId(): ?string | setGoodsReceiptId(?string goodsReceiptId): void | +| `employeeId` | `?string` | Optional | The Square-generated 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 Square-generated 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 Square-generated 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 Square-generated 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 | +| `goodsReceiptId` | `?string` | Optional | The Square-generated ID of the goods receipt that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | getGoodsReceiptId(): ?string | setGoodsReceiptId(?string goodsReceiptId): void | ## Example (as JSON) diff --git a/doc/models/inventory-change.md b/doc/models/inventory-change.md index 40df97fb..7e15d296 100644 --- a/doc/models/inventory-change.md +++ b/doc/models/inventory-change.md @@ -3,7 +3,7 @@ Represents a single physical count, inventory, adjustment, or transfer that is part of the history of inventory changes for a particular -`CatalogObject`. +[CatalogObject](/doc/models/catalog-object.md) instance. ## Structure diff --git a/doc/models/inventory-count.md b/doc/models/inventory-count.md index d1e2f4aa..2b106826 100644 --- a/doc/models/inventory-count.md +++ b/doc/models/inventory-count.md @@ -1,8 +1,8 @@ # Inventory Count -Represents Square's estimated quantity of items in a particular state at a -particular location based on the known history of physical counts and +Represents Square-estimated quantity of items in a particular state at a +particular seller location based on the known history of physical counts and inventory adjustments. ## Structure @@ -13,12 +13,12 @@ inventory adjustments. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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 | +| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](/doc/models/catalog-object.md) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectType` | `?string` | Optional | The [type](/doc/models/catalog-object-type.md) of the
[CatalogObject](/doc/models/catalog-object.md) 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](/doc/models/location.md) where the related
quantity of items are being tracked.
**Constraints**: *Maximum Length*: `100` | getLocationId(): ?string | setLocationId(?string locationId): void | +| `locationId` | `?string` | Optional | The Square-generated ID of the [Location](/doc/models/location.md) where the related
quantity of items is 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 | +| `calculatedAt` | `?string` | Optional | An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment affecting
the estimated count is received.
**Constraints**: *Maximum Length*: `34` | getCalculatedAt(): ?string | setCalculatedAt(?string calculatedAt): void | ## Example (as JSON) diff --git a/doc/models/inventory-physical-count.md b/doc/models/inventory-physical-count.md index 24450b49..47efd3c2 100644 --- a/doc/models/inventory-physical-count.md +++ b/doc/models/inventory-physical-count.md @@ -14,17 +14,17 @@ 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](/doc/models/inventory-physical-count.md).
**Constraints**: *Maximum Length*: `100` | getId(): ?string | setId(?string id): void | +| `id` | `?string` | Optional | A unique Square-generated ID 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 | +| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](/doc/models/catalog-object.md) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectType` | `?string` | Optional | The [type](/doc/models/catalog-object-type.md) of the
[CatalogObject](/doc/models/catalog-object.md) 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](/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 | +| `locationId` | `?string` | Optional | The Square-generated ID of the [Location](/doc/models/location.md) where the related
quantity of items is 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.
The number 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](/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 | +| `employeeId` | `?string` | Optional | The Square-generated 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 RFC 3339-formatted timestamp that indicates when
the physical count was examined. For physical count updates, 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 | An RFC 3339-formatted timestamp that indicates when the physical count is received.
**Constraints**: *Maximum Length*: `34` | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | ## Example (as JSON) diff --git a/doc/models/inventory-transfer.md b/doc/models/inventory-transfer.md index eb00cb93..dd09df29 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](/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 | +| `fromLocationId` | `?string` | Optional | The Square-generated ID of the [Location](/doc/models/location.md) where the related
quantity of items was tracked before the transfer.
**Constraints**: *Maximum Length*: `100` | getFromLocationId(): ?string | setFromLocationId(?string fromLocationId): void | +| `toLocationId` | `?string` | Optional | The Square-generated ID of the [Location](/doc/models/location.md) where the related
quantity of items was tracked after the transfer.
**Constraints**: *Maximum Length*: `100` | getToLocationId(): ?string | setToLocationId(?string toLocationId): void | +| `catalogObjectId` | `?string` | Optional | The Square-generated ID of the
[CatalogObject](/doc/models/catalog-object.md) being tracked.
**Constraints**: *Maximum Length*: `100` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `catalogObjectType` | `?string` | Optional | The [type](/doc/models/catalog-object-type.md) of the
[CatalogObject](/doc/models/catalog-object.md) 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 | +| `occurredAt` | `?string` | Optional | A client-generated RFC 3339-formatted timestamp 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 | An RFC 3339-formatted timestamp 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](/doc/models/employee.md) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | getEmployeeId(): ?string | setEmployeeId(?string employeeId): void | +| `employeeId` | `?string` | Optional | The Square-generated 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/list-catalog-request.md b/doc/models/list-catalog-request.md index c41e0af8..44a42890 100644 --- a/doc/models/list-catalog-request.md +++ b/doc/models/list-catalog-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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 | +| `cursor` | `?string` | Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.
The page size is currently set to be 100.
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](/doc/models/catalog-object.md)s' `version` attribute. | getCatalogVersion(): ?int | setCatalogVersion(?int catalogVersion): void | diff --git a/doc/models/list-sites-response.md b/doc/models/list-sites-response.md new file mode 100644 index 00000000..3ad9f980 --- /dev/null +++ b/doc/models/list-sites-response.md @@ -0,0 +1,41 @@ + +# List Sites Response + +Represents a `ListSites` response. The response can include either `sites` or `errors`. + +## Structure + +`ListSitesResponse` + +## 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 | +| `sites` | [`?(Site[])`](/doc/models/site.md) | Optional | The sites that belong to the seller. | getSites(): ?array | setSites(?array sites): void | + +## Example (as JSON) + +```json +{ + "sites": [ + { + "created_at": "2020-02-28T13:22:51Z", + "domain": "mysite1.square.site", + "id": "site_278075276488921835", + "is_published": true, + "site_title": "My First Site", + "updated_at": "2021-01-13T09:58:32Z" + }, + { + "created_at": "2020-06-18T17:45:13Z", + "domain": "mysite2.square.site", + "id": "site_102725345836253849", + "is_published": true, + "site_title": "My Second Site", + "updated_at": "2020-11-23T02:19:10Z" + } + ] +} +``` + diff --git a/doc/models/loyalty-account-mapping.md b/doc/models/loyalty-account-mapping.md index eec05c84..1bccff13 100644 --- a/doc/models/loyalty-account-mapping.md +++ b/doc/models/loyalty-account-mapping.md @@ -15,18 +15,14 @@ Currently, a loyalty account can only be mapped to a buyer by phone number. For | 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 (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 | +| `phoneNumber` | `?string` | Optional | The phone number of the buyer, in E.164 format. For example, "+14155551111". | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | ## Example (as JSON) ```json { "id": "id0", - "type": "PHONE", - "value": "value2", "created_at": "created_at2", "phone_number": "phone_number2" } diff --git a/doc/models/loyalty-account.md b/doc/models/loyalty-account.md index cad5d961..eeaedc58 100644 --- a/doc/models/loyalty-account.md +++ b/doc/models/loyalty-account.md @@ -13,7 +13,6 @@ 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) | 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 | @@ -28,19 +27,11 @@ Describes a loyalty account. For more information, see ```json { "id": "id0", - "mappings": [ - { - "id": "id4", - "type": "PHONE", - "value": "value6", - "created_at": "created_at8", - "phone_number": "phone_number8" - } - ], "program_id": "program_id0", "balance": 64, "lifetime_points": 88, - "customer_id": "customer_id8" + "customer_id": "customer_id8", + "enrolled_at": "enrolled_at0" } ``` diff --git a/doc/models/order-created.md b/doc/models/order-created.md index 2c5085b0..2a4ed480 100644 --- a/doc/models/order-created.md +++ b/doc/models/order-created.md @@ -10,10 +10,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `orderId` | `?string` | Optional | The order's unique ID. | getOrderId(): ?string | setOrderId(?string orderId): 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 | -| `locationId` | `?string` | Optional | The ID of the merchant location this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore 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 | +| `locationId` | `?string` | Optional | The ID of the seller location that this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | | `state` | [`?string (OrderState)`](/doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `createdAt` | `?string` | Optional | Timestamp for when the order was created in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | ## Example (as JSON) diff --git a/doc/models/order-entry.md b/doc/models/order-entry.md index ec5ec7da..78cc2114 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](/doc/models/order.md) that is returned when -`returned_entries` is true on a [SearchOrdersRequest](/doc/apis/orders.md#search-orders) +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 @@ -12,9 +12,9 @@ A lightweight description of an [Order](/doc/models/order.md) that is returned w | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `orderId` | `?string` | Optional | The id of the Order | getOrderId(): ?string | setOrderId(?string orderId): 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 | -| `locationId` | `?string` | Optional | The location id the Order belongs to. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `orderId` | `?string` | Optional | The ID of the order. | getOrderId(): ?string | setOrderId(?string orderId): void | +| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore 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 | +| `locationId` | `?string` | Optional | The location ID the order belongs to. | getLocationId(): ?string | setLocationId(?string locationId): void | ## Example (as JSON) 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 9abb2cd6..05a5db4d 100644 --- a/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md +++ b/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md @@ -11,8 +11,8 @@ 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](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 | +| `curbsideDetails` | `?string` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | getCurbsideDetails(): ?string | setCurbsideDetails(?string curbsideDetails): void | +| `buyerArrivedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getBuyerArrivedAt(): ?string | setBuyerArrivedAt(?string buyerArrivedAt): void | ## Example (as JSON) diff --git a/doc/models/order-fulfillment-pickup-details-schedule-type.md b/doc/models/order-fulfillment-pickup-details-schedule-type.md index ce6786ae..6e774d4a 100644 --- a/doc/models/order-fulfillment-pickup-details-schedule-type.md +++ b/doc/models/order-fulfillment-pickup-details-schedule-type.md @@ -11,6 +11,6 @@ The schedule type of the pickup fulfillment. | Name | Description | | --- | --- | -| `SCHEDULED` | Indicates the fulfillment will be picked up at a scheduled pickup time. | -| `ASAP` | Indicates the fulfillment will be picked up as soon as possible and
should be prepared immediately. | +| `SCHEDULED` | Indicates that the fulfillment will be picked up at a scheduled pickup time. | +| `ASAP` | Indicates that the fulfillment will be picked up as soon as possible and
should be prepared immediately. | diff --git a/doc/models/order-fulfillment-pickup-details.md b/doc/models/order-fulfillment-pickup-details.md index 19b1b51c..403a72a1 100644 --- a/doc/models/order-fulfillment-pickup-details.md +++ b/doc/models/order-fulfillment-pickup-details.md @@ -11,23 +11,23 @@ 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](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 | +| `recipient` | [`?OrderFulfillmentRecipient`](/doc/models/order-fulfillment-recipient.md) | Optional | Contains information about the recipient of a fulfillment. | getRecipient(): ?OrderFulfillmentRecipient | setRecipient(?OrderFulfillmentRecipient recipient): void | +| `expiresAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when this fulfillment expires if it is not accepted. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set up to 7 days in the future.
If `expires_at` is not set, this pickup fulfillment is 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
is automatically moved to the `COMPLETED` state. The duration must be in RFC 3339
format (for example, "P1W3D").

If not set, this pickup fulfillment remains 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](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](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 | +| `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 RFC 3339 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 RFC 3339 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.
The duration must be in RFC 3339 format (for example, "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 application and set by the API.
**Constraints**: *Maximum Length*: `500` | getNote(): ?string | setNote(?string note): void | +| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format
(for example, "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. The timestamp must be in RFC 3339 format
(for example, "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. The timestamp must be in RFC 3339 format
(for example, "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. The timestamp must be in RFC 3339 format
(for example, "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. The timestamp must be in RFC 3339 format
(for example, "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. The timestamp must be in RFC 3339 format
(for example, "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)
indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format
(for example, "2016-09-04T23:59:33.123Z"). | getCanceledAt(): ?string | setCanceledAt(?string canceledAt): void | +| `cancelReason` | `?string` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | getCancelReason(): ?string | setCancelReason(?string cancelReason): void | +| `isCurbsidePickup` | `?bool` | Optional | If set to `true`, indicates that 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 | ## Example (as JSON) diff --git a/doc/models/order-fulfillment-recipient.md b/doc/models/order-fulfillment-recipient.md index 2bf3ad61..437db6fb 100644 --- a/doc/models/order-fulfillment-recipient.md +++ b/doc/models/order-fulfillment-recipient.md @@ -1,7 +1,7 @@ # Order Fulfillment Recipient -Contains information on the recipient of a fulfillment. +Contains information about the recipient of a fulfillment. ## Structure @@ -11,10 +11,10 @@ Contains information on the recipient of a fulfillment. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `customerId` | `?string` | Optional | The Customer ID of the customer associated with the fulfillment.

If `customer_id` is provided, the fulfillment recipient's `display_name`,
`email_address`, and `phone_number` are automatically populated from the
targeted customer profile. If these fields are set in the request, the request
values will override the information from the customer profile. If the
targeted customer profile does not contain the necessary information and
these fields are left unset, the request will result in an error.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | -| `displayName` | `?string` | Optional | The display name of the fulfillment recipient.

If provided, overrides the value pulled from the customer profile indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getDisplayName(): ?string | setDisplayName(?string displayName): void | -| `emailAddress` | `?string` | Optional | The email address of the fulfillment recipient.

If provided, overrides the value pulled from the customer profile indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | -| `phoneNumber` | `?string` | Optional | The phone number of the fulfillment recipient.

If provided, overrides the value pulled from the customer profile indicated by `customer_id`.
**Constraints**: *Maximum Length*: `17` | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | +| `customerId` | `?string` | Optional | The customer ID of the customer associated with the fulfillment.

If `customer_id` is provided, the fulfillment recipient's `display_name`,
`email_address`, and `phone_number` are automatically populated from the
targeted customer profile. If these fields are set in the request, the request
values overrides the information from the customer profile. If the
targeted customer profile does not contain the necessary information and
these fields are left unset, the request results in an error.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `displayName` | `?string` | Optional | The display name of the fulfillment recipient.

If provided, the display name overrides the value pulled from the customer profile indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getDisplayName(): ?string | setDisplayName(?string displayName): void | +| `emailAddress` | `?string` | Optional | The email address of the fulfillment recipient.

If provided, the email address overrides the value pulled from the customer profile indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void | +| `phoneNumber` | `?string` | Optional | The phone number of the fulfillment recipient.

If provided, the phone number overrides the value pulled from the customer profile indicated by `customer_id`.
**Constraints**: *Maximum Length*: `17` | getPhoneNumber(): ?string | setPhoneNumber(?string phoneNumber): void | | `address` | [`?Address`](/doc/models/address.md) | Optional | Represents a physical address. | getAddress(): ?Address | setAddress(?Address address): void | ## Example (as JSON) diff --git a/doc/models/order-fulfillment-shipment-details.md b/doc/models/order-fulfillment-shipment-details.md index bbeb09d0..293d18bf 100644 --- a/doc/models/order-fulfillment-shipment-details.md +++ b/doc/models/order-fulfillment-shipment-details.md @@ -1,7 +1,7 @@ # Order Fulfillment Shipment Details -Contains details necessary to fulfill a shipment order. +Contains the details necessary to fulfill a shipment order. ## Structure @@ -11,20 +11,20 @@ Contains details necessary to fulfill a shipment 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 | -| `carrier` | `?string` | Optional | The shipping carrier being used to ship this fulfillment
e.g. UPS, FedEx, USPS, etc.
**Constraints**: *Maximum Length*: `50` | getCarrier(): ?string | setCarrier(?string carrier): void | +| `recipient` | [`?OrderFulfillmentRecipient`](/doc/models/order-fulfillment-recipient.md) | Optional | Contains information about the recipient of a fulfillment. | getRecipient(): ?OrderFulfillmentRecipient | setRecipient(?OrderFulfillmentRecipient recipient): void | +| `carrier` | `?string` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | getCarrier(): ?string | setCarrier(?string carrier): void | | `shippingNote` | `?string` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | getShippingNote(): ?string | setShippingNote(?string shippingNote): void | -| `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 | +| `shippingType` | `?string` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or 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](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 | +| `placedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment was requested. The timestamp must be in RFC 3339 format
(for example, "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 was moved to the `RESERVED` state, which indicates that preparation
of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "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, which indicates that the
fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "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.
The timestamp must be in RFC 3339 format (for example, "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, which indicates that
the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format
(for example, "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.
The timestamp must be in RFC 3339 format (for example, "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](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 | +| `failedAt` | `?string` | Optional | The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates)
indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format
(for example, "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-state.md b/doc/models/order-fulfillment-state.md index f52c6723..0885e821 100644 --- a/doc/models/order-fulfillment-state.md +++ b/doc/models/order-fulfillment-state.md @@ -11,10 +11,10 @@ The current state of this fulfillment. | Name | Description | | --- | --- | -| `PROPOSED` | Indicates the fulfillment has been proposed. | -| `RESERVED` | Indicates the fulfillment has been reserved. | -| `PREPARED` | Indicates the fulfillment has been prepared. | -| `COMPLETED` | Indicates the fulfillment was successfully completed. | -| `CANCELED` | Indicates the fulfillment was canceled. | -| `FAILED` | Indicates the fulfillment failed to be completed but was not explicitly
canceled. | +| `PROPOSED` | Indicates that the fulfillment has been proposed. | +| `RESERVED` | Indicates that the fulfillment has been reserved. | +| `PREPARED` | Indicates that the fulfillment has been prepared. | +| `COMPLETED` | Indicates that the fulfillment was successfully completed. | +| `CANCELED` | Indicates that the fulfillment was canceled. | +| `FAILED` | Indicates that the fulfillment failed to be completed, but was not explicitly
canceled. | diff --git a/doc/models/order-fulfillment-updated-update.md b/doc/models/order-fulfillment-updated-update.md index 156967df..43e5802e 100644 --- a/doc/models/order-fulfillment-updated-update.md +++ b/doc/models/order-fulfillment-updated-update.md @@ -11,7 +11,7 @@ Information about fulfillment updates. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `fulfillmentUid` | `?string` | Optional | Unique ID that identifies the fulfillment only within this order. | getFulfillmentUid(): ?string | setFulfillmentUid(?string fulfillmentUid): void | +| `fulfillmentUid` | `?string` | Optional | A unique ID that identifies the fulfillment only within this order. | getFulfillmentUid(): ?string | setFulfillmentUid(?string fulfillmentUid): void | | `oldState` | [`?string (OrderFulfillmentState)`](/doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | getOldState(): ?string | setOldState(?string oldState): void | | `newState` | [`?string (OrderFulfillmentState)`](/doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | getNewState(): ?string | setNewState(?string newState): void | diff --git a/doc/models/order-fulfillment-updated.md b/doc/models/order-fulfillment-updated.md index 91db8feb..d09316de 100644 --- a/doc/models/order-fulfillment-updated.md +++ b/doc/models/order-fulfillment-updated.md @@ -10,11 +10,11 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `orderId` | `?string` | Optional | The order's unique ID. | getOrderId(): ?string | setOrderId(?string orderId): 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 | -| `locationId` | `?string` | Optional | The ID of the merchant location this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore 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 | +| `locationId` | `?string` | Optional | The ID of the seller location that this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | | `state` | [`?string (OrderState)`](/doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `createdAt` | `?string` | Optional | Timestamp for when the order was created in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | Timestamp for when the order was last updated in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | +| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `updatedAt` | `?string` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | | `fulfillmentUpdate` | [`?(OrderFulfillmentUpdatedUpdate[])`](/doc/models/order-fulfillment-updated-update.md) | Optional | The fulfillments that were updated with this version change. | getFulfillmentUpdate(): ?array | setFulfillmentUpdate(?array fulfillmentUpdate): void | ## Example (as JSON) diff --git a/doc/models/order-fulfillment.md b/doc/models/order-fulfillment.md index 69b1f756..0d7f3dfc 100644 --- a/doc/models/order-fulfillment.md +++ b/doc/models/order-fulfillment.md @@ -1,7 +1,7 @@ # Order Fulfillment -Contains details on how to fulfill this order. +Contains details about how to fulfill this order. ## Structure @@ -11,12 +11,12 @@ Contains details on how to fulfill this order. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `uid` | `?string` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `type` | [`?string (OrderFulfillmentType)`](/doc/models/order-fulfillment-type.md) | Optional | The type of fulfillment. | getType(): ?string | setType(?string type): void | | `state` | [`?string (OrderFulfillmentState)`](/doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | getState(): ?string | setState(?string state): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this fulfillment. 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 fulfillment. 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 (such as personally
identifiable information or card details).

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

Values have a maximum length of 255 characters.

An application can 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.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | | `pickupDetails` | [`?OrderFulfillmentPickupDetails`](/doc/models/order-fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | getPickupDetails(): ?OrderFulfillmentPickupDetails | setPickupDetails(?OrderFulfillmentPickupDetails pickupDetails): void | -| `shipmentDetails` | [`?OrderFulfillmentShipmentDetails`](/doc/models/order-fulfillment-shipment-details.md) | Optional | Contains details necessary to fulfill a shipment order. | getShipmentDetails(): ?OrderFulfillmentShipmentDetails | setShipmentDetails(?OrderFulfillmentShipmentDetails shipmentDetails): void | +| `shipmentDetails` | [`?OrderFulfillmentShipmentDetails`](/doc/models/order-fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | getShipmentDetails(): ?OrderFulfillmentShipmentDetails | setShipmentDetails(?OrderFulfillmentShipmentDetails shipmentDetails): void | ## Example (as JSON) diff --git a/doc/models/order-line-item-applied-discount.md b/doc/models/order-line-item-applied-discount.md index 36b1cb77..123af060 100644 --- a/doc/models/order-line-item-applied-discount.md +++ b/doc/models/order-line-item-applied-discount.md @@ -3,9 +3,9 @@ Represents an applied portion of a discount to a line item in an order. -Order scoped discounts will automatically have applied discounts present for each line item. -Line item scoped discounts must have applied discounts added manually for any applicable line -items. The corresponding applied money will automatically be computed based on participating +Order scoped discounts have automatically applied discounts present for each line item. +Line-item scoped discounts must have applied discounts added manually for any applicable line +items. The corresponding applied money is automatically computed based on participating line items. ## Structure @@ -16,8 +16,8 @@ line items. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the applied discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `discountUid` | `string` | Required | The `uid` of the discount the applied discount represents. Must
reference a discount present in the `order.discounts` field.

This field is immutable. To change which discounts apply to a line item,
you must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getDiscountUid(): string | setDiscountUid(string discountUid): void | +| `uid` | `?string` | Optional | A unique ID that identifies the applied discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `discountUid` | `string` | Required | The `uid` of the discount that the applied discount represents. It must
reference a discount present in the `order.discounts` field.

This field is immutable. To change which discounts apply to a line item,
you must delete the discount and re-add it as a new `OrderLineItemAppliedDiscount`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getDiscountUid(): string | setDiscountUid(string discountUid): 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 | ## Example (as JSON) diff --git a/doc/models/order-line-item-applied-tax.md b/doc/models/order-line-item-applied-tax.md index c3082dd1..f340f7c9 100644 --- a/doc/models/order-line-item-applied-tax.md +++ b/doc/models/order-line-item-applied-tax.md @@ -16,8 +16,8 @@ set of participating line items. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the applied tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `taxUid` | `string` | Required | The `uid` of the tax for which this applied tax represents. Must reference
a tax present in the `order.taxes` field.

This field is immutable. To change which taxes apply to a line item, delete and add new
`OrderLineItemAppliedTax`s.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getTaxUid(): string | setTaxUid(string taxUid): void | +| `uid` | `?string` | Optional | A unique ID that identifies the applied tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `taxUid` | `string` | Required | The `uid` of the tax for which this applied tax represents. It must reference
a tax present in the `order.taxes` field.

This field is immutable. To change which taxes apply to a line item, delete and add a new
`OrderLineItemAppliedTax`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | getTaxUid(): string | setTaxUid(string taxUid): 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 | ## Example (as JSON) diff --git a/doc/models/order-line-item-discount-scope.md b/doc/models/order-line-item-discount-scope.md index 15ca9d82..ccb5bb8a 100644 --- a/doc/models/order-line-item-discount-scope.md +++ b/doc/models/order-line-item-discount-scope.md @@ -1,7 +1,7 @@ # Order Line Item Discount Scope -Indicates whether this is a line item or order level discount. +Indicates whether this is a line-item or order-level discount. ## Enumeration diff --git a/doc/models/order-line-item-discount-type.md b/doc/models/order-line-item-discount-type.md index d947bd88..99dc297f 100644 --- a/doc/models/order-line-item-discount-type.md +++ b/doc/models/order-line-item-discount-type.md @@ -12,8 +12,8 @@ Indicates how the discount is applied to the associated line item or order. | Name | Description | | --- | --- | | `UNKNOWN_DISCOUNT` | Used for reporting only.
The original transaction discount type is currently not supported by the API. | -| `FIXED_PERCENTAGE` | Apply the discount as a fixed percentage (e.g., 5%) off the item price. | -| `FIXED_AMOUNT` | Apply the discount as a fixed monetary value (e.g., $1.00) off the item price. | +| `FIXED_PERCENTAGE` | Apply the discount as a fixed percentage (such as 5%) off the item price. | +| `FIXED_AMOUNT` | Apply the discount as a fixed monetary value (such as $1.00) off the item price. | | `VARIABLE_PERCENTAGE` | Apply the discount as a variable percentage based on the item
price.

The specific discount percentage of a `VARIABLE_PERCENTAGE` discount
is assigned at the time of the purchase. | | `VARIABLE_AMOUNT` | Apply the discount as a variable amount based on the item price.

The specific discount amount of a `VARIABLE_AMOUNT` discount
is assigned at the time of the purchase. | diff --git a/doc/models/order-line-item-discount.md b/doc/models/order-line-item-discount.md index 2f49f988..e79fb8f1 100644 --- a/doc/models/order-line-item-discount.md +++ b/doc/models/order-line-item-discount.md @@ -16,17 +16,17 @@ 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](/doc/models/catalog-discount.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `uid` | `?string` | Optional | A 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](/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 | -| `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](/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 | +| `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 (such as personally
identifiable information or card details).

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

Values have a maximum length of 255 characters.

An application can 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.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | 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 IDs 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 ID 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 6899f5df..fdb74b08 100644 --- a/doc/models/order-line-item-modifier.md +++ b/doc/models/order-line-item-modifier.md @@ -11,8 +11,8 @@ A [CatalogModifier](/doc/models/catalog-modifier.md). | 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](/doc/models/catalog-modifier.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `uid` | `?string` | Optional | A 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](/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-pricing-blocklists-blocked-discount.md b/doc/models/order-line-item-pricing-blocklists-blocked-discount.md index a0dcd814..65de04fb 100644 --- a/doc/models/order-line-item-pricing-blocklists-blocked-discount.md +++ b/doc/models/order-line-item-pricing-blocklists-blocked-discount.md @@ -12,9 +12,9 @@ identified by either `discount_uid` or `discount_catalog_object_id`, but not bot | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID of the `BlockedDiscount` within the order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `discountUid` | `?string` | Optional | The `uid` of the discount that should be blocked. Use this field to block
ad-hoc discounts. For catalog discounts use the `discount_catalog_object_id` field.
**Constraints**: *Maximum Length*: `60` | getDiscountUid(): ?string | setDiscountUid(?string discountUid): void | -| `discountCatalogObjectId` | `?string` | Optional | The `catalog_object_id` of the discount that should be blocked.
Use this field to block catalog discounts. For ad-hoc discounts use the
`discount_uid` field.
**Constraints**: *Maximum Length*: `192` | getDiscountCatalogObjectId(): ?string | setDiscountCatalogObjectId(?string discountCatalogObjectId): void | +| `uid` | `?string` | Optional | A unique ID of the `BlockedDiscount` within the order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `discountUid` | `?string` | Optional | The `uid` of the discount that should be blocked. Use this field to block
ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field.
**Constraints**: *Maximum Length*: `60` | getDiscountUid(): ?string | setDiscountUid(?string discountUid): void | +| `discountCatalogObjectId` | `?string` | Optional | The `catalog_object_id` of the discount that should be blocked.
Use this field to block catalog discounts. For ad hoc discounts, use the
`discount_uid` field.
**Constraints**: *Maximum Length*: `192` | getDiscountCatalogObjectId(): ?string | setDiscountCatalogObjectId(?string discountCatalogObjectId): void | ## Example (as JSON) diff --git a/doc/models/order-line-item-pricing-blocklists-blocked-tax.md b/doc/models/order-line-item-pricing-blocklists-blocked-tax.md index 8c5ca84f..7088c8fc 100644 --- a/doc/models/order-line-item-pricing-blocklists-blocked-tax.md +++ b/doc/models/order-line-item-pricing-blocklists-blocked-tax.md @@ -12,9 +12,9 @@ identified by either `tax_uid` or `tax_catalog_object_id`, but not both. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID of the `BlockedTax` within the order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `taxUid` | `?string` | Optional | The `uid` of the tax that should be blocked. Use this field to block
ad-hoc taxes. For catalog taxes use the `tax_catalog_object_id` field.
**Constraints**: *Maximum Length*: `60` | getTaxUid(): ?string | setTaxUid(?string taxUid): void | -| `taxCatalogObjectId` | `?string` | Optional | The `catalog_object_id` of the tax that should be blocked.
Use this field to block catalog taxes. For ad-hoc taxes use the
`tax_uid` field.
**Constraints**: *Maximum Length*: `192` | getTaxCatalogObjectId(): ?string | setTaxCatalogObjectId(?string taxCatalogObjectId): void | +| `uid` | `?string` | Optional | A unique ID of the `BlockedTax` within the order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `taxUid` | `?string` | Optional | The `uid` of the tax that should be blocked. Use this field to block
ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field.
**Constraints**: *Maximum Length*: `60` | getTaxUid(): ?string | setTaxUid(?string taxUid): void | +| `taxCatalogObjectId` | `?string` | Optional | The `catalog_object_id` of the tax that should be blocked.
Use this field to block catalog taxes. For ad hoc taxes, use the
`tax_uid` field.
**Constraints**: *Maximum Length*: `192` | getTaxCatalogObjectId(): ?string | setTaxCatalogObjectId(?string taxCatalogObjectId): void | ## Example (as JSON) diff --git a/doc/models/order-line-item-pricing-blocklists.md b/doc/models/order-line-item-pricing-blocklists.md index f0993956..0abe413f 100644 --- a/doc/models/order-line-item-pricing-blocklists.md +++ b/doc/models/order-line-item-pricing-blocklists.md @@ -13,8 +13,8 @@ automatic application to a line item. For more information, see | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `blockedDiscounts` | [`?(OrderLineItemPricingBlocklistsBlockedDiscount[])`](/doc/models/order-line-item-pricing-blocklists-blocked-discount.md) | Optional | A list of discounts blocked from applying to the line item.
Discounts can be blocked by the `discount_uid` (for ad-hoc discounts) or
the `discount_catalog_object_id` (for catalog discounts). | getBlockedDiscounts(): ?array | setBlockedDiscounts(?array blockedDiscounts): void | -| `blockedTaxes` | [`?(OrderLineItemPricingBlocklistsBlockedTax[])`](/doc/models/order-line-item-pricing-blocklists-blocked-tax.md) | Optional | A list of taxes blocked from applying to the line item.
Taxes can be blocked by the `tax_uid` (for ad-hoc taxes) or
the `tax_catalog_object_id` (for catalog taxes). | getBlockedTaxes(): ?array | setBlockedTaxes(?array blockedTaxes): void | +| `blockedDiscounts` | [`?(OrderLineItemPricingBlocklistsBlockedDiscount[])`](/doc/models/order-line-item-pricing-blocklists-blocked-discount.md) | Optional | A list of discounts blocked from applying to the line item.
Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or
the `discount_catalog_object_id` (for catalog discounts). | getBlockedDiscounts(): ?array | setBlockedDiscounts(?array blockedDiscounts): void | +| `blockedTaxes` | [`?(OrderLineItemPricingBlocklistsBlockedTax[])`](/doc/models/order-line-item-pricing-blocklists-blocked-tax.md) | Optional | A list of taxes blocked from applying to the line item.
Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or
the `tax_catalog_object_id` (for catalog taxes). | getBlockedTaxes(): ?array | setBlockedTaxes(?array blockedTaxes): void | ## Example (as JSON) diff --git a/doc/models/order-line-item-tax-scope.md b/doc/models/order-line-item-tax-scope.md index a4678c7d..3a27c8fd 100644 --- a/doc/models/order-line-item-tax-scope.md +++ b/doc/models/order-line-item-tax-scope.md @@ -1,7 +1,7 @@ # Order Line Item Tax Scope -Indicates whether this is a line item or order level tax. +Indicates whether this is a line-item or order-level tax. ## Enumeration diff --git a/doc/models/order-line-item-tax-type.md b/doc/models/order-line-item-tax-type.md index 81b3096f..780dfa36 100644 --- a/doc/models/order-line-item-tax-type.md +++ b/doc/models/order-line-item-tax-type.md @@ -12,6 +12,6 @@ Indicates how the tax is applied to the associated line item or order. | Name | Description | | --- | --- | | `UNKNOWN_TAX` | Used for reporting only.
The original transaction tax type is currently not supported by the API. | -| `ADDITIVE` | The tax is an additive tax. The tax amount is added on top of the price.
For example, an item with a cost of 1.00 USD and a 10% additive tax would have a total
cost to the buyer of 1.10 USD. | -| `INCLUSIVE` | The tax is an inclusive tax. Inclusive taxes are already included
in the line item price or order total. For example, an item with cost
1.00 USD with a 10% inclusive tax would have a pre-tax cost of 0.91 USD
(91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to
the buyer. | +| `ADDITIVE` | The tax is an additive tax. The tax amount is added on top of the price.
For example, an item with a cost of 1.00 USD and a 10% additive tax has a total
cost to the buyer of 1.10 USD. | +| `INCLUSIVE` | The tax is an inclusive tax. Inclusive taxes are already included
in the line item price or order total. For example, an item with a cost of
1.00 USD and a 10% inclusive tax has a pretax cost of 0.91 USD
(91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to
the buyer. | diff --git a/doc/models/order-line-item-tax.md b/doc/models/order-line-item-tax.md index 170b0bed..2191c114 100644 --- a/doc/models/order-line-item-tax.md +++ b/doc/models/order-line-item-tax.md @@ -15,14 +15,14 @@ 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](/doc/models/catalog-tax.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `uid` | `?string` | Optional | A 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](/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 (such as personally
identifiable information or card details).

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

Values have a maximum length of 255 characters.

An application can 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.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | 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 | +| `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 | ## Example (as JSON) diff --git a/doc/models/order-line-item.md b/doc/models/order-line-item.md index ffffa4fb..430b3e4d 100644 --- a/doc/models/order-line-item.md +++ b/doc/models/order-line-item.md @@ -12,17 +12,17 @@ product to purchase, with its own quantity and price details. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the line item only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `uid` | `?string` | Optional | A unique ID that identifies the line item only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | | `name` | `?string` | Optional | The name of the line item.
**Constraints**: *Maximum Length*: `512` | getName(): ?string | setName(?string name): void | -| `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 | +| `quantity` | `string` | Required | The quantity purchased, formatted as a decimal number.
For example, `"3"`.

Line items with a quantity of `"0"` are automatically removed
when 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 that
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](/doc/models/catalog-item-variation.md) 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 | +| `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 (such as personally
identifiable information or card details).

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

Values have a maximum length of 255 characters.

An application can 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.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | 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 | +| `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` is 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` is 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 | | `variationTotalPriceMoney` | [`?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. | getVariationTotalPriceMoney(): ?Money | setVariationTotalPriceMoney(?Money variationTotalPriceMoney): void | | `grossSalesMoney` | [`?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. | getGrossSalesMoney(): ?Money | setGrossSalesMoney(?Money grossSalesMoney): void | diff --git a/doc/models/order-pricing-options.md b/doc/models/order-pricing-options.md index aa1c65a9..79d2ca94 100644 --- a/doc/models/order-pricing-options.md +++ b/doc/models/order-pricing-options.md @@ -2,7 +2,7 @@ # Order Pricing Options 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 +They can be used, for example, to apply automatic price adjustments that are based on preconfigured [pricing rules](/doc/models/catalog-pricing-rule.md). ## Structure diff --git a/doc/models/order-quantity-unit.md b/doc/models/order-quantity-unit.md index 553ac5b1..63dfef6a 100644 --- a/doc/models/order-quantity-unit.md +++ b/doc/models/order-quantity-unit.md @@ -1,7 +1,7 @@ # Order Quantity Unit -Contains the measurement unit for a quantity and a precision which +Contains the measurement unit for a quantity and a precision that specifies the number of digits after the decimal point for decimal quantities. ## Structure @@ -13,7 +13,7 @@ specifies the number of digits after the decimal point for decimal quantities. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `measurementUnit` | [`?MeasurementUnit`](/doc/models/measurement-unit.md) | Optional | Represents a unit of measurement to use with a quantity, such as ounces
or inches. Exactly one of the following fields are required: `custom_unit`,
`area_unit`, `length_unit`, `volume_unit`, and `weight_unit`. | getMeasurementUnit(): ?MeasurementUnit | setMeasurementUnit(?MeasurementUnit measurementUnit): void | -| `precision` | `?int` | Optional | For non-integer quantities, represents the number of digits after the decimal point that are
recorded for this quantity.

For example, a precision of 1 allows quantities like `"1.0"` and `"1.1"`, but not `"1.01"`.

Min: 0. Max: 5. | getPrecision(): ?int | setPrecision(?int precision): void | +| `precision` | `?int` | Optional | For non-integer quantities, represents the number of digits after the decimal point that are
recorded for this quantity.

For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`.

Min: 0. Max: 5. | getPrecision(): ?int | setPrecision(?int precision): void | ## Example (as JSON) diff --git a/doc/models/order-return-discount.md b/doc/models/order-return-discount.md index 6cf37b41..69fdba0b 100644 --- a/doc/models/order-return-discount.md +++ b/doc/models/order-return-discount.md @@ -16,15 +16,15 @@ order subtotal. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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](/doc/models/catalog-discount.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `uid` | `?string` | Optional | A unique ID that identifies the returned discount only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `sourceDiscountUid` | `?string` | Optional | The discount `uid` from the order that 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](/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 | +| `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 | | `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 | -| `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 | +| `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 | ## Example (as JSON) diff --git a/doc/models/order-return-line-item-modifier.md b/doc/models/order-return-line-item-modifier.md index c2ba61e8..75de0771 100644 --- a/doc/models/order-return-line-item-modifier.md +++ b/doc/models/order-return-line-item-modifier.md @@ -11,9 +11,9 @@ A line item modifier being returned. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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](/doc/models/catalog-modifier.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `uid` | `?string` | Optional | A unique ID that identifies the return modifier only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `sourceModifierUid` | `?string` | Optional | The modifier `uid` from the order's line item that 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](/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 58c0f07b..1ae98ba3 100644 --- a/doc/models/order-return-line-item.md +++ b/doc/models/order-return-line-item.md @@ -1,7 +1,7 @@ # Order Return Line Item -The line item being returned in an Order. +The line item being returned in an order. ## Structure @@ -11,17 +11,17 @@ The line item being returned in an Order. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique identifier for this return line item entry.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceLineItemUid` | `?string` | Optional | `uid` of the LineItem in the original sale Order.
**Constraints**: *Maximum Length*: `60` | getSourceLineItemUid(): ?string | setSourceLineItemUid(?string sourceLineItemUid): void | +| `uid` | `?string` | Optional | A unique ID for this return line-item entry.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `sourceLineItemUid` | `?string` | Optional | The `uid` of the line item in the original sale order.
**Constraints**: *Maximum Length*: `60` | getSourceLineItemUid(): ?string | setSourceLineItemUid(?string sourceLineItemUid): void | | `name` | `?string` | Optional | The name of the line item.
**Constraints**: *Maximum Length*: `512` | getName(): ?string | setName(?string name): void | -| `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](/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 | +| `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 that
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 return line item.
**Constraints**: *Maximum Length*: `2000` | getNote(): ?string | setNote(?string note): void | +| `catalogObjectId` | `?string` | Optional | The [CatalogItemVariation](/doc/models/catalog-item-variation.md) ID applied to this return line item.
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `variationName` | `?string` | Optional | The name of the variation applied to this return 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](/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 | +| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to `OrderReturnTax` entities applied to the return line item. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level
`OrderReturnTax` applied to the return line item. On reads, the applied amount
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 return line item. Each
`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level
`OrderReturnDiscount` applied to the return line item. On reads, the applied amount
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 | | `variationTotalPriceMoney` | [`?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. | getVariationTotalPriceMoney(): ?Money | setVariationTotalPriceMoney(?Money variationTotalPriceMoney): void | | `grossReturnMoney` | [`?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. | getGrossReturnMoney(): ?Money | setGrossReturnMoney(?Money grossReturnMoney): void | diff --git a/doc/models/order-return-service-charge.md b/doc/models/order-return-service-charge.md index 79bee3ec..6754beb0 100644 --- a/doc/models/order-return-service-charge.md +++ b/doc/models/order-return-service-charge.md @@ -11,18 +11,18 @@ Represents the service charge applied to the original order. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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 | +| `uid` | `?string` | Optional | A 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 | The service charge `uid` from the order containing the original
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 [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 | +| `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%.

Either `percentage` or `amount_money` should be set, but not both.
**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 | | `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 | | `totalTaxMoney` | [`?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. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `calculationPhase` | [`?string (OrderServiceChargeCalculationPhase)`](/doc/models/order-service-charge-calculation-phase.md) | Optional | Represents a phase in the process of calculating order totals.
Service charges are applied __after__ the indicated phase.

[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | +| `calculationPhase` | [`?string (OrderServiceChargeCalculationPhase)`](/doc/models/order-service-charge-calculation-phase.md) | Optional | Represents a phase in the process of calculating order totals.
Service charges are applied after the indicated phase.

[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | | `taxable` | `?bool` | Optional | Indicates whether the surcharge can be taxed. Service charges
calculated in the `TOTAL_PHASE` cannot be marked as taxable. | getTaxable(): ?bool | setTaxable(?bool taxable): void | -| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to `OrderReturnTax` entities applied to the
`OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid`
that references the `uid` of a top-level `OrderReturnTax` that is being
applied to the `OrderReturnServiceCharge`. On reads, the amount applied is
populated. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | +| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to `OrderReturnTax` entities applied to the
`OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid`
that references the `uid` of a top-level `OrderReturnTax` that is being
applied to the `OrderReturnServiceCharge`. On reads, the applied amount is
populated. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | ## Example (as JSON) diff --git a/doc/models/order-return-tax.md b/doc/models/order-return-tax.md index 61df2f7f..a8a0d88d 100644 --- a/doc/models/order-return-tax.md +++ b/doc/models/order-return-tax.md @@ -15,14 +15,14 @@ order subtotal. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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](/doc/models/catalog-tax.md).
**Constraints**: *Maximum Length*: `192` | getCatalogObjectId(): ?string | setCatalogObjectId(?string catalogObjectId): void | +| `uid` | `?string` | Optional | A unique ID that identifies the returned tax only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `sourceTaxUid` | `?string` | Optional | The tax `uid` from the order that contains the original tax charge.
**Constraints**: *Maximum Length*: `60` | getSourceTaxUid(): ?string | setSourceTaxUid(?string sourceTaxUid): 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 | | `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 | +| `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 | ## Example (as JSON) diff --git a/doc/models/order-return.md b/doc/models/order-return.md index 635971b1..868cfc4e 100644 --- a/doc/models/order-return.md +++ b/doc/models/order-return.md @@ -1,7 +1,7 @@ # Order Return -The set of line items, service charges, taxes, discounts, tips, etc. being returned in an Order. +The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. ## Structure @@ -11,13 +11,13 @@ The set of line items, service charges, taxes, discounts, tips, etc. being retur | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the return only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `sourceOrderId` | `?string` | Optional | Order which contains the original sale of these returned line items. This will be unset
for unlinked returns. | getSourceOrderId(): ?string | setSourceOrderId(?string sourceOrderId): void | -| `returnLineItems` | [`?(OrderReturnLineItem[])`](/doc/models/order-return-line-item.md) | Optional | Collection of line items which are being returned. | getReturnLineItems(): ?array | setReturnLineItems(?array returnLineItems): void | -| `returnServiceCharges` | [`?(OrderReturnServiceCharge[])`](/doc/models/order-return-service-charge.md) | Optional | Collection of service charges which are being returned. | getReturnServiceCharges(): ?array | setReturnServiceCharges(?array returnServiceCharges): void | -| `returnTaxes` | [`?(OrderReturnTax[])`](/doc/models/order-return-tax.md) | Optional | Collection of references to taxes being returned for an order, including the total
applied tax amount to be returned. The taxes must reference a top-level tax ID from the source
order. | getReturnTaxes(): ?array | setReturnTaxes(?array returnTaxes): void | -| `returnDiscounts` | [`?(OrderReturnDiscount[])`](/doc/models/order-return-discount.md) | Optional | Collection of references to discounts being returned for an order, including the total
applied discount amount to be returned. The discounts must reference a top-level discount ID
from the source order. | getReturnDiscounts(): ?array | setReturnDiscounts(?array returnDiscounts): void | -| `roundingAdjustment` | [`?OrderRoundingAdjustment`](/doc/models/order-rounding-adjustment.md) | Optional | A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding
when the minimum unit of account is smaller than the lowest physical denomination of currency. | getRoundingAdjustment(): ?OrderRoundingAdjustment | setRoundingAdjustment(?OrderRoundingAdjustment roundingAdjustment): void | +| `uid` | `?string` | Optional | A unique ID that identifies the return only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `sourceOrderId` | `?string` | Optional | An order that contains the original sale of these return line items. This is unset
for unlinked returns. | getSourceOrderId(): ?string | setSourceOrderId(?string sourceOrderId): void | +| `returnLineItems` | [`?(OrderReturnLineItem[])`](/doc/models/order-return-line-item.md) | Optional | A collection of line items that are being returned. | getReturnLineItems(): ?array | setReturnLineItems(?array returnLineItems): void | +| `returnServiceCharges` | [`?(OrderReturnServiceCharge[])`](/doc/models/order-return-service-charge.md) | Optional | A collection of service charges that are being returned. | getReturnServiceCharges(): ?array | setReturnServiceCharges(?array returnServiceCharges): void | +| `returnTaxes` | [`?(OrderReturnTax[])`](/doc/models/order-return-tax.md) | Optional | A collection of references to taxes being returned for an order, including the total
applied tax amount to be returned. The taxes must reference a top-level tax ID from the source
order. | getReturnTaxes(): ?array | setReturnTaxes(?array returnTaxes): void | +| `returnDiscounts` | [`?(OrderReturnDiscount[])`](/doc/models/order-return-discount.md) | Optional | A collection of references to discounts being returned for an order, including the total
applied discount amount to be returned. The discounts must reference a top-level discount ID
from the source order. | getReturnDiscounts(): ?array | setReturnDiscounts(?array returnDiscounts): void | +| `roundingAdjustment` | [`?OrderRoundingAdjustment`](/doc/models/order-rounding-adjustment.md) | Optional | A rounding adjustment of the money being returned. Commonly used to apply cash rounding
when the minimum unit of the account is smaller than the lowest physical denomination of the currency. | getRoundingAdjustment(): ?OrderRoundingAdjustment | setRoundingAdjustment(?OrderRoundingAdjustment roundingAdjustment): void | | `returnAmounts` | [`?OrderMoneyAmounts`](/doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | getReturnAmounts(): ?OrderMoneyAmounts | setReturnAmounts(?OrderMoneyAmounts returnAmounts): void | ## Example (as JSON) diff --git a/doc/models/order-reward.md b/doc/models/order-reward.md index c6b93958..81e6b124 100644 --- a/doc/models/order-reward.md +++ b/doc/models/order-reward.md @@ -1,7 +1,7 @@ # Order Reward -Represents a reward that may be applied to an order if the necessary +Represents a reward that can be applied to an order if the necessary reward tier criteria are met. Rewards are created through the Loyalty API. ## Structure diff --git a/doc/models/order-rounding-adjustment.md b/doc/models/order-rounding-adjustment.md index f5ef72c5..2e979916 100644 --- a/doc/models/order-rounding-adjustment.md +++ b/doc/models/order-rounding-adjustment.md @@ -1,8 +1,8 @@ # Order Rounding Adjustment -A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding -when the minimum unit of account is smaller than the lowest physical denomination of currency. +A rounding adjustment of the money being returned. Commonly used to apply cash rounding +when the minimum unit of the account is smaller than the lowest physical denomination of the currency. ## Structure @@ -12,8 +12,8 @@ when the minimum unit of account is smaller than the lowest physical denominatio | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the rounding adjustment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | -| `name` | `?string` | Optional | The name of the rounding adjustment from the original sale Order. | getName(): ?string | setName(?string name): void | +| `uid` | `?string` | Optional | A unique ID that identifies the rounding adjustment only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `name` | `?string` | Optional | The name of the rounding adjustment from the original sale order. | getName(): ?string | setName(?string name): 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 | ## Example (as JSON) diff --git a/doc/models/order-service-charge-calculation-phase.md b/doc/models/order-service-charge-calculation-phase.md index bbce1b45..bcefc4c6 100644 --- a/doc/models/order-service-charge-calculation-phase.md +++ b/doc/models/order-service-charge-calculation-phase.md @@ -2,7 +2,7 @@ # Order Service Charge Calculation Phase Represents a phase in the process of calculating order totals. -Service charges are applied __after__ the indicated phase. +Service charges are applied after the indicated phase. [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) @@ -14,6 +14,6 @@ Service charges are applied __after__ the indicated phase. | Name | Description | | --- | --- | -| `SUBTOTAL_PHASE` | The service charge will be applied after discounts, but before
taxes. | -| `TOTAL_PHASE` | The service charge will be applied after all discounts and taxes
are applied. | +| `SUBTOTAL_PHASE` | The service charge is applied after discounts, but before
taxes. | +| `TOTAL_PHASE` | The service charge is applied after all discounts and taxes
are applied. | diff --git a/doc/models/order-service-charge.md b/doc/models/order-service-charge.md index d73d290a..8769f2e0 100644 --- a/doc/models/order-service-charge.md +++ b/doc/models/order-service-charge.md @@ -11,7 +11,7 @@ Represents a service charge applied to an order. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `uid` | `?string` | Optional | Unique ID that identifies the service charge only within this order.
**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void | +| `uid` | `?string` | Optional | A 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](/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 | @@ -19,10 +19,10 @@ Represents a service charge applied to an order. | `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 | | `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 | | `totalTaxMoney` | [`?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. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | -| `calculationPhase` | [`?string (OrderServiceChargeCalculationPhase)`](/doc/models/order-service-charge-calculation-phase.md) | Optional | Represents a phase in the process of calculating order totals.
Service charges are applied __after__ the indicated phase.

[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | +| `calculationPhase` | [`?string (OrderServiceChargeCalculationPhase)`](/doc/models/order-service-charge-calculation-phase.md) | Optional | Represents a phase in the process of calculating order totals.
Service charges are applied after the indicated phase.

[Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) | getCalculationPhase(): ?string | setCalculationPhase(?string calculationPhase): void | | `taxable` | `?bool` | Optional | Indicates whether the service charge can be taxed. If set to `true`,
order-level taxes automatically apply to the service charge. Note that
service charges calculated in the `TOTAL_PHASE` cannot be marked as taxable. | getTaxable(): ?bool | setTaxable(?bool taxable): void | -| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to taxes applied to this service charge. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level
`OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied
is populated.

An `OrderLineItemAppliedTax` will be automatically created on every taxable service charge
for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records
for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable
service charge. Taxable service charges have the `taxable` field set to true and calculated
in the `SUBTOTAL_PHASE`.

To change the amount of a tax, modify the referenced top-level tax. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | -| `metadata` | `?array` | Optional | Application-defined data attached to this service charge. 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 | +| `appliedTaxes` | [`?(OrderLineItemAppliedTax[])`](/doc/models/order-line-item-applied-tax.md) | Optional | The list of references to the taxes applied to this service charge. Each
`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level
`OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied
is populated.

An `OrderLineItemAppliedTax` is automatically created on every taxable service charge
for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records
for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable
service charge. Taxable service charges have the `taxable` field set to `true` and calculated
in the `SUBTOTAL_PHASE`.

To change the amount of a tax, modify the referenced top-level tax. | getAppliedTaxes(): ?array | setAppliedTaxes(?array appliedTaxes): void | +| `metadata` | `?array` | Optional | Application-defined data attached to this service charge. 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 (such as personally
identifiable information or card details).

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

Values have a maximum length of 255 characters.

An application can 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.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | ## Example (as JSON) diff --git a/doc/models/order-state.md b/doc/models/order-state.md index fa7e5769..383adbfd 100644 --- a/doc/models/order-state.md +++ b/doc/models/order-state.md @@ -11,7 +11,7 @@ The state of the order. | Name | Description | | --- | --- | -| `OPEN` | Indicates the order is open. Open orders may be updated. | -| `COMPLETED` | Indicates the order is completed. Completed orders are fully paid. This is a terminal state. | -| `CANCELED` | Indicates the order is canceled. Canceled orders are not paid. This is a terminal state. | +| `OPEN` | Indicates that the order is open. Open orders can be updated. | +| `COMPLETED` | Indicates that the order is completed. Completed orders are fully paid. This is a terminal state. | +| `CANCELED` | Indicates that the order is canceled. Canceled orders are not paid. This is a terminal state. | diff --git a/doc/models/order-updated.md b/doc/models/order-updated.md index 8aaa6faf..1377357e 100644 --- a/doc/models/order-updated.md +++ b/doc/models/order-updated.md @@ -10,11 +10,11 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `orderId` | `?string` | Optional | The order's unique ID. | getOrderId(): ?string | setOrderId(?string orderId): 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 | -| `locationId` | `?string` | Optional | The ID of the merchant location this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | +| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders that were not created through the API do not include a version number and
therefore 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 | +| `locationId` | `?string` | Optional | The ID of the seller location that this order is associated with. | getLocationId(): ?string | setLocationId(?string locationId): void | | `state` | [`?string (OrderState)`](/doc/models/order-state.md) | Optional | The state of the order. | getState(): ?string | setState(?string state): void | -| `createdAt` | `?string` | Optional | Timestamp for when the order was created in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | -| `updatedAt` | `?string` | Optional | Timestamp for when the order was last updated in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | +| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `updatedAt` | `?string` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | ## Example (as JSON) diff --git a/doc/models/order.md b/doc/models/order.md index 82c4fc2b..b68a35f4 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -2,8 +2,8 @@ # Order Contains all information related to a single order to process with Square, -including line items that specify the products to purchase. Order objects also -include information on any associated tenders, refunds, and returns. +including line items that specify the products to purchase. `Order` objects also +include information about any associated tenders, refunds, and returns. All Connect V2 Transactions have all been converted to Orders including all associated itemization data. @@ -17,34 +17,34 @@ itemization data. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | The order's unique ID. | getId(): ?string | setId(?string id): void | -| `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 | +| `locationId` | `string` | Required | The ID of the seller location that this order is associated with.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | +| `referenceId` | `?string` | Optional | A client-specified ID 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](/doc/models/customer.md) ID of the customer associated with the order.
**Constraints**: *Maximum Length*: `191` | getCustomerId(): ?string | setCustomerId(?string customerId): void | +| `customerId` | `?string` | Optional | The ID of the [customer](/doc/models/customer.md) 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 | +| `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 generates an `OrderLineItemAppliedTax` for every line item.

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

__IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated
`line_items.taxes` field results in an error. 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 generates an `OrderLineItemAppliedDiscount`
for every line item.

__IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated
`line_items.discounts` field results in an error. Use `line_items.applied_discounts`
instead. | getDiscounts(): ?array | setDiscounts(?array discounts): void | | `serviceCharges` | [`?(OrderServiceCharge[])`](/doc/models/order-service-charge.md) | Optional | A list of service charges applied to the order. | getServiceCharges(): ?array | setServiceCharges(?array serviceCharges): void | -| `fulfillments` | [`?(OrderFulfillment[])`](/doc/models/order-fulfillment.md) | Optional | Details on order fulfillment.

Orders can only be created with at most one fulfillment. However, orders returned
by the API may contain multiple fulfillments. | getFulfillments(): ?array | setFulfillments(?array fulfillments): void | -| `returns` | [`?(OrderReturn[])`](/doc/models/order-return.md) | Optional | Collection of items from sale Orders being returned in this one. Normally part of an
Itemized Return or Exchange. There will be exactly one `Return` object per sale Order being
referenced. | getReturns(): ?array | setReturns(?array returns): void | +| `fulfillments` | [`?(OrderFulfillment[])`](/doc/models/order-fulfillment.md) | Optional | Details about order fulfillment.

Orders can only be created with at most one fulfillment. However, orders returned
by the API might contain multiple fulfillments. | getFulfillments(): ?array | setFulfillments(?array fulfillments): void | +| `returns` | [`?(OrderReturn[])`](/doc/models/order-return.md) | Optional | A collection of items from sale orders being returned in this one. Normally part of an
itemized return or exchange. There is exactly one `Return` object per sale `Order` being
referenced. | getReturns(): ?array | setReturns(?array returns): void | | `returnAmounts` | [`?OrderMoneyAmounts`](/doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | getReturnAmounts(): ?OrderMoneyAmounts | setReturnAmounts(?OrderMoneyAmounts returnAmounts): void | | `netAmounts` | [`?OrderMoneyAmounts`](/doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | getNetAmounts(): ?OrderMoneyAmounts | setNetAmounts(?OrderMoneyAmounts netAmounts): void | -| `roundingAdjustment` | [`?OrderRoundingAdjustment`](/doc/models/order-rounding-adjustment.md) | Optional | A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding
when the minimum unit of account is smaller than the lowest physical denomination of currency. | getRoundingAdjustment(): ?OrderRoundingAdjustment | setRoundingAdjustment(?OrderRoundingAdjustment roundingAdjustment): void | -| `tenders` | [`?(Tender[])`](/doc/models/tender.md) | Optional | The Tenders which were used to pay for the Order. | getTenders(): ?array | setTenders(?array tenders): void | -| `refunds` | [`?(Refund[])`](/doc/models/refund.md) | Optional | The Refunds that are part of this Order. | getRefunds(): ?array | setRefunds(?array refunds): void | -| `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](/doc/models/order-state.md). In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". | getClosedAt(): ?string | setClosedAt(?string closedAt): void | +| `roundingAdjustment` | [`?OrderRoundingAdjustment`](/doc/models/order-rounding-adjustment.md) | Optional | A rounding adjustment of the money being returned. Commonly used to apply cash rounding
when the minimum unit of the account is smaller than the lowest physical denomination of the currency. | getRoundingAdjustment(): ?OrderRoundingAdjustment | setRoundingAdjustment(?OrderRoundingAdjustment roundingAdjustment): void | +| `tenders` | [`?(Tender[])`](/doc/models/tender.md) | Optional | The tenders that were used to pay for the order. | getTenders(): ?array | setTenders(?array tenders): void | +| `refunds` | [`?(Refund[])`](/doc/models/refund.md) | Optional | The refunds that are part of this order. | getRefunds(): ?array | setRefunds(?array refunds): void | +| `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 (such as personally
identifiable information or card details).

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

Values have a maximum length of 255 characters.

An application can 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.

For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void | +| `createdAt` | `?string` | Optional | The timestamp for when the order was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `updatedAt` | `?string` | Optional | The timestamp for when the order was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | +| `closedAt` | `?string` | Optional | The timestamp for when the order reached a terminal [state](/doc/models/order-state.md), in RFC 3339 format (for example "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 | +| `version` | `?int` | Optional | The version number, which is incremented each time an update is committed to the order.
Orders not created through the API do not include a version number and
therefore 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 | | `totalTaxMoney` | [`?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. | getTotalTaxMoney(): ?Money | setTotalTaxMoney(?Money totalTaxMoney): void | | `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](/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 | +| `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 preconfigured
[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 a36795bb..d95dec0a 100644 --- a/doc/models/pay-order-request.md +++ b/doc/models/pay-order-request.md @@ -12,7 +12,7 @@ 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 have sent. If
you are unsure whether a particular payment request was completed successfully, you can reattempt
it with the same idempotency key without worrying about duplicate payments.

For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**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](/doc/models/payment.md) to collect.
The payment total must match the order total. | getPaymentIds(): ?array | setPaymentIds(?array paymentIds): void | diff --git a/doc/models/pay-order-response.md b/doc/models/pay-order-response.md index 6a44bf96..4c82be45 100644 --- a/doc/models/pay-order-response.md +++ b/doc/models/pay-order-response.md @@ -13,7 +13,7 @@ Defines the fields that are included in the response body of a request to the | 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 | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | ## Example (as JSON) diff --git a/doc/models/payment.md b/doc/models/payment.md index 54f4b439..4b618e0a 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -21,13 +21,14 @@ Represents a payment processed by the Square API. | `approvedMoney` | [`?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. | getApprovedMoney(): ?Money | setApprovedMoney(?Money approvedMoney): void | | `processingFee` | [`?(ProcessingFee[])`](/doc/models/processing-fee.md) | Optional | The processing fees and fee adjustments assessed by Square for this payment. | getProcessingFee(): ?array | setProcessingFee(?array processingFee): void | | `refundedMoney` | [`?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. | getRefundedMoney(): ?Money | setRefundedMoney(?Money refundedMoney): void | -| `status` | `?string` | Optional | Indicates whether the payment is APPROVED, COMPLETED, CANCELED, or FAILED.
**Constraints**: *Maximum Length*: `50` | getStatus(): ?string | setStatus(?string status): void | +| `status` | `?string` | Optional | Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.
**Constraints**: *Maximum Length*: `50` | getStatus(): ?string | setStatus(?string status): void | | `delayDuration` | `?string` | Optional | The duration of time after the payment's creation when Square automatically applies the
`delay_action` to the payment. This automatic `delay_action` applies only to payments that
do not reach a terminal state (COMPLETED, CANCELED, or FAILED) before the `delay_duration`
time period.

This field is specified as a time duration, in RFC 3339 format.

Notes:
This feature is only supported for card payments.

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 | | `delayAction` | `?string` | Optional | The action to be applied to the payment when the `delay_duration` has elapsed. This field
is read-only.

Current values include `CANCEL`. | getDelayAction(): ?string | setDelayAction(?string delayAction): void | | `delayedUntil` | `?string` | Optional | The read-only timestamp of when the `delay_action` is automatically applied,
in RFC 3339 format.

Note that this field is calculated by summing the payment's `delay_duration` and `created_at`
fields. The `created_at` field is generated by Square and might not exactly match the
time on your local machine. | getDelayedUntil(): ?string | setDelayedUntil(?string delayedUntil): void | -| `sourceType` | `?string` | Optional | The source type for this payment.

Current values include `CARD`, `CASH`, or `EXTERNAL`.
**Constraints**: *Maximum Length*: `50` | getSourceType(): ?string | setSourceType(?string sourceType): void | +| `sourceType` | `?string` | Optional | The source type for this payment.

Current values include `CARD`, `BANK_ACCOUNT`, `CASH`, or `EXTERNAL`.
**Constraints**: *Maximum Length*: `50` | getSourceType(): ?string | setSourceType(?string sourceType): void | | `cardDetails` | [`?CardPaymentDetails`](/doc/models/card-payment-details.md) | Optional | Reflects the current status of a card payment. Contains only non-confidential information. | getCardDetails(): ?CardPaymentDetails | setCardDetails(?CardPaymentDetails cardDetails): void | | `cashDetails` | [`?CashPaymentDetails`](/doc/models/cash-payment-details.md) | Optional | Stores details about a cash payment. Contains only non-confidential information. For more information, see
[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). | getCashDetails(): ?CashPaymentDetails | setCashDetails(?CashPaymentDetails cashDetails): void | +| `bankAccountDetails` | [`?BankAccountPaymentDetails`](/doc/models/bank-account-payment-details.md) | Optional | Additional details about BANK_ACCOUNT type payments. | getBankAccountDetails(): ?BankAccountPaymentDetails | setBankAccountDetails(?BankAccountPaymentDetails bankAccountDetails): void | | `externalDetails` | [`?ExternalPaymentDetails`](/doc/models/external-payment-details.md) | Optional | Stores details about an external payment. Contains only non-confidential information.
For more information, see
[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). | getExternalDetails(): ?ExternalPaymentDetails | setExternalDetails(?ExternalPaymentDetails externalDetails): void | | `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 | diff --git a/doc/models/retrieve-loyalty-account-response.md b/doc/models/retrieve-loyalty-account-response.md index f1eeb755..6790c586 100644 --- a/doc/models/retrieve-loyalty-account-response.md +++ b/doc/models/retrieve-loyalty-account-response.md @@ -27,19 +27,8 @@ A response that includes the loyalty account. "mapping": { "created_at": "2020-05-08T21:44:32Z", "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234", - "type": "PHONE", - "value": "+14155551234" + "phone_number": "+14155551234" }, - "mappings": [ - { - "created_at": "2020-05-08T21:44:32Z", - "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234", - "type": "PHONE", - "value": "+14155551234" - } - ], "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", "updated_at": "2020-05-08T21:44:32Z" } diff --git a/doc/models/retrieve-order-response.md b/doc/models/retrieve-order-response.md index 2699bd1e..01d7e519 100644 --- a/doc/models/retrieve-order-response.md +++ b/doc/models/retrieve-order-response.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): 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/retrieve-snippet-response.md b/doc/models/retrieve-snippet-response.md new file mode 100644 index 00000000..e291796c --- /dev/null +++ b/doc/models/retrieve-snippet-response.md @@ -0,0 +1,30 @@ + +# Retrieve Snippet Response + +Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. + +## Structure + +`RetrieveSnippetResponse` + +## 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 | +| `snippet` | [`?Snippet`](/doc/models/snippet.md) | Optional | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): ?Snippet | setSnippet(?Snippet snippet): void | + +## Example (as JSON) + +```json +{ + "snippet": { + "content": "", + "created_at": "2021-03-11T25:40:09Z", + "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", + "site_id": "site_278075276488921835", + "updated_at": "2021-03-11T25:40:09Z" + } +} +``` + 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 ff1b95c2..37026eac 100644 --- a/doc/models/search-loyalty-accounts-request-loyalty-account-query.md +++ b/doc/models/search-loyalty-accounts-request-loyalty-account-query.md @@ -21,8 +21,6 @@ The search criteria for the loyalty accounts. "mappings": [ { "id": "id4", - "type": "PHONE", - "value": "value6", "created_at": "created_at8", "phone_number": "phone_number8" } diff --git a/doc/models/search-loyalty-accounts-response.md b/doc/models/search-loyalty-accounts-response.md index f9354b97..9abd291d 100644 --- a/doc/models/search-loyalty-accounts-response.md +++ b/doc/models/search-loyalty-accounts-response.md @@ -29,19 +29,8 @@ A response that includes loyalty accounts that satisfy the search criteria. "mapping": { "created_at": "2020-05-08T21:44:32Z", "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234", - "type": "PHONE", - "value": "+14155551234" + "phone_number": "+14155551234" }, - "mappings": [ - { - "created_at": "2020-05-08T21:44:32Z", - "id": "66aaab3f-da99-49ed-8b19-b87f851c844f", - "phone_number": "+14155551234", - "type": "PHONE", - "value": "+14155551234" - } - ], "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", "updated_at": "2020-05-08T21:44:32Z" } diff --git a/doc/models/search-orders-customer-filter.md b/doc/models/search-orders-customer-filter.md index ef0808a8..ee6729e8 100644 --- a/doc/models/search-orders-customer-filter.md +++ b/doc/models/search-orders-customer-filter.md @@ -1,8 +1,8 @@ # Search Orders Customer Filter -Filter based on Order `customer_id` and any Tender `customer_id` -associated with the Order. Does not filter based on the +A filter based on the order `customer_id` and any tender `customer_id` +associated with the order. It does not filter based on the [FulfillmentRecipient](/doc/models/order-fulfillment-recipient.md) `customer_id`. ## Structure @@ -13,7 +13,7 @@ associated with the Order. Does not filter based on the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `customerIds` | `?(string[])` | Optional | List of customer IDs to filter by.

Max: 10 customer IDs. | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | +| `customerIds` | `?(string[])` | Optional | A list of customer IDs to filter by.

Max: 10 customer IDs. | getCustomerIds(): ?array | setCustomerIds(?array customerIds): void | ## Example (as JSON) diff --git a/doc/models/search-orders-date-time-filter.md b/doc/models/search-orders-date-time-filter.md index fbc0702e..9ca16c3f 100644 --- a/doc/models/search-orders-date-time-filter.md +++ b/doc/models/search-orders-date-time-filter.md @@ -2,19 +2,19 @@ # Search Orders Date Time Filter Filter for `Order` objects based on whether their `CREATED_AT`, -`CLOSED_AT` or `UPDATED_AT` timestamps fall within a specified time range. +`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) +__Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, +you must 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). +in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to +`CLOSED_AT`. Otherwise, `SearchOrders` throws 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) ## Structure diff --git a/doc/models/search-orders-filter.md b/doc/models/search-orders-filter.md index 32999e8b..bb099e53 100644 --- a/doc/models/search-orders-filter.md +++ b/doc/models/search-orders-filter.md @@ -1,8 +1,8 @@ # Search Orders Filter -Filtering criteria to use for a SearchOrders request. Multiple filters -will be ANDed together. +Filtering criteria to use for a `SearchOrders` request. Multiple filters +are ANDed together. ## Structure @@ -12,11 +12,11 @@ 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](/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](/doc/models/order-fulfillment-recipient.md) `customer_id`. | getCustomerFilter(): ?SearchOrdersCustomerFilter | setCustomerFilter(?SearchOrdersCustomerFilter customerFilter): void | +| `stateFilter` | [`?SearchOrdersStateFilter`](/doc/models/search-orders-state-filter.md) | Optional | Filter by the 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 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 set the `sort_field` in `SearchOrdersSort` to
`CLOSED_AT`. Otherwise, `SearchOrders` throws 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 | A filter based on order `source` information. | getSourceFilter(): ?SearchOrdersSourceFilter | setSourceFilter(?SearchOrdersSourceFilter sourceFilter): void | +| `customerFilter` | [`?SearchOrdersCustomerFilter`](/doc/models/search-orders-customer-filter.md) | Optional | A filter based on the order `customer_id` and any tender `customer_id`
associated with the order. It 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 64dfc3cf..280ed5fa 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](/doc/models/order-fulfillment.md) information. +Filter based on [order fulfillment](/doc/models/order-fulfillment.md) information. ## Structure @@ -11,8 +11,8 @@ Filter based on [Order Fulfillment](/doc/models/order-fulfillment.md) informatio | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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 | +| `fulfillmentTypes` | [`?(string[]) (OrderFulfillmentType)`](/doc/models/order-fulfillment-type.md) | Optional | A list of [fulfillment types](/doc/models/order-fulfillment-type.md) to filter
for. The list returns 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 | A list of [fulfillment states](/doc/models/order-fulfillment-state.md) to filter
for. The list returns 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-query.md b/doc/models/search-orders-query.md index 1643ea16..f5a867e0 100644 --- a/doc/models/search-orders-query.md +++ b/doc/models/search-orders-query.md @@ -11,8 +11,8 @@ Contains query criteria for the search. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `filter` | [`?SearchOrdersFilter`](/doc/models/search-orders-filter.md) | Optional | Filtering criteria to use for a SearchOrders request. Multiple filters
will be ANDed together. | getFilter(): ?SearchOrdersFilter | setFilter(?SearchOrdersFilter filter): void | -| `sort` | [`?SearchOrdersSort`](/doc/models/search-orders-sort.md) | Optional | Sorting criteria for a SearchOrders request. Results can only be sorted
by a timestamp field. | getSort(): ?SearchOrdersSort | setSort(?SearchOrdersSort sort): void | +| `filter` | [`?SearchOrdersFilter`](/doc/models/search-orders-filter.md) | Optional | Filtering criteria to use for a `SearchOrders` request. Multiple filters
are ANDed together. | getFilter(): ?SearchOrdersFilter | setFilter(?SearchOrdersFilter filter): void | +| `sort` | [`?SearchOrdersSort`](/doc/models/search-orders-sort.md) | Optional | Sorting criteria for a `SearchOrders` request. Results can only be sorted
by a timestamp field. | getSort(): ?SearchOrdersSort | setSort(?SearchOrdersSort sort): void | ## Example (as JSON) diff --git a/doc/models/search-orders-request.md b/doc/models/search-orders-request.md index 9c13f6f9..a54be5b1 100644 --- a/doc/models/search-orders-request.md +++ b/doc/models/search-orders-request.md @@ -2,8 +2,8 @@ # Search Orders Request The request does not have any required fields. When given no query criteria, -SearchOrders will return all results for all of the merchant’s locations. When fetching additional -pages using a `cursor`, the `query` must be equal to the `query` used to fetch the first page of +`SearchOrders` returns all results for all of the seller's locations. When retrieving additional +pages using a `cursor`, the `query` must be equal to the `query` used to retrieve the first page of results. ## Structure @@ -14,11 +14,11 @@ 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 | +| `locationIds` | `?(string[])` | Optional | The location IDs for the orders to query. All locations must belong to
the same merchant.

Min: 1 location ID.

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 cursor to retrieve the next set of results for your original query.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | 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`](/doc/models/order-entry.md) objects. If `false`, SearchOrders
will return complete Order objects.

Default: `false`. | getReturnEntries(): ?bool | setReturnEntries(?bool returnEntries): 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.

Default: `500`
**Constraints**: `>= 1` | getLimit(): ?int | setLimit(?int limit): void | +| `returnEntries` | `?bool` | Optional | A Boolean that controls the format of the search results. If `true`,
`SearchOrders` returns [OrderEntry](/doc/models/order-entry.md) objects. If `false`, `SearchOrders`
returns 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 943eee2b..dd5bf242 100644 --- a/doc/models/search-orders-response.md +++ b/doc/models/search-orders-response.md @@ -1,8 +1,8 @@ # Search Orders Response -Only one of `order_entries` or `orders` fields will be set, depending on whether -`return_entries` was set on the [SearchOrdersRequest](/doc/apis/orders.md#search-orders). +Either the `order_entries` or `orders` field is set, depending on whether +`return_entries` is set on the [SearchOrdersRequest](/doc/apis/orders.md#search-orders). ## Structure @@ -12,9 +12,9 @@ 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](/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 | +| `orderEntries` | [`?(OrderEntry[])`](/doc/models/order-entry.md) | Optional | A list of [OrderEntries](/doc/models/order-entry.md) that fit the query
conditions. The list is populated only if `return_entries` is set to `true` in the request. | getOrderEntries(): ?array | setOrderEntries(?array orderEntries): void | +| `orders` | [`?(Order[])`](/doc/models/order.md) | Optional | A list of
[Order](/doc/models/order.md) objects that match the query conditions. The list is populated only if
`return_entries` is set to `false` in the request. | 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.
For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). | 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-sort-field.md b/doc/models/search-orders-sort-field.md index 7dedfd44..6c556a9d 100644 --- a/doc/models/search-orders-sort-field.md +++ b/doc/models/search-orders-sort-field.md @@ -1,7 +1,7 @@ # Search Orders Sort Field -Specifies which timestamp to use to sort SearchOrder results. +Specifies which timestamp to use to sort `SearchOrder` results. ## Enumeration @@ -11,7 +11,7 @@ Specifies which timestamp to use to sort SearchOrder results. | Name | Description | | --- | --- | -| `CREATED_AT` | Time when the order was created in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `CREATED_AT`
field in your DateTimeFilter. | -| `UPDATED_AT` | Time when the order last updated in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `UPDATED_AT`
field in your DateTimeFilter. | -| `CLOSED_AT` | Time when the order was closed in RFC-3339 format. If you use this
value, you must also set a StateFilter with closed states. If you are also
filtering for a time range in this query, you must set the `CLOSED_AT`
field in your DateTimeFilter. | +| `CREATED_AT` | The time when the order was created, in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `CREATED_AT`
field in your `DateTimeFilter`. | +| `UPDATED_AT` | The time when the order last updated, in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `UPDATED_AT`
field in your `DateTimeFilter`. | +| `CLOSED_AT` | The time when the order was closed, in RFC-3339 format. If you use this
value, you must also set a `StateFilter` with closed states. If you are also
filtering for a time range in this query, you must set the `CLOSED_AT`
field in your `DateTimeFilter`. | diff --git a/doc/models/search-orders-sort.md b/doc/models/search-orders-sort.md index 6c32a7ad..6d4266ff 100644 --- a/doc/models/search-orders-sort.md +++ b/doc/models/search-orders-sort.md @@ -1,7 +1,7 @@ # Search Orders Sort -Sorting criteria for a SearchOrders request. Results can only be sorted +Sorting criteria for a `SearchOrders` request. Results can only be sorted by a timestamp field. ## Structure @@ -12,7 +12,7 @@ by a timestamp field. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `sortField` | [`string (SearchOrdersSortField)`](/doc/models/search-orders-sort-field.md) | Required | Specifies which timestamp to use to sort SearchOrder results. | getSortField(): string | setSortField(string sortField): void | +| `sortField` | [`string (SearchOrdersSortField)`](/doc/models/search-orders-sort-field.md) | Required | Specifies which timestamp to use to sort `SearchOrder` results. | 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 | ## Example (as JSON) diff --git a/doc/models/search-orders-source-filter.md b/doc/models/search-orders-source-filter.md index 13128823..29ad7724 100644 --- a/doc/models/search-orders-source-filter.md +++ b/doc/models/search-orders-source-filter.md @@ -1,7 +1,7 @@ # Search Orders Source Filter -Filter based on order `source` information. +A filter based on order `source` information. ## Structure @@ -11,7 +11,7 @@ Filter based on order `source` information. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `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 | +| `sourceNames` | `?(string[])` | Optional | Filters by the [Source](/doc/models/order-source.md) `name`. The filter returns any orders
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-orders-state-filter.md b/doc/models/search-orders-state-filter.md index b5f54120..570aba88 100644 --- a/doc/models/search-orders-state-filter.md +++ b/doc/models/search-orders-state-filter.md @@ -1,7 +1,7 @@ # Search Orders State Filter -Filter by current Order `state`. +Filter by the current order `state`. ## Structure diff --git a/doc/models/site.md b/doc/models/site.md new file mode 100644 index 00000000..868cd06f --- /dev/null +++ b/doc/models/site.md @@ -0,0 +1,32 @@ + +# Site + +Represents a Square Online site, which is an online store for a Square seller. + +## Structure + +`Site` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `id` | `?string` | Optional | The Square-assigned ID of the site.
**Constraints**: *Maximum Length*: `32` | getId(): ?string | setId(?string id): void | +| `siteTitle` | `?string` | Optional | The title of the site. | getSiteTitle(): ?string | setSiteTitle(?string siteTitle): void | +| `domain` | `?string` | Optional | The domain of the site (without the protocol). For example, `mysite1.square.site`. | getDomain(): ?string | setDomain(?string domain): void | +| `isPublished` | `?bool` | Optional | Indicates whether the site is published. | getIsPublished(): ?bool | setIsPublished(?bool isPublished): void | +| `createdAt` | `?string` | Optional | The timestamp of when the site was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `updatedAt` | `?string` | Optional | The timestamp of when the site was last updated, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | + +## Example (as JSON) + +```json +{ + "id": "id0", + "site_title": "site_title6", + "domain": "domain6", + "is_published": false, + "created_at": "created_at2" +} +``` + diff --git a/doc/models/snippet-response.md b/doc/models/snippet-response.md new file mode 100644 index 00000000..7c548eb2 --- /dev/null +++ b/doc/models/snippet-response.md @@ -0,0 +1,48 @@ + +# Snippet Response + +## Structure + +`SnippetResponse` + +## 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 | +| `snippet` | [`?Snippet`](/doc/models/snippet.md) | Optional | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): ?Snippet | setSnippet(?Snippet snippet): void | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "AUTHENTICATION_ERROR", + "code": "UNPROCESSABLE_ENTITY", + "detail": "detail1", + "field": "field9" + }, + { + "category": "INVALID_REQUEST_ERROR", + "code": "RATE_LIMITED", + "detail": "detail2", + "field": "field0" + }, + { + "category": "RATE_LIMIT_ERROR", + "code": "NOT_IMPLEMENTED", + "detail": "detail3", + "field": "field1" + } + ], + "snippet": { + "id": "id0", + "site_id": "site_id6", + "content": "content4", + "created_at": "created_at8", + "updated_at": "updated_at4" + } +} +``` + diff --git a/doc/models/snippet.md b/doc/models/snippet.md new file mode 100644 index 00000000..807440a9 --- /dev/null +++ b/doc/models/snippet.md @@ -0,0 +1,31 @@ + +# Snippet + +Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. + +## Structure + +`Snippet` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `id` | `?string` | Optional | The Square-assigned ID for the snippet.
**Constraints**: *Maximum Length*: `48` | getId(): ?string | setId(?string id): void | +| `siteId` | `?string` | Optional | The ID of the site that contains the snippet. | getSiteId(): ?string | setSiteId(?string siteId): void | +| `content` | `string` | Required | The snippet code, which can contain valid HTML, JavaScript, or both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65535` | getContent(): string | setContent(string content): void | +| `createdAt` | `?string` | Optional | The timestamp of when the snippet was initially added to the site, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void | +| `updatedAt` | `?string` | Optional | The timestamp of when the snippet was last updated on the site, in RFC 3339 format. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | + +## Example (as JSON) + +```json +{ + "id": "id0", + "site_id": "site_id6", + "content": "content4", + "created_at": "created_at2", + "updated_at": "updated_at4" +} +``` + diff --git a/doc/models/update-order-request.md b/doc/models/update-order-request.md index 03b017db..f0ff0742 100644 --- a/doc/models/update-order-request.md +++ b/doc/models/update-order-request.md @@ -12,9 +12,9 @@ Defines the fields that are included in requests to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | -| `fieldsToClear` | `?(string[])` | Optional | The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation)
fields to clear. For example, `line_items[uid].note`
[Read more about Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders#delete-fields). | getFieldsToClear(): ?array | setFieldsToClear(?array fieldsToClear): void | -| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this update request

If you're unsure whether a particular update was applied to an order successfully,
you can reattempt it with the same idempotency key without
worrying about creating duplicate updates to the order.
The latest order version will be returned.

See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more information.
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `fieldsToClear` | `?(string[])` | Optional | The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation)
fields to clear. For example, `line_items[uid].note`.
For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage-orders#delete-fields). | getFieldsToClear(): ?array | setFieldsToClear(?array fieldsToClear): void | +| `idempotencyKey` | `?string` | Optional | A value you specify that uniquely identifies this update request.

If you are unsure whether a particular update was applied to an order successfully,
you can reattempt it with the same idempotency key without
worrying about creating duplicate updates to the order.
The latest order version is returned.

For more information, see [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency).
**Constraints**: *Maximum Length*: `192` | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | ## Example (as JSON) diff --git a/doc/models/update-order-response.md b/doc/models/update-order-response.md index d8d9cb21..540fbd50 100644 --- a/doc/models/update-order-response.md +++ b/doc/models/update-order-response.md @@ -12,7 +12,7 @@ a request to the [UpdateOrder](/doc/apis/orders.md#update-order) endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): void | +| `order` | [`?Order`](/doc/models/order.md) | Optional | Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. `Order` objects also
include information about any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data. | getOrder(): ?Order | setOrder(?Order order): 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/upsert-snippet-request.md b/doc/models/upsert-snippet-request.md new file mode 100644 index 00000000..42c8aab2 --- /dev/null +++ b/doc/models/upsert-snippet-request.md @@ -0,0 +1,25 @@ + +# Upsert Snippet Request + +Represents an `UpsertSnippet` request. + +## Structure + +`UpsertSnippetRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `snippet` | [`Snippet`](/doc/models/snippet.md) | Required | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): Snippet | setSnippet(Snippet snippet): void | + +## Example (as JSON) + +```json +{ + "snippet": { + "content": "" + } +} +``` + diff --git a/doc/models/upsert-snippet-response.md b/doc/models/upsert-snippet-response.md new file mode 100644 index 00000000..5d3c6bf3 --- /dev/null +++ b/doc/models/upsert-snippet-response.md @@ -0,0 +1,30 @@ + +# Upsert Snippet Response + +Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. + +## Structure + +`UpsertSnippetResponse` + +## 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 | +| `snippet` | [`?Snippet`](/doc/models/snippet.md) | Optional | Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. | getSnippet(): ?Snippet | setSnippet(?Snippet snippet): void | + +## Example (as JSON) + +```json +{ + "snippet": { + "content": "", + "created_at": "2021-03-11T25:40:09Z", + "id": "snippet_5d178150-a6c0-11eb-a9f1-437e6a2881e7", + "site_id": "site_278075276488921835", + "updated_at": "2021-03-11T25:40:09Z" + } +} +``` + diff --git a/src/Apis/BaseApi.php b/src/Apis/BaseApi.php index 24dfbb02..13351c0a 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/10.0.0.20210421'; + protected const USER_AGENT = 'Square-PHP-SDK/11.0.0.20210513'; /** * HttpCallBack instance associated with this controller diff --git a/src/Apis/CatalogApi.php b/src/Apis/CatalogApi.php index fb6c6aaa..be78412d 100644 --- a/src/Apis/CatalogApi.php +++ b/src/Apis/CatalogApi.php @@ -396,6 +396,7 @@ public function catalogInfo(): ApiResponse * * @param string|null $cursor The pagination cursor returned in the previous response. Leave * unset for an initial request. + * The page size is currently set to be 100. * See [Pagination](https://developer.squareup. * com/docs/basics/api101/pagination) for more information. * @param string|null $types An optional case-insensitive, comma-separated list of object diff --git a/src/Apis/LoyaltyApi.php b/src/Apis/LoyaltyApi.php index d34b1ef4..8244bf14 100644 --- a/src/Apis/LoyaltyApi.php +++ b/src/Apis/LoyaltyApi.php @@ -23,8 +23,8 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * 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. + * Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a + * `mapping` with the `phone_number` of the buyer. * * @param \Square\Models\CreateLoyaltyAccountRequest $body An object containing the fields to * POST for the request. @@ -467,7 +467,15 @@ public function searchLoyaltyEvents(\Square\Models\SearchLoyaltyEventsRequest $b /** * Returns a list of loyalty programs in the seller's account. - * Currently, a seller can only have one loyalty program. + * 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). + * + * + * Replaced with [RetrieveLoyaltyProgram]($e/Loyalty/RetrieveLoyaltyProgram) when used with the keyword + * `main`. + * + * @deprecated * * @return ApiResponse Response from the API call * @@ -475,6 +483,8 @@ public function searchLoyaltyEvents(\Square\Models\SearchLoyaltyEventsRequest $b */ public function listLoyaltyPrograms(): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v2/loyalty/programs'; diff --git a/src/Apis/OrdersApi.php b/src/Apis/OrdersApi.php index 0e8fce1d..9e758e11 100644 --- a/src/Apis/OrdersApi.php +++ b/src/Apis/OrdersApi.php @@ -23,12 +23,11 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC } /** - * Creates a new [Order]($m/Order) which can include information on products for + * Creates a new [order]($m/Order) that can include information about 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) - * guide. + * To pay for a created order, see + * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). * * You can modify open orders using the [UpdateOrder]($e/Orders/UpdateOrder) endpoint. * @@ -97,9 +96,9 @@ public function createOrder(\Square\Models\CreateOrderRequest $body): ApiRespons } /** - * Retrieves a set of [Order]($m/Order)s by their IDs. + * Retrieves a set of [orders]($m/Order) by their IDs. * - * If a given Order ID does not exist, the ID is ignored instead of generating an error. + * If a given order ID does not exist, the ID is ignored instead of generating an error. * * @param \Square\Models\BatchRetrieveOrdersRequest $body An object containing the fields to * POST for the request. @@ -235,19 +234,19 @@ public function calculateOrder(\Square\Models\CalculateOrderRequest $body): ApiR /** * Search all orders for one or more locations. Orders include all sales, * returns, and exchanges regardless of how or when they entered the Square - * Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc). + * ecosystem (such as Point of Sale, Invoices, and Connect APIs). * - * SearchOrders requests need to specify which locations to search and define a - * [`SearchOrdersQuery`]($m/SearchOrdersQuery) object which controls - * how to sort or filter the results. Your SearchOrdersQuery can: + * `SearchOrders` requests need to specify which locations to search and define a + * [SearchOrdersQuery]($m/SearchOrdersQuery) object that 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 + * Set the sort order. + * Determine whether to return results as complete `Order` objects or as * [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 + * offline mode might not be transmitted to Square for up to 72 hours. Offline * orders have a `created_at` value that reflects the time the order was created, * not the time it was subsequently transmitted to Square. * @@ -380,23 +379,23 @@ public function retrieveOrder(string $orderId): ApiResponse } /** - * Updates an open [Order]($m/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: + * An `UpdateOrder` request requires the following: * * - The `order_id` in the endpoint path, identifying the order to update. * - The latest `version` of the order to update. * - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders#sparse-order- * objects) - * containing only the fields to update and the version the update is - * being applied to. + * containing only the fields to update and the version to which the update is + * being applied. * - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage- * orders#on-dot-notation) - * identifying fields to clear. + * identifying the 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, see + * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). * * @param string $orderId The ID of the order to update. * @param \Square\Models\UpdateOrderRequest $body An object containing the fields to POST for @@ -469,22 +468,22 @@ public function updateOrder(string $orderId, \Square\Models\UpdateOrderRequest $ } /** - * Pay for an [order]($m/Order) using one or more approved [payments]($m/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 * total. Orders with a total amount of `0` can be marked as paid by specifying an empty * array of `payment_ids` in the request. * - * To be used with PayOrder, a payment must: + * To be used with `PayOrder`, a payment must: * * - 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. + * `payment_ids` is canceled. * - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take- * payments#delayed-capture). - * Using a delayed capture payment with PayOrder will complete the approved payment. + * Using a delayed capture payment with `PayOrder` completes the approved payment. * * @param string $orderId The ID of the order being paid. * @param \Square\Models\PayOrderRequest $body An object containing the fields to POST for the diff --git a/src/Apis/SitesApi.php b/src/Apis/SitesApi.php new file mode 100644 index 00000000..6b19a399 --- /dev/null +++ b/src/Apis/SitesApi.php @@ -0,0 +1,86 @@ +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\\ListSitesResponse'); + return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); + } +} diff --git a/src/Apis/SnippetsApi.php b/src/Apis/SnippetsApi.php new file mode 100644 index 00000000..1b48976a --- /dev/null +++ b/src/Apis/SnippetsApi.php @@ -0,0 +1,249 @@ + $siteId, + ]); + + //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::DELETE, $_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::delete($_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\\DeleteSnippetResponse'); + return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); + } + + /** + * Retrieves your snippet from a Square Online site. A site can contain snippets from multiple snippet + * applications, but you can retrieve only the snippet that was added by your application. + * + * You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites that belong to a seller. + * + * + * __Note:__ Square Online APIs are publicly available as part of an early access program. For more + * information, see [Early access program for Square Online APIs](https://developer.squareup. + * com/docs/online-api#early-access-program-for-square-online-apis). + * + * @param string $siteId The ID of the site that contains the snippet. + * + * @return ApiResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function retrieveSnippet(string $siteId): ApiResponse + { + //prepare query string for API call + $_queryBuilder = '/v2/sites/{site_id}/snippet'; + + //process optional query parameters + $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ + 'site_id' => $siteId, + ]); + + //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\\RetrieveSnippetResponse'); + return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); + } + + /** + * Adds a snippet to a Square Online site or updates the existing snippet on the site. + * The snippet code is appended to the end of the `head` element on every page of the site, except + * checkout pages. A snippet application can add one snippet to a given site. + * + * You can call [ListSites]($e/Sites/ListSites) to get the IDs of the sites that belong to a seller. + * + * + * __Note:__ Square Online APIs are publicly available as part of an early access program. For more + * information, see [Early access program for Square Online APIs](https://developer.squareup. + * com/docs/online-api#early-access-program-for-square-online-apis). + * + * @param string $siteId The ID of the site where you want to add or update the snippet. + * @param \Square\Models\UpsertSnippetRequest $body An object containing the fields to POST + * for the request. + * + * See the corresponding object definition + * for field details. + * + * @return ApiResponse Response from the API call + * + * @throws ApiException Thrown if API call fails + */ + public function upsertSnippet(string $siteId, \Square\Models\UpsertSnippetRequest $body): ApiResponse + { + //prepare query string for API call + $_queryBuilder = '/v2/sites/{site_id}/snippet'; + + //process optional query parameters + $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [ + 'site_id' => $siteId, + ]); + + //validate and preprocess url + $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder); + + //prepare headers + $_headers = [ + 'user-agent' => BaseApi::USER_AGENT, + 'Accept' => 'application/json', + 'content-type' => 'application/json', + 'Square-Version' => $this->config->getSquareVersion(), + 'Authorization' => sprintf('Bearer %1$s', $this->config->getAccessToken()) + ]; + $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders()); + + //json encode body + $_bodyJson = Request\Body::Json($body); + + $_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, $_bodyJson); + } 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\\UpsertSnippetResponse'); + return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext); + } +} diff --git a/src/Apis/V1TransactionsApi.php b/src/Apis/V1TransactionsApi.php index f2cbce5a..5a874c98 100644 --- a/src/Apis/V1TransactionsApi.php +++ b/src/Apis/V1TransactionsApi.php @@ -25,6 +25,8 @@ public function __construct(ConfigurationInterface $config, ?HttpCallBack $httpC /** * Provides summary information for a merchant's online store orders. * + * @deprecated + * * @param string $locationId The ID of the location to list online store orders for. * @param string|null $order The order in which payments are listed in the response. * @param int|null $limit The maximum number of payments to return in a single response. This @@ -43,6 +45,8 @@ public function listOrders( ?int $limit = null, ?string $batchToken = null ): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/orders'; @@ -106,6 +110,8 @@ public function listOrders( /** * Provides comprehensive information for a single online store order, including the order's history. * + * @deprecated + * * @param string $locationId The ID of the order's associated location. * @param string $orderId The order's Square-issued ID. You obtain this value from Order * objects returned by the List Orders endpoint @@ -116,6 +122,8 @@ public function listOrders( */ public function retrieveOrder(string $locationId, string $orderId): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/orders/{order_id}'; @@ -174,6 +182,8 @@ public function retrieveOrder(string $locationId, string $orderId): ApiResponse * Updates the details of an online store order. Every update you perform on an order corresponds to * one of three actions: * + * @deprecated + * * @param string $locationId The ID of the order's associated location. * @param string $orderId The order's Square-issued ID. You obtain this value from Order * objects returned by the List Orders endpoint @@ -192,6 +202,8 @@ public function updateOrder( string $orderId, \Square\Models\V1UpdateOrderRequest $body ): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/orders/{order_id}'; @@ -263,6 +275,8 @@ public function updateOrder( * list an offline payment chronologically between online payments that * were seen in a previous request. * + * @deprecated + * * @param string $locationId The ID of the location to list payments for. If you specify me, * this endpoint returns payments aggregated from all of the * business's locations. @@ -297,6 +311,8 @@ public function listPayments( ?string $batchToken = null, ?bool $includePartial = false ): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/payments'; @@ -364,6 +380,8 @@ public function listPayments( /** * Provides comprehensive information for a single payment. * + * @deprecated + * * @param string $locationId The ID of the payment's associated location. * @param string $paymentId The Square-issued payment ID. payment_id comes from Payment * objects returned by the List Payments endpoint, Settlement objects @@ -376,6 +394,8 @@ public function listPayments( */ public function retrievePayment(string $locationId, string $paymentId): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/payments/{payment_id}'; @@ -434,6 +454,8 @@ public function retrievePayment(string $locationId, string $paymentId): ApiRespo * Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff * during a date range. Date ranges cannot exceed one year in length. * + * @deprecated + * * @param string $locationId The ID of the location to list refunds for. * @param string|null $order The order in which payments are listed in the response. * @param string|null $beginTime The beginning of the requested reporting period, in ISO 8601 @@ -464,6 +486,8 @@ public function listRefunds( ?int $limit = null, ?string $batchToken = null ): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/refunds'; @@ -540,6 +564,8 @@ public function listRefunds( * purposes, you can create fake cash payments in Square Point of Sale and * refund them. * + * @deprecated + * * @param string $locationId The ID of the original payment's associated location. * @param \Square\Models\V1CreateRefundRequest $body An object containing the fields to POST * for the request. @@ -553,6 +579,8 @@ public function listRefunds( */ public function createRefund(string $locationId, \Square\Models\V1CreateRefundRequest $body): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/refunds'; @@ -618,6 +646,8 @@ public function createRefund(string $locationId, \Square\Models\V1CreateRefundRe * *Note**: the ListSettlements endpoint does not provide entry * information. * + * @deprecated + * * @param string $locationId The ID of the location to list settlements for. If you specify me, * this endpoint returns settlements aggregated from all of the * business's locations. @@ -650,6 +680,8 @@ public function listSettlements( ?string $status = null, ?string $batchToken = null ): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/settlements'; @@ -732,6 +764,8 @@ public function listSettlements( * a bank account within 3 business days, but in exceptional cases it may * take longer. * + * @deprecated + * * @param string $locationId The ID of the settlements's associated location. * @param string $settlementId The settlement's Square-issued ID. You obtain this value from * Settlement objects returned by the List Settlements endpoint. @@ -742,6 +776,8 @@ public function listSettlements( */ public function retrieveSettlement(string $locationId, string $settlementId): ApiResponse { + trigger_error('Method ' . __METHOD__ . ' is deprecated.', E_USER_DEPRECATED); + //prepare query string for API call $_queryBuilder = '/v1/{location_id}/settlements/{settlement_id}'; diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php index efc8ed84..ca562b87 100644 --- a/src/ConfigurationDefaults.php +++ b/src/ConfigurationDefaults.php @@ -11,7 +11,7 @@ class ConfigurationDefaults { public const TIMEOUT = 60; - public const SQUARE_VERSION = '2021-04-21'; + public const SQUARE_VERSION = '2021-05-13'; public const ACCESS_TOKEN = 'TODO: Replace'; diff --git a/src/Models/ACHDetails.php b/src/Models/ACHDetails.php new file mode 100644 index 00000000..4bd7708a --- /dev/null +++ b/src/Models/ACHDetails.php @@ -0,0 +1,111 @@ +routingNumber; + } + + /** + * Sets Routing Number. + * + * The routing number for the bank account. + * + * @maps routing_number + */ + public function setRoutingNumber(?string $routingNumber): void + { + $this->routingNumber = $routingNumber; + } + + /** + * Returns Account Number Suffix. + * + * The last few digits of the bank account number. + */ + public function getAccountNumberSuffix(): ?string + { + return $this->accountNumberSuffix; + } + + /** + * Sets Account Number Suffix. + * + * The last few digits of the bank account number. + * + * @maps account_number_suffix + */ + public function setAccountNumberSuffix(?string $accountNumberSuffix): void + { + $this->accountNumberSuffix = $accountNumberSuffix; + } + + /** + * Returns Account Type. + * + * The type of the bank account performing the transfer. The account type can be `CHECKING`, + * `SAVINGS`, or `UNKNOWN`. + */ + public function getAccountType(): ?string + { + return $this->accountType; + } + + /** + * Sets Account Type. + * + * The type of the bank account performing the transfer. The account type can be `CHECKING`, + * `SAVINGS`, or `UNKNOWN`. + * + * @maps account_type + */ + public function setAccountType(?string $accountType): void + { + $this->accountType = $accountType; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['routing_number'] = $this->routingNumber; + $json['account_number_suffix'] = $this->accountNumberSuffix; + $json['account_type'] = $this->accountType; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/BankAccountPaymentDetails.php b/src/Models/BankAccountPaymentDetails.php new file mode 100644 index 00000000..6150ba88 --- /dev/null +++ b/src/Models/BankAccountPaymentDetails.php @@ -0,0 +1,257 @@ +bankName; + } + + /** + * Sets Bank Name. + * + * The name of the bank associated with the bank account. + * + * @maps bank_name + */ + public function setBankName(?string $bankName): void + { + $this->bankName = $bankName; + } + + /** + * Returns Transfer Type. + * + * The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. + */ + public function getTransferType(): ?string + { + return $this->transferType; + } + + /** + * Sets Transfer Type. + * + * The type of the bank transfer. The type can be `ACH` or `UNKNOWN`. + * + * @maps transfer_type + */ + public function setTransferType(?string $transferType): void + { + $this->transferType = $transferType; + } + + /** + * Returns Account Ownership Type. + * + * The ownership type of the bank account performing the transfer. + * The type can be `INDIVIDUAL`, `COMPANY`, or `UNKNOWN`. + */ + public function getAccountOwnershipType(): ?string + { + return $this->accountOwnershipType; + } + + /** + * Sets Account Ownership Type. + * + * The ownership type of the bank account performing the transfer. + * The type can be `INDIVIDUAL`, `COMPANY`, or `UNKNOWN`. + * + * @maps account_ownership_type + */ + public function setAccountOwnershipType(?string $accountOwnershipType): void + { + $this->accountOwnershipType = $accountOwnershipType; + } + + /** + * Returns Fingerprint. + * + * Uniquely identifies the bank account for this seller and can be used + * to determine if payments are from the same bank account. + */ + public function getFingerprint(): ?string + { + return $this->fingerprint; + } + + /** + * Sets Fingerprint. + * + * Uniquely identifies the bank account for this seller and can be used + * to determine if payments are from the same bank account. + * + * @maps fingerprint + */ + public function setFingerprint(?string $fingerprint): void + { + $this->fingerprint = $fingerprint; + } + + /** + * Returns Country. + * + * The two-letter ISO code representing the country the bank account is located in. + */ + public function getCountry(): ?string + { + return $this->country; + } + + /** + * Sets Country. + * + * The two-letter ISO code representing the country the bank account is located in. + * + * @maps country + */ + public function setCountry(?string $country): void + { + $this->country = $country; + } + + /** + * Returns Statement Description. + * + * The statement description as sent to the bank. + */ + public function getStatementDescription(): ?string + { + return $this->statementDescription; + } + + /** + * Sets Statement Description. + * + * The statement description as sent to the bank. + * + * @maps statement_description + */ + public function setStatementDescription(?string $statementDescription): void + { + $this->statementDescription = $statementDescription; + } + + /** + * Returns Ach Details. + * + * ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. + */ + public function getAchDetails(): ?ACHDetails + { + return $this->achDetails; + } + + /** + * Sets Ach Details. + * + * ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. + * + * @maps ach_details + */ + public function setAchDetails(?ACHDetails $achDetails): void + { + $this->achDetails = $achDetails; + } + + /** + * Returns Errors. + * + * Information about errors encountered during the request. + * + * @return Error[]|null + */ + public function getErrors(): ?array + { + return $this->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; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['bank_name'] = $this->bankName; + $json['transfer_type'] = $this->transferType; + $json['account_ownership_type'] = $this->accountOwnershipType; + $json['fingerprint'] = $this->fingerprint; + $json['country'] = $this->country; + $json['statement_description'] = $this->statementDescription; + $json['ach_details'] = $this->achDetails; + $json['errors'] = $this->errors; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/BatchChangeInventoryRequest.php b/src/Models/BatchChangeInventoryRequest.php index 78135587..a3926e38 100644 --- a/src/Models/BatchChangeInventoryRequest.php +++ b/src/Models/BatchChangeInventoryRequest.php @@ -7,7 +7,7 @@ class BatchChangeInventoryRequest implements \JsonSerializable { /** - * @var string|null + * @var string */ private $idempotencyKey; @@ -21,6 +21,14 @@ class BatchChangeInventoryRequest implements \JsonSerializable */ private $ignoreUnchangedCounts; + /** + * @param string $idempotencyKey + */ + public function __construct(string $idempotencyKey) + { + $this->idempotencyKey = $idempotencyKey; + } + /** * Returns Idempotency Key. * @@ -31,7 +39,7 @@ class BatchChangeInventoryRequest implements \JsonSerializable * [API Development 101](https://developer.squareup.com/docs/basics/api101/overview) section for more * information. */ - public function getIdempotencyKey(): ?string + public function getIdempotencyKey(): string { return $this->idempotencyKey; } @@ -46,9 +54,10 @@ public function getIdempotencyKey(): ?string * [API Development 101](https://developer.squareup.com/docs/basics/api101/overview) section for more * information. * + * @required * @maps idempotency_key */ - public function setIdempotencyKey(?string $idempotencyKey): void + public function setIdempotencyKey(string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } diff --git a/src/Models/BatchRetrieveOrdersRequest.php b/src/Models/BatchRetrieveOrdersRequest.php index 94d1eda6..f560eaa5 100644 --- a/src/Models/BatchRetrieveOrdersRequest.php +++ b/src/Models/BatchRetrieveOrdersRequest.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in requests to the - * BatchRetrieveOrders endpoint. + * `BatchRetrieveOrders` endpoint. */ class BatchRetrieveOrdersRequest implements \JsonSerializable { diff --git a/src/Models/BatchRetrieveOrdersResponse.php b/src/Models/BatchRetrieveOrdersResponse.php index 8ed68d3a..3eadea67 100644 --- a/src/Models/BatchRetrieveOrdersResponse.php +++ b/src/Models/BatchRetrieveOrdersResponse.php @@ -6,7 +6,7 @@ /** * Defines the fields that are included in the response body of - * a request to the BatchRetrieveOrders endpoint. + * a request to the `BatchRetrieveOrders` endpoint. */ class BatchRetrieveOrdersResponse implements \JsonSerializable { diff --git a/src/Models/CalculateOrderRequest.php b/src/Models/CalculateOrderRequest.php index 4e813039..6007cf1c 100644 --- a/src/Models/CalculateOrderRequest.php +++ b/src/Models/CalculateOrderRequest.php @@ -28,8 +28,8 @@ public function __construct(Order $order) * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -43,8 +43,8 @@ public function getOrder(): Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -60,10 +60,10 @@ public function setOrder(Order $order): void /** * Returns Proposed Rewards. * - * Identifies one or more loyalty reward tiers to apply during order calculation. + * Identifies one or more loyalty reward tiers to apply during the order calculation. * The discounts defined by the reward tiers are added to the order only to preview the - * effect of applying the specified reward(s). The reward(s) do not correspond to actual - * redemptions, that is, no `reward`s are created. Therefore, the reward `id`s are + * effect of applying the specified rewards. The rewards do not correspond to actual + * redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are * random strings used only to reference the reward tier. * * @return OrderReward[]|null @@ -76,10 +76,10 @@ public function getProposedRewards(): ?array /** * Sets Proposed Rewards. * - * Identifies one or more loyalty reward tiers to apply during order calculation. + * Identifies one or more loyalty reward tiers to apply during the order calculation. * The discounts defined by the reward tiers are added to the order only to preview the - * effect of applying the specified reward(s). The reward(s) do not correspond to actual - * redemptions, that is, no `reward`s are created. Therefore, the reward `id`s are + * effect of applying the specified rewards. The rewards do not correspond to actual + * redemptions; that is, no `reward`s are created. Therefore, the reward `id`s are * random strings used only to reference the reward tier. * * @maps proposed_rewards diff --git a/src/Models/CalculateOrderResponse.php b/src/Models/CalculateOrderResponse.php index f5d41753..f4398705 100644 --- a/src/Models/CalculateOrderResponse.php +++ b/src/Models/CalculateOrderResponse.php @@ -20,8 +20,8 @@ class CalculateOrderResponse implements \JsonSerializable * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -35,8 +35,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. diff --git a/src/Models/CatalogSubscriptionPlan.php b/src/Models/CatalogSubscriptionPlan.php index 6427940f..e486961e 100644 --- a/src/Models/CatalogSubscriptionPlan.php +++ b/src/Models/CatalogSubscriptionPlan.php @@ -12,21 +12,31 @@ class CatalogSubscriptionPlan implements \JsonSerializable { /** - * @var string|null + * @var string */ private $name; /** - * @var SubscriptionPhase[]|null + * @var SubscriptionPhase[] */ private $phases; + /** + * @param string $name + * @param SubscriptionPhase[] $phases + */ + public function __construct(string $name, array $phases) + { + $this->name = $name; + $this->phases = $phases; + } + /** * Returns Name. * * The name of the plan. */ - public function getName(): ?string + public function getName(): string { return $this->name; } @@ -36,9 +46,10 @@ public function getName(): ?string * * The name of the plan. * + * @required * @maps name */ - public function setName(?string $name): void + public function setName(string $name): void { $this->name = $name; } @@ -48,9 +59,9 @@ public function setName(?string $name): void * * A list of SubscriptionPhase containing the [SubscriptionPhase]($m/SubscriptionPhase) for this plan. * - * @return SubscriptionPhase[]|null + * @return SubscriptionPhase[] */ - public function getPhases(): ?array + public function getPhases(): array { return $this->phases; } @@ -60,11 +71,12 @@ public function getPhases(): ?array * * A list of SubscriptionPhase containing the [SubscriptionPhase]($m/SubscriptionPhase) for this plan. * + * @required * @maps phases * - * @param SubscriptionPhase[]|null $phases + * @param SubscriptionPhase[] $phases */ - public function setPhases(?array $phases): void + public function setPhases(array $phases): void { $this->phases = $phases; } diff --git a/src/Models/Checkout.php b/src/Models/Checkout.php index d5a3c935..22e7a3b5 100644 --- a/src/Models/Checkout.php +++ b/src/Models/Checkout.php @@ -270,8 +270,8 @@ public function setRedirectUrl(?string $redirectUrl): void * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -285,8 +285,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. diff --git a/src/Models/CreateOrderRequest.php b/src/Models/CreateOrderRequest.php index 1b1c9df0..5a14cf0d 100644 --- a/src/Models/CreateOrderRequest.php +++ b/src/Models/CreateOrderRequest.php @@ -20,8 +20,8 @@ class CreateOrderRequest implements \JsonSerializable * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -35,8 +35,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -52,14 +52,14 @@ public function setOrder(?Order $order): void * Returns Idempotency Key. * * A value you specify that uniquely identifies this - * order among orders you've created. + * order among orders you have created. * - * If you're unsure whether a particular order was created successfully, - * you can reattempt it with the same idempotency key without + * If you are unsure whether a particular order was created successfully, + * you can try it again with the same idempotency key without * worrying about creating duplicate orders. * - * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more - * information. + * For more information, see [Idempotency](https://developer.squareup. + * com/docs/basics/api101/idempotency). */ public function getIdempotencyKey(): ?string { @@ -70,14 +70,14 @@ public function getIdempotencyKey(): ?string * Sets Idempotency Key. * * A value you specify that uniquely identifies this - * order among orders you've created. + * order among orders you have created. * - * If you're unsure whether a particular order was created successfully, - * you can reattempt it with the same idempotency key without + * If you are unsure whether a particular order was created successfully, + * you can try it again with the same idempotency key without * worrying about creating duplicate orders. * - * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more - * information. + * For more information, see [Idempotency](https://developer.squareup. + * com/docs/basics/api101/idempotency). * * @maps idempotency_key */ diff --git a/src/Models/CreateOrderResponse.php b/src/Models/CreateOrderResponse.php index 1b17f36e..c67f9a78 100644 --- a/src/Models/CreateOrderResponse.php +++ b/src/Models/CreateOrderResponse.php @@ -6,9 +6,9 @@ /** * Defines the fields that are included in the response body of - * a request to the CreateOrder endpoint. + * a request to the `CreateOrder` endpoint. * - * One of `errors` or `order` is present in a given response (never both). + * Either `errors` or `order` is present in a given response, but never both. */ class CreateOrderResponse implements \JsonSerializable { @@ -26,8 +26,8 @@ class CreateOrderResponse implements \JsonSerializable * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -41,8 +41,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. diff --git a/src/Models/DeleteSnippetResponse.php b/src/Models/DeleteSnippetResponse.php new file mode 100644 index 00000000..fe3172e3 --- /dev/null +++ b/src/Models/DeleteSnippetResponse.php @@ -0,0 +1,57 @@ +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['errors'] = $this->errors; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/ExternalPaymentDetails.php b/src/Models/ExternalPaymentDetails.php index b48f8936..8a16bc44 100644 --- a/src/Models/ExternalPaymentDetails.php +++ b/src/Models/ExternalPaymentDetails.php @@ -47,7 +47,7 @@ public function __construct(string $type, string $source) * * The type of external payment the seller received. It can be one of the following: * - CHECK - Paid using a physical check. - * - BANK_TRANSFER - Paid using ACH or another bank transfer. + * - BANK_TRANSFER - Paid using external bank transfer. * - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. * - CRYPTO - Paid using a crypto currency. * - SQUARE_CASH - Paid using Square Cash App. @@ -68,7 +68,7 @@ public function getType(): string * * The type of external payment the seller received. It can be one of the following: * - CHECK - Paid using a physical check. - * - BANK_TRANSFER - Paid using ACH or another bank transfer. + * - BANK_TRANSFER - Paid using external bank transfer. * - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. * - CRYPTO - Paid using a crypto currency. * - SQUARE_CASH - Paid using Square Cash App. diff --git a/src/Models/InventoryAdjustment.php b/src/Models/InventoryAdjustment.php index 28802f0e..a48a897b 100644 --- a/src/Models/InventoryAdjustment.php +++ b/src/Models/InventoryAdjustment.php @@ -192,8 +192,8 @@ public function setToState(?string $toState): void /** * Returns Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items are being tracked. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items is being tracked. */ public function getLocationId(): ?string { @@ -203,8 +203,8 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items are being tracked. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items is being tracked. * * @maps location_id */ @@ -216,8 +216,8 @@ public function setLocationId(?string $locationId): void /** * Returns Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. */ public function getCatalogObjectId(): ?string { @@ -227,8 +227,8 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. * * @maps catalog_object_id */ @@ -240,8 +240,8 @@ public function setCatalogObjectId(?string $catalogObjectId): void /** * Returns Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked. Tracking is only + * The [type](entity:CatalogObjectType] of the + * [CatalogObject]($m/CatalogObject) being tracked. Tracking is only * supported for the `ITEM_VARIATION` type. */ public function getCatalogObjectType(): ?string @@ -252,8 +252,8 @@ public function getCatalogObjectType(): ?string /** * Sets Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked. Tracking is only + * The [type](entity:CatalogObjectType] of the + * [CatalogObject]($m/CatalogObject) being tracked. Tracking is only * supported for the `ITEM_VARIATION` type. * * @maps catalog_object_type @@ -324,8 +324,8 @@ public function setTotalPriceMoney(?Money $totalPriceMoney): void /** * Returns Occurred At. * - * A client-generated timestamp in RFC 3339 format that indicates when - * the adjustment took place. For write actions, the `occurred_at` + * A client-generated RFC 3339-formatted timestamp that indicates when + * the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` * timestamp cannot be older than 24 hours or in the future relative to the * time of the request. */ @@ -337,8 +337,8 @@ public function getOccurredAt(): ?string /** * Sets Occurred At. * - * A client-generated timestamp in RFC 3339 format that indicates when - * the adjustment took place. For write actions, the `occurred_at` + * A client-generated RFC 3339-formatted timestamp that indicates when + * the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` * timestamp cannot be older than 24 hours or in the future relative to the * time of the request. * @@ -352,8 +352,7 @@ public function setOccurredAt(?string $occurredAt): void /** * Returns Created At. * - * A read-only timestamp in RFC 3339 format that indicates when Square - * received the adjustment. + * An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received. */ public function getCreatedAt(): ?string { @@ -363,8 +362,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * A read-only timestamp in RFC 3339 format that indicates when Square - * received the adjustment. + * An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received. * * @maps created_at */ @@ -398,7 +396,7 @@ public function setSource(?SourceApplication $source): void /** * Returns Employee Id. * - * The Square ID of the [Employee]($m/Employee) responsible for the + * The Square-generated ID of the [Employee]($m/Employee) responsible for the * inventory adjustment. */ public function getEmployeeId(): ?string @@ -409,7 +407,7 @@ public function getEmployeeId(): ?string /** * Sets Employee Id. * - * The Square ID of the [Employee]($m/Employee) responsible for the + * The Square-generated ID of the [Employee]($m/Employee) responsible for the * inventory adjustment. * * @maps employee_id @@ -422,7 +420,7 @@ public function setEmployeeId(?string $employeeId): void /** * Returns Transaction Id. * - * The read-only Square ID of the [Transaction][#type-transaction] that + * The Square-generated ID of the [Transaction][#type-transaction] that * caused the adjustment. Only relevant for payment-related state * transitions. */ @@ -434,7 +432,7 @@ public function getTransactionId(): ?string /** * Sets Transaction Id. * - * The read-only Square ID of the [Transaction][#type-transaction] that + * The Square-generated ID of the [Transaction][#type-transaction] that * caused the adjustment. Only relevant for payment-related state * transitions. * @@ -448,7 +446,7 @@ public function setTransactionId(?string $transactionId): void /** * Returns Refund Id. * - * The read-only Square ID of the [Refund][#type-refund] that + * The Square-generated ID of the [Refund][#type-refund] that * caused the adjustment. Only relevant for refund-related state * transitions. */ @@ -460,7 +458,7 @@ public function getRefundId(): ?string /** * Sets Refund Id. * - * The read-only Square ID of the [Refund][#type-refund] that + * The Square-generated ID of the [Refund][#type-refund] that * caused the adjustment. Only relevant for refund-related state * transitions. * @@ -474,7 +472,7 @@ public function setRefundId(?string $refundId): void /** * Returns Purchase Order Id. * - * The read-only Square ID of the purchase order that caused the + * The Square-generated ID of the purchase order that caused the * adjustment. Only relevant for state transitions from the Square for Retail * app. */ @@ -486,7 +484,7 @@ public function getPurchaseOrderId(): ?string /** * Sets Purchase Order Id. * - * The read-only Square ID of the purchase order that caused the + * The Square-generated ID of the purchase order that caused the * adjustment. Only relevant for state transitions from the Square for Retail * app. * @@ -500,7 +498,7 @@ public function setPurchaseOrderId(?string $purchaseOrderId): void /** * Returns Goods Receipt Id. * - * The read-only Square ID of the Square goods receipt that caused the + * The Square-generated ID of the goods receipt that caused the * adjustment. Only relevant for state transitions from the Square for Retail * app. */ @@ -512,7 +510,7 @@ public function getGoodsReceiptId(): ?string /** * Sets Goods Receipt Id. * - * The read-only Square ID of the Square goods receipt that caused the + * The Square-generated ID of the goods receipt that caused the * adjustment. Only relevant for state transitions from the Square for Retail * app. * diff --git a/src/Models/InventoryChange.php b/src/Models/InventoryChange.php index 330ab9fd..835b8db7 100644 --- a/src/Models/InventoryChange.php +++ b/src/Models/InventoryChange.php @@ -7,7 +7,7 @@ /** * Represents a single physical count, inventory, adjustment, or transfer * that is part of the history of inventory changes for a particular - * `CatalogObject`. + * [CatalogObject]($m/CatalogObject) instance. */ class InventoryChange implements \JsonSerializable { diff --git a/src/Models/InventoryCount.php b/src/Models/InventoryCount.php index 795702de..f206dfc3 100644 --- a/src/Models/InventoryCount.php +++ b/src/Models/InventoryCount.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Represents Square's estimated quantity of items in a particular state at a - * particular location based on the known history of physical counts and + * Represents Square-estimated quantity of items in a particular state at a + * particular seller location based on the known history of physical counts and * inventory adjustments. */ class InventoryCount implements \JsonSerializable @@ -44,8 +44,8 @@ class InventoryCount implements \JsonSerializable /** * Returns Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. */ public function getCatalogObjectId(): ?string { @@ -55,8 +55,8 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. * * @maps catalog_object_id */ @@ -68,8 +68,8 @@ public function setCatalogObjectId(?string $catalogObjectId): void /** * Returns Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked. Tracking is only + * The [type]($m/CatalogObjectType) of the + * [CatalogObject]($m/CatalogObject) being tracked. Tracking is only * supported for the `ITEM_VARIATION` type. */ public function getCatalogObjectType(): ?string @@ -80,8 +80,8 @@ public function getCatalogObjectType(): ?string /** * Sets Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked. Tracking is only + * The [type]($m/CatalogObjectType) of the + * [CatalogObject]($m/CatalogObject) being tracked. Tracking is only * supported for the `ITEM_VARIATION` type. * * @maps catalog_object_type @@ -116,8 +116,8 @@ public function setState(?string $state): void /** * Returns Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items are being tracked. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items is being tracked. */ public function getLocationId(): ?string { @@ -127,8 +127,8 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items are being tracked. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items is being tracked. * * @maps location_id */ @@ -164,9 +164,9 @@ public function setQuantity(?string $quantity): void /** * Returns Calculated At. * - * 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. + * An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment + * affecting + * the estimated count is received. */ public function getCalculatedAt(): ?string { @@ -176,9 +176,9 @@ public function getCalculatedAt(): ?string /** * Sets Calculated At. * - * 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. + * An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment + * affecting + * the estimated count is received. * * @maps calculated_at */ diff --git a/src/Models/InventoryPhysicalCount.php b/src/Models/InventoryPhysicalCount.php index e726ef04..214aabdd 100644 --- a/src/Models/InventoryPhysicalCount.php +++ b/src/Models/InventoryPhysicalCount.php @@ -70,7 +70,7 @@ class InventoryPhysicalCount implements \JsonSerializable /** * Returns Id. * - * A unique ID generated by Square for the + * A unique Square-generated ID for the * [InventoryPhysicalCount]($m/InventoryPhysicalCount). */ public function getId(): ?string @@ -81,7 +81,7 @@ public function getId(): ?string /** * Sets Id. * - * A unique ID generated by Square for the + * A unique Square-generated ID for the * [InventoryPhysicalCount]($m/InventoryPhysicalCount). * * @maps id @@ -120,8 +120,8 @@ public function setReferenceId(?string $referenceId): void /** * Returns Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. */ public function getCatalogObjectId(): ?string { @@ -131,8 +131,8 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. * * @maps catalog_object_id */ @@ -144,8 +144,8 @@ public function setCatalogObjectId(?string $catalogObjectId): void /** * Returns Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked. Tracking is only + * The [type]($m/CatalogObjectType) of the + * [CatalogObject]($m/CatalogObject) being tracked. Tracking is only * supported for the `ITEM_VARIATION` type. */ public function getCatalogObjectType(): ?string @@ -156,8 +156,8 @@ public function getCatalogObjectType(): ?string /** * Sets Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked. Tracking is only + * The [type]($m/CatalogObjectType) of the + * [CatalogObject]($m/CatalogObject) being tracked. Tracking is only * supported for the `ITEM_VARIATION` type. * * @maps catalog_object_type @@ -192,8 +192,8 @@ public function setState(?string $state): void /** * Returns Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items are being tracked. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items is being tracked. */ public function getLocationId(): ?string { @@ -203,8 +203,8 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items are being tracked. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items is being tracked. * * @maps location_id */ @@ -217,7 +217,7 @@ public function setLocationId(?string $locationId): void * Returns Quantity. * * The number of items affected by the physical count as a decimal string. - * Can support up to 5 digits after the decimal point. + * The number can support up to 5 digits after the decimal point. */ public function getQuantity(): ?string { @@ -228,7 +228,7 @@ public function getQuantity(): ?string * Sets Quantity. * * The number of items affected by the physical count as a decimal string. - * Can support up to 5 digits after the decimal point. + * The number can support up to 5 digits after the decimal point. * * @maps quantity */ @@ -262,7 +262,7 @@ public function setSource(?SourceApplication $source): void /** * Returns Employee Id. * - * The Square ID of the [Employee]($m/Employee) responsible for the + * The Square-generated 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]($m/Employee) responsible for the + * The Square-generated ID of the [Employee]($m/Employee) responsible for the * physical count. * * @maps employee_id @@ -286,8 +286,8 @@ public function setEmployeeId(?string $employeeId): void /** * Returns Occurred At. * - * A client-generated timestamp in RFC 3339 format that indicates when - * the physical count took place. For write actions, the `occurred_at` + * A client-generated RFC 3339-formatted timestamp that indicates when + * the physical count was examined. For physical count updates, the `occurred_at` * timestamp cannot be older than 24 hours or in the future relative to the * time of the request. */ @@ -299,8 +299,8 @@ public function getOccurredAt(): ?string /** * Sets Occurred At. * - * A client-generated timestamp in RFC 3339 format that indicates when - * the physical count took place. For write actions, the `occurred_at` + * A client-generated RFC 3339-formatted timestamp that indicates when + * the physical count was examined. For physical count updates, the `occurred_at` * timestamp cannot be older than 24 hours or in the future relative to the * time of the request. * @@ -314,8 +314,7 @@ public function setOccurredAt(?string $occurredAt): void /** * Returns Created At. * - * A read-only timestamp in RFC 3339 format that indicates when Square - * received the physical count. + * An RFC 3339-formatted timestamp that indicates when the physical count is received. */ public function getCreatedAt(): ?string { @@ -325,8 +324,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * A read-only timestamp in RFC 3339 format that indicates when Square - * received the physical count. + * An RFC 3339-formatted timestamp that indicates when the physical count is received. * * @maps created_at */ diff --git a/src/Models/InventoryTransfer.php b/src/Models/InventoryTransfer.php index e12f34d5..613b86e0 100644 --- a/src/Models/InventoryTransfer.php +++ b/src/Models/InventoryTransfer.php @@ -143,8 +143,8 @@ public function setState(?string $state): void /** * Returns From Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items were tracked before the transfer. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items was tracked before the transfer. */ public function getFromLocationId(): ?string { @@ -154,8 +154,8 @@ public function getFromLocationId(): ?string /** * Sets From Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items were tracked before the transfer. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items was tracked before the transfer. * * @maps from_location_id */ @@ -167,8 +167,8 @@ public function setFromLocationId(?string $fromLocationId): void /** * Returns To Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items were tracked after the transfer. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items was tracked after the transfer. */ public function getToLocationId(): ?string { @@ -178,8 +178,8 @@ public function getToLocationId(): ?string /** * Sets To Location Id. * - * The Square ID of the [Location]($m/Location) where the related - * quantity of items were tracked after the transfer. + * The Square-generated ID of the [Location]($m/Location) where the related + * quantity of items was tracked after the transfer. * * @maps to_location_id */ @@ -191,8 +191,8 @@ public function setToLocationId(?string $toLocationId): void /** * Returns Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. */ public function getCatalogObjectId(): ?string { @@ -202,8 +202,8 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The Square generated ID of the - * `CatalogObject` being tracked. + * The Square-generated ID of the + * [CatalogObject]($m/CatalogObject) being tracked. * * @maps catalog_object_id */ @@ -215,8 +215,8 @@ public function setCatalogObjectId(?string $catalogObjectId): void /** * Returns Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked.Tracking is only + * The [type]($m/CatalogObjectType) of the + * [CatalogObject]($m/CatalogObject) being tracked.Tracking is only * supported for the `ITEM_VARIATION` type. */ public function getCatalogObjectType(): ?string @@ -227,8 +227,8 @@ public function getCatalogObjectType(): ?string /** * Sets Catalog Object Type. * - * The `CatalogObjectType` of the - * `CatalogObject` being tracked.Tracking is only + * The [type]($m/CatalogObjectType) of the + * [CatalogObject]($m/CatalogObject) being tracked.Tracking is only * supported for the `ITEM_VARIATION` type. * * @maps catalog_object_type @@ -265,7 +265,7 @@ public function setQuantity(?string $quantity): void /** * Returns Occurred At. * - * A client-generated timestamp in RFC 3339 format that indicates when + * A client-generated RFC 3339-formatted timestamp 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. @@ -278,7 +278,7 @@ public function getOccurredAt(): ?string /** * Sets Occurred At. * - * A client-generated timestamp in RFC 3339 format that indicates when + * A client-generated RFC 3339-formatted timestamp 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. @@ -293,7 +293,7 @@ public function setOccurredAt(?string $occurredAt): void /** * Returns Created At. * - * A read-only timestamp in RFC 3339 format that indicates when Square + * An RFC 3339-formatted timestamp that indicates when Square * received the transfer request. */ public function getCreatedAt(): ?string @@ -304,7 +304,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * A read-only timestamp in RFC 3339 format that indicates when Square + * An RFC 3339-formatted timestamp that indicates when Square * received the transfer request. * * @maps created_at @@ -339,7 +339,7 @@ public function setSource(?SourceApplication $source): void /** * Returns Employee Id. * - * The Square ID of the [Employee]($m/Employee) responsible for the + * The Square-generated 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]($m/Employee) responsible for the + * The Square-generated ID of the [Employee]($m/Employee) responsible for the * inventory transfer. * * @maps employee_id diff --git a/src/Models/ListCatalogRequest.php b/src/Models/ListCatalogRequest.php index c25cdcfa..c49c3946 100644 --- a/src/Models/ListCatalogRequest.php +++ b/src/Models/ListCatalogRequest.php @@ -25,6 +25,7 @@ class ListCatalogRequest implements \JsonSerializable * Returns Cursor. * * The pagination cursor returned in the previous response. Leave unset for an initial request. + * The page size is currently set to be 100. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. */ public function getCursor(): ?string @@ -36,6 +37,7 @@ public function getCursor(): ?string * Sets Cursor. * * The pagination cursor returned in the previous response. Leave unset for an initial request. + * The page size is currently set to be 100. * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. * * @maps cursor diff --git a/src/Models/ListSitesResponse.php b/src/Models/ListSitesResponse.php new file mode 100644 index 00000000..40c31f51 --- /dev/null +++ b/src/Models/ListSitesResponse.php @@ -0,0 +1,89 @@ +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; + } + + /** + * Returns Sites. + * + * The sites that belong to the seller. + * + * @return Site[]|null + */ + public function getSites(): ?array + { + return $this->sites; + } + + /** + * Sets Sites. + * + * The sites that belong to the seller. + * + * @maps sites + * + * @param Site[]|null $sites + */ + public function setSites(?array $sites): void + { + $this->sites = $sites; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['errors'] = $this->errors; + $json['sites'] = $this->sites; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/LoyaltyAccount.php b/src/Models/LoyaltyAccount.php index 44b6a40f..23b3b054 100644 --- a/src/Models/LoyaltyAccount.php +++ b/src/Models/LoyaltyAccount.php @@ -15,11 +15,6 @@ class LoyaltyAccount implements \JsonSerializable */ private $id; - /** - * @var LoyaltyAccountMapping[]|null - */ - private $mappings; - /** * @var string */ @@ -90,46 +85,6 @@ public function setId(?string $id): void $this->id = $id; } - /** - * Returns Mappings. - * - * 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. - * - * @return LoyaltyAccountMapping[]|null - */ - public function getMappings(): ?array - { - return $this->mappings; - } - - /** - * Sets Mappings. - * - * 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. - * - * @maps mappings - * - * @param LoyaltyAccountMapping[]|null $mappings - */ - public function setMappings(?array $mappings): void - { - $this->mappings = $mappings; - } - /** * Returns Program Id. * @@ -332,7 +287,6 @@ public function jsonSerialize() { $json = []; $json['id'] = $this->id; - $json['mappings'] = $this->mappings; $json['program_id'] = $this->programId; $json['balance'] = $this->balance; $json['lifetime_points'] = $this->lifetimePoints; diff --git a/src/Models/LoyaltyAccountMapping.php b/src/Models/LoyaltyAccountMapping.php index d09c655c..5ee4350b 100644 --- a/src/Models/LoyaltyAccountMapping.php +++ b/src/Models/LoyaltyAccountMapping.php @@ -18,16 +18,6 @@ class LoyaltyAccountMapping implements \JsonSerializable */ private $id; - /** - * @var string|null - */ - private $type; - - /** - * @var string|null - */ - private $value; - /** * @var string|null */ @@ -60,56 +50,6 @@ public function setId(?string $id): void $this->id = $id; } - /** - * Returns Type. - * - * The type of mapping. - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Sets Type. - * - * The type of mapping. - * - * @maps type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - - /** - * Returns Value. - * - * 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 - { - return $this->value; - } - - /** - * Sets Value. - * - * 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`. - * - * @maps value - */ - public function setValue(?string $value): void - { - $this->value = $value; - } - /** * Returns Created At. * @@ -136,8 +76,6 @@ public function setCreatedAt(?string $createdAt): void * 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 { @@ -149,8 +87,6 @@ public function getPhoneNumber(): ?string * * 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 @@ -167,8 +103,6 @@ public function jsonSerialize() { $json = []; $json['id'] = $this->id; - $json['type'] = $this->type; - $json['value'] = $this->value; $json['created_at'] = $this->createdAt; $json['phone_number'] = $this->phoneNumber; diff --git a/src/Models/Order.php b/src/Models/Order.php index 3c3a0d28..a74e8f26 100644 --- a/src/Models/Order.php +++ b/src/Models/Order.php @@ -6,8 +6,8 @@ /** * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -192,7 +192,7 @@ public function setId(?string $id): void /** * Returns Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. */ public function getLocationId(): string { @@ -202,7 +202,7 @@ public function getLocationId(): string /** * Sets Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. * * @required * @maps location_id @@ -215,7 +215,7 @@ public function setLocationId(string $locationId): void /** * Returns Reference Id. * - * A client specified identifier to associate an entity in another system + * A client-specified ID to associate an entity in another system * with this order. */ public function getReferenceId(): ?string @@ -226,7 +226,7 @@ public function getReferenceId(): ?string /** * Sets Reference Id. * - * A client specified identifier to associate an entity in another system + * A client-specified ID to associate an entity in another system * with this order. * * @maps reference_id @@ -261,7 +261,7 @@ public function setSource(?OrderSource $source): void /** * Returns Customer Id. * - * The [Customer]($m/Customer) ID of the customer associated with the order. + * The ID of the [customer]($m/Customer) associated with the order. */ public function getCustomerId(): ?string { @@ -271,7 +271,7 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The [Customer]($m/Customer) ID of the customer associated with the order. + * The ID of the [customer]($m/Customer) associated with the order. * * @maps customer_id */ @@ -313,12 +313,12 @@ public function setLineItems(?array $lineItems): void * * 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. + * with `ORDER` scope, the server generates 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. + * On reads, each tax in the list includes 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` + * __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated + * `line_items.taxes` field results in an error. Use `line_items.applied_taxes` * instead. * * @return OrderLineItemTax[]|null @@ -335,12 +335,12 @@ public function getTaxes(): ?array * * 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. + * with `ORDER` scope, the server generates 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. + * On reads, each tax in the list includes 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` + * __IMPORTANT__: If `LINE_ITEM` scope is set on any taxes in this field, using the deprecated + * `line_items.taxes` field results in an error. Use `line_items.applied_taxes` * instead. * * @maps taxes @@ -359,11 +359,11 @@ public function setTaxes(?array $taxes): void * * 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 discounts with `ORDER` scope, the server generates 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` + * __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated + * `line_items.discounts` field results in an error. Use `line_items.applied_discounts` * instead. * * @return OrderLineItemDiscount[]|null @@ -380,11 +380,11 @@ public function getDiscounts(): ?array * * 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 discounts with `ORDER` scope, the server generates 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` + * __IMPORTANT__: If `LINE_ITEM` scope is set on any discounts in this field, using the deprecated + * `line_items.discounts` field results in an error. Use `line_items.applied_discounts` * instead. * * @maps discounts @@ -425,10 +425,10 @@ public function setServiceCharges(?array $serviceCharges): void /** * Returns Fulfillments. * - * Details on order fulfillment. + * Details about order fulfillment. * * Orders can only be created with at most one fulfillment. However, orders returned - * by the API may contain multiple fulfillments. + * by the API might contain multiple fulfillments. * * @return OrderFulfillment[]|null */ @@ -440,10 +440,10 @@ public function getFulfillments(): ?array /** * Sets Fulfillments. * - * Details on order fulfillment. + * Details about order fulfillment. * * Orders can only be created with at most one fulfillment. However, orders returned - * by the API may contain multiple fulfillments. + * by the API might contain multiple fulfillments. * * @maps fulfillments * @@ -457,8 +457,8 @@ public function setFulfillments(?array $fulfillments): void /** * Returns Returns. * - * Collection of items from sale Orders being returned in this one. Normally part of an - * Itemized Return or Exchange. There will be exactly one `Return` object per sale Order being + * A collection of items from sale orders being returned in this one. Normally part of an + * itemized return or exchange. There is exactly one `Return` object per sale `Order` being * referenced. * * @return OrderReturn[]|null @@ -471,8 +471,8 @@ public function getReturns(): ?array /** * Sets Returns. * - * Collection of items from sale Orders being returned in this one. Normally part of an - * Itemized Return or Exchange. There will be exactly one `Return` object per sale Order being + * A collection of items from sale orders being returned in this one. Normally part of an + * itemized return or exchange. There is exactly one `Return` object per sale `Order` being * referenced. * * @maps returns @@ -531,8 +531,9 @@ public function setNetAmounts(?OrderMoneyAmounts $netAmounts): void /** * Returns Rounding Adjustment. * - * A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding - * when the minimum unit of account is smaller than the lowest physical denomination of currency. + * A rounding adjustment of the money being returned. Commonly used to apply cash rounding + * when the minimum unit of the account is smaller than the lowest physical denomination of the + * currency. */ public function getRoundingAdjustment(): ?OrderRoundingAdjustment { @@ -542,8 +543,9 @@ public function getRoundingAdjustment(): ?OrderRoundingAdjustment /** * Sets Rounding Adjustment. * - * A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding - * when the minimum unit of account is smaller than the lowest physical denomination of currency. + * A rounding adjustment of the money being returned. Commonly used to apply cash rounding + * when the minimum unit of the account is smaller than the lowest physical denomination of the + * currency. * * @maps rounding_adjustment */ @@ -555,7 +557,7 @@ public function setRoundingAdjustment(?OrderRoundingAdjustment $roundingAdjustme /** * Returns Tenders. * - * The Tenders which were used to pay for the Order. + * The tenders that were used to pay for the order. * * @return Tender[]|null */ @@ -567,7 +569,7 @@ public function getTenders(): ?array /** * Sets Tenders. * - * The Tenders which were used to pay for the Order. + * The tenders that were used to pay for the order. * * @maps tenders * @@ -581,7 +583,7 @@ public function setTenders(?array $tenders): void /** * Returns Refunds. * - * The Refunds that are part of this Order. + * The refunds that are part of this order. * * @return Refund[]|null */ @@ -593,7 +595,7 @@ public function getRefunds(): ?array /** * Sets Refunds. * - * The Refunds that are part of this Order. + * The refunds that are part of this order. * * @maps refunds * @@ -610,21 +612,21 @@ public function setRefunds(?array $refunds): void * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ public function getMetadata(): ?array { @@ -637,21 +639,21 @@ public function getMetadata(): ?array * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). * * @maps metadata */ @@ -663,7 +665,8 @@ public function setMetadata(?array $metadata): void /** * Returns Created At. * - * Timestamp for when the order was created. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + * The timestamp for when the order was created, in RFC 3339 format (for example, "2016-09-04T23:59:33. + * 123Z"). */ public function getCreatedAt(): ?string { @@ -673,7 +676,8 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * Timestamp for when the order was created. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + * The timestamp for when the order was created, in RFC 3339 format (for example, "2016-09-04T23:59:33. + * 123Z"). * * @maps created_at */ @@ -685,7 +689,8 @@ public function setCreatedAt(?string $createdAt): void /** * Returns Updated At. * - * Timestamp for when the order was last updated. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + * The timestamp for when the order was last updated, in RFC 3339 format (for example, "2016-09-04T23: + * 59:33.123Z"). */ public function getUpdatedAt(): ?string { @@ -695,7 +700,8 @@ public function getUpdatedAt(): ?string /** * Sets Updated At. * - * Timestamp for when the order was last updated. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + * The timestamp for when the order was last updated, in RFC 3339 format (for example, "2016-09-04T23: + * 59:33.123Z"). * * @maps updated_at */ @@ -707,8 +713,8 @@ public function setUpdatedAt(?string $updatedAt): void /** * Returns Closed At. * - * Timestamp for when the order reached a terminal [state]($m/OrderState). In RFC 3339 format, e.g., - * "2016-09-04T23:59:33.123Z". + * The timestamp for when the order reached a terminal [state]($m/OrderState), in RFC 3339 format (for + * example "2016-09-04T23:59:33.123Z"). */ public function getClosedAt(): ?string { @@ -718,8 +724,8 @@ public function getClosedAt(): ?string /** * Sets Closed At. * - * Timestamp for when the order reached a terminal [state]($m/OrderState). In RFC 3339 format, e.g., - * "2016-09-04T23:59:33.123Z". + * The timestamp for when the order reached a terminal [state]($m/OrderState), in RFC 3339 format (for + * example "2016-09-04T23:59:33.123Z"). * * @maps closed_at */ @@ -753,9 +759,9 @@ public function setState(?string $state): void /** * Returns Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders not created through the API do not include a version number and + * therefore cannot be updated. * * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders). @@ -768,9 +774,9 @@ public function getVersion(): ?int /** * Sets Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders not created through the API do not include a version number and + * therefore cannot be updated. * * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders). @@ -956,8 +962,7 @@ public function setTotalServiceChargeMoney(?Money $totalServiceChargeMoney): voi * Returns Pricing Options. * * 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 + * They can be used, for example, to apply automatic price adjustments that are based on preconfigured * [pricing rules]($m/CatalogPricingRule). */ public function getPricingOptions(): ?OrderPricingOptions @@ -969,8 +974,7 @@ public function getPricingOptions(): ?OrderPricingOptions * Sets Pricing Options. * * 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 + * They can be used, for example, to apply automatic price adjustments that are based on preconfigured * [pricing rules]($m/CatalogPricingRule). * * @maps pricing_options @@ -983,7 +987,7 @@ public function setPricingOptions(?OrderPricingOptions $pricingOptions): void /** * Returns Rewards. * - * A set-like list of rewards that have been added to the order. + * A set-like list of Rewards that have been added to the Order. * * @return OrderReward[]|null */ @@ -995,7 +999,7 @@ public function getRewards(): ?array /** * Sets Rewards. * - * A set-like list of rewards that have been added to the order. + * A set-like list of Rewards that have been added to the Order. * * @maps rewards * diff --git a/src/Models/OrderCreated.php b/src/Models/OrderCreated.php index 0e2c4eb5..f1cd79aa 100644 --- a/src/Models/OrderCreated.php +++ b/src/Models/OrderCreated.php @@ -56,11 +56,11 @@ public function setOrderId(?string $orderId): void /** * Returns Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders) */ public function getVersion(): ?int @@ -71,11 +71,11 @@ public function getVersion(): ?int /** * Sets Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders) * * @maps version @@ -88,7 +88,7 @@ public function setVersion(?int $version): void /** * Returns Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. */ public function getLocationId(): ?string { @@ -98,7 +98,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. * * @maps location_id */ @@ -132,7 +132,7 @@ public function setState(?string $state): void /** * Returns Created At. * - * Timestamp for when the order was created in RFC 3339 format. + * The timestamp for when the order was created, in RFC 3339 format. */ public function getCreatedAt(): ?string { @@ -142,7 +142,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * Timestamp for when the order was created in RFC 3339 format. + * The timestamp for when the order was created, in RFC 3339 format. * * @maps created_at */ diff --git a/src/Models/OrderEntry.php b/src/Models/OrderEntry.php index 735944e3..31cb66ae 100644 --- a/src/Models/OrderEntry.php +++ b/src/Models/OrderEntry.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * A lightweight description of an [Order]($m/Order) that is returned when - * `returned_entries` is true on a [SearchOrdersRequest]($e/Orders/SearchOrders) + * 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 { @@ -28,7 +28,7 @@ class OrderEntry implements \JsonSerializable /** * Returns Order Id. * - * The id of the Order + * The ID of the order. */ public function getOrderId(): ?string { @@ -38,7 +38,7 @@ public function getOrderId(): ?string /** * Sets Order Id. * - * The id of the Order + * The ID of the order. * * @maps order_id */ @@ -50,12 +50,12 @@ public function setOrderId(?string $orderId): void /** * Returns Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- - * orders#update-orders). + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- + * orders#update-orders) */ public function getVersion(): ?int { @@ -65,12 +65,12 @@ public function getVersion(): ?int /** * Sets Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- - * orders#update-orders). + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- + * orders#update-orders) * * @maps version */ @@ -82,7 +82,7 @@ public function setVersion(?int $version): void /** * Returns Location Id. * - * The location id the Order belongs to. + * The location ID the order belongs to. */ public function getLocationId(): ?string { @@ -92,7 +92,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The location id the Order belongs to. + * The location ID the order belongs to. * * @maps location_id */ diff --git a/src/Models/OrderFulfillment.php b/src/Models/OrderFulfillment.php index 887d47fd..a5e97bd4 100644 --- a/src/Models/OrderFulfillment.php +++ b/src/Models/OrderFulfillment.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Contains details on how to fulfill this order. + * Contains details about how to fulfill this order. */ class OrderFulfillment implements \JsonSerializable { @@ -42,7 +42,7 @@ class OrderFulfillment implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the fulfillment only within this order. + * A unique ID that identifies the fulfillment only within this order. */ public function getUid(): ?string { @@ -52,7 +52,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the fulfillment only within this order. + * A unique ID that identifies the fulfillment only within this order. * * @maps uid */ @@ -111,21 +111,21 @@ public function setState(?string $state): void * Application-defined data attached to this fulfillment. 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ public function getMetadata(): ?array { @@ -138,21 +138,21 @@ public function getMetadata(): ?array * Application-defined data attached to this fulfillment. 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). * * @maps metadata */ @@ -186,7 +186,7 @@ public function setPickupDetails(?OrderFulfillmentPickupDetails $pickupDetails): /** * Returns Shipment Details. * - * Contains details necessary to fulfill a shipment order. + * Contains the details necessary to fulfill a shipment order. */ public function getShipmentDetails(): ?OrderFulfillmentShipmentDetails { @@ -196,7 +196,7 @@ public function getShipmentDetails(): ?OrderFulfillmentShipmentDetails /** * Sets Shipment Details. * - * Contains details necessary to fulfill a shipment order. + * Contains the details necessary to fulfill a shipment order. * * @maps shipment_details */ diff --git a/src/Models/OrderFulfillmentPickupDetails.php b/src/Models/OrderFulfillmentPickupDetails.php index dcee4fab..33326910 100644 --- a/src/Models/OrderFulfillmentPickupDetails.php +++ b/src/Models/OrderFulfillmentPickupDetails.php @@ -102,7 +102,7 @@ class OrderFulfillmentPickupDetails implements \JsonSerializable /** * Returns Recipient. * - * Contains information on the recipient of a fulfillment. + * Contains information about the recipient of a fulfillment. */ public function getRecipient(): ?OrderFulfillmentRecipient { @@ -112,7 +112,7 @@ public function getRecipient(): ?OrderFulfillmentRecipient /** * Sets Recipient. * - * Contains information on the recipient of a fulfillment. + * Contains information about the recipient of a fulfillment. * * @maps recipient */ @@ -125,9 +125,11 @@ public function setRecipient(?OrderFulfillmentRecipient $recipient): void * Returns Expires At. * * 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 + * indicating when this fulfillment expires if it is not accepted. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set up to 7 days in the + * future. + * If `expires_at` is not set, this pickup fulfillment is automatically accepted when * placed. */ public function getExpiresAt(): ?string @@ -139,9 +141,11 @@ public function getExpiresAt(): ?string * Sets Expires At. * * 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 + * indicating when this fulfillment expires if it is not accepted. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). The expiration time can only be set up to 7 days in the + * future. + * If `expires_at` is not set, this pickup fulfillment is automatically accepted when * placed. * * @maps expires_at @@ -155,10 +159,10 @@ public function setExpiresAt(?string $expiresAt): void * Returns Auto Complete Duration. * * 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". + * is automatically moved to the `COMPLETED` state. The duration must be in RFC 3339 + * format (for example, "P1W3D"). * - * If not set, this pickup fulfillment will remain accepted until it is canceled or completed. + * If not set, this pickup fulfillment remains accepted until it is canceled or completed. */ public function getAutoCompleteDuration(): ?string { @@ -169,10 +173,10 @@ public function getAutoCompleteDuration(): ?string * Sets Auto Complete Duration. * * 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". + * is automatically moved to the `COMPLETED` state. The duration must be in RFC 3339 + * format (for example, "P1W3D"). * - * If not set, this pickup fulfillment will remain accepted until it is canceled or completed. + * If not set, this pickup fulfillment remains accepted until it is canceled or completed. * * @maps auto_complete_duration */ @@ -207,7 +211,7 @@ public function setScheduleType(?string $scheduleType): void * Returns Pickup At. * * 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., + * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., * "2016-09-04T23:59:33.123Z". * * For fulfillments with the schedule type `ASAP`, this is automatically set @@ -222,7 +226,7 @@ public function getPickupAt(): ?string * Sets Pickup At. * * 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., + * that represents the start of the pickup window. Must be in RFC 3339 timestamp format, e.g., * "2016-09-04T23:59:33.123Z". * * For fulfillments with the schedule type `ASAP`, this is automatically set @@ -239,7 +243,7 @@ public function setPickupAt(?string $pickupAt): void * Returns Pickup Window Duration. * * 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 + * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an * informational guideline for merchants. */ public function getPickupWindowDuration(): ?string @@ -251,7 +255,7 @@ public function getPickupWindowDuration(): ?string * Sets Pickup Window Duration. * * 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 + * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an * informational guideline for merchants. * * @maps pickup_window_duration @@ -265,7 +269,7 @@ public function setPickupWindowDuration(?string $pickupWindowDuration): void * Returns Prep Time Duration. * * The duration of time it takes to prepare this fulfillment. - * Must be in RFC3339 duration format, e.g., "P1W3D". + * The duration must be in RFC 3339 format (for example, "P1W3D"). */ public function getPrepTimeDuration(): ?string { @@ -276,7 +280,7 @@ public function getPrepTimeDuration(): ?string * Sets Prep Time Duration. * * The duration of time it takes to prepare this fulfillment. - * Must be in RFC3339 duration format, e.g., "P1W3D". + * The duration must be in RFC 3339 format (for example, "P1W3D"). * * @maps prep_time_duration */ @@ -289,7 +293,7 @@ public function setPrepTimeDuration(?string $prepTimeDuration): void * Returns Note. * * A note meant to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale and set by the API. + * fulfillment displayed in the Square Point of Sale application and set by the API. */ public function getNote(): ?string { @@ -300,7 +304,7 @@ public function getNote(): ?string * Sets Note. * * A note meant to provide additional instructions about the pickup - * fulfillment displayed in the Square Point of Sale and set by the API. + * fulfillment displayed in the Square Point of Sale application and set by the API. * * @maps note */ @@ -313,8 +317,8 @@ public function setNote(?string $note): void * Returns Placed At. * * 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". + * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getPlacedAt(): ?string { @@ -325,8 +329,8 @@ public function getPlacedAt(): ?string * Sets Placed At. * * 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". + * indicating when the fulfillment was placed. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps placed_at */ @@ -339,8 +343,8 @@ public function setPlacedAt(?string $placedAt): void * Returns Accepted At. * * 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". + * indicating when the fulfillment was accepted. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getAcceptedAt(): ?string { @@ -351,8 +355,8 @@ public function getAcceptedAt(): ?string * Sets Accepted At. * * 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". + * indicating when the fulfillment was accepted. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps accepted_at */ @@ -365,8 +369,8 @@ public function setAcceptedAt(?string $acceptedAt): void * Returns Rejected At. * * 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". + * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getRejectedAt(): ?string { @@ -377,8 +381,8 @@ public function getRejectedAt(): ?string * Sets Rejected At. * * 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". + * indicating when the fulfillment was rejected. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps rejected_at */ @@ -391,8 +395,9 @@ public function setRejectedAt(?string $rejectedAt): void * Returns Ready At. * * 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". + * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getReadyAt(): ?string { @@ -403,8 +408,9 @@ public function getReadyAt(): ?string * Sets Ready At. * * 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". + * indicating when the fulfillment is marked as ready for pickup. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps ready_at */ @@ -416,9 +422,9 @@ public function setReadyAt(?string $readyAt): void /** * Returns Expired At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getExpiredAt(): ?string { @@ -428,9 +434,9 @@ public function getExpiredAt(): ?string /** * Sets Expired At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the fulfillment expired. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps expired_at */ @@ -443,8 +449,9 @@ public function setExpiredAt(?string $expiredAt): void * Returns Picked up At. * * 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". + * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getPickedUpAt(): ?string { @@ -455,8 +462,9 @@ public function getPickedUpAt(): ?string * Sets Picked up At. * * 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". + * indicating when the fulfillment was picked up by the recipient. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps picked_up_at */ @@ -469,8 +477,8 @@ public function setPickedUpAt(?string $pickedUpAt): void * Returns Canceled At. * * 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. + * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getCanceledAt(): ?string { @@ -481,8 +489,8 @@ public function getCanceledAt(): ?string * Sets Canceled At. * * 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. + * indicating when the fulfillment was canceled. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps canceled_at */ @@ -494,7 +502,7 @@ public function setCanceledAt(?string $canceledAt): void /** * Returns Cancel Reason. * - * A description of why the pickup was canceled. Max length: 100 characters. + * A description of why the pickup was canceled. The maximum length: 100 characters. */ public function getCancelReason(): ?string { @@ -504,7 +512,7 @@ public function getCancelReason(): ?string /** * Sets Cancel Reason. * - * A description of why the pickup was canceled. Max length: 100 characters. + * A description of why the pickup was canceled. The maximum length: 100 characters. * * @maps cancel_reason */ @@ -516,7 +524,7 @@ public function setCancelReason(?string $cancelReason): void /** * Returns Is Curbside Pickup. * - * If true, indicates this pickup order is for curbside pickup, not in-store pickup. + * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. */ public function getIsCurbsidePickup(): ?bool { @@ -526,7 +534,7 @@ public function getIsCurbsidePickup(): ?bool /** * Sets Is Curbside Pickup. * - * If true, indicates this pickup order is for curbside pickup, not in-store pickup. + * If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. * * @maps is_curbside_pickup */ diff --git a/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php b/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php index d458b5b1..5bd1a78d 100644 --- a/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php +++ b/src/Models/OrderFulfillmentPickupDetailsCurbsidePickupDetails.php @@ -22,7 +22,7 @@ class OrderFulfillmentPickupDetailsCurbsidePickupDetails implements \JsonSeriali /** * Returns Curbside Details. * - * Specific details for curbside pickup, such as parking number, vehicle model, etc. + * Specific details for curbside pickup, such as parking number and vehicle model. */ public function getCurbsideDetails(): ?string { @@ -32,7 +32,7 @@ public function getCurbsideDetails(): ?string /** * Sets Curbside Details. * - * Specific details for curbside pickup, such as parking number, vehicle model, etc. + * Specific details for curbside pickup, such as parking number and vehicle model. * * @maps curbside_details */ @@ -45,8 +45,9 @@ public function setCurbsideDetails(?string $curbsideDetails): void * Returns Buyer Arrived At. * * 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. + * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getBuyerArrivedAt(): ?string { @@ -57,8 +58,9 @@ public function getBuyerArrivedAt(): ?string * Sets Buyer Arrived At. * * 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. + * indicating when the buyer arrived and is waiting for pickup. The timestamp must be in RFC 3339 + * format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps buyer_arrived_at */ diff --git a/src/Models/OrderFulfillmentPickupDetailsScheduleType.php b/src/Models/OrderFulfillmentPickupDetailsScheduleType.php index 0527776a..21430358 100644 --- a/src/Models/OrderFulfillmentPickupDetailsScheduleType.php +++ b/src/Models/OrderFulfillmentPickupDetailsScheduleType.php @@ -10,12 +10,12 @@ class OrderFulfillmentPickupDetailsScheduleType { /** - * Indicates the fulfillment will be picked up at a scheduled pickup time. + * Indicates that the fulfillment will be picked up at a scheduled pickup time. */ public const SCHEDULED = 'SCHEDULED'; /** - * Indicates the fulfillment will be picked up as soon as possible and + * Indicates that the fulfillment will be picked up as soon as possible and * should be prepared immediately. */ public const ASAP = 'ASAP'; diff --git a/src/Models/OrderFulfillmentRecipient.php b/src/Models/OrderFulfillmentRecipient.php index 638e412c..af6d8742 100644 --- a/src/Models/OrderFulfillmentRecipient.php +++ b/src/Models/OrderFulfillmentRecipient.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Contains information on the recipient of a fulfillment. + * Contains information about the recipient of a fulfillment. */ class OrderFulfillmentRecipient implements \JsonSerializable { @@ -37,14 +37,14 @@ class OrderFulfillmentRecipient implements \JsonSerializable /** * Returns Customer Id. * - * The Customer ID of the customer associated with the fulfillment. + * The customer ID of the customer associated with the fulfillment. * * If `customer_id` is provided, the fulfillment recipient's `display_name`, * `email_address`, and `phone_number` are automatically populated from the * targeted customer profile. If these fields are set in the request, the request - * values will override the information from the customer profile. If the + * values overrides the information from the customer profile. If the * targeted customer profile does not contain the necessary information and - * these fields are left unset, the request will result in an error. + * these fields are left unset, the request results in an error. */ public function getCustomerId(): ?string { @@ -54,14 +54,14 @@ public function getCustomerId(): ?string /** * Sets Customer Id. * - * The Customer ID of the customer associated with the fulfillment. + * The customer ID of the customer associated with the fulfillment. * * If `customer_id` is provided, the fulfillment recipient's `display_name`, * `email_address`, and `phone_number` are automatically populated from the * targeted customer profile. If these fields are set in the request, the request - * values will override the information from the customer profile. If the + * values overrides the information from the customer profile. If the * targeted customer profile does not contain the necessary information and - * these fields are left unset, the request will result in an error. + * these fields are left unset, the request results in an error. * * @maps customer_id */ @@ -75,7 +75,8 @@ public function setCustomerId(?string $customerId): void * * The display name of the fulfillment recipient. * - * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. + * If provided, the display name overrides the value pulled from the customer profile indicated by + * `customer_id`. */ public function getDisplayName(): ?string { @@ -87,7 +88,8 @@ public function getDisplayName(): ?string * * The display name of the fulfillment recipient. * - * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. + * If provided, the display name overrides the value pulled from the customer profile indicated by + * `customer_id`. * * @maps display_name */ @@ -101,7 +103,8 @@ public function setDisplayName(?string $displayName): void * * The email address of the fulfillment recipient. * - * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. + * If provided, the email address overrides the value pulled from the customer profile indicated by + * `customer_id`. */ public function getEmailAddress(): ?string { @@ -113,7 +116,8 @@ public function getEmailAddress(): ?string * * The email address of the fulfillment recipient. * - * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. + * If provided, the email address overrides the value pulled from the customer profile indicated by + * `customer_id`. * * @maps email_address */ @@ -127,7 +131,8 @@ public function setEmailAddress(?string $emailAddress): void * * The phone number of the fulfillment recipient. * - * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. + * If provided, the phone number overrides the value pulled from the customer profile indicated by + * `customer_id`. */ public function getPhoneNumber(): ?string { @@ -139,7 +144,8 @@ public function getPhoneNumber(): ?string * * The phone number of the fulfillment recipient. * - * If provided, overrides the value pulled from the customer profile indicated by `customer_id`. + * If provided, the phone number overrides the value pulled from the customer profile indicated by + * `customer_id`. * * @maps phone_number */ diff --git a/src/Models/OrderFulfillmentShipmentDetails.php b/src/Models/OrderFulfillmentShipmentDetails.php index c1f4791e..3a751ee6 100644 --- a/src/Models/OrderFulfillmentShipmentDetails.php +++ b/src/Models/OrderFulfillmentShipmentDetails.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Contains details necessary to fulfill a shipment order. + * Contains the details necessary to fulfill a shipment order. */ class OrderFulfillmentShipmentDetails implements \JsonSerializable { @@ -87,7 +87,7 @@ class OrderFulfillmentShipmentDetails implements \JsonSerializable /** * Returns Recipient. * - * Contains information on the recipient of a fulfillment. + * Contains information about the recipient of a fulfillment. */ public function getRecipient(): ?OrderFulfillmentRecipient { @@ -97,7 +97,7 @@ public function getRecipient(): ?OrderFulfillmentRecipient /** * Sets Recipient. * - * Contains information on the recipient of a fulfillment. + * Contains information about the recipient of a fulfillment. * * @maps recipient */ @@ -109,8 +109,7 @@ public function setRecipient(?OrderFulfillmentRecipient $recipient): void /** * Returns Carrier. * - * The shipping carrier being used to ship this fulfillment - * e.g. UPS, FedEx, USPS, etc. + * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). */ public function getCarrier(): ?string { @@ -120,8 +119,7 @@ public function getCarrier(): ?string /** * Sets Carrier. * - * The shipping carrier being used to ship this fulfillment - * e.g. UPS, FedEx, USPS, etc. + * The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS). * * @maps carrier */ @@ -155,8 +153,8 @@ public function setShippingNote(?string $shippingNote): void /** * Returns Shipping Type. * - * A description of the type of shipping product purchased from the carrier. - * e.g. First Class, Priority, Express + * A description of the type of shipping product purchased from the carrier + * (such as First Class, Priority, or Express). */ public function getShippingType(): ?string { @@ -166,8 +164,8 @@ public function getShippingType(): ?string /** * Sets Shipping Type. * - * A description of the type of shipping product purchased from the carrier. - * e.g. First Class, Priority, Express + * A description of the type of shipping product purchased from the carrier + * (such as First Class, Priority, or Express). * * @maps shipping_type */ @@ -224,8 +222,8 @@ public function setTrackingUrl(?string $trackingUrl): void * Returns Placed At. * * 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". + * indicating when the shipment was requested. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getPlacedAt(): ?string { @@ -236,8 +234,8 @@ public function getPlacedAt(): ?string * Sets Placed At. * * 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". + * indicating when the shipment was requested. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps placed_at */ @@ -250,9 +248,10 @@ public function setPlacedAt(?string $placedAt): void * Returns In Progress At. * * 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". + * indicating when this fulfillment was moved to the `RESERVED` state, which indicates that + * preparation + * of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59: + * 33.123Z"). */ public function getInProgressAt(): ?string { @@ -263,9 +262,10 @@ public function getInProgressAt(): ?string * Sets In Progress At. * * 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". + * indicating when this fulfillment was moved to the `RESERVED` state, which indicates that + * preparation + * of this shipment has begun. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59: + * 33.123Z"). * * @maps in_progress_at */ @@ -277,10 +277,10 @@ public function setInProgressAt(?string $inProgressAt): void /** * Returns Packaged At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the + * fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33. + * 123Z"). */ public function getPackagedAt(): ?string { @@ -290,10 +290,10 @@ public function getPackagedAt(): ?string /** * Sets Packaged At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when this fulfillment was moved to the `PREPARED` state, which indicates that the + * fulfillment is packaged. The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33. + * 123Z"). * * @maps packaged_at */ @@ -306,8 +306,8 @@ public function setPackagedAt(?string $packagedAt): void * Returns Expected Shipped At. * * 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". + * indicating when the shipment is expected to be delivered to the shipping carrier. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). */ public function getExpectedShippedAt(): ?string { @@ -318,8 +318,8 @@ public function getExpectedShippedAt(): ?string * Sets Expected Shipped At. * * 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". + * indicating when the shipment is expected to be delivered to the shipping carrier. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). * * @maps expected_shipped_at */ @@ -332,9 +332,9 @@ public function setExpectedShippedAt(?string $expectedShippedAt): void * Returns Shipped At. * * 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". + * indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that + * the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getShippedAt(): ?string { @@ -345,9 +345,9 @@ public function getShippedAt(): ?string * Sets Shipped At. * * 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". + * indicating when this fulfillment was moved to the `COMPLETED` state, which indicates that + * the fulfillment has been given to the shipping carrier. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps shipped_at */ @@ -359,9 +359,9 @@ public function setShippedAt(?string $shippedAt): void /** * Returns Canceled At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating the shipment was canceled. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). */ public function getCanceledAt(): ?string { @@ -371,9 +371,9 @@ public function getCanceledAt(): ?string /** * Sets Canceled At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating the shipment was canceled. + * The timestamp must be in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). * * @maps canceled_at */ @@ -407,10 +407,9 @@ public function setCancelReason(?string $cancelReason): void /** * Returns Failed At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). */ public function getFailedAt(): ?string { @@ -420,10 +419,9 @@ public function getFailedAt(): ?string /** * Sets Failed At. * - * 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". + * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) + * indicating when the shipment failed to be completed. The timestamp must be in RFC 3339 format + * (for example, "2016-09-04T23:59:33.123Z"). * * @maps failed_at */ diff --git a/src/Models/OrderFulfillmentState.php b/src/Models/OrderFulfillmentState.php index bc8f7ab3..2fd40b4c 100644 --- a/src/Models/OrderFulfillmentState.php +++ b/src/Models/OrderFulfillmentState.php @@ -10,32 +10,32 @@ class OrderFulfillmentState { /** - * Indicates the fulfillment has been proposed. + * Indicates that the fulfillment has been proposed. */ public const PROPOSED = 'PROPOSED'; /** - * Indicates the fulfillment has been reserved. + * Indicates that the fulfillment has been reserved. */ public const RESERVED = 'RESERVED'; /** - * Indicates the fulfillment has been prepared. + * Indicates that the fulfillment has been prepared. */ public const PREPARED = 'PREPARED'; /** - * Indicates the fulfillment was successfully completed. + * Indicates that the fulfillment was successfully completed. */ public const COMPLETED = 'COMPLETED'; /** - * Indicates the fulfillment was canceled. + * Indicates that the fulfillment was canceled. */ public const CANCELED = 'CANCELED'; /** - * Indicates the fulfillment failed to be completed but was not explicitly + * Indicates that the fulfillment failed to be completed, but was not explicitly * canceled. */ public const FAILED = 'FAILED'; diff --git a/src/Models/OrderFulfillmentUpdated.php b/src/Models/OrderFulfillmentUpdated.php index a02241c8..bbc1df00 100644 --- a/src/Models/OrderFulfillmentUpdated.php +++ b/src/Models/OrderFulfillmentUpdated.php @@ -66,11 +66,11 @@ public function setOrderId(?string $orderId): void /** * Returns Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders) */ public function getVersion(): ?int @@ -81,11 +81,11 @@ public function getVersion(): ?int /** * Sets Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders) * * @maps version @@ -98,7 +98,7 @@ public function setVersion(?int $version): void /** * Returns Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. */ public function getLocationId(): ?string { @@ -108,7 +108,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. * * @maps location_id */ @@ -142,7 +142,7 @@ public function setState(?string $state): void /** * Returns Created At. * - * Timestamp for when the order was created in RFC 3339 format. + * The timestamp for when the order was created, in RFC 3339 format. */ public function getCreatedAt(): ?string { @@ -152,7 +152,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * Timestamp for when the order was created in RFC 3339 format. + * The timestamp for when the order was created, in RFC 3339 format. * * @maps created_at */ @@ -164,7 +164,7 @@ public function setCreatedAt(?string $createdAt): void /** * Returns Updated At. * - * Timestamp for when the order was last updated in RFC 3339 format. + * The timestamp for when the order was last updated, in RFC 3339 format. */ public function getUpdatedAt(): ?string { @@ -174,7 +174,7 @@ public function getUpdatedAt(): ?string /** * Sets Updated At. * - * Timestamp for when the order was last updated in RFC 3339 format. + * The timestamp for when the order was last updated, in RFC 3339 format. * * @maps updated_at */ diff --git a/src/Models/OrderFulfillmentUpdatedUpdate.php b/src/Models/OrderFulfillmentUpdatedUpdate.php index 0781a895..acae1ac0 100644 --- a/src/Models/OrderFulfillmentUpdatedUpdate.php +++ b/src/Models/OrderFulfillmentUpdatedUpdate.php @@ -27,7 +27,7 @@ class OrderFulfillmentUpdatedUpdate implements \JsonSerializable /** * Returns Fulfillment Uid. * - * Unique ID that identifies the fulfillment only within this order. + * A unique ID that identifies the fulfillment only within this order. */ public function getFulfillmentUid(): ?string { @@ -37,7 +37,7 @@ public function getFulfillmentUid(): ?string /** * Sets Fulfillment Uid. * - * Unique ID that identifies the fulfillment only within this order. + * A unique ID that identifies the fulfillment only within this order. * * @maps fulfillment_uid */ diff --git a/src/Models/OrderLineItem.php b/src/Models/OrderLineItem.php index 1459a41f..d8622453 100644 --- a/src/Models/OrderLineItem.php +++ b/src/Models/OrderLineItem.php @@ -111,7 +111,7 @@ public function __construct(string $quantity) /** * Returns Uid. * - * Unique ID that identifies the line item only within this order. + * A unique ID that identifies the line item only within this order. */ public function getUid(): ?string { @@ -121,7 +121,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the line item only within this order. + * A unique ID that identifies the line item only within this order. * * @maps uid */ @@ -156,13 +156,13 @@ public function setName(?string $name): void * Returns Quantity. * * The quantity purchased, formatted as a decimal number. - * For example: `"3"`. + * 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 of `"0"` are automatically removed + * when paying for or otherwise completing the order. * * Line items with a `quantity_unit` can have non-integer quantities. - * For example: `"1.70000"`. + * For example, `"1.70000"`. */ public function getQuantity(): string { @@ -173,13 +173,13 @@ public function getQuantity(): string * Sets Quantity. * * The quantity purchased, formatted as a decimal number. - * For example: `"3"`. + * 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 of `"0"` are automatically removed + * when paying for or otherwise completing the order. * * Line items with a `quantity_unit` can have non-integer quantities. - * For example: `"1.70000"`. + * For example, `"1.70000"`. * * @required * @maps quantity @@ -192,7 +192,7 @@ public function setQuantity(string $quantity): void /** * Returns Quantity Unit. * - * Contains the measurement unit for a quantity and a precision which + * Contains the measurement unit for a quantity and a precision that * specifies the number of digits after the decimal point for decimal quantities. */ public function getQuantityUnit(): ?OrderQuantityUnit @@ -203,7 +203,7 @@ public function getQuantityUnit(): ?OrderQuantityUnit /** * Sets Quantity Unit. * - * Contains the measurement unit for a quantity and a precision which + * Contains the measurement unit for a quantity and a precision that * specifies the number of digits after the decimal point for decimal quantities. * * @maps quantity_unit @@ -238,7 +238,7 @@ public function setNote(?string $note): void /** * Returns Catalog Object Id. * - * The [CatalogItemVariation]($m/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]($m/CatalogItemVariation) id applied to this line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) ID applied to this line item. * * @maps catalog_object_id */ @@ -285,22 +285,21 @@ public function setVariationName(?string $variationName): void * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ public function getMetadata(): ?array { @@ -313,22 +312,21 @@ public function getMetadata(): ?array * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). * * @maps metadata */ @@ -371,7 +369,7 @@ public function setModifiers(?array $modifiers): void * top-level `OrderLineItemTax` applied to the line item. On reads, the * amount applied is populated. * - * An `OrderLineItemAppliedTax` will be automatically created on every line + * An `OrderLineItemAppliedTax` is 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. @@ -393,7 +391,7 @@ public function getAppliedTaxes(): ?array * top-level `OrderLineItemTax` applied to the line item. On reads, the * amount applied is populated. * - * An `OrderLineItemAppliedTax` will be automatically created on every line + * An `OrderLineItemAppliedTax` is 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. @@ -417,7 +415,7 @@ public function setAppliedTaxes(?array $appliedTaxes): void * `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 + * An `OrderLineItemAppliedDiscount` is 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. @@ -439,7 +437,7 @@ public function getAppliedDiscounts(): ?array * `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 + * An `OrderLineItemAppliedDiscount` is 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. diff --git a/src/Models/OrderLineItemAppliedDiscount.php b/src/Models/OrderLineItemAppliedDiscount.php index b18efdd2..9c1eac15 100644 --- a/src/Models/OrderLineItemAppliedDiscount.php +++ b/src/Models/OrderLineItemAppliedDiscount.php @@ -7,9 +7,9 @@ /** * Represents an applied portion of a discount to a line item in an order. * - * Order scoped discounts will automatically have applied discounts present for each line item. - * Line item scoped discounts must have applied discounts added manually for any applicable line - * items. The corresponding applied money will automatically be computed based on participating + * Order scoped discounts have automatically applied discounts present for each line item. + * Line-item scoped discounts must have applied discounts added manually for any applicable line + * items. The corresponding applied money is automatically computed based on participating * line items. */ class OrderLineItemAppliedDiscount implements \JsonSerializable @@ -40,7 +40,7 @@ public function __construct(string $discountUid) /** * Returns Uid. * - * Unique ID that identifies the applied discount only within this order. + * A unique ID that identifies the applied discount only within this order. */ public function getUid(): ?string { @@ -50,7 +50,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the applied discount only within this order. + * A unique ID that identifies the applied discount only within this order. * * @maps uid */ @@ -62,7 +62,7 @@ public function setUid(?string $uid): void /** * Returns Discount Uid. * - * The `uid` of the discount the applied discount represents. Must + * The `uid` of the discount that the applied discount represents. It must * reference a discount present in the `order.discounts` field. * * This field is immutable. To change which discounts apply to a line item, @@ -76,7 +76,7 @@ public function getDiscountUid(): string /** * Sets Discount Uid. * - * The `uid` of the discount the applied discount represents. Must + * The `uid` of the discount that the applied discount represents. It must * reference a discount present in the `order.discounts` field. * * This field is immutable. To change which discounts apply to a line item, diff --git a/src/Models/OrderLineItemAppliedTax.php b/src/Models/OrderLineItemAppliedTax.php index 29f7df74..79387aff 100644 --- a/src/Models/OrderLineItemAppliedTax.php +++ b/src/Models/OrderLineItemAppliedTax.php @@ -40,7 +40,7 @@ public function __construct(string $taxUid) /** * Returns Uid. * - * Unique ID that identifies the applied tax only within this order. + * A unique ID that identifies the applied tax only within this order. */ public function getUid(): ?string { @@ -50,7 +50,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the applied tax only within this order. + * A unique ID that identifies the applied tax only within this order. * * @maps uid */ @@ -62,11 +62,11 @@ public function setUid(?string $uid): void /** * Returns Tax Uid. * - * The `uid` of the tax for which this applied tax represents. Must reference + * The `uid` of the tax for which this applied tax represents. It must reference * a tax present in the `order.taxes` field. * - * This field is immutable. To change which taxes apply to a line item, delete and add new - * `OrderLineItemAppliedTax`s. + * This field is immutable. To change which taxes apply to a line item, delete and add a new + * `OrderLineItemAppliedTax`. */ public function getTaxUid(): string { @@ -76,11 +76,11 @@ public function getTaxUid(): string /** * Sets Tax Uid. * - * The `uid` of the tax for which this applied tax represents. Must reference + * The `uid` of the tax for which this applied tax represents. It must reference * a tax present in the `order.taxes` field. * - * This field is immutable. To change which taxes apply to a line item, delete and add new - * `OrderLineItemAppliedTax`s. + * This field is immutable. To change which taxes apply to a line item, delete and add a new + * `OrderLineItemAppliedTax`. * * @required * @maps tax_uid diff --git a/src/Models/OrderLineItemDiscount.php b/src/Models/OrderLineItemDiscount.php index 11426faa..7ef6601b 100644 --- a/src/Models/OrderLineItemDiscount.php +++ b/src/Models/OrderLineItemDiscount.php @@ -72,7 +72,7 @@ class OrderLineItemDiscount implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the discount only within this order. + * A unique ID that identifies the discount only within this order. */ public function getUid(): ?string { @@ -82,7 +82,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the discount only within this order. + * A unique ID that identifies the discount only within this order. * * @maps uid */ @@ -94,7 +94,7 @@ public function setUid(?string $uid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogDiscount]($m/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]($m/CatalogDiscount). + * The catalog object ID referencing [CatalogDiscount]($m/CatalogDiscount). * * @maps catalog_object_id */ @@ -259,22 +259,21 @@ public function setAppliedMoney(?Money $appliedMoney): void * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ public function getMetadata(): ?array { @@ -287,22 +286,21 @@ public function getMetadata(): ?array * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). * * @maps metadata */ @@ -314,7 +312,7 @@ public function setMetadata(?array $metadata): void /** * Returns Scope. * - * Indicates whether this is a line item or order level discount. + * Indicates whether this is a line-item or order-level discount. */ public function getScope(): ?string { @@ -324,7 +322,7 @@ public function getScope(): ?string /** * Sets Scope. * - * Indicates whether this is a line item or order level discount. + * Indicates whether this is a line-item or order-level discount. * * @maps scope */ @@ -336,7 +334,7 @@ public function setScope(?string $scope): void /** * Returns Reward Ids. * - * The reward identifiers corresponding to this discount. The application and + * The reward IDs 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, @@ -352,7 +350,7 @@ public function getRewardIds(): ?array /** * Sets Reward Ids. * - * The reward identifiers corresponding to this discount. The application and + * The reward IDs 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, @@ -370,7 +368,7 @@ public function setRewardIds(?array $rewardIds): void /** * Returns Pricing Rule Id. * - * The object identifier of a [pricing rule]($m/CatalogPricingRule) to be applied + * The object ID 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. @@ -383,7 +381,7 @@ public function getPricingRuleId(): ?string /** * Sets Pricing Rule Id. * - * The object identifier of a [pricing rule]($m/CatalogPricingRule) to be applied + * The object ID 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. diff --git a/src/Models/OrderLineItemDiscountScope.php b/src/Models/OrderLineItemDiscountScope.php index d6aa25ac..e5b0da14 100644 --- a/src/Models/OrderLineItemDiscountScope.php +++ b/src/Models/OrderLineItemDiscountScope.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Indicates whether this is a line item or order level discount. + * Indicates whether this is a line-item or order-level discount. */ class OrderLineItemDiscountScope { diff --git a/src/Models/OrderLineItemDiscountType.php b/src/Models/OrderLineItemDiscountType.php index 1db2442c..5bc08ebf 100644 --- a/src/Models/OrderLineItemDiscountType.php +++ b/src/Models/OrderLineItemDiscountType.php @@ -16,12 +16,12 @@ class OrderLineItemDiscountType public const UNKNOWN_DISCOUNT = 'UNKNOWN_DISCOUNT'; /** - * Apply the discount as a fixed percentage (e.g., 5%) off the item price. + * Apply the discount as a fixed percentage (such as 5%) off the item price. */ public const FIXED_PERCENTAGE = 'FIXED_PERCENTAGE'; /** - * Apply the discount as a fixed monetary value (e.g., $1.00) off the item price. + * Apply the discount as a fixed monetary value (such as $1.00) off the item price. */ public const FIXED_AMOUNT = 'FIXED_AMOUNT'; diff --git a/src/Models/OrderLineItemModifier.php b/src/Models/OrderLineItemModifier.php index 550a0f68..9961420b 100644 --- a/src/Models/OrderLineItemModifier.php +++ b/src/Models/OrderLineItemModifier.php @@ -37,7 +37,7 @@ class OrderLineItemModifier implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the modifier only within this order. + * A unique ID that identifies the modifier only within this order. */ public function getUid(): ?string { @@ -47,7 +47,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the modifier only within this order. + * A unique ID that identifies the modifier only within this order. * * @maps uid */ @@ -59,7 +59,7 @@ public function setUid(?string $uid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogModifier]($m/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]($m/CatalogModifier). + * The catalog object ID referencing [CatalogModifier]($m/CatalogModifier). * * @maps catalog_object_id */ diff --git a/src/Models/OrderLineItemPricingBlocklists.php b/src/Models/OrderLineItemPricingBlocklists.php index 13e01b09..6f464fd3 100644 --- a/src/Models/OrderLineItemPricingBlocklists.php +++ b/src/Models/OrderLineItemPricingBlocklists.php @@ -26,7 +26,7 @@ class OrderLineItemPricingBlocklists implements \JsonSerializable * Returns Blocked Discounts. * * A list of discounts blocked from applying to the line item. - * Discounts can be blocked by the `discount_uid` (for ad-hoc discounts) or + * Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or * the `discount_catalog_object_id` (for catalog discounts). * * @return OrderLineItemPricingBlocklistsBlockedDiscount[]|null @@ -40,7 +40,7 @@ public function getBlockedDiscounts(): ?array * Sets Blocked Discounts. * * A list of discounts blocked from applying to the line item. - * Discounts can be blocked by the `discount_uid` (for ad-hoc discounts) or + * Discounts can be blocked by the `discount_uid` (for ad hoc discounts) or * the `discount_catalog_object_id` (for catalog discounts). * * @maps blocked_discounts @@ -56,7 +56,7 @@ public function setBlockedDiscounts(?array $blockedDiscounts): void * Returns Blocked Taxes. * * A list of taxes blocked from applying to the line item. - * Taxes can be blocked by the `tax_uid` (for ad-hoc taxes) or + * Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or * the `tax_catalog_object_id` (for catalog taxes). * * @return OrderLineItemPricingBlocklistsBlockedTax[]|null @@ -70,7 +70,7 @@ public function getBlockedTaxes(): ?array * Sets Blocked Taxes. * * A list of taxes blocked from applying to the line item. - * Taxes can be blocked by the `tax_uid` (for ad-hoc taxes) or + * Taxes can be blocked by the `tax_uid` (for ad hoc taxes) or * the `tax_catalog_object_id` (for catalog taxes). * * @maps blocked_taxes diff --git a/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php b/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php index 9ceab4f4..ec6cf4b8 100644 --- a/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php +++ b/src/Models/OrderLineItemPricingBlocklistsBlockedDiscount.php @@ -28,7 +28,7 @@ class OrderLineItemPricingBlocklistsBlockedDiscount implements \JsonSerializable /** * Returns Uid. * - * Unique ID of the `BlockedDiscount` within the order. + * A unique ID of the `BlockedDiscount` within the order. */ public function getUid(): ?string { @@ -38,7 +38,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID of the `BlockedDiscount` within the order. + * A unique ID of the `BlockedDiscount` within the order. * * @maps uid */ @@ -51,7 +51,7 @@ public function setUid(?string $uid): void * Returns Discount Uid. * * The `uid` of the discount that should be blocked. Use this field to block - * ad-hoc discounts. For catalog discounts use the `discount_catalog_object_id` field. + * ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field. */ public function getDiscountUid(): ?string { @@ -62,7 +62,7 @@ public function getDiscountUid(): ?string * Sets Discount Uid. * * The `uid` of the discount that should be blocked. Use this field to block - * ad-hoc discounts. For catalog discounts use the `discount_catalog_object_id` field. + * ad hoc discounts. For catalog discounts, use the `discount_catalog_object_id` field. * * @maps discount_uid */ @@ -75,7 +75,7 @@ public function setDiscountUid(?string $discountUid): void * Returns Discount Catalog Object Id. * * The `catalog_object_id` of the discount that should be blocked. - * Use this field to block catalog discounts. For ad-hoc discounts use the + * Use this field to block catalog discounts. For ad hoc discounts, use the * `discount_uid` field. */ public function getDiscountCatalogObjectId(): ?string @@ -87,7 +87,7 @@ public function getDiscountCatalogObjectId(): ?string * Sets Discount Catalog Object Id. * * The `catalog_object_id` of the discount that should be blocked. - * Use this field to block catalog discounts. For ad-hoc discounts use the + * Use this field to block catalog discounts. For ad hoc discounts, use the * `discount_uid` field. * * @maps discount_catalog_object_id diff --git a/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php b/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php index 7f0b2427..56a9355a 100644 --- a/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php +++ b/src/Models/OrderLineItemPricingBlocklistsBlockedTax.php @@ -28,7 +28,7 @@ class OrderLineItemPricingBlocklistsBlockedTax implements \JsonSerializable /** * Returns Uid. * - * Unique ID of the `BlockedTax` within the order. + * A unique ID of the `BlockedTax` within the order. */ public function getUid(): ?string { @@ -38,7 +38,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID of the `BlockedTax` within the order. + * A unique ID of the `BlockedTax` within the order. * * @maps uid */ @@ -51,7 +51,7 @@ public function setUid(?string $uid): void * Returns Tax Uid. * * The `uid` of the tax that should be blocked. Use this field to block - * ad-hoc taxes. For catalog taxes use the `tax_catalog_object_id` field. + * ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field. */ public function getTaxUid(): ?string { @@ -62,7 +62,7 @@ public function getTaxUid(): ?string * Sets Tax Uid. * * The `uid` of the tax that should be blocked. Use this field to block - * ad-hoc taxes. For catalog taxes use the `tax_catalog_object_id` field. + * ad hoc taxes. For catalog, taxes use the `tax_catalog_object_id` field. * * @maps tax_uid */ @@ -75,7 +75,7 @@ public function setTaxUid(?string $taxUid): void * Returns Tax Catalog Object Id. * * The `catalog_object_id` of the tax that should be blocked. - * Use this field to block catalog taxes. For ad-hoc taxes use the + * Use this field to block catalog taxes. For ad hoc taxes, use the * `tax_uid` field. */ public function getTaxCatalogObjectId(): ?string @@ -87,7 +87,7 @@ public function getTaxCatalogObjectId(): ?string * Sets Tax Catalog Object Id. * * The `catalog_object_id` of the tax that should be blocked. - * Use this field to block catalog taxes. For ad-hoc taxes use the + * Use this field to block catalog taxes. For ad hoc taxes, use the * `tax_uid` field. * * @maps tax_catalog_object_id diff --git a/src/Models/OrderLineItemTax.php b/src/Models/OrderLineItemTax.php index 67ba2f62..c570516b 100644 --- a/src/Models/OrderLineItemTax.php +++ b/src/Models/OrderLineItemTax.php @@ -61,7 +61,7 @@ class OrderLineItemTax implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the tax only within this order. + * A unique ID that identifies the tax only within this order. */ public function getUid(): ?string { @@ -71,7 +71,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the tax only within this order. + * A unique ID that identifies the tax only within this order. * * @maps uid */ @@ -83,7 +83,7 @@ public function setUid(?string $uid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogTax]($m/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]($m/CatalogTax). + * The catalog object ID referencing [CatalogTax]($m/CatalogTax). * * @maps catalog_object_id */ @@ -178,22 +178,21 @@ public function setPercentage(?string $percentage): void * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ public function getMetadata(): ?array { @@ -206,22 +205,21 @@ public function getMetadata(): ?array * 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). * * @maps metadata */ @@ -267,7 +265,7 @@ public function setAppliedMoney(?Money $appliedMoney): void /** * Returns Scope. * - * Indicates whether this is a line item or order level tax. + * Indicates whether this is a line-item or order-level tax. */ public function getScope(): ?string { @@ -277,7 +275,7 @@ public function getScope(): ?string /** * Sets Scope. * - * Indicates whether this is a line item or order level tax. + * Indicates whether this is a line-item or order-level tax. * * @maps scope */ diff --git a/src/Models/OrderLineItemTaxScope.php b/src/Models/OrderLineItemTaxScope.php index b255e8fc..ac052ed0 100644 --- a/src/Models/OrderLineItemTaxScope.php +++ b/src/Models/OrderLineItemTaxScope.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Indicates whether this is a line item or order level tax. + * Indicates whether this is a line-item or order-level tax. */ class OrderLineItemTaxScope { diff --git a/src/Models/OrderLineItemTaxType.php b/src/Models/OrderLineItemTaxType.php index 4f002af1..5763cdb8 100644 --- a/src/Models/OrderLineItemTaxType.php +++ b/src/Models/OrderLineItemTaxType.php @@ -17,15 +17,15 @@ class OrderLineItemTaxType /** * The tax is an additive tax. The tax amount is added on top of the price. - * For example, an item with a cost of 1.00 USD and a 10% additive tax would have a total + * For example, an item with a cost of 1.00 USD and a 10% additive tax has a total * cost to the buyer of 1.10 USD. */ public const ADDITIVE = 'ADDITIVE'; /** * The tax is an inclusive tax. Inclusive taxes are already included - * in the line item price or order total. For example, an item with cost - * 1.00 USD with a 10% inclusive tax would have a pre-tax cost of 0.91 USD + * in the line item price or order total. For example, an item with a cost of + * 1.00 USD and a 10% inclusive tax has a pretax cost of 0.91 USD * (91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to * the buyer. */ diff --git a/src/Models/OrderPricingOptions.php b/src/Models/OrderPricingOptions.php index 393b1393..af6b649f 100644 --- a/src/Models/OrderPricingOptions.php +++ b/src/Models/OrderPricingOptions.php @@ -6,8 +6,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 + * They can be used, for example, to apply automatic price adjustments that are based on preconfigured * [pricing rules]($m/CatalogPricingRule). */ class OrderPricingOptions implements \JsonSerializable diff --git a/src/Models/OrderQuantityUnit.php b/src/Models/OrderQuantityUnit.php index 0ebf3888..de4a795d 100644 --- a/src/Models/OrderQuantityUnit.php +++ b/src/Models/OrderQuantityUnit.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Contains the measurement unit for a quantity and a precision which + * Contains the measurement unit for a quantity and a precision that * specifies the number of digits after the decimal point for decimal quantities. */ class OrderQuantityUnit implements \JsonSerializable @@ -52,7 +52,7 @@ public function setMeasurementUnit(?MeasurementUnit $measurementUnit): void * For non-integer quantities, represents the number of digits after the decimal point that are * recorded for this quantity. * - * For example, a precision of 1 allows quantities like `"1.0"` and `"1.1"`, but not `"1.01"`. + * For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`. * * Min: 0. Max: 5. */ @@ -67,7 +67,7 @@ public function getPrecision(): ?int * For non-integer quantities, represents the number of digits after the decimal point that are * recorded for this quantity. * - * For example, a precision of 1 allows quantities like `"1.0"` and `"1.1"`, but not `"1.01"`. + * For example, a precision of 1 allows quantities such as `"1.0"` and `"1.1"`, but not `"1.01"`. * * Min: 0. Max: 5. * diff --git a/src/Models/OrderReturn.php b/src/Models/OrderReturn.php index cce64db0..fee2c4f1 100644 --- a/src/Models/OrderReturn.php +++ b/src/Models/OrderReturn.php @@ -5,7 +5,8 @@ namespace Square\Models; /** - * The set of line items, service charges, taxes, discounts, tips, etc. being returned in an Order. + * The set of line items, service charges, taxes, discounts, tips, and other items being returned in + * an order. */ class OrderReturn implements \JsonSerializable { @@ -52,7 +53,7 @@ class OrderReturn implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the return only within this order. + * A unique ID that identifies the return only within this order. */ public function getUid(): ?string { @@ -62,7 +63,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the return only within this order. + * A unique ID that identifies the return only within this order. * * @maps uid */ @@ -74,7 +75,7 @@ public function setUid(?string $uid): void /** * Returns Source Order Id. * - * Order which contains the original sale of these returned line items. This will be unset + * An order that contains the original sale of these return line items. This is unset * for unlinked returns. */ public function getSourceOrderId(): ?string @@ -85,7 +86,7 @@ public function getSourceOrderId(): ?string /** * Sets Source Order Id. * - * Order which contains the original sale of these returned line items. This will be unset + * An order that contains the original sale of these return line items. This is unset * for unlinked returns. * * @maps source_order_id @@ -98,7 +99,7 @@ public function setSourceOrderId(?string $sourceOrderId): void /** * Returns Return Line Items. * - * Collection of line items which are being returned. + * A collection of line items that are being returned. * * @return OrderReturnLineItem[]|null */ @@ -110,7 +111,7 @@ public function getReturnLineItems(): ?array /** * Sets Return Line Items. * - * Collection of line items which are being returned. + * A collection of line items that are being returned. * * @maps return_line_items * @@ -124,7 +125,7 @@ public function setReturnLineItems(?array $returnLineItems): void /** * Returns Return Service Charges. * - * Collection of service charges which are being returned. + * A collection of service charges that are being returned. * * @return OrderReturnServiceCharge[]|null */ @@ -136,7 +137,7 @@ public function getReturnServiceCharges(): ?array /** * Sets Return Service Charges. * - * Collection of service charges which are being returned. + * A collection of service charges that are being returned. * * @maps return_service_charges * @@ -150,7 +151,7 @@ public function setReturnServiceCharges(?array $returnServiceCharges): void /** * Returns Return Taxes. * - * Collection of references to taxes being returned for an order, including the total + * A collection of references to taxes being returned for an order, including the total * applied tax amount to be returned. The taxes must reference a top-level tax ID from the source * order. * @@ -164,7 +165,7 @@ public function getReturnTaxes(): ?array /** * Sets Return Taxes. * - * Collection of references to taxes being returned for an order, including the total + * A collection of references to taxes being returned for an order, including the total * applied tax amount to be returned. The taxes must reference a top-level tax ID from the source * order. * @@ -180,7 +181,7 @@ public function setReturnTaxes(?array $returnTaxes): void /** * Returns Return Discounts. * - * Collection of references to discounts being returned for an order, including the total + * A collection of references to discounts being returned for an order, including the total * applied discount amount to be returned. The discounts must reference a top-level discount ID * from the source order. * @@ -194,7 +195,7 @@ public function getReturnDiscounts(): ?array /** * Sets Return Discounts. * - * Collection of references to discounts being returned for an order, including the total + * A collection of references to discounts being returned for an order, including the total * applied discount amount to be returned. The discounts must reference a top-level discount ID * from the source order. * @@ -210,8 +211,9 @@ public function setReturnDiscounts(?array $returnDiscounts): void /** * Returns Rounding Adjustment. * - * A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding - * when the minimum unit of account is smaller than the lowest physical denomination of currency. + * A rounding adjustment of the money being returned. Commonly used to apply cash rounding + * when the minimum unit of the account is smaller than the lowest physical denomination of the + * currency. */ public function getRoundingAdjustment(): ?OrderRoundingAdjustment { @@ -221,8 +223,9 @@ public function getRoundingAdjustment(): ?OrderRoundingAdjustment /** * Sets Rounding Adjustment. * - * A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding - * when the minimum unit of account is smaller than the lowest physical denomination of currency. + * A rounding adjustment of the money being returned. Commonly used to apply cash rounding + * when the minimum unit of the account is smaller than the lowest physical denomination of the + * currency. * * @maps rounding_adjustment */ diff --git a/src/Models/OrderReturnDiscount.php b/src/Models/OrderReturnDiscount.php index 73566abb..69c4f819 100644 --- a/src/Models/OrderReturnDiscount.php +++ b/src/Models/OrderReturnDiscount.php @@ -62,7 +62,7 @@ class OrderReturnDiscount implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the return discount only within this order. + * A unique ID that identifies the returned discount only within this order. */ public function getUid(): ?string { @@ -72,7 +72,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the return discount only within this order. + * A unique ID that identifies the returned discount only within this order. * * @maps uid */ @@ -84,7 +84,7 @@ public function setUid(?string $uid): void /** * Returns Source Discount Uid. * - * `uid` of the Discount from the Order which contains the original application of this discount. + * The discount `uid` from the order that contains the original application of this discount. */ public function getSourceDiscountUid(): ?string { @@ -94,7 +94,7 @@ public function getSourceDiscountUid(): ?string /** * Sets Source Discount Uid. * - * `uid` of the Discount from the Order which contains the original application of this discount. + * The discount `uid` from the order that contains the original application of this discount. * * @maps source_discount_uid */ @@ -106,7 +106,7 @@ public function setSourceDiscountUid(?string $sourceDiscountUid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogDiscount]($m/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]($m/CatalogDiscount). + * The catalog object ID referencing [CatalogDiscount]($m/CatalogDiscount). * * @maps catalog_object_id */ @@ -173,7 +173,7 @@ public function setType(?string $type): void * Returns Percentage. * * 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%. + * A value of `"7.25"` corresponds to a percentage of 7.25%. * * `percentage` is not set for amount-based discounts. */ @@ -186,7 +186,7 @@ public function getPercentage(): ?string * Sets Percentage. * * 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%. + * A value of `"7.25"` corresponds to a percentage of 7.25%. * * `percentage` is not set for amount-based discounts. * @@ -268,7 +268,7 @@ public function setAppliedMoney(?Money $appliedMoney): void /** * Returns Scope. * - * Indicates whether this is a line item or order level discount. + * Indicates whether this is a line-item or order-level discount. */ public function getScope(): ?string { @@ -278,7 +278,7 @@ public function getScope(): ?string /** * Sets Scope. * - * Indicates whether this is a line item or order level discount. + * Indicates whether this is a line-item or order-level discount. * * @maps scope */ diff --git a/src/Models/OrderReturnLineItem.php b/src/Models/OrderReturnLineItem.php index 9bc26f76..7e8ddd45 100644 --- a/src/Models/OrderReturnLineItem.php +++ b/src/Models/OrderReturnLineItem.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * The line item being returned in an Order. + * The line item being returned in an order. */ class OrderReturnLineItem implements \JsonSerializable { @@ -105,7 +105,7 @@ public function __construct(string $quantity) /** * Returns Uid. * - * Unique identifier for this return line item entry. + * A unique ID for this return line-item entry. */ public function getUid(): ?string { @@ -115,7 +115,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique identifier for this return line item entry. + * A unique ID for this return line-item entry. * * @maps uid */ @@ -127,7 +127,7 @@ public function setUid(?string $uid): void /** * Returns Source Line Item Uid. * - * `uid` of the LineItem in the original sale Order. + * The `uid` of the line item in the original sale order. */ public function getSourceLineItemUid(): ?string { @@ -137,7 +137,7 @@ public function getSourceLineItemUid(): ?string /** * Sets Source Line Item Uid. * - * `uid` of the LineItem in the original sale Order. + * The `uid` of the line item in the original sale order. * * @maps source_line_item_uid */ @@ -172,10 +172,10 @@ public function setName(?string $name): void * Returns Quantity. * * The quantity returned, formatted as a decimal number. - * For example: `"3"`. + * For example, `"3"`. * * Line items with a `quantity_unit` can have non-integer quantities. - * For example: `"1.70000"`. + * For example, `"1.70000"`. */ public function getQuantity(): string { @@ -186,10 +186,10 @@ public function getQuantity(): string * Sets Quantity. * * The quantity returned, formatted as a decimal number. - * For example: `"3"`. + * For example, `"3"`. * * Line items with a `quantity_unit` can have non-integer quantities. - * For example: `"1.70000"`. + * For example, `"1.70000"`. * * @required * @maps quantity @@ -202,7 +202,7 @@ public function setQuantity(string $quantity): void /** * Returns Quantity Unit. * - * Contains the measurement unit for a quantity and a precision which + * Contains the measurement unit for a quantity and a precision that * specifies the number of digits after the decimal point for decimal quantities. */ public function getQuantityUnit(): ?OrderQuantityUnit @@ -213,7 +213,7 @@ public function getQuantityUnit(): ?OrderQuantityUnit /** * Sets Quantity Unit. * - * Contains the measurement unit for a quantity and a precision which + * Contains the measurement unit for a quantity and a precision that * specifies the number of digits after the decimal point for decimal quantities. * * @maps quantity_unit @@ -226,7 +226,7 @@ public function setQuantityUnit(?OrderQuantityUnit $quantityUnit): void /** * Returns Note. * - * The note of the returned line item. + * The note of the return line item. */ public function getNote(): ?string { @@ -236,7 +236,7 @@ public function getNote(): ?string /** * Sets Note. * - * The note of the returned line item. + * The note of the return line item. * * @maps note */ @@ -248,7 +248,7 @@ public function setNote(?string $note): void /** * Returns Catalog Object Id. * - * The [CatalogItemVariation]($m/CatalogItemVariation) id applied to this returned line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) ID applied to this return line item. */ public function getCatalogObjectId(): ?string { @@ -258,7 +258,7 @@ public function getCatalogObjectId(): ?string /** * Sets Catalog Object Id. * - * The [CatalogItemVariation]($m/CatalogItemVariation) id applied to this returned line item. + * The [CatalogItemVariation]($m/CatalogItemVariation) ID applied to this return line item. * * @maps catalog_object_id */ @@ -270,7 +270,7 @@ public function setCatalogObjectId(?string $catalogObjectId): void /** * Returns Variation Name. * - * The name of the variation applied to this returned line item. + * The name of the variation applied to this return line item. */ public function getVariationName(): ?string { @@ -280,7 +280,7 @@ public function getVariationName(): ?string /** * Sets Variation Name. * - * The name of the variation applied to this returned line item. + * The name of the variation applied to this return line item. * * @maps variation_name */ @@ -318,9 +318,9 @@ public function setReturnModifiers(?array $returnModifiers): void /** * Returns Applied Taxes. * - * The list of references to `OrderReturnTax` entities applied to the returned line item. Each + * The list of references to `OrderReturnTax` entities applied to the return 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 + * `OrderReturnTax` applied to the return line item. On reads, the applied amount * is populated. * * @return OrderLineItemAppliedTax[]|null @@ -333,9 +333,9 @@ public function getAppliedTaxes(): ?array /** * Sets Applied Taxes. * - * The list of references to `OrderReturnTax` entities applied to the returned line item. Each + * The list of references to `OrderReturnTax` entities applied to the return 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 + * `OrderReturnTax` applied to the return line item. On reads, the applied amount * is populated. * * @maps applied_taxes @@ -350,10 +350,10 @@ public function setAppliedTaxes(?array $appliedTaxes): void /** * Returns Applied Discounts. * - * The list of references to `OrderReturnDiscount` entities applied to the returned line item. Each + * The list of references to `OrderReturnDiscount` entities applied to the return 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. + * `OrderReturnDiscount` applied to the return line item. On reads, the applied amount + * is populated. * * @return OrderLineItemAppliedDiscount[]|null */ @@ -365,10 +365,10 @@ public function getAppliedDiscounts(): ?array /** * Sets Applied Discounts. * - * The list of references to `OrderReturnDiscount` entities applied to the returned line item. Each + * The list of references to `OrderReturnDiscount` entities applied to the return 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. + * `OrderReturnDiscount` applied to the return line item. On reads, the applied amount + * is populated. * * @maps applied_discounts * diff --git a/src/Models/OrderReturnLineItemModifier.php b/src/Models/OrderReturnLineItemModifier.php index 307e73ca..97986113 100644 --- a/src/Models/OrderReturnLineItemModifier.php +++ b/src/Models/OrderReturnLineItemModifier.php @@ -42,7 +42,7 @@ class OrderReturnLineItemModifier implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the return modifier only within this order. + * A unique ID that identifies the return modifier only within this order. */ public function getUid(): ?string { @@ -52,7 +52,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the return modifier only within this order. + * A unique ID that identifies the return modifier only within this order. * * @maps uid */ @@ -64,7 +64,7 @@ public function setUid(?string $uid): void /** * Returns Source Modifier Uid. * - * `uid` of the Modifier from the LineItem from the Order which contains the + * The modifier `uid` from the order's line item that contains the * original sale of this line item modifier. */ public function getSourceModifierUid(): ?string @@ -75,7 +75,7 @@ public function getSourceModifierUid(): ?string /** * Sets Source Modifier Uid. * - * `uid` of the Modifier from the LineItem from the Order which contains the + * The modifier `uid` from the order's line item that contains the * original sale of this line item modifier. * * @maps source_modifier_uid @@ -88,7 +88,7 @@ public function setSourceModifierUid(?string $sourceModifierUid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogModifier]($m/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]($m/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 5b81ce5d..3997460c 100644 --- a/src/Models/OrderReturnServiceCharge.php +++ b/src/Models/OrderReturnServiceCharge.php @@ -72,7 +72,7 @@ class OrderReturnServiceCharge implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the return service charge only within this order. + * A unique ID that identifies the return service charge only within this order. */ public function getUid(): ?string { @@ -82,7 +82,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the return service charge only within this order. + * A unique ID that identifies the return service charge only within this order. * * @maps uid */ @@ -94,8 +94,8 @@ public function setUid(?string $uid): void /** * Returns Source Service Charge Uid. * - * `uid` of the Service Charge from the Order containing the original - * charge of the service charge. `source_service_charge_uid` is `null` for + * The service charge `uid` from the order containing the original + * service charge. `source_service_charge_uid` is `null` for * unlinked returns. */ public function getSourceServiceChargeUid(): ?string @@ -106,8 +106,8 @@ public function getSourceServiceChargeUid(): ?string /** * Sets Source Service Charge Uid. * - * `uid` of the Service Charge from the Order containing the original - * charge of the service charge. `source_service_charge_uid` is `null` for + * The service charge `uid` from the order containing the original + * service charge. `source_service_charge_uid` is `null` for * unlinked returns. * * @maps source_service_charge_uid @@ -168,7 +168,7 @@ public function setCatalogObjectId(?string $catalogObjectId): void * 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. + * Either `percentage` or `amount_money` should be set, but not both. */ public function getPercentage(): ?string { @@ -182,7 +182,7 @@ public function getPercentage(): ?string * 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. + * Either `percentage` or `amount_money` should be set, but not both. * * @maps percentage */ @@ -331,7 +331,7 @@ public function setTotalTaxMoney(?Money $totalTaxMoney): void * Returns Calculation Phase. * * Represents a phase in the process of calculating order totals. - * Service charges are applied __after__ the indicated phase. + * Service charges are applied after the indicated phase. * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- * api/how-it-works#how-totals-are-calculated) @@ -345,7 +345,7 @@ public function getCalculationPhase(): ?string * Sets Calculation Phase. * * Represents a phase in the process of calculating order totals. - * Service charges are applied __after__ the indicated phase. + * Service charges are applied after the indicated phase. * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- * api/how-it-works#how-totals-are-calculated) @@ -387,7 +387,7 @@ public function setTaxable(?bool $taxable): void * The list of references to `OrderReturnTax` entities applied to the * `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` * that references the `uid` of a top-level `OrderReturnTax` that is being - * applied to the `OrderReturnServiceCharge`. On reads, the amount applied is + * applied to the `OrderReturnServiceCharge`. On reads, the applied amount is * populated. * * @return OrderLineItemAppliedTax[]|null @@ -403,7 +403,7 @@ public function getAppliedTaxes(): ?array * The list of references to `OrderReturnTax` entities applied to the * `OrderReturnServiceCharge`. Each `OrderLineItemAppliedTax` has a `tax_uid` * that references the `uid` of a top-level `OrderReturnTax` that is being - * applied to the `OrderReturnServiceCharge`. On reads, the amount applied is + * applied to the `OrderReturnServiceCharge`. On reads, the applied amount is * populated. * * @maps applied_taxes diff --git a/src/Models/OrderReturnTax.php b/src/Models/OrderReturnTax.php index 643ea6d7..34d8d555 100644 --- a/src/Models/OrderReturnTax.php +++ b/src/Models/OrderReturnTax.php @@ -56,7 +56,7 @@ class OrderReturnTax implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the return tax only within this order. + * A unique ID that identifies the returned tax only within this order. */ public function getUid(): ?string { @@ -66,7 +66,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the return tax only within this order. + * A unique ID that identifies the returned tax only within this order. * * @maps uid */ @@ -78,7 +78,7 @@ public function setUid(?string $uid): void /** * Returns Source Tax Uid. * - * `uid` of the Tax from the Order which contains the original charge of this tax. + * The tax `uid` from the order that contains the original tax charge. */ public function getSourceTaxUid(): ?string { @@ -88,7 +88,7 @@ public function getSourceTaxUid(): ?string /** * Sets Source Tax Uid. * - * `uid` of the Tax from the Order which contains the original charge of this tax. + * The tax `uid` from the order that contains the original tax charge. * * @maps source_tax_uid */ @@ -100,7 +100,7 @@ public function setSourceTaxUid(?string $sourceTaxUid): void /** * Returns Catalog Object Id. * - * The catalog object id referencing [CatalogTax]($m/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]($m/CatalogTax). + * The catalog object ID referencing [CatalogTax]($m/CatalogTax). * * @maps catalog_object_id */ @@ -224,7 +224,7 @@ public function setAppliedMoney(?Money $appliedMoney): void /** * Returns Scope. * - * Indicates whether this is a line item or order level tax. + * Indicates whether this is a line-item or order-level tax. */ public function getScope(): ?string { @@ -234,7 +234,7 @@ public function getScope(): ?string /** * Sets Scope. * - * Indicates whether this is a line item or order level tax. + * Indicates whether this is a line-item or order-level tax. * * @maps scope */ diff --git a/src/Models/OrderReward.php b/src/Models/OrderReward.php index 073f709d..312b06b1 100644 --- a/src/Models/OrderReward.php +++ b/src/Models/OrderReward.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Represents a reward that may be applied to an order if the necessary + * Represents a reward that can be applied to an order if the necessary * reward tier criteria are met. Rewards are created through the Loyalty API. */ class OrderReward implements \JsonSerializable diff --git a/src/Models/OrderRoundingAdjustment.php b/src/Models/OrderRoundingAdjustment.php index 9c0328e9..2d20b859 100644 --- a/src/Models/OrderRoundingAdjustment.php +++ b/src/Models/OrderRoundingAdjustment.php @@ -5,8 +5,9 @@ namespace Square\Models; /** - * A rounding adjustment of the money being returned. Commonly used to apply Cash Rounding - * when the minimum unit of account is smaller than the lowest physical denomination of currency. + * A rounding adjustment of the money being returned. Commonly used to apply cash rounding + * when the minimum unit of the account is smaller than the lowest physical denomination of the + * currency. */ class OrderRoundingAdjustment implements \JsonSerializable { @@ -28,7 +29,7 @@ class OrderRoundingAdjustment implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the rounding adjustment only within this order. + * A unique ID that identifies the rounding adjustment only within this order. */ public function getUid(): ?string { @@ -38,7 +39,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the rounding adjustment only within this order. + * A unique ID that identifies the rounding adjustment only within this order. * * @maps uid */ @@ -50,7 +51,7 @@ public function setUid(?string $uid): void /** * Returns Name. * - * The name of the rounding adjustment from the original sale Order. + * The name of the rounding adjustment from the original sale order. */ public function getName(): ?string { @@ -60,7 +61,7 @@ public function getName(): ?string /** * Sets Name. * - * The name of the rounding adjustment from the original sale Order. + * The name of the rounding adjustment from the original sale order. * * @maps name */ diff --git a/src/Models/OrderServiceCharge.php b/src/Models/OrderServiceCharge.php index 99a042f4..903a51c6 100644 --- a/src/Models/OrderServiceCharge.php +++ b/src/Models/OrderServiceCharge.php @@ -72,7 +72,7 @@ class OrderServiceCharge implements \JsonSerializable /** * Returns Uid. * - * Unique ID that identifies the service charge only within this order. + * A unique ID that identifies the service charge only within this order. */ public function getUid(): ?string { @@ -82,7 +82,7 @@ public function getUid(): ?string /** * Sets Uid. * - * Unique ID that identifies the service charge only within this order. + * A unique ID that identifies the service charge only within this order. * * @maps uid */ @@ -303,7 +303,7 @@ public function setTotalTaxMoney(?Money $totalTaxMoney): void * Returns Calculation Phase. * * Represents a phase in the process of calculating order totals. - * Service charges are applied __after__ the indicated phase. + * Service charges are applied after the indicated phase. * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- * api/how-it-works#how-totals-are-calculated) @@ -317,7 +317,7 @@ public function getCalculationPhase(): ?string * Sets Calculation Phase. * * Represents a phase in the process of calculating order totals. - * Service charges are applied __after__ the indicated phase. + * Service charges are applied after the indicated phase. * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- * api/how-it-works#how-totals-are-calculated) @@ -358,15 +358,15 @@ public function setTaxable(?bool $taxable): void /** * Returns Applied Taxes. * - * The list of references to taxes applied to this service charge. Each + * The list of references to the taxes applied to this service charge. Each * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level * `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied * is populated. * - * An `OrderLineItemAppliedTax` will be automatically created on every taxable service charge + * An `OrderLineItemAppliedTax` is automatically created on every taxable service charge * for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records * for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable - * service charge. Taxable service charges have the `taxable` field set to true and calculated + * service charge. Taxable service charges have the `taxable` field set to `true` and calculated * in the `SUBTOTAL_PHASE`. * * To change the amount of a tax, modify the referenced top-level tax. @@ -381,15 +381,15 @@ public function getAppliedTaxes(): ?array /** * Sets Applied Taxes. * - * The list of references to taxes applied to this service charge. Each + * The list of references to the taxes applied to this service charge. Each * `OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a top-level * `OrderLineItemTax` that is being applied to this service charge. On reads, the amount applied * is populated. * - * An `OrderLineItemAppliedTax` will be automatically created on every taxable service charge + * An `OrderLineItemAppliedTax` is automatically created on every taxable service charge * for all `ORDER` scoped taxes that are added to the order. `OrderLineItemAppliedTax` records * for `LINE_ITEM` scoped taxes must be added in requests for the tax to apply to any taxable - * service charge. Taxable service charges have the `taxable` field set to true and calculated + * service charge. Taxable service charges have the `taxable` field set to `true` and calculated * in the `SUBTOTAL_PHASE`. * * To change the amount of a tax, modify the referenced top-level tax. @@ -409,21 +409,21 @@ public function setAppliedTaxes(?array $appliedTaxes): void * Application-defined data attached to this service charge. 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ public function getMetadata(): ?array { @@ -436,21 +436,21 @@ public function getMetadata(): ?array * Application-defined data attached to this service charge. 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.). + * in relevant API calls. Do not use metadata to store any sensitive information (such as personally + * identifiable information or card details). * * 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 + * `[a-zA-Z0-9_-]`. Entries can 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. + * Values have a maximum length of 255 characters. * - * An application may have up to 10 entries per metadata field. + * An application can 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. + * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). * * @maps metadata */ diff --git a/src/Models/OrderServiceChargeCalculationPhase.php b/src/Models/OrderServiceChargeCalculationPhase.php index 35fa2711..96d5072c 100644 --- a/src/Models/OrderServiceChargeCalculationPhase.php +++ b/src/Models/OrderServiceChargeCalculationPhase.php @@ -6,7 +6,7 @@ /** * Represents a phase in the process of calculating order totals. - * Service charges are applied __after__ the indicated phase. + * Service charges are applied after the indicated phase. * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders- * api/how-it-works#how-totals-are-calculated) @@ -14,13 +14,13 @@ class OrderServiceChargeCalculationPhase { /** - * The service charge will be applied after discounts, but before + * The service charge is applied after discounts, but before * taxes. */ public const SUBTOTAL_PHASE = 'SUBTOTAL_PHASE'; /** - * The service charge will be applied after all discounts and taxes + * The service charge is applied after all discounts and taxes * are applied. */ public const TOTAL_PHASE = 'TOTAL_PHASE'; diff --git a/src/Models/OrderState.php b/src/Models/OrderState.php index 5f1fa537..7a971bc3 100644 --- a/src/Models/OrderState.php +++ b/src/Models/OrderState.php @@ -10,17 +10,17 @@ class OrderState { /** - * Indicates the order is open. Open orders may be updated. + * Indicates that the order is open. Open orders can be updated. */ public const OPEN = 'OPEN'; /** - * Indicates the order is completed. Completed orders are fully paid. This is a terminal state. + * Indicates that the order is completed. Completed orders are fully paid. This is a terminal state. */ public const COMPLETED = 'COMPLETED'; /** - * Indicates the order is canceled. Canceled orders are not paid. This is a terminal state. + * Indicates that the order is canceled. Canceled orders are not paid. This is a terminal state. */ public const CANCELED = 'CANCELED'; } diff --git a/src/Models/OrderUpdated.php b/src/Models/OrderUpdated.php index 7bff8318..9789b2db 100644 --- a/src/Models/OrderUpdated.php +++ b/src/Models/OrderUpdated.php @@ -61,11 +61,11 @@ public function setOrderId(?string $orderId): void /** * Returns Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders) */ public function getVersion(): ?int @@ -76,11 +76,11 @@ public function getVersion(): ?int /** * Sets Version. * - * 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. + * The version number, which is incremented each time an update is committed to the order. + * Orders that were not created through the API do not include a version number and + * therefore cannot be updated. * - * [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage- + * [Read more about working with versions.](https://developer.squareup.com/docs/orders-api/manage- * orders#update-orders) * * @maps version @@ -93,7 +93,7 @@ public function setVersion(?int $version): void /** * Returns Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. */ public function getLocationId(): ?string { @@ -103,7 +103,7 @@ public function getLocationId(): ?string /** * Sets Location Id. * - * The ID of the merchant location this order is associated with. + * The ID of the seller location that this order is associated with. * * @maps location_id */ @@ -137,7 +137,7 @@ public function setState(?string $state): void /** * Returns Created At. * - * Timestamp for when the order was created in RFC 3339 format. + * The timestamp for when the order was created, in RFC 3339 format. */ public function getCreatedAt(): ?string { @@ -147,7 +147,7 @@ public function getCreatedAt(): ?string /** * Sets Created At. * - * Timestamp for when the order was created in RFC 3339 format. + * The timestamp for when the order was created, in RFC 3339 format. * * @maps created_at */ @@ -159,7 +159,7 @@ public function setCreatedAt(?string $createdAt): void /** * Returns Updated At. * - * Timestamp for when the order was last updated in RFC 3339 format. + * The timestamp for when the order was last updated, in RFC 3339 format. */ public function getUpdatedAt(): ?string { @@ -169,7 +169,7 @@ public function getUpdatedAt(): ?string /** * Sets Updated At. * - * Timestamp for when the order was last updated in RFC 3339 format. + * The timestamp for when the order was last updated, in RFC 3339 format. * * @maps updated_at */ diff --git a/src/Models/PayOrderRequest.php b/src/Models/PayOrderRequest.php index 61b08605..35a6ffa3 100644 --- a/src/Models/PayOrderRequest.php +++ b/src/Models/PayOrderRequest.php @@ -36,12 +36,12 @@ public function __construct(string $idempotencyKey) /** * Returns Idempotency Key. * - * 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 + * A value you specify that uniquely identifies this request among requests you have sent. If + * you are 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. + * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- + * apis/idempotency). */ public function getIdempotencyKey(): string { @@ -51,12 +51,12 @@ public function getIdempotencyKey(): string /** * Sets Idempotency Key. * - * 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 + * A value you specify that uniquely identifies this request among requests you have sent. If + * you are 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. + * For more information, see [Idempotency](https://developer.squareup.com/docs/working-with- + * apis/idempotency). * * @required * @maps idempotency_key diff --git a/src/Models/PayOrderResponse.php b/src/Models/PayOrderResponse.php index 194fee8f..279242ff 100644 --- a/src/Models/PayOrderResponse.php +++ b/src/Models/PayOrderResponse.php @@ -50,8 +50,8 @@ public function setErrors(?array $errors): void * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -65,8 +65,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. diff --git a/src/Models/Payment.php b/src/Models/Payment.php index 8f6451f2..357f846b 100644 --- a/src/Models/Payment.php +++ b/src/Models/Payment.php @@ -94,6 +94,11 @@ class Payment implements \JsonSerializable */ private $cashDetails; + /** + * @var BankAccountPaymentDetails|null + */ + private $bankAccountDetails; + /** * @var ExternalPaymentDetails|null */ @@ -478,7 +483,7 @@ public function setRefundedMoney(?Money $refundedMoney): void /** * Returns Status. * - * Indicates whether the payment is APPROVED, COMPLETED, CANCELED, or FAILED. + * Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED. */ public function getStatus(): ?string { @@ -488,7 +493,7 @@ public function getStatus(): ?string /** * Sets Status. * - * Indicates whether the payment is APPROVED, COMPLETED, CANCELED, or FAILED. + * Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED. * * @maps status */ @@ -610,7 +615,7 @@ public function setDelayedUntil(?string $delayedUntil): void * * The source type for this payment. * - * Current values include `CARD`, `CASH`, or `EXTERNAL`. + * Current values include `CARD`, `BANK_ACCOUNT`, `CASH`, or `EXTERNAL`. */ public function getSourceType(): ?string { @@ -622,7 +627,7 @@ public function getSourceType(): ?string * * The source type for this payment. * - * Current values include `CARD`, `CASH`, or `EXTERNAL`. + * Current values include `CARD`, `BANK_ACCOUNT`, `CASH`, or `EXTERNAL`. * * @maps source_type */ @@ -679,6 +684,28 @@ public function setCashDetails(?CashPaymentDetails $cashDetails): void $this->cashDetails = $cashDetails; } + /** + * Returns Bank Account Details. + * + * Additional details about BANK_ACCOUNT type payments. + */ + public function getBankAccountDetails(): ?BankAccountPaymentDetails + { + return $this->bankAccountDetails; + } + + /** + * Sets Bank Account Details. + * + * Additional details about BANK_ACCOUNT type payments. + * + * @maps bank_account_details + */ + public function setBankAccountDetails(?BankAccountPaymentDetails $bankAccountDetails): void + { + $this->bankAccountDetails = $bankAccountDetails; + } + /** * Returns External Details. * @@ -1128,6 +1155,7 @@ public function jsonSerialize() $json['source_type'] = $this->sourceType; $json['card_details'] = $this->cardDetails; $json['cash_details'] = $this->cashDetails; + $json['bank_account_details'] = $this->bankAccountDetails; $json['external_details'] = $this->externalDetails; $json['location_id'] = $this->locationId; $json['order_id'] = $this->orderId; diff --git a/src/Models/RetrieveOrderResponse.php b/src/Models/RetrieveOrderResponse.php index 29ae5170..21178759 100644 --- a/src/Models/RetrieveOrderResponse.php +++ b/src/Models/RetrieveOrderResponse.php @@ -20,8 +20,8 @@ class RetrieveOrderResponse implements \JsonSerializable * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -35,8 +35,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. diff --git a/src/Models/RetrieveSnippetResponse.php b/src/Models/RetrieveSnippetResponse.php new file mode 100644 index 00000000..f59dc882 --- /dev/null +++ b/src/Models/RetrieveSnippetResponse.php @@ -0,0 +1,87 @@ +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; + } + + /** + * Returns Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + */ + public function getSnippet(): ?Snippet + { + return $this->snippet; + } + + /** + * Sets Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + * + * @maps snippet + */ + public function setSnippet(?Snippet $snippet): void + { + $this->snippet = $snippet; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['errors'] = $this->errors; + $json['snippet'] = $this->snippet; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/SearchOrdersCustomerFilter.php b/src/Models/SearchOrdersCustomerFilter.php index 0a8ce949..bd6b51ba 100644 --- a/src/Models/SearchOrdersCustomerFilter.php +++ b/src/Models/SearchOrdersCustomerFilter.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Filter based on Order `customer_id` and any Tender `customer_id` - * associated with the Order. Does not filter based on the + * A filter based on the order `customer_id` and any tender `customer_id` + * associated with the order. It does not filter based on the * [FulfillmentRecipient]($m/OrderFulfillmentRecipient) `customer_id`. */ class SearchOrdersCustomerFilter implements \JsonSerializable @@ -19,7 +19,7 @@ class SearchOrdersCustomerFilter implements \JsonSerializable /** * Returns Customer Ids. * - * List of customer IDs to filter by. + * A list of customer IDs to filter by. * * Max: 10 customer IDs. * @@ -33,7 +33,7 @@ public function getCustomerIds(): ?array /** * Sets Customer Ids. * - * List of customer IDs to filter by. + * A list of customer IDs to filter by. * * Max: 10 customer IDs. * diff --git a/src/Models/SearchOrdersDateTimeFilter.php b/src/Models/SearchOrdersDateTimeFilter.php index b9bd6f04..5d0b29cd 100644 --- a/src/Models/SearchOrdersDateTimeFilter.php +++ b/src/Models/SearchOrdersDateTimeFilter.php @@ -6,20 +6,20 @@ /** * Filter for `Order` objects based on whether their `CREATED_AT`, - * `CLOSED_AT` or `UPDATED_AT` timestamps fall within a specified time range. + * `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]($m/SearchOrdersSort) + * __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, + * you must 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. - * [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). + * in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to + * `CLOSED_AT`. Otherwise, `SearchOrders` throws 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) */ class SearchOrdersDateTimeFilter implements \JsonSerializable { diff --git a/src/Models/SearchOrdersFilter.php b/src/Models/SearchOrdersFilter.php index f85d543e..72a268a6 100644 --- a/src/Models/SearchOrdersFilter.php +++ b/src/Models/SearchOrdersFilter.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Filtering criteria to use for a SearchOrders request. Multiple filters - * will be ANDed together. + * Filtering criteria to use for a `SearchOrders` request. Multiple filters + * are ANDed together. */ class SearchOrdersFilter implements \JsonSerializable { @@ -38,7 +38,7 @@ class SearchOrdersFilter implements \JsonSerializable /** * Returns State Filter. * - * Filter by current Order `state`. + * Filter by the current order `state`. */ public function getStateFilter(): ?SearchOrdersStateFilter { @@ -48,7 +48,7 @@ public function getStateFilter(): ?SearchOrdersStateFilter /** * Sets State Filter. * - * Filter by current Order `state`. + * Filter by the current order `state`. * * @maps state_filter */ @@ -61,20 +61,20 @@ public function setStateFilter(?SearchOrdersStateFilter $stateFilter): void * Returns Date Time Filter. * * Filter for `Order` objects based on whether their `CREATED_AT`, - * `CLOSED_AT` or `UPDATED_AT` timestamps fall within a specified time range. + * `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]($m/SearchOrdersSort) + * __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, + * you must 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. - * [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). + * in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to + * `CLOSED_AT`. Otherwise, `SearchOrders` throws 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) */ public function getDateTimeFilter(): ?SearchOrdersDateTimeFilter { @@ -85,20 +85,20 @@ public function getDateTimeFilter(): ?SearchOrdersDateTimeFilter * Sets Date Time Filter. * * Filter for `Order` objects based on whether their `CREATED_AT`, - * `CLOSED_AT` or `UPDATED_AT` timestamps fall within a specified time range. + * `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]($m/SearchOrdersSort) + * __Important:__ If you use the `DateTimeFilter` in a `SearchOrders` query, + * you must 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. - * [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). + * in `DateTimeFilter`, you must set the `sort_field` in `SearchOrdersSort` to + * `CLOSED_AT`. Otherwise, `SearchOrders` throws 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) * * @maps date_time_filter */ @@ -110,7 +110,7 @@ public function setDateTimeFilter(?SearchOrdersDateTimeFilter $dateTimeFilter): /** * Returns Fulfillment Filter. * - * Filter based on [Order Fulfillment]($m/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]($m/OrderFulfillment) information. + * Filter based on [order fulfillment]($m/OrderFulfillment) information. * * @maps fulfillment_filter */ @@ -132,7 +132,7 @@ public function setFulfillmentFilter(?SearchOrdersFulfillmentFilter $fulfillment /** * Returns Source Filter. * - * Filter based on order `source` information. + * A filter based on order `source` information. */ public function getSourceFilter(): ?SearchOrdersSourceFilter { @@ -142,7 +142,7 @@ public function getSourceFilter(): ?SearchOrdersSourceFilter /** * Sets Source Filter. * - * Filter based on order `source` information. + * A filter based on order `source` information. * * @maps source_filter */ @@ -154,8 +154,8 @@ public function setSourceFilter(?SearchOrdersSourceFilter $sourceFilter): void /** * Returns Customer Filter. * - * Filter based on Order `customer_id` and any Tender `customer_id` - * associated with the Order. Does not filter based on the + * A filter based on the order `customer_id` and any tender `customer_id` + * associated with the order. It does not filter based on the * [FulfillmentRecipient]($m/OrderFulfillmentRecipient) `customer_id`. */ public function getCustomerFilter(): ?SearchOrdersCustomerFilter @@ -166,8 +166,8 @@ public function getCustomerFilter(): ?SearchOrdersCustomerFilter /** * Sets Customer Filter. * - * Filter based on Order `customer_id` and any Tender `customer_id` - * associated with the Order. Does not filter based on the + * A filter based on the order `customer_id` and any tender `customer_id` + * associated with the order. It does not filter based on the * [FulfillmentRecipient]($m/OrderFulfillmentRecipient) `customer_id`. * * @maps customer_filter diff --git a/src/Models/SearchOrdersFulfillmentFilter.php b/src/Models/SearchOrdersFulfillmentFilter.php index 2e7d92d8..ad08bf15 100644 --- a/src/Models/SearchOrdersFulfillmentFilter.php +++ b/src/Models/SearchOrdersFulfillmentFilter.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Filter based on [Order Fulfillment]($m/OrderFulfillment) information. + * Filter based on [order fulfillment]($m/OrderFulfillment) information. */ class SearchOrdersFulfillmentFilter implements \JsonSerializable { @@ -22,8 +22,8 @@ class SearchOrdersFulfillmentFilter implements \JsonSerializable /** * Returns Fulfillment Types. * - * List of [fulfillment types]($m/OrderFulfillmentType) to filter - * for. Will return orders if any of its fulfillments match any of the fulfillment types + * A list of [fulfillment types]($m/OrderFulfillmentType) to filter + * for. The list returns orders if any of its fulfillments match any of the fulfillment types * listed in this field. * See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values * @@ -37,8 +37,8 @@ public function getFulfillmentTypes(): ?array /** * Sets Fulfillment Types. * - * List of [fulfillment types]($m/OrderFulfillmentType) to filter - * for. Will return orders if any of its fulfillments match any of the fulfillment types + * A list of [fulfillment types]($m/OrderFulfillmentType) to filter + * for. The list returns orders if any of its fulfillments match any of the fulfillment types * listed in this field. * See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values * @@ -54,8 +54,8 @@ public function setFulfillmentTypes(?array $fulfillmentTypes): void /** * Returns Fulfillment States. * - * List of [fulfillment states]($m/OrderFulfillmentState) to filter - * for. Will return orders if any of its fulfillments match any of the + * A list of [fulfillment states]($m/OrderFulfillmentState) to filter + * for. The list returns orders if any of its fulfillments match any of the * fulfillment states listed in this field. * See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values * @@ -69,8 +69,8 @@ public function getFulfillmentStates(): ?array /** * Sets Fulfillment States. * - * List of [fulfillment states]($m/OrderFulfillmentState) to filter - * for. Will return orders if any of its fulfillments match any of the + * A list of [fulfillment states]($m/OrderFulfillmentState) to filter + * for. The list returns 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/SearchOrdersQuery.php b/src/Models/SearchOrdersQuery.php index 18cc8d16..36d46b0a 100644 --- a/src/Models/SearchOrdersQuery.php +++ b/src/Models/SearchOrdersQuery.php @@ -22,8 +22,8 @@ class SearchOrdersQuery implements \JsonSerializable /** * Returns Filter. * - * Filtering criteria to use for a SearchOrders request. Multiple filters - * will be ANDed together. + * Filtering criteria to use for a `SearchOrders` request. Multiple filters + * are ANDed together. */ public function getFilter(): ?SearchOrdersFilter { @@ -33,8 +33,8 @@ public function getFilter(): ?SearchOrdersFilter /** * Sets Filter. * - * Filtering criteria to use for a SearchOrders request. Multiple filters - * will be ANDed together. + * Filtering criteria to use for a `SearchOrders` request. Multiple filters + * are ANDed together. * * @maps filter */ @@ -46,7 +46,7 @@ public function setFilter(?SearchOrdersFilter $filter): void /** * Returns Sort. * - * Sorting criteria for a SearchOrders request. Results can only be sorted + * Sorting criteria for a `SearchOrders` request. Results can only be sorted * by a timestamp field. */ public function getSort(): ?SearchOrdersSort @@ -57,7 +57,7 @@ public function getSort(): ?SearchOrdersSort /** * Sets Sort. * - * Sorting criteria for a SearchOrders request. Results can only be sorted + * Sorting criteria for a `SearchOrders` request. Results can only be sorted * by a timestamp field. * * @maps sort diff --git a/src/Models/SearchOrdersRequest.php b/src/Models/SearchOrdersRequest.php index d6c9d5f5..2b4c79dc 100644 --- a/src/Models/SearchOrdersRequest.php +++ b/src/Models/SearchOrdersRequest.php @@ -6,8 +6,8 @@ /** * The request does not have any required fields. When given no query criteria, - * SearchOrders will return all results for all of the merchant’s locations. When fetching additional - * pages using a `cursor`, the `query` must be equal to the `query` used to fetch the first page of + * `SearchOrders` returns all results for all of the seller's locations. When retrieving additional + * pages using a `cursor`, the `query` must be equal to the `query` used to retrieve the first page of * results. */ class SearchOrdersRequest implements \JsonSerializable @@ -43,7 +43,7 @@ class SearchOrdersRequest implements \JsonSerializable * The location IDs for the orders to query. All locations must belong to * the same merchant. * - * Min: 1 location IDs. + * Min: 1 location ID. * * Max: 10 location IDs. * @@ -60,7 +60,7 @@ public function getLocationIds(): ?array * The location IDs for the orders to query. All locations must belong to * the same merchant. * - * Min: 1 location IDs. + * Min: 1 location ID. * * Max: 10 location IDs. * @@ -77,9 +77,8 @@ public function setLocationIds(?array $locationIds): void * 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. - * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more - * information. + * Provide this cursor to retrieve the next set of results for your original query. + * For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). */ public function getCursor(): ?string { @@ -90,9 +89,8 @@ 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. - * See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more - * information. + * Provide this cursor to retrieve the next set of results for your original query. + * For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). * * @maps cursor */ @@ -126,7 +124,7 @@ public function setQuery(?SearchOrdersQuery $query): void /** * Returns Limit. * - * Maximum number of results to be returned in a single page. It is + * 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. * * Default: `500` @@ -139,7 +137,7 @@ public function getLimit(): ?int /** * Sets Limit. * - * Maximum number of results to be returned in a single page. It is + * 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. * * Default: `500` @@ -154,9 +152,9 @@ public function setLimit(?int $limit): void /** * Returns Return Entries. * - * Boolean that controls the format of the search results. If `true`, - * SearchOrders will return [`OrderEntry`]($m/OrderEntry) objects. If `false`, SearchOrders - * will return complete Order objects. + * A Boolean that controls the format of the search results. If `true`, + * `SearchOrders` returns [OrderEntry]($m/OrderEntry) objects. If `false`, `SearchOrders` + * returns complete order objects. * * Default: `false`. */ @@ -168,9 +166,9 @@ public function getReturnEntries(): ?bool /** * Sets Return Entries. * - * Boolean that controls the format of the search results. If `true`, - * SearchOrders will return [`OrderEntry`]($m/OrderEntry) objects. If `false`, SearchOrders - * will return complete Order objects. + * A Boolean that controls the format of the search results. If `true`, + * `SearchOrders` returns [OrderEntry]($m/OrderEntry) objects. If `false`, `SearchOrders` + * returns complete order objects. * * Default: `false`. * diff --git a/src/Models/SearchOrdersResponse.php b/src/Models/SearchOrdersResponse.php index 58f712b5..f618145a 100644 --- a/src/Models/SearchOrdersResponse.php +++ b/src/Models/SearchOrdersResponse.php @@ -5,8 +5,8 @@ namespace Square\Models; /** - * Only one of `order_entries` or `orders` fields will be set, depending on whether - * `return_entries` was set on the [SearchOrdersRequest]($e/Orders/SearchOrders). + * Either the `order_entries` or `orders` field is set, depending on whether + * `return_entries` is set on the [SearchOrdersRequest]($e/Orders/SearchOrders). */ class SearchOrdersResponse implements \JsonSerializable { @@ -33,8 +33,8 @@ class SearchOrdersResponse implements \JsonSerializable /** * Returns Order Entries. * - * List of [OrderEntries]($m/OrderEntry) that fit the query - * conditions. Populated only if `return_entries` was set to `true` in the request. + * A list of [OrderEntries]($m/OrderEntry) that fit the query + * conditions. The list is populated only if `return_entries` is set to `true` in the request. * * @return OrderEntry[]|null */ @@ -46,8 +46,8 @@ public function getOrderEntries(): ?array /** * Sets Order Entries. * - * List of [OrderEntries]($m/OrderEntry) that fit the query - * conditions. Populated only if `return_entries` was set to `true` in the request. + * A list of [OrderEntries]($m/OrderEntry) that fit the query + * conditions. The list is populated only if `return_entries` is set to `true` in the request. * * @maps order_entries * @@ -61,9 +61,9 @@ public function setOrderEntries(?array $orderEntries): void /** * Returns Orders. * - * List of - * [Order]($m/Order) objects that match query conditions. Populated only if - * `return_entries` in the request is set to `false`. + * A list of + * [Order]($m/Order) objects that match the query conditions. The list is populated only if + * `return_entries` is set to `false` in the request. * * @return Order[]|null */ @@ -75,9 +75,9 @@ public function getOrders(): ?array /** * Sets Orders. * - * List of - * [Order]($m/Order) objects that match query conditions. Populated only if - * `return_entries` in the request is set to `false`. + * A list of + * [Order]($m/Order) objects that match the query conditions. The list is populated only if + * `return_entries` is set to `false` in the request. * * @maps orders * @@ -93,8 +93,7 @@ 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. + * For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). */ public function getCursor(): ?string { @@ -106,8 +105,7 @@ 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. + * For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). * * @maps cursor */ diff --git a/src/Models/SearchOrdersSort.php b/src/Models/SearchOrdersSort.php index 8e007340..0ca474a2 100644 --- a/src/Models/SearchOrdersSort.php +++ b/src/Models/SearchOrdersSort.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Sorting criteria for a SearchOrders request. Results can only be sorted + * Sorting criteria for a `SearchOrders` request. Results can only be sorted * by a timestamp field. */ class SearchOrdersSort implements \JsonSerializable @@ -31,7 +31,7 @@ public function __construct(string $sortField) /** * Returns Sort Field. * - * Specifies which timestamp to use to sort SearchOrder results. + * Specifies which timestamp to use to sort `SearchOrder` results. */ public function getSortField(): string { @@ -41,7 +41,7 @@ public function getSortField(): string /** * Sets Sort Field. * - * Specifies which timestamp to use to sort SearchOrder results. + * Specifies which timestamp to use to sort `SearchOrder` results. * * @required * @maps sort_field diff --git a/src/Models/SearchOrdersSortField.php b/src/Models/SearchOrdersSortField.php index 64a913e2..fc714217 100644 --- a/src/Models/SearchOrdersSortField.php +++ b/src/Models/SearchOrdersSortField.php @@ -5,29 +5,29 @@ namespace Square\Models; /** - * Specifies which timestamp to use to sort SearchOrder results. + * Specifies which timestamp to use to sort `SearchOrder` results. */ class SearchOrdersSortField { /** - * Time when the order was created in RFC-3339 format. If you are also + * The time when the order was created, in RFC-3339 format. If you are also * filtering for a time range in this query, you must set the `CREATED_AT` - * field in your DateTimeFilter. + * field in your `DateTimeFilter`. */ public const CREATED_AT = 'CREATED_AT'; /** - * Time when the order last updated in RFC-3339 format. If you are also + * The time when the order last updated, in RFC-3339 format. If you are also * filtering for a time range in this query, you must set the `UPDATED_AT` - * field in your DateTimeFilter. + * field in your `DateTimeFilter`. */ public const UPDATED_AT = 'UPDATED_AT'; /** - * Time when the order was closed in RFC-3339 format. If you use this - * value, you must also set a StateFilter with closed states. If you are also + * The time when the order was closed, in RFC-3339 format. If you use this + * value, you must also set a `StateFilter` with closed states. If you are also * filtering for a time range in this query, you must set the `CLOSED_AT` - * field in your DateTimeFilter. + * field in your `DateTimeFilter`. */ public const CLOSED_AT = 'CLOSED_AT'; } diff --git a/src/Models/SearchOrdersSourceFilter.php b/src/Models/SearchOrdersSourceFilter.php index ee08e876..7a4ec14f 100644 --- a/src/Models/SearchOrdersSourceFilter.php +++ b/src/Models/SearchOrdersSourceFilter.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Filter based on order `source` information. + * A filter based on order `source` information. */ class SearchOrdersSourceFilter implements \JsonSerializable { @@ -17,8 +17,8 @@ class SearchOrdersSourceFilter implements \JsonSerializable /** * Returns Source Names. * - * Filters by [Source]($m/OrderSource) `name`. Will return any orders - * with with a `source.name` that matches any of the listed source names. + * Filters by the [Source]($m/OrderSource) `name`. The filter returns any orders + * with a `source.name` that matches any of the listed source names. * * Max: 10 source names. * @@ -32,8 +32,8 @@ public function getSourceNames(): ?array /** * Sets Source Names. * - * Filters by [Source]($m/OrderSource) `name`. Will return any orders - * with with a `source.name` that matches any of the listed source names. + * Filters by the [Source]($m/OrderSource) `name`. The filter returns any orders + * with a `source.name` that matches any of the listed source names. * * Max: 10 source names. * diff --git a/src/Models/SearchOrdersStateFilter.php b/src/Models/SearchOrdersStateFilter.php index 629b5919..dfcb9c7e 100644 --- a/src/Models/SearchOrdersStateFilter.php +++ b/src/Models/SearchOrdersStateFilter.php @@ -5,7 +5,7 @@ namespace Square\Models; /** - * Filter by current Order `state`. + * Filter by the current order `state`. */ class SearchOrdersStateFilter implements \JsonSerializable { diff --git a/src/Models/Site.php b/src/Models/Site.php new file mode 100644 index 00000000..560117d1 --- /dev/null +++ b/src/Models/Site.php @@ -0,0 +1,193 @@ +id; + } + + /** + * Sets Id. + * + * The Square-assigned ID of the site. + * + * @maps id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * Returns Site Title. + * + * The title of the site. + */ + public function getSiteTitle(): ?string + { + return $this->siteTitle; + } + + /** + * Sets Site Title. + * + * The title of the site. + * + * @maps site_title + */ + public function setSiteTitle(?string $siteTitle): void + { + $this->siteTitle = $siteTitle; + } + + /** + * Returns Domain. + * + * The domain of the site (without the protocol). For example, `mysite1.square.site`. + */ + public function getDomain(): ?string + { + return $this->domain; + } + + /** + * Sets Domain. + * + * The domain of the site (without the protocol). For example, `mysite1.square.site`. + * + * @maps domain + */ + public function setDomain(?string $domain): void + { + $this->domain = $domain; + } + + /** + * Returns Is Published. + * + * Indicates whether the site is published. + */ + public function getIsPublished(): ?bool + { + return $this->isPublished; + } + + /** + * Sets Is Published. + * + * Indicates whether the site is published. + * + * @maps is_published + */ + public function setIsPublished(?bool $isPublished): void + { + $this->isPublished = $isPublished; + } + + /** + * Returns Created At. + * + * The timestamp of when the site was created, in RFC 3339 format. + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * Sets Created At. + * + * The timestamp of when the site was created, in RFC 3339 format. + * + * @maps created_at + */ + public function setCreatedAt(?string $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Returns Updated At. + * + * The timestamp of when the site was last updated, in RFC 3339 format. + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * Sets Updated At. + * + * The timestamp of when the site was last updated, in RFC 3339 format. + * + * @maps updated_at + */ + public function setUpdatedAt(?string $updatedAt): void + { + $this->updatedAt = $updatedAt; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['id'] = $this->id; + $json['site_title'] = $this->siteTitle; + $json['domain'] = $this->domain; + $json['is_published'] = $this->isPublished; + $json['created_at'] = $this->createdAt; + $json['updated_at'] = $this->updatedAt; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/Snippet.php b/src/Models/Snippet.php new file mode 100644 index 00000000..b48714fa --- /dev/null +++ b/src/Models/Snippet.php @@ -0,0 +1,175 @@ +content = $content; + } + + /** + * Returns Id. + * + * The Square-assigned ID for the snippet. + */ + public function getId(): ?string + { + return $this->id; + } + + /** + * Sets Id. + * + * The Square-assigned ID for the snippet. + * + * @maps id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * Returns Site Id. + * + * The ID of the site that contains the snippet. + */ + public function getSiteId(): ?string + { + return $this->siteId; + } + + /** + * Sets Site Id. + * + * The ID of the site that contains the snippet. + * + * @maps site_id + */ + public function setSiteId(?string $siteId): void + { + $this->siteId = $siteId; + } + + /** + * Returns Content. + * + * The snippet code, which can contain valid HTML, JavaScript, or both. + */ + public function getContent(): string + { + return $this->content; + } + + /** + * Sets Content. + * + * The snippet code, which can contain valid HTML, JavaScript, or both. + * + * @required + * @maps content + */ + public function setContent(string $content): void + { + $this->content = $content; + } + + /** + * Returns Created At. + * + * The timestamp of when the snippet was initially added to the site, in RFC 3339 format. + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * Sets Created At. + * + * The timestamp of when the snippet was initially added to the site, in RFC 3339 format. + * + * @maps created_at + */ + public function setCreatedAt(?string $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * Returns Updated At. + * + * The timestamp of when the snippet was last updated on the site, in RFC 3339 format. + */ + public function getUpdatedAt(): ?string + { + return $this->updatedAt; + } + + /** + * Sets Updated At. + * + * The timestamp of when the snippet was last updated on the site, in RFC 3339 format. + * + * @maps updated_at + */ + public function setUpdatedAt(?string $updatedAt): void + { + $this->updatedAt = $updatedAt; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['id'] = $this->id; + $json['site_id'] = $this->siteId; + $json['content'] = $this->content; + $json['created_at'] = $this->createdAt; + $json['updated_at'] = $this->updatedAt; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/SnippetResponse.php b/src/Models/SnippetResponse.php new file mode 100644 index 00000000..6ae8b96e --- /dev/null +++ b/src/Models/SnippetResponse.php @@ -0,0 +1,84 @@ +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; + } + + /** + * Returns Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + */ + public function getSnippet(): ?Snippet + { + return $this->snippet; + } + + /** + * Sets Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + * + * @maps snippet + */ + public function setSnippet(?Snippet $snippet): void + { + $this->snippet = $snippet; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['errors'] = $this->errors; + $json['snippet'] = $this->snippet; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/UpdateOrderRequest.php b/src/Models/UpdateOrderRequest.php index e25d1d5a..d3f92a60 100644 --- a/src/Models/UpdateOrderRequest.php +++ b/src/Models/UpdateOrderRequest.php @@ -29,8 +29,8 @@ class UpdateOrderRequest implements \JsonSerializable * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -44,8 +44,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -62,8 +62,8 @@ public function setOrder(?Order $order): void * * The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot- * notation) - * fields to clear. For example, `line_items[uid].note` - * [Read more about Deleting fields](https://developer.squareup.com/docs/orders-api/manage- + * fields to clear. For example, `line_items[uid].note`. + * For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage- * orders#delete-fields). * * @return string[]|null @@ -78,8 +78,8 @@ public function getFieldsToClear(): ?array * * The [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot- * notation) - * fields to clear. For example, `line_items[uid].note` - * [Read more about Deleting fields](https://developer.squareup.com/docs/orders-api/manage- + * fields to clear. For example, `line_items[uid].note`. + * For more information, see [Deleting fields](https://developer.squareup.com/docs/orders-api/manage- * orders#delete-fields). * * @maps fields_to_clear @@ -94,15 +94,15 @@ public function setFieldsToClear(?array $fieldsToClear): void /** * Returns Idempotency Key. * - * A value you specify that uniquely identifies this update request + * A value you specify that uniquely identifies this update request. * - * If you're unsure whether a particular update was applied to an order successfully, + * If you are unsure whether a particular update was applied to an order successfully, * you can reattempt it with the same idempotency key without * worrying about creating duplicate updates to the order. - * The latest order version will be returned. + * The latest order version is returned. * - * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more - * information. + * For more information, see [Idempotency](https://developer.squareup. + * com/docs/basics/api101/idempotency). */ public function getIdempotencyKey(): ?string { @@ -112,15 +112,15 @@ public function getIdempotencyKey(): ?string /** * Sets Idempotency Key. * - * A value you specify that uniquely identifies this update request + * A value you specify that uniquely identifies this update request. * - * If you're unsure whether a particular update was applied to an order successfully, + * If you are unsure whether a particular update was applied to an order successfully, * you can reattempt it with the same idempotency key without * worrying about creating duplicate updates to the order. - * The latest order version will be returned. + * The latest order version is returned. * - * See [Idempotency](https://developer.squareup.com/docs/basics/api101/idempotency) for more - * information. + * For more information, see [Idempotency](https://developer.squareup. + * com/docs/basics/api101/idempotency). * * @maps idempotency_key */ diff --git a/src/Models/UpdateOrderResponse.php b/src/Models/UpdateOrderResponse.php index 46476c39..3fe54162 100644 --- a/src/Models/UpdateOrderResponse.php +++ b/src/Models/UpdateOrderResponse.php @@ -24,8 +24,8 @@ class UpdateOrderResponse implements \JsonSerializable * Returns Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. @@ -39,8 +39,8 @@ public function getOrder(): ?Order * Sets Order. * * Contains all information related to a single order to process with Square, - * including line items that specify the products to purchase. Order objects also - * include information on any associated tenders, refunds, and returns. + * including line items that specify the products to purchase. `Order` objects also + * include information about any associated tenders, refunds, and returns. * * All Connect V2 Transactions have all been converted to Orders including all associated * itemization data. diff --git a/src/Models/UpsertSnippetRequest.php b/src/Models/UpsertSnippetRequest.php new file mode 100644 index 00000000..e50c56df --- /dev/null +++ b/src/Models/UpsertSnippetRequest.php @@ -0,0 +1,64 @@ +snippet = $snippet; + } + + /** + * Returns Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + */ + public function getSnippet(): Snippet + { + return $this->snippet; + } + + /** + * Sets Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + * + * @required + * @maps snippet + */ + public function setSnippet(Snippet $snippet): void + { + $this->snippet = $snippet; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['snippet'] = $this->snippet; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/Models/UpsertSnippetResponse.php b/src/Models/UpsertSnippetResponse.php new file mode 100644 index 00000000..329462fb --- /dev/null +++ b/src/Models/UpsertSnippetResponse.php @@ -0,0 +1,87 @@ +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; + } + + /** + * Returns Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + */ + public function getSnippet(): ?Snippet + { + return $this->snippet; + } + + /** + * Sets Snippet. + * + * Represents the snippet that is added to a Square Online site. The snippet code is injected into the + * `head` element of all pages on the site, except for checkout pages. + * + * @maps snippet + */ + public function setSnippet(?Snippet $snippet): void + { + $this->snippet = $snippet; + } + + /** + * Encode this object to JSON + * + * @return mixed + */ + public function jsonSerialize() + { + $json = []; + $json['errors'] = $this->errors; + $json['snippet'] = $this->snippet; + + return array_filter($json, function ($val) { + return $val !== null; + }); + } +} diff --git a/src/SquareClient.php b/src/SquareClient.php index 5f0d881f..3871d62e 100644 --- a/src/SquareClient.php +++ b/src/SquareClient.php @@ -37,6 +37,8 @@ class SquareClient implements ConfigurationInterface private $orders; private $payments; private $refunds; + private $sites; + private $snippets; private $subscriptions; private $team; private $terminal; @@ -143,7 +145,7 @@ public function getCustomUrl(): string */ public function getSdkVersion(): string { - return '10.0.0.20210421'; + return '11.0.0.20210513'; } /** @@ -450,6 +452,28 @@ public function getRefundsApi(): Apis\RefundsApi return $this->refunds; } + /** + * Returns Sites Api + */ + public function getSitesApi(): Apis\SitesApi + { + if ($this->sites == null) { + $this->sites = new Apis\SitesApi($this); + } + return $this->sites; + } + + /** + * Returns Snippets Api + */ + public function getSnippetsApi(): Apis\SnippetsApi + { + if ($this->snippets == null) { + $this->snippets = new Apis\SnippetsApi($this); + } + return $this->snippets; + } + /** * Returns Subscriptions Api */