From fd6ec449b4414afb195baf4e44ab2accf5c096dc Mon Sep 17 00:00:00 2001 From: autobot Date: Wed, 21 Jul 2021 05:13:32 +0000 Subject: [PATCH] Generated PR for Release: 13.0.0.20210721 --- .github/workflows/python-package.yml | 2 +- CHANGELOG.md | 48 +++ README.md | 2 +- doc/api/checkout.md | 6 +- doc/api/inventory.md | 275 ++++++++++++++ doc/api/loyalty.md | 13 +- doc/api/orders.md | 17 +- doc/client.md | 8 +- doc/models/balance-payment-details.md | 25 -- .../calculate-loyalty-points-request.md | 2 +- doc/models/create-loyalty-account-request.md | 2 +- doc/models/create-loyalty-account-response.md | 2 +- doc/models/digital-wallet-details.md | 23 ++ doc/models/error-category.md | 1 + doc/models/error-code.md | 1 + doc/models/error.md | 4 +- doc/models/external-payment-details.md | 2 +- doc/models/inventory-change-type.md | 2 +- doc/models/inventory-change.md | 2 +- doc/models/invoice.md | 2 +- doc/models/list-employees-response.md | 6 +- doc/models/list-invoices-response.md | 186 ++++++---- doc/models/location.md | 3 +- doc/models/loyalty-account.md | 2 +- .../loyalty-program-expiration-policy.md | 2 +- doc/models/order-line-item-discount.md | 5 +- doc/models/order-line-item-modifier.md | 6 +- doc/models/order-line-item-tax.md | 5 +- doc/models/order-line-item.md | 4 +- doc/models/order-quantity-unit.md | 4 +- doc/models/order-return-discount.md | 5 +- doc/models/order-return-line-item-modifier.md | 8 +- doc/models/order-return-line-item.md | 4 +- doc/models/order-return-service-charge.md | 3 +- doc/models/order-return-tax.md | 5 +- doc/models/order-return.md | 17 +- doc/models/order-service-charge-type.md | 14 + doc/models/order-service-charge.md | 9 +- doc/models/order.md | 11 +- doc/models/payment.md | 3 +- doc/models/retrieve-employee-response.md | 6 +- .../retrieve-inventory-transfer-response.md | 40 ++ .../retrieve-loyalty-account-response.md | 2 +- doc/models/search-catalog-items-response.md | 6 +- doc/models/search-invoices-response.md | 186 ++++++---- doc/models/snippet-response.md | 6 +- doc/models/tax-ids.md | 27 ++ doc/models/update-order-request.md | 3 +- doc/models/v1-list-orders-response.md | 16 +- doc/models/v1-order.md | 6 +- doc/models/v1-payment-tax.md | 6 +- setup.py | 2 +- square/api/base_api.py | 2 +- square/api/inventory_api.py | 342 +++++++++++++++++- square/api/loyalty_api.py | 20 +- square/client.py | 6 +- square/configuration.py | 2 +- 57 files changed, 1154 insertions(+), 265 deletions(-) delete mode 100644 doc/models/balance-payment-details.md create mode 100644 doc/models/digital-wallet-details.md create mode 100644 doc/models/order-service-charge-type.md create mode 100644 doc/models/retrieve-inventory-transfer-response.md create mode 100644 doc/models/tax-ids.md diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c4503411..64bc76f7 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.5] + python-version: [2.7, 3.6] steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f8c1104..5d4c5e1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # Change Log +## Version 13.0.0.20210721 (2021-07-21) +## SDK updates + * The [Square Python SDK](https://developer.squareup.com/docs/sdks/python) now requires Python 3.7 or later, if Python 3 is used. With Python 2, the minimum version remains at 2.7. + +## API updates + +* **Orders API:** + * [OrderServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderServiceCharge) object. Added a new field, `type`. It identifies the service charge type. + + * [OrderQuantityUnit](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderQuantityUnit), + [OrderLineItem](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItem), + [OrderLineItemDiscount](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemDiscount), + [OrderLineItemModifier](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemModifier), + [OrderLineItemTax](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemTax), + [OrderServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderServiceCharge), + [OrderReturnLineItem](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnLineItem), + [OrderReturnLineItemModifier](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnLineItemModifier), + [OrderReturnServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnServiceCharge), + [OrderReturnTax](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnTax), and + [OrderReturnDiscount](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnDiscount) objects. Added a new field, `catalog_version`. +* **Locations API:** + * [Location](https://developer.squareup.com/reference/square_2021-07-21/objects/Location) object. Added a new field `tax_ids` of type `TaxIds`. In the current implementation, sellers in Ireland and France can configure tax IDs during the onboarding process. They can also provide the information later by updating the location information in the Seller Dashboard. These tax IDs appear in this field. + +* **Loyalty API:** + * As of July 15, 2021, the country in which the seller’s Square account is activated determines whether Square uses pretax or post-tax purchase amounts to calculate accrued points. This change supports consumption tax models, such as value-added tax (VAT). Previously, point accrual was based on pretax purchase amounts only. This change does not affect the existing point balance of loyalty accounts. For more information, see [Availability of Square Loyalty.](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability) + +* **Payments API:** + * [UpdatePayment](https://developer.squareup.com/reference/square_2021-07-21/payments-api/update-payment). The endpoint has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. Also, you can now update gift card payments (similar to card, cash, and external payments). + +* **Subscriptions API:** + * The [Subscriptions API](https://developer.squareup.com/docs/subscriptions-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. + * [CatalogSubscriptionPlan](https://developer.squareup.com/reference/square_2021-07-21/objects/CatalogSubscriptionPlan) object. The `name` and `price` are now write-once fields. You specify these values at the time of creating a plan. After the plan is created, these fields cannot be updated. This makes a subscription plan immutable. + +* **Inventory API:** + * [RetrieveInventoryTransfer.](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Transfer) This new endpoint is introduced to support the retrieval of inventory transfer. + * [RetrieveInventoryChanges.](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Changes) This endpoint is deprecated. Its support ends when it is retired in about 12 months. + * The following endpoints have updated URLs to conform to the standard REST API convention. For more information about migrating deprecated URLs to updated URLs in your application, see [Inventory API: Migrate to Updated API Entities.](https://developer.squareup.com/docs/inventory-api/migrate-to-updated-api-entities) + * [RetrieveInventoryAdjustment](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Adjustment) + * [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Change-Inventory) + * [BatchRetrieveInventoryChanges](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Retrieve-Inventory-Changes) + * [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Retrieve-Inventory-Counts) + * [RetrieveInventoryPhysicalCount](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Physical-Count) + +## Documentation updates +* **Webhooks.** Revised the steps and descriptions for creating and using webhooks. For more information, see [Webhooks Overview.](https://developer.squareup.com/docs/webhooks/overview) + + + ## Version 12.0.0.20210616 (2021-06-16) ## New API releases * **Gift Cards API and Gift Card Activities API.** Gift card support is integrated in the [Square Seller Dashboard](https://squareup.com/dashboard/) and the [Square Point of Sale](https://squareup.com/us/en/point-of-sale) application. Sellers can sell, redeem, track, and reload Square gift cards. Now developers can use the [Gift Cards API](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api) and the [Gift Card Activities API](https://developer.squareup.com/reference/square_2021-06-16/gift-card-activities-api) to integrate Square gift cards into third-party applications. For more information, see [Gift Cards API Overview.](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api) diff --git a/README.md b/README.md index b894eb77..8eb93ba1 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Use this Python library to manage Square resources (payments, orders, items, inv The SDK supports the following versions of Python: * Python 2 versions 2.7.9 and later -* Python 3 versions 3.4 and later +* Python 3 versions 3.7 and later ## Installation diff --git a/doc/api/checkout.md b/doc/api/checkout.md index d3d51516..50f1ae11 100644 --- a/doc/api/checkout.md +++ b/doc/api/checkout.md @@ -59,6 +59,7 @@ body['order']['order']['line_items'][0]['quantity_unit']['measurement_unit']['le body['order']['order']['line_items'][0]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_SHOT' body['order']['order']['line_items'][0]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_MILLIGRAM' body['order']['order']['line_items'][0]['quantity_unit']['precision'] = 191 +body['order']['order']['line_items'][0]['quantity_unit']['catalog_version'] = 131 body['order']['order']['line_items'][0]['note'] = 'note1' body['order']['order']['line_items'][0]['catalog_object_id'] = 'catalog_object_id3' body['order']['order']['line_items'][0]['applied_taxes'] = [] @@ -94,6 +95,7 @@ body['order']['order']['line_items'][1]['quantity_unit']['measurement_unit']['le body['order']['order']['line_items'][1]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_CUP' body['order']['order']['line_items'][1]['quantity_unit']['measurement_unit']['weight_unit'] = 'IMPERIAL_STONE' body['order']['order']['line_items'][1]['quantity_unit']['precision'] = 192 +body['order']['order']['line_items'][1]['quantity_unit']['catalog_version'] = 130 body['order']['order']['line_items'][1]['note'] = 'note0' body['order']['order']['line_items'][1]['catalog_object_id'] = 'catalog_object_id2' body['order']['order']['line_items'][1]['base_price_money'] = {} @@ -111,6 +113,7 @@ body['order']['order']['line_items'][2]['quantity_unit']['measurement_unit']['le body['order']['order']['line_items'][2]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_PINT' body['order']['order']['line_items'][2]['quantity_unit']['measurement_unit']['weight_unit'] = 'IMPERIAL_POUND' body['order']['order']['line_items'][2]['quantity_unit']['precision'] = 193 +body['order']['order']['line_items'][2]['quantity_unit']['catalog_version'] = 129 body['order']['order']['line_items'][2]['note'] = 'note9' body['order']['order']['line_items'][2]['catalog_object_id'] = 'catalog_object_id1' body['order']['order']['line_items'][2]['base_price_money'] = {} @@ -122,6 +125,7 @@ body['order']['order']['taxes'] = [] body['order']['order']['taxes'].append({}) body['order']['order']['taxes'][0]['uid'] = '38ze1696-z1e3-5628-af6d-f1e04d947fg3' body['order']['order']['taxes'][0]['catalog_object_id'] = 'catalog_object_id7' +body['order']['order']['taxes'][0]['catalog_version'] = 47 body['order']['order']['taxes'][0]['name'] = 'name9' body['order']['order']['taxes'][0]['type'] = 'INCLUSIVE' body['order']['order']['taxes'][0]['percentage'] = '7.75' @@ -132,9 +136,9 @@ body['order']['order']['discounts'] = [] body['order']['order']['discounts'].append({}) body['order']['order']['discounts'][0]['uid'] = '56ae1696-z1e3-9328-af6d-f1e04d947gd4' body['order']['order']['discounts'][0]['catalog_object_id'] = 'catalog_object_id1' +body['order']['order']['discounts'][0]['catalog_version'] = 73 body['order']['order']['discounts'][0]['name'] = 'name7' body['order']['order']['discounts'][0]['type'] = 'FIXED_AMOUNT' -body['order']['order']['discounts'][0]['percentage'] = 'percentage5' body['order']['order']['discounts'][0]['amount_money'] = {} body['order']['order']['discounts'][0]['amount_money']['amount'] = 100 body['order']['order']['discounts'][0]['amount_money']['currency'] = 'USD' diff --git a/doc/api/inventory.md b/doc/api/inventory.md index 3467e3b4..ee068619 100644 --- a/doc/api/inventory.md +++ b/doc/api/inventory.md @@ -10,15 +10,57 @@ inventory_api = client.inventory ## Methods +* [Deprecated Retrieve Inventory Adjustment](/doc/api/inventory.md#deprecated-retrieve-inventory-adjustment) * [Retrieve Inventory Adjustment](/doc/api/inventory.md#retrieve-inventory-adjustment) +* [Deprecated Batch Change Inventory](/doc/api/inventory.md#deprecated-batch-change-inventory) +* [Deprecated Batch Retrieve Inventory Changes](/doc/api/inventory.md#deprecated-batch-retrieve-inventory-changes) +* [Deprecated Batch Retrieve Inventory Counts](/doc/api/inventory.md#deprecated-batch-retrieve-inventory-counts) * [Batch Change Inventory](/doc/api/inventory.md#batch-change-inventory) * [Batch Retrieve Inventory Changes](/doc/api/inventory.md#batch-retrieve-inventory-changes) * [Batch Retrieve Inventory Counts](/doc/api/inventory.md#batch-retrieve-inventory-counts) +* [Deprecated Retrieve Inventory Physical Count](/doc/api/inventory.md#deprecated-retrieve-inventory-physical-count) * [Retrieve Inventory Physical Count](/doc/api/inventory.md#retrieve-inventory-physical-count) +* [Retrieve Inventory Transfer](/doc/api/inventory.md#retrieve-inventory-transfer) * [Retrieve Inventory Count](/doc/api/inventory.md#retrieve-inventory-count) * [Retrieve Inventory Changes](/doc/api/inventory.md#retrieve-inventory-changes) +# Deprecated Retrieve Inventory Adjustment + +**This endpoint is deprecated.** + +Deprecated version of [RetrieveInventoryAdjustment](/doc/api/inventory.md#retrieve-inventory-adjustment) after the endpoint URL +is updated to conform to the standard convention. + +```python +def deprecated_retrieve_inventory_adjustment(self, + adjustment_id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `adjustment_id` | `string` | Template, Required | ID of the [InventoryAdjustment](/doc/models/inventory-adjustment.md) to retrieve. | + +## Response Type + +[`Retrieve Inventory Adjustment Response`](/doc/models/retrieve-inventory-adjustment-response.md) + +## Example Usage + +```python +adjustment_id = 'adjustment_id0' + +result = inventory_api.deprecated_retrieve_inventory_adjustment(adjustment_id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + # Retrieve Inventory Adjustment Returns the [InventoryAdjustment](/doc/models/inventory-adjustment.md) object @@ -53,6 +95,164 @@ elif result.is_error(): ``` +# Deprecated Batch Change Inventory + +**This endpoint is deprecated.** + +Deprecated version of [BatchChangeInventory](/doc/api/inventory.md#batch-change-inventory) after the endpoint URL +is updated to conform to the standard convention. + +```python +def deprecated_batch_change_inventory(self, + body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`Batch Change Inventory Request`](/doc/models/batch-change-inventory-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Batch Change Inventory Response`](/doc/models/batch-change-inventory-response.md) + +## Example Usage + +```python +body = {} +body['idempotency_key'] = '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe' +body['changes'] = [] + +body['changes'].append({}) +body['changes'][0]['type'] = 'PHYSICAL_COUNT' +body['changes'][0]['physical_count'] = {} +body['changes'][0]['physical_count']['id'] = 'id0' +body['changes'][0]['physical_count']['reference_id'] = '1536bfbf-efed-48bf-b17d-a197141b2a92' +body['changes'][0]['physical_count']['catalog_object_id'] = 'W62UWFY35CWMYGVWK6TWJDNI' +body['changes'][0]['physical_count']['catalog_object_type'] = 'catalog_object_type4' +body['changes'][0]['physical_count']['state'] = 'IN_STOCK' +body['changes'][0]['physical_count']['location_id'] = 'C6W5YS5QM06F5' +body['changes'][0]['physical_count']['quantity'] = '53' +body['changes'][0]['physical_count']['employee_id'] = 'LRK57NSQ5X7PUD05' +body['changes'][0]['physical_count']['occurred_at'] = '2016-11-16T22:25:24.878Z' +body['changes'][0]['adjustment'] = {} +body['changes'][0]['adjustment']['id'] = 'id6' +body['changes'][0]['adjustment']['reference_id'] = 'reference_id4' +body['changes'][0]['adjustment']['from_state'] = 'SOLD' +body['changes'][0]['adjustment']['to_state'] = 'SOLD_ONLINE' +body['changes'][0]['adjustment']['location_id'] = 'location_id0' +body['changes'][0]['transfer'] = {} +body['changes'][0]['transfer']['id'] = 'id0' +body['changes'][0]['transfer']['reference_id'] = 'reference_id8' +body['changes'][0]['transfer']['state'] = 'UNLINKED_RETURN' +body['changes'][0]['transfer']['from_location_id'] = 'from_location_id2' +body['changes'][0]['transfer']['to_location_id'] = 'to_location_id2' +body['changes'][0]['measurement_unit'] = {} +body['changes'][0]['measurement_unit']['measurement_unit'] = {} +body['changes'][0]['measurement_unit']['measurement_unit']['custom_unit'] = {} +body['changes'][0]['measurement_unit']['measurement_unit']['custom_unit']['name'] = 'name0' +body['changes'][0]['measurement_unit']['measurement_unit']['custom_unit']['abbreviation'] = 'abbreviation2' +body['changes'][0]['measurement_unit']['measurement_unit']['area_unit'] = 'IMPERIAL_SQUARE_FOOT' +body['changes'][0]['measurement_unit']['measurement_unit']['length_unit'] = 'METRIC_METER' +body['changes'][0]['measurement_unit']['measurement_unit']['volume_unit'] = 'METRIC_MILLILITER' +body['changes'][0]['measurement_unit']['measurement_unit']['weight_unit'] = 'IMPERIAL_WEIGHT_OUNCE' +body['changes'][0]['measurement_unit']['precision'] = 26 + +body['ignore_unchanged_counts'] = True + +result = inventory_api.deprecated_batch_change_inventory(body) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + +# Deprecated Batch Retrieve Inventory Changes + +**This endpoint is deprecated.** + +Deprecated version of [BatchRetrieveInventoryChanges](/doc/api/inventory.md#batch-retrieve-inventory-changes) after the endpoint URL +is updated to conform to the standard convention. + +```python +def deprecated_batch_retrieve_inventory_changes(self, + body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`Batch Retrieve Inventory Changes Request`](/doc/models/batch-retrieve-inventory-changes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Batch Retrieve Inventory Changes Response`](/doc/models/batch-retrieve-inventory-changes-response.md) + +## Example Usage + +```python +body = {} +body['catalog_object_ids'] = ['W62UWFY35CWMYGVWK6TWJDNI'] +body['location_ids'] = ['C6W5YS5QM06F5'] +body['types'] = ['PHYSICAL_COUNT'] +body['states'] = ['IN_STOCK'] +body['updated_after'] = '2016-11-01T00:00:00.000Z' +body['updated_before'] = '2016-12-01T00:00:00.000Z' + +result = inventory_api.deprecated_batch_retrieve_inventory_changes(body) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + +# Deprecated Batch Retrieve Inventory Counts + +**This endpoint is deprecated.** + +Deprecated version of [BatchRetrieveInventoryCounts](/doc/api/inventory.md#batch-retrieve-inventory-counts) after the endpoint URL +is updated to conform to the standard convention. + +```python +def deprecated_batch_retrieve_inventory_counts(self, + body) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`Batch Retrieve Inventory Counts Request`](/doc/models/batch-retrieve-inventory-counts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | + +## Response Type + +[`Batch Retrieve Inventory Counts Response`](/doc/models/batch-retrieve-inventory-counts-response.md) + +## Example Usage + +```python +body = {} +body['catalog_object_ids'] = ['W62UWFY35CWMYGVWK6TWJDNI'] +body['location_ids'] = ['59TNP9SA8VGDA'] +body['updated_after'] = '2016-11-16T00:00:00.000Z' +body['cursor'] = 'cursor0' +body['states'] = ['SUPPORTED_BY_NEWER_VERSION'] + +result = inventory_api.deprecated_batch_retrieve_inventory_counts(body) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + # Batch Change Inventory Applies adjustments and counts to the provided item quantities. @@ -223,6 +423,42 @@ elif result.is_error(): ``` +# Deprecated Retrieve Inventory Physical Count + +**This endpoint is deprecated.** + +Deprecated version of [RetrieveInventoryPhysicalCount](/doc/api/inventory.md#retrieve-inventory-physical-count) after the endpoint URL +is updated to conform to the standard convention. + +```python +def deprecated_retrieve_inventory_physical_count(self, + physical_count_id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `physical_count_id` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](/doc/models/inventory-physical-count.md) to retrieve. | + +## Response Type + +[`Retrieve Inventory Physical Count Response`](/doc/models/retrieve-inventory-physical-count-response.md) + +## Example Usage + +```python +physical_count_id = 'physical_count_id2' + +result = inventory_api.deprecated_retrieve_inventory_physical_count(physical_count_id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + # Retrieve Inventory Physical Count Returns the [InventoryPhysicalCount](/doc/models/inventory-physical-count.md) @@ -257,6 +493,40 @@ elif result.is_error(): ``` +# Retrieve Inventory Transfer + +Returns the [InventoryTransfer](/doc/models/inventory-transfer.md) object +with the provided `transfer_id`. + +```python +def retrieve_inventory_transfer(self, + transfer_id) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `transfer_id` | `string` | Template, Required | ID of the [InventoryTransfer](/doc/models/inventory-transfer.md) to retrieve. | + +## Response Type + +[`Retrieve Inventory Transfer Response`](/doc/models/retrieve-inventory-transfer-response.md) + +## Example Usage + +```python +transfer_id = 'transfer_id6' + +result = inventory_api.retrieve_inventory_transfer(transfer_id) + +if result.is_success(): + print(result.body) +elif result.is_error(): + print(result.errors) +``` + + # Retrieve Inventory Count Retrieves the current calculated stock count for a given @@ -301,10 +571,15 @@ elif result.is_error(): # Retrieve Inventory Changes +**This endpoint is deprecated.** + Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](/doc/models/catalog-object.md) at the requested [Location](/doc/models/location.md)s. +You can achieve the same result by calling [BatchRetrieveInventoryChanges](/doc/api/inventory.md#batch-retrieve-inventory-changes) +and having the `catalog_object_ids` list contain a single element of the `CatalogObject` ID. + Results are paginated and sorted in descending order according to their `occurred_at` timestamp (newest first). diff --git a/doc/api/loyalty.md b/doc/api/loyalty.md index 3e90fe8b..9f6b7908 100644 --- a/doc/api/loyalty.md +++ b/doc/api/loyalty.md @@ -160,10 +160,12 @@ Adds points to a loyalty account. The endpoint reads the order to compute points to add to the buyer's account. - If you are not using the Orders API to manage orders, you first perform a client-side computation to compute the points. - For spend-based and visit-based programs, you can call - [CalculateLoyaltyPoints](/doc/api/loyalty.md#calculate-loyalty-points) to compute the points. For more information, - see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - You then provide the points in a request to this endpoint. + For spend-based and visit-based programs, you can first call + [CalculateLoyaltyPoints](/doc/api/loyalty.md#calculate-loyalty-points) to compute the points + that you provide to this endpoint. + +__Note:__ The country of the seller's Square account determines whether tax is included in the purchase amount when accruing points for spend-based and visit-based programs. +For more information, see [Availability of Square Loyalty](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability). ```python def accumulate_loyalty_points(self, @@ -380,6 +382,9 @@ Calculates the points a purchase earns. An application might call this endpoint to show the points that a buyer can earn with the specific purchase. +__Note:__ The country of the seller's Square account determines whether tax is included in the purchase amount when accruing points for spend-based and visit-based programs. +For more information, see [Availability of Square Loyalty](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability). + ```python def calculate_loyalty_points(self, program_id, diff --git a/doc/api/orders.md b/doc/api/orders.md index 7b2f22c7..1c6368ef 100644 --- a/doc/api/orders.md +++ b/doc/api/orders.md @@ -71,6 +71,7 @@ body['order']['line_items'][0]['quantity_unit']['measurement_unit']['length_unit body['order']['line_items'][0]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_QUART' body['order']['line_items'][0]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_MILLIGRAM' body['order']['line_items'][0]['quantity_unit']['precision'] = 189 +body['order']['line_items'][0]['quantity_unit']['catalog_version'] = 133 body['order']['line_items'][0]['note'] = 'note3' body['order']['line_items'][0]['catalog_object_id'] = 'catalog_object_id5' body['order']['line_items'][0]['base_price_money'] = {} @@ -91,6 +92,7 @@ body['order']['line_items'][1]['quantity_unit']['measurement_unit']['length_unit body['order']['line_items'][1]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_PINT' body['order']['line_items'][1]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_GRAM' body['order']['line_items'][1]['quantity_unit']['precision'] = 188 +body['order']['line_items'][1]['quantity_unit']['catalog_version'] = 134 body['order']['line_items'][1]['note'] = 'note4' body['order']['line_items'][1]['catalog_object_id'] = 'BEMYCSMIJL46OCDV4KYIKXIB' body['order']['line_items'][1]['modifiers'] = [] @@ -98,13 +100,11 @@ body['order']['line_items'][1]['modifiers'] = [] body['order']['line_items'][1]['modifiers'].append({}) body['order']['line_items'][1]['modifiers'][0]['uid'] = 'uid1' body['order']['line_items'][1]['modifiers'][0]['catalog_object_id'] = 'CHQX7Y4KY6N5KINJKZCFURPZ' +body['order']['line_items'][1]['modifiers'][0]['catalog_version'] = 69 body['order']['line_items'][1]['modifiers'][0]['name'] = 'name1' body['order']['line_items'][1]['modifiers'][0]['base_price_money'] = {} body['order']['line_items'][1]['modifiers'][0]['base_price_money']['amount'] = 53 body['order']['line_items'][1]['modifiers'][0]['base_price_money']['currency'] = 'TTD' -body['order']['line_items'][1]['modifiers'][0]['total_price_money'] = {} -body['order']['line_items'][1]['modifiers'][0]['total_price_money']['amount'] = 51 -body['order']['line_items'][1]['modifiers'][0]['total_price_money']['currency'] = 'EUR' body['order']['line_items'][1]['applied_discounts'] = [] @@ -121,6 +121,7 @@ body['order']['taxes'] = [] body['order']['taxes'].append({}) body['order']['taxes'][0]['uid'] = 'state-sales-tax' body['order']['taxes'][0]['catalog_object_id'] = 'catalog_object_id1' +body['order']['taxes'][0]['catalog_version'] = 189 body['order']['taxes'][0]['name'] = 'State Sales Tax' body['order']['taxes'][0]['type'] = 'UNKNOWN_TAX' body['order']['taxes'][0]['percentage'] = '9' @@ -131,6 +132,7 @@ body['order']['discounts'] = [] body['order']['discounts'].append({}) body['order']['discounts'][0]['uid'] = 'labor-day-sale' body['order']['discounts'][0]['catalog_object_id'] = 'catalog_object_id5' +body['order']['discounts'][0]['catalog_version'] = 89 body['order']['discounts'][0]['name'] = 'Labor Day Sale' body['order']['discounts'][0]['type'] = 'FIXED_PERCENTAGE' body['order']['discounts'][0]['percentage'] = '5' @@ -139,17 +141,17 @@ body['order']['discounts'][0]['scope'] = 'ORDER' body['order']['discounts'].append({}) body['order']['discounts'][1]['uid'] = 'membership-discount' body['order']['discounts'][1]['catalog_object_id'] = 'DB7L55ZH2BGWI4H23ULIWOQ7' +body['order']['discounts'][1]['catalog_version'] = 90 body['order']['discounts'][1]['name'] = 'name2' body['order']['discounts'][1]['type'] = 'FIXED_AMOUNT' -body['order']['discounts'][1]['percentage'] = 'percentage0' body['order']['discounts'][1]['scope'] = 'ORDER' body['order']['discounts'].append({}) body['order']['discounts'][2]['uid'] = 'one-dollar-off' body['order']['discounts'][2]['catalog_object_id'] = 'catalog_object_id7' +body['order']['discounts'][2]['catalog_version'] = 91 body['order']['discounts'][2]['name'] = 'Sale - $1.00 off' body['order']['discounts'][2]['type'] = 'VARIABLE_PERCENTAGE' -body['order']['discounts'][2]['percentage'] = 'percentage1' body['order']['discounts'][2]['amount_money'] = {} body['order']['discounts'][2]['amount_money']['amount'] = 100 body['order']['discounts'][2]['amount_money']['currency'] = 'USD' @@ -249,6 +251,7 @@ body['order']['line_items'][0]['quantity_unit']['measurement_unit']['length_unit body['order']['line_items'][0]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_QUART' body['order']['line_items'][0]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_MILLIGRAM' body['order']['line_items'][0]['quantity_unit']['precision'] = 189 +body['order']['line_items'][0]['quantity_unit']['catalog_version'] = 133 body['order']['line_items'][0]['note'] = 'note3' body['order']['line_items'][0]['catalog_object_id'] = 'catalog_object_id5' body['order']['line_items'][0]['base_price_money'] = {} @@ -269,6 +272,7 @@ body['order']['line_items'][1]['quantity_unit']['measurement_unit']['length_unit body['order']['line_items'][1]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_PINT' body['order']['line_items'][1]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_GRAM' body['order']['line_items'][1]['quantity_unit']['precision'] = 188 +body['order']['line_items'][1]['quantity_unit']['catalog_version'] = 134 body['order']['line_items'][1]['note'] = 'note4' body['order']['line_items'][1]['catalog_object_id'] = 'catalog_object_id6' body['order']['line_items'][1]['base_price_money'] = {} @@ -280,6 +284,7 @@ body['order']['discounts'] = [] body['order']['discounts'].append({}) body['order']['discounts'][0]['uid'] = 'uid1' body['order']['discounts'][0]['catalog_object_id'] = 'catalog_object_id5' +body['order']['discounts'][0]['catalog_version'] = 89 body['order']['discounts'][0]['name'] = '50% Off' body['order']['discounts'][0]['type'] = 'FIXED_PERCENTAGE' body['order']['discounts'][0]['percentage'] = '50' @@ -482,6 +487,7 @@ body['order']['line_items'][0]['quantity_unit']['measurement_unit']['length_unit body['order']['line_items'][0]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_QUART' body['order']['line_items'][0]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_MILLIGRAM' body['order']['line_items'][0]['quantity_unit']['precision'] = 189 +body['order']['line_items'][0]['quantity_unit']['catalog_version'] = 133 body['order']['line_items'][0]['note'] = 'note3' body['order']['line_items'][0]['catalog_object_id'] = 'catalog_object_id5' @@ -499,6 +505,7 @@ body['order']['line_items'][1]['quantity_unit']['measurement_unit']['length_unit body['order']['line_items'][1]['quantity_unit']['measurement_unit']['volume_unit'] = 'GENERIC_PINT' body['order']['line_items'][1]['quantity_unit']['measurement_unit']['weight_unit'] = 'METRIC_GRAM' body['order']['line_items'][1]['quantity_unit']['precision'] = 188 +body['order']['line_items'][1]['quantity_unit']['catalog_version'] = 134 body['order']['line_items'][1]['note'] = 'note4' body['order']['line_items'][1]['catalog_object_id'] = 'catalog_object_id6' diff --git a/doc/client.md b/doc/client.md index 76dacc7e..7cab94ce 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 | | --- | --- | --- | -| `square_version` | `string` | Square Connect API versions
*Default*: `'2021-06-16'` | +| `square_version` | `string` | Square Connect API versions
*Default*: `'2021-07-21'` | | `access_token` | `string` | The OAuth 2.0 Access Token to use for API requests. | | `custom_url` | `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`** | @@ -22,9 +22,9 @@ The API client can be initialized as follows: from square.client import Client client = Client( - square_version='2021-06-16', + square_version='2021-07-21', access_token='AccessToken', - environment = 'production', + environment='production', custom_url = 'https://connect.squareup.com',) ``` @@ -47,7 +47,7 @@ API calls return an `ApiResponse` object that includes the following fields: from square.client import Client client = Client( - square_version='2021-06-16', + square_version='2021-07-21', access_token='AccessToken',) locations_api = client.locations diff --git a/doc/models/balance-payment-details.md b/doc/models/balance-payment-details.md deleted file mode 100644 index 848639e5..00000000 --- a/doc/models/balance-payment-details.md +++ /dev/null @@ -1,25 +0,0 @@ - -# Balance Payment Details - -Reflects the current status of a balance payment. Contains only non-confidential information. - -## Structure - -`Balance Payment Details` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `account_id` | `string` | Optional | The ID of the account used to fund the payment. | -| `status` | `string` | Optional | The balance payment’s current state. The state can be COMPLETED or FAILED. | - -## Example (as JSON) - -```json -{ - "account_id": "account_id2", - "status": "status8" -} -``` - diff --git a/doc/models/calculate-loyalty-points-request.md b/doc/models/calculate-loyalty-points-request.md index 1d921344..054323de 100644 --- a/doc/models/calculate-loyalty-points-request.md +++ b/doc/models/calculate-loyalty-points-request.md @@ -12,7 +12,7 @@ a specified purchase. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `order_id` | `string` | Optional | The [order](/doc/models/order.md) ID for which to calculate the points.
Specify this field if your application uses the Orders API to process orders.
Otherwise, specify the `transaction_amount`. | +| `order_id` | `string` | Optional | The [order](/doc/models/order.md) ID for which to calculate the points.
Specify this field if your application uses the Orders API to process orders.
Otherwise, specify the `transaction_amount_money`. | | `transaction_amount_money` | [`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. | ## Example (as JSON) diff --git a/doc/models/create-loyalty-account-request.md b/doc/models/create-loyalty-account-request.md index 2059a3db..a1ce690f 100644 --- a/doc/models/create-loyalty-account-request.md +++ b/doc/models/create-loyalty-account-request.md @@ -11,7 +11,7 @@ A request to create a new loyalty account. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `loyalty_account` | [`Loyalty Account`](/doc/models/loyalty-account.md) | Required | Describes a loyalty account. For more information, see
[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). | +| `loyalty_account` | [`Loyalty Account`](/doc/models/loyalty-account.md) | Required | Describes a loyalty account. For more information, see
[Manage Loyalty Accounts Using the Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview). | | `idempotency_key` | `string` | Required | A unique string that identifies this `CreateLoyaltyAccount` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | ## Example (as JSON) diff --git a/doc/models/create-loyalty-account-response.md b/doc/models/create-loyalty-account-response.md index 04f6c278..9f15a722 100644 --- a/doc/models/create-loyalty-account-response.md +++ b/doc/models/create-loyalty-account-response.md @@ -12,7 +12,7 @@ A response that includes loyalty account created. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `errors` | [`List of Error`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_account` | [`Loyalty Account`](/doc/models/loyalty-account.md) | Optional | Describes a loyalty account. For more information, see
[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). | +| `loyalty_account` | [`Loyalty Account`](/doc/models/loyalty-account.md) | Optional | Describes a loyalty account. For more information, see
[Manage Loyalty Accounts Using the Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview). | ## Example (as JSON) diff --git a/doc/models/digital-wallet-details.md b/doc/models/digital-wallet-details.md new file mode 100644 index 00000000..3be99322 --- /dev/null +++ b/doc/models/digital-wallet-details.md @@ -0,0 +1,23 @@ + +# Digital Wallet Details + +Additional details about `WALLET` type payments. Contains only non-confidential information. + +## Structure + +`Digital Wallet Details` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | `string` | Optional | The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or
`FAILED`.
**Constraints**: *Maximum Length*: `50` | + +## Example (as JSON) + +```json +{ + "status": "status8" +} +``` + diff --git a/doc/models/error-category.md b/doc/models/error-category.md index ab3f268e..5343933e 100644 --- a/doc/models/error-category.md +++ b/doc/models/error-category.md @@ -18,4 +18,5 @@ request to the Connect API. | `RATE_LIMIT_ERROR` | Your application reached the Connect API rate limit. Retry your
request after a while. | | `PAYMENT_METHOD_ERROR` | An error occurred while processing a payment method. Most commonly,
the details of the payment method were invalid (such as a card's CVV
or expiration date). | | `REFUND_ERROR` | An error occurred while attempting to process a refund. | +| `MERCHANT_SUBSCRIPTION_ERROR` | An error occurred when checking a merchant subscription status | diff --git a/doc/models/error-code.md b/doc/models/error-code.md index 0ebb37ae..99dab9d0 100644 --- a/doc/models/error-code.md +++ b/doc/models/error-code.md @@ -23,6 +23,7 @@ Square API. | `V1_APPLICATION` | The calling application was created prior to
2016-03-30 and is not compatible with v2 Square API calls. | | `V1_ACCESS_TOKEN` | The calling application is using an access token
created prior to 2016-03-30 and is not compatible with v2 Square API
calls. | | `CARD_PROCESSING_NOT_ENABLED` | The location provided in the API call is not
enabled for credit card processing. | +| `MERCHANT_SUBSCRIPTION_NOT_FOUND` | A required subscription was not found for the merchant | | `BAD_REQUEST` | A general error occurred with the request. | | `MISSING_REQUIRED_PARAMETER` | The request is missing a required path, query, or
body parameter. | | `INCORRECT_TYPE` | The value provided in the request is the wrong
type. For example, a string instead of an integer. | diff --git a/doc/models/error.md b/doc/models/error.md index cf687711..114da2ba 100644 --- a/doc/models/error.md +++ b/doc/models/error.md @@ -22,8 +22,8 @@ See [Handling errors](https://developer.squareup.com/docs/build-basics/handling- ```json { - "category": "INVALID_REQUEST_ERROR", - "code": "CARD_DECLINED_CALL_ISSUER", + "category": "RATE_LIMIT_ERROR", + "code": "EXPECTED_OBJECT", "detail": "detail6", "field": "field6" } diff --git a/doc/models/external-payment-details.md b/doc/models/external-payment-details.md index 575b06dd..9725ea20 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 | | --- | --- | --- | --- | -| `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` | +| `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.
- FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals
- OTHER - A type not listed here.
**Constraints**: *Maximum Length*: `50` | | `source` | `string` | Required | A description of the external payment source. For example,
"Food Delivery Service".
**Constraints**: *Maximum Length*: `255` | | `source_id` | `string` | Optional | An ID to associate the payment to its originating source.
**Constraints**: *Maximum Length*: `255` | | `source_fee_money` | [`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. | diff --git a/doc/models/inventory-change-type.md b/doc/models/inventory-change-type.md index 09d88ac3..02933da7 100644 --- a/doc/models/inventory-change-type.md +++ b/doc/models/inventory-change-type.md @@ -1,7 +1,7 @@ # Inventory Change Type -Indicates how the inventory change was applied to a tracked quantity of items. +Indicates how the inventory change was applied to a tracked product quantity. ## Enumeration diff --git a/doc/models/inventory-change.md b/doc/models/inventory-change.md index f68e33cb..a57432fd 100644 --- a/doc/models/inventory-change.md +++ b/doc/models/inventory-change.md @@ -13,7 +13,7 @@ that is part of the history of inventory changes for a particular | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `type` | [`str (Inventory Change Type)`](/doc/models/inventory-change-type.md) | Optional | Indicates how the inventory change was applied to a tracked quantity of items. | +| `type` | [`str (Inventory Change Type)`](/doc/models/inventory-change-type.md) | Optional | Indicates how the inventory change was applied to a tracked product quantity. | | `physical_count` | [`Inventory Physical Count`](/doc/models/inventory-physical-count.md) | Optional | Represents the quantity of an item variation that is physically present
at a specific location, verified by a seller or a seller's employee. For example,
a physical count might come from an employee counting the item variations on
hand or from syncing with an external system. | | `adjustment` | [`Inventory Adjustment`](/doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | | `transfer` | [`Inventory Transfer`](/doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | diff --git a/doc/models/invoice.md b/doc/models/invoice.md index bda2f385..72968c12 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,7 +15,7 @@ invoices. For more information, see [Manage Invoices Using the Invoices API](htt | `id` | `string` | Optional | The Square-assigned ID of the invoice. | | `version` | `int` | Optional | The Square-assigned version number, which is incremented each time an update is committed to the invoice. | | `location_id` | `string` | Optional | The ID of the location that this invoice is associated with.

If specified in a `CreateInvoice` request, the value must match the `location_id` of the associated order.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | -| `order_id` | `string` | Optional | The ID of the [order](/doc/models/order.md) for which the invoice is created.

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

To view the line items and other information for the associated order, call the
[RetrieveOrder](/doc/api/orders.md#retrieve-order) endpoint using the order ID.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | | `primary_recipient` | [`Invoice Recipient`](/doc/models/invoice-recipient.md) | Optional | Provides customer data that Square uses to deliver an invoice. | | `payment_requests` | [`List of Invoice Payment Request`](/doc/models/invoice-payment-request.md) | Optional | The payment schedule for the invoice, represented by one or more payment requests that
define payment settings, such as amount due and due date. You can specify a maximum of 13
payment requests, with up to 12 `INSTALLMENT` request types. For more information, see
[Payment requests](https://developer.squareup.com/docs/invoices-api/overview#payment-requests).

This field is required when creating an invoice. It must contain at least one payment request. | | `delivery_method` | [`str (Invoice Delivery Method)`](/doc/models/invoice-delivery-method.md) | Optional | Indicates how Square delivers the [invoice](/doc/models/invoice.md) to the customer. | diff --git a/doc/models/list-employees-response.md b/doc/models/list-employees-response.md index ddd9b6b3..3fb7c3c1 100644 --- a/doc/models/list-employees-response.md +++ b/doc/models/list-employees-response.md @@ -30,19 +30,19 @@ "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "UNPROCESSABLE_ENTITY", + "code": "NOT_ACCEPTABLE", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "RATE_LIMITED", + "code": "REQUEST_TIMEOUT", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "NOT_IMPLEMENTED", + "code": "CONFLICT", "detail": "detail3", "field": "field1" } diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 410157aa..f31af14a 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -19,73 +19,135 @@ Describes a `ListInvoice` response. ```json { - "cursor": "CURSOR", + "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", "invoices": [ { - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "card": true, - "square_gift_card": false + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240" + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + }, + { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": true + }, + "created_at": "2021-01-23T15:29:12Z", + "delivery_method": "EMAIL", + "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + "invoice_number": "inv-455", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", + "payment_requests": [ + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "due_date": "2021-01-23", + "percentage_requested": "25", + "request_type": "DEPOSIT", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" }, - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "DRAFT", - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T17:45:13Z", - "version": 0 - } + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "due_date": "2021-06-15", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/h9sfsfTGTSnYEhISUDBhEQ", + "status": "PARTIALLY_PAID", + "timezone": "America/Los_Angeles", + "updated_at": "2021-01-23T15:29:56Z", + "version": 3 } ] } diff --git a/doc/models/location.md b/doc/models/location.md index f2ad782a..0263bc8e 100644 --- a/doc/models/location.md +++ b/doc/models/location.md @@ -18,7 +18,7 @@ | `created_at` | `string` | Optional | The time when the location was created, in RFC 3339 format. | | `merchant_id` | `string` | Optional | The ID of the merchant that owns the location. | | `country` | [`str (Country)`](/doc/models/country.md) | Optional | Indicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). | -| `language_code` | `string` | Optional | The language associated with the location, in
[BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A). | +| `language_code` | `string` | Optional | The language associated with the location, in
[BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A).
For more information, see [Location language code](https://developer.squareup.com/docs/locations-api#location-language-code). | | `currency` | [`str (Currency)`](/doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | | `phone_number` | `string` | Optional | The phone number of the location in human readable format. | | `business_name` | `string` | Optional | The business name of the location
This is the name visible to the customers of the location.
For example, this name appears on customer receipts. | @@ -35,6 +35,7 @@ | `pos_background_url` | `string` | Optional | The URL of the Point of Sale background image for the location. | | `mcc` | `string` | Optional | The merchant category code (MCC) of the location, as standardized by ISO 18245.
The MCC describes the kind of goods or services sold at the location. | | `full_format_logo_url` | `string` | Optional | The URL of a full-format logo image for the location. The Seller must choose this logo in the
Seller dashboard (Receipts section) for the logo to appear on transactions (such as receipts, invoices)
that Square generates on behalf of the Seller. This image can have an aspect ratio of 2:1 or greater
and is recommended to be at least 1280x648 pixels. | +| `tax_ids` | [`Tax Ids`](/doc/models/tax-ids.md) | Optional | The tax IDs that a Location is operating under. | ## Example (as JSON) diff --git a/doc/models/loyalty-account.md b/doc/models/loyalty-account.md index d90e3931..9eb6079e 100644 --- a/doc/models/loyalty-account.md +++ b/doc/models/loyalty-account.md @@ -2,7 +2,7 @@ # Loyalty Account Describes a loyalty account. For more information, see -[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). +[Manage Loyalty Accounts Using the Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview). ## Structure diff --git a/doc/models/loyalty-program-expiration-policy.md b/doc/models/loyalty-program-expiration-policy.md index cdd34e12..1033424f 100644 --- a/doc/models/loyalty-program-expiration-policy.md +++ b/doc/models/loyalty-program-expiration-policy.md @@ -11,7 +11,7 @@ Describes when the loyalty program expires. | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `expiration_duration` | `string` | Required | The duration of time before points expire, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | +| `expiration_duration` | `string` | Required | The number of months before points expire, in RFC 3339 duration format. For example, a value of `P12M` represents a duration of 12 months.
**Constraints**: *Minimum Length*: `1` | ## Example (as JSON) diff --git a/doc/models/order-line-item-discount.md b/doc/models/order-line-item-discount.md index 57713406..efd1d6eb 100644 --- a/doc/models/order-line-item-discount.md +++ b/doc/models/order-line-item-discount.md @@ -18,6 +18,7 @@ amount contributed by the item to the order subtotal. | --- | --- | --- | --- | | `uid` | `string` | Optional | A unique ID that identifies the discount only within this order.
**Constraints**: *Maximum Length*: `60` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing [CatalogDiscount](/doc/models/catalog-discount.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this discount references. | | `name` | `string` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | | `type` | [`str (Order Line Item Discount Type)`](/doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | | `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` | @@ -34,9 +35,9 @@ amount contributed by the item to the order subtotal. { "uid": "uid0", "catalog_object_id": "catalog_object_id6", + "catalog_version": 126, "name": "name0", - "type": "UNKNOWN_DISCOUNT", - "percentage": "percentage8" + "type": "UNKNOWN_DISCOUNT" } ``` diff --git a/doc/models/order-line-item-modifier.md b/doc/models/order-line-item-modifier.md index 6b3f2a70..11dea081 100644 --- a/doc/models/order-line-item-modifier.md +++ b/doc/models/order-line-item-modifier.md @@ -13,6 +13,7 @@ A [CatalogModifier](/doc/models/catalog-modifier.md). | --- | --- | --- | --- | | `uid` | `string` | Optional | A unique ID that identifies the modifier only within this order.
**Constraints**: *Maximum Length*: `60` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing [CatalogModifier](/doc/models/catalog-modifier.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this modifier references. | | `name` | `string` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | | `base_price_money` | [`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. | | `total_price_money` | [`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. | @@ -23,14 +24,11 @@ A [CatalogModifier](/doc/models/catalog-modifier.md). { "uid": "uid0", "catalog_object_id": "catalog_object_id6", + "catalog_version": 126, "name": "name0", "base_price_money": { "amount": 114, "currency": "ALL" - }, - "total_price_money": { - "amount": 52, - "currency": "MYR" } } ``` diff --git a/doc/models/order-line-item-tax.md b/doc/models/order-line-item-tax.md index 2c621b2f..5600af32 100644 --- a/doc/models/order-line-item-tax.md +++ b/doc/models/order-line-item-tax.md @@ -17,6 +17,7 @@ contributes to the order subtotal. | --- | --- | --- | --- | | `uid` | `string` | Optional | A unique ID that identifies the tax only within this order.
**Constraints**: *Maximum Length*: `60` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing [CatalogTax](/doc/models/catalog-tax.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this tax references. | | `name` | `string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | | `type` | [`str (Order Line Item Tax Type)`](/doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | | `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` | @@ -31,9 +32,9 @@ contributes to the order subtotal. { "uid": "uid0", "catalog_object_id": "catalog_object_id6", + "catalog_version": 126, "name": "name0", - "type": "INCLUSIVE", - "percentage": "percentage8" + "type": "INCLUSIVE" } ``` diff --git a/doc/models/order-line-item.md b/doc/models/order-line-item.md index 4a4e09ab..775167cc 100644 --- a/doc/models/order-line-item.md +++ b/doc/models/order-line-item.md @@ -18,6 +18,7 @@ product to purchase, with its own quantity and price details. | `quantity_unit` | [`Order Quantity Unit`](/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. | | `note` | `string` | Optional | The note of the line item.
**Constraints**: *Maximum Length*: `2000` | | `catalog_object_id` | `string` | Optional | The [CatalogItemVariation](/doc/models/catalog-item-variation.md) ID applied to this line item.
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this line item references. | | `variation_name` | `string` | Optional | The name of the variation applied to this line item.
**Constraints**: *Maximum Length*: `255` | | `item_type` | [`str (Order Line Item Item Type)`](/doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | | `metadata` | `dict` | 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). | @@ -50,7 +51,8 @@ product to purchase, with its own quantity and price details. "volume_unit": "GENERIC_CUP", "weight_unit": "IMPERIAL_WEIGHT_OUNCE" }, - "precision": 54 + "precision": 54, + "catalog_version": 12 }, "note": "note4", "catalog_object_id": "catalog_object_id6" diff --git a/doc/models/order-quantity-unit.md b/doc/models/order-quantity-unit.md index 9db16983..43ec805f 100644 --- a/doc/models/order-quantity-unit.md +++ b/doc/models/order-quantity-unit.md @@ -14,6 +14,7 @@ specifies the number of digits after the decimal point for decimal quantities. | --- | --- | --- | --- | | `measurement_unit` | [`Measurement Unit`](/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`. | | `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. | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this measurement unit references.

This field is set when this is a catalog-backed measurement unit. | ## Example (as JSON) @@ -29,7 +30,8 @@ specifies the number of digits after the decimal point for decimal quantities. "volume_unit": "METRIC_LITER", "weight_unit": "IMPERIAL_WEIGHT_OUNCE" }, - "precision": 196 + "precision": 196, + "catalog_version": 126 } ``` diff --git a/doc/models/order-return-discount.md b/doc/models/order-return-discount.md index 828bafd9..7c418898 100644 --- a/doc/models/order-return-discount.md +++ b/doc/models/order-return-discount.md @@ -19,6 +19,7 @@ order subtotal. | `uid` | `string` | Optional | A unique ID that identifies the returned discount only within this order.
**Constraints**: *Maximum Length*: `60` | | `source_discount_uid` | `string` | Optional | The discount `uid` from the order that contains the original application of this discount.
**Constraints**: *Maximum Length*: `60` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing [CatalogDiscount](/doc/models/catalog-discount.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this discount references. | | `name` | `string` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | | `type` | [`str (Order Line Item Discount Type)`](/doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | | `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` | @@ -33,8 +34,8 @@ order subtotal. "uid": "uid0", "source_discount_uid": "source_discount_uid0", "catalog_object_id": "catalog_object_id6", - "name": "name0", - "type": "UNKNOWN_DISCOUNT" + "catalog_version": 126, + "name": "name0" } ``` diff --git a/doc/models/order-return-line-item-modifier.md b/doc/models/order-return-line-item-modifier.md index ba5a8c87..07e90e01 100644 --- a/doc/models/order-return-line-item-modifier.md +++ b/doc/models/order-return-line-item-modifier.md @@ -14,6 +14,7 @@ A line item modifier being returned. | `uid` | `string` | Optional | A unique ID that identifies the return modifier only within this order.
**Constraints**: *Maximum Length*: `60` | | `source_modifier_uid` | `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` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing [CatalogModifier](/doc/models/catalog-modifier.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this line item modifier references. | | `name` | `string` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | | `base_price_money` | [`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. | | `total_price_money` | [`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. | @@ -25,11 +26,8 @@ A line item modifier being returned. "uid": "uid0", "source_modifier_uid": "source_modifier_uid6", "catalog_object_id": "catalog_object_id6", - "name": "name0", - "base_price_money": { - "amount": 114, - "currency": "ALL" - } + "catalog_version": 126, + "name": "name0" } ``` diff --git a/doc/models/order-return-line-item.md b/doc/models/order-return-line-item.md index c83a0b32..88ea7935 100644 --- a/doc/models/order-return-line-item.md +++ b/doc/models/order-return-line-item.md @@ -18,6 +18,7 @@ The line item being returned in an order. | `quantity_unit` | [`Order Quantity Unit`](/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. | | `note` | `string` | Optional | The note of the return line item.
**Constraints**: *Maximum Length*: `2000` | | `catalog_object_id` | `string` | Optional | The [CatalogItemVariation](/doc/models/catalog-item-variation.md) ID applied to this return line item.
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this line item references. | | `variation_name` | `string` | Optional | The name of the variation applied to this return line item.
**Constraints**: *Maximum Length*: `255` | | `item_type` | [`str (Order Line Item Item Type)`](/doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | | `return_modifiers` | [`List of Order Return Line Item Modifier`](/doc/models/order-return-line-item-modifier.md) | Optional | The [CatalogModifier](/doc/models/catalog-modifier.md)s applied to this line item. | @@ -49,7 +50,8 @@ The line item being returned in an order. "volume_unit": "GENERIC_CUP", "weight_unit": "IMPERIAL_WEIGHT_OUNCE" }, - "precision": 54 + "precision": 54, + "catalog_version": 12 }, "note": "note4" } diff --git a/doc/models/order-return-service-charge.md b/doc/models/order-return-service-charge.md index fc5ba87f..7cfa6e88 100644 --- a/doc/models/order-return-service-charge.md +++ b/doc/models/order-return-service-charge.md @@ -15,6 +15,7 @@ Represents the service charge applied to the original order. | `source_service_charge_uid` | `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` | | `name` | `string` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | | `catalog_object_id` | `string` | Optional | The catalog object ID of the associated [OrderServiceCharge](/doc/models/order-service-charge.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this service charge references. | | `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` | | `amount_money` | [`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. | | `applied_money` | [`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. | @@ -32,7 +33,7 @@ Represents the service charge applied to the original order. "source_service_charge_uid": "source_service_charge_uid6", "name": "name0", "catalog_object_id": "catalog_object_id6", - "percentage": "percentage8" + "catalog_version": 126 } ``` diff --git a/doc/models/order-return-tax.md b/doc/models/order-return-tax.md index dc5b4627..5821fc0d 100644 --- a/doc/models/order-return-tax.md +++ b/doc/models/order-return-tax.md @@ -18,6 +18,7 @@ order subtotal. | `uid` | `string` | Optional | A unique ID that identifies the returned tax only within this order.
**Constraints**: *Maximum Length*: `60` | | `source_tax_uid` | `string` | Optional | The tax `uid` from the order that contains the original tax charge.
**Constraints**: *Maximum Length*: `60` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing [CatalogTax](/doc/models/catalog-tax.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this tax references. | | `name` | `string` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | | `type` | [`str (Order Line Item Tax Type)`](/doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | | `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` | @@ -31,8 +32,8 @@ order subtotal. "uid": "uid0", "source_tax_uid": "source_tax_uid2", "catalog_object_id": "catalog_object_id6", - "name": "name0", - "type": "INCLUSIVE" + "catalog_version": 126, + "name": "name0" } ``` diff --git a/doc/models/order-return.md b/doc/models/order-return.md index b8c33ff6..cc5a6ae5 100644 --- a/doc/models/order-return.md +++ b/doc/models/order-return.md @@ -43,7 +43,8 @@ The set of line items, service charges, taxes, discounts, tips, and other items "volume_unit": "IMPERIAL_CUBIC_FOOT", "weight_unit": "METRIC_KILOGRAM" }, - "precision": 73 + "precision": 73, + "catalog_version": 249 }, "note": "note9" }, @@ -63,7 +64,8 @@ The set of line items, service charges, taxes, discounts, tips, and other items "volume_unit": "IMPERIAL_CUBIC_YARD", "weight_unit": "METRIC_GRAM" }, - "precision": 74 + "precision": 74, + "catalog_version": 248 }, "note": "note8" }, @@ -83,7 +85,8 @@ The set of line items, service charges, taxes, discounts, tips, and other items "volume_unit": "METRIC_MILLILITER", "weight_unit": "METRIC_MILLIGRAM" }, - "precision": 75 + "precision": 75, + "catalog_version": 247 }, "note": "note7" } @@ -94,14 +97,14 @@ The set of line items, service charges, taxes, discounts, tips, and other items "source_service_charge_uid": "source_service_charge_uid3", "name": "name3", "catalog_object_id": "catalog_object_id3", - "percentage": "percentage1" + "catalog_version": 197 }, { "uid": "uid4", "source_service_charge_uid": "source_service_charge_uid2", "name": "name4", "catalog_object_id": "catalog_object_id2", - "percentage": "percentage2" + "catalog_version": 196 } ], "return_taxes": [ @@ -109,8 +112,8 @@ The set of line items, service charges, taxes, discounts, tips, and other items "uid": "uid6", "source_tax_uid": "source_tax_uid4", "catalog_object_id": "catalog_object_id0", - "name": "name6", - "type": "INCLUSIVE" + "catalog_version": 116, + "name": "name6" } ] } diff --git a/doc/models/order-service-charge-type.md b/doc/models/order-service-charge-type.md new file mode 100644 index 00000000..27d80525 --- /dev/null +++ b/doc/models/order-service-charge-type.md @@ -0,0 +1,14 @@ + +# Order Service Charge Type + +## Enumeration + +`Order Service Charge Type` + +## Fields + +| Name | +| --- | +| `AUTO_GRATUITY` | +| `CUSTOM` | + diff --git a/doc/models/order-service-charge.md b/doc/models/order-service-charge.md index 48c4911f..18b94013 100644 --- a/doc/models/order-service-charge.md +++ b/doc/models/order-service-charge.md @@ -14,6 +14,7 @@ Represents a service charge applied to an order. | `uid` | `string` | Optional | A unique ID that identifies the service charge only within this order.
**Constraints**: *Maximum Length*: `60` | | `name` | `string` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | | `catalog_object_id` | `string` | Optional | The catalog object ID referencing the service charge [CatalogObject](/doc/models/catalog-object.md).
**Constraints**: *Maximum Length*: `192` | +| `catalog_version` | `long\|int` | Optional | The version of the catalog object that this service charge references. | | `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` | | `amount_money` | [`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. | | `applied_money` | [`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. | @@ -23,6 +24,7 @@ Represents a service charge applied to an order. | `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. | | `applied_taxes` | [`List of Order Line Item Applied Tax`](/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. | | `metadata` | `dict` | 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). | +| `type` | [`str (Order Service Charge Type)`](/doc/models/order-service-charge-type.md) | Optional | - | ## Example (as JSON) @@ -31,11 +33,8 @@ Represents a service charge applied to an order. "uid": "uid0", "name": "name0", "catalog_object_id": "catalog_object_id6", - "percentage": "percentage8", - "amount_money": { - "amount": 186, - "currency": "NGN" - } + "catalog_version": 126, + "percentage": "percentage8" } ``` diff --git a/doc/models/order.md b/doc/models/order.md index 40c36652..780c90ca 100644 --- a/doc/models/order.md +++ b/doc/models/order.md @@ -20,7 +20,7 @@ itemization data. | `location_id` | `string` | Required | The ID of the seller location that this order is associated with.
**Constraints**: *Minimum Length*: `1` | | `reference_id` | `string` | Optional | A client-specified ID to associate an entity in another system
with this order.
**Constraints**: *Maximum Length*: `40` | | `source` | [`Order Source`](/doc/models/order-source.md) | Optional | Represents the origination details of an order. | -| `customer_id` | `string` | Optional | The ID of the [customer](/doc/models/customer.md) associated with the order.
**Constraints**: *Maximum Length*: `191` | +| `customer_id` | `string` | Optional | The ID of the [customer](/doc/models/customer.md) associated with the order.

__IMPORTANT:__ You should specify a `customer_id` if you want the corresponding payment transactions
to be explicitly linked to the customer in the Seller Dashboard. If this field is omitted, the
`customer_id` assigned to any underlying `Payment` objects is ignored and might result in the
creation of new [instant profiles](https://developer.squareup.com/docs/customers-api/what-it-does#instant-profiles).
**Constraints**: *Maximum Length*: `191` | | `line_items` | [`List of Order Line Item`](/doc/models/order-line-item.md) | Optional | The line items included in the order. | | `taxes` | [`List of Order Line Item Tax`](/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. | | `discounts` | [`List of Order Line Item Discount`](/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. | @@ -73,7 +73,8 @@ itemization data. "volume_unit": "GENERIC_PINT", "weight_unit": "METRIC_KILOGRAM" }, - "precision": 199 + "precision": 199, + "catalog_version": 133 }, "note": "note5", "catalog_object_id": "catalog_object_id7" @@ -93,7 +94,8 @@ itemization data. "volume_unit": "GENERIC_QUART", "weight_unit": "METRIC_GRAM" }, - "precision": 200 + "precision": 200, + "catalog_version": 134 }, "note": "note6", "catalog_object_id": "catalog_object_id6" @@ -113,7 +115,8 @@ itemization data. "volume_unit": "GENERIC_GALLON", "weight_unit": "METRIC_MILLIGRAM" }, - "precision": 201 + "precision": 201, + "catalog_version": 135 }, "note": "note7", "catalog_object_id": "catalog_object_id5" diff --git a/doc/models/payment.md b/doc/models/payment.md index 58ed6c2f..b5e7ebc9 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -25,11 +25,12 @@ Represents a payment processed by the Square API. | `delay_duration` | `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. | | `delay_action` | `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`. | | `delayed_until` | `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. | -| `source_type` | `string` | Optional | The source type for this payment.

Current values include `CARD`, `BANK_ACCOUNT`, `CASH`, or `EXTERNAL`.
**Constraints**: *Maximum Length*: `50` | +| `source_type` | `string` | Optional | The source type for this payment.

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, or `EXTERNAL`.
**Constraints**: *Maximum Length*: `50` | | `card_details` | [`Card Payment Details`](/doc/models/card-payment-details.md) | Optional | Reflects the current status of a card payment. Contains only non-confidential information. | | `cash_details` | [`Cash Payment Details`](/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). | | `bank_account_details` | [`Bank Account Payment Details`](/doc/models/bank-account-payment-details.md) | Optional | Additional details about BANK_ACCOUNT type payments. | | `external_details` | [`External Payment Details`](/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). | +| `wallet_details` | [`Digital Wallet Details`](/doc/models/digital-wallet-details.md) | Optional | Additional details about `WALLET` type payments. Contains only non-confidential information. | | `location_id` | `string` | Optional | The ID of the location associated with the payment.
**Constraints**: *Maximum Length*: `50` | | `order_id` | `string` | Optional | The ID of the order associated with the payment.
**Constraints**: *Maximum Length*: `192` | | `reference_id` | `string` | Optional | An optional ID that associates the payment with an entity in
another system.
**Constraints**: *Maximum Length*: `40` | diff --git a/doc/models/retrieve-employee-response.md b/doc/models/retrieve-employee-response.md index fbd43768..f8ca381c 100644 --- a/doc/models/retrieve-employee-response.md +++ b/doc/models/retrieve-employee-response.md @@ -26,19 +26,19 @@ "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "UNPROCESSABLE_ENTITY", + "code": "NOT_ACCEPTABLE", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "RATE_LIMITED", + "code": "REQUEST_TIMEOUT", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "NOT_IMPLEMENTED", + "code": "CONFLICT", "detail": "detail3", "field": "field1" } diff --git a/doc/models/retrieve-inventory-transfer-response.md b/doc/models/retrieve-inventory-transfer-response.md new file mode 100644 index 00000000..420b0022 --- /dev/null +++ b/doc/models/retrieve-inventory-transfer-response.md @@ -0,0 +1,40 @@ + +# Retrieve Inventory Transfer Response + +## Structure + +`Retrieve Inventory Transfer Response` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`List of Error`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `transfer` | [`Inventory Transfer`](/doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | + +## Example (as JSON) + +```json +{ + "errors": [], + "transfer": { + "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI", + "catalog_object_type": "ITEM_VARIATION", + "created_at": "2016-11-17T13:02:15.142Z", + "employee_id": "LRK57NSQ5X7PUD05", + "from_location_id": "C6W5YS5QM06F5", + "id": "UDMOEO78BG6GYWA2XDRYX3KB", + "occurred_at": "2016-11-16T25:44:22.837Z", + "quantity": "7", + "reference_id": "4a366069-4096-47a2-99a5-0084ac879509", + "source": { + "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0", + "name": "Square Point of Sale 4.37", + "product": "SQUARE_POS" + }, + "state": "IN_STOCK", + "to_location_id": "59TNP9SA8VGDA" + } +} +``` + diff --git a/doc/models/retrieve-loyalty-account-response.md b/doc/models/retrieve-loyalty-account-response.md index 4788e71d..9137839f 100644 --- a/doc/models/retrieve-loyalty-account-response.md +++ b/doc/models/retrieve-loyalty-account-response.md @@ -12,7 +12,7 @@ A response that includes the loyalty account. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `errors` | [`List of Error`](/doc/models/error.md) | Optional | Any errors that occurred during the request. | -| `loyalty_account` | [`Loyalty Account`](/doc/models/loyalty-account.md) | Optional | Describes a loyalty account. For more information, see
[Loyalty Overview](https://developer.squareup.com/docs/loyalty/overview). | +| `loyalty_account` | [`Loyalty Account`](/doc/models/loyalty-account.md) | Optional | Describes a loyalty account. For more information, see
[Manage Loyalty Accounts Using the Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview). | ## Example (as JSON) diff --git a/doc/models/search-catalog-items-response.md b/doc/models/search-catalog-items-response.md index bd5d0a52..9b8a4603 100644 --- a/doc/models/search-catalog-items-response.md +++ b/doc/models/search-catalog-items-response.md @@ -23,19 +23,19 @@ Defines the response body returned from the [SearchCatalogItems](/doc/api/catalo "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "UNPROCESSABLE_ENTITY", + "code": "NOT_ACCEPTABLE", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "RATE_LIMITED", + "code": "REQUEST_TIMEOUT", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "NOT_IMPLEMENTED", + "code": "CONFLICT", "detail": "detail3", "field": "field1" } diff --git a/doc/models/search-invoices-response.md b/doc/models/search-invoices-response.md index 27e9d30c..463fc31c 100644 --- a/doc/models/search-invoices-response.md +++ b/doc/models/search-invoices-response.md @@ -19,73 +19,135 @@ Describes a `SearchInvoices` response. ```json { - "cursor": "CURSOR", + "cursor": "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", "invoices": [ { - "invoice": { - "accepted_payment_methods": { - "bank_account": false, - "card": true, - "square_gift_card": false + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": false + }, + "created_at": "2020-06-18T17:45:13Z", + "custom_fields": [ + { + "label": "Event Reference Number", + "placement": "ABOVE_LINE_ITEMS", + "value": "Ref. #1234" }, - "created_at": "2020-06-18T17:45:13Z", - "custom_fields": [ - { - "label": "Event Reference Number", - "placement": "ABOVE_LINE_ITEMS", - "value": "Ref. #1234" + { + "label": "Terms of Service", + "placement": "BELOW_LINE_ITEMS", + "value": "The terms of service are..." + } + ], + "delivery_method": "EMAIL", + "description": "We appreciate your business!", + "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "invoice_number": "inv-100", + "location_id": "ES0RJRZYEC39A", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "payment_requests": [ + { + "automatic_payment_source": "NONE", + "computed_amount_money": { + "amount": 10000, + "currency": "USD" }, - { - "label": "Terms of Service", - "placement": "BELOW_LINE_ITEMS", - "value": "The terms of service are..." - } - ], - "delivery_method": "EMAIL", - "description": "We appreciate your business!", - "id": "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - "invoice_number": "inv-100", - "location_id": "ES0RJRZYEC39A", - "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", - "payment_requests": [ - { - "automatic_payment_source": "NONE", - "computed_amount_money": { - "amount": 10000, - "currency": "USD" - }, - "due_date": "2030-01-24", - "reminders": [ - { - "message": "Your invoice is due tomorrow", - "relative_scheduled_days": -1, - "status": "PENDING", - "uid": "beebd363-e47f-4075-8785-c235aaa7df11" - } - ], - "request_type": "BALANCE", - "tipping_enabled": true, - "total_completed_amount_money": { - "amount": 0, - "currency": "USD" - }, - "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" - } - ], - "primary_recipient": { - "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", - "email_address": "Amelia.Earhart@example.com", - "family_name": "Earhart", - "given_name": "Amelia", - "phone_number": "1-212-555-4240" + "due_date": "2030-01-24", + "reminders": [ + { + "message": "Your invoice is due tomorrow", + "relative_scheduled_days": -1, + "status": "PENDING", + "uid": "beebd363-e47f-4075-8785-c235aaa7df11" + } + ], + "request_type": "BALANCE", + "tipping_enabled": true, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "scheduled_at": "2030-01-13T10:00:00Z", + "status": "DRAFT", + "timezone": "America/Los_Angeles", + "title": "Event Planning Services", + "updated_at": "2020-06-18T17:45:13Z", + "version": 0 + }, + { + "accepted_payment_methods": { + "bank_account": false, + "card": true, + "square_gift_card": true + }, + "created_at": "2021-01-23T15:29:12Z", + "delivery_method": "EMAIL", + "id": "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", + "invoice_number": "inv-455", + "location_id": "ES0RJRZYEC39A", + "next_payment_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "order_id": "a65jnS8NXbfprvGJzY9F4fQTuaB", + "payment_requests": [ + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "due_date": "2021-01-23", + "percentage_requested": "25", + "request_type": "DEPOSIT", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 1000, + "currency": "USD" + }, + "uid": "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176" }, - "scheduled_at": "2030-01-13T10:00:00Z", - "status": "DRAFT", - "timezone": "America/Los_Angeles", - "title": "Event Planning Services", - "updated_at": "2020-06-18T17:45:13Z", - "version": 0 - } + { + "automatic_payment_source": "CARD_ON_FILE", + "card_id": "ccof:IkWfpLj4tNHMyFii3GB", + "computed_amount_money": { + "amount": 3000, + "currency": "USD" + }, + "due_date": "2021-06-15", + "request_type": "BALANCE", + "tipping_enabled": false, + "total_completed_amount_money": { + "amount": 0, + "currency": "USD" + }, + "uid": "120c5e18-4f80-4f6b-b159-774cb9bf8f99" + } + ], + "primary_recipient": { + "customer_id": "JDKYHBWT1D4F8MFH63DBMEN8Y4", + "email_address": "Amelia.Earhart@example.com", + "family_name": "Earhart", + "given_name": "Amelia", + "phone_number": "1-212-555-4240" + }, + "public_url": "https://squareup.com/pay-invoice/h9sfsfTGTSnYEhISUDBhEQ", + "status": "PARTIALLY_PAID", + "timezone": "America/Los_Angeles", + "updated_at": "2021-01-23T15:29:56Z", + "version": 3 } ] } diff --git a/doc/models/snippet-response.md b/doc/models/snippet-response.md index febfdc9a..4b2c9a17 100644 --- a/doc/models/snippet-response.md +++ b/doc/models/snippet-response.md @@ -19,19 +19,19 @@ "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "UNPROCESSABLE_ENTITY", + "code": "NOT_ACCEPTABLE", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "RATE_LIMITED", + "code": "REQUEST_TIMEOUT", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "NOT_IMPLEMENTED", + "code": "CONFLICT", "detail": "detail3", "field": "field1" } diff --git a/doc/models/tax-ids.md b/doc/models/tax-ids.md new file mode 100644 index 00000000..df2fa900 --- /dev/null +++ b/doc/models/tax-ids.md @@ -0,0 +1,27 @@ + +# Tax Ids + +The tax IDs that a Location is operating under. + +## Structure + +`Tax Ids` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `eu_vat` | `string` | Optional | The EU VAT number for this location. For example, "IE3426675K".
If the EU VAT number is present, it is well-formed and has been
validated with VIES, the VAT Information Exchange System. | +| `fr_siret` | `string` | Optional | The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements)
number is a 14 digits code issued by the French INSEE. For example, "39922799000021". | +| `fr_naf` | `string` | Optional | The French government uses the NAF (Nomenclature des Activités Françaises) to display and
track economic statistical data. This is also called the APE (Activite Principale de l’Entreprise) code.
For example, 6910Z. | + +## Example (as JSON) + +```json +{ + "eu_vat": "eu_vat2", + "fr_siret": "fr_siret0", + "fr_naf": "fr_naf0" +} +``` + diff --git a/doc/models/update-order-request.md b/doc/models/update-order-request.md index c35eed77..2cc6d23f 100644 --- a/doc/models/update-order-request.md +++ b/doc/models/update-order-request.md @@ -44,7 +44,8 @@ Defines the fields that are included in requests to the "volume_unit": "GENERIC_FLUID_OUNCE", "weight_unit": "METRIC_KILOGRAM" }, - "precision": 201 + "precision": 201, + "catalog_version": 135 }, "note": "note3", "catalog_object_id": "catalog_object_id5" diff --git a/doc/models/v1-list-orders-response.md b/doc/models/v1-list-orders-response.md index 394a1f53..58c7004f 100644 --- a/doc/models/v1-list-orders-response.md +++ b/doc/models/v1-list-orders-response.md @@ -19,20 +19,20 @@ { "errors": [ { - "category": "PAYMENT_METHOD_ERROR", - "code": "REFUND_DECLINED", + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_CONTENT_TYPE", "detail": "detail8", "field": "field6" }, { - "category": "REFUND_ERROR", - "code": "INVALID_CARD_DATA", + "category": "API_ERROR", + "code": "INVALID_FORM_VALUE", "detail": "detail9", "field": "field7" }, { - "category": "API_ERROR", - "code": "SOURCE_USED", + "category": "AUTHENTICATION_ERROR", + "code": "CUSTOMER_NOT_FOUND", "detail": "detail0", "field": "field8" } @@ -45,8 +45,8 @@ { "errors": [ { - "category": "REFUND_ERROR", - "code": "INVALID_CARD_DATA", + "category": "API_ERROR", + "code": "INVALID_FORM_VALUE", "detail": "detail9", "field": "field7" } diff --git a/doc/models/v1-order.md b/doc/models/v1-order.md index 5067e2eb..6427d68e 100644 --- a/doc/models/v1-order.md +++ b/doc/models/v1-order.md @@ -44,19 +44,19 @@ V1Order "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "UNPROCESSABLE_ENTITY", + "code": "NOT_ACCEPTABLE", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "RATE_LIMITED", + "code": "REQUEST_TIMEOUT", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "NOT_IMPLEMENTED", + "code": "CONFLICT", "detail": "detail3", "field": "field1" } diff --git a/doc/models/v1-payment-tax.md b/doc/models/v1-payment-tax.md index 9ce2dcba..869d42e8 100644 --- a/doc/models/v1-payment-tax.md +++ b/doc/models/v1-payment-tax.md @@ -25,19 +25,19 @@ V1PaymentTax "errors": [ { "category": "AUTHENTICATION_ERROR", - "code": "UNPROCESSABLE_ENTITY", + "code": "NOT_ACCEPTABLE", "detail": "detail1", "field": "field9" }, { "category": "INVALID_REQUEST_ERROR", - "code": "RATE_LIMITED", + "code": "REQUEST_TIMEOUT", "detail": "detail2", "field": "field0" }, { "category": "RATE_LIMIT_ERROR", - "code": "NOT_IMPLEMENTED", + "code": "CONFLICT", "detail": "detail3", "field": "field1" } diff --git a/setup.py b/setup.py index 8629ed99..1e6dcbb9 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name='squareup', - version='12.0.0.20210616', + version='13.0.0.20210721', description='Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.', long_description=long_description, long_description_content_type="text/markdown", diff --git a/square/api/base_api.py b/square/api/base_api.py index f9a992e7..f4fd6a7d 100644 --- a/square/api/base_api.py +++ b/square/api/base_api.py @@ -21,7 +21,7 @@ class BaseApi(object): def global_headers(self): return { - 'user-agent': 'Square-Python-SDK/12.0.0.20210616', + 'user-agent': 'Square-Python-SDK/13.0.0.20210721', 'Square-Version': self.config.square_version } diff --git a/square/api/inventory_api.py b/square/api/inventory_api.py index a4433a2b..62cf99af 100644 --- a/square/api/inventory_api.py +++ b/square/api/inventory_api.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +from deprecation import deprecated from square.api_helper import APIHelper from square.http.api_response import ApiResponse from square.api.base_api import BaseApi @@ -13,9 +14,62 @@ class InventoryApi(BaseApi): def __init__(self, config, call_back=None): super(InventoryApi, self).__init__(config, call_back) + @deprecated() + def deprecated_retrieve_inventory_adjustment(self, + adjustment_id): + """Does a GET request to /v2/inventory/adjustment/{adjustment_id}. + + Deprecated version of + [RetrieveInventoryAdjustment]($e/Inventory/RetrieveInventoryAdjustment) + after the endpoint URL + is updated to conform to the standard convention. + + Args: + adjustment_id (string): ID of the + [InventoryAdjustment]($m/InventoryAdjustment) to retrieve. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + # Prepare query URL + _url_path = '/v2/inventory/adjustment/{adjustment_id}' + _url_path = APIHelper.append_url_with_template_parameters(_url_path, { + 'adjustment_id': {'value': adjustment_id, 'encode': True} + }) + _query_builder = self.config.get_base_uri() + _query_builder += _url_path + _query_url = APIHelper.clean_url(_query_builder) + + # Prepare headers + _headers = { + 'accept': 'application/json' + } + + # Prepare and execute request + _request = self.config.http_client.get(_query_url, headers=_headers) + OAuth2.apply(self.config, _request) + _response = self.execute_request(_request) + + decoded = APIHelper.json_deserialize(_response.text) + if type(decoded) is dict: + _errors = decoded.get('errors') + else: + _errors = None + _result = ApiResponse(_response, body=decoded, errors=_errors) + return _result + def retrieve_inventory_adjustment(self, adjustment_id): - """Does a GET request to /v2/inventory/adjustment/{adjustment_id}. + """Does a GET request to /v2/inventory/adjustments/{adjustment_id}. Returns the [InventoryAdjustment]($m/InventoryAdjustment) object with the provided `adjustment_id`. @@ -37,7 +91,7 @@ def retrieve_inventory_adjustment(self, """ # Prepare query URL - _url_path = '/v2/inventory/adjustment/{adjustment_id}' + _url_path = '/v2/inventory/adjustments/{adjustment_id}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 'adjustment_id': {'value': adjustment_id, 'encode': True} }) @@ -63,9 +117,165 @@ def retrieve_inventory_adjustment(self, _result = ApiResponse(_response, body=decoded, errors=_errors) return _result + @deprecated() + def deprecated_batch_change_inventory(self, + body): + """Does a POST request to /v2/inventory/batch-change. + + Deprecated version of + [BatchChangeInventory]($e/Inventory/BatchChangeInventory) after the + endpoint URL + is updated to conform to the standard convention. + + Args: + body (BatchChangeInventoryRequest): An object containing the + fields to POST for the request. See the corresponding object + definition for field details. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + # Prepare query URL + _url_path = '/v2/inventory/batch-change' + _query_builder = self.config.get_base_uri() + _query_builder += _url_path + _query_url = APIHelper.clean_url(_query_builder) + + # Prepare headers + _headers = { + 'accept': 'application/json', + 'content-type': 'application/json; charset=utf-8' + } + + # Prepare and execute request + _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) + OAuth2.apply(self.config, _request) + _response = self.execute_request(_request) + + decoded = APIHelper.json_deserialize(_response.text) + if type(decoded) is dict: + _errors = decoded.get('errors') + else: + _errors = None + _result = ApiResponse(_response, body=decoded, errors=_errors) + return _result + + @deprecated() + def deprecated_batch_retrieve_inventory_changes(self, + body): + """Does a POST request to /v2/inventory/batch-retrieve-changes. + + Deprecated version of + [BatchRetrieveInventoryChanges]($e/Inventory/BatchRetrieveInventoryChan + ges) after the endpoint URL + is updated to conform to the standard convention. + + Args: + body (BatchRetrieveInventoryChangesRequest): An object containing + the fields to POST for the request. See the corresponding + object definition for field details. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + # Prepare query URL + _url_path = '/v2/inventory/batch-retrieve-changes' + _query_builder = self.config.get_base_uri() + _query_builder += _url_path + _query_url = APIHelper.clean_url(_query_builder) + + # Prepare headers + _headers = { + 'accept': 'application/json', + 'content-type': 'application/json; charset=utf-8' + } + + # Prepare and execute request + _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) + OAuth2.apply(self.config, _request) + _response = self.execute_request(_request) + + decoded = APIHelper.json_deserialize(_response.text) + if type(decoded) is dict: + _errors = decoded.get('errors') + else: + _errors = None + _result = ApiResponse(_response, body=decoded, errors=_errors) + return _result + + @deprecated() + def deprecated_batch_retrieve_inventory_counts(self, + body): + """Does a POST request to /v2/inventory/batch-retrieve-counts. + + Deprecated version of + [BatchRetrieveInventoryCounts]($e/Inventory/BatchRetrieveInventoryCount + s) after the endpoint URL + is updated to conform to the standard convention. + + Args: + body (BatchRetrieveInventoryCountsRequest): An object containing + the fields to POST for the request. See the corresponding + object definition for field details. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + # Prepare query URL + _url_path = '/v2/inventory/batch-retrieve-counts' + _query_builder = self.config.get_base_uri() + _query_builder += _url_path + _query_url = APIHelper.clean_url(_query_builder) + + # Prepare headers + _headers = { + 'accept': 'application/json', + 'content-type': 'application/json; charset=utf-8' + } + + # Prepare and execute request + _request = self.config.http_client.post(_query_url, headers=_headers, parameters=APIHelper.json_serialize(body)) + OAuth2.apply(self.config, _request) + _response = self.execute_request(_request) + + decoded = APIHelper.json_deserialize(_response.text) + if type(decoded) is dict: + _errors = decoded.get('errors') + else: + _errors = None + _result = ApiResponse(_response, body=decoded, errors=_errors) + return _result + def batch_change_inventory(self, body): - """Does a POST request to /v2/inventory/batch-change. + """Does a POST request to /v2/inventory/changes/batch-create. Applies adjustments and counts to the provided item quantities. On success: returns the current calculated counts for all objects @@ -90,7 +300,7 @@ def batch_change_inventory(self, """ # Prepare query URL - _url_path = '/v2/inventory/batch-change' + _url_path = '/v2/inventory/changes/batch-create' _query_builder = self.config.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) @@ -116,7 +326,7 @@ def batch_change_inventory(self, def batch_retrieve_inventory_changes(self, body): - """Does a POST request to /v2/inventory/batch-retrieve-changes. + """Does a POST request to /v2/inventory/changes/batch-retrieve. Returns historical physical counts and adjustments based on the provided filter criteria. @@ -144,7 +354,7 @@ def batch_retrieve_inventory_changes(self, """ # Prepare query URL - _url_path = '/v2/inventory/batch-retrieve-changes' + _url_path = '/v2/inventory/changes/batch-retrieve' _query_builder = self.config.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) @@ -170,7 +380,7 @@ def batch_retrieve_inventory_changes(self, def batch_retrieve_inventory_counts(self, body): - """Does a POST request to /v2/inventory/batch-retrieve-counts. + """Does a POST request to /v2/inventory/counts/batch-retrieve. Returns current counts for the provided [CatalogObject]($m/CatalogObject)s at the requested @@ -203,7 +413,7 @@ def batch_retrieve_inventory_counts(self, """ # Prepare query URL - _url_path = '/v2/inventory/batch-retrieve-counts' + _url_path = '/v2/inventory/counts/batch-retrieve' _query_builder = self.config.get_base_uri() _query_builder += _url_path _query_url = APIHelper.clean_url(_query_builder) @@ -227,9 +437,63 @@ def batch_retrieve_inventory_counts(self, _result = ApiResponse(_response, body=decoded, errors=_errors) return _result + @deprecated() + def deprecated_retrieve_inventory_physical_count(self, + physical_count_id): + """Does a GET request to /v2/inventory/physical-count/{physical_count_id}. + + Deprecated version of + [RetrieveInventoryPhysicalCount]($e/Inventory/RetrieveInventoryPhysical + Count) after the endpoint URL + is updated to conform to the standard convention. + + Args: + physical_count_id (string): ID of the + [InventoryPhysicalCount]($m/InventoryPhysicalCount) to + retrieve. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + # Prepare query URL + _url_path = '/v2/inventory/physical-count/{physical_count_id}' + _url_path = APIHelper.append_url_with_template_parameters(_url_path, { + 'physical_count_id': {'value': physical_count_id, 'encode': True} + }) + _query_builder = self.config.get_base_uri() + _query_builder += _url_path + _query_url = APIHelper.clean_url(_query_builder) + + # Prepare headers + _headers = { + 'accept': 'application/json' + } + + # Prepare and execute request + _request = self.config.http_client.get(_query_url, headers=_headers) + OAuth2.apply(self.config, _request) + _response = self.execute_request(_request) + + decoded = APIHelper.json_deserialize(_response.text) + if type(decoded) is dict: + _errors = decoded.get('errors') + else: + _errors = None + _result = ApiResponse(_response, body=decoded, errors=_errors) + return _result + def retrieve_inventory_physical_count(self, physical_count_id): - """Does a GET request to /v2/inventory/physical-count/{physical_count_id}. + """Does a GET request to /v2/inventory/physical-counts/{physical_count_id}. Returns the [InventoryPhysicalCount]($m/InventoryPhysicalCount) object with the provided `physical_count_id`. @@ -252,7 +516,7 @@ def retrieve_inventory_physical_count(self, """ # Prepare query URL - _url_path = '/v2/inventory/physical-count/{physical_count_id}' + _url_path = '/v2/inventory/physical-counts/{physical_count_id}' _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 'physical_count_id': {'value': physical_count_id, 'encode': True} }) @@ -278,6 +542,56 @@ def retrieve_inventory_physical_count(self, _result = ApiResponse(_response, body=decoded, errors=_errors) return _result + def retrieve_inventory_transfer(self, + transfer_id): + """Does a GET request to /v2/inventory/transfers/{transfer_id}. + + Returns the [InventoryTransfer]($m/InventoryTransfer) object + with the provided `transfer_id`. + + Args: + transfer_id (string): ID of the + [InventoryTransfer]($m/InventoryTransfer) to retrieve. + + Returns: + ApiResponse: An object with the response value as well as other + useful information such as status codes and headers. Success + + Raises: + APIException: When an error occurs while fetching the data from + the remote API. This exception includes the HTTP Response + code, an error message, and the HTTP body that was received in + the request. + + """ + + # Prepare query URL + _url_path = '/v2/inventory/transfers/{transfer_id}' + _url_path = APIHelper.append_url_with_template_parameters(_url_path, { + 'transfer_id': {'value': transfer_id, 'encode': True} + }) + _query_builder = self.config.get_base_uri() + _query_builder += _url_path + _query_url = APIHelper.clean_url(_query_builder) + + # Prepare headers + _headers = { + 'accept': 'application/json' + } + + # Prepare and execute request + _request = self.config.http_client.get(_query_url, headers=_headers) + OAuth2.apply(self.config, _request) + _response = self.execute_request(_request) + + decoded = APIHelper.json_deserialize(_response.text) + if type(decoded) is dict: + _errors = decoded.get('errors') + else: + _errors = None + _result = ApiResponse(_response, body=decoded, errors=_errors) + return _result + def retrieve_inventory_count(self, catalog_object_id, location_ids=None, @@ -348,6 +662,7 @@ def retrieve_inventory_count(self, _result = ApiResponse(_response, body=decoded, errors=_errors) return _result + @deprecated() def retrieve_inventory_changes(self, catalog_object_id, location_ids=None, @@ -356,7 +671,12 @@ def retrieve_inventory_changes(self, Returns a set of physical counts and inventory adjustments for the provided [CatalogObject]($m/CatalogObject) at the requested - [Location]($m/Location)s. + [Location]($m/Location)s. + You can achieve the same result by calling + [BatchRetrieveInventoryChanges]($e/Inventory/BatchRetrieveInventoryChan + ges) + and having the `catalog_object_ids` list contain a single element of + the `CatalogObject` ID. Results are paginated and sorted in descending order according to their `occurred_at` timestamp (newest first). diff --git a/square/api/loyalty_api.py b/square/api/loyalty_api.py index 9d25b129..de0a7641 100644 --- a/square/api/loyalty_api.py +++ b/square/api/loyalty_api.py @@ -177,12 +177,16 @@ def accumulate_loyalty_points(self, account. - If you are not using the Orders API to manage orders, you first perform a client-side computation to compute the points. - For spend-based and visit-based programs, you can call + For spend-based and visit-based programs, you can first call [CalculateLoyaltyPoints]($e/Loyalty/CalculateLoyaltyPoints) to compute - the points. For more information, - see [Loyalty Program - Overview](https://developer.squareup.com/docs/loyalty/overview). - You then provide the points in a request to this endpoint. + the points + that you provide to this endpoint. + __Note:__ The country of the seller's Square account determines + whether tax is included in the purchase amount when accruing points + for spend-based and visit-based programs. + For more information, see [Availability of Square + Loyalty](https://developer.squareup.com/docs/loyalty-api/overview#loyal + ty-market-availability). Args: account_id (string): The [loyalty account]($m/LoyaltyAccount) ID @@ -465,6 +469,12 @@ def calculate_loyalty_points(self, An application might call this endpoint to show the points that a buyer can earn with the specific purchase. + __Note:__ The country of the seller's Square account determines + whether tax is included in the purchase amount when accruing points + for spend-based and visit-based programs. + For more information, see [Availability of Square + Loyalty](https://developer.squareup.com/docs/loyalty-api/overview#loyal + ty-market-availability). Args: program_id (string): The [loyalty program]($m/LoyaltyProgram) ID, diff --git a/square/client.py b/square/client.py index 2f12b2c0..57c3ce98 100644 --- a/square/client.py +++ b/square/client.py @@ -42,11 +42,11 @@ class Client(object): @staticmethod def sdk_version(): - return '12.0.0.20210616' + return '13.0.0.20210721' @staticmethod def square_version(): - return '2021-06-16' + return '2021-07-21' @lazy_property def mobile_authorization(self): @@ -188,7 +188,7 @@ def __init__(self, timeout=60, max_retries=0, backoff_factor=2, retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods=['GET', 'PUT'], environment='production', custom_url='https://connect.squareup.com', - square_version='2021-06-16', access_token='TODO: Replace', + square_version='2021-07-21', access_token='TODO: Replace', additional_headers={}, config=None): if config is None: self.config = Configuration(timeout=timeout, diff --git a/square/configuration.py b/square/configuration.py index 7664f33e..9f15b7a8 100644 --- a/square/configuration.py +++ b/square/configuration.py @@ -57,7 +57,7 @@ def __init__( self, timeout=60, max_retries=0, backoff_factor=2, retry_statuses=[408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods=['GET', 'PUT'], environment='production', - custom_url='https://connect.squareup.com', square_version='2021-06-16', + custom_url='https://connect.squareup.com', square_version='2021-07-21', access_token='TODO: Replace', additional_headers={} ): # The value to use for connection timeout