Skip to content

Commit

Permalink
Merge pull request #136 from square/release/30.0.0
Browse files Browse the repository at this point in the history
Generated PR for Release: 30.0.0
  • Loading branch information
daphnechiu committed Aug 15, 2023
2 parents 2419cd7 + 87e55cd commit 73a7121
Show file tree
Hide file tree
Showing 430 changed files with 1,910 additions and 1,248 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ npm test

### Orders
* [Orders]
* [Order Custom Attributes]

### Subscriptions
* [Subscriptions]
Expand All @@ -104,10 +105,13 @@ npm test

### Bookings
* [Bookings]
* [Booking Custom Attributes]

### Business
* [Merchants]
* [Merchant Custom Attributes]
* [Locations]
* [Location Custom Attributes]
* [Devices]
* [Cash Drawers]

Expand Down Expand Up @@ -161,9 +165,13 @@ The following Square APIs are [deprecated](https://developer.squareup.com/docs/b
[Labor]: doc/api/labor.md
[Loyalty]: doc/api/loyalty.md
[Bookings]: doc/api/bookings.md
[Booking Custom Attributes]: doc/api/booking-custom-attributes.md
[Locations]: doc/api/locations.md
[Location Custom Attributes]: doc/api/location-custom-attributes.md
[Merchants]: doc/api/merchants.md
[Merchant Custom Attributes]: doc/api/merchant-custom-attributes.md
[Orders]: doc/api/orders.md
[Order Custom Attributes]: doc/api/order-custom-attributes.md
[Invoices]: doc/api/invoices.md
[Apple Pay]: doc/api/apple-pay.md
[Refunds]: doc/api/refunds.md
Expand Down
52 changes: 52 additions & 0 deletions doc/api/bookings.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const bookingsApi = client.bookingsApi;
* [List Bookings](../../doc/api/bookings.md#list-bookings)
* [Create Booking](../../doc/api/bookings.md#create-booking)
* [Search Availability](../../doc/api/bookings.md#search-availability)
* [Bulk Retrieve Bookings](../../doc/api/bookings.md#bulk-retrieve-bookings)
* [Retrieve Business Booking Profile](../../doc/api/bookings.md#retrieve-business-booking-profile)
* [List Team Member Booking Profiles](../../doc/api/bookings.md#list-team-member-booking-profiles)
* [Retrieve Team Member Booking Profile](../../doc/api/bookings.md#retrieve-team-member-booking-profile)
Expand All @@ -32,6 +33,7 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
async listBookings(
limit?: number,
cursor?: string,
customerId?: string,
teamMemberId?: string,
locationId?: string,
startAtMin?: string,
Expand All @@ -46,6 +48,7 @@ async listBookings(
| --- | --- | --- | --- |
| `limit` | `number \| undefined` | Query, Optional | The maximum number of results per page to return in a paged response. |
| `cursor` | `string \| undefined` | Query, Optional | The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. |
| `customerId` | `string \| undefined` | Query, Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. |
| `teamMemberId` | `string \| undefined` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. |
| `locationId` | `string \| undefined` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. |
| `startAtMin` | `string \| undefined` | Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. |
Expand Down Expand Up @@ -177,6 +180,55 @@ try {
```


# Bulk Retrieve Bookings

Bulk-Retrieves a list of bookings by booking IDs.

To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope.
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.

```ts
async bulkRetrieveBookings(
body: BulkRetrieveBookingsRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<BulkRetrieveBookingsResponse>>
```

## Parameters

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `body` | [`BulkRetrieveBookingsRequest`](../../doc/models/bulk-retrieve-bookings-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |

## Response Type

[`BulkRetrieveBookingsResponse`](../../doc/models/bulk-retrieve-bookings-response.md)

## Example Usage

```ts
const body: BulkRetrieveBookingsRequest = {
bookingIds: [
'booking_ids8',
'booking_ids9',
'booking_ids0'
],
};

try {
const { result, ...httpResponse } = await bookingsApi.bulkRetrieveBookings(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
```


# Retrieve Business Booking Profile

Retrieves a seller's booking profile.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/gift-cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async listGiftCards(
| --- | --- | --- | --- |
| `type` | `string \| undefined` | Query, Optional | If a [type](entity:GiftCardType) is provided, the endpoint returns gift cards of the specified type.<br>Otherwise, the endpoint returns gift cards of all types. |
| `state` | `string \| undefined` | Query, Optional | If a [state](entity:GiftCardStatus) is provided, the endpoint returns the gift cards in the specified state.<br>Otherwise, the endpoint returns the gift cards of all states. |
| `limit` | `number \| undefined` | Query, Optional | If a limit is provided, the endpoint returns only the specified number of results per page.<br>The maximum value is 50. The default value is 30.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
| `limit` | `number \| undefined` | Query, Optional | If a limit is provided, the endpoint returns only the specified number of results per page.<br>The maximum value is 200. The default value is 30.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
| `cursor` | `string \| undefined` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>If a cursor is not provided, the endpoint returns the first page of the results.<br>For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). |
| `customerId` | `string \| undefined` | Query, Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
Expand Down
2 changes: 1 addition & 1 deletion doc/api/loyalty.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ const body: CreateLoyaltyPromotionRequest = {
incentive: {
type: 'POINTS_MULTIPLIER',
pointsMultiplierData: {
pointsMultiplier: 3,
multiplier: '3.0',
},
},
availableTime: {
Expand Down
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2023-07-20'` |
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2023-08-16'` |
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `additionalHeaders` | `Readonly<Record<string, string>>` | Additional headers to add to each API call<br>*Default*: `{}` |
Expand Down Expand Up @@ -40,7 +40,7 @@ The API client can be initialized as follows:

```ts
const client = new Client({
squareVersion: '2023-07-20',
squareVersion: '2023-08-16',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand All @@ -55,7 +55,7 @@ const client = new Client({
import { ApiError, Client } from 'square';

const client = new Client({
squareVersion: '2023-07-20',
squareVersion: '2023-08-16',
timeout: 60000,
additionalHeaders: {},
userAgentDetail: '',
Expand Down
8 changes: 4 additions & 4 deletions doc/models/accepted-payment-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `applePay` | `boolean \| undefined` | Optional | Whether Apple Pay is accepted at checkout. |
| `googlePay` | `boolean \| undefined` | Optional | Whether Google Pay is accepted at checkout. |
| `cashAppPay` | `boolean \| undefined` | Optional | Whether Cash App Pay is accepted at checkout. |
| `afterpayClearpay` | `boolean \| undefined` | Optional | Whether Afterpay/Clearpay is accepted at checkout. |
| `applePay` | `boolean \| null \| undefined` | Optional | Whether Apple Pay is accepted at checkout. |
| `googlePay` | `boolean \| null \| undefined` | Optional | Whether Google Pay is accepted at checkout. |
| `cashAppPay` | `boolean \| null \| undefined` | Optional | Whether Cash App Pay is accepted at checkout. |
| `afterpayClearpay` | `boolean \| null \| undefined` | Optional | Whether Afterpay/Clearpay is accepted at checkout. |

## Example (as JSON)

Expand Down
6 changes: 3 additions & 3 deletions doc/models/ach-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type`

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `routingNumber` | `string \| undefined` | Optional | The routing number for the bank account.<br>**Constraints**: *Maximum Length*: `50` |
| `accountNumberSuffix` | `string \| undefined` | Optional | The last few digits of the bank account number.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4` |
| `accountType` | `string \| undefined` | Optional | The type of the bank account performing the transfer. The account type can be `CHECKING`,<br>`SAVINGS`, or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` |
| `routingNumber` | `string \| null \| undefined` | Optional | The routing number for the bank account.<br>**Constraints**: *Maximum Length*: `50` |
| `accountNumberSuffix` | `string \| null \| undefined` | Optional | The last few digits of the bank account number.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4` |
| `accountType` | `string \| null \| undefined` | Optional | The type of the bank account performing the transfer. The account type can be `CHECKING`,<br>`SAVINGS`, or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` |

## Example (as JSON)

Expand Down
4 changes: 2 additions & 2 deletions doc/models/additional-recipient.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Represents an additional recipient (other than the merchant) receiving a portion
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `locationId` | `string` | Required | The location ID for a recipient (other than the merchant) receiving a portion of this tender.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` |
| `description` | `string \| undefined` | Optional | The description of the additional recipient.<br>**Constraints**: *Maximum Length*: `100` |
| `description` | `string \| null \| undefined` | Optional | The description of the additional recipient.<br>**Constraints**: *Maximum Length*: `100` |
| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `receivableId` | `string \| undefined` | Optional | The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.<br>**Constraints**: *Maximum Length*: `192` |
| `receivableId` | `string \| null \| undefined` | Optional | The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.<br>**Constraints**: *Maximum Length*: `192` |

## Example (as JSON)

Expand Down
26 changes: 13 additions & 13 deletions doc/models/address.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ For more information, see [Working with Addresses](https://developer.squareup.co

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `addressLine1` | `string \| undefined` | Optional | The first line of the address.<br><br>Fields that start with `address_line` provide the address's most specific<br>details, like street number, street name, and building name. They do *not*<br>provide less specific details like city, state/province, or country (these<br>details are provided in other fields). |
| `addressLine2` | `string \| undefined` | Optional | The second line of the address, if any. |
| `addressLine3` | `string \| undefined` | Optional | The third line of the address, if any. |
| `locality` | `string \| undefined` | Optional | The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `sublocality` | `string \| undefined` | Optional | A civil region within the address's `locality`, if any. |
| `sublocality2` | `string \| undefined` | Optional | A civil region within the address's `sublocality`, if any. |
| `sublocality3` | `string \| undefined` | Optional | A civil region within the address's `sublocality_2`, if any. |
| `administrativeDistrictLevel1` | `string \| undefined` | Optional | A civil entity within the address's country. In the US, this<br>is the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `administrativeDistrictLevel2` | `string \| undefined` | Optional | A civil entity within the address's `administrative_district_level_1`.<br>In the US, this is the county. |
| `administrativeDistrictLevel3` | `string \| undefined` | Optional | A civil entity within the address's `administrative_district_level_2`,<br>if any. |
| `postalCode` | `string \| undefined` | Optional | The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `addressLine1` | `string \| null \| undefined` | Optional | The first line of the address.<br><br>Fields that start with `address_line` provide the address's most specific<br>details, like street number, street name, and building name. They do *not*<br>provide less specific details like city, state/province, or country (these<br>details are provided in other fields). |
| `addressLine2` | `string \| null \| undefined` | Optional | The second line of the address, if any. |
| `addressLine3` | `string \| null \| undefined` | Optional | The third line of the address, if any. |
| `locality` | `string \| null \| undefined` | Optional | The city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `sublocality` | `string \| null \| undefined` | Optional | A civil region within the address's `locality`, if any. |
| `sublocality2` | `string \| null \| undefined` | Optional | A civil region within the address's `sublocality`, if any. |
| `sublocality3` | `string \| null \| undefined` | Optional | A civil region within the address's `sublocality_2`, if any. |
| `administrativeDistrictLevel1` | `string \| null \| undefined` | Optional | A civil entity within the address's country. In the US, this<br>is the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `administrativeDistrictLevel2` | `string \| null \| undefined` | Optional | A civil entity within the address's `administrative_district_level_1`.<br>In the US, this is the county. |
| `administrativeDistrictLevel3` | `string \| null \| undefined` | Optional | A civil entity within the address's `administrative_district_level_2`,<br>if any. |
| `postalCode` | `string \| null \| undefined` | Optional | The address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). |
| `country` | [`string \| undefined`](../../doc/models/country.md) | Optional | Indicates the country associated with another entity, such as a business.<br>Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). |
| `firstName` | `string \| undefined` | Optional | Optional first name when it's representing recipient. |
| `lastName` | `string \| undefined` | Optional | Optional last name when it's representing recipient. |
| `firstName` | `string \| null \| undefined` | Optional | Optional first name when it's representing recipient. |
| `lastName` | `string \| null \| undefined` | Optional | Optional last name when it's representing recipient. |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/adjust-loyalty-points-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Represents an [AdjustLoyaltyPoints](../../doc/api/loyalty.md#adjust-loyalty-poin
| --- | --- | --- | --- |
| `idempotencyKey` | `string` | Required | A unique string that identifies this `AdjustLoyaltyPoints` request.<br>Keys can be any valid string, but must be unique for every request.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` |
| `adjustPoints` | [`LoyaltyEventAdjustPoints`](../../doc/models/loyalty-event-adjust-points.md) | Required | Provides metadata when the event `type` is `ADJUST_POINTS`. |
| `allowNegativeBalance` | `boolean \| undefined` | Optional | Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a negative<br>balance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when subtracting<br>the specified number of points would result in a negative balance. The default value is `false`. |
| `allowNegativeBalance` | `boolean \| null \| undefined` | Optional | Indicates whether to allow a negative adjustment to result in a negative balance. If `true`, a negative<br>balance is allowed when subtracting points. If `false`, Square returns a `BAD_REQUEST` error when subtracting<br>the specified number of points would result in a negative balance. The default value is `false`. |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/afterpay-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Additional details about Afterpay payments.

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `emailAddress` | `string \| undefined` | Optional | Email address on the buyer's Afterpay account.<br>**Constraints**: *Maximum Length*: `255` |
| `emailAddress` | `string \| null \| undefined` | Optional | Email address on the buyer's Afterpay account.<br>**Constraints**: *Maximum Length*: `255` |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/application-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Details about the application that took the payment.
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `squareProduct` | [`string \| undefined`](../../doc/models/application-details-external-square-product.md) | Optional | A list of products to return to external callers. |
| `applicationId` | `string \| undefined` | Optional | The Square ID assigned to the application used to take the payment.<br>Application developers can use this information to identify payments that<br>their application processed.<br>For example, if a developer uses a custom application to process payments,<br>this field contains the application ID from the Developer Dashboard.<br>If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace)<br>application to process payments, the field contains the corresponding application ID. |
| `applicationId` | `string \| null \| undefined` | Optional | The Square ID assigned to the application used to take the payment.<br>Application developers can use this information to identify payments that<br>their application processed.<br>For example, if a developer uses a custom application to process payments,<br>this field contains the application ID from the Developer Dashboard.<br>If a seller uses a [Square App Marketplace](https://developer.squareup.com/docs/app-marketplace)<br>application to process payments, the field contains the corresponding application ID. |

## Example (as JSON)

Expand Down
Loading

0 comments on commit 73a7121

Please sign in to comment.