Skip to content

Commit d1951e3

Browse files
Merge pull request #110 from square/release/24.0.0
Generated PR for Release: 24.0.0
2 parents 9aaebe2 + 6562c5f commit d1951e3

File tree

511 files changed

+9165
-2785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

511 files changed

+9165
-2785
lines changed

doc/api-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The ApiError extends the ApiResponse interface, so all ApiResponse properties ar
1010
| Name | Type | Description |
1111
| --- | --- | --- |
1212
| request | HttpRequest | Original request that resulted in this response. |
13-
| statusCode | number | Response status codee. |
13+
| statusCode | number | Response status code. |
1414
| headers | Record<string, string> | Response headers. |
1515
| result | T | Response data. |
1616
| body | string \| Blob \| NodeJS.ReadableStream | Original body from the response. |

doc/api/booking-custom-attributes.md

Lines changed: 565 additions & 0 deletions
Large diffs are not rendered by default.

doc/api/catalog.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ children.
3939
IDs can be deleted. The response will only include IDs that were
4040
actually deleted.
4141

42+
To ensure consistency, only one delete request is processed at a time per seller account.
43+
While one (batch or non-batch) delete request is being processed, other (batched and non-batched)
44+
delete requests are rejected with the `429` error code.
45+
4246
```ts
4347
async batchDeleteCatalogObjects(
4448
body: BatchDeleteCatalogObjectsRequest,
@@ -140,6 +144,10 @@ batches will be processed in order as long as the total object count for the
140144
request (items, variations, modifier lists, discounts, and taxes) is no more
141145
than 10,000.
142146

147+
To ensure consistency, only one update request is processed at a time per seller account.
148+
While one (batch or non-batch) update request is being processed, other (batched and non-batched)
149+
update requests are rejected with the `429` error code.
150+
143151
```ts
144152
async batchUpsertCatalogObjects(
145153
body: BatchUpsertCatalogObjectsRequest,
@@ -472,7 +480,7 @@ async listCatalog(
472480
| --- | --- | --- | --- |
473481
| `cursor` | `string \| undefined` | Query, Optional | The pagination cursor returned in the previous response. Leave unset for an initial request.<br>The page size is currently set to be 100.<br>See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. |
474482
| `types` | `string \| undefined` | Query, Optional | An optional case-insensitive, comma-separated list of object types to retrieve.<br><br>The valid values are defined in the [CatalogObjectType](../../doc/models/catalog-object-type.md) enum, for example,<br>`ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`,<br>`MODIFIER`, `MODIFIER_LIST`, `IMAGE`, etc.<br><br>If this is unspecified, the operation returns objects of all the top level types at the version<br>of the Square API used to make the request. Object types that are nested onto other object types<br>are not included in the defaults.<br><br>At the current API version the default object types are:<br>ITEM, CATEGORY, TAX, DISCOUNT, MODIFIER_LIST,<br>PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT,<br>SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNT_SETTINGS. |
475-
| `catalogVersion` | `bigint \| undefined` | Query, Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical<br>versions of objects. The specified version value is matched against<br>the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will<br>be from the current version of the catalog. |
483+
| `catalogVersion` | `bigint \| undefined` | Query, Optional | The specific version of the catalog objects to be included in the response.<br>This allows you to retrieve historical versions of objects. The specified version value is matched against<br>the [CatalogObject](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will be from the<br>current version of the catalog. |
476484
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
477485

478486
## Response Type
@@ -497,7 +505,11 @@ try {
497505

498506
# Upsert Catalog Object
499507

500-
Creates or updates the target [CatalogObject](../../doc/models/catalog-object.md).
508+
Creates a new or updates the specified [CatalogObject](../../doc/models/catalog-object.md).
509+
510+
To ensure consistency, only one update request is processed at a time per seller account.
511+
While one (batch or non-batch) update request is being processed, other (batched and non-batched)
512+
update requests are rejected with the `429` error code.
501513

502514
```ts
503515
async upsertCatalogObject(
@@ -593,6 +605,10 @@ are also deleted. For example, deleting a [CatalogItem](../../doc/models/catalog
593605
will also delete all of its
594606
[CatalogItemVariation](../../doc/models/catalog-item-variation.md) children.
595607

608+
To ensure consistency, only one delete request is processed at a time per seller account.
609+
While one (batch or non-batch) delete request is being processed, other (batched and non-batched)
610+
delete requests are rejected with the `429` error code.
611+
596612
```ts
597613
async deleteCatalogObject(
598614
objectId: string,

doc/api/customer-custom-attributes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ const customerId = 'customer_id8';
522522
const key = 'key0';
523523
const contentType = null;
524524
const bodyCustomAttribute: CustomAttribute = {};
525-
bodyCustomAttribute.value = '"Dune"';
526525

527526
const body: UpsertCustomerCustomAttributeRequest = {
528527
customAttribute: bodyCustomAttribute,

doc/api/customers.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ try {
220220

221221
Deletes a customer profile from a business. This operation also unlinks any associated cards on file.
222222

223-
As a best practice, you should include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. The value must be set to the current version of the customer profile.
223+
As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control.
224+
If included, the value must be set to the current version of the customer profile.
224225

225226
To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
226227

@@ -302,9 +303,12 @@ try {
302303

303304
# Update Customer
304305

305-
Updates a customer profile. To change an attribute, specify the new value. To remove an attribute, specify the value as an empty string or empty object.
306+
Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request.
307+
To add or update a field, specify the new value. To remove a field, specify `null` and include the `X-Clear-Null` header set to `true`
308+
(recommended) or specify an empty string (string fields only).
306309

307-
As a best practice, you should include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/working-with-apis/optimistic-concurrency) control. The value must be set to the current version of the customer profile.
310+
As a best practice, include the `version` field in the request to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control.
311+
If included, the value must be set to the current version of the customer profile.
308312

309313
To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
310314

doc/api/loyalty.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,19 @@ const bodyLoyaltyPromotionTriggerLimit: LoyaltyPromotionTriggerLimit = {
599599
};
600600
bodyLoyaltyPromotionTriggerLimit.interval = 'DAY';
601601

602+
const bodyLoyaltyPromotionMinimumSpendAmountMoney: Money = {};
603+
bodyLoyaltyPromotionMinimumSpendAmountMoney.amount = BigInt(2000);
604+
bodyLoyaltyPromotionMinimumSpendAmountMoney.currency = 'USD';
605+
606+
const bodyLoyaltyPromotionQualifyingCategoryIds: string[] = ['XTQPYLR3IIU9C44VRCB3XD12'];
602607
const bodyLoyaltyPromotion: LoyaltyPromotion = {
603608
name: 'Tuesday Happy Hour Promo',
604609
incentive: bodyLoyaltyPromotionIncentive,
605610
availableTime: bodyLoyaltyPromotionAvailableTime,
606611
};
607612
bodyLoyaltyPromotion.triggerLimit = bodyLoyaltyPromotionTriggerLimit;
613+
bodyLoyaltyPromotion.minimumSpendAmountMoney = bodyLoyaltyPromotionMinimumSpendAmountMoney;
614+
bodyLoyaltyPromotion.qualifyingCategoryIds = bodyLoyaltyPromotionQualifyingCategoryIds;
608615

609616
const body: CreateLoyaltyPromotionRequest = {
610617
loyaltyPromotion: bodyLoyaltyPromotion,

0 commit comments

Comments
 (0)