diff --git a/package.json b/package.json index 6acef5d92..1fb834b6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "square", - "version": "43.1.1", + "version": "43.1.0", "private": false, "repository": "github:square/square-nodejs-sdk", "license": "MIT", diff --git a/reference.md b/reference.md index 42f62d172..d6e291d65 100644 --- a/reference.md +++ b/reference.md @@ -392,6 +392,9 @@ Provides summary information for a merchant's online store orders. ```typescript await client.v1Transactions.v1ListOrders({ locationId: "location_id", + order: "DESC", + limit: 1, + batchToken: "batch_token", }); ``` @@ -670,13 +673,21 @@ Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square a
```typescript -const response = await client.bankAccounts.list(); +const response = await client.bankAccounts.list({ + cursor: "cursor", + limit: 1, + locationId: "location_id", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.bankAccounts.list(); +let page = await client.bankAccounts.list({ + cursor: "cursor", + limit: 1, + locationId: "location_id", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -878,13 +889,29 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
```typescript -const response = await client.bookings.list(); +const response = await client.bookings.list({ + limit: 1, + cursor: "cursor", + customerId: "customer_id", + teamMemberId: "team_member_id", + locationId: "location_id", + startAtMin: "start_at_min", + startAtMax: "start_at_max", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.bookings.list(); +let page = await client.bookings.list({ + limit: 1, + cursor: "cursor", + customerId: "customer_id", + teamMemberId: "team_member_id", + locationId: "location_id", + startAtMin: "start_at_min", + startAtMax: "start_at_max", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -1568,13 +1595,25 @@ A max of 25 cards will be returned.
```typescript -const response = await client.cards.list(); +const response = await client.cards.list({ + cursor: "cursor", + customerId: "customer_id", + includeDisabled: true, + referenceId: "reference_id", + sortOrder: "DESC", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.cards.list(); +let page = await client.cards.list({ + cursor: "cursor", + customerId: "customer_id", + includeDisabled: true, + referenceId: "reference_id", + sortOrder: "DESC", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -2163,13 +2202,21 @@ and set the `include_deleted_objects` attribute value to `true`.
```typescript -const response = await client.catalog.list(); +const response = await client.catalog.list({ + cursor: "cursor", + types: "types", + catalogVersion: BigInt("1000000"), +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.catalog.list(); +let page = await client.catalog.list({ + cursor: "cursor", + types: "types", + catalogVersion: BigInt("1000000"), +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -2524,6 +2571,216 @@ await client.catalog.updateItemTaxes({ +## Channels + +
client.channels.list({ ...params }) -> core.Page +
+
+ +#### 📝 Description + +
+
+ +
+
+ +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +const response = await client.channels.list({ + referenceType: "UNKNOWN_TYPE", + referenceId: "reference_id", + status: "ACTIVE", + cursor: "cursor", + limit: 1, +}); +for await (const item of response) { + console.log(item); +} + +// Or you can manually iterate page-by-page +let page = await client.channels.list({ + referenceType: "UNKNOWN_TYPE", + referenceId: "reference_id", + status: "ACTIVE", + cursor: "cursor", + limit: 1, +}); +while (page.hasNextPage()) { + page = page.getNextPage(); +} +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.ListChannelsRequest` + +
+
+ +
+
+ +**requestOptions:** `Channels.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.channels.bulkRetrieve({ ...params }) -> Square.BulkRetrieveChannelsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.channels.bulkRetrieve({ + channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.BulkRetrieveChannelsRequest` + +
+
+ +
+
+ +**requestOptions:** `Channels.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.channels.get({ ...params }) -> Square.RetrieveChannelResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.channels.get({ + channelId: "channel_id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.GetChannelsRequest` + +
+
+ +
+
+ +**requestOptions:** `Channels.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Customers
client.customers.list({ ...params }) -> core.Page @@ -2558,13 +2815,25 @@ profiles can take closer to one minute or longer, especially during network inci
```typescript -const response = await client.customers.list(); +const response = await client.customers.list({ + cursor: "cursor", + limit: 1, + sortField: "DEFAULT", + sortOrder: "DESC", + count: true, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.customers.list(); +let page = await client.customers.list({ + cursor: "cursor", + limit: 1, + sortField: "DEFAULT", + sortOrder: "DESC", + count: true, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -3270,6 +3539,7 @@ To delete a customer profile that was created by merging existing profiles, you ```typescript await client.customers.delete({ customerId: "customer_id", + version: BigInt("1000000"), }); ``` @@ -3336,13 +3606,23 @@ devices are supported.
```typescript -const response = await client.devices.list(); +const response = await client.devices.list({ + cursor: "cursor", + sortOrder: "DESC", + limit: 1, + locationId: "location_id", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.devices.list(); +let page = await client.devices.list({ + cursor: "cursor", + sortOrder: "DESC", + limit: 1, + locationId: "location_id", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -3475,13 +3755,21 @@ Returns a list of disputes associated with a particular account.
```typescript -const response = await client.disputes.list(); +const response = await client.disputes.list({ + cursor: "cursor", + states: "INQUIRY_EVIDENCE_REQUIRED", + locationId: "location_id", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.disputes.list(); +let page = await client.disputes.list({ + cursor: "cursor", + states: "INQUIRY_EVIDENCE_REQUIRED", + locationId: "location_id", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -3886,13 +4174,23 @@ await client.disputes.submitEvidence({
```typescript -const response = await client.employees.list(); +const response = await client.employees.list({ + locationId: "location_id", + status: "ACTIVE", + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.employees.list(); +let page = await client.employees.list({ + locationId: "location_id", + status: "ACTIVE", + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -4198,7 +4496,9 @@ Lists all event types that you can subscribe to as webhooks or query using the E
```typescript -await client.events.listEventTypes(); +await client.events.listEventTypes({ + apiVersion: "api_version", +}); ```
@@ -4264,13 +4564,25 @@ a subset of the gift cards. Results are sorted by `created_at` in ascending orde
```typescript -const response = await client.giftCards.list(); +const response = await client.giftCards.list({ + type: "type", + state: "state", + limit: 1, + cursor: "cursor", + customerId: "customer_id", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.giftCards.list(); +let page = await client.giftCards.list({ + type: "type", + state: "state", + limit: 1, + cursor: "cursor", + customerId: "customer_id", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -5560,6 +5872,8 @@ For more sophisticated queries, use a batch endpoint. ```typescript const response = await client.inventory.get({ catalogObjectId: "catalog_object_id", + locationIds: "location_ids", + cursor: "cursor", }); for await (const item of response) { console.log(item); @@ -5568,6 +5882,8 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.inventory.get({ catalogObjectId: "catalog_object_id", + locationIds: "location_ids", + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -5648,6 +5964,8 @@ sophisticated queries, use a batch endpoint. ```typescript const response = await client.inventory.changes({ catalogObjectId: "catalog_object_id", + locationIds: "location_ids", + cursor: "cursor", }); for await (const item of response) { console.log(item); @@ -5656,6 +5974,8 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.inventory.changes({ catalogObjectId: "catalog_object_id", + locationIds: "location_ids", + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -5728,6 +6048,8 @@ use in a subsequent request to retrieve the next set of invoices. ```typescript const response = await client.invoices.list({ locationId: "location_id", + cursor: "cursor", + limit: 1, }); for await (const item of response) { console.log(item); @@ -5736,6 +6058,8 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.invoices.list({ locationId: "location_id", + cursor: "cursor", + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -6146,6 +6470,7 @@ invoice (you cannot delete a published invoice, including one that is scheduled ```typescript await client.invoices.delete({ invoiceId: "invoice_id", + version: 1, }); ``` @@ -7925,13 +8250,17 @@ endpoint to retrieve the merchant information.
```typescript -const response = await client.merchants.list(); +const response = await client.merchants.list({ + cursor: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.merchants.list(); +let page = await client.merchants.list({ + cursor: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -9021,13 +9350,45 @@ The maximum results per page is 100.
```typescript -const response = await client.payments.list(); +const response = await client.payments.list({ + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "sort_order", + cursor: "cursor", + locationId: "location_id", + total: BigInt("1000000"), + last4: "last_4", + cardBrand: "card_brand", + limit: 1, + isOfflinePayment: true, + offlineBeginTime: "offline_begin_time", + offlineEndTime: "offline_end_time", + updatedAtBeginTime: "updated_at_begin_time", + updatedAtEndTime: "updated_at_end_time", + sortField: "CREATED_AT", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.payments.list(); +let page = await client.payments.list({ + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "sort_order", + cursor: "cursor", + locationId: "location_id", + total: BigInt("1000000"), + last4: "last_4", + cardBrand: "card_brand", + limit: 1, + isOfflinePayment: true, + offlineBeginTime: "offline_begin_time", + offlineEndTime: "offline_end_time", + updatedAtBeginTime: "updated_at_begin_time", + updatedAtEndTime: "updated_at_end_time", + sortField: "CREATED_AT", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -9535,13 +9896,29 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
```typescript -const response = await client.payouts.list(); +const response = await client.payouts.list({ + locationId: "location_id", + status: "SENT", + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "DESC", + cursor: "cursor", + limit: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.payouts.list(); +let page = await client.payouts.list({ + locationId: "location_id", + status: "SENT", + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "DESC", + cursor: "cursor", + limit: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -9676,6 +10053,9 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. ```typescript const response = await client.payouts.listEntries({ payoutId: "payout_id", + sortOrder: "DESC", + cursor: "cursor", + limit: 1, }); for await (const item of response) { console.log(item); @@ -9684,6 +10064,9 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.payouts.listEntries({ payoutId: "payout_id", + sortOrder: "DESC", + cursor: "cursor", + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -9757,13 +10140,37 @@ The maximum results per page is 100.
```typescript -const response = await client.refunds.list(); -for await (const item of response) { +const response = await client.refunds.list({ + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "sort_order", + cursor: "cursor", + locationId: "location_id", + status: "status", + sourceType: "source_type", + limit: 1, + updatedAtBeginTime: "updated_at_begin_time", + updatedAtEndTime: "updated_at_end_time", + sortField: "CREATED_AT", +}); +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.refunds.list(); +let page = await client.refunds.list({ + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "sort_order", + cursor: "cursor", + locationId: "location_id", + status: "status", + sourceType: "source_type", + limit: 1, + updatedAtBeginTime: "updated_at_begin_time", + updatedAtEndTime: "updated_at_end_time", + sortField: "CREATED_AT", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -10487,6 +10894,7 @@ Retrieves a specific subscription. ```typescript await client.subscriptions.get({ subscriptionId: "subscription_id", + include: "include", }); ``` @@ -10821,6 +11229,8 @@ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions ```typescript const response = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", + cursor: "cursor", + limit: 1, }); for await (const item of response) { console.log(item); @@ -10829,6 +11239,8 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", + cursor: "cursor", + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -11576,7 +11988,585 @@ await client.teamMembers.update({ ], isOvertimeExempt: true, }, - }, + }, + }, +}); +``` + +
+ +
+ + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.UpdateTeamMembersRequest` + +
+
+ +
+
+ +**requestOptions:** `TeamMembers.RequestOptions` + +
+
+
+
+ + + + + +## Team + +
client.team.listJobs({ ...params }) -> Square.ListJobsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Lists jobs in a seller account. Results are sorted by title in ascending order. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.team.listJobs({ + cursor: "cursor", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.ListJobsRequest` + +
+
+ +
+
+ +**requestOptions:** `Team.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.team.createJob({ ...params }) -> Square.CreateJobResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a job in a seller account. A job defines a title and tip eligibility. Note that +compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.team.createJob({ + job: { + title: "Cashier", + isTipEligible: true, + }, + idempotencyKey: "idempotency-key-0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.CreateJobRequest` + +
+
+ +
+
+ +**requestOptions:** `Team.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.team.retrieveJob({ ...params }) -> Square.RetrieveJobResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Retrieves a specified job. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.team.retrieveJob({ + jobId: "job_id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.RetrieveJobRequest` + +
+
+ +
+
+ +**requestOptions:** `Team.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.team.updateJob({ ...params }) -> Square.UpdateJobResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates the title or tip eligibility of a job. Changes to the title propagate to all +`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to +tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.team.updateJob({ + jobId: "job_id", + job: { + title: "Cashier 1", + isTipEligible: true, + }, +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.UpdateJobRequest` + +
+
+ +
+
+ +**requestOptions:** `Team.RequestOptions` + +
+
+
+
+ +
+
+
+ +## Terminal + +
client.terminal.dismissTerminalAction({ ...params }) -> Square.DismissTerminalActionResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Dismisses a Terminal action request if the status and type of the request permits it. + +See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.terminal.dismissTerminalAction({ + actionId: "action_id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.DismissTerminalActionRequest` + +
+
+ +
+
+ +**requestOptions:** `Terminal.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.terminal.dismissTerminalCheckout({ ...params }) -> Square.DismissTerminalCheckoutResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Dismisses a Terminal checkout request if the status and type of the request permits it. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.terminal.dismissTerminalCheckout({ + checkoutId: "checkout_id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.DismissTerminalCheckoutRequest` + +
+
+ +
+
+ +**requestOptions:** `Terminal.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.terminal.dismissTerminalRefund({ ...params }) -> Square.DismissTerminalRefundResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Dismisses a Terminal refund request if the status and type of the request permits it. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.terminal.dismissTerminalRefund({ + terminalRefundId: "terminal_refund_id", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Square.DismissTerminalRefundRequest` + +
+
+ +
+
+ +**requestOptions:** `Terminal.RequestOptions` + +
+
+
+
+ +
+
+
+ +## TransferOrders + +
client.transferOrders.create({ ...params }) -> Square.CreateTransferOrderResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent +to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. +The source and destination locations must be different and must belong to your Square account. + +In [DRAFT](entity:TransferOrderStatus) status, you can: + +- Add or remove items +- Modify quantities +- Update shipping information +- Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) + +The request requires source_location_id and destination_location_id. +Inventory levels are not affected until the order is started via +[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). + +Common integration points: + +- Sync with warehouse management systems +- Automate regular stock transfers +- Initialize transfers from inventory optimization systems + +Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.transferOrders.create({ + idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", + transferOrder: { + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + expectedAt: "2025-11-09T05:00:00Z", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + }, + { + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + }, + ], }, }); ``` @@ -11594,7 +12584,7 @@ await client.teamMembers.update({
-**request:** `Square.UpdateTeamMembersRequest` +**request:** `Square.CreateTransferOrderRequest`
@@ -11602,7 +12592,7 @@ await client.teamMembers.update({
-**requestOptions:** `TeamMembers.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -11613,9 +12603,7 @@ await client.teamMembers.update({
-## Team - -
client.team.listJobs({ ...params }) -> Square.ListJobsResponse +
client.transferOrders.search({ ...params }) -> core.Page
@@ -11627,12 +12615,18 @@ await client.teamMembers.update({
-Lists jobs in a seller account. Results are sorted by title in ascending order. +Searches for transfer orders using filters. Returns a paginated list of matching +[TransferOrder](entity:TransferOrder)s sorted by creation date. -
-
-
-
+Common search scenarios: + +- Find orders for a source [Location](entity:Location) +- Find orders for a destination [Location](entity:Location) +- Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) + + + + #### 🔌 Usage @@ -11643,7 +12637,44 @@ Lists jobs in a seller account. Results are sorted by title in ascending order.
```typescript -await client.team.listJobs(); +const response = await client.transferOrders.search({ + query: { + filter: { + sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], + destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], + statuses: ["STARTED", "PARTIALLY_RECEIVED"], + }, + sort: { + field: "UPDATED_AT", + order: "DESC", + }, + }, + cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + limit: 10, +}); +for await (const item of response) { + console.log(item); +} + +// Or you can manually iterate page-by-page +let page = await client.transferOrders.search({ + query: { + filter: { + sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], + destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], + statuses: ["STARTED", "PARTIALLY_RECEIVED"], + }, + sort: { + field: "UPDATED_AT", + order: "DESC", + }, + }, + cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + limit: 10, +}); +while (page.hasNextPage()) { + page = page.getNextPage(); +} ```
@@ -11659,7 +12690,7 @@ await client.team.listJobs();
-**request:** `Square.ListJobsRequest` +**request:** `Square.SearchTransferOrdersRequest`
@@ -11667,7 +12698,7 @@ await client.team.listJobs();
-**requestOptions:** `Team.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -11678,7 +12709,7 @@ await client.team.listJobs();
-
client.team.createJob({ ...params }) -> Square.CreateJobResponse +
client.transferOrders.get({ ...params }) -> Square.RetrieveTransferOrderResponse
@@ -11690,13 +12721,17 @@ await client.team.listJobs();
-Creates a job in a seller account. A job defines a title and tip eligibility. Note that -compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. +Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete +order details including: -
-
-
-
+- Basic information (status, dates, notes) +- Line items with ordered and received quantities +- Source and destination [Location](entity:Location)s +- Tracking information (if available) + + + + #### 🔌 Usage @@ -11707,12 +12742,8 @@ compensation is defined in a [job assignment](entity:JobAssignment) in a team me
```typescript -await client.team.createJob({ - job: { - title: "Cashier", - isTipEligible: true, - }, - idempotencyKey: "idempotency-key-0", +await client.transferOrders.get({ + transferOrderId: "transfer_order_id", }); ``` @@ -11729,7 +12760,7 @@ await client.team.createJob({
-**request:** `Square.CreateJobRequest` +**request:** `Square.GetTransferOrdersRequest`
@@ -11737,7 +12768,7 @@ await client.team.createJob({
-**requestOptions:** `Team.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -11748,7 +12779,7 @@ await client.team.createJob({
-
client.team.retrieveJob({ ...params }) -> Square.RetrieveJobResponse +
client.transferOrders.update({ ...params }) -> Square.UpdateTransferOrderResponse
@@ -11760,7 +12791,10 @@ await client.team.createJob({
-Retrieves a specified job. +Updates an existing transfer order. This endpoint supports sparse updates, +allowing you to modify specific fields without affecting others. + +Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -11776,8 +12810,31 @@ Retrieves a specified job.
```typescript -await client.team.retrieveJob({ - jobId: "job_id", +await client.transferOrders.update({ + transferOrderId: "transfer_order_id", + idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", + transferOrder: { + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", + expectedAt: "2025-11-10T08:00:00Z", + notes: "Updated: Priority transfer due to low stock at destination", + trackingNumber: "TRACK987654321", + lineItems: [ + { + uid: "1", + quantityOrdered: "7", + }, + { + itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + quantityOrdered: "2", + }, + { + uid: "2", + remove: true, + }, + ], + }, + version: BigInt("1753109537351"), }); ``` @@ -11794,7 +12851,7 @@ await client.team.retrieveJob({
-**request:** `Square.RetrieveJobRequest` +**request:** `Square.UpdateTransferOrderRequest`
@@ -11802,7 +12859,7 @@ await client.team.retrieveJob({
-**requestOptions:** `Team.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -11813,7 +12870,7 @@ await client.team.retrieveJob({
-
client.team.updateJob({ ...params }) -> Square.UpdateJobResponse +
client.transferOrders.delete({ ...params }) -> Square.DeleteTransferOrderResponse
@@ -11825,9 +12882,11 @@ await client.team.retrieveJob({
-Updates the title or tip eligibility of a job. Changes to the title propagate to all -`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to -tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. +Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. +Only draft orders can be deleted. Once an order is started via +[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. + +Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event.
@@ -11843,12 +12902,9 @@ tip eligibility propagate to all `TeamMemberWage` objects that reference the job
```typescript -await client.team.updateJob({ - jobId: "job_id", - job: { - title: "Cashier 1", - isTipEligible: true, - }, +await client.transferOrders.delete({ + transferOrderId: "transfer_order_id", + version: BigInt("1000000"), }); ``` @@ -11865,7 +12921,7 @@ await client.team.updateJob({
-**request:** `Square.UpdateJobRequest` +**request:** `Square.DeleteTransferOrdersRequest`
@@ -11873,7 +12929,7 @@ await client.team.updateJob({
-**requestOptions:** `Team.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -11884,9 +12940,7 @@ await client.team.updateJob({
-## Terminal - -
client.terminal.dismissTerminalAction({ ...params }) -> Square.DismissTerminalActionResponse +
client.transferOrders.cancel({ ...params }) -> Square.CancelTransferOrderResponse
@@ -11898,9 +12952,17 @@ await client.team.updateJob({
-Dismisses a Terminal action request if the status and type of the request permits it. +Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or +[PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no +longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. -See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. +Common reasons for cancellation: + +- Items no longer needed at destination +- Source location needs the inventory +- Order created in error + +Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -11916,8 +12978,10 @@ See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/
```typescript -await client.terminal.dismissTerminalAction({ - actionId: "action_id", +await client.transferOrders.cancel({ + transferOrderId: "transfer_order_id", + idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", + version: BigInt("1753117449752"), }); ``` @@ -11934,7 +12998,7 @@ await client.terminal.dismissTerminalAction({
-**request:** `Square.DismissTerminalActionRequest` +**request:** `Square.CancelTransferOrderRequest`
@@ -11942,7 +13006,7 @@ await client.terminal.dismissTerminalAction({
-**requestOptions:** `Terminal.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -11953,7 +13017,7 @@ await client.terminal.dismissTerminalAction({
-
client.terminal.dismissTerminalCheckout({ ...params }) -> Square.DismissTerminalCheckoutResponse +
client.transferOrders.receive({ ...params }) -> Square.ReceiveTransferOrderResponse
@@ -11965,7 +13029,23 @@ await client.terminal.dismissTerminalAction({
-Dismisses a Terminal checkout request if the status and type of the request permits it. +Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. +This endpoint supports partial receiving - you can receive items in multiple batches. + +For each line item, you can specify: + +- Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) +- Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) +- Quantity canceled (returned to source location's inventory) + +The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. +Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. +Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. + +When all items are either received, damaged, or canceled, the order moves to +[COMPLETED](entity:TransferOrderStatus) status. + +Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -11981,8 +13061,25 @@ Dismisses a Terminal checkout request if the status and type of the request perm
```typescript -await client.terminal.dismissTerminalCheckout({ - checkoutId: "checkout_id", +await client.transferOrders.receive({ + transferOrderId: "transfer_order_id", + idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", + receipt: { + lineItems: [ + { + transferOrderLineUid: "transfer_order_line_uid", + quantityReceived: "3", + quantityDamaged: "1", + quantityCanceled: "1", + }, + { + transferOrderLineUid: "transfer_order_line_uid", + quantityReceived: "2", + quantityCanceled: "1", + }, + ], + }, + version: BigInt("1753118664873"), }); ``` @@ -11999,7 +13096,7 @@ await client.terminal.dismissTerminalCheckout({
-**request:** `Square.DismissTerminalCheckoutRequest` +**request:** `Square.ReceiveTransferOrderRequest`
@@ -12007,7 +13104,7 @@ await client.terminal.dismissTerminalCheckout({
-**requestOptions:** `Terminal.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -12018,7 +13115,7 @@ await client.terminal.dismissTerminalCheckout({
-
client.terminal.dismissTerminalRefund({ ...params }) -> Square.DismissTerminalRefundResponse +
client.transferOrders.start({ ...params }) -> Square.StartTransferOrderResponse
@@ -12030,7 +13127,14 @@ await client.terminal.dismissTerminalCheckout({
-Dismisses a Terminal refund request if the status and type of the request permits it. +Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. +This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. + +The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. +Once started, the order can no longer be deleted, but it can be canceled via +[CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). + +Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -12046,8 +13150,10 @@ Dismisses a Terminal refund request if the status and type of the request permit
```typescript -await client.terminal.dismissTerminalRefund({ - terminalRefundId: "terminal_refund_id", +await client.transferOrders.start({ + transferOrderId: "transfer_order_id", + idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", + version: BigInt("1753109537351"), }); ``` @@ -12064,7 +13170,7 @@ await client.terminal.dismissTerminalRefund({
-**request:** `Square.DismissTerminalRefundRequest` +**request:** `Square.StartTransferOrderRequest`
@@ -12072,7 +13178,7 @@ await client.terminal.dismissTerminalRefund({
-**requestOptions:** `Terminal.RequestOptions` +**requestOptions:** `TransferOrders.RequestOptions`
@@ -12630,13 +13736,19 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
```typescript -const response = await client.bookings.customAttributeDefinitions.list(); +const response = await client.bookings.customAttributeDefinitions.list({ + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.bookings.customAttributeDefinitions.list(); +let page = await client.bookings.customAttributeDefinitions.list({ + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -12778,6 +13890,7 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.customAttributeDefinitions.get({ key: "key", + version: 1, }); ``` @@ -13143,6 +14256,9 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript const response = await client.bookings.customAttributes.list({ bookingId: "booking_id", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); for await (const item of response) { console.log(item); @@ -13151,6 +14267,9 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.bookings.customAttributes.list({ bookingId: "booking_id", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -13223,6 +14342,8 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` await client.bookings.customAttributes.get({ bookingId: "booking_id", key: "key", + withDefinition: true, + version: 1, }); ``` @@ -13433,13 +14554,19 @@ Lists location booking profiles of a seller.
```typescript -const response = await client.bookings.locationProfiles.list(); +const response = await client.bookings.locationProfiles.list({ + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.bookings.locationProfiles.list(); +let page = await client.bookings.locationProfiles.list({ + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -13507,13 +14634,23 @@ Lists booking profiles for team members.
```typescript -const response = await client.bookings.teamMemberProfiles.list(); +const response = await client.bookings.teamMemberProfiles.list({ + bookableOnly: true, + limit: 1, + cursor: "cursor", + locationId: "location_id", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.bookings.teamMemberProfiles.list(); +let page = await client.bookings.teamMemberProfiles.list({ + bookableOnly: true, + limit: 1, + cursor: "cursor", + locationId: "location_id", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -13649,6 +14786,11 @@ in a date range. ```typescript const response = await client.cashDrawers.shifts.list({ locationId: "location_id", + sortOrder: "DESC", + beginTime: "begin_time", + endTime: "end_time", + limit: 1, + cursor: "cursor", }); for await (const item of response) { console.log(item); @@ -13657,6 +14799,11 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.cashDrawers.shifts.list({ locationId: "location_id", + sortOrder: "DESC", + beginTime: "begin_time", + endTime: "end_time", + limit: 1, + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -13793,6 +14940,8 @@ Provides a paginated list of events for a single cash drawer shift. const response = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", + limit: 1, + cursor: "cursor", }); for await (const item of response) { console.log(item); @@ -13802,6 +14951,8 @@ for await (const item of response) { let page = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", + limit: 1, + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -14089,6 +15240,9 @@ any [CatalogTax](entity:CatalogTax) objects that apply to it. ```typescript await client.catalog.object.get({ objectId: "object_id", + includeRelatedObjects: true, + catalogVersion: BigInt("1000000"), + includeCategoryPathToRoot: true, }); ``` @@ -14228,13 +15382,19 @@ Lists all payment links.
```typescript -const response = await client.checkout.paymentLinks.list(); +const response = await client.checkout.paymentLinks.list({ + cursor: "cursor", + limit: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.checkout.paymentLinks.list(); +let page = await client.checkout.paymentLinks.list({ + cursor: "cursor", + limit: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -14583,13 +15743,19 @@ seller-defined custom attributes (also known as custom fields) are always set to
```typescript -const response = await client.customers.customAttributeDefinitions.list(); +const response = await client.customers.customAttributeDefinitions.list({ + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.customers.customAttributeDefinitions.list(); +let page = await client.customers.customAttributeDefinitions.list({ + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -14744,6 +15910,7 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note t ```typescript await client.customers.customAttributeDefinitions.get({ key: "key", + version: 1, }); ``` @@ -15068,13 +16235,19 @@ Retrieves the list of customer groups of a business.
```typescript -const response = await client.customers.groups.list(); +const response = await client.customers.groups.list({ + cursor: "cursor", + limit: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.customers.groups.list(); +let page = await client.customers.groups.list({ + cursor: "cursor", + limit: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -15547,13 +16720,19 @@ Retrieves the list of customer segments of a business.
```typescript -const response = await client.customers.segments.list(); +const response = await client.customers.segments.list({ + cursor: "cursor", + limit: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.customers.segments.list(); +let page = await client.customers.segments.list({ + cursor: "cursor", + limit: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -15842,6 +17021,9 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript const response = await client.customers.customAttributes.list({ customerId: "customer_id", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); for await (const item of response) { console.log(item); @@ -15850,6 +17032,9 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.customers.customAttributes.list({ customerId: "customer_id", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -15926,6 +17111,8 @@ To retrieve a custom attribute owned by another application, the `visibility` se await client.customers.customAttributes.get({ customerId: "customer_id", key: "key", + withDefinition: true, + version: 1, }); ``` @@ -16138,13 +17325,23 @@ Lists all DeviceCodes associated with the merchant.
```typescript -const response = await client.devices.codes.list(); +const response = await client.devices.codes.list({ + cursor: "cursor", + locationId: "location_id", + productType: "TERMINAL_API", + status: "UNKNOWN", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.devices.codes.list(); +let page = await client.devices.codes.list({ + cursor: "cursor", + locationId: "location_id", + productType: "TERMINAL_API", + status: "UNKNOWN", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -16350,6 +17547,7 @@ Returns a list of evidence associated with a dispute. ```typescript const response = await client.disputes.evidence.list({ disputeId: "dispute_id", + cursor: "cursor", }); for await (const item of response) { console.log(item); @@ -16358,6 +17556,7 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.disputes.evidence.list({ disputeId: "dispute_id", + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -16564,13 +17763,31 @@ for all gift cards in a specific region, or for activities within a time window.
```typescript -const response = await client.giftCards.activities.list(); +const response = await client.giftCards.activities.list({ + giftCardId: "gift_card_id", + type: "type", + locationId: "location_id", + beginTime: "begin_time", + endTime: "end_time", + limit: 1, + cursor: "cursor", + sortOrder: "sort_order", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.giftCards.activities.list(); +let page = await client.giftCards.activities.list({ + giftCardId: "gift_card_id", + type: "type", + locationId: "location_id", + beginTime: "begin_time", + endTime: "end_time", + limit: 1, + cursor: "cursor", + sortOrder: "sort_order", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -16713,13 +17930,21 @@ Returns a paginated list of `BreakType` instances for a business.
```typescript -const response = await client.labor.breakTypes.list(); +const response = await client.labor.breakTypes.list({ + locationId: "location_id", + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.labor.breakTypes.list(); +let page = await client.labor.breakTypes.list({ + locationId: "location_id", + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -17075,13 +18300,21 @@ Returns a paginated list of `EmployeeWage` instances for a business.
```typescript -const response = await client.labor.employeeWages.list(); +const response = await client.labor.employeeWages.list({ + employeeId: "employee_id", + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.labor.employeeWages.list(); +let page = await client.labor.employeeWages.list({ + employeeId: "employee_id", + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -17648,13 +18881,21 @@ Returns a paginated list of `TeamMemberWage` instances for a business.
```typescript -const response = await client.labor.teamMemberWages.list(); +const response = await client.labor.teamMemberWages.list({ + teamMemberId: "team_member_id", + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.labor.teamMemberWages.list(); +let page = await client.labor.teamMemberWages.list({ + teamMemberId: "team_member_id", + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -17787,13 +19028,19 @@ Returns a list of `WorkweekConfig` instances for a business.
```typescript -const response = await client.labor.workweekConfigs.list(); +const response = await client.labor.workweekConfigs.list({ + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.labor.workweekConfigs.list(); +let page = await client.labor.workweekConfigs.list({ + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -17934,13 +19181,21 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`
```typescript -const response = await client.locations.customAttributeDefinitions.list(); +const response = await client.locations.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.locations.customAttributeDefinitions.list(); +let page = await client.locations.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -18089,6 +19344,7 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.locations.customAttributeDefinitions.get({ key: "key", + version: 1, }); ``` @@ -18474,6 +19730,10 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript const response = await client.locations.customAttributes.list({ locationId: "location_id", + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); for await (const item of response) { console.log(item); @@ -18482,6 +19742,10 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.locations.customAttributes.list({ locationId: "location_id", + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -18555,6 +19819,8 @@ To retrieve a custom attribute owned by another application, the `visibility` se await client.locations.customAttributes.get({ locationId: "location_id", key: "key", + withDefinition: true, + version: 1, }); ``` @@ -18769,6 +20035,10 @@ Max results per [page](https://developer.squareup.com/docs/working-with-apis/pag ```typescript await client.locations.transactions.list({ locationId: "location_id", + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "DESC", + cursor: "cursor", }); ``` @@ -19988,6 +21258,9 @@ Results are sorted by the `created_at` date in descending order (newest to oldes ```typescript const response = await client.loyalty.programs.promotions.list({ programId: "program_id", + status: "ACTIVE", + cursor: "cursor", + limit: 1, }); for await (const item of response) { console.log(item); @@ -19996,6 +21269,9 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.loyalty.programs.promotions.list({ programId: "program_id", + status: "ACTIVE", + cursor: "cursor", + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -20157,8 +21433,8 @@ Retrieves a loyalty promotion. ```typescript await client.loyalty.programs.promotions.get({ - promotionId: "promotion_id", programId: "program_id", + promotionId: "promotion_id", }); ``` @@ -20228,8 +21504,8 @@ This endpoint sets the loyalty promotion to the `CANCELED` state ```typescript await client.loyalty.programs.promotions.cancel({ - promotionId: "promotion_id", programId: "program_id", + promotionId: "promotion_id", }); ``` @@ -20298,13 +21574,21 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`
```typescript -const response = await client.merchants.customAttributeDefinitions.list(); +const response = await client.merchants.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.merchants.customAttributeDefinitions.list(); +let page = await client.merchants.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -20453,6 +21737,7 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.merchants.customAttributeDefinitions.get({ key: "key", + version: 1, }); ``` @@ -20828,6 +22113,10 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript const response = await client.merchants.customAttributes.list({ merchantId: "merchant_id", + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); for await (const item of response) { console.log(item); @@ -20836,6 +22125,10 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.merchants.customAttributes.list({ merchantId: "merchant_id", + visibilityFilter: "ALL", + limit: 1, + cursor: "cursor", + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -20909,6 +22202,8 @@ To retrieve a custom attribute owned by another application, the `visibility` se await client.merchants.customAttributes.get({ merchantId: "merchant_id", key: "key", + withDefinition: true, + version: 1, }); ``` @@ -21121,13 +22416,21 @@ seller-defined custom attributes (also known as custom fields) are always set to
```typescript -const response = await client.orders.customAttributeDefinitions.list(); +const response = await client.orders.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + cursor: "cursor", + limit: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.orders.customAttributeDefinitions.list(); +let page = await client.orders.customAttributeDefinitions.list({ + visibilityFilter: "ALL", + cursor: "cursor", + limit: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -21277,6 +22580,7 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note t ```typescript await client.orders.customAttributeDefinitions.get({ key: "key", + version: 1, }); ``` @@ -21673,6 +22977,10 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript const response = await client.orders.customAttributes.list({ orderId: "order_id", + visibilityFilter: "ALL", + cursor: "cursor", + limit: 1, + withDefinitions: true, }); for await (const item of response) { console.log(item); @@ -21681,6 +22989,10 @@ for await (const item of response) { // Or you can manually iterate page-by-page let page = await client.orders.customAttributes.list({ orderId: "order_id", + visibilityFilter: "ALL", + cursor: "cursor", + limit: 1, + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -21757,6 +23069,8 @@ also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. await client.orders.customAttributes.get({ orderId: "order_id", customAttributeKey: "custom_attribute_key", + version: 1, + withDefinition: true, }); ``` @@ -22973,7 +24287,9 @@ Lists all webhook event types that can be subscribed to.
```typescript -await client.webhooks.eventTypes.list(); +await client.webhooks.eventTypes.list({ + apiVersion: "api_version", +}); ```
@@ -23038,13 +24354,23 @@ Lists all webhook subscriptions owned by your application.
```typescript -const response = await client.webhooks.subscriptions.list(); +const response = await client.webhooks.subscriptions.list({ + cursor: "cursor", + includeDisabled: true, + sortOrder: "DESC", + limit: 1, +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.webhooks.subscriptions.list(); +let page = await client.webhooks.subscriptions.list({ + cursor: "cursor", + includeDisabled: true, + sortOrder: "DESC", + limit: 1, +}); while (page.hasNextPage()) { page = page.getNextPage(); } diff --git a/src/Client.ts b/src/Client.ts index 19d30e5b7..dfc978661 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -13,6 +13,7 @@ import { BankAccounts } from "./api/resources/bankAccounts/client/Client"; import { Bookings } from "./api/resources/bookings/client/Client"; import { Cards } from "./api/resources/cards/client/Client"; import { Catalog } from "./api/resources/catalog/client/Client"; +import { Channels } from "./api/resources/channels/client/Client"; import { Customers } from "./api/resources/customers/client/Client"; import { Devices } from "./api/resources/devices/client/Client"; import { Disputes } from "./api/resources/disputes/client/Client"; @@ -36,6 +37,7 @@ import { Subscriptions } from "./api/resources/subscriptions/client/Client"; import { TeamMembers } from "./api/resources/teamMembers/client/Client"; import { Team } from "./api/resources/team/client/Client"; import { Terminal } from "./api/resources/terminal/client/Client"; +import { TransferOrders } from "./api/resources/transferOrders/client/Client"; import { Vendors } from "./api/resources/vendors/client/Client"; import { CashDrawers } from "./api/resources/cashDrawers/client/Client"; import { Webhooks } from "./api/resources/webhooks/client/Client"; @@ -47,7 +49,7 @@ export declare namespace SquareClient { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -61,7 +63,7 @@ export declare namespace SquareClient { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -77,6 +79,7 @@ export class SquareClient { protected _bookings: Bookings | undefined; protected _cards: Cards | undefined; protected _catalog: Catalog | undefined; + protected _channels: Channels | undefined; protected _customers: Customers | undefined; protected _devices: Devices | undefined; protected _disputes: Disputes | undefined; @@ -100,6 +103,7 @@ export class SquareClient { protected _teamMembers: TeamMembers | undefined; protected _team: Team | undefined; protected _terminal: Terminal | undefined; + protected _transferOrders: TransferOrders | undefined; protected _vendors: Vendors | undefined; protected _cashDrawers: CashDrawers | undefined; protected _webhooks: Webhooks | undefined; @@ -109,11 +113,11 @@ export class SquareClient { ..._options, headers: mergeHeaders( { - "Square-Version": _options?.version ?? "2025-09-24", + "Square-Version": _options?.version ?? "2025-10-16", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "square", - "X-Fern-SDK-Version": "43.1.1", - "User-Agent": "square/43.1.1", + "X-Fern-SDK-Version": "43.1.0", + "User-Agent": "square/43.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -154,6 +158,10 @@ export class SquareClient { return (this._catalog ??= new Catalog(this._options)); } + public get channels(): Channels { + return (this._channels ??= new Channels(this._options)); + } + public get customers(): Customers { return (this._customers ??= new Customers(this._options)); } @@ -246,6 +254,10 @@ export class SquareClient { return (this._terminal ??= new Terminal(this._options)); } + public get transferOrders(): TransferOrders { + return (this._transferOrders ??= new TransferOrders(this._options)); + } + public get vendors(): Vendors { return (this._vendors ??= new Vendors(this._options)); } diff --git a/src/api/resources/applePay/client/Client.ts b/src/api/resources/applePay/client/Client.ts index c3d94787f..c22f1f0b2 100644 --- a/src/api/resources/applePay/client/Client.ts +++ b/src/api/resources/applePay/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace ApplePay { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace ApplePay { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -90,7 +90,7 @@ export class ApplePay { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bankAccounts/client/Client.ts b/src/api/resources/bankAccounts/client/Client.ts index 9b187eb16..6604d5b6f 100644 --- a/src/api/resources/bankAccounts/client/Client.ts +++ b/src/api/resources/bankAccounts/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace BankAccounts { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace BankAccounts { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,11 @@ export class BankAccounts { * @param {BankAccounts.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.bankAccounts.list() + * await client.bankAccounts.list({ + * cursor: "cursor", + * limit: 1, + * locationId: "location_id" + * }) */ public async list( request: Square.ListBankAccountsRequest = {}, @@ -83,7 +87,7 @@ export class BankAccounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -177,7 +181,7 @@ export class BankAccounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -261,7 +265,7 @@ export class BankAccounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts index b5ffadfe8..e7aa36957 100644 --- a/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * cursor: "cursor", + * limit: 1, + * locationId: "location_id" + * } */ export interface ListBankAccountsRequest { /** diff --git a/src/api/resources/bookings/client/Client.ts b/src/api/resources/bookings/client/Client.ts index bb61ca529..995525cbb 100644 --- a/src/api/resources/bookings/client/Client.ts +++ b/src/api/resources/bookings/client/Client.ts @@ -20,7 +20,7 @@ export declare namespace Bookings { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -34,7 +34,7 @@ export declare namespace Bookings { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -77,7 +77,15 @@ export class Bookings { * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.bookings.list() + * await client.bookings.list({ + * limit: 1, + * cursor: "cursor", + * customerId: "customer_id", + * teamMemberId: "team_member_id", + * locationId: "location_id", + * startAtMin: "start_at_min", + * startAtMax: "start_at_max" + * }) */ public async list( request: Square.ListBookingsRequest = {}, @@ -120,7 +128,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -226,7 +234,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -319,7 +327,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -410,7 +418,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -491,7 +499,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -574,7 +582,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -658,7 +666,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -750,7 +758,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -838,7 +846,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -931,7 +939,7 @@ export class Bookings { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bookings/client/requests/ListBookingsRequest.ts b/src/api/resources/bookings/client/requests/ListBookingsRequest.ts index e57f99b22..f8d24958d 100644 --- a/src/api/resources/bookings/client/requests/ListBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/ListBookingsRequest.ts @@ -4,7 +4,15 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: "cursor", + * customerId: "customer_id", + * teamMemberId: "team_member_id", + * locationId: "location_id", + * startAtMin: "start_at_min", + * startAtMax: "start_at_max" + * } */ export interface ListBookingsRequest { /** diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts index 0c3e2205e..c73c8d222 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributeDefinitions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributeDefinitions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -53,7 +53,10 @@ export class CustomAttributeDefinitions { * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.bookings.customAttributeDefinitions.list() + * await client.bookings.customAttributeDefinitions.list({ + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.bookings.ListCustomAttributeDefinitionsRequest = {}, @@ -83,7 +86,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -187,7 +190,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -252,7 +255,8 @@ export class CustomAttributeDefinitions { * * @example * await client.bookings.customAttributeDefinitions.get({ - * key: "key" + * key: "key", + * version: 1 * }) */ public get( @@ -284,7 +288,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -375,7 +379,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -470,7 +474,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 9b086bfb6..e4c05d712 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * key: "key" + * key: "key", + * version: 1 * } */ export interface GetCustomAttributeDefinitionsRequest { diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index ebdc049cc..ded39f5a0 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: "cursor" + * } */ export interface ListCustomAttributeDefinitionsRequest { /** diff --git a/src/api/resources/bookings/resources/customAttributes/client/Client.ts b/src/api/resources/bookings/resources/customAttributes/client/Client.ts index db77e7928..a96a72a7f 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -88,7 +88,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -187,7 +187,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -252,7 +252,10 @@ export class CustomAttributes { * * @example * await client.bookings.customAttributes.list({ - * bookingId: "booking_id" + * bookingId: "booking_id", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * }) */ public async list( @@ -286,7 +289,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -359,7 +362,9 @@ export class CustomAttributes { * @example * await client.bookings.customAttributes.get({ * bookingId: "booking_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * }) */ public get( @@ -395,7 +400,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -487,7 +492,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -583,7 +588,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index 540eb8c10..2dc919041 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -6,7 +6,9 @@ * @example * { * bookingId: "booking_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * } */ export interface GetCustomAttributesRequest { diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index ec23db686..bab55c3f7 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -5,7 +5,10 @@ /** * @example * { - * bookingId: "booking_id" + * bookingId: "booking_id", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * } */ export interface ListCustomAttributesRequest { diff --git a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts index 3ef976809..09dd6d406 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace LocationProfiles { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace LocationProfiles { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,10 @@ export class LocationProfiles { * @param {LocationProfiles.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.bookings.locationProfiles.list() + * await client.bookings.locationProfiles.list({ + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.bookings.ListLocationProfilesRequest = {}, @@ -80,7 +83,7 @@ export class LocationProfiles { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts b/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts index 1cc29a3f2..03d1b8bfc 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: "cursor" + * } */ export interface ListLocationProfilesRequest { /** diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts index 5841ae00e..d0f230f5f 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace TeamMemberProfiles { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace TeamMemberProfiles { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,12 @@ export class TeamMemberProfiles { * @param {TeamMemberProfiles.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.bookings.teamMemberProfiles.list() + * await client.bookings.teamMemberProfiles.list({ + * bookableOnly: true, + * limit: 1, + * cursor: "cursor", + * locationId: "location_id" + * }) */ public async list( request: Square.bookings.ListTeamMemberProfilesRequest = {}, @@ -86,7 +91,7 @@ export class TeamMemberProfiles { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -182,7 +187,7 @@ export class TeamMemberProfiles { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts index 126643f74..bb7d124ab 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts @@ -4,7 +4,12 @@ /** * @example - * {} + * { + * bookableOnly: true, + * limit: 1, + * cursor: "cursor", + * locationId: "location_id" + * } */ export interface ListTeamMemberProfilesRequest { /** diff --git a/src/api/resources/cards/client/Client.ts b/src/api/resources/cards/client/Client.ts index 7574d82d6..c11419162 100644 --- a/src/api/resources/cards/client/Client.ts +++ b/src/api/resources/cards/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Cards { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Cards { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -51,7 +51,13 @@ export class Cards { * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.cards.list() + * await client.cards.list({ + * cursor: "cursor", + * customerId: "customer_id", + * includeDisabled: true, + * referenceId: "reference_id", + * sortOrder: "DESC" + * }) */ public async list( request: Square.ListCardsRequest = {}, @@ -91,7 +97,7 @@ export class Cards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -198,7 +204,7 @@ export class Cards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -285,7 +291,7 @@ export class Cards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -367,7 +373,7 @@ export class Cards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/cards/client/requests/ListCardsRequest.ts b/src/api/resources/cards/client/requests/ListCardsRequest.ts index 44df40e49..ae1540aa5 100644 --- a/src/api/resources/cards/client/requests/ListCardsRequest.ts +++ b/src/api/resources/cards/client/requests/ListCardsRequest.ts @@ -6,7 +6,13 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * cursor: "cursor", + * customerId: "customer_id", + * includeDisabled: true, + * referenceId: "reference_id", + * sortOrder: "DESC" + * } */ export interface ListCardsRequest { /** diff --git a/src/api/resources/cashDrawers/client/Client.ts b/src/api/resources/cashDrawers/client/Client.ts index 5b580eb2a..bc71ccec3 100644 --- a/src/api/resources/cashDrawers/client/Client.ts +++ b/src/api/resources/cashDrawers/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace CashDrawers { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; diff --git a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts index 182fea033..090764a15 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Shifts { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Shifts { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -52,7 +52,12 @@ export class Shifts { * * @example * await client.cashDrawers.shifts.list({ - * locationId: "location_id" + * locationId: "location_id", + * sortOrder: "DESC", + * beginTime: "begin_time", + * endTime: "end_time", + * limit: 1, + * cursor: "cursor" * }) */ public async list( @@ -96,7 +101,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -196,7 +201,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -254,7 +259,9 @@ export class Shifts { * @example * await client.cashDrawers.shifts.listEvents({ * shiftId: "shift_id", - * locationId: "location_id" + * locationId: "location_id", + * limit: 1, + * cursor: "cursor" * }) */ public async listEvents( @@ -286,7 +293,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts index 33d092715..69d274f2b 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts @@ -6,7 +6,9 @@ * @example * { * shiftId: "shift_id", - * locationId: "location_id" + * locationId: "location_id", + * limit: 1, + * cursor: "cursor" * } */ export interface ListEventsShiftsRequest { diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts index a7ef994f1..711f5a9cf 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts @@ -7,7 +7,12 @@ import * as Square from "../../../../../../index"; /** * @example * { - * locationId: "location_id" + * locationId: "location_id", + * sortOrder: "DESC", + * beginTime: "begin_time", + * endTime: "end_time", + * limit: 1, + * cursor: "cursor" * } */ export interface ListShiftsRequest { diff --git a/src/api/resources/catalog/client/Client.ts b/src/api/resources/catalog/client/Client.ts index e1758f968..72b4c7b28 100644 --- a/src/api/resources/catalog/client/Client.ts +++ b/src/api/resources/catalog/client/Client.ts @@ -18,7 +18,7 @@ export declare namespace Catalog { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -32,7 +32,7 @@ export declare namespace Catalog { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -102,7 +102,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -194,7 +194,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -307,7 +307,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -387,7 +387,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -447,7 +447,11 @@ export class Catalog { * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.catalog.list() + * await client.catalog.list({ + * cursor: "cursor", + * types: "types", + * catalogVersion: BigInt("1000000") + * }) */ public async list( request: Square.ListCatalogRequest = {}, @@ -478,7 +482,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -587,7 +591,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -703,7 +707,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -795,7 +799,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -887,7 +891,7 @@ export class Catalog { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/catalog/client/requests/ListCatalogRequest.ts b/src/api/resources/catalog/client/requests/ListCatalogRequest.ts index 5a2363cda..def3b3f15 100644 --- a/src/api/resources/catalog/client/requests/ListCatalogRequest.ts +++ b/src/api/resources/catalog/client/requests/ListCatalogRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * cursor: "cursor", + * types: "types", + * catalogVersion: BigInt("1000000") + * } */ export interface ListCatalogRequest { /** diff --git a/src/api/resources/catalog/resources/images/client/Client.ts b/src/api/resources/catalog/resources/images/client/Client.ts index 29dfd4f09..dedc2fcf4 100644 --- a/src/api/resources/catalog/resources/images/client/Client.ts +++ b/src/api/resources/catalog/resources/images/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace Images { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace Images { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -99,7 +99,7 @@ export class Images { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", ..._maybeEncodedRequest.headers, }), requestOptions?.headers, @@ -204,7 +204,7 @@ export class Images { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", ..._maybeEncodedRequest.headers, }), requestOptions?.headers, diff --git a/src/api/resources/catalog/resources/object/client/Client.ts b/src/api/resources/catalog/resources/object/client/Client.ts index 2c126f730..51bb3c6c5 100644 --- a/src/api/resources/catalog/resources/object/client/Client.ts +++ b/src/api/resources/catalog/resources/object/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Object_ { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Object_ { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -85,7 +85,7 @@ export class Object_ { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -151,7 +151,10 @@ export class Object_ { * * @example * await client.catalog.object.get({ - * objectId: "object_id" + * objectId: "object_id", + * includeRelatedObjects: true, + * catalogVersion: BigInt("1000000"), + * includeCategoryPathToRoot: true * }) */ public get( @@ -191,7 +194,7 @@ export class Object_ { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -284,7 +287,7 @@ export class Object_ { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts index 0a008fb87..a39970258 100644 --- a/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts @@ -5,7 +5,10 @@ /** * @example * { - * objectId: "object_id" + * objectId: "object_id", + * includeRelatedObjects: true, + * catalogVersion: BigInt("1000000"), + * includeCategoryPathToRoot: true * } */ export interface GetObjectRequest { diff --git a/src/api/resources/channels/client/Client.ts b/src/api/resources/channels/client/Client.ts new file mode 100644 index 000000000..42016aa0d --- /dev/null +++ b/src/api/resources/channels/client/Client.ts @@ -0,0 +1,336 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as errors from "../../../../errors/index"; + +export declare namespace Channels { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-10-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-10-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } +} + +export class Channels { + protected readonly _options: Channels.Options; + + constructor(_options: Channels.Options = {}) { + this._options = _options; + } + + /** + * + * + * @param {Square.ListChannelsRequest} request + * @param {Channels.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.channels.list({ + * referenceType: "UNKNOWN_TYPE", + * referenceId: "reference_id", + * status: "ACTIVE", + * cursor: "cursor", + * limit: 1 + * }) + */ + public async list( + request: Square.ListChannelsRequest = {}, + requestOptions?: Channels.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async (request: Square.ListChannelsRequest): Promise> => { + const { referenceType, referenceId, status, cursor, limit } = request; + const _queryParams: Record = {}; + if (referenceType !== undefined) { + _queryParams["reference_type"] = serializers.ReferenceType.jsonOrThrow(referenceType, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }); + } + if (referenceId !== undefined) { + _queryParams["reference_id"] = referenceId; + } + if (status !== undefined) { + _queryParams["status"] = serializers.ChannelStatus.jsonOrThrow(status, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }); + } + if (cursor !== undefined) { + _queryParams["cursor"] = cursor; + } + if (limit !== undefined) { + _queryParams["limit"] = limit?.toString() ?? null; + } + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + "v2/channels", + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ListChannelsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError("Timeout exceeded when calling GET /v2/channels."); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Pageable({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.cursor != null && !(typeof response?.cursor === "string" && response?.cursor === ""), + getItems: (response) => response?.channels ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "cursor", response?.cursor)); + }, + }); + } + + /** + * + * + * @param {Square.BulkRetrieveChannelsRequest} request + * @param {Channels.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.channels.bulkRetrieve({ + * channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] + * }) + */ + public bulkRetrieve( + request: Square.BulkRetrieveChannelsRequest, + requestOptions?: Channels.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__bulkRetrieve(request, requestOptions)); + } + + private async __bulkRetrieve( + request: Square.BulkRetrieveChannelsRequest, + requestOptions?: Channels.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + "v2/channels/bulk-retrieve", + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.BulkRetrieveChannelsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.BulkRetrieveChannelsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError("Timeout exceeded when calling POST /v2/channels/bulk-retrieve."); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * + * + * @param {Square.GetChannelsRequest} request + * @param {Channels.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.channels.get({ + * channelId: "channel_id" + * }) + */ + public get( + request: Square.GetChannelsRequest, + requestOptions?: Channels.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + } + + private async __get( + request: Square.GetChannelsRequest, + requestOptions?: Channels.RequestOptions, + ): Promise> { + const { channelId } = request; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/channels/${encodeURIComponent(channelId)}`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.RetrieveChannelResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError("Timeout exceeded when calling GET /v2/channels/{channel_id}."); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + if (bearer != null) { + return `Bearer ${bearer}`; + } + + return undefined; + } +} diff --git a/src/api/resources/channels/client/index.ts b/src/api/resources/channels/client/index.ts new file mode 100644 index 000000000..f33205a0f --- /dev/null +++ b/src/api/resources/channels/client/index.ts @@ -0,0 +1,2 @@ +export {}; +export * from "./requests"; diff --git a/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts b/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts new file mode 100644 index 000000000..42c908fd0 --- /dev/null +++ b/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] + * } + */ +export interface BulkRetrieveChannelsRequest { + channelIds: string[]; +} diff --git a/src/api/resources/channels/client/requests/GetChannelsRequest.ts b/src/api/resources/channels/client/requests/GetChannelsRequest.ts new file mode 100644 index 000000000..eb452888a --- /dev/null +++ b/src/api/resources/channels/client/requests/GetChannelsRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * channelId: "channel_id" + * } + */ +export interface GetChannelsRequest { + /** + * A channel id + */ + channelId: string; +} diff --git a/src/api/resources/channels/client/requests/ListChannelsRequest.ts b/src/api/resources/channels/client/requests/ListChannelsRequest.ts new file mode 100644 index 000000000..52e45208d --- /dev/null +++ b/src/api/resources/channels/client/requests/ListChannelsRequest.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../../../../index"; + +/** + * @example + * { + * referenceType: "UNKNOWN_TYPE", + * referenceId: "reference_id", + * status: "ACTIVE", + * cursor: "cursor", + * limit: 1 + * } + */ +export interface ListChannelsRequest { + /** + * Type of reference associated to channel + */ + referenceType?: Square.ReferenceType | null; + /** + * id of reference associated to channel + */ + referenceId?: string | null; + /** + * Status of channel + */ + status?: Square.ChannelStatus | null; + /** + * Cursor to fetch the next result + */ + cursor?: string | null; + /** + * Maximum number of results to return. + * When not provided the returned results will be cap at 100 channels. + */ + limit?: number | null; +} diff --git a/src/api/resources/channels/client/requests/index.ts b/src/api/resources/channels/client/requests/index.ts new file mode 100644 index 000000000..8255049a1 --- /dev/null +++ b/src/api/resources/channels/client/requests/index.ts @@ -0,0 +1,3 @@ +export { type ListChannelsRequest } from "./ListChannelsRequest"; +export { type BulkRetrieveChannelsRequest } from "./BulkRetrieveChannelsRequest"; +export { type GetChannelsRequest } from "./GetChannelsRequest"; diff --git a/src/api/resources/channels/index.ts b/src/api/resources/channels/index.ts new file mode 100644 index 000000000..5ec76921e --- /dev/null +++ b/src/api/resources/channels/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/checkout/client/Client.ts b/src/api/resources/checkout/client/Client.ts index ed4bded17..80aca7915 100644 --- a/src/api/resources/checkout/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace Checkout { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace Checkout { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -84,7 +84,7 @@ export class Checkout { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -168,7 +168,7 @@ export class Checkout { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -251,7 +251,7 @@ export class Checkout { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -333,7 +333,7 @@ export class Checkout { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts index 74fa15dbd..0cab603d1 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace PaymentLinks { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace PaymentLinks { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,10 @@ export class PaymentLinks { * @param {PaymentLinks.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.checkout.paymentLinks.list() + * await client.checkout.paymentLinks.list({ + * cursor: "cursor", + * limit: 1 + * }) */ public async list( request: Square.checkout.ListPaymentLinksRequest = {}, @@ -80,7 +83,7 @@ export class PaymentLinks { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -183,7 +186,7 @@ export class PaymentLinks { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -272,7 +275,7 @@ export class PaymentLinks { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -363,7 +366,7 @@ export class PaymentLinks { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -452,7 +455,7 @@ export class PaymentLinks { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts index eda441448..ebcb3acd2 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * cursor: "cursor", + * limit: 1 + * } */ export interface ListPaymentLinksRequest { /** diff --git a/src/api/resources/customers/client/Client.ts b/src/api/resources/customers/client/Client.ts index bf3c05dd8..90c71fbaa 100644 --- a/src/api/resources/customers/client/Client.ts +++ b/src/api/resources/customers/client/Client.ts @@ -21,7 +21,7 @@ export declare namespace Customers { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -35,7 +35,7 @@ export declare namespace Customers { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -84,7 +84,13 @@ export class Customers { * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.customers.list() + * await client.customers.list({ + * cursor: "cursor", + * limit: 1, + * sortField: "DEFAULT", + * sortOrder: "DESC", + * count: true + * }) */ public async list( request: Square.ListCustomersRequest = {}, @@ -129,7 +135,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -244,7 +250,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -373,7 +379,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -461,7 +467,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -549,7 +555,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -648,7 +654,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -764,7 +770,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -851,7 +857,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -938,7 +944,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1000,7 +1006,8 @@ export class Customers { * * @example * await client.customers.delete({ - * customerId: "customer_id" + * customerId: "customer_id", + * version: BigInt("1000000") * }) */ public delete( @@ -1032,7 +1039,7 @@ export class Customers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts b/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts index af3a62bb6..7e0dc540a 100644 --- a/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * customerId: "customer_id" + * customerId: "customer_id", + * version: BigInt("1000000") * } */ export interface DeleteCustomersRequest { diff --git a/src/api/resources/customers/client/requests/ListCustomersRequest.ts b/src/api/resources/customers/client/requests/ListCustomersRequest.ts index 6d319949c..c10f2c512 100644 --- a/src/api/resources/customers/client/requests/ListCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/ListCustomersRequest.ts @@ -6,7 +6,13 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * cursor: "cursor", + * limit: 1, + * sortField: "DEFAULT", + * sortOrder: "DESC", + * count: true + * } */ export interface ListCustomersRequest { /** diff --git a/src/api/resources/customers/resources/cards/client/Client.ts b/src/api/resources/customers/resources/cards/client/Client.ts index 856308c40..5758d6dca 100644 --- a/src/api/resources/customers/resources/cards/client/Client.ts +++ b/src/api/resources/customers/resources/cards/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Cards { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Cards { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -92,7 +92,7 @@ export class Cards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -182,7 +182,7 @@ export class Cards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts index c181fe772..20e37876d 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributeDefinitions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributeDefinitions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -55,7 +55,10 @@ export class CustomAttributeDefinitions { * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.customers.customAttributeDefinitions.list() + * await client.customers.customAttributeDefinitions.list({ + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.customers.ListCustomAttributeDefinitionsRequest = {}, @@ -85,7 +88,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -201,7 +204,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -267,7 +270,8 @@ export class CustomAttributeDefinitions { * * @example * await client.customers.customAttributeDefinitions.get({ - * key: "key" + * key: "key", + * version: 1 * }) */ public get( @@ -299,7 +303,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -393,7 +397,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -487,7 +491,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -618,7 +622,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 9b086bfb6..e4c05d712 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * key: "key" + * key: "key", + * version: 1 * } */ export interface GetCustomAttributeDefinitionsRequest { diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index ebdc049cc..ded39f5a0 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: "cursor" + * } */ export interface ListCustomAttributeDefinitionsRequest { /** diff --git a/src/api/resources/customers/resources/customAttributes/client/Client.ts b/src/api/resources/customers/resources/customAttributes/client/Client.ts index e7c1b22ac..1f255afb0 100644 --- a/src/api/resources/customers/resources/customAttributes/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -58,7 +58,10 @@ export class CustomAttributes { * * @example * await client.customers.customAttributes.list({ - * customerId: "customer_id" + * customerId: "customer_id", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * }) */ public async list( @@ -92,7 +95,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -169,7 +172,9 @@ export class CustomAttributes { * @example * await client.customers.customAttributes.get({ * customerId: "customer_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * }) */ public get( @@ -205,7 +210,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -301,7 +306,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -395,7 +400,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index f59d7efa3..dec991b8a 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -6,7 +6,9 @@ * @example * { * customerId: "customer_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * } */ export interface GetCustomAttributesRequest { diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 505056267..61d16f54a 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -5,7 +5,10 @@ /** * @example * { - * customerId: "customer_id" + * customerId: "customer_id", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * } */ export interface ListCustomAttributesRequest { diff --git a/src/api/resources/customers/resources/groups/client/Client.ts b/src/api/resources/customers/resources/groups/client/Client.ts index b3307543e..12c75283d 100644 --- a/src/api/resources/customers/resources/groups/client/Client.ts +++ b/src/api/resources/customers/resources/groups/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Groups { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Groups { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,10 @@ export class Groups { * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.customers.groups.list() + * await client.customers.groups.list({ + * cursor: "cursor", + * limit: 1 + * }) */ public async list( request: Square.customers.ListGroupsRequest = {}, @@ -80,7 +83,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -177,7 +180,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -264,7 +267,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -350,7 +353,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -439,7 +442,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -526,7 +529,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -613,7 +616,7 @@ export class Groups { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts index f5e1b638e..8f5ce9765 100644 --- a/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * cursor: "cursor", + * limit: 1 + * } */ export interface ListGroupsRequest { /** diff --git a/src/api/resources/customers/resources/segments/client/Client.ts b/src/api/resources/customers/resources/segments/client/Client.ts index a7e416fe4..8417890ef 100644 --- a/src/api/resources/customers/resources/segments/client/Client.ts +++ b/src/api/resources/customers/resources/segments/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Segments { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Segments { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,10 @@ export class Segments { * @param {Segments.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.customers.segments.list() + * await client.customers.segments.list({ + * cursor: "cursor", + * limit: 1 + * }) */ public async list( request: Square.customers.ListSegmentsRequest = {}, @@ -80,7 +83,7 @@ export class Segments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -176,7 +179,7 @@ export class Segments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts b/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts index 259e1b80f..4ee529a9f 100644 --- a/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts +++ b/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * cursor: "cursor", + * limit: 1 + * } */ export interface ListSegmentsRequest { /** diff --git a/src/api/resources/devices/client/Client.ts b/src/api/resources/devices/client/Client.ts index db4ef046b..b84a26b5b 100644 --- a/src/api/resources/devices/client/Client.ts +++ b/src/api/resources/devices/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace Devices { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace Devices { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -57,7 +57,12 @@ export class Devices { * @param {Devices.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.devices.list() + * await client.devices.list({ + * cursor: "cursor", + * sortOrder: "DESC", + * limit: 1, + * locationId: "location_id" + * }) */ public async list( request: Square.ListDevicesRequest = {}, @@ -94,7 +99,7 @@ export class Devices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -188,7 +193,7 @@ export class Devices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/devices/client/requests/ListDevicesRequest.ts b/src/api/resources/devices/client/requests/ListDevicesRequest.ts index 323d264f4..299bd9ec4 100644 --- a/src/api/resources/devices/client/requests/ListDevicesRequest.ts +++ b/src/api/resources/devices/client/requests/ListDevicesRequest.ts @@ -6,7 +6,12 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * cursor: "cursor", + * sortOrder: "DESC", + * limit: 1, + * locationId: "location_id" + * } */ export interface ListDevicesRequest { /** diff --git a/src/api/resources/devices/resources/codes/client/Client.ts b/src/api/resources/devices/resources/codes/client/Client.ts index 1e9b92476..84c30d8f6 100644 --- a/src/api/resources/devices/resources/codes/client/Client.ts +++ b/src/api/resources/devices/resources/codes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Codes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Codes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,12 @@ export class Codes { * @param {Codes.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.devices.codes.list() + * await client.devices.codes.list({ + * cursor: "cursor", + * locationId: "location_id", + * productType: "TERMINAL_API", + * status: "UNKNOWN" + * }) */ public async list( request: Square.devices.ListCodesRequest = {}, @@ -92,7 +97,7 @@ export class Codes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -191,7 +196,7 @@ export class Codes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -278,7 +283,7 @@ export class Codes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts b/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts index dcb084347..c7e5d8399 100644 --- a/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts @@ -6,7 +6,12 @@ import * as Square from "../../../../../../index"; /** * @example - * {} + * { + * cursor: "cursor", + * locationId: "location_id", + * productType: "TERMINAL_API", + * status: "UNKNOWN" + * } */ export interface ListCodesRequest { /** diff --git a/src/api/resources/disputes/client/Client.ts b/src/api/resources/disputes/client/Client.ts index 384b8492f..905d9ad14 100644 --- a/src/api/resources/disputes/client/Client.ts +++ b/src/api/resources/disputes/client/Client.ts @@ -18,7 +18,7 @@ export declare namespace Disputes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -32,7 +32,7 @@ export declare namespace Disputes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -57,7 +57,11 @@ export class Disputes { * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.disputes.list() + * await client.disputes.list({ + * cursor: "cursor", + * states: "INQUIRY_EVIDENCE_REQUIRED", + * locationId: "location_id" + * }) */ public async list( request: Square.ListDisputesRequest = {}, @@ -91,7 +95,7 @@ export class Disputes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -185,7 +189,7 @@ export class Disputes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -270,7 +274,7 @@ export class Disputes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -371,7 +375,7 @@ export class Disputes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", ..._maybeEncodedRequest.headers, }), requestOptions?.headers, @@ -461,7 +465,7 @@ export class Disputes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -556,7 +560,7 @@ export class Disputes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/disputes/client/requests/ListDisputesRequest.ts b/src/api/resources/disputes/client/requests/ListDisputesRequest.ts index eb1e6a560..228295073 100644 --- a/src/api/resources/disputes/client/requests/ListDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/ListDisputesRequest.ts @@ -6,7 +6,11 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * cursor: "cursor", + * states: "INQUIRY_EVIDENCE_REQUIRED", + * locationId: "location_id" + * } */ export interface ListDisputesRequest { /** diff --git a/src/api/resources/disputes/resources/evidence/client/Client.ts b/src/api/resources/disputes/resources/evidence/client/Client.ts index 27d03dedb..d8d7bfb9c 100644 --- a/src/api/resources/disputes/resources/evidence/client/Client.ts +++ b/src/api/resources/disputes/resources/evidence/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Evidence { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Evidence { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -51,7 +51,8 @@ export class Evidence { * * @example * await client.disputes.evidence.list({ - * disputeId: "dispute_id" + * disputeId: "dispute_id", + * cursor: "cursor" * }) */ public async list( @@ -79,7 +80,7 @@ export class Evidence { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -178,7 +179,7 @@ export class Evidence { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -263,7 +264,7 @@ export class Evidence { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts index 2a603aa53..b7dcdf22a 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * disputeId: "dispute_id" + * disputeId: "dispute_id", + * cursor: "cursor" * } */ export interface ListEvidenceRequest { diff --git a/src/api/resources/employees/client/Client.ts b/src/api/resources/employees/client/Client.ts index bcd53029d..2c3743bfd 100644 --- a/src/api/resources/employees/client/Client.ts +++ b/src/api/resources/employees/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Employees { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Employees { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,12 @@ export class Employees { * @param {Employees.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.employees.list() + * await client.employees.list({ + * locationId: "location_id", + * status: "ACTIVE", + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.ListEmployeesRequest = {}, @@ -89,7 +94,7 @@ export class Employees { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -183,7 +188,7 @@ export class Employees { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/employees/client/requests/ListEmployeesRequest.ts b/src/api/resources/employees/client/requests/ListEmployeesRequest.ts index 78453e229..1a727fa8e 100644 --- a/src/api/resources/employees/client/requests/ListEmployeesRequest.ts +++ b/src/api/resources/employees/client/requests/ListEmployeesRequest.ts @@ -6,7 +6,12 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * locationId: "location_id", + * status: "ACTIVE", + * limit: 1, + * cursor: "cursor" + * } */ export interface ListEmployeesRequest { /** diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index 22aabb86c..11aeda797 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Events { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Events { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -75,7 +75,7 @@ export class Events { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -158,7 +158,7 @@ export class Events { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -231,7 +231,7 @@ export class Events { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -284,7 +284,9 @@ export class Events { * @param {Events.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.events.listEventTypes() + * await client.events.listEventTypes({ + * apiVersion: "api_version" + * }) */ public listEventTypes( request: Square.ListEventTypesRequest = {}, @@ -315,7 +317,7 @@ export class Events { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/events/client/requests/ListEventTypesRequest.ts b/src/api/resources/events/client/requests/ListEventTypesRequest.ts index 58176164e..dacf1b022 100644 --- a/src/api/resources/events/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/events/client/requests/ListEventTypesRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * apiVersion: "api_version" + * } */ export interface ListEventTypesRequest { /** diff --git a/src/api/resources/giftCards/client/Client.ts b/src/api/resources/giftCards/client/Client.ts index 4e9e20593..4276c4951 100644 --- a/src/api/resources/giftCards/client/Client.ts +++ b/src/api/resources/giftCards/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace GiftCards { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace GiftCards { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -57,7 +57,13 @@ export class GiftCards { * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.giftCards.list() + * await client.giftCards.list({ + * type: "type", + * state: "state", + * limit: 1, + * cursor: "cursor", + * customerId: "customer_id" + * }) */ public async list( request: Square.ListGiftCardsRequest = {}, @@ -96,7 +102,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -197,7 +203,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -283,7 +289,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -369,7 +375,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -457,7 +463,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -547,7 +553,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -636,7 +642,7 @@ export class GiftCards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts b/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts index 2a4b28c88..6d23cec0d 100644 --- a/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts +++ b/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts @@ -4,7 +4,13 @@ /** * @example - * {} + * { + * type: "type", + * state: "state", + * limit: 1, + * cursor: "cursor", + * customerId: "customer_id" + * } */ export interface ListGiftCardsRequest { /** diff --git a/src/api/resources/giftCards/resources/activities/client/Client.ts b/src/api/resources/giftCards/resources/activities/client/Client.ts index 0bd5bd348..d7ac9af25 100644 --- a/src/api/resources/giftCards/resources/activities/client/Client.ts +++ b/src/api/resources/giftCards/resources/activities/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Activities { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Activities { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -53,7 +53,16 @@ export class Activities { * @param {Activities.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.giftCards.activities.list() + * await client.giftCards.activities.list({ + * giftCardId: "gift_card_id", + * type: "type", + * locationId: "location_id", + * beginTime: "begin_time", + * endTime: "end_time", + * limit: 1, + * cursor: "cursor", + * sortOrder: "sort_order" + * }) */ public async list( request: Square.giftCards.ListActivitiesRequest = {}, @@ -101,7 +110,7 @@ export class Activities { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -206,7 +215,7 @@ export class Activities { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts b/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts index ef91964a1..88a40604c 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts @@ -4,7 +4,16 @@ /** * @example - * {} + * { + * giftCardId: "gift_card_id", + * type: "type", + * locationId: "location_id", + * beginTime: "begin_time", + * endTime: "end_time", + * limit: 1, + * cursor: "cursor", + * sortOrder: "sort_order" + * } */ export interface ListActivitiesRequest { /** diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 23678d5af..84c19b91c 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -6,6 +6,7 @@ export * as bankAccounts from "./bankAccounts"; export * as bookings from "./bookings"; export * as cards from "./cards"; export * as catalog from "./catalog"; +export * as channels from "./channels"; export * as customers from "./customers"; export * as devices from "./devices"; export * as disputes from "./disputes"; @@ -29,6 +30,7 @@ export * as subscriptions from "./subscriptions"; export * as teamMembers from "./teamMembers"; export * as team from "./team"; export * as terminal from "./terminal"; +export * as transferOrders from "./transferOrders"; export * as vendors from "./vendors"; export * as cashDrawers from "./cashDrawers"; export * as webhooks from "./webhooks"; @@ -40,6 +42,7 @@ export * from "./bankAccounts/client/requests"; export * from "./bookings/client/requests"; export * from "./cards/client/requests"; export * from "./catalog/client/requests"; +export * from "./channels/client/requests"; export * from "./customers/client/requests"; export * from "./devices/client/requests"; export * from "./disputes/client/requests"; @@ -62,4 +65,5 @@ export * from "./subscriptions/client/requests"; export * from "./teamMembers/client/requests"; export * from "./team/client/requests"; export * from "./terminal/client/requests"; +export * from "./transferOrders/client/requests"; export * from "./vendors/client/requests"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index 7f471db53..71bd63bff 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Inventory { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Inventory { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -79,7 +79,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -163,7 +163,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -259,7 +259,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -351,7 +351,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -442,7 +442,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -547,7 +547,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -644,7 +644,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -753,7 +753,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -855,7 +855,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -939,7 +939,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1023,7 +1023,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1082,7 +1082,9 @@ export class Inventory { * * @example * await client.inventory.get({ - * catalogObjectId: "catalog_object_id" + * catalogObjectId: "catalog_object_id", + * locationIds: "location_ids", + * cursor: "cursor" * }) */ public async get( @@ -1113,7 +1115,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1194,7 +1196,9 @@ export class Inventory { * * @example * await client.inventory.changes({ - * catalogObjectId: "catalog_object_id" + * catalogObjectId: "catalog_object_id", + * locationIds: "location_ids", + * cursor: "cursor" * }) */ public async changes( @@ -1225,7 +1229,7 @@ export class Inventory { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts b/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts index 0ecaff2d6..4be1ccbc5 100644 --- a/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts @@ -5,7 +5,9 @@ /** * @example * { - * catalogObjectId: "catalog_object_id" + * catalogObjectId: "catalog_object_id", + * locationIds: "location_ids", + * cursor: "cursor" * } */ export interface ChangesInventoryRequest { diff --git a/src/api/resources/inventory/client/requests/GetInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetInventoryRequest.ts index 7d4dab332..c4cb90342 100644 --- a/src/api/resources/inventory/client/requests/GetInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetInventoryRequest.ts @@ -5,7 +5,9 @@ /** * @example * { - * catalogObjectId: "catalog_object_id" + * catalogObjectId: "catalog_object_id", + * locationIds: "location_ids", + * cursor: "cursor" * } */ export interface GetInventoryRequest { diff --git a/src/api/resources/invoices/client/Client.ts b/src/api/resources/invoices/client/Client.ts index 5f93306c5..acd3f9d89 100644 --- a/src/api/resources/invoices/client/Client.ts +++ b/src/api/resources/invoices/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace Invoices { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace Invoices { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -54,7 +54,9 @@ export class Invoices { * * @example * await client.invoices.list({ - * locationId: "location_id" + * locationId: "location_id", + * cursor: "cursor", + * limit: 1 * }) */ public async list( @@ -84,7 +86,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -221,7 +223,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -323,7 +325,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -410,7 +412,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -502,7 +504,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -564,7 +566,8 @@ export class Invoices { * * @example * await client.invoices.delete({ - * invoiceId: "invoice_id" + * invoiceId: "invoice_id", + * version: 1 * }) */ public delete( @@ -596,7 +599,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -702,7 +705,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", ..._maybeEncodedRequest.headers, }), requestOptions?.headers, @@ -791,7 +794,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -878,7 +881,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -982,7 +985,7 @@ export class Invoices { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts b/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts index 2cf9546a6..97e237452 100644 --- a/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * invoiceId: "invoice_id" + * invoiceId: "invoice_id", + * version: 1 * } */ export interface DeleteInvoicesRequest { diff --git a/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts b/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts index d38f8f30a..501cde386 100644 --- a/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts @@ -5,7 +5,9 @@ /** * @example * { - * locationId: "location_id" + * locationId: "location_id", + * cursor: "cursor", + * limit: 1 * } */ export interface ListInvoicesRequest { diff --git a/src/api/resources/labor/client/Client.ts b/src/api/resources/labor/client/Client.ts index cb58539c6..c30f736c2 100644 --- a/src/api/resources/labor/client/Client.ts +++ b/src/api/resources/labor/client/Client.ts @@ -21,7 +21,7 @@ export declare namespace Labor { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -35,7 +35,7 @@ export declare namespace Labor { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -125,7 +125,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -219,7 +219,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -318,7 +318,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -407,7 +407,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -511,7 +511,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -604,7 +604,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -735,7 +735,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -846,7 +846,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -933,7 +933,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1049,7 +1049,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1136,7 +1136,7 @@ export class Labor { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/labor/resources/breakTypes/client/Client.ts b/src/api/resources/labor/resources/breakTypes/client/Client.ts index b67c613d7..40c6efed1 100644 --- a/src/api/resources/labor/resources/breakTypes/client/Client.ts +++ b/src/api/resources/labor/resources/breakTypes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace BreakTypes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace BreakTypes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,11 @@ export class BreakTypes { * @param {BreakTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.labor.breakTypes.list() + * await client.labor.breakTypes.list({ + * locationId: "location_id", + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.labor.ListBreakTypesRequest = {}, @@ -83,7 +87,7 @@ export class BreakTypes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -195,7 +199,7 @@ export class BreakTypes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -282,7 +286,7 @@ export class BreakTypes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -370,7 +374,7 @@ export class BreakTypes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -459,7 +463,7 @@ export class BreakTypes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts index 8786dd752..f8d653dfc 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * locationId: "location_id", + * limit: 1, + * cursor: "cursor" + * } */ export interface ListBreakTypesRequest { /** diff --git a/src/api/resources/labor/resources/employeeWages/client/Client.ts b/src/api/resources/labor/resources/employeeWages/client/Client.ts index edd3ca44c..9335b4cf0 100644 --- a/src/api/resources/labor/resources/employeeWages/client/Client.ts +++ b/src/api/resources/labor/resources/employeeWages/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace EmployeeWages { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace EmployeeWages { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,11 @@ export class EmployeeWages { * @param {EmployeeWages.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.labor.employeeWages.list() + * await client.labor.employeeWages.list({ + * employeeId: "employee_id", + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.labor.ListEmployeeWagesRequest = {}, @@ -83,7 +87,7 @@ export class EmployeeWages { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -179,7 +183,7 @@ export class EmployeeWages { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts b/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts index cf1e2232d..24a7da1d0 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * employeeId: "employee_id", + * limit: 1, + * cursor: "cursor" + * } */ export interface ListEmployeeWagesRequest { /** diff --git a/src/api/resources/labor/resources/shifts/client/Client.ts b/src/api/resources/labor/resources/shifts/client/Client.ts index a413facbc..51b3518ce 100644 --- a/src/api/resources/labor/resources/shifts/client/Client.ts +++ b/src/api/resources/labor/resources/shifts/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Shifts { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Shifts { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -120,7 +120,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -231,7 +231,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -318,7 +318,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -433,7 +433,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -520,7 +520,7 @@ export class Shifts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts index 6d1a5c8a1..7d903d3c5 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace TeamMemberWages { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace TeamMemberWages { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,11 @@ export class TeamMemberWages { * @param {TeamMemberWages.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.labor.teamMemberWages.list() + * await client.labor.teamMemberWages.list({ + * teamMemberId: "team_member_id", + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.labor.ListTeamMemberWagesRequest = {}, @@ -83,7 +87,7 @@ export class TeamMemberWages { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -179,7 +183,7 @@ export class TeamMemberWages { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts index df32649b6..4bdcfeb7a 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts @@ -4,7 +4,11 @@ /** * @example - * {} + * { + * teamMemberId: "team_member_id", + * limit: 1, + * cursor: "cursor" + * } */ export interface ListTeamMemberWagesRequest { /** diff --git a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts index c6b4a3f98..deab7baab 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace WorkweekConfigs { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace WorkweekConfigs { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,10 @@ export class WorkweekConfigs { * @param {WorkweekConfigs.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.labor.workweekConfigs.list() + * await client.labor.workweekConfigs.list({ + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.labor.ListWorkweekConfigsRequest = {}, @@ -80,7 +83,7 @@ export class WorkweekConfigs { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -181,7 +184,7 @@ export class WorkweekConfigs { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts index 606f88dfa..2f8a70af2 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts @@ -4,7 +4,10 @@ /** * @example - * {} + * { + * limit: 1, + * cursor: "cursor" + * } */ export interface ListWorkweekConfigsRequest { /** diff --git a/src/api/resources/locations/client/Client.ts b/src/api/resources/locations/client/Client.ts index 18fa9a7e1..77b9640d7 100644 --- a/src/api/resources/locations/client/Client.ts +++ b/src/api/resources/locations/client/Client.ts @@ -19,7 +19,7 @@ export declare namespace Locations { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -33,7 +33,7 @@ export declare namespace Locations { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -89,7 +89,7 @@ export class Locations { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -184,7 +184,7 @@ export class Locations { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -272,7 +272,7 @@ export class Locations { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -371,7 +371,7 @@ export class Locations { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -538,7 +538,7 @@ export class Locations { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts index d5e85b31f..dfb270ca4 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributeDefinitions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributeDefinitions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -53,7 +53,11 @@ export class CustomAttributeDefinitions { * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.locations.customAttributeDefinitions.list() + * await client.locations.customAttributeDefinitions.list({ + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.locations.ListCustomAttributeDefinitionsRequest = {}, @@ -89,7 +93,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -201,7 +205,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -265,7 +269,8 @@ export class CustomAttributeDefinitions { * * @example * await client.locations.customAttributeDefinitions.get({ - * key: "key" + * key: "key", + * version: 1 * }) */ public get( @@ -297,7 +302,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -388,7 +393,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -480,7 +485,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 9b086bfb6..e4c05d712 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * key: "key" + * key: "key", + * version: 1 * } */ export interface GetCustomAttributeDefinitionsRequest { diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 313ea4854..4818482a3 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -6,7 +6,11 @@ import * as Square from "../../../../../../index"; /** * @example - * {} + * { + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor" + * } */ export interface ListCustomAttributeDefinitionsRequest { /** diff --git a/src/api/resources/locations/resources/customAttributes/client/Client.ts b/src/api/resources/locations/resources/customAttributes/client/Client.ts index 881484463..9ce72fa20 100644 --- a/src/api/resources/locations/resources/customAttributes/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -89,7 +89,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -208,7 +208,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -275,7 +275,11 @@ export class CustomAttributes { * * @example * await client.locations.customAttributes.list({ - * locationId: "location_id" + * locationId: "location_id", + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * }) */ public async list( @@ -315,7 +319,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -389,7 +393,9 @@ export class CustomAttributes { * @example * await client.locations.customAttributes.get({ * locationId: "location_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * }) */ public get( @@ -425,7 +431,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -518,7 +524,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -610,7 +616,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index da1c7c505..7ca5414a6 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -6,7 +6,9 @@ * @example * { * locationId: "location_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * } */ export interface GetCustomAttributesRequest { diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index f573b8c2e..a7f35f860 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -7,7 +7,11 @@ import * as Square from "../../../../../../index"; /** * @example * { - * locationId: "location_id" + * locationId: "location_id", + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * } */ export interface ListCustomAttributesRequest { diff --git a/src/api/resources/locations/resources/transactions/client/Client.ts b/src/api/resources/locations/resources/transactions/client/Client.ts index 9611fb25c..6fbea9efd 100644 --- a/src/api/resources/locations/resources/transactions/client/Client.ts +++ b/src/api/resources/locations/resources/transactions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Transactions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Transactions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -56,7 +56,11 @@ export class Transactions { * * @example * await client.locations.transactions.list({ - * locationId: "location_id" + * locationId: "location_id", + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "DESC", + * cursor: "cursor" * }) */ public list( @@ -103,7 +107,7 @@ export class Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -188,7 +192,7 @@ export class Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -277,7 +281,7 @@ export class Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -366,7 +370,7 @@ export class Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts index db18e708a..9a850cf0b 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts @@ -7,7 +7,11 @@ import * as Square from "../../../../../../index"; /** * @example * { - * locationId: "location_id" + * locationId: "location_id", + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "DESC", + * cursor: "cursor" * } */ export interface ListTransactionsRequest { diff --git a/src/api/resources/loyalty/client/Client.ts b/src/api/resources/loyalty/client/Client.ts index b586afbe2..30c776228 100644 --- a/src/api/resources/loyalty/client/Client.ts +++ b/src/api/resources/loyalty/client/Client.ts @@ -19,7 +19,7 @@ export declare namespace Loyalty { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -33,7 +33,7 @@ export declare namespace Loyalty { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -109,7 +109,7 @@ export class Loyalty { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/loyalty/resources/accounts/client/Client.ts b/src/api/resources/loyalty/resources/accounts/client/Client.ts index e0358a93e..009ca17ba 100644 --- a/src/api/resources/loyalty/resources/accounts/client/Client.ts +++ b/src/api/resources/loyalty/resources/accounts/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Accounts { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Accounts { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -83,7 +83,7 @@ export class Accounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -178,7 +178,7 @@ export class Accounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -265,7 +265,7 @@ export class Accounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -366,7 +366,7 @@ export class Accounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -464,7 +464,7 @@ export class Accounts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/loyalty/resources/programs/client/Client.ts b/src/api/resources/loyalty/resources/programs/client/Client.ts index 2bb28e6f6..4a12dc254 100644 --- a/src/api/resources/loyalty/resources/programs/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace Programs { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace Programs { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -82,7 +82,7 @@ export class Programs { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -165,7 +165,7 @@ export class Programs { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -264,7 +264,7 @@ export class Programs { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts index 663e77ec3..6bdb8c8c6 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Promotions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Promotions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -52,7 +52,10 @@ export class Promotions { * * @example * await client.loyalty.programs.promotions.list({ - * programId: "program_id" + * programId: "program_id", + * status: "ACTIVE", + * cursor: "cursor", + * limit: 1 * }) */ public async list( @@ -89,7 +92,7 @@ export class Promotions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -212,7 +215,7 @@ export class Promotions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -274,8 +277,8 @@ export class Promotions { * * @example * await client.loyalty.programs.promotions.get({ - * promotionId: "promotion_id", - * programId: "program_id" + * programId: "program_id", + * promotionId: "promotion_id" * }) */ public get( @@ -289,7 +292,7 @@ export class Promotions { request: Square.loyalty.programs.GetPromotionsRequest, requestOptions?: Promotions.RequestOptions, ): Promise> { - const { promotionId, programId } = request; + const { programId, promotionId } = request; const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -302,7 +305,7 @@ export class Promotions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -363,8 +366,8 @@ export class Promotions { * * @example * await client.loyalty.programs.promotions.cancel({ - * promotionId: "promotion_id", - * programId: "program_id" + * programId: "program_id", + * promotionId: "promotion_id" * }) */ public cancel( @@ -378,7 +381,7 @@ export class Promotions { request: Square.loyalty.programs.CancelPromotionsRequest, requestOptions?: Promotions.RequestOptions, ): Promise> { - const { promotionId, programId } = request; + const { programId, promotionId } = request; const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -391,7 +394,7 @@ export class Promotions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts index 691ada4c3..419b7deb7 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts @@ -5,18 +5,18 @@ /** * @example * { - * promotionId: "promotion_id", - * programId: "program_id" + * programId: "program_id", + * promotionId: "promotion_id" * } */ export interface CancelPromotionsRequest { + /** + * The ID of the base [loyalty program](entity:LoyaltyProgram). + */ + programId: string; /** * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a * promotion that has an `ACTIVE` or `SCHEDULED` status. */ promotionId: string; - /** - * The ID of the base [loyalty program](entity:LoyaltyProgram). - */ - programId: string; } diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts index 5138a2719..df500e557 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts @@ -5,18 +5,18 @@ /** * @example * { - * promotionId: "promotion_id", - * programId: "program_id" + * programId: "program_id", + * promotionId: "promotion_id" * } */ export interface GetPromotionsRequest { - /** - * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. - */ - promotionId: string; /** * The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID, * call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. */ programId: string; + /** + * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. + */ + promotionId: string; } diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts index d1ec23846..46d676b3a 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts @@ -7,7 +7,10 @@ import * as Square from "../../../../../../../../index"; /** * @example * { - * programId: "program_id" + * programId: "program_id", + * status: "ACTIVE", + * cursor: "cursor", + * limit: 1 * } */ export interface ListPromotionsRequest { diff --git a/src/api/resources/loyalty/resources/rewards/client/Client.ts b/src/api/resources/loyalty/resources/rewards/client/Client.ts index 42ac8cd70..70f50658a 100644 --- a/src/api/resources/loyalty/resources/rewards/client/Client.ts +++ b/src/api/resources/loyalty/resources/rewards/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Rewards { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Rewards { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -89,7 +89,7 @@ export class Rewards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -184,7 +184,7 @@ export class Rewards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -271,7 +271,7 @@ export class Rewards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -362,7 +362,7 @@ export class Rewards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -457,7 +457,7 @@ export class Rewards { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/merchants/client/Client.ts b/src/api/resources/merchants/client/Client.ts index 77a5eb469..cd995f488 100644 --- a/src/api/resources/merchants/client/Client.ts +++ b/src/api/resources/merchants/client/Client.ts @@ -18,7 +18,7 @@ export declare namespace Merchants { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -32,7 +32,7 @@ export declare namespace Merchants { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -71,7 +71,9 @@ export class Merchants { * @param {Merchants.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.merchants.list() + * await client.merchants.list({ + * cursor: 1 + * }) */ public async list( request: Square.ListMerchantsRequest = {}, @@ -98,7 +100,7 @@ export class Merchants { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -192,7 +194,7 @@ export class Merchants { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts b/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts index 30bb590cc..a7cbfe78b 100644 --- a/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts +++ b/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * cursor: 1 + * } */ export interface ListMerchantsRequest { /** diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts index 099160964..c7507644c 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributeDefinitions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributeDefinitions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -53,7 +53,11 @@ export class CustomAttributeDefinitions { * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.merchants.customAttributeDefinitions.list() + * await client.merchants.customAttributeDefinitions.list({ + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor" + * }) */ public async list( request: Square.merchants.ListCustomAttributeDefinitionsRequest = {}, @@ -89,7 +93,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -201,7 +205,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -265,7 +269,8 @@ export class CustomAttributeDefinitions { * * @example * await client.merchants.customAttributeDefinitions.get({ - * key: "key" + * key: "key", + * version: 1 * }) */ public get( @@ -297,7 +302,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -388,7 +393,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -480,7 +485,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 9b086bfb6..e4c05d712 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * key: "key" + * key: "key", + * version: 1 * } */ export interface GetCustomAttributeDefinitionsRequest { diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 313ea4854..4818482a3 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -6,7 +6,11 @@ import * as Square from "../../../../../../index"; /** * @example - * {} + * { + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor" + * } */ export interface ListCustomAttributeDefinitionsRequest { /** diff --git a/src/api/resources/merchants/resources/customAttributes/client/Client.ts b/src/api/resources/merchants/resources/customAttributes/client/Client.ts index a138aceb9..e3b7177ca 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -86,7 +86,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -198,7 +198,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -265,7 +265,11 @@ export class CustomAttributes { * * @example * await client.merchants.customAttributes.list({ - * merchantId: "merchant_id" + * merchantId: "merchant_id", + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * }) */ public async list( @@ -305,7 +309,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -379,7 +383,9 @@ export class CustomAttributes { * @example * await client.merchants.customAttributes.get({ * merchantId: "merchant_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * }) */ public get( @@ -415,7 +421,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -508,7 +514,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -600,7 +606,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index b2a5f6471..ddedc056e 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -6,7 +6,9 @@ * @example * { * merchantId: "merchant_id", - * key: "key" + * key: "key", + * withDefinition: true, + * version: 1 * } */ export interface GetCustomAttributesRequest { diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 0a4615f85..649e8a162 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -7,7 +7,11 @@ import * as Square from "../../../../../../index"; /** * @example * { - * merchantId: "merchant_id" + * merchantId: "merchant_id", + * visibilityFilter: "ALL", + * limit: 1, + * cursor: "cursor", + * withDefinitions: true * } */ export interface ListCustomAttributesRequest { diff --git a/src/api/resources/mobile/client/Client.ts b/src/api/resources/mobile/client/Client.ts index a773ec579..96e12e7b0 100644 --- a/src/api/resources/mobile/client/Client.ts +++ b/src/api/resources/mobile/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Mobile { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Mobile { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -91,7 +91,7 @@ export class Mobile { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/oAuth/client/Client.ts b/src/api/resources/oAuth/client/Client.ts index 15cf3b3f3..537e7526d 100644 --- a/src/api/resources/oAuth/client/Client.ts +++ b/src/api/resources/oAuth/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace OAuth { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace OAuth { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -91,7 +91,7 @@ export class OAuth { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -200,7 +200,7 @@ export class OAuth { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -294,7 +294,7 @@ export class OAuth { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -363,7 +363,7 @@ export class OAuth { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index 43b4e7035..36b40452a 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -18,7 +18,7 @@ export declare namespace Orders { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -32,7 +32,7 @@ export declare namespace Orders { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -140,7 +140,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -229,7 +229,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -337,7 +337,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -426,7 +426,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -547,7 +547,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -634,7 +634,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -744,7 +744,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -846,7 +846,7 @@ export class Orders { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts index 46231e197..899a7ba8d 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributeDefinitions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributeDefinitions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -55,7 +55,11 @@ export class CustomAttributeDefinitions { * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.orders.customAttributeDefinitions.list() + * await client.orders.customAttributeDefinitions.list({ + * visibilityFilter: "ALL", + * cursor: "cursor", + * limit: 1 + * }) */ public async list( request: Square.orders.ListCustomAttributeDefinitionsRequest = {}, @@ -91,7 +95,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -199,7 +203,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -265,7 +269,8 @@ export class CustomAttributeDefinitions { * * @example * await client.orders.customAttributeDefinitions.get({ - * key: "key" + * key: "key", + * version: 1 * }) */ public get( @@ -297,7 +302,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -389,7 +394,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -480,7 +485,7 @@ export class CustomAttributeDefinitions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index f0d58ef27..b72b1159b 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * key: "key" + * key: "key", + * version: 1 * } */ export interface GetCustomAttributeDefinitionsRequest { diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index e8123e530..3f1c4b730 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -6,7 +6,11 @@ import * as Square from "../../../../../../index"; /** * @example - * {} + * { + * visibilityFilter: "ALL", + * cursor: "cursor", + * limit: 1 + * } */ export interface ListCustomAttributeDefinitionsRequest { /** diff --git a/src/api/resources/orders/resources/customAttributes/client/Client.ts b/src/api/resources/orders/resources/customAttributes/client/Client.ts index f0f7e46dd..c67c62da9 100644 --- a/src/api/resources/orders/resources/customAttributes/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace CustomAttributes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace CustomAttributes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -99,7 +99,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -217,7 +217,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -286,7 +286,11 @@ export class CustomAttributes { * * @example * await client.orders.customAttributes.list({ - * orderId: "order_id" + * orderId: "order_id", + * visibilityFilter: "ALL", + * cursor: "cursor", + * limit: 1, + * withDefinitions: true * }) */ public async list( @@ -326,7 +330,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -403,7 +407,9 @@ export class CustomAttributes { * @example * await client.orders.customAttributes.get({ * orderId: "order_id", - * customAttributeKey: "custom_attribute_key" + * customAttributeKey: "custom_attribute_key", + * version: 1, + * withDefinition: true * }) */ public get( @@ -439,7 +445,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -537,7 +543,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -631,7 +637,7 @@ export class CustomAttributes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index 7c77448f5..4c8dbdb0d 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -6,7 +6,9 @@ * @example * { * orderId: "order_id", - * customAttributeKey: "custom_attribute_key" + * customAttributeKey: "custom_attribute_key", + * version: 1, + * withDefinition: true * } */ export interface GetCustomAttributesRequest { diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index e91327e97..206799d76 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -7,7 +7,11 @@ import * as Square from "../../../../../../index"; /** * @example * { - * orderId: "order_id" + * orderId: "order_id", + * visibilityFilter: "ALL", + * cursor: "cursor", + * limit: 1, + * withDefinitions: true * } */ export interface ListCustomAttributesRequest { diff --git a/src/api/resources/payments/client/Client.ts b/src/api/resources/payments/client/Client.ts index 07a1cfa66..c5e81a7cb 100644 --- a/src/api/resources/payments/client/Client.ts +++ b/src/api/resources/payments/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Payments { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Payments { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -55,7 +55,23 @@ export class Payments { * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.payments.list() + * await client.payments.list({ + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "sort_order", + * cursor: "cursor", + * locationId: "location_id", + * total: BigInt("1000000"), + * last4: "last_4", + * cardBrand: "card_brand", + * limit: 1, + * isOfflinePayment: true, + * offlineBeginTime: "offline_begin_time", + * offlineEndTime: "offline_end_time", + * updatedAtBeginTime: "updated_at_begin_time", + * updatedAtEndTime: "updated_at_end_time", + * sortField: "CREATED_AT" + * }) */ public async list( request: Square.ListPaymentsRequest = {}, @@ -141,7 +157,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -255,7 +271,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -351,7 +367,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -438,7 +454,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -532,7 +548,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -620,7 +636,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -706,7 +722,7 @@ export class Payments { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/payments/client/requests/ListPaymentsRequest.ts b/src/api/resources/payments/client/requests/ListPaymentsRequest.ts index 686751d03..affd3d479 100644 --- a/src/api/resources/payments/client/requests/ListPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/ListPaymentsRequest.ts @@ -6,7 +6,23 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "sort_order", + * cursor: "cursor", + * locationId: "location_id", + * total: BigInt("1000000"), + * last4: "last_4", + * cardBrand: "card_brand", + * limit: 1, + * isOfflinePayment: true, + * offlineBeginTime: "offline_begin_time", + * offlineEndTime: "offline_end_time", + * updatedAtBeginTime: "updated_at_begin_time", + * updatedAtEndTime: "updated_at_end_time", + * sortField: "CREATED_AT" + * } */ export interface ListPaymentsRequest { /** diff --git a/src/api/resources/payouts/client/Client.ts b/src/api/resources/payouts/client/Client.ts index e4eb3bdf8..19a6b714f 100644 --- a/src/api/resources/payouts/client/Client.ts +++ b/src/api/resources/payouts/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Payouts { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Payouts { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -52,7 +52,15 @@ export class Payouts { * @param {Payouts.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.payouts.list() + * await client.payouts.list({ + * locationId: "location_id", + * status: "SENT", + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "DESC", + * cursor: "cursor", + * limit: 1 + * }) */ public async list( request: Square.ListPayoutsRequest = {}, @@ -101,7 +109,7 @@ export class Payouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -196,7 +204,7 @@ export class Payouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -251,7 +259,10 @@ export class Payouts { * * @example * await client.payouts.listEntries({ - * payoutId: "payout_id" + * payoutId: "payout_id", + * sortOrder: "DESC", + * cursor: "cursor", + * limit: 1 * }) */ public async listEntries( @@ -288,7 +299,7 @@ export class Payouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts b/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts index e12ee9e59..6b329f73c 100644 --- a/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts @@ -7,7 +7,10 @@ import * as Square from "../../../../index"; /** * @example * { - * payoutId: "payout_id" + * payoutId: "payout_id", + * sortOrder: "DESC", + * cursor: "cursor", + * limit: 1 * } */ export interface ListEntriesPayoutsRequest { diff --git a/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts b/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts index c585aace4..49f693190 100644 --- a/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts @@ -6,7 +6,15 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * locationId: "location_id", + * status: "SENT", + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "DESC", + * cursor: "cursor", + * limit: 1 + * } */ export interface ListPayoutsRequest { /** diff --git a/src/api/resources/refunds/client/Client.ts b/src/api/resources/refunds/client/Client.ts index a2f73cc06..6832f14e8 100644 --- a/src/api/resources/refunds/client/Client.ts +++ b/src/api/resources/refunds/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Refunds { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Refunds { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -55,7 +55,19 @@ export class Refunds { * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.refunds.list() + * await client.refunds.list({ + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "sort_order", + * cursor: "cursor", + * locationId: "location_id", + * status: "status", + * sourceType: "source_type", + * limit: 1, + * updatedAtBeginTime: "updated_at_begin_time", + * updatedAtEndTime: "updated_at_end_time", + * sortField: "CREATED_AT" + * }) */ public async list( request: Square.ListRefundsRequest = {}, @@ -127,7 +139,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -233,7 +245,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -320,7 +332,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/refunds/client/requests/ListRefundsRequest.ts b/src/api/resources/refunds/client/requests/ListRefundsRequest.ts index f21e73500..e7e2d1d54 100644 --- a/src/api/resources/refunds/client/requests/ListRefundsRequest.ts +++ b/src/api/resources/refunds/client/requests/ListRefundsRequest.ts @@ -6,7 +6,19 @@ import * as Square from "../../../../index"; /** * @example - * {} + * { + * beginTime: "begin_time", + * endTime: "end_time", + * sortOrder: "sort_order", + * cursor: "cursor", + * locationId: "location_id", + * status: "status", + * sourceType: "source_type", + * limit: 1, + * updatedAtBeginTime: "updated_at_begin_time", + * updatedAtEndTime: "updated_at_end_time", + * sortField: "CREATED_AT" + * } */ export interface ListRefundsRequest { /** diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index 00e3e261a..3942631c3 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Sites { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Sites { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -73,7 +73,7 @@ export class Sites { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/snippets/client/Client.ts b/src/api/resources/snippets/client/Client.ts index e66b004b5..e118cc663 100644 --- a/src/api/resources/snippets/client/Client.ts +++ b/src/api/resources/snippets/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Snippets { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Snippets { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -83,7 +83,7 @@ export class Snippets { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -173,7 +173,7 @@ export class Snippets { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -265,7 +265,7 @@ export class Snippets { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/subscriptions/client/Client.ts b/src/api/resources/subscriptions/client/Client.ts index 90adfebd7..de23f0291 100644 --- a/src/api/resources/subscriptions/client/Client.ts +++ b/src/api/resources/subscriptions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Subscriptions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Subscriptions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -97,7 +97,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -186,7 +186,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -293,7 +293,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -353,7 +353,8 @@ export class Subscriptions { * * @example * await client.subscriptions.get({ - * subscriptionId: "subscription_id" + * subscriptionId: "subscription_id", + * include: "include" * }) */ public get( @@ -385,7 +386,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -473,7 +474,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -563,7 +564,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -648,7 +649,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -739,7 +740,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -795,7 +796,9 @@ export class Subscriptions { * * @example * await client.subscriptions.listEvents({ - * subscriptionId: "subscription_id" + * subscriptionId: "subscription_id", + * cursor: "cursor", + * limit: 1 * }) */ public async listEvents( @@ -826,7 +829,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -922,7 +925,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1011,7 +1014,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -1106,7 +1109,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts index 90b54e807..4604762dd 100644 --- a/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * subscriptionId: "subscription_id" + * subscriptionId: "subscription_id", + * include: "include" * } */ export interface GetSubscriptionsRequest { diff --git a/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts index 85ef351a1..d2597584e 100644 --- a/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts @@ -5,7 +5,9 @@ /** * @example * { - * subscriptionId: "subscription_id" + * subscriptionId: "subscription_id", + * cursor: "cursor", + * limit: 1 * } */ export interface ListEventsSubscriptionsRequest { diff --git a/src/api/resources/team/client/Client.ts b/src/api/resources/team/client/Client.ts index 0984b062d..0e86f4be0 100644 --- a/src/api/resources/team/client/Client.ts +++ b/src/api/resources/team/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Team { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Team { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,9 @@ export class Team { * @param {Team.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.team.listJobs() + * await client.team.listJobs({ + * cursor: "cursor" + * }) */ public listJobs( request: Square.ListJobsRequest = {}, @@ -81,7 +83,7 @@ export class Team { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -167,7 +169,7 @@ export class Team { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -254,7 +256,7 @@ export class Team { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -343,7 +345,7 @@ export class Team { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/team/client/requests/ListJobsRequest.ts b/src/api/resources/team/client/requests/ListJobsRequest.ts index ac21e815f..0202a0ebc 100644 --- a/src/api/resources/team/client/requests/ListJobsRequest.ts +++ b/src/api/resources/team/client/requests/ListJobsRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * cursor: "cursor" + * } */ export interface ListJobsRequest { /** diff --git a/src/api/resources/teamMembers/client/Client.ts b/src/api/resources/teamMembers/client/Client.ts index 495a71500..5bc1df3b1 100644 --- a/src/api/resources/teamMembers/client/Client.ts +++ b/src/api/resources/teamMembers/client/Client.ts @@ -17,7 +17,7 @@ export declare namespace TeamMembers { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -31,7 +31,7 @@ export declare namespace TeamMembers { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -119,7 +119,7 @@ export class TeamMembers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -236,7 +236,7 @@ export class TeamMembers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -356,7 +356,7 @@ export class TeamMembers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -450,7 +450,7 @@ export class TeamMembers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -538,7 +538,7 @@ export class TeamMembers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -655,7 +655,7 @@ export class TeamMembers { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts index cedfe5800..eed114e5f 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace WageSetting { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace WageSetting { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -83,7 +83,7 @@ export class WageSetting { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -192,7 +192,7 @@ export class WageSetting { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/terminal/client/Client.ts b/src/api/resources/terminal/client/Client.ts index f3f0bb3ae..d436cce33 100644 --- a/src/api/resources/terminal/client/Client.ts +++ b/src/api/resources/terminal/client/Client.ts @@ -19,7 +19,7 @@ export declare namespace Terminal { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -33,7 +33,7 @@ export declare namespace Terminal { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -98,7 +98,7 @@ export class Terminal { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -181,7 +181,7 @@ export class Terminal { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -264,7 +264,7 @@ export class Terminal { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/terminal/resources/actions/client/Client.ts b/src/api/resources/terminal/resources/actions/client/Client.ts index 830e5a8e0..443e2a991 100644 --- a/src/api/resources/terminal/resources/actions/client/Client.ts +++ b/src/api/resources/terminal/resources/actions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Actions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Actions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -86,7 +86,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -182,7 +182,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -269,7 +269,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -352,7 +352,7 @@ export class Actions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/terminal/resources/checkouts/client/Client.ts b/src/api/resources/terminal/resources/checkouts/client/Client.ts index bcce81a0d..cb73ce7ac 100644 --- a/src/api/resources/terminal/resources/checkouts/client/Client.ts +++ b/src/api/resources/terminal/resources/checkouts/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Checkouts { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Checkouts { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -89,7 +89,7 @@ export class Checkouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -180,7 +180,7 @@ export class Checkouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -269,7 +269,7 @@ export class Checkouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -352,7 +352,7 @@ export class Checkouts { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/terminal/resources/refunds/client/Client.ts b/src/api/resources/terminal/resources/refunds/client/Client.ts index 239b3469d..1c874fa13 100644 --- a/src/api/resources/terminal/resources/refunds/client/Client.ts +++ b/src/api/resources/terminal/resources/refunds/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Refunds { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Refunds { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -86,7 +86,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -177,7 +177,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -264,7 +264,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -347,7 +347,7 @@ export class Refunds { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/transferOrders/client/Client.ts b/src/api/resources/transferOrders/client/Client.ts new file mode 100644 index 000000000..ea4b0ebf1 --- /dev/null +++ b/src/api/resources/transferOrders/client/Client.ts @@ -0,0 +1,899 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import * as Square from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace TransferOrders { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-10-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-10-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } +} + +export class TransferOrders { + protected readonly _options: TransferOrders.Options; + + constructor(_options: TransferOrders.Options = {}) { + this._options = _options; + } + + /** + * Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent + * to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. + * The source and destination locations must be different and must belong to your Square account. + * + * In [DRAFT](entity:TransferOrderStatus) status, you can: + * - Add or remove items + * - Modify quantities + * - Update shipping information + * - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) + * + * The request requires source_location_id and destination_location_id. + * Inventory levels are not affected until the order is started via + * [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). + * + * Common integration points: + * - Sync with warehouse management systems + * - Automate regular stock transfers + * - Initialize transfers from inventory optimization systems + * + * Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. + * + * @param {Square.CreateTransferOrderRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.create({ + * idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", + * transferOrder: { + * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + * expectedAt: "2025-11-09T05:00:00Z", + * notes: "Example transfer order for inventory redistribution between locations", + * trackingNumber: "TRACK123456789", + * createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + * lineItems: [{ + * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + * quantityOrdered: "5" + * }, { + * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + * quantityOrdered: "3" + * }] + * } + * }) + */ + public create( + request: Square.CreateTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + + private async __create( + request: Square.CreateTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + "v2/transfer-orders", + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.CreateTransferOrderRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.CreateTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError("Timeout exceeded when calling POST /v2/transfer-orders."); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Searches for transfer orders using filters. Returns a paginated list of matching + * [TransferOrder](entity:TransferOrder)s sorted by creation date. + * + * Common search scenarios: + * - Find orders for a source [Location](entity:Location) + * - Find orders for a destination [Location](entity:Location) + * - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) + * + * @param {Square.SearchTransferOrdersRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.search({ + * query: { + * filter: { + * sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], + * destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], + * statuses: ["STARTED", "PARTIALLY_RECEIVED"] + * }, + * sort: { + * field: "UPDATED_AT", + * order: "DESC" + * } + * }, + * cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + * limit: 10 + * }) + */ + public async search( + request: Square.SearchTransferOrdersRequest = {}, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Square.SearchTransferOrdersRequest, + ): Promise> => { + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + "v2/transfer-orders/search", + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.SearchTransferOrdersRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.SearchTransferOrdersResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling POST /v2/transfer-orders/search.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Pageable({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.cursor != null && !(typeof response?.cursor === "string" && response?.cursor === ""), + getItems: (response) => response?.transferOrders ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "cursor", response?.cursor)); + }, + }); + } + + /** + * Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete + * order details including: + * + * - Basic information (status, dates, notes) + * - Line items with ordered and received quantities + * - Source and destination [Location](entity:Location)s + * - Tracking information (if available) + * + * @param {Square.GetTransferOrdersRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.get({ + * transferOrderId: "transfer_order_id" + * }) + */ + public get( + request: Square.GetTransferOrdersRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + } + + private async __get( + request: Square.GetTransferOrdersRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const { transferOrderId } = request; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/transfer-orders/${encodeURIComponent(transferOrderId)}`, + ), + method: "GET", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.RetrieveTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling GET /v2/transfer-orders/{transfer_order_id}.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Updates an existing transfer order. This endpoint supports sparse updates, + * allowing you to modify specific fields without affecting others. + * + * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. + * + * @param {Square.UpdateTransferOrderRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.update({ + * transferOrderId: "transfer_order_id", + * idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", + * transferOrder: { + * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", + * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", + * expectedAt: "2025-11-10T08:00:00Z", + * notes: "Updated: Priority transfer due to low stock at destination", + * trackingNumber: "TRACK987654321", + * lineItems: [{ + * uid: "1", + * quantityOrdered: "7" + * }, { + * itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + * quantityOrdered: "2" + * }, { + * uid: "2", + * remove: true + * }] + * }, + * version: BigInt("1753109537351") + * }) + */ + public update( + request: Square.UpdateTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); + } + + private async __update( + request: Square.UpdateTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const { transferOrderId, ..._body } = request; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/transfer-orders/${encodeURIComponent(transferOrderId)}`, + ), + method: "PUT", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.UpdateTransferOrderRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.UpdateTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling PUT /v2/transfer-orders/{transfer_order_id}.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. + * Only draft orders can be deleted. Once an order is started via + * [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. + * + * Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. + * + * @param {Square.DeleteTransferOrdersRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.delete({ + * transferOrderId: "transfer_order_id", + * version: BigInt("1000000") + * }) + */ + public delete( + request: Square.DeleteTransferOrdersRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); + } + + private async __delete( + request: Square.DeleteTransferOrdersRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const { transferOrderId, version } = request; + const _queryParams: Record = {}; + if (version !== undefined) { + _queryParams["version"] = version?.toString() ?? null; + } + + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/transfer-orders/${encodeURIComponent(transferOrderId)}`, + ), + method: "DELETE", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.DeleteTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling DELETE /v2/transfer-orders/{transfer_order_id}.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or + * [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no + * longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. + * + * Common reasons for cancellation: + * - Items no longer needed at destination + * - Source location needs the inventory + * - Order created in error + * + * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. + * + * @param {Square.CancelTransferOrderRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.cancel({ + * transferOrderId: "transfer_order_id", + * idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", + * version: BigInt("1753117449752") + * }) + */ + public cancel( + request: Square.CancelTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); + } + + private async __cancel( + request: Square.CancelTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const { transferOrderId, ..._body } = request; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/transfer-orders/${encodeURIComponent(transferOrderId)}/cancel`, + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.CancelTransferOrderRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.CancelTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling POST /v2/transfer-orders/{transfer_order_id}/cancel.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. + * This endpoint supports partial receiving - you can receive items in multiple batches. + * + * For each line item, you can specify: + * - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) + * - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) + * - Quantity canceled (returned to source location's inventory) + * + * The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. + * Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. + * Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. + * + * When all items are either received, damaged, or canceled, the order moves to + * [COMPLETED](entity:TransferOrderStatus) status. + * + * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. + * + * @param {Square.ReceiveTransferOrderRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.receive({ + * transferOrderId: "transfer_order_id", + * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", + * receipt: { + * lineItems: [{ + * transferOrderLineUid: "transfer_order_line_uid", + * quantityReceived: "3", + * quantityDamaged: "1", + * quantityCanceled: "1" + * }, { + * transferOrderLineUid: "transfer_order_line_uid", + * quantityReceived: "2", + * quantityCanceled: "1" + * }] + * }, + * version: BigInt("1753118664873") + * }) + */ + public receive( + request: Square.ReceiveTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__receive(request, requestOptions)); + } + + private async __receive( + request: Square.ReceiveTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const { transferOrderId, ..._body } = request; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/transfer-orders/${encodeURIComponent(transferOrderId)}/receive`, + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.ReceiveTransferOrderRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.ReceiveTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling POST /v2/transfer-orders/{transfer_order_id}/receive.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + /** + * Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. + * This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. + * + * The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. + * Once started, the order can no longer be deleted, but it can be canceled via + * [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). + * + * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. + * + * @param {Square.StartTransferOrderRequest} request + * @param {TransferOrders.RequestOptions} requestOptions - Request-specific configuration. + * + * @example + * await client.transferOrders.start({ + * transferOrderId: "transfer_order_id", + * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", + * version: BigInt("1753109537351") + * }) + */ + public start( + request: Square.StartTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__start(request, requestOptions)); + } + + private async __start( + request: Square.StartTransferOrderRequest, + requestOptions?: TransferOrders.RequestOptions, + ): Promise> { + const { transferOrderId, ..._body } = request; + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SquareEnvironment.Production, + `v2/transfer-orders/${encodeURIComponent(transferOrderId)}/start`, + ), + method: "POST", + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-10-16", + }), + requestOptions?.headers, + ), + contentType: "application/json", + requestType: "json", + body: serializers.StartTransferOrderRequest.jsonOrThrow(_body, { + unrecognizedObjectKeys: "strip", + omitUndefined: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return { + data: serializers.StartTransferOrderResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SquareError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse, + }); + case "timeout": + throw new errors.SquareTimeoutError( + "Timeout exceeded when calling POST /v2/transfer-orders/{transfer_order_id}/start.", + ); + case "unknown": + throw new errors.SquareError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; + if (bearer != null) { + return `Bearer ${bearer}`; + } + + return undefined; + } +} diff --git a/src/api/resources/transferOrders/client/index.ts b/src/api/resources/transferOrders/client/index.ts new file mode 100644 index 000000000..f33205a0f --- /dev/null +++ b/src/api/resources/transferOrders/client/index.ts @@ -0,0 +1,2 @@ +export {}; +export * from "./requests"; diff --git a/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts new file mode 100644 index 000000000..0f9610db4 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * transferOrderId: "transfer_order_id", + * idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", + * version: BigInt("1753117449752") + * } + */ +export interface CancelTransferOrderRequest { + /** + * The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. + */ + transferOrderId: string; + /** + * A unique string that identifies this UpdateTransferOrder request. Keys can be + * any valid string but must be unique for every UpdateTransferOrder request. + */ + idempotencyKey: string; + /** Version for optimistic concurrency */ + version?: bigint; +} diff --git a/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts new file mode 100644 index 000000000..faba51024 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../../../../index"; + +/** + * @example + * { + * idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", + * transferOrder: { + * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + * expectedAt: "2025-11-09T05:00:00Z", + * notes: "Example transfer order for inventory redistribution between locations", + * trackingNumber: "TRACK123456789", + * createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + * lineItems: [{ + * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + * quantityOrdered: "5" + * }, { + * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + * quantityOrdered: "3" + * }] + * } + * } + */ +export interface CreateTransferOrderRequest { + /** + * A unique string that identifies this CreateTransferOrder request. Keys can be + * any valid string but must be unique for every CreateTransferOrder request. + */ + idempotencyKey: string; + /** The transfer order to create */ + transferOrder: Square.CreateTransferOrderData; +} diff --git a/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts new file mode 100644 index 000000000..06b9d4593 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * transferOrderId: "transfer_order_id", + * version: BigInt("1000000") + * } + */ +export interface DeleteTransferOrdersRequest { + /** + * The ID of the transfer order to delete + */ + transferOrderId: string; + /** + * Version for optimistic concurrency + */ + version?: bigint | null; +} diff --git a/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts new file mode 100644 index 000000000..63f1481de --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * transferOrderId: "transfer_order_id" + * } + */ +export interface GetTransferOrdersRequest { + /** + * The ID of the transfer order to retrieve + */ + transferOrderId: string; +} diff --git a/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts new file mode 100644 index 000000000..d7786a107 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts @@ -0,0 +1,38 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../../../../index"; + +/** + * @example + * { + * transferOrderId: "transfer_order_id", + * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", + * receipt: { + * lineItems: [{ + * transferOrderLineUid: "transfer_order_line_uid", + * quantityReceived: "3", + * quantityDamaged: "1", + * quantityCanceled: "1" + * }, { + * transferOrderLineUid: "transfer_order_line_uid", + * quantityReceived: "2", + * quantityCanceled: "1" + * }] + * }, + * version: BigInt("1753118664873") + * } + */ +export interface ReceiveTransferOrderRequest { + /** + * The ID of the transfer order to receive items for + */ + transferOrderId: string; + /** A unique key to make this request idempotent */ + idempotencyKey: string; + /** The receipt details */ + receipt: Square.TransferOrderGoodsReceipt; + /** Version for optimistic concurrency */ + version?: bigint; +} diff --git a/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts new file mode 100644 index 000000000..1dd02b62c --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../../../../index"; + +/** + * @example + * { + * query: { + * filter: { + * sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], + * destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], + * statuses: ["STARTED", "PARTIALLY_RECEIVED"] + * }, + * sort: { + * field: "UPDATED_AT", + * order: "DESC" + * } + * }, + * cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", + * limit: 10 + * } + */ +export interface SearchTransferOrdersRequest { + /** The search query */ + query?: Square.TransferOrderQuery; + /** Pagination cursor from a previous search response */ + cursor?: string; + /** Maximum number of results to return (1-100) */ + limit?: number; +} diff --git a/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts new file mode 100644 index 000000000..cad5a9131 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * transferOrderId: "transfer_order_id", + * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", + * version: BigInt("1753109537351") + * } + */ +export interface StartTransferOrderRequest { + /** + * The ID of the transfer order to start. Must be in DRAFT status. + */ + transferOrderId: string; + /** + * A unique string that identifies this UpdateTransferOrder request. Keys can be + * any valid string but must be unique for every UpdateTransferOrder request. + */ + idempotencyKey: string; + /** Version for optimistic concurrency */ + version?: bigint; +} diff --git a/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts new file mode 100644 index 000000000..2882b1415 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../../../../index"; + +/** + * @example + * { + * transferOrderId: "transfer_order_id", + * idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", + * transferOrder: { + * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", + * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", + * expectedAt: "2025-11-10T08:00:00Z", + * notes: "Updated: Priority transfer due to low stock at destination", + * trackingNumber: "TRACK987654321", + * lineItems: [{ + * uid: "1", + * quantityOrdered: "7" + * }, { + * itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + * quantityOrdered: "2" + * }, { + * uid: "2", + * remove: true + * }] + * }, + * version: BigInt("1753109537351") + * } + */ +export interface UpdateTransferOrderRequest { + /** + * The ID of the transfer order to update + */ + transferOrderId: string; + /** A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores */ + idempotencyKey: string; + /** The transfer order updates to apply */ + transferOrder: Square.UpdateTransferOrderData; + /** Version for optimistic concurrency */ + version?: bigint; +} diff --git a/src/api/resources/transferOrders/client/requests/index.ts b/src/api/resources/transferOrders/client/requests/index.ts new file mode 100644 index 000000000..f984bc5f1 --- /dev/null +++ b/src/api/resources/transferOrders/client/requests/index.ts @@ -0,0 +1,8 @@ +export { type CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; +export { type SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; +export { type GetTransferOrdersRequest } from "./GetTransferOrdersRequest"; +export { type UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; +export { type DeleteTransferOrdersRequest } from "./DeleteTransferOrdersRequest"; +export { type CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; +export { type ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; +export { type StartTransferOrderRequest } from "./StartTransferOrderRequest"; diff --git a/src/api/resources/transferOrders/index.ts b/src/api/resources/transferOrders/index.ts new file mode 100644 index 000000000..5ec76921e --- /dev/null +++ b/src/api/resources/transferOrders/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/v1Transactions/client/Client.ts b/src/api/resources/v1Transactions/client/Client.ts index 7e0b91a53..feb0094bb 100644 --- a/src/api/resources/v1Transactions/client/Client.ts +++ b/src/api/resources/v1Transactions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace V1Transactions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace V1Transactions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -51,7 +51,10 @@ export class V1Transactions { * * @example * await client.v1Transactions.v1ListOrders({ - * locationId: "location_id" + * locationId: "location_id", + * order: "DESC", + * limit: 1, + * batchToken: "batch_token" * }) */ public v1ListOrders( @@ -94,7 +97,7 @@ export class V1Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -177,7 +180,7 @@ export class V1Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -262,7 +265,7 @@ export class V1Transactions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts b/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts index ef21b9525..b485a1a5f 100644 --- a/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts @@ -7,7 +7,10 @@ import * as Square from "../../../../index"; /** * @example * { - * locationId: "location_id" + * locationId: "location_id", + * order: "DESC", + * limit: 1, + * batchToken: "batch_token" * } */ export interface V1ListOrdersRequest { diff --git a/src/api/resources/vendors/client/Client.ts b/src/api/resources/vendors/client/Client.ts index d924fa434..b9b5a2df7 100644 --- a/src/api/resources/vendors/client/Client.ts +++ b/src/api/resources/vendors/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Vendors { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Vendors { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -97,7 +97,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -183,7 +183,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -276,7 +276,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -381,7 +381,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -465,7 +465,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -552,7 +552,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -642,7 +642,7 @@ export class Vendors { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 295179460..c0d48deaf 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -14,7 +14,7 @@ export declare namespace Webhooks { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; diff --git a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts index 2e74fa548..66b829363 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace EventTypes { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace EventTypes { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,9 @@ export class EventTypes { * @param {EventTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.webhooks.eventTypes.list() + * await client.webhooks.eventTypes.list({ + * apiVersion: "api_version" + * }) */ public list( request: Square.webhooks.ListEventTypesRequest = {}, @@ -81,7 +83,7 @@ export class EventTypes { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts index 58176164e..dacf1b022 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * apiVersion: "api_version" + * } */ export interface ListEventTypesRequest { /** diff --git a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts index f23d405e8..c39e407b6 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts @@ -16,7 +16,7 @@ export declare namespace Subscriptions { baseUrl?: core.Supplier; token?: core.Supplier; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in requests. */ headers?: Record | undefined>; fetcher?: core.FetchFunction; @@ -30,7 +30,7 @@ export declare namespace Subscriptions { /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the Square-Version header */ - version?: "2025-09-24"; + version?: "2025-10-16"; /** Additional headers to include in the request. */ headers?: Record | undefined>; } @@ -50,7 +50,12 @@ export class Subscriptions { * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.webhooks.subscriptions.list() + * await client.webhooks.subscriptions.list({ + * cursor: "cursor", + * includeDisabled: true, + * sortOrder: "DESC", + * limit: 1 + * }) */ public async list( request: Square.webhooks.ListSubscriptionsRequest = {}, @@ -89,7 +94,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -190,7 +195,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -277,7 +282,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -364,7 +369,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -453,7 +458,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -537,7 +542,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), @@ -627,7 +632,7 @@ export class Subscriptions { this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-09-24", + "Square-Version": requestOptions?.version ?? "2025-10-16", }), requestOptions?.headers, ), diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts index 1d9c241f6..3507e8a2b 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts @@ -6,7 +6,12 @@ import * as Square from "../../../../../../index"; /** * @example - * {} + * { + * cursor: "cursor", + * includeDisabled: true, + * sortOrder: "DESC", + * limit: 1 + * } */ export interface ListSubscriptionsRequest { /** diff --git a/src/api/types/BulkRetrieveChannelsRequestConstants.ts b/src/api/types/BulkRetrieveChannelsRequestConstants.ts new file mode 100644 index 000000000..181509f5e --- /dev/null +++ b/src/api/types/BulkRetrieveChannelsRequestConstants.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type BulkRetrieveChannelsRequestConstants = "MAX_BATCH_SIZE"; diff --git a/src/api/types/BulkRetrieveChannelsResponse.ts b/src/api/types/BulkRetrieveChannelsResponse.ts new file mode 100644 index 000000000..aeb031c2f --- /dev/null +++ b/src/api/types/BulkRetrieveChannelsResponse.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Defines the fields that are included in the request body for the + * [BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint. + */ +export interface BulkRetrieveChannelsResponse { + /** Information about errors encountered during the request. */ + errors?: Square.Error_[]; + /** + * A map of channel IDs to channel responses which tell whether + * retrieval for a specific channel is success or not. + * Channel response of a success retrieval would contain channel info + * whereas channel response of a failed retrieval would have error info. + */ + responses?: Record; +} diff --git a/src/api/types/CancelTransferOrderResponse.ts b/src/api/types/CancelTransferOrderResponse.ts new file mode 100644 index 000000000..b2d0da40c --- /dev/null +++ b/src/api/types/CancelTransferOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for canceling a transfer order + */ +export interface CancelTransferOrderResponse { + /** The updated transfer order with status changed to CANCELED */ + transferOrder?: Square.TransferOrder; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/Channel.ts b/src/api/types/Channel.ts new file mode 100644 index 000000000..6a655fc63 --- /dev/null +++ b/src/api/types/Channel.ts @@ -0,0 +1,33 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface Channel { + /** The channel's unique ID. */ + id?: string; + /** The unique ID of the merchant this channel belongs to. */ + merchantId?: string; + /** The name of the channel. */ + name?: string | null; + /** The version number which is incremented each time an update is made to the channel. */ + version?: number; + /** Represents an entity the channel is associated with. */ + reference?: Square.Reference; + /** + * Status of the channel. + * See [Status](#type-status) for possible values + */ + status?: Square.ChannelStatus; + /** + * The timestamp for when the channel was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + */ + createdAt?: string; + /** + * The timestamp for when the channel was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). + * For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). + */ + updatedAt?: string; +} diff --git a/src/api/types/ChannelStatus.ts b/src/api/types/ChannelStatus.ts new file mode 100644 index 000000000..b10da68a2 --- /dev/null +++ b/src/api/types/ChannelStatus.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ChannelStatus = "ACTIVE" | "INACTIVE"; +export const ChannelStatus = { + Active: "ACTIVE", + Inactive: "INACTIVE", +} as const; diff --git a/src/api/types/CreateTransferOrderData.ts b/src/api/types/CreateTransferOrderData.ts new file mode 100644 index 000000000..889cda53a --- /dev/null +++ b/src/api/types/CreateTransferOrderData.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s + * between [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder) + * endpoint. + */ +export interface CreateTransferOrderData { + /** + * The source [Location](entity:Location) that will send the items. Must be an active location + * in your Square account with sufficient inventory of the requested items. + */ + sourceLocationId: string; + /** + * The destination [Location](entity:Location) that will receive the items. Must be an active location + * in your Square account + */ + destinationLocationId: string; + /** Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). */ + expectedAt?: string | null; + /** Optional notes about the transfer */ + notes?: string | null; + /** Optional shipment tracking number */ + trackingNumber?: string | null; + /** + * ID of the [TeamMember](entity:TeamMember) creating this transfer order. Used for tracking + * and auditing purposes. + */ + createdByTeamMemberId?: string | null; + /** List of [CatalogItemVariation](entity:CatalogItemVariation)s to transfer, including quantities */ + lineItems?: Square.CreateTransferOrderLineData[] | null; +} diff --git a/src/api/types/CreateTransferOrderLineData.ts b/src/api/types/CreateTransferOrderLineData.ts new file mode 100644 index 000000000..99db9a31f --- /dev/null +++ b/src/api/types/CreateTransferOrderLineData.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Data for creating a new transfer order line item. Each line item specifies a + * [CatalogItemVariation](entity:CatalogItemVariation) and quantity to transfer. + */ +export interface CreateTransferOrderLineData { + /** + * ID of the [CatalogItemVariation](entity:CatalogItemVariation) to transfer. Must reference a valid + * item variation in the [Catalog](api:Catalog). The item variation must be: + * - Active and available for sale + * - Enabled for inventory tracking + * - Available at the source location + */ + itemVariationId: string; + /** Total quantity ordered */ + quantityOrdered: string; +} diff --git a/src/api/types/CreateTransferOrderResponse.ts b/src/api/types/CreateTransferOrderResponse.ts new file mode 100644 index 000000000..e8d117fe7 --- /dev/null +++ b/src/api/types/CreateTransferOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for creating a transfer order. + */ +export interface CreateTransferOrderResponse { + /** The created transfer order */ + transferOrder?: Square.TransferOrder; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/CustomAttribute.ts b/src/api/types/CustomAttribute.ts index 78cde8e8f..ee921ef55 100644 --- a/src/api/types/CustomAttribute.ts +++ b/src/api/types/CustomAttribute.ts @@ -23,7 +23,13 @@ export interface CustomAttribute { * underscores (_), and hyphens (-). */ key?: string | null; - value?: unknown; + /** + * The value assigned to the custom attribute. It is validated against the custom + * attribute definition's schema on write operations. For more information about custom + * attribute values, + * see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). + */ + value?: unknown | null; /** * Read only. The current version of the custom attribute. This field is incremented when the custom attribute is changed. * When updating an existing custom attribute value, you can provide this field diff --git a/src/api/types/DeleteTransferOrderResponse.ts b/src/api/types/DeleteTransferOrderResponse.ts new file mode 100644 index 000000000..2b83f2ccc --- /dev/null +++ b/src/api/types/DeleteTransferOrderResponse.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for deleting a transfer order + */ +export interface DeleteTransferOrderResponse { + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/ListChannelsRequestConstants.ts b/src/api/types/ListChannelsRequestConstants.ts new file mode 100644 index 000000000..8cfda1584 --- /dev/null +++ b/src/api/types/ListChannelsRequestConstants.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ListChannelsRequestConstants = "MAX_PAGE_SIZE"; diff --git a/src/api/types/ListChannelsResponse.ts b/src/api/types/ListChannelsResponse.ts new file mode 100644 index 000000000..c16d7b2ee --- /dev/null +++ b/src/api/types/ListChannelsResponse.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface ListChannelsResponse { + /** Information about errors encountered during the request. */ + errors?: Square.Error_[]; + /** List of requested Channel. */ + channels?: Square.Channel[]; + /** The token required to retrieve the next page of results. */ + cursor?: string; +} diff --git a/src/api/types/ReceiveTransferOrderResponse.ts b/src/api/types/ReceiveTransferOrderResponse.ts new file mode 100644 index 000000000..090bfc4e6 --- /dev/null +++ b/src/api/types/ReceiveTransferOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for receiving items for a transfer order + */ +export interface ReceiveTransferOrderResponse { + /** The updated transfer order */ + transferOrder?: Square.TransferOrder; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/Reference.ts b/src/api/types/Reference.ts new file mode 100644 index 000000000..414e8e515 --- /dev/null +++ b/src/api/types/Reference.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface Reference { + /** + * The type of entity a channel is associated with. + * See [Type](#type-type) for possible values + */ + type?: Square.ReferenceType; + /** The id of the entity a channel is associated with. */ + id?: string; +} diff --git a/src/api/types/ReferenceType.ts b/src/api/types/ReferenceType.ts new file mode 100644 index 000000000..0dd9de135 --- /dev/null +++ b/src/api/types/ReferenceType.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The type of platform concept a channel can represent. + */ +export type ReferenceType = + | "UNKNOWN_TYPE" + | "LOCATION" + | "FIRST_PARTY_INTEGRATION" + | "OAUTH_APPLICATION" + | "ONLINE_SITE" + | "ONLINE_CHECKOUT" + | "INVOICE" + | "GIFT_CARD" + | "GIFT_CARD_MARKETPLACE" + | "RECURRING_SUBSCRIPTION" + | "ONLINE_BOOKING_FLOW" + | "SQUARE_ASSISTANT" + | "CASH_LOCAL" + | "POINT_OF_SALE" + | "KIOSK"; +export const ReferenceType = { + UnknownType: "UNKNOWN_TYPE", + Location: "LOCATION", + FirstPartyIntegration: "FIRST_PARTY_INTEGRATION", + OauthApplication: "OAUTH_APPLICATION", + OnlineSite: "ONLINE_SITE", + OnlineCheckout: "ONLINE_CHECKOUT", + Invoice: "INVOICE", + GiftCard: "GIFT_CARD", + GiftCardMarketplace: "GIFT_CARD_MARKETPLACE", + RecurringSubscription: "RECURRING_SUBSCRIPTION", + OnlineBookingFlow: "ONLINE_BOOKING_FLOW", + SquareAssistant: "SQUARE_ASSISTANT", + CashLocal: "CASH_LOCAL", + PointOfSale: "POINT_OF_SALE", + Kiosk: "KIOSK", +} as const; diff --git a/src/api/types/RetrieveChannelResponse.ts b/src/api/types/RetrieveChannelResponse.ts new file mode 100644 index 000000000..04a3f8ad2 --- /dev/null +++ b/src/api/types/RetrieveChannelResponse.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface RetrieveChannelResponse { + /** Information about errors encountered during the request. */ + errors?: Square.Error_[]; + /** The requested Channel. */ + channel?: Square.Channel; +} diff --git a/src/api/types/RetrieveTransferOrderResponse.ts b/src/api/types/RetrieveTransferOrderResponse.ts new file mode 100644 index 000000000..f122e6979 --- /dev/null +++ b/src/api/types/RetrieveTransferOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response containing the requested transfer order + */ +export interface RetrieveTransferOrderResponse { + /** The requested transfer order */ + transferOrder?: Square.TransferOrder; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/SearchTransferOrdersResponse.ts b/src/api/types/SearchTransferOrdersResponse.ts new file mode 100644 index 000000000..2e0de46ed --- /dev/null +++ b/src/api/types/SearchTransferOrdersResponse.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for searching transfer orders + */ +export interface SearchTransferOrdersResponse { + /** List of transfer orders matching the search criteria */ + transferOrders?: Square.TransferOrder[]; + /** Pagination cursor for fetching the next page of results */ + cursor?: string; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/StartTransferOrderResponse.ts b/src/api/types/StartTransferOrderResponse.ts new file mode 100644 index 000000000..a58c3d150 --- /dev/null +++ b/src/api/types/StartTransferOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for starting a transfer order. + */ +export interface StartTransferOrderResponse { + /** The updated transfer order with status changed to STARTED */ + transferOrder?: Square.TransferOrder; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/TransferOrder.ts b/src/api/types/TransferOrder.ts new file mode 100644 index 000000000..38e9be59d --- /dev/null +++ b/src/api/types/TransferOrder.ts @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s + * between [Location](entity:Location)s. Transfer orders track the entire lifecycle of an inventory + * transfer, including: + * - What items and quantities are being moved + * - Source and destination locations + * - Current [TransferOrderStatus](entity:TransferOrderStatus) + * - Shipping information and tracking + * - Which [TeamMember](entity:TeamMember) initiated the transfer + * + * This object is commonly used to: + * - Track [CatalogItemVariation](entity:CatalogItemVariation) movements between [Location](entity:Location)s + * - Reconcile expected vs received quantities + * - Monitor transfer progress and shipping status + * - Audit inventory movement history + */ +export interface TransferOrder { + /** + * Unique system-generated identifier for this transfer order. Use this ID for: + * - Retrieving transfer order details + * - Tracking status changes via webhooks + * - Linking transfers in external systems + */ + id?: string; + /** + * The source [Location](entity:Location) sending the [CatalogItemVariation](entity:CatalogItemVariation)s. + * This location must: + * - Be active in your Square organization + * - Have sufficient inventory for the items being transferred + * - Not be the same as the destination location + * + * This field is not updatable. + */ + sourceLocationId?: string | null; + /** + * The destination [Location](entity:Location) receiving the [CatalogItemVariation](entity:CatalogItemVariation)s. + * This location must: + * - Be active in your Square organization + * - Not be the same as the source location + * + * This field is not updatable. + */ + destinationLocationId?: string | null; + /** + * Current [TransferOrderStatus](entity:TransferOrderStatus) indicating where the order is in its lifecycle. + * Status transitions follow this progression: + * 1. [DRAFT](entity:TransferOrderStatus) -> [STARTED](entity:TransferOrderStatus) via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder) + * 2. [STARTED](entity:TransferOrderStatus) -> [PARTIALLY_RECEIVED](entity:TransferOrderStatus) via [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) + * 3. [PARTIALLY_RECEIVED](entity:TransferOrderStatus) -> [COMPLETED](entity:TransferOrderStatus) after all items received + * + * Orders can be [CANCELED](entity:TransferOrderStatus) from [STARTED](entity:TransferOrderStatus) or + * [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. + * + * This field is read-only and reflects the current state of the transfer order, and cannot be updated directly. Use the appropriate + * endpoints (e.g. [StartPurchaseOrder](api-endpoint:TransferOrders-StartTransferOrder), to change the status. + * See [TransferOrderStatus](#type-transferorderstatus) for possible values + */ + status?: Square.TransferOrderStatus; + /** + * Timestamp when the transfer order was created, in RFC 3339 format. + * Used for: + * - Auditing transfer history + * - Tracking order age + * - Reporting and analytics + */ + createdAt?: string; + /** + * Timestamp when the transfer order was last updated, in RFC 3339 format. + * Updated when: + * - Order status changes + * - Items are received + * - Notes or metadata are modified + */ + updatedAt?: string; + /** + * Expected transfer completion date, in RFC 3339 format. + * Used for: + * - Planning inventory availability + * - Scheduling receiving staff + * - Monitoring transfer timeliness + */ + expectedAt?: string | null; + /** Timestamp when the transfer order was completed or canceled, in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). */ + completedAt?: string; + /** Optional notes about the transfer. */ + notes?: string | null; + /** Shipment tracking number for monitoring transfer progress. */ + trackingNumber?: string | null; + /** ID of the [TeamMember](entity:TeamMember) who created this transfer order. This field is not writeable by the Connect V2 API. */ + createdByTeamMemberId?: string; + /** List of [CatalogItemVariation](entity:CatalogItemVariation)s being transferred. */ + lineItems?: Square.TransferOrderLine[] | null; + /** + * Version for optimistic concurrency control. This is a monotonically increasing integer + * that changes whenever the transfer order is modified. Use this when calling + * [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder) and other endpoints to ensure you're + * not overwriting concurrent changes. + */ + version?: bigint; +} diff --git a/src/api/types/TransferOrderCreatedEvent.ts b/src/api/types/TransferOrderCreatedEvent.ts new file mode 100644 index 000000000..1d5b14e75 --- /dev/null +++ b/src/api/types/TransferOrderCreatedEvent.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Published when a transfer_order is created. + */ +export interface TransferOrderCreatedEvent { + /** The ID of the target merchant associated with the event. */ + merchantId?: string | null; + /** The type of event this represents, `"transfer_order.created"`. */ + type?: string | null; + /** A unique ID for the event. */ + eventId?: string | null; + /** Timestamp of when the event was created, in RFC 3339 format. */ + createdAt?: string; + /** Data associated with the event. */ + data?: Square.TransferOrderCreatedEventData; +} diff --git a/src/api/types/TransferOrderCreatedEventData.ts b/src/api/types/TransferOrderCreatedEventData.ts new file mode 100644 index 000000000..18dc372b5 --- /dev/null +++ b/src/api/types/TransferOrderCreatedEventData.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface TransferOrderCreatedEventData { + /** Name of the affected object’s type, `"transfer_order"`. */ + type?: string | null; + /** ID of the affected transfer_order. */ + id?: string; + /** An object containing the created transfer_order. */ + object?: Square.TransferOrderCreatedEventObject; +} diff --git a/src/api/types/TransferOrderCreatedEventObject.ts b/src/api/types/TransferOrderCreatedEventObject.ts new file mode 100644 index 000000000..66358281f --- /dev/null +++ b/src/api/types/TransferOrderCreatedEventObject.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface TransferOrderCreatedEventObject { + /** The created transfer_order. */ + transferOrder?: Square.TransferOrder; +} diff --git a/src/api/types/TransferOrderDeletedEvent.ts b/src/api/types/TransferOrderDeletedEvent.ts new file mode 100644 index 000000000..b6826d923 --- /dev/null +++ b/src/api/types/TransferOrderDeletedEvent.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Published when a transfer_order is deleted. + */ +export interface TransferOrderDeletedEvent { + /** The ID of the target merchant associated with the event. */ + merchantId?: string | null; + /** The type of event this represents, `"transfer_order.deleted"`. */ + type?: string | null; + /** A unique ID for the event. */ + eventId?: string | null; + /** Timestamp of when the event was created, in RFC 3339 format. */ + createdAt?: string; + /** Data associated with the event. */ + data?: Square.TransferOrderDeletedEventData; +} diff --git a/src/api/types/TransferOrderDeletedEventData.ts b/src/api/types/TransferOrderDeletedEventData.ts new file mode 100644 index 000000000..f2359ac43 --- /dev/null +++ b/src/api/types/TransferOrderDeletedEventData.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TransferOrderDeletedEventData { + /** Name of the affected object’s type, `"transfer_order"`. */ + type?: string | null; + /** ID of the affected transfer_order. */ + id?: string; + /** Is true if the affected object was deleted. Otherwise absent. */ + deleted?: boolean | null; +} diff --git a/src/api/types/TransferOrderFilter.ts b/src/api/types/TransferOrderFilter.ts new file mode 100644 index 000000000..1df1a25fe --- /dev/null +++ b/src/api/types/TransferOrderFilter.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Filter criteria for searching transfer orders + */ +export interface TransferOrderFilter { + /** Filter by source location IDs */ + sourceLocationIds?: string[] | null; + /** Filter by destination location IDs */ + destinationLocationIds?: string[] | null; + /** + * Filter by order statuses + * See [TransferOrderStatus](#type-transferorderstatus) for possible values + */ + statuses?: Square.TransferOrderStatus[] | null; +} diff --git a/src/api/types/TransferOrderGoodsReceipt.ts b/src/api/types/TransferOrderGoodsReceipt.ts new file mode 100644 index 000000000..ad44aca8c --- /dev/null +++ b/src/api/types/TransferOrderGoodsReceipt.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * The goods receipt details for a transfer order. This object represents a single receipt + * of goods against a transfer order, tracking: + * + * - Which [CatalogItemVariation](entity:CatalogItemVariation)s were received + * - Quantities received in good condition + * - Quantities damaged during transit/handling + * - Quantities canceled during receipt + * + * Multiple goods receipts can be created for a single transfer order to handle: + * - Partial deliveries + * - Multiple shipments + * - Split receipts across different dates + * - Cancellations of specific quantities + * + * Each receipt automatically: + * - Updates the transfer order status + * - Adjusts received quantities + * - Updates inventory levels at both source and destination [Location](entity:Location)s + */ +export interface TransferOrderGoodsReceipt { + /** + * Line items being received. Each line item specifies: + * - The item being received + * - Quantity received in good condition + * - Quantity received damaged + * - Quantity canceled + * + * Constraints: + * - Must include at least one line item + * - Maximum of 1000 line items per receipt + * - Each line item must reference a valid item from the transfer order + * - Total of received, damaged, and canceled quantities cannot exceed ordered quantity + */ + lineItems?: Square.TransferOrderGoodsReceiptLineItem[] | null; +} diff --git a/src/api/types/TransferOrderGoodsReceiptLineItem.ts b/src/api/types/TransferOrderGoodsReceiptLineItem.ts new file mode 100644 index 000000000..e22fafd1e --- /dev/null +++ b/src/api/types/TransferOrderGoodsReceiptLineItem.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * A simplified line item for goods receipts in transfer orders + */ +export interface TransferOrderGoodsReceiptLineItem { + /** The unique identifier of the Transfer Order line being received */ + transferOrderLineUid: string; + /** + * The quantity received for this line item as a decimal string (e.g. "10.5"). + * These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. + */ + quantityReceived?: string | null; + /** + * The quantity that was damaged during shipping/handling as a decimal string (e.g. "1.5"). + * These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. + */ + quantityDamaged?: string | null; + /** The quantity that was canceled during shipping/handling as a decimal string (e.g. "1.5"). These will be immediately added to inventory in the source location. */ + quantityCanceled?: string | null; +} diff --git a/src/api/types/TransferOrderLine.ts b/src/api/types/TransferOrderLine.ts new file mode 100644 index 000000000..2dc146fe3 --- /dev/null +++ b/src/api/types/TransferOrderLine.ts @@ -0,0 +1,46 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Represents a line item in a transfer order. Each line item tracks a specific + * [CatalogItemVariation](entity:CatalogItemVariation) being transferred, including ordered quantities + * and receipt status. + */ +export interface TransferOrderLine { + /** Unique system-generated identifier for the line item. Provide when updating/removing a line via [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). */ + uid?: string; + /** + * The required identifier of the [CatalogItemVariation](entity:CatalogItemVariation) being transferred. Must reference + * a valid catalog item variation that exists in the [Catalog](api:Catalog). + */ + itemVariationId: string; + /** + * Total quantity ordered, formatted as a decimal string (e.g. "10 or 10.0000"). Required to be a positive number. + * + * To remove a line item, set `remove` to `true` in [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). + */ + quantityOrdered: string; + /** Calculated quantity of this line item's yet to be received stock. This is the difference between the total quantity ordered and the sum of quantities received, canceled, and damaged. */ + quantityPending?: string; + /** + * Quantity received at destination. These items are added to the destination + * [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. + * + * This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). + */ + quantityReceived?: string; + /** + * Quantity received in damaged condition. These items are added to the destination + * [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. + * + * This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). + */ + quantityDamaged?: string; + /** + * Quantity that was canceled. These items will be immediately added to inventory in the source location. + * + * This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) or [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). + */ + quantityCanceled?: string; +} diff --git a/src/api/types/TransferOrderQuery.ts b/src/api/types/TransferOrderQuery.ts new file mode 100644 index 000000000..13e3a282b --- /dev/null +++ b/src/api/types/TransferOrderQuery.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Query parameters for searching transfer orders + */ +export interface TransferOrderQuery { + /** Filter criteria */ + filter?: Square.TransferOrderFilter; + /** Sort configuration */ + sort?: Square.TransferOrderSort; +} diff --git a/src/api/types/TransferOrderSort.ts b/src/api/types/TransferOrderSort.ts new file mode 100644 index 000000000..64a794fdf --- /dev/null +++ b/src/api/types/TransferOrderSort.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Sort configuration for search results + */ +export interface TransferOrderSort { + /** + * Field to sort by + * See [TransferOrderSortField](#type-transferordersortfield) for possible values + */ + field?: Square.TransferOrderSortField; + /** + * Sort order direction + * See [SortOrder](#type-sortorder) for possible values + */ + order?: Square.SortOrder; +} diff --git a/src/api/types/TransferOrderSortField.ts b/src/api/types/TransferOrderSortField.ts new file mode 100644 index 000000000..b704e8b4f --- /dev/null +++ b/src/api/types/TransferOrderSortField.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Fields that can be used for sorting [TransferOrder](entity:TransferOrder)s in search results. + * Used with [SearchTransferOrders](api-endpoint:TransferOrders-SearchTransferOrders) to control + * the order of returned results. + */ +export type TransferOrderSortField = "CREATED_AT" | "UPDATED_AT"; +export const TransferOrderSortField = { + CreatedAt: "CREATED_AT", + UpdatedAt: "UPDATED_AT", +} as const; diff --git a/src/api/types/TransferOrderStatus.ts b/src/api/types/TransferOrderStatus.ts new file mode 100644 index 000000000..b3eb9eb2d --- /dev/null +++ b/src/api/types/TransferOrderStatus.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Status values for transfer orders. Represents the current state of a + * [TransferOrder](entity:TransferOrder) in its lifecycle from creation to completion. + * Each status determines what actions are available and how inventory is affected. + */ +export type TransferOrderStatus = "DRAFT" | "STARTED" | "PARTIALLY_RECEIVED" | "COMPLETED" | "CANCELED"; +export const TransferOrderStatus = { + Draft: "DRAFT", + Started: "STARTED", + PartiallyReceived: "PARTIALLY_RECEIVED", + Completed: "COMPLETED", + Canceled: "CANCELED", +} as const; diff --git a/src/api/types/TransferOrderUpdatedEvent.ts b/src/api/types/TransferOrderUpdatedEvent.ts new file mode 100644 index 000000000..ae0203992 --- /dev/null +++ b/src/api/types/TransferOrderUpdatedEvent.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Published when a transfer_order is updated. + */ +export interface TransferOrderUpdatedEvent { + /** The ID of the target merchant associated with the event. */ + merchantId?: string | null; + /** The type of event this represents, `"transfer_order.updated"`. */ + type?: string | null; + /** A unique ID for the event. */ + eventId?: string | null; + /** Timestamp of when the event was created, in RFC 3339 format. */ + createdAt?: string; + /** Data associated with the event. */ + data?: Square.TransferOrderUpdatedEventData; +} diff --git a/src/api/types/TransferOrderUpdatedEventData.ts b/src/api/types/TransferOrderUpdatedEventData.ts new file mode 100644 index 000000000..bf6998995 --- /dev/null +++ b/src/api/types/TransferOrderUpdatedEventData.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface TransferOrderUpdatedEventData { + /** Name of the affected object’s type, `"transfer_order"`. */ + type?: string | null; + /** ID of the affected transfer_order. */ + id?: string; + /** An object containing the updated transfer_order. */ + object?: Square.TransferOrderUpdatedEventObject; +} diff --git a/src/api/types/TransferOrderUpdatedEventObject.ts b/src/api/types/TransferOrderUpdatedEventObject.ts new file mode 100644 index 000000000..198e8811d --- /dev/null +++ b/src/api/types/TransferOrderUpdatedEventObject.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +export interface TransferOrderUpdatedEventObject { + /** The updated transfer_order. */ + transferOrder?: Square.TransferOrder; +} diff --git a/src/api/types/UpdateTransferOrderData.ts b/src/api/types/UpdateTransferOrderData.ts new file mode 100644 index 000000000..3308e4fa1 --- /dev/null +++ b/src/api/types/UpdateTransferOrderData.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Data model for updating a transfer order. All fields are optional. + */ +export interface UpdateTransferOrderData { + /** + * The source [Location](entity:Location) that will send the items. Must be an active location + * in your Square account with sufficient inventory of the requested items. + */ + sourceLocationId?: string | null; + /** + * The destination [Location](entity:Location) that will receive the items. Must be an active location + * in your Square account. + */ + destinationLocationId?: string | null; + /** Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). */ + expectedAt?: string | null; + /** Optional notes about the transfer */ + notes?: string | null; + /** Shipment tracking number */ + trackingNumber?: string | null; + /** List of items being transferred */ + lineItems?: Square.UpdateTransferOrderLineData[] | null; +} diff --git a/src/api/types/UpdateTransferOrderLineData.ts b/src/api/types/UpdateTransferOrderLineData.ts new file mode 100644 index 000000000..c12b58f0a --- /dev/null +++ b/src/api/types/UpdateTransferOrderLineData.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Represents a line item update in a transfer order + */ +export interface UpdateTransferOrderLineData { + /** Line item id being updated. Required for updating/removing existing line items, but should not be set for new line items. */ + uid?: string | null; + /** + * Catalog item variation being transferred + * + * Required for new line items, but otherwise is not updatable. + */ + itemVariationId?: string | null; + /** Total quantity ordered */ + quantityOrdered?: string | null; + /** Flag to remove the line item during update. Must include `uid` in removal request */ + remove?: boolean | null; +} diff --git a/src/api/types/UpdateTransferOrderResponse.ts b/src/api/types/UpdateTransferOrderResponse.ts new file mode 100644 index 000000000..d83cdba68 --- /dev/null +++ b/src/api/types/UpdateTransferOrderResponse.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Square from "../index"; + +/** + * Response for updating a transfer order + */ +export interface UpdateTransferOrderResponse { + /** The updated transfer order */ + transferOrder?: Square.TransferOrder; + /** Any errors that occurred during the request */ + errors?: Square.Error_[]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 58eb9f815..a6114f07f 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -82,6 +82,8 @@ export * from "./BulkDeleteOrderCustomAttributesResponse"; export * from "./BulkPublishScheduledShiftsData"; export * from "./BulkPublishScheduledShiftsResponse"; export * from "./BulkRetrieveBookingsResponse"; +export * from "./BulkRetrieveChannelsRequestConstants"; +export * from "./BulkRetrieveChannelsResponse"; export * from "./BulkRetrieveCustomersResponse"; export * from "./BulkRetrieveTeamMemberBookingProfilesResponse"; export * from "./BatchGetVendorsResponse"; @@ -124,6 +126,7 @@ export * from "./CancelSubscriptionResponse"; export * from "./CancelTerminalActionResponse"; export * from "./CancelTerminalCheckoutResponse"; export * from "./CancelTerminalRefundResponse"; +export * from "./CancelTransferOrderResponse"; export * from "./CaptureTransactionResponse"; export * from "./Card"; export * from "./CardAutomaticallyUpdatedEvent"; @@ -234,6 +237,8 @@ export * from "./CatalogVersionUpdatedEventObject"; export * from "./CategoryPathToRootNode"; export * from "./ChangeBillingAnchorDateResponse"; export * from "./ChangeTiming"; +export * from "./Channel"; +export * from "./ChannelStatus"; export * from "./ChargeRequestAdditionalRecipient"; export * from "./Checkout"; export * from "./CheckoutLocationSettings"; @@ -302,6 +307,9 @@ export * from "./CreateTerminalActionResponse"; export * from "./CreateTerminalCheckoutResponse"; export * from "./CreateTerminalRefundResponse"; export * from "./CreateTimecardResponse"; +export * from "./CreateTransferOrderData"; +export * from "./CreateTransferOrderLineData"; +export * from "./CreateTransferOrderResponse"; export * from "./CreateVendorResponse"; export * from "./CreateWebhookSubscriptionResponse"; export * from "./Currency"; @@ -393,6 +401,7 @@ export * from "./DeleteShiftResponse"; export * from "./DeleteSnippetResponse"; export * from "./DeleteSubscriptionActionResponse"; export * from "./DeleteTimecardResponse"; +export * from "./DeleteTransferOrderResponse"; export * from "./DeleteWebhookSubscriptionResponse"; export * from "./Destination"; export * from "./DestinationDetails"; @@ -647,6 +656,8 @@ export * from "./ListCardsResponse"; export * from "./ListCashDrawerShiftEventsResponse"; export * from "./ListCashDrawerShiftsResponse"; export * from "./ListCatalogResponse"; +export * from "./ListChannelsRequestConstants"; +export * from "./ListChannelsResponse"; export * from "./ListCustomerCustomAttributeDefinitionsResponse"; export * from "./ListCustomerCustomAttributesResponse"; export * from "./ListCustomerGroupsResponse"; @@ -943,7 +954,10 @@ export * from "./QrCodeOptions"; export * from "./QuickPay"; export * from "./Range"; export * from "./ReceiptOptions"; +export * from "./ReceiveTransferOrderResponse"; export * from "./RedeemLoyaltyRewardResponse"; +export * from "./Reference"; +export * from "./ReferenceType"; export * from "./Refund"; export * from "./RefundCreatedEvent"; export * from "./RefundCreatedEventData"; @@ -964,6 +978,7 @@ export * from "./GetBusinessBookingProfileResponse"; export * from "./GetCardResponse"; export * from "./GetCashDrawerShiftResponse"; export * from "./GetCatalogObjectResponse"; +export * from "./RetrieveChannelResponse"; export * from "./GetCustomerCustomAttributeDefinitionResponse"; export * from "./GetCustomerCustomAttributeResponse"; export * from "./GetCustomerGroupResponse"; @@ -1006,6 +1021,7 @@ export * from "./GetTeamMemberResponse"; export * from "./RetrieveTimecardResponse"; export * from "./RetrieveTokenStatusResponse"; export * from "./GetTransactionResponse"; +export * from "./RetrieveTransferOrderResponse"; export * from "./GetVendorResponse"; export * from "./GetWageSettingResponse"; export * from "./GetWebhookSubscriptionResponse"; @@ -1064,6 +1080,7 @@ export * from "./SearchTerminalActionsResponse"; export * from "./SearchTerminalCheckoutsResponse"; export * from "./SearchTerminalRefundsResponse"; export * from "./SearchTimecardsResponse"; +export * from "./SearchTransferOrdersResponse"; export * from "./SearchVendorsRequestFilter"; export * from "./SearchVendorsRequestSort"; export * from "./SearchVendorsRequestSortField"; @@ -1091,6 +1108,7 @@ export * from "./SourceApplication"; export * from "./SquareAccountDetails"; export * from "./StandardUnitDescription"; export * from "./StandardUnitDescriptionGroup"; +export * from "./StartTransferOrderResponse"; export * from "./SubmitEvidenceResponse"; export * from "./Subscription"; export * from "./SubscriptionAction"; @@ -1192,6 +1210,23 @@ export * from "./TipSettings"; export * from "./Transaction"; export * from "./TransactionProduct"; export * from "./TransactionType"; +export * from "./TransferOrder"; +export * from "./TransferOrderCreatedEvent"; +export * from "./TransferOrderCreatedEventData"; +export * from "./TransferOrderCreatedEventObject"; +export * from "./TransferOrderDeletedEvent"; +export * from "./TransferOrderDeletedEventData"; +export * from "./TransferOrderFilter"; +export * from "./TransferOrderGoodsReceipt"; +export * from "./TransferOrderGoodsReceiptLineItem"; +export * from "./TransferOrderLine"; +export * from "./TransferOrderQuery"; +export * from "./TransferOrderSort"; +export * from "./TransferOrderSortField"; +export * from "./TransferOrderStatus"; +export * from "./TransferOrderUpdatedEvent"; +export * from "./TransferOrderUpdatedEventData"; +export * from "./TransferOrderUpdatedEventObject"; export * from "./UnlinkCustomerFromGiftCardResponse"; export * from "./UpdateBookingCustomAttributeDefinitionResponse"; export * from "./UpdateBookingResponse"; @@ -1220,6 +1255,9 @@ export * from "./UpdateSubscriptionResponse"; export * from "./UpdateTeamMemberRequest"; export * from "./UpdateTeamMemberResponse"; export * from "./UpdateTimecardResponse"; +export * from "./UpdateTransferOrderData"; +export * from "./UpdateTransferOrderLineData"; +export * from "./UpdateTransferOrderResponse"; export * from "./UpdateVendorRequest"; export * from "./UpdateVendorResponse"; export * from "./UpdateWageSettingResponse"; diff --git a/src/serialization/resources/channels/client/index.ts b/src/serialization/resources/channels/client/index.ts new file mode 100644 index 000000000..415726b7f --- /dev/null +++ b/src/serialization/resources/channels/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts b/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts new file mode 100644 index 000000000..1d6074e88 --- /dev/null +++ b/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const BulkRetrieveChannelsRequest: core.serialization.Schema< + serializers.BulkRetrieveChannelsRequest.Raw, + Square.BulkRetrieveChannelsRequest +> = core.serialization.object({ + channelIds: core.serialization.property("channel_ids", core.serialization.list(core.serialization.string())), +}); + +export declare namespace BulkRetrieveChannelsRequest { + export interface Raw { + channel_ids: string[]; + } +} diff --git a/src/serialization/resources/channels/client/requests/index.ts b/src/serialization/resources/channels/client/requests/index.ts new file mode 100644 index 000000000..1b0856e98 --- /dev/null +++ b/src/serialization/resources/channels/client/requests/index.ts @@ -0,0 +1 @@ +export { BulkRetrieveChannelsRequest } from "./BulkRetrieveChannelsRequest"; diff --git a/src/serialization/resources/channels/index.ts b/src/serialization/resources/channels/index.ts new file mode 100644 index 000000000..5ec76921e --- /dev/null +++ b/src/serialization/resources/channels/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 4ac63f244..51fc24220 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -12,6 +12,8 @@ export * as cards from "./cards"; export * from "./cards/client/requests"; export * as catalog from "./catalog"; export * from "./catalog/client/requests"; +export * as channels from "./channels"; +export * from "./channels/client/requests"; export * as customers from "./customers"; export * from "./customers/client/requests"; export * as disputes from "./disputes"; @@ -44,6 +46,8 @@ export * as teamMembers from "./teamMembers"; export * from "./teamMembers/client/requests"; export * as team from "./team"; export * from "./team/client/requests"; +export * as transferOrders from "./transferOrders"; +export * from "./transferOrders/client/requests"; export * as vendors from "./vendors"; export * from "./vendors/client/requests"; export * as devices from "./devices"; diff --git a/src/serialization/resources/transferOrders/client/index.ts b/src/serialization/resources/transferOrders/client/index.ts new file mode 100644 index 000000000..415726b7f --- /dev/null +++ b/src/serialization/resources/transferOrders/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts new file mode 100644 index 000000000..1642cb61d --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const CancelTransferOrderRequest: core.serialization.Schema< + serializers.CancelTransferOrderRequest.Raw, + Omit +> = core.serialization.object({ + idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), + version: core.serialization.bigint().optional(), +}); + +export declare namespace CancelTransferOrderRequest { + export interface Raw { + idempotency_key: string; + version?: (bigint | number) | null; + } +} diff --git a/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts new file mode 100644 index 000000000..29f8ae59d --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { CreateTransferOrderData } from "../../../../types/CreateTransferOrderData"; + +export const CreateTransferOrderRequest: core.serialization.Schema< + serializers.CreateTransferOrderRequest.Raw, + Square.CreateTransferOrderRequest +> = core.serialization.object({ + idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), + transferOrder: core.serialization.property("transfer_order", CreateTransferOrderData), +}); + +export declare namespace CreateTransferOrderRequest { + export interface Raw { + idempotency_key: string; + transfer_order: CreateTransferOrderData.Raw; + } +} diff --git a/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts new file mode 100644 index 000000000..8c52fdd2b --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { TransferOrderGoodsReceipt } from "../../../../types/TransferOrderGoodsReceipt"; + +export const ReceiveTransferOrderRequest: core.serialization.Schema< + serializers.ReceiveTransferOrderRequest.Raw, + Omit +> = core.serialization.object({ + idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), + receipt: TransferOrderGoodsReceipt, + version: core.serialization.bigint().optional(), +}); + +export declare namespace ReceiveTransferOrderRequest { + export interface Raw { + idempotency_key: string; + receipt: TransferOrderGoodsReceipt.Raw; + version?: (bigint | number) | null; + } +} diff --git a/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts b/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts new file mode 100644 index 000000000..3e933e01b --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { TransferOrderQuery } from "../../../../types/TransferOrderQuery"; + +export const SearchTransferOrdersRequest: core.serialization.Schema< + serializers.SearchTransferOrdersRequest.Raw, + Square.SearchTransferOrdersRequest +> = core.serialization.object({ + query: TransferOrderQuery.optional(), + cursor: core.serialization.string().optional(), + limit: core.serialization.number().optional(), +}); + +export declare namespace SearchTransferOrdersRequest { + export interface Raw { + query?: TransferOrderQuery.Raw | null; + cursor?: string | null; + limit?: number | null; + } +} diff --git a/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts new file mode 100644 index 000000000..f3b558d7c --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const StartTransferOrderRequest: core.serialization.Schema< + serializers.StartTransferOrderRequest.Raw, + Omit +> = core.serialization.object({ + idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), + version: core.serialization.bigint().optional(), +}); + +export declare namespace StartTransferOrderRequest { + export interface Raw { + idempotency_key: string; + version?: (bigint | number) | null; + } +} diff --git a/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts new file mode 100644 index 000000000..f6d398ecd --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { UpdateTransferOrderData } from "../../../../types/UpdateTransferOrderData"; + +export const UpdateTransferOrderRequest: core.serialization.Schema< + serializers.UpdateTransferOrderRequest.Raw, + Omit +> = core.serialization.object({ + idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), + transferOrder: core.serialization.property("transfer_order", UpdateTransferOrderData), + version: core.serialization.bigint().optional(), +}); + +export declare namespace UpdateTransferOrderRequest { + export interface Raw { + idempotency_key: string; + transfer_order: UpdateTransferOrderData.Raw; + version?: (bigint | number) | null; + } +} diff --git a/src/serialization/resources/transferOrders/client/requests/index.ts b/src/serialization/resources/transferOrders/client/requests/index.ts new file mode 100644 index 000000000..8c4b45ffa --- /dev/null +++ b/src/serialization/resources/transferOrders/client/requests/index.ts @@ -0,0 +1,6 @@ +export { CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; +export { SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; +export { UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; +export { CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; +export { ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; +export { StartTransferOrderRequest } from "./StartTransferOrderRequest"; diff --git a/src/serialization/resources/transferOrders/index.ts b/src/serialization/resources/transferOrders/index.ts new file mode 100644 index 000000000..5ec76921e --- /dev/null +++ b/src/serialization/resources/transferOrders/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts b/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts new file mode 100644 index 000000000..1e8ea7bcc --- /dev/null +++ b/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const BulkRetrieveChannelsRequestConstants: core.serialization.Schema< + serializers.BulkRetrieveChannelsRequestConstants.Raw, + Square.BulkRetrieveChannelsRequestConstants +> = core.serialization.stringLiteral("MAX_BATCH_SIZE"); + +export declare namespace BulkRetrieveChannelsRequestConstants { + export type Raw = "MAX_BATCH_SIZE"; +} diff --git a/src/serialization/types/BulkRetrieveChannelsResponse.ts b/src/serialization/types/BulkRetrieveChannelsResponse.ts new file mode 100644 index 000000000..a9f30befa --- /dev/null +++ b/src/serialization/types/BulkRetrieveChannelsResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { Error_ } from "./Error_"; +import { RetrieveChannelResponse } from "./RetrieveChannelResponse"; + +export const BulkRetrieveChannelsResponse: core.serialization.ObjectSchema< + serializers.BulkRetrieveChannelsResponse.Raw, + Square.BulkRetrieveChannelsResponse +> = core.serialization.object({ + errors: core.serialization.list(Error_).optional(), + responses: core.serialization.record(core.serialization.string(), RetrieveChannelResponse).optional(), +}); + +export declare namespace BulkRetrieveChannelsResponse { + export interface Raw { + errors?: Error_.Raw[] | null; + responses?: Record | null; + } +} diff --git a/src/serialization/types/CancelTransferOrderResponse.ts b/src/serialization/types/CancelTransferOrderResponse.ts new file mode 100644 index 000000000..e125ad7a1 --- /dev/null +++ b/src/serialization/types/CancelTransferOrderResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const CancelTransferOrderResponse: core.serialization.ObjectSchema< + serializers.CancelTransferOrderResponse.Raw, + Square.CancelTransferOrderResponse +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace CancelTransferOrderResponse { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/Channel.ts b/src/serialization/types/Channel.ts new file mode 100644 index 000000000..d4d8dd500 --- /dev/null +++ b/src/serialization/types/Channel.ts @@ -0,0 +1,34 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { Reference } from "./Reference"; +import { ChannelStatus } from "./ChannelStatus"; + +export const Channel: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optional(), + merchantId: core.serialization.property("merchant_id", core.serialization.string().optional()), + name: core.serialization.string().optionalNullable(), + version: core.serialization.number().optional(), + reference: Reference.optional(), + status: ChannelStatus.optional(), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), + }); + +export declare namespace Channel { + export interface Raw { + id?: string | null; + merchant_id?: string | null; + name?: (string | null) | null; + version?: number | null; + reference?: Reference.Raw | null; + status?: ChannelStatus.Raw | null; + created_at?: string | null; + updated_at?: string | null; + } +} diff --git a/src/serialization/types/ChannelStatus.ts b/src/serialization/types/ChannelStatus.ts new file mode 100644 index 000000000..18bb0c931 --- /dev/null +++ b/src/serialization/types/ChannelStatus.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const ChannelStatus: core.serialization.Schema = + core.serialization.enum_(["ACTIVE", "INACTIVE"]); + +export declare namespace ChannelStatus { + export type Raw = "ACTIVE" | "INACTIVE"; +} diff --git a/src/serialization/types/CreateTransferOrderData.ts b/src/serialization/types/CreateTransferOrderData.ts new file mode 100644 index 000000000..d87af9b3d --- /dev/null +++ b/src/serialization/types/CreateTransferOrderData.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { CreateTransferOrderLineData } from "./CreateTransferOrderLineData"; + +export const CreateTransferOrderData: core.serialization.ObjectSchema< + serializers.CreateTransferOrderData.Raw, + Square.CreateTransferOrderData +> = core.serialization.object({ + sourceLocationId: core.serialization.property("source_location_id", core.serialization.string()), + destinationLocationId: core.serialization.property("destination_location_id", core.serialization.string()), + expectedAt: core.serialization.property("expected_at", core.serialization.string().optionalNullable()), + notes: core.serialization.string().optionalNullable(), + trackingNumber: core.serialization.property("tracking_number", core.serialization.string().optionalNullable()), + createdByTeamMemberId: core.serialization.property( + "created_by_team_member_id", + core.serialization.string().optionalNullable(), + ), + lineItems: core.serialization.property( + "line_items", + core.serialization.list(CreateTransferOrderLineData).optionalNullable(), + ), +}); + +export declare namespace CreateTransferOrderData { + export interface Raw { + source_location_id: string; + destination_location_id: string; + expected_at?: (string | null) | null; + notes?: (string | null) | null; + tracking_number?: (string | null) | null; + created_by_team_member_id?: (string | null) | null; + line_items?: (CreateTransferOrderLineData.Raw[] | null) | null; + } +} diff --git a/src/serialization/types/CreateTransferOrderLineData.ts b/src/serialization/types/CreateTransferOrderLineData.ts new file mode 100644 index 000000000..5819787be --- /dev/null +++ b/src/serialization/types/CreateTransferOrderLineData.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const CreateTransferOrderLineData: core.serialization.ObjectSchema< + serializers.CreateTransferOrderLineData.Raw, + Square.CreateTransferOrderLineData +> = core.serialization.object({ + itemVariationId: core.serialization.property("item_variation_id", core.serialization.string()), + quantityOrdered: core.serialization.property("quantity_ordered", core.serialization.string()), +}); + +export declare namespace CreateTransferOrderLineData { + export interface Raw { + item_variation_id: string; + quantity_ordered: string; + } +} diff --git a/src/serialization/types/CreateTransferOrderResponse.ts b/src/serialization/types/CreateTransferOrderResponse.ts new file mode 100644 index 000000000..f6e02796d --- /dev/null +++ b/src/serialization/types/CreateTransferOrderResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const CreateTransferOrderResponse: core.serialization.ObjectSchema< + serializers.CreateTransferOrderResponse.Raw, + Square.CreateTransferOrderResponse +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace CreateTransferOrderResponse { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/CustomAttribute.ts b/src/serialization/types/CustomAttribute.ts index 7456f606c..2f671981f 100644 --- a/src/serialization/types/CustomAttribute.ts +++ b/src/serialization/types/CustomAttribute.ts @@ -11,7 +11,7 @@ import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; export const CustomAttribute: core.serialization.ObjectSchema = core.serialization.object({ key: core.serialization.string().optionalNullable(), - value: core.serialization.unknown().optional(), + value: core.serialization.unknown().optionalNullable(), version: core.serialization.number().optional(), visibility: CustomAttributeDefinitionVisibility.optional(), definition: CustomAttributeDefinition.optional(), @@ -22,7 +22,7 @@ export const CustomAttribute: core.serialization.ObjectSchema = core.serialization.object({ + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace DeleteTransferOrderResponse { + export interface Raw { + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/ListChannelsRequestConstants.ts b/src/serialization/types/ListChannelsRequestConstants.ts new file mode 100644 index 000000000..492bd7fef --- /dev/null +++ b/src/serialization/types/ListChannelsRequestConstants.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const ListChannelsRequestConstants: core.serialization.Schema< + serializers.ListChannelsRequestConstants.Raw, + Square.ListChannelsRequestConstants +> = core.serialization.stringLiteral("MAX_PAGE_SIZE"); + +export declare namespace ListChannelsRequestConstants { + export type Raw = "MAX_PAGE_SIZE"; +} diff --git a/src/serialization/types/ListChannelsResponse.ts b/src/serialization/types/ListChannelsResponse.ts new file mode 100644 index 000000000..d7d109dd8 --- /dev/null +++ b/src/serialization/types/ListChannelsResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { Error_ } from "./Error_"; +import { Channel } from "./Channel"; + +export const ListChannelsResponse: core.serialization.ObjectSchema< + serializers.ListChannelsResponse.Raw, + Square.ListChannelsResponse +> = core.serialization.object({ + errors: core.serialization.list(Error_).optional(), + channels: core.serialization.list(Channel).optional(), + cursor: core.serialization.string().optional(), +}); + +export declare namespace ListChannelsResponse { + export interface Raw { + errors?: Error_.Raw[] | null; + channels?: Channel.Raw[] | null; + cursor?: string | null; + } +} diff --git a/src/serialization/types/ReceiveTransferOrderResponse.ts b/src/serialization/types/ReceiveTransferOrderResponse.ts new file mode 100644 index 000000000..90d2ecbbe --- /dev/null +++ b/src/serialization/types/ReceiveTransferOrderResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const ReceiveTransferOrderResponse: core.serialization.ObjectSchema< + serializers.ReceiveTransferOrderResponse.Raw, + Square.ReceiveTransferOrderResponse +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace ReceiveTransferOrderResponse { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/Reference.ts b/src/serialization/types/Reference.ts new file mode 100644 index 000000000..d3c83c1eb --- /dev/null +++ b/src/serialization/types/Reference.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { ReferenceType } from "./ReferenceType"; + +export const Reference: core.serialization.ObjectSchema = + core.serialization.object({ + type: ReferenceType.optional(), + id: core.serialization.string().optional(), + }); + +export declare namespace Reference { + export interface Raw { + type?: ReferenceType.Raw | null; + id?: string | null; + } +} diff --git a/src/serialization/types/ReferenceType.ts b/src/serialization/types/ReferenceType.ts new file mode 100644 index 000000000..1de4d0d77 --- /dev/null +++ b/src/serialization/types/ReferenceType.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const ReferenceType: core.serialization.Schema = + core.serialization.enum_([ + "UNKNOWN_TYPE", + "LOCATION", + "FIRST_PARTY_INTEGRATION", + "OAUTH_APPLICATION", + "ONLINE_SITE", + "ONLINE_CHECKOUT", + "INVOICE", + "GIFT_CARD", + "GIFT_CARD_MARKETPLACE", + "RECURRING_SUBSCRIPTION", + "ONLINE_BOOKING_FLOW", + "SQUARE_ASSISTANT", + "CASH_LOCAL", + "POINT_OF_SALE", + "KIOSK", + ]); + +export declare namespace ReferenceType { + export type Raw = + | "UNKNOWN_TYPE" + | "LOCATION" + | "FIRST_PARTY_INTEGRATION" + | "OAUTH_APPLICATION" + | "ONLINE_SITE" + | "ONLINE_CHECKOUT" + | "INVOICE" + | "GIFT_CARD" + | "GIFT_CARD_MARKETPLACE" + | "RECURRING_SUBSCRIPTION" + | "ONLINE_BOOKING_FLOW" + | "SQUARE_ASSISTANT" + | "CASH_LOCAL" + | "POINT_OF_SALE" + | "KIOSK"; +} diff --git a/src/serialization/types/RetrieveChannelResponse.ts b/src/serialization/types/RetrieveChannelResponse.ts new file mode 100644 index 000000000..0bb1147f0 --- /dev/null +++ b/src/serialization/types/RetrieveChannelResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { Error_ } from "./Error_"; +import { Channel } from "./Channel"; + +export const RetrieveChannelResponse: core.serialization.ObjectSchema< + serializers.RetrieveChannelResponse.Raw, + Square.RetrieveChannelResponse +> = core.serialization.object({ + errors: core.serialization.list(Error_).optional(), + channel: Channel.optional(), +}); + +export declare namespace RetrieveChannelResponse { + export interface Raw { + errors?: Error_.Raw[] | null; + channel?: Channel.Raw | null; + } +} diff --git a/src/serialization/types/RetrieveTransferOrderResponse.ts b/src/serialization/types/RetrieveTransferOrderResponse.ts new file mode 100644 index 000000000..b0cf1a404 --- /dev/null +++ b/src/serialization/types/RetrieveTransferOrderResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const RetrieveTransferOrderResponse: core.serialization.ObjectSchema< + serializers.RetrieveTransferOrderResponse.Raw, + Square.RetrieveTransferOrderResponse +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace RetrieveTransferOrderResponse { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/SearchTransferOrdersResponse.ts b/src/serialization/types/SearchTransferOrdersResponse.ts new file mode 100644 index 000000000..36fd4ef47 --- /dev/null +++ b/src/serialization/types/SearchTransferOrdersResponse.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const SearchTransferOrdersResponse: core.serialization.ObjectSchema< + serializers.SearchTransferOrdersResponse.Raw, + Square.SearchTransferOrdersResponse +> = core.serialization.object({ + transferOrders: core.serialization.property("transfer_orders", core.serialization.list(TransferOrder).optional()), + cursor: core.serialization.string().optional(), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace SearchTransferOrdersResponse { + export interface Raw { + transfer_orders?: TransferOrder.Raw[] | null; + cursor?: string | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/StartTransferOrderResponse.ts b/src/serialization/types/StartTransferOrderResponse.ts new file mode 100644 index 000000000..08684f95e --- /dev/null +++ b/src/serialization/types/StartTransferOrderResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const StartTransferOrderResponse: core.serialization.ObjectSchema< + serializers.StartTransferOrderResponse.Raw, + Square.StartTransferOrderResponse +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace StartTransferOrderResponse { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/TransferOrder.ts b/src/serialization/types/TransferOrder.ts new file mode 100644 index 000000000..c7e4695ce --- /dev/null +++ b/src/serialization/types/TransferOrder.ts @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderStatus } from "./TransferOrderStatus"; +import { TransferOrderLine } from "./TransferOrderLine"; + +export const TransferOrder: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optional(), + sourceLocationId: core.serialization.property( + "source_location_id", + core.serialization.string().optionalNullable(), + ), + destinationLocationId: core.serialization.property( + "destination_location_id", + core.serialization.string().optionalNullable(), + ), + status: TransferOrderStatus.optional(), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), + expectedAt: core.serialization.property("expected_at", core.serialization.string().optionalNullable()), + completedAt: core.serialization.property("completed_at", core.serialization.string().optional()), + notes: core.serialization.string().optionalNullable(), + trackingNumber: core.serialization.property("tracking_number", core.serialization.string().optionalNullable()), + createdByTeamMemberId: core.serialization.property( + "created_by_team_member_id", + core.serialization.string().optional(), + ), + lineItems: core.serialization.property( + "line_items", + core.serialization.list(TransferOrderLine).optionalNullable(), + ), + version: core.serialization.bigint().optional(), + }); + +export declare namespace TransferOrder { + export interface Raw { + id?: string | null; + source_location_id?: (string | null) | null; + destination_location_id?: (string | null) | null; + status?: TransferOrderStatus.Raw | null; + created_at?: string | null; + updated_at?: string | null; + expected_at?: (string | null) | null; + completed_at?: string | null; + notes?: (string | null) | null; + tracking_number?: (string | null) | null; + created_by_team_member_id?: string | null; + line_items?: (TransferOrderLine.Raw[] | null) | null; + version?: (bigint | number) | null; + } +} diff --git a/src/serialization/types/TransferOrderCreatedEvent.ts b/src/serialization/types/TransferOrderCreatedEvent.ts new file mode 100644 index 000000000..e37d7bc2c --- /dev/null +++ b/src/serialization/types/TransferOrderCreatedEvent.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderCreatedEventData } from "./TransferOrderCreatedEventData"; + +export const TransferOrderCreatedEvent: core.serialization.ObjectSchema< + serializers.TransferOrderCreatedEvent.Raw, + Square.TransferOrderCreatedEvent +> = core.serialization.object({ + merchantId: core.serialization.property("merchant_id", core.serialization.string().optionalNullable()), + type: core.serialization.string().optionalNullable(), + eventId: core.serialization.property("event_id", core.serialization.string().optionalNullable()), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + data: TransferOrderCreatedEventData.optional(), +}); + +export declare namespace TransferOrderCreatedEvent { + export interface Raw { + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; + created_at?: string | null; + data?: TransferOrderCreatedEventData.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderCreatedEventData.ts b/src/serialization/types/TransferOrderCreatedEventData.ts new file mode 100644 index 000000000..78735aab8 --- /dev/null +++ b/src/serialization/types/TransferOrderCreatedEventData.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderCreatedEventObject } from "./TransferOrderCreatedEventObject"; + +export const TransferOrderCreatedEventData: core.serialization.ObjectSchema< + serializers.TransferOrderCreatedEventData.Raw, + Square.TransferOrderCreatedEventData +> = core.serialization.object({ + type: core.serialization.string().optionalNullable(), + id: core.serialization.string().optional(), + object: TransferOrderCreatedEventObject.optional(), +}); + +export declare namespace TransferOrderCreatedEventData { + export interface Raw { + type?: (string | null) | null; + id?: string | null; + object?: TransferOrderCreatedEventObject.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderCreatedEventObject.ts b/src/serialization/types/TransferOrderCreatedEventObject.ts new file mode 100644 index 000000000..d7ccd88cc --- /dev/null +++ b/src/serialization/types/TransferOrderCreatedEventObject.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; + +export const TransferOrderCreatedEventObject: core.serialization.ObjectSchema< + serializers.TransferOrderCreatedEventObject.Raw, + Square.TransferOrderCreatedEventObject +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), +}); + +export declare namespace TransferOrderCreatedEventObject { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderDeletedEvent.ts b/src/serialization/types/TransferOrderDeletedEvent.ts new file mode 100644 index 000000000..3f4e2e1fd --- /dev/null +++ b/src/serialization/types/TransferOrderDeletedEvent.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderDeletedEventData } from "./TransferOrderDeletedEventData"; + +export const TransferOrderDeletedEvent: core.serialization.ObjectSchema< + serializers.TransferOrderDeletedEvent.Raw, + Square.TransferOrderDeletedEvent +> = core.serialization.object({ + merchantId: core.serialization.property("merchant_id", core.serialization.string().optionalNullable()), + type: core.serialization.string().optionalNullable(), + eventId: core.serialization.property("event_id", core.serialization.string().optionalNullable()), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + data: TransferOrderDeletedEventData.optional(), +}); + +export declare namespace TransferOrderDeletedEvent { + export interface Raw { + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; + created_at?: string | null; + data?: TransferOrderDeletedEventData.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderDeletedEventData.ts b/src/serialization/types/TransferOrderDeletedEventData.ts new file mode 100644 index 000000000..4038ef66a --- /dev/null +++ b/src/serialization/types/TransferOrderDeletedEventData.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const TransferOrderDeletedEventData: core.serialization.ObjectSchema< + serializers.TransferOrderDeletedEventData.Raw, + Square.TransferOrderDeletedEventData +> = core.serialization.object({ + type: core.serialization.string().optionalNullable(), + id: core.serialization.string().optional(), + deleted: core.serialization.boolean().optionalNullable(), +}); + +export declare namespace TransferOrderDeletedEventData { + export interface Raw { + type?: (string | null) | null; + id?: string | null; + deleted?: (boolean | null) | null; + } +} diff --git a/src/serialization/types/TransferOrderFilter.ts b/src/serialization/types/TransferOrderFilter.ts new file mode 100644 index 000000000..273868b1c --- /dev/null +++ b/src/serialization/types/TransferOrderFilter.ts @@ -0,0 +1,31 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderStatus } from "./TransferOrderStatus"; + +export const TransferOrderFilter: core.serialization.ObjectSchema< + serializers.TransferOrderFilter.Raw, + Square.TransferOrderFilter +> = core.serialization.object({ + sourceLocationIds: core.serialization.property( + "source_location_ids", + core.serialization.list(core.serialization.string()).optionalNullable(), + ), + destinationLocationIds: core.serialization.property( + "destination_location_ids", + core.serialization.list(core.serialization.string()).optionalNullable(), + ), + statuses: core.serialization.list(TransferOrderStatus).optionalNullable(), +}); + +export declare namespace TransferOrderFilter { + export interface Raw { + source_location_ids?: (string[] | null) | null; + destination_location_ids?: (string[] | null) | null; + statuses?: (TransferOrderStatus.Raw[] | null) | null; + } +} diff --git a/src/serialization/types/TransferOrderGoodsReceipt.ts b/src/serialization/types/TransferOrderGoodsReceipt.ts new file mode 100644 index 000000000..78e135007 --- /dev/null +++ b/src/serialization/types/TransferOrderGoodsReceipt.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderGoodsReceiptLineItem } from "./TransferOrderGoodsReceiptLineItem"; + +export const TransferOrderGoodsReceipt: core.serialization.ObjectSchema< + serializers.TransferOrderGoodsReceipt.Raw, + Square.TransferOrderGoodsReceipt +> = core.serialization.object({ + lineItems: core.serialization.property( + "line_items", + core.serialization.list(TransferOrderGoodsReceiptLineItem).optionalNullable(), + ), +}); + +export declare namespace TransferOrderGoodsReceipt { + export interface Raw { + line_items?: (TransferOrderGoodsReceiptLineItem.Raw[] | null) | null; + } +} diff --git a/src/serialization/types/TransferOrderGoodsReceiptLineItem.ts b/src/serialization/types/TransferOrderGoodsReceiptLineItem.ts new file mode 100644 index 000000000..14986d4c6 --- /dev/null +++ b/src/serialization/types/TransferOrderGoodsReceiptLineItem.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const TransferOrderGoodsReceiptLineItem: core.serialization.ObjectSchema< + serializers.TransferOrderGoodsReceiptLineItem.Raw, + Square.TransferOrderGoodsReceiptLineItem +> = core.serialization.object({ + transferOrderLineUid: core.serialization.property("transfer_order_line_uid", core.serialization.string()), + quantityReceived: core.serialization.property("quantity_received", core.serialization.string().optionalNullable()), + quantityDamaged: core.serialization.property("quantity_damaged", core.serialization.string().optionalNullable()), + quantityCanceled: core.serialization.property("quantity_canceled", core.serialization.string().optionalNullable()), +}); + +export declare namespace TransferOrderGoodsReceiptLineItem { + export interface Raw { + transfer_order_line_uid: string; + quantity_received?: (string | null) | null; + quantity_damaged?: (string | null) | null; + quantity_canceled?: (string | null) | null; + } +} diff --git a/src/serialization/types/TransferOrderLine.ts b/src/serialization/types/TransferOrderLine.ts new file mode 100644 index 000000000..643b5bf32 --- /dev/null +++ b/src/serialization/types/TransferOrderLine.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const TransferOrderLine: core.serialization.ObjectSchema< + serializers.TransferOrderLine.Raw, + Square.TransferOrderLine +> = core.serialization.object({ + uid: core.serialization.string().optional(), + itemVariationId: core.serialization.property("item_variation_id", core.serialization.string()), + quantityOrdered: core.serialization.property("quantity_ordered", core.serialization.string()), + quantityPending: core.serialization.property("quantity_pending", core.serialization.string().optional()), + quantityReceived: core.serialization.property("quantity_received", core.serialization.string().optional()), + quantityDamaged: core.serialization.property("quantity_damaged", core.serialization.string().optional()), + quantityCanceled: core.serialization.property("quantity_canceled", core.serialization.string().optional()), +}); + +export declare namespace TransferOrderLine { + export interface Raw { + uid?: string | null; + item_variation_id: string; + quantity_ordered: string; + quantity_pending?: string | null; + quantity_received?: string | null; + quantity_damaged?: string | null; + quantity_canceled?: string | null; + } +} diff --git a/src/serialization/types/TransferOrderQuery.ts b/src/serialization/types/TransferOrderQuery.ts new file mode 100644 index 000000000..993afd79f --- /dev/null +++ b/src/serialization/types/TransferOrderQuery.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderFilter } from "./TransferOrderFilter"; +import { TransferOrderSort } from "./TransferOrderSort"; + +export const TransferOrderQuery: core.serialization.ObjectSchema< + serializers.TransferOrderQuery.Raw, + Square.TransferOrderQuery +> = core.serialization.object({ + filter: TransferOrderFilter.optional(), + sort: TransferOrderSort.optional(), +}); + +export declare namespace TransferOrderQuery { + export interface Raw { + filter?: TransferOrderFilter.Raw | null; + sort?: TransferOrderSort.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderSort.ts b/src/serialization/types/TransferOrderSort.ts new file mode 100644 index 000000000..c0363d253 --- /dev/null +++ b/src/serialization/types/TransferOrderSort.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderSortField } from "./TransferOrderSortField"; +import { SortOrder } from "./SortOrder"; + +export const TransferOrderSort: core.serialization.ObjectSchema< + serializers.TransferOrderSort.Raw, + Square.TransferOrderSort +> = core.serialization.object({ + field: TransferOrderSortField.optional(), + order: SortOrder.optional(), +}); + +export declare namespace TransferOrderSort { + export interface Raw { + field?: TransferOrderSortField.Raw | null; + order?: SortOrder.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderSortField.ts b/src/serialization/types/TransferOrderSortField.ts new file mode 100644 index 000000000..d84b34f95 --- /dev/null +++ b/src/serialization/types/TransferOrderSortField.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const TransferOrderSortField: core.serialization.Schema< + serializers.TransferOrderSortField.Raw, + Square.TransferOrderSortField +> = core.serialization.enum_(["CREATED_AT", "UPDATED_AT"]); + +export declare namespace TransferOrderSortField { + export type Raw = "CREATED_AT" | "UPDATED_AT"; +} diff --git a/src/serialization/types/TransferOrderStatus.ts b/src/serialization/types/TransferOrderStatus.ts new file mode 100644 index 000000000..9efdbeb93 --- /dev/null +++ b/src/serialization/types/TransferOrderStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const TransferOrderStatus: core.serialization.Schema< + serializers.TransferOrderStatus.Raw, + Square.TransferOrderStatus +> = core.serialization.enum_(["DRAFT", "STARTED", "PARTIALLY_RECEIVED", "COMPLETED", "CANCELED"]); + +export declare namespace TransferOrderStatus { + export type Raw = "DRAFT" | "STARTED" | "PARTIALLY_RECEIVED" | "COMPLETED" | "CANCELED"; +} diff --git a/src/serialization/types/TransferOrderUpdatedEvent.ts b/src/serialization/types/TransferOrderUpdatedEvent.ts new file mode 100644 index 000000000..956b7eb64 --- /dev/null +++ b/src/serialization/types/TransferOrderUpdatedEvent.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderUpdatedEventData } from "./TransferOrderUpdatedEventData"; + +export const TransferOrderUpdatedEvent: core.serialization.ObjectSchema< + serializers.TransferOrderUpdatedEvent.Raw, + Square.TransferOrderUpdatedEvent +> = core.serialization.object({ + merchantId: core.serialization.property("merchant_id", core.serialization.string().optionalNullable()), + type: core.serialization.string().optionalNullable(), + eventId: core.serialization.property("event_id", core.serialization.string().optionalNullable()), + createdAt: core.serialization.property("created_at", core.serialization.string().optional()), + data: TransferOrderUpdatedEventData.optional(), +}); + +export declare namespace TransferOrderUpdatedEvent { + export interface Raw { + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; + created_at?: string | null; + data?: TransferOrderUpdatedEventData.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderUpdatedEventData.ts b/src/serialization/types/TransferOrderUpdatedEventData.ts new file mode 100644 index 000000000..abaa4f737 --- /dev/null +++ b/src/serialization/types/TransferOrderUpdatedEventData.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrderUpdatedEventObject } from "./TransferOrderUpdatedEventObject"; + +export const TransferOrderUpdatedEventData: core.serialization.ObjectSchema< + serializers.TransferOrderUpdatedEventData.Raw, + Square.TransferOrderUpdatedEventData +> = core.serialization.object({ + type: core.serialization.string().optionalNullable(), + id: core.serialization.string().optional(), + object: TransferOrderUpdatedEventObject.optional(), +}); + +export declare namespace TransferOrderUpdatedEventData { + export interface Raw { + type?: (string | null) | null; + id?: string | null; + object?: TransferOrderUpdatedEventObject.Raw | null; + } +} diff --git a/src/serialization/types/TransferOrderUpdatedEventObject.ts b/src/serialization/types/TransferOrderUpdatedEventObject.ts new file mode 100644 index 000000000..000e7a400 --- /dev/null +++ b/src/serialization/types/TransferOrderUpdatedEventObject.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; + +export const TransferOrderUpdatedEventObject: core.serialization.ObjectSchema< + serializers.TransferOrderUpdatedEventObject.Raw, + Square.TransferOrderUpdatedEventObject +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), +}); + +export declare namespace TransferOrderUpdatedEventObject { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + } +} diff --git a/src/serialization/types/UpdateTransferOrderData.ts b/src/serialization/types/UpdateTransferOrderData.ts new file mode 100644 index 000000000..fd59ea68b --- /dev/null +++ b/src/serialization/types/UpdateTransferOrderData.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { UpdateTransferOrderLineData } from "./UpdateTransferOrderLineData"; + +export const UpdateTransferOrderData: core.serialization.ObjectSchema< + serializers.UpdateTransferOrderData.Raw, + Square.UpdateTransferOrderData +> = core.serialization.object({ + sourceLocationId: core.serialization.property("source_location_id", core.serialization.string().optionalNullable()), + destinationLocationId: core.serialization.property( + "destination_location_id", + core.serialization.string().optionalNullable(), + ), + expectedAt: core.serialization.property("expected_at", core.serialization.string().optionalNullable()), + notes: core.serialization.string().optionalNullable(), + trackingNumber: core.serialization.property("tracking_number", core.serialization.string().optionalNullable()), + lineItems: core.serialization.property( + "line_items", + core.serialization.list(UpdateTransferOrderLineData).optionalNullable(), + ), +}); + +export declare namespace UpdateTransferOrderData { + export interface Raw { + source_location_id?: (string | null) | null; + destination_location_id?: (string | null) | null; + expected_at?: (string | null) | null; + notes?: (string | null) | null; + tracking_number?: (string | null) | null; + line_items?: (UpdateTransferOrderLineData.Raw[] | null) | null; + } +} diff --git a/src/serialization/types/UpdateTransferOrderLineData.ts b/src/serialization/types/UpdateTransferOrderLineData.ts new file mode 100644 index 000000000..8d57d4ba3 --- /dev/null +++ b/src/serialization/types/UpdateTransferOrderLineData.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; + +export const UpdateTransferOrderLineData: core.serialization.ObjectSchema< + serializers.UpdateTransferOrderLineData.Raw, + Square.UpdateTransferOrderLineData +> = core.serialization.object({ + uid: core.serialization.string().optionalNullable(), + itemVariationId: core.serialization.property("item_variation_id", core.serialization.string().optionalNullable()), + quantityOrdered: core.serialization.property("quantity_ordered", core.serialization.string().optionalNullable()), + remove: core.serialization.boolean().optionalNullable(), +}); + +export declare namespace UpdateTransferOrderLineData { + export interface Raw { + uid?: (string | null) | null; + item_variation_id?: (string | null) | null; + quantity_ordered?: (string | null) | null; + remove?: (boolean | null) | null; + } +} diff --git a/src/serialization/types/UpdateTransferOrderResponse.ts b/src/serialization/types/UpdateTransferOrderResponse.ts new file mode 100644 index 000000000..271ec305a --- /dev/null +++ b/src/serialization/types/UpdateTransferOrderResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; +import { TransferOrder } from "./TransferOrder"; +import { Error_ } from "./Error_"; + +export const UpdateTransferOrderResponse: core.serialization.ObjectSchema< + serializers.UpdateTransferOrderResponse.Raw, + Square.UpdateTransferOrderResponse +> = core.serialization.object({ + transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), + errors: core.serialization.list(Error_).optional(), +}); + +export declare namespace UpdateTransferOrderResponse { + export interface Raw { + transfer_order?: TransferOrder.Raw | null; + errors?: Error_.Raw[] | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 58eb9f815..a6114f07f 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -82,6 +82,8 @@ export * from "./BulkDeleteOrderCustomAttributesResponse"; export * from "./BulkPublishScheduledShiftsData"; export * from "./BulkPublishScheduledShiftsResponse"; export * from "./BulkRetrieveBookingsResponse"; +export * from "./BulkRetrieveChannelsRequestConstants"; +export * from "./BulkRetrieveChannelsResponse"; export * from "./BulkRetrieveCustomersResponse"; export * from "./BulkRetrieveTeamMemberBookingProfilesResponse"; export * from "./BatchGetVendorsResponse"; @@ -124,6 +126,7 @@ export * from "./CancelSubscriptionResponse"; export * from "./CancelTerminalActionResponse"; export * from "./CancelTerminalCheckoutResponse"; export * from "./CancelTerminalRefundResponse"; +export * from "./CancelTransferOrderResponse"; export * from "./CaptureTransactionResponse"; export * from "./Card"; export * from "./CardAutomaticallyUpdatedEvent"; @@ -234,6 +237,8 @@ export * from "./CatalogVersionUpdatedEventObject"; export * from "./CategoryPathToRootNode"; export * from "./ChangeBillingAnchorDateResponse"; export * from "./ChangeTiming"; +export * from "./Channel"; +export * from "./ChannelStatus"; export * from "./ChargeRequestAdditionalRecipient"; export * from "./Checkout"; export * from "./CheckoutLocationSettings"; @@ -302,6 +307,9 @@ export * from "./CreateTerminalActionResponse"; export * from "./CreateTerminalCheckoutResponse"; export * from "./CreateTerminalRefundResponse"; export * from "./CreateTimecardResponse"; +export * from "./CreateTransferOrderData"; +export * from "./CreateTransferOrderLineData"; +export * from "./CreateTransferOrderResponse"; export * from "./CreateVendorResponse"; export * from "./CreateWebhookSubscriptionResponse"; export * from "./Currency"; @@ -393,6 +401,7 @@ export * from "./DeleteShiftResponse"; export * from "./DeleteSnippetResponse"; export * from "./DeleteSubscriptionActionResponse"; export * from "./DeleteTimecardResponse"; +export * from "./DeleteTransferOrderResponse"; export * from "./DeleteWebhookSubscriptionResponse"; export * from "./Destination"; export * from "./DestinationDetails"; @@ -647,6 +656,8 @@ export * from "./ListCardsResponse"; export * from "./ListCashDrawerShiftEventsResponse"; export * from "./ListCashDrawerShiftsResponse"; export * from "./ListCatalogResponse"; +export * from "./ListChannelsRequestConstants"; +export * from "./ListChannelsResponse"; export * from "./ListCustomerCustomAttributeDefinitionsResponse"; export * from "./ListCustomerCustomAttributesResponse"; export * from "./ListCustomerGroupsResponse"; @@ -943,7 +954,10 @@ export * from "./QrCodeOptions"; export * from "./QuickPay"; export * from "./Range"; export * from "./ReceiptOptions"; +export * from "./ReceiveTransferOrderResponse"; export * from "./RedeemLoyaltyRewardResponse"; +export * from "./Reference"; +export * from "./ReferenceType"; export * from "./Refund"; export * from "./RefundCreatedEvent"; export * from "./RefundCreatedEventData"; @@ -964,6 +978,7 @@ export * from "./GetBusinessBookingProfileResponse"; export * from "./GetCardResponse"; export * from "./GetCashDrawerShiftResponse"; export * from "./GetCatalogObjectResponse"; +export * from "./RetrieveChannelResponse"; export * from "./GetCustomerCustomAttributeDefinitionResponse"; export * from "./GetCustomerCustomAttributeResponse"; export * from "./GetCustomerGroupResponse"; @@ -1006,6 +1021,7 @@ export * from "./GetTeamMemberResponse"; export * from "./RetrieveTimecardResponse"; export * from "./RetrieveTokenStatusResponse"; export * from "./GetTransactionResponse"; +export * from "./RetrieveTransferOrderResponse"; export * from "./GetVendorResponse"; export * from "./GetWageSettingResponse"; export * from "./GetWebhookSubscriptionResponse"; @@ -1064,6 +1080,7 @@ export * from "./SearchTerminalActionsResponse"; export * from "./SearchTerminalCheckoutsResponse"; export * from "./SearchTerminalRefundsResponse"; export * from "./SearchTimecardsResponse"; +export * from "./SearchTransferOrdersResponse"; export * from "./SearchVendorsRequestFilter"; export * from "./SearchVendorsRequestSort"; export * from "./SearchVendorsRequestSortField"; @@ -1091,6 +1108,7 @@ export * from "./SourceApplication"; export * from "./SquareAccountDetails"; export * from "./StandardUnitDescription"; export * from "./StandardUnitDescriptionGroup"; +export * from "./StartTransferOrderResponse"; export * from "./SubmitEvidenceResponse"; export * from "./Subscription"; export * from "./SubscriptionAction"; @@ -1192,6 +1210,23 @@ export * from "./TipSettings"; export * from "./Transaction"; export * from "./TransactionProduct"; export * from "./TransactionType"; +export * from "./TransferOrder"; +export * from "./TransferOrderCreatedEvent"; +export * from "./TransferOrderCreatedEventData"; +export * from "./TransferOrderCreatedEventObject"; +export * from "./TransferOrderDeletedEvent"; +export * from "./TransferOrderDeletedEventData"; +export * from "./TransferOrderFilter"; +export * from "./TransferOrderGoodsReceipt"; +export * from "./TransferOrderGoodsReceiptLineItem"; +export * from "./TransferOrderLine"; +export * from "./TransferOrderQuery"; +export * from "./TransferOrderSort"; +export * from "./TransferOrderSortField"; +export * from "./TransferOrderStatus"; +export * from "./TransferOrderUpdatedEvent"; +export * from "./TransferOrderUpdatedEventData"; +export * from "./TransferOrderUpdatedEventObject"; export * from "./UnlinkCustomerFromGiftCardResponse"; export * from "./UpdateBookingCustomAttributeDefinitionResponse"; export * from "./UpdateBookingResponse"; @@ -1220,6 +1255,9 @@ export * from "./UpdateSubscriptionResponse"; export * from "./UpdateTeamMemberRequest"; export * from "./UpdateTeamMemberResponse"; export * from "./UpdateTimecardResponse"; +export * from "./UpdateTransferOrderData"; +export * from "./UpdateTransferOrderLineData"; +export * from "./UpdateTransferOrderResponse"; export * from "./UpdateVendorRequest"; export * from "./UpdateVendorResponse"; export * from "./UpdateWageSettingResponse"; diff --git a/src/version.ts b/src/version.ts index d1ee57a59..7854a9712 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "43.1.1"; +export const SDK_VERSION = "43.1.0"; diff --git a/tests/wire/bookings/customAttributeDefinitions.test.ts b/tests/wire/bookings/customAttributeDefinitions.test.ts index 803d05ba0..97cadf0b2 100644 --- a/tests/wire/bookings/customAttributeDefinitions.test.ts +++ b/tests/wire/bookings/customAttributeDefinitions.test.ts @@ -90,6 +90,7 @@ describe("CustomAttributeDefinitions", () => { const response = await client.bookings.customAttributeDefinitions.get({ key: "key", + version: 1, }); expect(response).toEqual({ customAttributeDefinition: { diff --git a/tests/wire/bookings/customAttributes.test.ts b/tests/wire/bookings/customAttributes.test.ts index 81ef7210a..602533cfe 100644 --- a/tests/wire/bookings/customAttributes.test.ts +++ b/tests/wire/bookings/customAttributes.test.ts @@ -306,6 +306,8 @@ describe("CustomAttributes", () => { const response = await client.bookings.customAttributes.get({ bookingId: "booking_id", key: "key", + withDefinition: true, + version: 1, }); expect(response).toEqual({ customAttribute: { diff --git a/tests/wire/catalog/object.test.ts b/tests/wire/catalog/object.test.ts index 3b3a58854..65945541d 100644 --- a/tests/wire/catalog/object.test.ts +++ b/tests/wire/catalog/object.test.ts @@ -220,6 +220,9 @@ describe("Object_", () => { const response = await client.catalog.object.get({ objectId: "object_id", + includeRelatedObjects: true, + catalogVersion: BigInt("1000000"), + includeCategoryPathToRoot: true, }); expect(response).toEqual({ errors: [ diff --git a/tests/wire/channels.test.ts b/tests/wire/channels.test.ts new file mode 100644 index 000000000..0f46d1c35 --- /dev/null +++ b/tests/wire/channels.test.ts @@ -0,0 +1,173 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; + +describe("Channels", () => { + test("bulkRetrieve", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { channel_ids: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] }; + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + responses: { + CH_6X139B5MN: { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR" }], + channel: { + id: "CH_6X139B5MN", + merchant_id: "ML64FACEA", + name: "Contoso Fulfillment Application", + version: 1, + reference: { type: "OAUTH_APPLICATION", id: "OA_9C03D0444" }, + status: "ACTIVE", + created_at: "2022-10-25T16:27:00Z", + updated_at: "2022-10-25T16:48:00Z", + }, + }, + CH_9C03D0B59: { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR" }], + channel: { + id: "CH_9C03D0B59", + merchant_id: "ML64FACEA", + name: "State Street Store", + version: 1, + reference: { type: "LOCATION", id: "OA_9C03D0B59" }, + status: "ACTIVE", + created_at: "2022-10-25T16:27:00Z", + updated_at: "2022-10-25T16:48:00Z", + }, + }, + NOT_EXISTING: { errors: [{ category: "API_ERROR", code: "NOT_FOUND" }] }, + }, + }; + server + .mockEndpoint() + .post("/v2/channels/bulk-retrieve") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.channels.bulkRetrieve({ + channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], + }); + expect(response).toEqual({ + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + responses: { + CH_6X139B5MN: { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + }, + ], + channel: { + id: "CH_6X139B5MN", + merchantId: "ML64FACEA", + name: "Contoso Fulfillment Application", + version: 1, + reference: { + type: "OAUTH_APPLICATION", + id: "OA_9C03D0444", + }, + status: "ACTIVE", + createdAt: "2022-10-25T16:27:00Z", + updatedAt: "2022-10-25T16:48:00Z", + }, + }, + CH_9C03D0B59: { + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + }, + ], + channel: { + id: "CH_9C03D0B59", + merchantId: "ML64FACEA", + name: "State Street Store", + version: 1, + reference: { + type: "LOCATION", + id: "OA_9C03D0B59", + }, + status: "ACTIVE", + createdAt: "2022-10-25T16:27:00Z", + updatedAt: "2022-10-25T16:48:00Z", + }, + }, + NOT_EXISTING: { + errors: [ + { + category: "API_ERROR", + code: "NOT_FOUND", + }, + ], + }, + }, + }); + }); + + test("get", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + channel: { + id: "CH_9C03D0B59", + merchant_id: "ML64FACEA", + name: "Contoso Fulfillment Application", + version: 1, + reference: { type: "OAUTH_APPLICATION", id: "OA_9C03D0444" }, + status: "ACTIVE", + created_at: "2022-10-25T16:27:00Z", + updated_at: "2022-10-25T16:48:00Z", + }, + }; + server + .mockEndpoint() + .get("/v2/channels/channel_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.channels.get({ + channelId: "channel_id", + }); + expect(response).toEqual({ + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + channel: { + id: "CH_9C03D0B59", + merchantId: "ML64FACEA", + name: "Contoso Fulfillment Application", + version: 1, + reference: { + type: "OAUTH_APPLICATION", + id: "OA_9C03D0444", + }, + status: "ACTIVE", + createdAt: "2022-10-25T16:27:00Z", + updatedAt: "2022-10-25T16:48:00Z", + }, + }); + }); +}); diff --git a/tests/wire/customers.test.ts b/tests/wire/customers.test.ts index 21fdb5b60..ecd022c26 100644 --- a/tests/wire/customers.test.ts +++ b/tests/wire/customers.test.ts @@ -1106,6 +1106,7 @@ describe("Customers", () => { const response = await client.customers.delete({ customerId: "customer_id", + version: BigInt("1000000"), }); expect(response).toEqual({ errors: [ diff --git a/tests/wire/customers/customAttributeDefinitions.test.ts b/tests/wire/customers/customAttributeDefinitions.test.ts index c91893d5c..d6a45aafd 100644 --- a/tests/wire/customers/customAttributeDefinitions.test.ts +++ b/tests/wire/customers/customAttributeDefinitions.test.ts @@ -108,6 +108,7 @@ describe("CustomAttributeDefinitions", () => { const response = await client.customers.customAttributeDefinitions.get({ key: "key", + version: 1, }); expect(response).toEqual({ customAttributeDefinition: { diff --git a/tests/wire/customers/customAttributes.test.ts b/tests/wire/customers/customAttributes.test.ts index 1e17e6722..d54d1bde3 100644 --- a/tests/wire/customers/customAttributes.test.ts +++ b/tests/wire/customers/customAttributes.test.ts @@ -42,6 +42,8 @@ describe("CustomAttributes", () => { const response = await client.customers.customAttributes.get({ customerId: "customer_id", key: "key", + withDefinition: true, + version: 1, }); expect(response).toEqual({ customAttribute: { diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index 43a51517f..4a20f754d 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -170,7 +170,9 @@ describe("Events", () => { }; server.mockEndpoint().get("/v2/events/types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); - const response = await client.events.listEventTypes(); + const response = await client.events.listEventTypes({ + apiVersion: "api_version", + }); expect(response).toEqual({ errors: [ { diff --git a/tests/wire/invoices.test.ts b/tests/wire/invoices.test.ts index 01fff266f..656882160 100644 --- a/tests/wire/invoices.test.ts +++ b/tests/wire/invoices.test.ts @@ -939,6 +939,7 @@ describe("Invoices", () => { const response = await client.invoices.delete({ invoiceId: "invoice_id", + version: 1, }); expect(response).toEqual({ errors: [ diff --git a/tests/wire/locations/customAttributeDefinitions.test.ts b/tests/wire/locations/customAttributeDefinitions.test.ts index fd1e52bb9..9981e7c1c 100644 --- a/tests/wire/locations/customAttributeDefinitions.test.ts +++ b/tests/wire/locations/customAttributeDefinitions.test.ts @@ -108,6 +108,7 @@ describe("CustomAttributeDefinitions", () => { const response = await client.locations.customAttributeDefinitions.get({ key: "key", + version: 1, }); expect(response).toEqual({ customAttributeDefinition: { diff --git a/tests/wire/locations/customAttributes.test.ts b/tests/wire/locations/customAttributes.test.ts index af23bcc83..97be77755 100644 --- a/tests/wire/locations/customAttributes.test.ts +++ b/tests/wire/locations/customAttributes.test.ts @@ -278,6 +278,8 @@ describe("CustomAttributes", () => { const response = await client.locations.customAttributes.get({ locationId: "location_id", key: "key", + withDefinition: true, + version: 1, }); expect(response).toEqual({ customAttribute: { diff --git a/tests/wire/locations/transactions.test.ts b/tests/wire/locations/transactions.test.ts index 13055153c..1c73f947a 100644 --- a/tests/wire/locations/transactions.test.ts +++ b/tests/wire/locations/transactions.test.ts @@ -79,6 +79,10 @@ describe("Transactions", () => { const response = await client.locations.transactions.list({ locationId: "location_id", + beginTime: "begin_time", + endTime: "end_time", + sortOrder: "DESC", + cursor: "cursor", }); expect(response).toEqual({ errors: [ diff --git a/tests/wire/loyalty/programs/promotions.test.ts b/tests/wire/loyalty/programs/promotions.test.ts index 7739e6ed6..66a5a1ede 100644 --- a/tests/wire/loyalty/programs/promotions.test.ts +++ b/tests/wire/loyalty/programs/promotions.test.ts @@ -177,8 +177,8 @@ describe("Promotions", () => { .build(); const response = await client.loyalty.programs.promotions.get({ - promotionId: "promotion_id", programId: "program_id", + promotionId: "promotion_id", }); expect(response).toEqual({ errors: [ @@ -269,8 +269,8 @@ describe("Promotions", () => { .build(); const response = await client.loyalty.programs.promotions.cancel({ - promotionId: "promotion_id", programId: "program_id", + promotionId: "promotion_id", }); expect(response).toEqual({ errors: [ diff --git a/tests/wire/merchants/customAttributeDefinitions.test.ts b/tests/wire/merchants/customAttributeDefinitions.test.ts index 123d7e9fb..5123e9514 100644 --- a/tests/wire/merchants/customAttributeDefinitions.test.ts +++ b/tests/wire/merchants/customAttributeDefinitions.test.ts @@ -108,6 +108,7 @@ describe("CustomAttributeDefinitions", () => { const response = await client.merchants.customAttributeDefinitions.get({ key: "key", + version: 1, }); expect(response).toEqual({ customAttributeDefinition: { diff --git a/tests/wire/merchants/customAttributes.test.ts b/tests/wire/merchants/customAttributes.test.ts index 358de20d9..d95f40c4c 100644 --- a/tests/wire/merchants/customAttributes.test.ts +++ b/tests/wire/merchants/customAttributes.test.ts @@ -220,6 +220,8 @@ describe("CustomAttributes", () => { const response = await client.merchants.customAttributes.get({ merchantId: "merchant_id", key: "key", + withDefinition: true, + version: 1, }); expect(response).toEqual({ customAttribute: { diff --git a/tests/wire/orders/customAttributeDefinitions.test.ts b/tests/wire/orders/customAttributeDefinitions.test.ts index b95344f51..0e45e7484 100644 --- a/tests/wire/orders/customAttributeDefinitions.test.ts +++ b/tests/wire/orders/customAttributeDefinitions.test.ts @@ -110,6 +110,7 @@ describe("CustomAttributeDefinitions", () => { const response = await client.orders.customAttributeDefinitions.get({ key: "key", + version: 1, }); expect(response).toEqual({ customAttributeDefinition: { diff --git a/tests/wire/orders/customAttributes.test.ts b/tests/wire/orders/customAttributes.test.ts index e7734114b..01c098e70 100644 --- a/tests/wire/orders/customAttributes.test.ts +++ b/tests/wire/orders/customAttributes.test.ts @@ -222,6 +222,8 @@ describe("CustomAttributes", () => { const response = await client.orders.customAttributes.get({ orderId: "order_id", customAttributeKey: "custom_attribute_key", + version: 1, + withDefinition: true, }); expect(response).toEqual({ customAttribute: { diff --git a/tests/wire/subscriptions.test.ts b/tests/wire/subscriptions.test.ts index b326af019..6672eff5d 100644 --- a/tests/wire/subscriptions.test.ts +++ b/tests/wire/subscriptions.test.ts @@ -405,6 +405,7 @@ describe("Subscriptions", () => { const response = await client.subscriptions.get({ subscriptionId: "subscription_id", + include: "include", }); expect(response).toEqual({ errors: [ diff --git a/tests/wire/team.test.ts b/tests/wire/team.test.ts index 6d885317e..284fee613 100644 --- a/tests/wire/team.test.ts +++ b/tests/wire/team.test.ts @@ -40,7 +40,9 @@ describe("Team", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.team.listJobs(); + const response = await client.team.listJobs({ + cursor: "cursor", + }); expect(response).toEqual({ jobs: [ { diff --git a/tests/wire/transferOrders.test.ts b/tests/wire/transferOrders.test.ts new file mode 100644 index 000000000..c0bfc35d0 --- /dev/null +++ b/tests/wire/transferOrders.test.ts @@ -0,0 +1,744 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; + +describe("TransferOrders", () => { + test("create", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + idempotency_key: "65cc0586-3e82-384s-b524-3885cffd52", + transfer_order: { + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + expected_at: "2025-11-09T05:00:00Z", + notes: "Example transfer order for inventory redistribution between locations", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", quantity_ordered: "5" }, + { item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", quantity_ordered: "3" }, + ], + }, + }; + const rawResponseBody = { + transfer_order: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "DRAFT", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T10:30:00Z", + expected_at: "2025-11-09T05:00:00Z", + completed_at: "completed_at", + notes: "Example transfer order for inventory redistribution between locations", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "5", + quantity_pending: "5", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + { + uid: "2", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", + quantity_ordered: "3", + quantity_pending: "3", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + ], + version: BigInt(1753109537351), + }, + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .post("/v2/transfer-orders") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.create({ + idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", + transferOrder: { + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + expectedAt: "2025-11-09T05:00:00Z", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + }, + { + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + }, + ], + }, + }); + expect(response).toEqual({ + transferOrder: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "DRAFT", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T10:30:00Z", + expectedAt: "2025-11-09T05:00:00Z", + completedAt: "completed_at", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + quantityPending: "5", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + { + uid: "2", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + quantityPending: "3", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + ], + version: BigInt("1753109537351"), + }, + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); + + test("get", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + transfer_order: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "STARTED", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T10:35:00Z", + expected_at: "2025-11-09T05:00:00Z", + completed_at: "completed_at", + notes: "Example transfer order for inventory redistribution between locations", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "5", + quantity_pending: "5", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + { + uid: "2", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", + quantity_ordered: "3", + quantity_pending: "3", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + ], + version: BigInt(1753117449752), + }, + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .get("/v2/transfer-orders/transfer_order_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.get({ + transferOrderId: "transfer_order_id", + }); + expect(response).toEqual({ + transferOrder: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "STARTED", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T10:35:00Z", + expectedAt: "2025-11-09T05:00:00Z", + completedAt: "completed_at", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + quantityPending: "5", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + { + uid: "2", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + quantityPending: "3", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + ], + version: BigInt("1753117449752"), + }, + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); + + test("update", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + idempotency_key: "f47ac10b-58cc-4372-a567-0e02b2c3d479", + transfer_order: { + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_789", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_101", + expected_at: "2025-11-10T08:00:00Z", + notes: "Updated: Priority transfer due to low stock at destination", + tracking_number: "TRACK987654321", + line_items: [ + { uid: "1", quantity_ordered: "7" }, + { item_variation_id: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", quantity_ordered: "2" }, + { uid: "2", remove: true }, + ], + }, + version: BigInt(1753109537351), + }; + const rawResponseBody = { + transfer_order: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_789", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_101", + status: "DRAFT", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T11:15:00Z", + expected_at: "2025-11-10T08:00:00Z", + completed_at: "completed_at", + notes: "Updated: Priority transfer due to low stock at destination", + tracking_number: "TRACK987654321", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "7", + quantity_pending: "7", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + { + uid: "3", + item_variation_id: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + quantity_ordered: "2", + quantity_pending: "2", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + ], + version: BigInt(1753122900456), + }, + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .put("/v2/transfer-orders/transfer_order_id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.update({ + transferOrderId: "transfer_order_id", + idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", + transferOrder: { + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", + expectedAt: "2025-11-10T08:00:00Z", + notes: "Updated: Priority transfer due to low stock at destination", + trackingNumber: "TRACK987654321", + lineItems: [ + { + uid: "1", + quantityOrdered: "7", + }, + { + itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + quantityOrdered: "2", + }, + { + uid: "2", + remove: true, + }, + ], + }, + version: BigInt("1753109537351"), + }); + expect(response).toEqual({ + transferOrder: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", + status: "DRAFT", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T11:15:00Z", + expectedAt: "2025-11-10T08:00:00Z", + completedAt: "completed_at", + notes: "Updated: Priority transfer due to low stock at destination", + trackingNumber: "TRACK987654321", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "7", + quantityPending: "7", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + { + uid: "3", + itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", + quantityOrdered: "2", + quantityPending: "2", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + ], + version: BigInt("1753122900456"), + }, + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); + + test("delete", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + + const rawResponseBody = { + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .delete("/v2/transfer-orders/transfer_order_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.delete({ + transferOrderId: "transfer_order_id", + version: BigInt("1000000"), + }); + expect(response).toEqual({ + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); + + test("cancel", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + idempotency_key: "65cc0586-3e82-4d08-b524-3885cffd52", + version: BigInt(1753117449752), + }; + const rawResponseBody = { + transfer_order: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "CANCELED", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T10:45:00Z", + expected_at: "2025-11-09T05:00:00Z", + completed_at: "2025-01-15T10:45:00Z", + notes: "Example transfer order for inventory redistribution between locations", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "5", + quantity_pending: "0", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "5", + }, + { + uid: "2", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", + quantity_ordered: "3", + quantity_pending: "0", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "3", + }, + ], + version: BigInt(1753117461842), + }, + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .post("/v2/transfer-orders/transfer_order_id/cancel") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.cancel({ + transferOrderId: "transfer_order_id", + idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", + version: BigInt("1753117449752"), + }); + expect(response).toEqual({ + transferOrder: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "CANCELED", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T10:45:00Z", + expectedAt: "2025-11-09T05:00:00Z", + completedAt: "2025-01-15T10:45:00Z", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + quantityPending: "0", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "5", + }, + { + uid: "2", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + quantityPending: "0", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "3", + }, + ], + version: BigInt("1753117461842"), + }, + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); + + test("receive", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { + idempotency_key: "EXAMPLE_IDEMPOTENCY_KEY_101", + receipt: { + line_items: [ + { + transfer_order_line_uid: "transfer_order_line_uid", + quantity_received: "3", + quantity_damaged: "1", + quantity_canceled: "1", + }, + { + transfer_order_line_uid: "transfer_order_line_uid", + quantity_received: "2", + quantity_canceled: "1", + }, + ], + }, + version: BigInt(1753118664873), + }; + const rawResponseBody = { + transfer_order: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "COMPLETED", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T10:55:00Z", + expected_at: "2025-11-09T05:00:00Z", + completed_at: "2025-01-15T10:55:00Z", + notes: "Example transfer order for inventory redistribution between locations", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "5", + quantity_pending: "0", + quantity_received: "3", + quantity_damaged: "1", + quantity_canceled: "1", + }, + { + uid: "2", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", + quantity_ordered: "3", + quantity_pending: "0", + quantity_received: "2", + quantity_damaged: "0", + quantity_canceled: "1", + }, + ], + version: BigInt(1753118667248), + }, + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .post("/v2/transfer-orders/transfer_order_id/receive") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.receive({ + transferOrderId: "transfer_order_id", + idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", + receipt: { + lineItems: [ + { + transferOrderLineUid: "transfer_order_line_uid", + quantityReceived: "3", + quantityDamaged: "1", + quantityCanceled: "1", + }, + { + transferOrderLineUid: "transfer_order_line_uid", + quantityReceived: "2", + quantityCanceled: "1", + }, + ], + }, + version: BigInt("1753118664873"), + }); + expect(response).toEqual({ + transferOrder: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "COMPLETED", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T10:55:00Z", + expectedAt: "2025-11-09T05:00:00Z", + completedAt: "2025-01-15T10:55:00Z", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + quantityPending: "0", + quantityReceived: "3", + quantityDamaged: "1", + quantityCanceled: "1", + }, + { + uid: "2", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + quantityPending: "0", + quantityReceived: "2", + quantityDamaged: "0", + quantityCanceled: "1", + }, + ], + version: BigInt("1753118667248"), + }, + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); + + test("start", async () => { + const server = mockServerPool.createServer(); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); + const rawRequestBody = { idempotency_key: "EXAMPLE_IDEMPOTENCY_KEY_789", version: BigInt(1753109537351) }; + const rawResponseBody = { + transfer_order: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", + destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", + status: "STARTED", + created_at: "2025-01-15T10:30:00Z", + updated_at: "2025-01-15T10:32:00Z", + expected_at: "2025-11-09T05:00:00Z", + completed_at: "completed_at", + notes: "Example transfer order for inventory redistribution between locations", + tracking_number: "TRACK123456789", + created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", + line_items: [ + { + uid: "1", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", + quantity_ordered: "5", + quantity_pending: "5", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + { + uid: "2", + item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", + quantity_ordered: "3", + quantity_pending: "3", + quantity_received: "0", + quantity_damaged: "0", + quantity_canceled: "0", + }, + ], + version: BigInt(1753118664873), + }, + errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], + }; + server + .mockEndpoint() + .post("/v2/transfer-orders/transfer_order_id/start") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.transferOrders.start({ + transferOrderId: "transfer_order_id", + idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", + version: BigInt("1753109537351"), + }); + expect(response).toEqual({ + transferOrder: { + id: "EXAMPLE_TRANSFER_ORDER_ID_123", + sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", + destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", + status: "STARTED", + createdAt: "2025-01-15T10:30:00Z", + updatedAt: "2025-01-15T10:32:00Z", + expectedAt: "2025-11-09T05:00:00Z", + completedAt: "completed_at", + notes: "Example transfer order for inventory redistribution between locations", + trackingNumber: "TRACK123456789", + createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", + lineItems: [ + { + uid: "1", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", + quantityOrdered: "5", + quantityPending: "5", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + { + uid: "2", + itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", + quantityOrdered: "3", + quantityPending: "3", + quantityReceived: "0", + quantityDamaged: "0", + quantityCanceled: "0", + }, + ], + version: BigInt("1753118664873"), + }, + errors: [ + { + category: "API_ERROR", + code: "INTERNAL_SERVER_ERROR", + detail: "detail", + field: "field", + }, + ], + }); + }); +}); diff --git a/tests/wire/v1Transactions.test.ts b/tests/wire/v1Transactions.test.ts index 5690f9569..0c9a2b361 100644 --- a/tests/wire/v1Transactions.test.ts +++ b/tests/wire/v1Transactions.test.ts @@ -77,6 +77,9 @@ describe("V1Transactions", () => { const response = await client.v1Transactions.v1ListOrders({ locationId: "location_id", + order: "DESC", + limit: 1, + batchToken: "batch_token", }); expect(response).toEqual([ { diff --git a/tests/wire/webhooks/eventTypes.test.ts b/tests/wire/webhooks/eventTypes.test.ts index 6d2b9b8d9..440ec0805 100644 --- a/tests/wire/webhooks/eventTypes.test.ts +++ b/tests/wire/webhooks/eventTypes.test.ts @@ -29,7 +29,9 @@ describe("EventTypes", () => { .jsonBody(rawResponseBody) .build(); - const response = await client.webhooks.eventTypes.list(); + const response = await client.webhooks.eventTypes.list({ + apiVersion: "api_version", + }); expect(response).toEqual({ errors: [ {