Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #123 from square/release/6.20201216.0
Browse files Browse the repository at this point in the history
Release 6.20201216.0
  • Loading branch information
mohsin-sq authored Dec 16, 2020
2 parents b308d7b + 8e36f15 commit 3c12c06
Show file tree
Hide file tree
Showing 204 changed files with 2,801 additions and 2,826 deletions.
51 changes: 51 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Change Log

## Version 6.20201216.0 (2020-12-16T00:00)
## Existing API updates

**Orders API:**
* [OrderLineItemPricingBlocklists.](https://developer.squareup.com/reference/square_2020_12_16/objects/OrderLineItemPricingBlocklists) You can explicitly specify taxes and discounts in an order or automatically apply preconfigured taxes and discounts to an order. In addition, you can now block applying these taxes and discounts to a specific [OrderLineItem](https://developer.squareup.com/reference/square_2020_12_16/objects/OrderLineItem) in an [order](https://developer.squareup.com/reference/square_2020_12_16/objects/Order). You add the `pricing_blocklists` attribute to individual line items and specify the `blocked_discounts` and `blocked_taxes` that you do not want to apply. For more information, see [Apply Taxes and Discounts.](orders-api/apply-taxes-and-discounts) For example walkthroughs, see [Automatically Apply Discounts](orders-api/apply-taxes-and-discounts/auto-apply-discounts) and [Automatically Apply Taxes.](orders-api/apply-taxes-and-discounts/auto-apply-taxes)
* [OrderPricingOptions](https://developer.squareup.com/reference/square_2020_12_16/objects/OrderPricingOptions). Previously, the `pricing_options` field in an [order](https://developer.squareup.com/reference/square_2020_12_16/objects/OrderPricingOptions) supported only `auto_apply_discounts` to enable the automatic application of preconfigured discounts. Now it also supports `auto_apply_taxes` to enable the automatic application of preconfigured taxes. For more information, see [Automatically apply preconfigured catalog taxes or discounts.](orders-api/apply-taxes-and-discounts#automatically-apply-preconfigured-catalog-taxes-or-discounts)

* [OrderLineItemTax](https://developer.squareup.com/reference/square_2020_12_16/objects/OrderLineItemTax). It now includes the new `auto_applied` field. It indicates whether the tax was automatically applied using a preconfigured [CatalogTax](https://developer.squareup.com/reference/square_2020_12_16/objects/CatalogTax).


* **Bookings API:**
* The [CancelBooking](https://developer.squareup.com/reference/square_2020_12_16/bookings-api/cancel-booking) endpoint supports canceling an accepted or pending booking.
* The [booking.created](https://developer.squareup.com/reference/square_2020_12_16/webhooks/booking.created) webhook event notifies when a new booking is created by calling the [CreateBooking](https://developer.squareup.com/reference/square_2020_12_16/bookings-api/cancel-booking) endpoint.
* The [booking.updated](https://developer.squareup.com/reference/square_2020_12_16/webhooks/booking.updated) webhook event notifies when an existing booking is updated.

* **Catalog API:**
* [ListCatalog](https://developer.squareup.com/reference/square_2020_12_16/catalog-api/list-catalog), [RetrieveCatalogObject](https://developer.squareup.com/reference/square_2020_12_16/catalog-api/retrieve-catalog-object), and [BatchRetrieveCatalogObjects](https://developer.squareup.com/reference/square_2020_12_16/catalog-api/batch-retrieve-catalog-objects) now support the `catalog_version` filter to return catalog objects of the specified version.

* **Customers API:**
* [SearchCustomers](https://developer.squareup.com/reference/square_2020_12_16/customers-api/search-customers) endpoint. The `email_address`, `group_ids`, `phone_number`, and `reference_id` query filters are now generally available (GA).
* The [Customer Groups](https://developer.squareup.com/reference/square_2020_12_16/customer-groups-api) API is now GA.
* The [Customer Segments](https://developer.squareup.com/reference/square_2020_12_16/customer-segments-api) API is now GA.


* **Invoices API:** (beta)
* [Invoice](https://developer.squareup.com/reference/square_2020_12_16/objects/Invoice) object. Added the `custom_fields` field, which contains up to two customer-facing, seller-defined fields to display on the invoice. For more information, see [Custom fields.](https://developer.squareup.com/docs/invoices-api/overview#custom-fields)
As part of this change, the following objects are added:
* [InvoiceCustomField](https://developer.squareup.com/reference/square_2020_12_16/objects/InvoiceCustomField) object
* [InvoiceCustomFieldPlacement](https://developer.squareup.com/reference/square_2020_12_16/enums/InvoiceCustomFieldPlacement) enum
* [InvoiceRequestMethod](https://developer.squareup.com/reference/square_2020_12_16/enums/InvoiceRequestMethod) enum. Added the read-only CHARGE_BANK_ON_FILE value, which represents a bank transfer automatic payment method for a recurring invoice.


* **Loyalty API:** (beta)
* [LoyaltyProgramRewardTier](https://developer.squareup.com/reference/square_2020_12_16/objects/LoyaltyProgramRewardTier) object. The `definition` field in this type is deprecated and replaced by the new `pricing_rule_reference` field. You can use `pricing_rule_reference` fields to retrieve catalog objects that define the discount details for the reward tier. For more information, see [Get discount details for a reward tier.](https://developer.squareup.com/docs/loyalty-api/overview#get-discount-details-for-a-reward-tier)
As part of this change, the following APIs are deprecated:
* [LoyaltyProgramRewardDefinition](https://developer.squareup.com/reference/square_2020_12_16/objects/LoyaltyProgramRewardDefinition) object
* [LoyaltyProgramRewardDefinitionScope](https://developer.squareup.com/reference/square_2020_12_16/enums/LoyaltyProgramRewardDefinitionScope) enum
* [LoyaltyProgramRewardDefinitionType](https://developer.squareup.com/reference/square_2020_12_16/enums/LoyaltyProgramRewardDefinitionType) enum

## New SDK release
* **Square Node.js SDK:**

The new [Square Node.js SDK](https://github.com/square/square-nodejs-sdk) is now GA and replaces the deprecated Connect Node.js SDK. For migration information, see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md)


## Documentation updates

* [Get Right-Sized Permissions with Down-Scoped OAuth Tokens.](https://developer.squareup.com/docs/oauth-api/cookbook/downscoped-access) This new OAuth API topic shows how to get an additional reduced-scope OAuth token with a 24-hour expiration by using the refresh token from the Square account authorization OAuth flow.



## Version 5.20201118.0 (2020-11-18T00:00)
## New API releases

Expand Down
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)
==================

## NOTICE: The Square Connect Node.js SDK is deprecated and will be replaced by [square/square-nodejs-sdk] (currently in beta)
This Square Connect Node.js SDK is deprecated. The SDK will enter a security maintenance phase in Q4 2020 and will be RETIRED (EOL) in Q2 2021. In the security maintenance phase, the SDK will continue to receive support and security patches but will no longer receive bug fixes or product updates. Once it is retired, support and security patches will no longer be available.
## NOTICE: The Square Connect Node.js SDK is deprecated and replaced by [square/square-nodejs-sdk]
This Square Connect Node.js SDK is deprecated. This SDK entered security maintenance phase on 2020-12-16 and will be RETIRED (EOL) in Q2, 2021. In the security maintenance phase, this SDK will continue to receive support and security patches but will no longer receive bug fixes or API updates. Once it is retired, support and security patches will no longer be available.

The SDK itself will continue to work indefinitely until such time that the underlying APIs are retired, at which point portions of the SDK may stop functioning. For a full list of API retirement dates, please see our [Square API Lifecycle documentation].
This SDK itself will continue to work indefinitely until such time that the underlying APIs are retired, at which point portions of this SDK may stop functioning. For a full list of API retirement dates, please see our [Square API Lifecycle documentation].

| Security Maintenance | Retired (EOL) |
| -------- | -------- |
| Q4, 2020 | Q2, 2021 |
| December 16, 2020 | Q2, 2021 |

To ensure that you continue to receive API updates and SDK improvements, you should plan to migrate to the new [Square Node.js SDK] after it reaches GA. Please follow the instructions below to migrate to the new SDK.
To ensure that you continue to receive API updates and SDK improvements, you should migrate to the new [Square Node.js SDK]. Please follow the instructions below to migrate to the new SDK.

The old Connect SDK documentation is available under the [/docs] folder.

Expand All @@ -36,30 +36,14 @@ The old Connect SDK documentation is available under the [/docs] folder.

## Migrate to the Square Node.js SDK

Follow the instructions below to migrate your apps from this deprecated Connect Node.js SDK to the new [Square Node.js SDK] after it reaches GA. You need to install the new SDK and update your application code.
Follow the instructions below to migrate your apps from this deprecated Connect Node.js SDK to the new [Square Node.js SDK]. You need to install the new SDK and update your application code.

### Install the SDK
### Install the Square Node.js SDK

#### Option 1: Install the latest SDK version using npm
```sh
$ npm install square
```

#### Option 2: Install the latest SDK version using GitHub
First clone the repo:
```sh
git clone https://github.com/square/square-nodejs-sdk.git
```
Then, build the SDK:
```sh
$ cd square-nodejs-sdk
$ npm link
```
Lastly, run the following in the directory that contains your code:
```sh
$ npm link square
```

### Update your application code
Make the following changes to migrate your application code to the new Square SDK:

Expand Down Expand Up @@ -211,4 +195,4 @@ Please join us in our [Square developer community] if you have any questions or
[Square API Lifecycle documentation]: https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated-apis
[/docs]: https://github.com/square/connect-nodejs-sdk/tree/master/docs/README.md
[Square Connect API Examples]: https://github.com/square/connect-api-examples/tree/master/connect-examples/v2
[Square developer community]: https://squ.re/slack
[Square developer community]: https://squ.re/slack
2 changes: 1 addition & 1 deletion docs/AcceptDisputeRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Description
**Note: This model is in beta.**

Defines request parameters for the AcceptDispute endpoint.
Defines the request parameters for the `AcceptDispute` endpoint.

## Properties
Name | Type | Description | Notes
Expand Down
4 changes: 2 additions & 2 deletions docs/AcceptDisputeResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
### Description
**Note: This model is in beta.**

Defines fields in a AcceptDispute response.
Defines the fields in an `AcceptDispute` response.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errors** | [**[Error]**](Error.md) | Information on errors encountered during the request. | [optional]
**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional]
**dispute** | [**Dispute**](Dispute.md) | Details about the accepted dispute. | [optional]


1 change: 0 additions & 1 deletion docs/AddGroupToCustomerRequest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# SquareConnect.AddGroupToCustomerRequest

### Description
**Note: This model is in beta.**

Defines the fields that are included in the request body of a request to the [AddGroupToCustomer](#endpoint-addgrouptocustomer) endpoint.

Expand Down
1 change: 0 additions & 1 deletion docs/AddGroupToCustomerResponse.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# SquareConnect.AddGroupToCustomerResponse

### Description
**Note: This model is in beta.**

Defines the fields that are included in the response body of a request to the [AddGroupToCustomer](#endpoint-addgrouptocustomer) endpoint.

Expand Down
1 change: 1 addition & 0 deletions docs/BatchRetrieveCatalogObjectsRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**object_ids** | **[String]** | The IDs of the CatalogObjects to be retrieved. |
**include_related_objects** | **Boolean** | If `true`, the response will include additional objects that are related to the requested objects, as follows: If the `objects` field of the response contains a CatalogItem, its associated CatalogCategory objects, CatalogTax objects, CatalogImage objects and CatalogModifierLists will be returned in the `related_objects` field of the response. If the `objects` field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the `related_objects` field of the response. | [optional]
**catalog_version** | **Number** | The specific version of the catalog objects to be included in the response. This allows you to retrieve historical versions of objects. The specified version value is matched against the `CatalogObject`s' `version` attribute. | [optional] [beta]


53 changes: 53 additions & 0 deletions docs/BookingsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All URIs are relative to *https://connect.squareup.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**cancelBooking**](BookingsApi.md#cancelBooking) | **POST** /v2/bookings/{booking_id}/cancel | CancelBooking
[**createBooking**](BookingsApi.md#createBooking) | **POST** /v2/bookings | CreateBooking
[**listTeamMemberBookingProfiles**](BookingsApi.md#listTeamMemberBookingProfiles) | **GET** /v2/bookings/team-member-booking-profiles | ListTeamMemberBookingProfiles
[**retrieveBooking**](BookingsApi.md#retrieveBooking) | **GET** /v2/bookings/{booking_id} | RetrieveBooking
Expand All @@ -13,6 +14,58 @@ Method | HTTP request | Description
[**updateBooking**](BookingsApi.md#updateBooking) | **PUT** /v2/bookings/{booking_id} | UpdateBooking


<a name="cancelBooking"></a>
# **cancelBooking**
**Note: This endpoint is in beta.**
> CancelBookingResponse cancelBooking(bookingId, body)
CancelBooking

Cancels an existing booking.

### Example
```javascript
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.BookingsApi();

var bookingId = SquareConnect.BookingsApi.constructFromObject({}); // String | The ID of the `Booking` object representing the to-be-cancelled booking.

var body = SquareConnect.BookingsApi.constructFromObject({}); // CancelBookingRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.

apiInstance.cancelBooking(bookingId, body).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});

```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**bookingId** | **String**| The ID of the &#x60;Booking&#x60; object representing the to-be-cancelled booking. |
**body** | [**CancelBookingRequest**](CancelBookingRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |

### Return type

[**CancelBookingResponse**](CancelBookingResponse.md)

### Authorization

[oauth2](../README.md#oauth2)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

<a name="createBooking"></a>
# **createBooking**
**Note: This endpoint is in beta.**
Expand Down
2 changes: 1 addition & 1 deletion docs/BusinessAppointmentSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The service appointment settings, including where and how the service is provide
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**location_types** | [**[BusinessAppointmentSettingsBookingLocationType]**](BusinessAppointmentSettingssBookingLocationType.md) | Types of the location allowed for bookings. | [optional]
**location_types** | [**[BusinessAppointmentSettingsBookingLocationType]**](BusinessAppointmentSettingsBookingLocationType.md) | Types of the location allowed for bookings. | [optional]
**alignment_time** | [**BusinessAppointmentSettingsAlignmentTime**](BusinessAppointmentSettingsAlignmentTime.md) | The time unit of the service duration for bookings. | [optional]
**min_booking_lead_time_seconds** | **Number** | The minimum lead time in seconds before a service can be booked. Bookings must be created at least this far ahead of the booking&#39;s starting time. | [optional]
**max_booking_lead_time_seconds** | **Number** | The maximum lead time in seconds before a service can be booked. Bookings must be created at most this far ahead of the booking&#39;s starting time. | [optional]
Expand Down
14 changes: 14 additions & 0 deletions docs/CancelBookingRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SquareConnect.CancelBookingRequest

### Description
**Note: This model is in beta.**



## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**idempotency_key** | **String** | A unique key to make this request an idempotent operation. | [optional]
**booking_version** | **Number** | The revision number for the booking used for optimistic concurrency. | [optional]


14 changes: 14 additions & 0 deletions docs/CancelBookingResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SquareConnect.CancelBookingResponse

### Description
**Note: This model is in beta.**



## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**booking** | [**Booking**](Booking.md) | The booking that was cancelled. | [optional]
**errors** | [**[Error]**](Error.md) | Any errors that occurred during the request. | [optional]


Loading

0 comments on commit 3c12c06

Please sign in to comment.