From 62d31e976c8c6c04b9056cf74da729fd2a78ca4f Mon Sep 17 00:00:00 2001
From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com>
Date: Thu, 16 Oct 2025 15:52:03 +0000
Subject: [PATCH] SDK regeneration
---
README.md | 10 +-
build.gradle | 4 +-
reference.md | 1282 ++++++++++++++++-
.../squareup/square/AsyncCatalogClient.java | 14 +-
.../squareup/square/AsyncChannelsClient.java | 63 +
.../squareup/square/AsyncCustomersClient.java | 7 +-
.../squareup/square/AsyncInventoryClient.java | 14 +-
.../squareup/square/AsyncInvoicesClient.java | 5 +-
.../squareup/square/AsyncLoyaltyClient.java | 9 +-
.../squareup/square/AsyncOrdersClient.java | 10 +-
.../square/AsyncRawCatalogClient.java | 56 +-
.../square/AsyncRawChannelsClient.java | 250 ++++
.../square/AsyncRawCustomersClient.java | 28 +-
.../square/AsyncRawInventoryClient.java | 58 +-
.../square/AsyncRawInvoicesClient.java | 26 +-
.../square/AsyncRawLoyaltyClient.java | 34 +-
.../squareup/square/AsyncRawOrdersClient.java | 32 +-
.../square/AsyncRawSubscriptionsClient.java | 30 +-
.../square/AsyncRawTeamMembersClient.java | 34 +-
.../square/AsyncRawTransferOrdersClient.java | 749 ++++++++++
.../square/AsyncRawVendorsClient.java | 33 +-
.../squareup/square/AsyncSquareClient.java | 14 +
.../square/AsyncSquareClientBuilder.java | 2 +-
.../square/AsyncSubscriptionsClient.java | 8 +-
.../square/AsyncTeamMembersClient.java | 9 +-
.../square/AsyncTransferOrdersClient.java | 307 ++++
.../squareup/square/AsyncVendorsClient.java | 9 +-
.../com/squareup/square/CatalogClient.java | 16 +-
.../com/squareup/square/ChannelsClient.java | 61 +
.../com/squareup/square/CustomersClient.java | 7 +-
.../com/squareup/square/InventoryClient.java | 14 +-
.../com/squareup/square/InvoicesClient.java | 5 +-
.../com/squareup/square/LoyaltyClient.java | 10 +-
.../com/squareup/square/OrdersClient.java | 9 +-
.../com/squareup/square/RawCatalogClient.java | 36 +-
.../squareup/square/RawChannelsClient.java | 197 +++
.../squareup/square/RawCustomersClient.java | 18 +-
.../squareup/square/RawInventoryClient.java | 40 +-
.../squareup/square/RawInvoicesClient.java | 16 +-
.../com/squareup/square/RawLoyaltyClient.java | 23 +-
.../com/squareup/square/RawOrdersClient.java | 23 +-
.../square/RawSubscriptionsClient.java | 19 +-
.../squareup/square/RawTeamMembersClient.java | 23 +-
.../square/RawTransferOrdersClient.java | 617 ++++++++
.../com/squareup/square/RawVendorsClient.java | 23 +-
.../com/squareup/square/SquareClient.java | 14 +
.../squareup/square/SquareClientBuilder.java | 2 +-
.../squareup/square/SubscriptionsClient.java | 8 +-
.../squareup/square/TeamMembersClient.java | 9 +-
.../squareup/square/TransferOrdersClient.java | 299 ++++
.../com/squareup/square/VendorsClient.java | 9 +-
.../squareup/square/core/ClientOptions.java | 4 +-
.../square/labor/AsyncRawShiftsClient.java | 32 +-
.../square/labor/AsyncShiftsClient.java | 10 +-
.../square/labor/RawShiftsClient.java | 23 +-
.../squareup/square/labor/ShiftsClient.java | 9 +-
.../square/loyalty/AccountsClient.java | 10 +-
.../square/loyalty/AsyncAccountsClient.java | 9 +-
.../loyalty/AsyncRawAccountsClient.java | 35 +-
.../square/loyalty/AsyncRawRewardsClient.java | 34 +-
.../square/loyalty/AsyncRewardsClient.java | 9 +-
.../square/loyalty/RawAccountsClient.java | 24 +-
.../square/loyalty/RawRewardsClient.java | 23 +-
.../square/loyalty/RewardsClient.java | 10 +-
.../types/CancelPromotionsRequest.java | 78 +-
.../programs/types/GetPromotionsRequest.java | 78 +-
.../square/terminal/ActionsClient.java | 10 +-
.../square/terminal/AsyncActionsClient.java | 9 +-
.../square/terminal/AsyncCheckoutsClient.java | 9 +-
.../terminal/AsyncRawActionsClient.java | 34 +-
.../terminal/AsyncRawCheckoutsClient.java | 35 +-
.../terminal/AsyncRawRefundsClient.java | 35 +-
.../square/terminal/AsyncRefundsClient.java | 9 +-
.../square/terminal/CheckoutsClient.java | 9 +-
.../square/terminal/RawActionsClient.java | 23 +-
.../square/terminal/RawCheckoutsClient.java | 25 +-
.../square/terminal/RawRefundsClient.java | 23 +-
.../square/terminal/RefundsClient.java | 10 +-
.../types/BulkRetrieveChannelsRequest.java | 104 ++
.../types/BulkRetrieveChannelsResponse.java | 139 ++
.../types/CancelTransferOrderRequest.java | 199 +++
.../types/CancelTransferOrderResponse.java | 133 ++
.../com/squareup/square/types/Channel.java | 351 +++++
.../squareup/square/types/ChannelStatus.java | 83 ++
.../square/types/CreateTransferOrderData.java | 535 +++++++
.../types/CreateTransferOrderLineData.java | 171 +++
.../types/CreateTransferOrderRequest.java | 151 ++
.../types/CreateTransferOrderResponse.java | 133 ++
.../square/types/CustomAttribute.java | 34 +-
.../types/DeleteTransferOrderResponse.java | 102 ++
.../types/DeleteTransferOrdersRequest.java | 187 +++
.../square/types/GetChannelsRequest.java | 113 ++
.../types/GetTransferOrdersRequest.java | 113 ++
.../square/types/ListChannelsRequest.java | 328 +++++
.../square/types/ListChannelsResponse.java | 162 +++
.../types/ReceiveTransferOrderRequest.java | 231 +++
.../types/ReceiveTransferOrderResponse.java | 133 ++
.../com/squareup/square/types/Reference.java | 131 ++
.../squareup/square/types/ReferenceType.java | 218 +++
.../square/types/RetrieveChannelResponse.java | 131 ++
.../types/RetrieveTransferOrderResponse.java | 133 ++
.../types/SearchTransferOrdersRequest.java | 161 +++
.../types/SearchTransferOrdersResponse.java | 164 +++
.../types/StartTransferOrderRequest.java | 199 +++
.../types/StartTransferOrderResponse.java | 133 ++
.../squareup/square/types/TransferOrder.java | 714 +++++++++
.../types/TransferOrderCreatedEvent.java | 286 ++++
.../types/TransferOrderCreatedEventData.java | 184 +++
.../TransferOrderCreatedEventObject.java | 102 ++
.../types/TransferOrderDeletedEvent.java | 286 ++++
.../types/TransferOrderDeletedEventData.java | 204 +++
.../square/types/TransferOrderFilter.java | 229 +++
.../types/TransferOrderGoodsReceipt.java | 152 ++
.../TransferOrderGoodsReceiptLineItem.java | 343 +++++
.../square/types/TransferOrderLine.java | 410 ++++++
.../square/types/TransferOrderQuery.java | 132 ++
.../square/types/TransferOrderSort.java | 136 ++
.../square/types/TransferOrderSortField.java | 84 ++
.../square/types/TransferOrderStatus.java | 114 ++
.../types/TransferOrderUpdatedEvent.java | 286 ++++
.../types/TransferOrderUpdatedEventData.java | 184 +++
.../TransferOrderUpdatedEventObject.java | 102 ++
.../square/types/UpdateTransferOrderData.java | 394 +++++
.../types/UpdateTransferOrderLineData.java | 278 ++++
.../types/UpdateTransferOrderRequest.java | 232 +++
.../types/UpdateTransferOrderResponse.java | 133 ++
126 files changed, 14439 insertions(+), 432 deletions(-)
create mode 100644 src/main/java/com/squareup/square/AsyncChannelsClient.java
create mode 100644 src/main/java/com/squareup/square/AsyncRawChannelsClient.java
create mode 100644 src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java
create mode 100644 src/main/java/com/squareup/square/AsyncTransferOrdersClient.java
create mode 100644 src/main/java/com/squareup/square/ChannelsClient.java
create mode 100644 src/main/java/com/squareup/square/RawChannelsClient.java
create mode 100644 src/main/java/com/squareup/square/RawTransferOrdersClient.java
create mode 100644 src/main/java/com/squareup/square/TransferOrdersClient.java
create mode 100644 src/main/java/com/squareup/square/types/BulkRetrieveChannelsRequest.java
create mode 100644 src/main/java/com/squareup/square/types/BulkRetrieveChannelsResponse.java
create mode 100644 src/main/java/com/squareup/square/types/CancelTransferOrderRequest.java
create mode 100644 src/main/java/com/squareup/square/types/CancelTransferOrderResponse.java
create mode 100644 src/main/java/com/squareup/square/types/Channel.java
create mode 100644 src/main/java/com/squareup/square/types/ChannelStatus.java
create mode 100644 src/main/java/com/squareup/square/types/CreateTransferOrderData.java
create mode 100644 src/main/java/com/squareup/square/types/CreateTransferOrderLineData.java
create mode 100644 src/main/java/com/squareup/square/types/CreateTransferOrderRequest.java
create mode 100644 src/main/java/com/squareup/square/types/CreateTransferOrderResponse.java
create mode 100644 src/main/java/com/squareup/square/types/DeleteTransferOrderResponse.java
create mode 100644 src/main/java/com/squareup/square/types/DeleteTransferOrdersRequest.java
create mode 100644 src/main/java/com/squareup/square/types/GetChannelsRequest.java
create mode 100644 src/main/java/com/squareup/square/types/GetTransferOrdersRequest.java
create mode 100644 src/main/java/com/squareup/square/types/ListChannelsRequest.java
create mode 100644 src/main/java/com/squareup/square/types/ListChannelsResponse.java
create mode 100644 src/main/java/com/squareup/square/types/ReceiveTransferOrderRequest.java
create mode 100644 src/main/java/com/squareup/square/types/ReceiveTransferOrderResponse.java
create mode 100644 src/main/java/com/squareup/square/types/Reference.java
create mode 100644 src/main/java/com/squareup/square/types/ReferenceType.java
create mode 100644 src/main/java/com/squareup/square/types/RetrieveChannelResponse.java
create mode 100644 src/main/java/com/squareup/square/types/RetrieveTransferOrderResponse.java
create mode 100644 src/main/java/com/squareup/square/types/SearchTransferOrdersRequest.java
create mode 100644 src/main/java/com/squareup/square/types/SearchTransferOrdersResponse.java
create mode 100644 src/main/java/com/squareup/square/types/StartTransferOrderRequest.java
create mode 100644 src/main/java/com/squareup/square/types/StartTransferOrderResponse.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrder.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderCreatedEvent.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderCreatedEventData.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderCreatedEventObject.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderDeletedEvent.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderDeletedEventData.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderFilter.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderGoodsReceipt.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderGoodsReceiptLineItem.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderLine.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderQuery.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderSort.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderSortField.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderStatus.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderUpdatedEvent.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderUpdatedEventData.java
create mode 100644 src/main/java/com/squareup/square/types/TransferOrderUpdatedEventObject.java
create mode 100644 src/main/java/com/squareup/square/types/UpdateTransferOrderData.java
create mode 100644 src/main/java/com/squareup/square/types/UpdateTransferOrderLineData.java
create mode 100644 src/main/java/com/squareup/square/types/UpdateTransferOrderRequest.java
create mode 100644 src/main/java/com/squareup/square/types/UpdateTransferOrderResponse.java
diff --git a/README.md b/README.md
index 9ff27443..da5c11ec 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Add the dependency in your `pom.xml` file:
com.squareup
square
- 45.0.0.20250924
+ 45.1.0.20251016
```
@@ -336,8 +336,8 @@ Gradle:
```groovy
dependencies {
- implementation 'com.squareup:square:45.0.0.20250924'
- implementation 'com.squareup:square-legacy:45.0.0.20250924'
+ implementation 'com.squareup:square:45.1.0.20251016'
+ implementation 'com.squareup:square-legacy:45.1.0.20251016'
}
```
@@ -347,12 +347,12 @@ Maven:
com.squareup
square
- 45.0.0.20250924
+ 45.1.0.20251016
com.squareup
square-legacy
- 45.0.0.20250924
+ 45.1.0.20251016
```
diff --git a/build.gradle b/build.gradle
index b5f723c1..ed6b345e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -47,7 +47,7 @@ java {
group = 'com.squareup'
-version = '45.0.0.20250924'
+version = '45.1.0.20251016'
jar {
dependsOn(":generatePomFileForMavenPublication")
@@ -78,7 +78,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.squareup'
artifactId = 'square'
- version = '45.0.0.20250924'
+ version = '45.1.0.20251016'
from components.java
pom {
name = 'square'
diff --git a/reference.md b/reference.md
index 4d998d2e..b341cd67 100644
--- a/reference.md
+++ b/reference.md
@@ -505,6 +505,9 @@ client.v1Transactions().v1ListOrders(
V1ListOrdersRequest
.builder()
.locationId("location_id")
+ .order(SortOrder.DESC)
+ .limit(1)
+ .batchToken("batch_token")
.build()
);
```
@@ -844,6 +847,9 @@ Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square a
client.bankAccounts().list(
ListBankAccountsRequest
.builder()
+ .cursor("cursor")
+ .limit(1)
+ .locationId("location_id")
.build()
);
```
@@ -1057,6 +1063,13 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
client.bookings().list(
ListBookingsRequest
.builder()
+ .limit(1)
+ .cursor("cursor")
+ .customerId("customer_id")
+ .teamMemberId("team_member_id")
+ .locationId("location_id")
+ .startAtMin("start_at_min")
+ .startAtMax("start_at_max")
.build()
);
```
@@ -1777,6 +1790,11 @@ A max of 25 cards will be returned.
client.cards().list(
ListCardsRequest
.builder()
+ .cursor("cursor")
+ .customerId("customer_id")
+ .includeDisabled(true)
+ .referenceId("reference_id")
+ .sortOrder(SortOrder.DESC)
.build()
);
```
@@ -2512,6 +2530,9 @@ and set the `include_deleted_objects` attribute value to `true`.
client.catalog().list(
ListCatalogRequest
.builder()
+ .cursor("cursor")
+ .types("types")
+ .catalogVersion(1000000L)
.build()
);
```
@@ -3158,6 +3179,225 @@ At least one of `taxes_to_enable` or `taxes_to_disable` must be specified.
+
+
+
+
+## Channels
+client.channels.list() -> ListChannelsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.channels().list(
+ ListChannelsRequest
+ .builder()
+ .referenceType(ReferenceType.UNKNOWN_TYPE)
+ .referenceId("reference_id")
+ .status(ChannelStatus.ACTIVE)
+ .cursor("cursor")
+ .limit(1)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**referenceType:** `Optional` — Type of reference associated to channel
+
+
+
+
+
+-
+
+**referenceId:** `Optional` — id of reference associated to channel
+
+
+
+
+
+-
+
+**status:** `Optional` — Status of channel
+
+
+
+
+
+-
+
+**cursor:** `Optional` — Cursor to fetch the next result
+
+
+
+
+
+-
+
+**limit:** `Optional`
+
+Maximum number of results to return.
+When not provided the returned results will be cap at 100 channels.
+
+
+
+
+
+
+
+
+
+
+
+client.channels.bulkRetrieve(request) -> BulkRetrieveChannelsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.channels().bulkRetrieve(
+ BulkRetrieveChannelsRequest
+ .builder()
+ .channelIds(
+ Arrays.asList("CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING")
+ )
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**channelIds:** `List`
+
+
+
+
+
+
+
+
+
+
+
+client.channels.get(channelId) -> RetrieveChannelResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.channels().get(
+ GetChannelsRequest
+ .builder()
+ .channelId("channel_id")
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**channelId:** `String` — A channel id
+
+
+
+
+
+
+
@@ -3197,6 +3437,11 @@ profiles can take closer to one minute or longer, especially during network inci
client.customers().list(
ListCustomersRequest
.builder()
+ .cursor("cursor")
+ .limit(1)
+ .sortField(CustomerSortField.DEFAULT)
+ .sortOrder(SortOrder.DESC)
+ .count(true)
.build()
);
```
@@ -4288,6 +4533,7 @@ client.customers().delete(
DeleteCustomersRequest
.builder()
.customerId("customer_id")
+ .version(1000000L)
.build()
);
```
@@ -4360,6 +4606,10 @@ devices are supported.
client.devices().list(
ListDevicesRequest
.builder()
+ .cursor("cursor")
+ .sortOrder(SortOrder.DESC)
+ .limit(1)
+ .locationId("location_id")
.build()
);
```
@@ -4510,6 +4760,9 @@ Returns a list of disputes associated with a particular account.
client.disputes().list(
ListDisputesRequest
.builder()
+ .cursor("cursor")
+ .states(DisputeState.INQUIRY_EVIDENCE_REQUIRED)
+ .locationId("location_id")
.build()
);
```
@@ -4928,6 +5181,10 @@ client.disputes().submitEvidence(
client.employees().list(
ListEmployeesRequest
.builder()
+ .locationId("location_id")
+ .status(EmployeeStatus.ACTIVE)
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -5234,6 +5491,7 @@ Lists all event types that you can subscribe to as webhooks or query using the E
client.events().listEventTypes(
ListEventTypesRequest
.builder()
+ .apiVersion("api_version")
.build()
);
```
@@ -5294,6 +5552,11 @@ a subset of the gift cards. Results are sorted by `created_at` in ascending orde
client.giftCards().list(
ListGiftCardsRequest
.builder()
+ .type("type")
+ .state("state")
+ .limit(1)
+ .cursor("cursor")
+ .customerId("customer_id")
.build()
);
```
@@ -6625,6 +6888,8 @@ client.inventory().get(
GetInventoryRequest
.builder()
.catalogObjectId("catalog_object_id")
+ .locationIds("location_ids")
+ .cursor("cursor")
.build()
);
```
@@ -6720,6 +6985,8 @@ client.inventory().changes(
ChangesInventoryRequest
.builder()
.catalogObjectId("catalog_object_id")
+ .locationIds("location_ids")
+ .cursor("cursor")
.build()
);
```
@@ -6806,6 +7073,8 @@ client.invoices().list(
ListInvoicesRequest
.builder()
.locationId("location_id")
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -7332,6 +7601,7 @@ client.invoices().delete(
DeleteInvoicesRequest
.builder()
.invoiceId("invoice_id")
+ .version(1)
.build()
);
```
@@ -9507,6 +9777,7 @@ endpoint to retrieve the merchant information.
client.merchants().list(
ListMerchantsRequest
.builder()
+ .cursor(1)
.build()
);
```
@@ -10804,6 +11075,21 @@ The maximum results per page is 100.
client.payments().list(
ListPaymentsRequest
.builder()
+ .beginTime("begin_time")
+ .endTime("end_time")
+ .sortOrder("sort_order")
+ .cursor("cursor")
+ .locationId("location_id")
+ .total(1000000L)
+ .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(ListPaymentsRequestSortField.CREATED_AT)
.build()
);
```
@@ -11799,6 +12085,13 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
client.payouts().list(
ListPayoutsRequest
.builder()
+ .locationId("location_id")
+ .status(PayoutStatus.SENT)
+ .beginTime("begin_time")
+ .endTime("end_time")
+ .sortOrder(SortOrder.DESC)
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -11987,6 +12280,9 @@ client.payouts().listEntries(
ListEntriesPayoutsRequest
.builder()
.payoutId("payout_id")
+ .sortOrder(SortOrder.DESC)
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -12086,6 +12382,17 @@ The maximum results per page is 100.
client.refunds().list(
ListRefundsRequest
.builder()
+ .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(ListPaymentRefundsRequestSortField.CREATED_AT)
.build()
);
```
@@ -13272,6 +13579,7 @@ client.subscriptions().get(
GetSubscriptionsRequest
.builder()
.subscriptionId("subscription_id")
+ .include("include")
.build()
);
```
@@ -13635,6 +13943,8 @@ client.subscriptions().listEvents(
ListEventsSubscriptionsRequest
.builder()
.subscriptionId("subscription_id")
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -14671,6 +14981,7 @@ Lists jobs in a seller account. Results are sorted by title in ascending order.
client.team().listJobs(
ListJobsRequest
.builder()
+ .cursor("cursor")
.build()
);
```
@@ -15100,8 +15411,8 @@ client.terminal().dismissTerminalRefund(
-## Vendors
-client.vendors.batchCreate(request) -> BatchCreateVendorsResponse
+## TransferOrders
+client.transferOrders.create(request) -> CreateTransferOrderResponse
-
@@ -15113,7 +15424,26 @@ client.terminal().dismissTerminalRefund(
-
-Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller.
+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.
@@ -15128,34 +15458,802 @@ Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a
-
```java
-client.vendors().batchCreate(
- BatchCreateVendorsRequest
+client.transferOrders().create(
+ CreateTransferOrderRequest
.builder()
- .vendors(
- new HashMap() {{
- put("8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", Vendor
- .builder()
- .name(Optional.of("Joe's Fresh Seafood"))
- .address(
- Optional.of(
- Address
+ .idempotencyKey("65cc0586-3e82-384s-b524-3885cffd52")
+ .transferOrder(
+ CreateTransferOrderData
+ .builder()
+ .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(
+ Optional.of(
+ Arrays.asList(
+ CreateTransferOrderLineData
.builder()
- .addressLine1(Optional.of("505 Electric Ave"))
- .addressLine2(Optional.of("Suite 600"))
- .locality(Optional.of("New York"))
- .administrativeDistrictLevel1(Optional.of("NY"))
- .postalCode(Optional.of("10003"))
- .country(Optional.of(Country.US))
+ .itemVariationId("EXAMPLE_ITEM_VARIATION_ID_001")
+ .quantityOrdered("5")
+ .build(),
+ CreateTransferOrderLineData
+ .builder()
+ .itemVariationId("EXAMPLE_ITEM_VARIATION_ID_002")
+ .quantityOrdered("3")
.build()
)
)
- .contacts(
- Optional.of(
- Arrays.asList(
- VendorContact
- .builder()
- .ordinal(1)
- .name("Joe Burrow")
+ )
+ .build()
+ )
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**idempotencyKey:** `String`
+
+A unique string that identifies this CreateTransferOrder request. Keys can be
+any valid string but must be unique for every CreateTransferOrder request.
+
+
+
+
+
+-
+
+**transferOrder:** `CreateTransferOrderData` — The transfer order to create
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.search(request) -> SearchTransferOrdersResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().search(
+ SearchTransferOrdersRequest
+ .builder()
+ .query(
+ TransferOrderQuery
+ .builder()
+ .filter(
+ TransferOrderFilter
+ .builder()
+ .sourceLocationIds(
+ Optional.of(
+ Arrays.asList("EXAMPLE_SOURCE_LOCATION_ID_123")
+ )
+ )
+ .destinationLocationIds(
+ Optional.of(
+ Arrays.asList("EXAMPLE_DEST_LOCATION_ID_456")
+ )
+ )
+ .statuses(
+ Optional.of(
+ Arrays.asList(TransferOrderStatus.STARTED, TransferOrderStatus.PARTIALLY_RECEIVED)
+ )
+ )
+ .build()
+ )
+ .sort(
+ TransferOrderSort
+ .builder()
+ .field(TransferOrderSortField.UPDATED_AT)
+ .order(SortOrder.DESC)
+ .build()
+ )
+ .build()
+ )
+ .cursor("eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9")
+ .limit(10)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**query:** `Optional` — The search query
+
+
+
+
+
+-
+
+**cursor:** `Optional` — Pagination cursor from a previous search response
+
+
+
+
+
+-
+
+**limit:** `Optional` — Maximum number of results to return (1-100)
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.get(transferOrderId) -> RetrieveTransferOrderResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().get(
+ GetTransferOrdersRequest
+ .builder()
+ .transferOrderId("transfer_order_id")
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**transferOrderId:** `String` — The ID of the transfer order to retrieve
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.update(transferOrderId, request) -> UpdateTransferOrderResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().update(
+ UpdateTransferOrderRequest
+ .builder()
+ .transferOrderId("transfer_order_id")
+ .idempotencyKey("f47ac10b-58cc-4372-a567-0e02b2c3d479")
+ .transferOrder(
+ UpdateTransferOrderData
+ .builder()
+ .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(
+ Optional.of(
+ Arrays.asList(
+ UpdateTransferOrderLineData
+ .builder()
+ .uid("1")
+ .quantityOrdered("7")
+ .build(),
+ UpdateTransferOrderLineData
+ .builder()
+ .itemVariationId("EXAMPLE_NEW_ITEM_VARIATION_ID_003")
+ .quantityOrdered("2")
+ .build(),
+ UpdateTransferOrderLineData
+ .builder()
+ .uid("2")
+ .remove(true)
+ .build()
+ )
+ )
+ )
+ .build()
+ )
+ .version(1753109537351L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**transferOrderId:** `String` — The ID of the transfer order to update
+
+
+
+
+
+-
+
+**idempotencyKey:** `String` — A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores
+
+
+
+
+
+-
+
+**transferOrder:** `UpdateTransferOrderData` — The transfer order updates to apply
+
+
+
+
+
+-
+
+**version:** `Optional` — Version for optimistic concurrency
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.delete(transferOrderId) -> DeleteTransferOrderResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().delete(
+ DeleteTransferOrdersRequest
+ .builder()
+ .transferOrderId("transfer_order_id")
+ .version(1000000L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**transferOrderId:** `String` — The ID of the transfer order to delete
+
+
+
+
+
+-
+
+**version:** `Optional` — Version for optimistic concurrency
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.cancel(transferOrderId, request) -> CancelTransferOrderResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().cancel(
+ CancelTransferOrderRequest
+ .builder()
+ .transferOrderId("transfer_order_id")
+ .idempotencyKey("65cc0586-3e82-4d08-b524-3885cffd52")
+ .version(1753117449752L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**transferOrderId:** `String` — The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status.
+
+
+
+
+
+-
+
+**idempotencyKey:** `String`
+
+A unique string that identifies this UpdateTransferOrder request. Keys can be
+any valid string but must be unique for every UpdateTransferOrder request.
+
+
+
+
+
+-
+
+**version:** `Optional` — Version for optimistic concurrency
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.receive(transferOrderId, request) -> ReceiveTransferOrderResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().receive(
+ ReceiveTransferOrderRequest
+ .builder()
+ .transferOrderId("transfer_order_id")
+ .idempotencyKey("EXAMPLE_IDEMPOTENCY_KEY_101")
+ .receipt(
+ TransferOrderGoodsReceipt
+ .builder()
+ .lineItems(
+ Optional.of(
+ Arrays.asList(
+ TransferOrderGoodsReceiptLineItem
+ .builder()
+ .transferOrderLineUid("transfer_order_line_uid")
+ .quantityReceived("3")
+ .quantityDamaged("1")
+ .quantityCanceled("1")
+ .build(),
+ TransferOrderGoodsReceiptLineItem
+ .builder()
+ .transferOrderLineUid("transfer_order_line_uid")
+ .quantityReceived("2")
+ .quantityCanceled("1")
+ .build()
+ )
+ )
+ )
+ .build()
+ )
+ .version(1753118664873L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**transferOrderId:** `String` — The ID of the transfer order to receive items for
+
+
+
+
+
+-
+
+**idempotencyKey:** `String` — A unique key to make this request idempotent
+
+
+
+
+
+-
+
+**receipt:** `TransferOrderGoodsReceipt` — The receipt details
+
+
+
+
+
+-
+
+**version:** `Optional` — Version for optimistic concurrency
+
+
+
+
+
+
+
+
+
+
+
+client.transferOrders.start(transferOrderId, request) -> StartTransferOrderResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+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.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.transferOrders().start(
+ StartTransferOrderRequest
+ .builder()
+ .transferOrderId("transfer_order_id")
+ .idempotencyKey("EXAMPLE_IDEMPOTENCY_KEY_789")
+ .version(1753109537351L)
+ .build()
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**transferOrderId:** `String` — The ID of the transfer order to start. Must be in DRAFT status.
+
+
+
+
+
+-
+
+**idempotencyKey:** `String`
+
+A unique string that identifies this UpdateTransferOrder request. Keys can be
+any valid string but must be unique for every UpdateTransferOrder request.
+
+
+
+
+
+-
+
+**version:** `Optional` — Version for optimistic concurrency
+
+
+
+
+
+
+
+
+
+
+
+## Vendors
+client.vendors.batchCreate(request) -> BatchCreateVendorsResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```java
+client.vendors().batchCreate(
+ BatchCreateVendorsRequest
+ .builder()
+ .vendors(
+ new HashMap() {{
+ put("8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", Vendor
+ .builder()
+ .name(Optional.of("Joe's Fresh Seafood"))
+ .address(
+ Optional.of(
+ Address
+ .builder()
+ .addressLine1(Optional.of("505 Electric Ave"))
+ .addressLine2(Optional.of("Suite 600"))
+ .locality(Optional.of("New York"))
+ .administrativeDistrictLevel1(Optional.of("NY"))
+ .postalCode(Optional.of("10003"))
+ .country(Optional.of(Country.US))
+ .build()
+ )
+ )
+ .contacts(
+ Optional.of(
+ Arrays.asList(
+ VendorContact
+ .builder()
+ .ordinal(1)
+ .name("Joe Burrow")
.emailAddress("joe@joesfreshseafood.com")
.phoneNumber("1-212-555-4250")
.build()
@@ -15698,6 +16796,8 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
client.bookings().customAttributeDefinitions().list(
ListCustomAttributeDefinitionsRequest
.builder()
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -15872,6 +16972,7 @@ client.bookings().customAttributeDefinitions().get(
GetCustomAttributeDefinitionsRequest
.builder()
.key("key")
+ .version(1)
.build()
);
```
@@ -16276,6 +17377,9 @@ client.bookings().customAttributes().list(
ListCustomAttributesRequest
.builder()
.bookingId("booking_id")
+ .limit(1)
+ .cursor("cursor")
+ .withDefinitions(true)
.build()
);
```
@@ -16375,6 +17479,8 @@ client.bookings().customAttributes().get(
.builder()
.bookingId("booking_id")
.key("key")
+ .withDefinition(true)
+ .version(1)
.build()
);
```
@@ -16660,6 +17766,8 @@ Lists location booking profiles of a seller.
client.bookings().locationProfiles().list(
ListLocationProfilesRequest
.builder()
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -16727,6 +17835,10 @@ Lists booking profiles for team members.
client.bookings().teamMemberProfiles().list(
ListTeamMemberProfilesRequest
.builder()
+ .bookableOnly(true)
+ .limit(1)
+ .cursor("cursor")
+ .locationId("location_id")
.build()
);
```
@@ -16871,6 +17983,11 @@ client.cashDrawers().shifts().list(
ListShiftsRequest
.builder()
.locationId("location_id")
+ .sortOrder(SortOrder.DESC)
+ .beginTime("begin_time")
+ .endTime("end_time")
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -17046,6 +18163,8 @@ client.cashDrawers().shifts().listEvents(
.builder()
.shiftId("shift_id")
.locationId("location_id")
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -17345,6 +18464,9 @@ client.catalog().object().get(
GetObjectRequest
.builder()
.objectId("object_id")
+ .includeRelatedObjects(true)
+ .catalogVersion(1000000L)
+ .includeCategoryPathToRoot(true)
.build()
);
```
@@ -17525,6 +18647,8 @@ Lists all payment links.
client.checkout().paymentLinks().list(
ListPaymentLinksRequest
.builder()
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -17955,6 +19079,8 @@ seller-defined custom attributes (also known as custom fields) are always set to
client.customers().customAttributeDefinitions().list(
ListCustomAttributeDefinitionsRequest
.builder()
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -18134,6 +19260,7 @@ client.customers().customAttributeDefinitions().get(
GetCustomAttributeDefinitionsRequest
.builder()
.key("key")
+ .version(1)
.build()
);
```
@@ -18514,6 +19641,8 @@ Retrieves the list of customer groups of a business.
client.customers().groups().list(
ListGroupsRequest
.builder()
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -18998,6 +20127,8 @@ Retrieves the list of customer segments of a business.
client.customers().segments().list(
ListSegmentsRequest
.builder()
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -19338,6 +20469,9 @@ client.customers().customAttributes().list(
ListCustomAttributesRequest
.builder()
.customerId("customer_id")
+ .limit(1)
+ .cursor("cursor")
+ .withDefinitions(true)
.build()
);
```
@@ -19441,6 +20575,8 @@ client.customers().customAttributes().get(
.builder()
.customerId("customer_id")
.key("key")
+ .withDefinition(true)
+ .version(1)
.build()
);
```
@@ -19727,6 +20863,10 @@ Lists all DeviceCodes associated with the merchant.
client.devices().codes().list(
ListCodesRequest
.builder()
+ .cursor("cursor")
+ .locationId("location_id")
+ .productType("TERMINAL_API")
+ .status(DeviceCodeStatus.UNKNOWN)
.build()
);
```
@@ -19965,6 +21105,7 @@ client.disputes().evidence().list(
ListEvidenceRequest
.builder()
.disputeId("dispute_id")
+ .cursor("cursor")
.build()
);
```
@@ -20178,6 +21319,14 @@ for all gift cards in a specific region, or for activities within a time window.
client.giftCards().activities().list(
ListActivitiesRequest
.builder()
+ .giftCardId("gift_card_id")
+ .type("type")
+ .locationId("location_id")
+ .beginTime("begin_time")
+ .endTime("end_time")
+ .limit(1)
+ .cursor("cursor")
+ .sortOrder("sort_order")
.build()
);
```
@@ -20408,6 +21557,9 @@ Returns a paginated list of `BreakType` instances for a business.
client.labor().breakTypes().list(
ListBreakTypesRequest
.builder()
+ .locationId("location_id")
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -20775,6 +21927,9 @@ Returns a paginated list of `EmployeeWage` instances for a business.
client.labor().employeeWages().list(
ListEmployeeWagesRequest
.builder()
+ .employeeId("employee_id")
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -21392,6 +22547,9 @@ Returns a paginated list of `TeamMemberWage` instances for a business.
client.labor().teamMemberWages().list(
ListTeamMemberWagesRequest
.builder()
+ .teamMemberId("team_member_id")
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -21532,6 +22690,8 @@ Returns a list of `WorkweekConfig` instances for a business.
client.labor().workweekConfigs().list(
ListWorkweekConfigsRequest
.builder()
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -21677,6 +22837,9 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`
client.locations().customAttributeDefinitions().list(
ListCustomAttributeDefinitionsRequest
.builder()
+ .visibilityFilter(VisibilityFilter.ALL)
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -21857,6 +23020,7 @@ client.locations().customAttributeDefinitions().get(
GetCustomAttributeDefinitionsRequest
.builder()
.key("key")
+ .version(1)
.build()
);
```
@@ -22290,6 +23454,10 @@ client.locations().customAttributes().list(
ListCustomAttributesRequest
.builder()
.locationId("location_id")
+ .visibilityFilter(VisibilityFilter.ALL)
+ .limit(1)
+ .cursor("cursor")
+ .withDefinitions(true)
.build()
);
```
@@ -22398,6 +23566,8 @@ client.locations().customAttributes().get(
.builder()
.locationId("location_id")
.key("key")
+ .withDefinition(true)
+ .version(1)
.build()
);
```
@@ -22683,6 +23853,10 @@ client.locations().transactions().list(
ListTransactionsRequest
.builder()
.locationId("location_id")
+ .beginTime("begin_time")
+ .endTime("end_time")
+ .sortOrder(SortOrder.DESC)
+ .cursor("cursor")
.build()
);
```
@@ -24090,6 +25264,9 @@ client.loyalty().programs().promotions().list(
ListPromotionsRequest
.builder()
.programId("program_id")
+ .status(LoyaltyPromotionStatus.ACTIVE)
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -24290,7 +25467,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-client.loyalty.programs.promotions.get(promotionId, programId) -> GetLoyaltyPromotionResponse
+client.loyalty.programs.promotions.get(programId, promotionId) -> GetLoyaltyPromotionResponse
-
@@ -24320,8 +25497,8 @@ Retrieves a loyalty promotion.
client.loyalty().programs().promotions().get(
GetPromotionsRequest
.builder()
- .promotionId("promotion_id")
.programId("program_id")
+ .promotionId("promotion_id")
.build()
);
```
@@ -24338,7 +25515,10 @@ client.loyalty().programs().promotions().get(
-
-**promotionId:** `String` — The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve.
+**programId:** `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.
@@ -24346,10 +25526,7 @@ client.loyalty().programs().promotions().get(
-
-**programId:** `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.
+**promotionId:** `String` — The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve.
@@ -24361,7 +25538,7 @@ call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using
-client.loyalty.programs.promotions.cancel(promotionId, programId) -> CancelLoyaltyPromotionResponse
+client.loyalty.programs.promotions.cancel(programId, promotionId) -> CancelLoyaltyPromotionResponse
-
@@ -24396,8 +25573,8 @@ This endpoint sets the loyalty promotion to the `CANCELED` state
client.loyalty().programs().promotions().cancel(
CancelPromotionsRequest
.builder()
- .promotionId("promotion_id")
.programId("program_id")
+ .promotionId("promotion_id")
.build()
);
```
@@ -24414,10 +25591,7 @@ client.loyalty().programs().promotions().cancel(
-
-**promotionId:** `String`
-
-The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a
-promotion that has an `ACTIVE` or `SCHEDULED` status.
+**programId:** `String` — The ID of the base [loyalty program](entity:LoyaltyProgram).
@@ -24425,7 +25599,10 @@ promotion that has an `ACTIVE` or `SCHEDULED` status.
-
-**programId:** `String` — The ID of the base [loyalty program](entity:LoyaltyProgram).
+**promotionId:** `String`
+
+The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a
+promotion that has an `ACTIVE` or `SCHEDULED` status.
@@ -24471,6 +25648,9 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`
client.merchants().customAttributeDefinitions().list(
ListCustomAttributeDefinitionsRequest
.builder()
+ .visibilityFilter(VisibilityFilter.ALL)
+ .limit(1)
+ .cursor("cursor")
.build()
);
```
@@ -24651,6 +25831,7 @@ client.merchants().customAttributeDefinitions().get(
GetCustomAttributeDefinitionsRequest
.builder()
.key("key")
+ .version(1)
.build()
);
```
@@ -25068,6 +26249,10 @@ client.merchants().customAttributes().list(
ListCustomAttributesRequest
.builder()
.merchantId("merchant_id")
+ .visibilityFilter(VisibilityFilter.ALL)
+ .limit(1)
+ .cursor("cursor")
+ .withDefinitions(true)
.build()
);
```
@@ -25176,6 +26361,8 @@ client.merchants().customAttributes().get(
.builder()
.merchantId("merchant_id")
.key("key")
+ .withDefinition(true)
+ .version(1)
.build()
);
```
@@ -25460,6 +26647,9 @@ seller-defined custom attributes (also known as custom fields) are always set to
client.orders().customAttributeDefinitions().list(
ListCustomAttributeDefinitionsRequest
.builder()
+ .visibilityFilter(VisibilityFilter.ALL)
+ .cursor("cursor")
+ .limit(1)
.build()
);
```
@@ -25643,6 +26833,7 @@ client.orders().customAttributeDefinitions().get(
GetCustomAttributeDefinitionsRequest
.builder()
.key("key")
+ .version(1)
.build()
);
```
@@ -26061,6 +27252,10 @@ client.orders().customAttributes().list(
ListCustomAttributesRequest
.builder()
.orderId("order_id")
+ .visibilityFilter(VisibilityFilter.ALL)
+ .cursor("cursor")
+ .limit(1)
+ .withDefinitions(true)
.build()
);
```
@@ -26173,6 +27368,8 @@ client.orders().customAttributes().get(
.builder()
.orderId("order_id")
.customAttributeKey("custom_attribute_key")
+ .version(1)
+ .withDefinition(true)
.build()
);
```
@@ -27553,6 +28750,7 @@ Lists all webhook event types that can be subscribed to.
client.webhooks().eventTypes().list(
ListEventTypesRequest
.builder()
+ .apiVersion("api_version")
.build()
);
```
@@ -27612,6 +28810,10 @@ Lists all webhook subscriptions owned by your application.
client.webhooks().subscriptions().list(
ListSubscriptionsRequest
.builder()
+ .cursor("cursor")
+ .includeDisabled(true)
+ .sortOrder(SortOrder.DESC)
+ .limit(1)
.build()
);
```
diff --git a/src/main/java/com/squareup/square/AsyncCatalogClient.java b/src/main/java/com/squareup/square/AsyncCatalogClient.java
index 5e174f3b..f5001c87 100644
--- a/src/main/java/com/squareup/square/AsyncCatalogClient.java
+++ b/src/main/java/com/squareup/square/AsyncCatalogClient.java
@@ -19,9 +19,7 @@
import com.squareup.square.types.CatalogObject;
import com.squareup.square.types.ListCatalogRequest;
import com.squareup.square.types.SearchCatalogItemsRequest;
-import com.squareup.square.types.SearchCatalogItemsResponse;
import com.squareup.square.types.SearchCatalogObjectsRequest;
-import com.squareup.square.types.SearchCatalogObjectsResponse;
import com.squareup.square.types.UpdateItemModifierListsRequest;
import com.squareup.square.types.UpdateItemModifierListsResponse;
import com.squareup.square.types.UpdateItemTaxesRequest;
@@ -216,7 +214,7 @@ public CompletableFuture> list(
* - The both endpoints have different call conventions, including the query filter formats.
*
*/
- public CompletableFuture search() {
+ public CompletableFuture> search() {
return this.rawClient.search().thenApply(response -> response.body());
}
@@ -232,7 +230,7 @@ public CompletableFuture search() {
* - The both endpoints have different call conventions, including the query filter formats.
*
*/
- public CompletableFuture search(SearchCatalogObjectsRequest request) {
+ public CompletableFuture> search(SearchCatalogObjectsRequest request) {
return this.rawClient.search(request).thenApply(response -> response.body());
}
@@ -248,7 +246,7 @@ public CompletableFuture search(SearchCatalogObjec
* - The both endpoints have different call conventions, including the query filter formats.
*
*/
- public CompletableFuture search(
+ public CompletableFuture> search(
SearchCatalogObjectsRequest request, RequestOptions requestOptions) {
return this.rawClient.search(request, requestOptions).thenApply(response -> response.body());
}
@@ -265,7 +263,7 @@ public CompletableFuture search(
* - The both endpoints use different call conventions, including the query filter formats.
*
*/
- public CompletableFuture searchItems() {
+ public CompletableFuture> searchItems() {
return this.rawClient.searchItems().thenApply(response -> response.body());
}
@@ -281,7 +279,7 @@ public CompletableFuture searchItems() {
* - The both endpoints use different call conventions, including the query filter formats.
*
*/
- public CompletableFuture searchItems(SearchCatalogItemsRequest request) {
+ public CompletableFuture> searchItems(SearchCatalogItemsRequest request) {
return this.rawClient.searchItems(request).thenApply(response -> response.body());
}
@@ -297,7 +295,7 @@ public CompletableFuture searchItems(SearchCatalogIt
* - The both endpoints use different call conventions, including the query filter formats.
*
*/
- public CompletableFuture searchItems(
+ public CompletableFuture> searchItems(
SearchCatalogItemsRequest request, RequestOptions requestOptions) {
return this.rawClient.searchItems(request, requestOptions).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncChannelsClient.java b/src/main/java/com/squareup/square/AsyncChannelsClient.java
new file mode 100644
index 00000000..5d1c9280
--- /dev/null
+++ b/src/main/java/com/squareup/square/AsyncChannelsClient.java
@@ -0,0 +1,63 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.squareup.square;
+
+import com.squareup.square.core.ClientOptions;
+import com.squareup.square.core.RequestOptions;
+import com.squareup.square.core.SyncPagingIterable;
+import com.squareup.square.types.BulkRetrieveChannelsRequest;
+import com.squareup.square.types.BulkRetrieveChannelsResponse;
+import com.squareup.square.types.Channel;
+import com.squareup.square.types.GetChannelsRequest;
+import com.squareup.square.types.ListChannelsRequest;
+import com.squareup.square.types.RetrieveChannelResponse;
+import java.util.concurrent.CompletableFuture;
+
+public class AsyncChannelsClient {
+ protected final ClientOptions clientOptions;
+
+ private final AsyncRawChannelsClient rawClient;
+
+ public AsyncChannelsClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ this.rawClient = new AsyncRawChannelsClient(clientOptions);
+ }
+
+ /**
+ * Get responses with HTTP metadata like headers
+ */
+ public AsyncRawChannelsClient withRawResponse() {
+ return this.rawClient;
+ }
+
+ public CompletableFuture> list() {
+ return this.rawClient.list().thenApply(response -> response.body());
+ }
+
+ public CompletableFuture> list(ListChannelsRequest request) {
+ return this.rawClient.list(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture> list(
+ ListChannelsRequest request, RequestOptions requestOptions) {
+ return this.rawClient.list(request, requestOptions).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture bulkRetrieve(BulkRetrieveChannelsRequest request) {
+ return this.rawClient.bulkRetrieve(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture bulkRetrieve(
+ BulkRetrieveChannelsRequest request, RequestOptions requestOptions) {
+ return this.rawClient.bulkRetrieve(request, requestOptions).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture get(GetChannelsRequest request) {
+ return this.rawClient.get(request).thenApply(response -> response.body());
+ }
+
+ public CompletableFuture get(GetChannelsRequest request, RequestOptions requestOptions) {
+ return this.rawClient.get(request, requestOptions).thenApply(response -> response.body());
+ }
+}
diff --git a/src/main/java/com/squareup/square/AsyncCustomersClient.java b/src/main/java/com/squareup/square/AsyncCustomersClient.java
index 60953130..221312b3 100644
--- a/src/main/java/com/squareup/square/AsyncCustomersClient.java
+++ b/src/main/java/com/squareup/square/AsyncCustomersClient.java
@@ -29,7 +29,6 @@
import com.squareup.square.types.GetCustomersRequest;
import com.squareup.square.types.ListCustomersRequest;
import com.squareup.square.types.SearchCustomersRequest;
-import com.squareup.square.types.SearchCustomersResponse;
import com.squareup.square.types.UpdateCustomerRequest;
import com.squareup.square.types.UpdateCustomerResponse;
import java.util.concurrent.CompletableFuture;
@@ -242,7 +241,7 @@ public CompletableFuture bulkUpdateCustomers(
* for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated
* profiles can take closer to one minute or longer, especially during network incidents and outages.
*/
- public CompletableFuture search() {
+ public CompletableFuture> search() {
return this.rawClient.search().thenApply(response -> response.body());
}
@@ -255,7 +254,7 @@ public CompletableFuture search() {
* for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated
* profiles can take closer to one minute or longer, especially during network incidents and outages.
*/
- public CompletableFuture search(SearchCustomersRequest request) {
+ public CompletableFuture> search(SearchCustomersRequest request) {
return this.rawClient.search(request).thenApply(response -> response.body());
}
@@ -268,7 +267,7 @@ public CompletableFuture search(SearchCustomersRequest
* for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated
* profiles can take closer to one minute or longer, especially during network incidents and outages.
*/
- public CompletableFuture search(
+ public CompletableFuture> search(
SearchCustomersRequest request, RequestOptions requestOptions) {
return this.rawClient.search(request, requestOptions).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncInventoryClient.java b/src/main/java/com/squareup/square/AsyncInventoryClient.java
index 59ec2fad..5c72924e 100644
--- a/src/main/java/com/squareup/square/AsyncInventoryClient.java
+++ b/src/main/java/com/squareup/square/AsyncInventoryClient.java
@@ -8,9 +8,7 @@
import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BatchChangeInventoryRequest;
import com.squareup.square.types.BatchChangeInventoryResponse;
-import com.squareup.square.types.BatchGetInventoryChangesResponse;
import com.squareup.square.types.BatchGetInventoryCountsRequest;
-import com.squareup.square.types.BatchGetInventoryCountsResponse;
import com.squareup.square.types.BatchRetrieveInventoryChangesRequest;
import com.squareup.square.types.ChangesInventoryRequest;
import com.squareup.square.types.DeprecatedGetAdjustmentInventoryRequest;
@@ -99,7 +97,7 @@ public CompletableFuture deprecatedBatchChange(
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture deprecatedBatchGetChanges() {
+ public CompletableFuture> deprecatedBatchGetChanges() {
return this.rawClient.deprecatedBatchGetChanges().thenApply(response -> response.body());
}
@@ -107,7 +105,7 @@ public CompletableFuture deprecatedBatchGetCha
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture deprecatedBatchGetChanges(
+ public CompletableFuture> deprecatedBatchGetChanges(
BatchRetrieveInventoryChangesRequest request) {
return this.rawClient.deprecatedBatchGetChanges(request).thenApply(response -> response.body());
}
@@ -116,7 +114,7 @@ public CompletableFuture deprecatedBatchGetCha
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture deprecatedBatchGetChanges(
+ public CompletableFuture> deprecatedBatchGetChanges(
BatchRetrieveInventoryChangesRequest request, RequestOptions requestOptions) {
return this.rawClient.deprecatedBatchGetChanges(request, requestOptions).thenApply(response -> response.body());
}
@@ -125,7 +123,7 @@ public CompletableFuture deprecatedBatchGetCha
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture deprecatedBatchGetCounts() {
+ public CompletableFuture> deprecatedBatchGetCounts() {
return this.rawClient.deprecatedBatchGetCounts().thenApply(response -> response.body());
}
@@ -133,7 +131,7 @@ public CompletableFuture deprecatedBatchGetCoun
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture deprecatedBatchGetCounts(
+ public CompletableFuture> deprecatedBatchGetCounts(
BatchGetInventoryCountsRequest request) {
return this.rawClient.deprecatedBatchGetCounts(request).thenApply(response -> response.body());
}
@@ -142,7 +140,7 @@ public CompletableFuture deprecatedBatchGetCoun
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture deprecatedBatchGetCounts(
+ public CompletableFuture> deprecatedBatchGetCounts(
BatchGetInventoryCountsRequest request, RequestOptions requestOptions) {
return this.rawClient.deprecatedBatchGetCounts(request, requestOptions).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncInvoicesClient.java b/src/main/java/com/squareup/square/AsyncInvoicesClient.java
index 23eaef9c..08257982 100644
--- a/src/main/java/com/squareup/square/AsyncInvoicesClient.java
+++ b/src/main/java/com/squareup/square/AsyncInvoicesClient.java
@@ -23,7 +23,6 @@
import com.squareup.square.types.PublishInvoiceRequest;
import com.squareup.square.types.PublishInvoiceResponse;
import com.squareup.square.types.SearchInvoicesRequest;
-import com.squareup.square.types.SearchInvoicesResponse;
import com.squareup.square.types.UpdateInvoiceRequest;
import com.squareup.square.types.UpdateInvoiceResponse;
import java.util.concurrent.CompletableFuture;
@@ -93,7 +92,7 @@ public CompletableFuture create(
* The response is paginated. If truncated, the response includes a cursor
* that you use in a subsequent request to retrieve the next set of invoices.
*/
- public CompletableFuture search(SearchInvoicesRequest request) {
+ public CompletableFuture> search(SearchInvoicesRequest request) {
return this.rawClient.search(request).thenApply(response -> response.body());
}
@@ -105,7 +104,7 @@ public CompletableFuture search(SearchInvoicesRequest re
* The response is paginated. If truncated, the response includes a cursor
* that you use in a subsequent request to retrieve the next set of invoices.
*/
- public CompletableFuture search(
+ public CompletableFuture> search(
SearchInvoicesRequest request, RequestOptions requestOptions) {
return this.rawClient.search(request, requestOptions).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncLoyaltyClient.java b/src/main/java/com/squareup/square/AsyncLoyaltyClient.java
index 574c6516..5c1d8626 100644
--- a/src/main/java/com/squareup/square/AsyncLoyaltyClient.java
+++ b/src/main/java/com/squareup/square/AsyncLoyaltyClient.java
@@ -6,11 +6,12 @@
import com.squareup.square.core.ClientOptions;
import com.squareup.square.core.RequestOptions;
import com.squareup.square.core.Suppliers;
+import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.loyalty.AsyncAccountsClient;
import com.squareup.square.loyalty.AsyncProgramsClient;
import com.squareup.square.loyalty.AsyncRewardsClient;
+import com.squareup.square.types.LoyaltyEvent;
import com.squareup.square.types.SearchLoyaltyEventsRequest;
-import com.squareup.square.types.SearchLoyaltyEventsResponse;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
@@ -48,7 +49,7 @@ public AsyncRawLoyaltyClient withRawResponse() {
* recorded in the ledger. Using this endpoint, you can search the ledger for events.
* Search results are sorted by created_at in descending order.
*/
- public CompletableFuture searchEvents() {
+ public CompletableFuture> searchEvents() {
return this.rawClient.searchEvents().thenApply(response -> response.body());
}
@@ -60,7 +61,7 @@ public CompletableFuture searchEvents() {
* recorded in the ledger. Using this endpoint, you can search the ledger for events.
* Search results are sorted by created_at in descending order.
*/
- public CompletableFuture searchEvents(SearchLoyaltyEventsRequest request) {
+ public CompletableFuture> searchEvents(SearchLoyaltyEventsRequest request) {
return this.rawClient.searchEvents(request).thenApply(response -> response.body());
}
@@ -72,7 +73,7 @@ public CompletableFuture searchEvents(SearchLoyalty
* recorded in the ledger. Using this endpoint, you can search the ledger for events.
* Search results are sorted by created_at in descending order.
*/
- public CompletableFuture searchEvents(
+ public CompletableFuture> searchEvents(
SearchLoyaltyEventsRequest request, RequestOptions requestOptions) {
return this.rawClient.searchEvents(request, requestOptions).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncOrdersClient.java b/src/main/java/com/squareup/square/AsyncOrdersClient.java
index c614e34f..3dbefb34 100644
--- a/src/main/java/com/squareup/square/AsyncOrdersClient.java
+++ b/src/main/java/com/squareup/square/AsyncOrdersClient.java
@@ -6,6 +6,7 @@
import com.squareup.square.core.ClientOptions;
import com.squareup.square.core.RequestOptions;
import com.squareup.square.core.Suppliers;
+import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.orders.AsyncCustomAttributeDefinitionsClient;
import com.squareup.square.orders.AsyncCustomAttributesClient;
import com.squareup.square.types.BatchGetOrdersRequest;
@@ -18,10 +19,10 @@
import com.squareup.square.types.CreateOrderResponse;
import com.squareup.square.types.GetOrderResponse;
import com.squareup.square.types.GetOrdersRequest;
+import com.squareup.square.types.Order;
import com.squareup.square.types.PayOrderRequest;
import com.squareup.square.types.PayOrderResponse;
import com.squareup.square.types.SearchOrdersRequest;
-import com.squareup.square.types.SearchOrdersResponse;
import com.squareup.square.types.UpdateOrderRequest;
import com.squareup.square.types.UpdateOrderResponse;
import java.util.concurrent.CompletableFuture;
@@ -148,7 +149,7 @@ public CompletableFuture clone(CloneOrderRequest request, Re
* orders have a created_at value that reflects the time the order was created,
* not the time it was subsequently transmitted to Square.
*/
- public CompletableFuture search() {
+ public CompletableFuture> search() {
return this.rawClient.search().thenApply(response -> response.body());
}
@@ -168,7 +169,7 @@ public CompletableFuture search() {
* orders have a created_at value that reflects the time the order was created,
* not the time it was subsequently transmitted to Square.
*/
- public CompletableFuture search(SearchOrdersRequest request) {
+ public CompletableFuture> search(SearchOrdersRequest request) {
return this.rawClient.search(request).thenApply(response -> response.body());
}
@@ -188,7 +189,8 @@ public CompletableFuture search(SearchOrdersRequest reques
* orders have a created_at value that reflects the time the order was created,
* not the time it was subsequently transmitted to Square.
*/
- public CompletableFuture search(SearchOrdersRequest request, RequestOptions requestOptions) {
+ public CompletableFuture> search(
+ SearchOrdersRequest request, RequestOptions requestOptions) {
return this.rawClient.search(request, requestOptions).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncRawCatalogClient.java b/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
index abf57df2..9f22bf42 100644
--- a/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
@@ -490,7 +490,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* The both endpoints have different call conventions, including the query filter formats.
*
*/
- public CompletableFuture> search() {
+ public CompletableFuture>> search() {
return search(SearchCatalogObjectsRequest.builder().build());
}
@@ -506,7 +506,7 @@ public CompletableFuture>
* The both endpoints have different call conventions, including the query filter formats.
*
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchCatalogObjectsRequest request) {
return search(request, null);
}
@@ -523,7 +523,7 @@ public CompletableFuture>
* The both endpoints have different call conventions, including the query filter formats.
*
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchCatalogObjectsRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -547,15 +547,31 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future =
+ new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchCatalogObjectsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchCatalogObjectsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchCatalogObjectsRequest nextRequest = SearchCatalogObjectsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getObjects().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchCatalogObjectsResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
@@ -591,7 +607,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* The both endpoints use different call conventions, including the query filter formats.
*
*/
- public CompletableFuture> searchItems() {
+ public CompletableFuture>> searchItems() {
return searchItems(SearchCatalogItemsRequest.builder().build());
}
@@ -607,7 +623,7 @@ public CompletableFuture> s
* The both endpoints use different call conventions, including the query filter formats.
*
*/
- public CompletableFuture> searchItems(
+ public CompletableFuture>> searchItems(
SearchCatalogItemsRequest request) {
return searchItems(request, null);
}
@@ -624,7 +640,7 @@ public CompletableFuture> s
* The both endpoints use different call conventions, including the query filter formats.
*
*/
- public CompletableFuture> searchItems(
+ public CompletableFuture>> searchItems(
SearchCatalogItemsRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -648,15 +664,31 @@ public CompletableFuture> s
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future =
+ new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchCatalogItemsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchCatalogItemsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchCatalogItemsRequest nextRequest = SearchCatalogItemsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getItems().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchCatalogItemsResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return searchItems(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawChannelsClient.java b/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
new file mode 100644
index 00000000..4f9f25b7
--- /dev/null
+++ b/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
@@ -0,0 +1,250 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.squareup.square;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.squareup.square.core.ClientOptions;
+import com.squareup.square.core.MediaTypes;
+import com.squareup.square.core.ObjectMappers;
+import com.squareup.square.core.QueryStringMapper;
+import com.squareup.square.core.RequestOptions;
+import com.squareup.square.core.SquareApiException;
+import com.squareup.square.core.SquareClientHttpResponse;
+import com.squareup.square.core.SquareException;
+import com.squareup.square.core.SyncPagingIterable;
+import com.squareup.square.types.BulkRetrieveChannelsRequest;
+import com.squareup.square.types.BulkRetrieveChannelsResponse;
+import com.squareup.square.types.Channel;
+import com.squareup.square.types.GetChannelsRequest;
+import com.squareup.square.types.ListChannelsRequest;
+import com.squareup.square.types.ListChannelsResponse;
+import com.squareup.square.types.RetrieveChannelResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import org.jetbrains.annotations.NotNull;
+
+public class AsyncRawChannelsClient {
+ protected final ClientOptions clientOptions;
+
+ public AsyncRawChannelsClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ public CompletableFuture>> list() {
+ return list(ListChannelsRequest.builder().build());
+ }
+
+ public CompletableFuture>> list(ListChannelsRequest request) {
+ return list(request, null);
+ }
+
+ public CompletableFuture>> list(
+ ListChannelsRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/channels");
+ if (request.getReferenceType().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "reference_type", request.getReferenceType().get(), false);
+ }
+ if (request.getReferenceId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "reference_id", request.getReferenceId().get(), false);
+ }
+ if (request.getStatus().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "status", request.getStatus().get(), false);
+ }
+ if (request.getCursor().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "cursor", request.getCursor().get(), false);
+ }
+ if (request.getLimit().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "limit", request.getLimit().get(), false);
+ }
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl.build())
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture>> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ ListChannelsResponse parsedResponse =
+ ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ListChannelsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ ListChannelsRequest nextRequest = ListChannelsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getChannels().orElse(Collections.emptyList());
+ future.complete(new SquareClientHttpResponse<>(
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return list(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> bulkRetrieve(
+ BulkRetrieveChannelsRequest request) {
+ return bulkRetrieve(request, null);
+ }
+
+ public CompletableFuture> bulkRetrieve(
+ BulkRetrieveChannelsRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/channels/bulk-retrieve")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), BulkRetrieveChannelsResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ public CompletableFuture> get(GetChannelsRequest request) {
+ return get(request, null);
+ }
+
+ public CompletableFuture> get(
+ GetChannelsRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/channels")
+ .addPathSegment(request.getChannelId())
+ .build();
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl)
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), RetrieveChannelResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+}
diff --git a/src/main/java/com/squareup/square/AsyncRawCustomersClient.java b/src/main/java/com/squareup/square/AsyncRawCustomersClient.java
index f13859f1..b1183e95 100644
--- a/src/main/java/com/squareup/square/AsyncRawCustomersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCustomersClient.java
@@ -568,7 +568,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated
* profiles can take closer to one minute or longer, especially during network incidents and outages.
*/
- public CompletableFuture> search() {
+ public CompletableFuture>> search() {
return search(SearchCustomersRequest.builder().build());
}
@@ -581,7 +581,8 @@ public CompletableFuture> sear
* for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated
* profiles can take closer to one minute or longer, especially during network incidents and outages.
*/
- public CompletableFuture> search(SearchCustomersRequest request) {
+ public CompletableFuture>> search(
+ SearchCustomersRequest request) {
return search(request, null);
}
@@ -594,7 +595,7 @@ public CompletableFuture> sear
* for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated
* profiles can take closer to one minute or longer, especially during network incidents and outages.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchCustomersRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -618,15 +619,30 @@ public CompletableFuture> sear
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchCustomersResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchCustomersResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchCustomersRequest nextRequest = SearchCustomersRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getCustomers().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchCustomersResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawInventoryClient.java b/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
index 44379820..3add22c4 100644
--- a/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
@@ -254,7 +254,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture> deprecatedBatchGetChanges() {
+ public CompletableFuture>>
+ deprecatedBatchGetChanges() {
return deprecatedBatchGetChanges(
BatchRetrieveInventoryChangesRequest.builder().build());
}
@@ -263,7 +264,7 @@ public CompletableFutureBatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture> deprecatedBatchGetChanges(
+ public CompletableFuture>> deprecatedBatchGetChanges(
BatchRetrieveInventoryChangesRequest request) {
return deprecatedBatchGetChanges(request, null);
}
@@ -272,7 +273,7 @@ public CompletableFutureBatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture> deprecatedBatchGetChanges(
+ public CompletableFuture>> deprecatedBatchGetChanges(
BatchRetrieveInventoryChangesRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -296,16 +297,33 @@ public CompletableFuture> future =
+ CompletableFuture>> future =
new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ BatchGetInventoryChangesResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), BatchGetInventoryChangesResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ BatchRetrieveInventoryChangesRequest nextRequest =
+ BatchRetrieveInventoryChangesRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result =
+ parsedResponse.getChanges().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), BatchGetInventoryChangesResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return deprecatedBatchGetChanges(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
@@ -333,7 +351,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture> deprecatedBatchGetCounts() {
+ public CompletableFuture>> deprecatedBatchGetCounts() {
return deprecatedBatchGetCounts(BatchGetInventoryCountsRequest.builder().build());
}
@@ -341,7 +359,7 @@ public CompletableFutureBatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture> deprecatedBatchGetCounts(
+ public CompletableFuture>> deprecatedBatchGetCounts(
BatchGetInventoryCountsRequest request) {
return deprecatedBatchGetCounts(request, null);
}
@@ -350,7 +368,7 @@ public CompletableFutureBatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
*/
- public CompletableFuture> deprecatedBatchGetCounts(
+ public CompletableFuture>> deprecatedBatchGetCounts(
BatchGetInventoryCountsRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -374,15 +392,31 @@ public CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future =
+ new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ BatchGetInventoryCountsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), BatchGetInventoryCountsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ BatchGetInventoryCountsRequest nextRequest = BatchGetInventoryCountsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getCounts().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), BatchGetInventoryCountsResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return deprecatedBatchGetCounts(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java b/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java
index 68b3c5ad..c8f983df 100644
--- a/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawInvoicesClient.java
@@ -225,7 +225,8 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* The response is paginated. If truncated, the response includes a cursor
* that you use in a subsequent request to retrieve the next set of invoices.
*/
- public CompletableFuture> search(SearchInvoicesRequest request) {
+ public CompletableFuture>> search(
+ SearchInvoicesRequest request) {
return search(request, null);
}
@@ -237,7 +238,7 @@ public CompletableFuture> searc
* The response is paginated. If truncated, the response includes a cursor
* that you use in a subsequent request to retrieve the next set of invoices.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchInvoicesRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -261,15 +262,30 @@ public CompletableFuture> searc
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchInvoicesResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchInvoicesResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchInvoicesRequest nextRequest = SearchInvoicesRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getInvoices().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchInvoicesResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java b/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java
index 2540f6f8..3a3db7ed 100644
--- a/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java
@@ -11,10 +11,16 @@
import com.squareup.square.core.SquareApiException;
import com.squareup.square.core.SquareClientHttpResponse;
import com.squareup.square.core.SquareException;
+import com.squareup.square.core.SyncPagingIterable;
+import com.squareup.square.types.LoyaltyEvent;
import com.squareup.square.types.SearchLoyaltyEventsRequest;
import com.squareup.square.types.SearchLoyaltyEventsResponse;
import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
@@ -41,7 +47,7 @@ public AsyncRawLoyaltyClient(ClientOptions clientOptions) {
* recorded in the ledger. Using this endpoint, you can search the ledger for events.
* Search results are sorted by created_at in descending order.
*/
- public CompletableFuture> searchEvents() {
+ public CompletableFuture>> searchEvents() {
return searchEvents(SearchLoyaltyEventsRequest.builder().build());
}
@@ -53,7 +59,7 @@ public CompletableFuture>
* recorded in the ledger. Using this endpoint, you can search the ledger for events.
* Search results are sorted by created_at in descending order.
*/
- public CompletableFuture> searchEvents(
+ public CompletableFuture>> searchEvents(
SearchLoyaltyEventsRequest request) {
return searchEvents(request, null);
}
@@ -66,7 +72,7 @@ public CompletableFuture>
* recorded in the ledger. Using this endpoint, you can search the ledger for events.
* Search results are sorted by created_at in descending order.
*/
- public CompletableFuture> searchEvents(
+ public CompletableFuture>> searchEvents(
SearchLoyaltyEventsRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -90,15 +96,31 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future =
+ new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchLoyaltyEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchLoyaltyEventsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchLoyaltyEventsRequest nextRequest = SearchLoyaltyEventsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getEvents().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchLoyaltyEventsResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return searchEvents(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawOrdersClient.java b/src/main/java/com/squareup/square/AsyncRawOrdersClient.java
index e0c695c7..238ff6c9 100644
--- a/src/main/java/com/squareup/square/AsyncRawOrdersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawOrdersClient.java
@@ -11,6 +11,7 @@
import com.squareup.square.core.SquareApiException;
import com.squareup.square.core.SquareClientHttpResponse;
import com.squareup.square.core.SquareException;
+import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BatchGetOrdersRequest;
import com.squareup.square.types.BatchGetOrdersResponse;
import com.squareup.square.types.CalculateOrderRequest;
@@ -21,6 +22,7 @@
import com.squareup.square.types.CreateOrderResponse;
import com.squareup.square.types.GetOrderResponse;
import com.squareup.square.types.GetOrdersRequest;
+import com.squareup.square.types.Order;
import com.squareup.square.types.PayOrderRequest;
import com.squareup.square.types.PayOrderResponse;
import com.squareup.square.types.SearchOrdersRequest;
@@ -28,7 +30,11 @@
import com.squareup.square.types.UpdateOrderRequest;
import com.squareup.square.types.UpdateOrderResponse;
import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
@@ -349,7 +355,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* orders have a created_at value that reflects the time the order was created,
* not the time it was subsequently transmitted to Square.
*/
- public CompletableFuture> search() {
+ public CompletableFuture>> search() {
return search(SearchOrdersRequest.builder().build());
}
@@ -369,7 +375,7 @@ public CompletableFuture> search(
* orders have a created_at value that reflects the time the order was created,
* not the time it was subsequently transmitted to Square.
*/
- public CompletableFuture> search(SearchOrdersRequest request) {
+ public CompletableFuture>> search(SearchOrdersRequest request) {
return search(request, null);
}
@@ -389,7 +395,7 @@ public CompletableFuture> search(
* orders have a created_at value that reflects the time the order was created,
* not the time it was subsequently transmitted to Square.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchOrdersRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -413,14 +419,30 @@ public CompletableFuture> search(
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchOrdersResponse parsedResponse =
+ ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SearchOrdersResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchOrdersRequest nextRequest = SearchOrdersRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getOrders().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SearchOrdersResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java b/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java
index c2367a94..3cbbf503 100644
--- a/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java
@@ -33,6 +33,7 @@
import com.squareup.square.types.ResumeSubscriptionResponse;
import com.squareup.square.types.SearchSubscriptionsRequest;
import com.squareup.square.types.SearchSubscriptionsResponse;
+import com.squareup.square.types.Subscription;
import com.squareup.square.types.SubscriptionEvent;
import com.squareup.square.types.SwapPlanRequest;
import com.squareup.square.types.SwapPlanResponse;
@@ -220,7 +221,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* first by location, within location by customer ID, and within
* customer by subscription creation date.
*/
- public CompletableFuture> search() {
+ public CompletableFuture>> search() {
return search(SearchSubscriptionsRequest.builder().build());
}
@@ -238,7 +239,7 @@ public CompletableFuture>
* first by location, within location by customer ID, and within
* customer by subscription creation date.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchSubscriptionsRequest request) {
return search(request, null);
}
@@ -257,7 +258,7 @@ public CompletableFuture>
* first by location, within location by customer ID, and within
* customer by subscription creation date.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchSubscriptionsRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -281,15 +282,32 @@ public CompletableFuture>
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future =
+ new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchSubscriptionsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchSubscriptionsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchSubscriptionsRequest nextRequest = SearchSubscriptionsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result =
+ parsedResponse.getSubscriptions().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchSubscriptionsResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java b/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java
index 0f8ae545..a08ab508 100644
--- a/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java
@@ -11,6 +11,7 @@
import com.squareup.square.core.SquareApiException;
import com.squareup.square.core.SquareClientHttpResponse;
import com.squareup.square.core.SquareException;
+import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BatchCreateTeamMembersRequest;
import com.squareup.square.types.BatchCreateTeamMembersResponse;
import com.squareup.square.types.BatchUpdateTeamMembersRequest;
@@ -21,10 +22,15 @@
import com.squareup.square.types.GetTeamMembersRequest;
import com.squareup.square.types.SearchTeamMembersRequest;
import com.squareup.square.types.SearchTeamMembersResponse;
+import com.squareup.square.types.TeamMember;
import com.squareup.square.types.UpdateTeamMemberResponse;
import com.squareup.square.types.UpdateTeamMembersRequest;
import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
@@ -290,7 +296,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
* The list can be filtered by location IDs, ACTIVE or INACTIVE status, or whether
* the team member is the Square account owner.
*/
- public CompletableFuture> search() {
+ public CompletableFuture>> search() {
return search(SearchTeamMembersRequest.builder().build());
}
@@ -299,7 +305,7 @@ public CompletableFuture> se
* The list can be filtered by location IDs, ACTIVE or INACTIVE status, or whether
* the team member is the Square account owner.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchTeamMembersRequest request) {
return search(request, null);
}
@@ -309,7 +315,7 @@ public CompletableFuture> se
* The list can be filtered by location IDs, ACTIVE or INACTIVE status, or whether
* the team member is the Square account owner.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchTeamMembersRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -333,15 +339,31 @@ public CompletableFuture> se
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchTeamMembersResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchTeamMembersResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchTeamMembersRequest nextRequest = SearchTeamMembersRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result =
+ parsedResponse.getTeamMembers().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBody.string(), SearchTeamMembersResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java b/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java
new file mode 100644
index 00000000..6fca85bd
--- /dev/null
+++ b/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java
@@ -0,0 +1,749 @@
+/**
+ * This file was auto-generated by Fern from our API Definition.
+ */
+package com.squareup.square;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.squareup.square.core.ClientOptions;
+import com.squareup.square.core.MediaTypes;
+import com.squareup.square.core.ObjectMappers;
+import com.squareup.square.core.QueryStringMapper;
+import com.squareup.square.core.RequestOptions;
+import com.squareup.square.core.SquareApiException;
+import com.squareup.square.core.SquareClientHttpResponse;
+import com.squareup.square.core.SquareException;
+import com.squareup.square.core.SyncPagingIterable;
+import com.squareup.square.types.CancelTransferOrderRequest;
+import com.squareup.square.types.CancelTransferOrderResponse;
+import com.squareup.square.types.CreateTransferOrderRequest;
+import com.squareup.square.types.CreateTransferOrderResponse;
+import com.squareup.square.types.DeleteTransferOrderResponse;
+import com.squareup.square.types.DeleteTransferOrdersRequest;
+import com.squareup.square.types.GetTransferOrdersRequest;
+import com.squareup.square.types.ReceiveTransferOrderRequest;
+import com.squareup.square.types.ReceiveTransferOrderResponse;
+import com.squareup.square.types.RetrieveTransferOrderResponse;
+import com.squareup.square.types.SearchTransferOrdersRequest;
+import com.squareup.square.types.SearchTransferOrdersResponse;
+import com.squareup.square.types.StartTransferOrderRequest;
+import com.squareup.square.types.StartTransferOrderResponse;
+import com.squareup.square.types.TransferOrder;
+import com.squareup.square.types.UpdateTransferOrderRequest;
+import com.squareup.square.types.UpdateTransferOrderResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import org.jetbrains.annotations.NotNull;
+
+public class AsyncRawTransferOrdersClient {
+ protected final ClientOptions clientOptions;
+
+ public AsyncRawTransferOrdersClient(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ }
+
+ /**
+ * Creates a new transfer order in DRAFT status. A transfer order represents the intent
+ * to move CatalogItemVariations from one Location to another.
+ * The source and destination locations must be different and must belong to your Square account.
+ * In DRAFT status, you can:
+ *
+ * - Add or remove items
+ * - Modify quantities
+ * - Update shipping information
+ * - Delete the entire order via DeleteTransferOrder
+ *
+ * The request requires source_location_id and destination_location_id.
+ * Inventory levels are not affected until the order is started via
+ * 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 event.
+ */
+ public CompletableFuture> create(
+ CreateTransferOrderRequest request) {
+ return create(request, null);
+ }
+
+ /**
+ * Creates a new transfer order in DRAFT status. A transfer order represents the intent
+ * to move CatalogItemVariations from one Location to another.
+ * The source and destination locations must be different and must belong to your Square account.
+ * In DRAFT status, you can:
+ *
+ * - Add or remove items
+ * - Modify quantities
+ * - Update shipping information
+ * - Delete the entire order via DeleteTransferOrder
+ *
+ * The request requires source_location_id and destination_location_id.
+ * Inventory levels are not affected until the order is started via
+ * 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 event.
+ */
+ public CompletableFuture> create(
+ CreateTransferOrderRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), CreateTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * Searches for transfer orders using filters. Returns a paginated list of matching
+ * TransferOrders sorted by creation date.
+ * Common search scenarios:
+ *
+ */
+ public CompletableFuture>> search() {
+ return search(SearchTransferOrdersRequest.builder().build());
+ }
+
+ /**
+ * Searches for transfer orders using filters. Returns a paginated list of matching
+ * TransferOrders sorted by creation date.
+ * Common search scenarios:
+ *
+ */
+ public CompletableFuture>> search(
+ SearchTransferOrdersRequest request) {
+ return search(request, null);
+ }
+
+ /**
+ * Searches for transfer orders using filters. Returns a paginated list of matching
+ * TransferOrders sorted by creation date.
+ * Common search scenarios:
+ *
+ */
+ public CompletableFuture>> search(
+ SearchTransferOrdersRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders/search")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture>> future =
+ new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ SearchTransferOrdersResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), SearchTransferOrdersResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchTransferOrdersRequest nextRequest = SearchTransferOrdersRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result =
+ parsedResponse.getTransferOrders().orElse(Collections.emptyList());
+ future.complete(new SquareClientHttpResponse<>(
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * Retrieves a specific TransferOrder by ID. Returns the complete
+ * order details including:
+ *
+ * - Basic information (status, dates, notes)
+ * - Line items with ordered and received quantities
+ * - Source and destination Locations
+ * - Tracking information (if available)
+ *
+ */
+ public CompletableFuture> get(
+ GetTransferOrdersRequest request) {
+ return get(request, null);
+ }
+
+ /**
+ * Retrieves a specific TransferOrder by ID. Returns the complete
+ * order details including:
+ *
+ * - Basic information (status, dates, notes)
+ * - Line items with ordered and received quantities
+ * - Source and destination Locations
+ * - Tracking information (if available)
+ *
+ */
+ public CompletableFuture> get(
+ GetTransferOrdersRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .addPathSegment(request.getTransferOrderId())
+ .build();
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl)
+ .method("GET", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), RetrieveTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * 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 event.
+ */
+ public CompletableFuture> update(
+ UpdateTransferOrderRequest request) {
+ return update(request, null);
+ }
+
+ /**
+ * 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 event.
+ */
+ public CompletableFuture> update(
+ UpdateTransferOrderRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .addPathSegment(request.getTransferOrderId())
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("PUT", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), UpdateTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * Deletes a transfer order in DRAFT status.
+ * Only draft orders can be deleted. Once an order is started via
+ * StartTransferOrder, it can no longer be deleted.
+ * Creates a transfer_order.deleted webhook event.
+ */
+ public CompletableFuture> delete(
+ DeleteTransferOrdersRequest request) {
+ return delete(request, null);
+ }
+
+ /**
+ * Deletes a transfer order in DRAFT status.
+ * Only draft orders can be deleted. Once an order is started via
+ * StartTransferOrder, it can no longer be deleted.
+ * Creates a transfer_order.deleted webhook event.
+ */
+ public CompletableFuture> delete(
+ DeleteTransferOrdersRequest request, RequestOptions requestOptions) {
+ HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .addPathSegment(request.getTransferOrderId());
+ if (request.getVersion().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "version", request.getVersion().get(), false);
+ }
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl.build())
+ .method("DELETE", null)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Accept", "application/json");
+ Request okhttpRequest = _requestBuilder.build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), DeleteTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * Cancels a transfer order in STARTED or
+ * PARTIALLY_RECEIVED status. Any unreceived quantities will no
+ * longer be receivable and will be immediately returned to the source 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 event.
+ */
+ public CompletableFuture> cancel(
+ CancelTransferOrderRequest request) {
+ return cancel(request, null);
+ }
+
+ /**
+ * Cancels a transfer order in STARTED or
+ * PARTIALLY_RECEIVED status. Any unreceived quantities will no
+ * longer be receivable and will be immediately returned to the source 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 event.
+ */
+ public CompletableFuture> cancel(
+ CancelTransferOrderRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .addPathSegment(request.getTransferOrderId())
+ .addPathSegments("cancel")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), CancelTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * Records receipt of CatalogItemVariations 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 of IN_STOCK)
+ * - Quantity damaged during transit/handling (added to destination inventory with InventoryState of WASTE)
+ * - Quantity canceled (returned to source location's inventory)
+ *
+ * The order must be in STARTED or PARTIALLY_RECEIVED status.
+ * Received quantities are added to the destination Location's inventory according to their condition.
+ * Canceled quantities are immediately returned to the source Location's inventory.
+ * When all items are either received, damaged, or canceled, the order moves to
+ * COMPLETED status.
+ * Creates a transfer_order.updated webhook event.
+ */
+ public CompletableFuture> receive(
+ ReceiveTransferOrderRequest request) {
+ return receive(request, null);
+ }
+
+ /**
+ * Records receipt of CatalogItemVariations 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 of IN_STOCK)
+ * - Quantity damaged during transit/handling (added to destination inventory with InventoryState of WASTE)
+ * - Quantity canceled (returned to source location's inventory)
+ *
+ * The order must be in STARTED or PARTIALLY_RECEIVED status.
+ * Received quantities are added to the destination Location's inventory according to their condition.
+ * Canceled quantities are immediately returned to the source Location's inventory.
+ * When all items are either received, damaged, or canceled, the order moves to
+ * COMPLETED status.
+ * Creates a transfer_order.updated webhook event.
+ */
+ public CompletableFuture> receive(
+ ReceiveTransferOrderRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .addPathSegment(request.getTransferOrderId())
+ .addPathSegments("receive")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), ReceiveTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+
+ /**
+ * Changes a DRAFT transfer order to STARTED status.
+ * This decrements inventory at the source Location and marks it as in-transit.
+ * The order must be in DRAFT status and have all required fields populated.
+ * Once started, the order can no longer be deleted, but it can be canceled via
+ * CancelTransferOrder.
+ * Creates a transfer_order.updated webhook event.
+ */
+ public CompletableFuture> start(
+ StartTransferOrderRequest request) {
+ return start(request, null);
+ }
+
+ /**
+ * Changes a DRAFT transfer order to STARTED status.
+ * This decrements inventory at the source Location and marks it as in-transit.
+ * The order must be in DRAFT status and have all required fields populated.
+ * Once started, the order can no longer be deleted, but it can be canceled via
+ * CancelTransferOrder.
+ * Creates a transfer_order.updated webhook event.
+ */
+ public CompletableFuture> start(
+ StartTransferOrderRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/transfer-orders")
+ .addPathSegment(request.getTransferOrderId())
+ .addPathSegments("start")
+ .build();
+ RequestBody body;
+ try {
+ body = RequestBody.create(
+ ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON);
+ } catch (JsonProcessingException e) {
+ throw new SquareException("Failed to serialize request", e);
+ }
+ Request okhttpRequest = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", body)
+ .headers(Headers.of(clientOptions.headers(requestOptions)))
+ .addHeader("Content-Type", "application/json")
+ .addHeader("Accept", "application/json")
+ .build();
+ OkHttpClient client = clientOptions.httpClient();
+ if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
+ client = clientOptions.httpClientWithTimeout(requestOptions);
+ }
+ CompletableFuture> future = new CompletableFuture<>();
+ client.newCall(okhttpRequest).enqueue(new Callback() {
+ @Override
+ public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
+ try (ResponseBody responseBody = response.body()) {
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBody.string(), StartTransferOrderResponse.class),
+ response));
+ return;
+ }
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(),
+ response.code(),
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class),
+ response));
+ return;
+ } catch (IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ }
+
+ @Override
+ public void onFailure(@NotNull Call call, @NotNull IOException e) {
+ future.completeExceptionally(new SquareException("Network error executing HTTP request", e));
+ }
+ });
+ return future;
+ }
+}
diff --git a/src/main/java/com/squareup/square/AsyncRawVendorsClient.java b/src/main/java/com/squareup/square/AsyncRawVendorsClient.java
index fd6cf515..9527d046 100644
--- a/src/main/java/com/squareup/square/AsyncRawVendorsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawVendorsClient.java
@@ -11,6 +11,7 @@
import com.squareup.square.core.SquareApiException;
import com.squareup.square.core.SquareClientHttpResponse;
import com.squareup.square.core.SquareException;
+import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BatchCreateVendorsRequest;
import com.squareup.square.types.BatchCreateVendorsResponse;
import com.squareup.square.types.BatchGetVendorsRequest;
@@ -25,8 +26,13 @@
import com.squareup.square.types.SearchVendorsResponse;
import com.squareup.square.types.UpdateVendorResponse;
import com.squareup.square.types.UpdateVendorsRequest;
+import com.squareup.square.types.Vendor;
import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
@@ -321,21 +327,22 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
/**
* Searches for vendors using a filter against supported Vendor properties and a supported sorter.
*/
- public CompletableFuture> search() {
+ public CompletableFuture>> search() {
return search(SearchVendorsRequest.builder().build());
}
/**
* Searches for vendors using a filter against supported Vendor properties and a supported sorter.
*/
- public CompletableFuture> search(SearchVendorsRequest request) {
+ public CompletableFuture>> search(
+ SearchVendorsRequest request) {
return search(request, null);
}
/**
* Searches for vendors using a filter against supported Vendor properties and a supported sorter.
*/
- public CompletableFuture> search(
+ public CompletableFuture>> search(
SearchVendorsRequest request, RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
@@ -359,14 +366,30 @@ public CompletableFuture> search
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
- CompletableFuture> future = new CompletableFuture<>();
+ CompletableFuture>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
if (response.isSuccessful()) {
+ SearchVendorsResponse parsedResponse =
+ ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SearchVendorsResponse.class);
+ Optional startingAfter = parsedResponse.getCursor();
+ SearchVendorsRequest nextRequest = SearchVendorsRequest.builder()
+ .from(request)
+ .cursor(startingAfter)
+ .build();
+ List result = parsedResponse.getVendors().orElse(Collections.emptyList());
future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), SearchVendorsResponse.class),
+ new SyncPagingIterable(startingAfter.isPresent(), result, () -> {
+ try {
+ return search(nextRequest, requestOptions)
+ .get()
+ .body();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }),
response));
return;
}
diff --git a/src/main/java/com/squareup/square/AsyncSquareClient.java b/src/main/java/com/squareup/square/AsyncSquareClient.java
index c307ebea..c78a23b4 100644
--- a/src/main/java/com/squareup/square/AsyncSquareClient.java
+++ b/src/main/java/com/squareup/square/AsyncSquareClient.java
@@ -28,6 +28,8 @@ public class AsyncSquareClient {
protected final Supplier catalogClient;
+ protected final Supplier channelsClient;
+
protected final Supplier customersClient;
protected final Supplier devicesClient;
@@ -74,6 +76,8 @@ public class AsyncSquareClient {
protected final Supplier terminalClient;
+ protected final Supplier transferOrdersClient;
+
protected final Supplier vendorsClient;
protected final Supplier cashDrawersClient;
@@ -90,6 +94,7 @@ public AsyncSquareClient(ClientOptions clientOptions) {
this.bookingsClient = Suppliers.memoize(() -> new AsyncBookingsClient(clientOptions));
this.cardsClient = Suppliers.memoize(() -> new AsyncCardsClient(clientOptions));
this.catalogClient = Suppliers.memoize(() -> new AsyncCatalogClient(clientOptions));
+ this.channelsClient = Suppliers.memoize(() -> new AsyncChannelsClient(clientOptions));
this.customersClient = Suppliers.memoize(() -> new AsyncCustomersClient(clientOptions));
this.devicesClient = Suppliers.memoize(() -> new AsyncDevicesClient(clientOptions));
this.disputesClient = Suppliers.memoize(() -> new AsyncDisputesClient(clientOptions));
@@ -113,6 +118,7 @@ public AsyncSquareClient(ClientOptions clientOptions) {
this.teamMembersClient = Suppliers.memoize(() -> new AsyncTeamMembersClient(clientOptions));
this.teamClient = Suppliers.memoize(() -> new AsyncTeamClient(clientOptions));
this.terminalClient = Suppliers.memoize(() -> new AsyncTerminalClient(clientOptions));
+ this.transferOrdersClient = Suppliers.memoize(() -> new AsyncTransferOrdersClient(clientOptions));
this.vendorsClient = Suppliers.memoize(() -> new AsyncVendorsClient(clientOptions));
this.cashDrawersClient = Suppliers.memoize(() -> new AsyncCashDrawersClient(clientOptions));
this.webhooksClient = Suppliers.memoize(() -> new AsyncWebhooksClient(clientOptions));
@@ -150,6 +156,10 @@ public AsyncCatalogClient catalog() {
return this.catalogClient.get();
}
+ public AsyncChannelsClient channels() {
+ return this.channelsClient.get();
+ }
+
public AsyncCustomersClient customers() {
return this.customersClient.get();
}
@@ -242,6 +252,10 @@ public AsyncTerminalClient terminal() {
return this.terminalClient.get();
}
+ public AsyncTransferOrdersClient transferOrders() {
+ return this.transferOrdersClient.get();
+ }
+
public AsyncVendorsClient vendors() {
return this.vendorsClient.get();
}
diff --git a/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java b/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java
index 42e0a880..2c0155a9 100644
--- a/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java
+++ b/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java
@@ -19,7 +19,7 @@ public class AsyncSquareClientBuilder {
private String token = System.getenv("SQUARE_TOKEN");
- private String version = "2025-09-24";
+ private String version = "2025-10-16";
private Environment environment = Environment.PRODUCTION;
diff --git a/src/main/java/com/squareup/square/AsyncSubscriptionsClient.java b/src/main/java/com/squareup/square/AsyncSubscriptionsClient.java
index fb4aa583..e7aec595 100644
--- a/src/main/java/com/squareup/square/AsyncSubscriptionsClient.java
+++ b/src/main/java/com/squareup/square/AsyncSubscriptionsClient.java
@@ -24,7 +24,7 @@
import com.squareup.square.types.ResumeSubscriptionRequest;
import com.squareup.square.types.ResumeSubscriptionResponse;
import com.squareup.square.types.SearchSubscriptionsRequest;
-import com.squareup.square.types.SearchSubscriptionsResponse;
+import com.squareup.square.types.Subscription;
import com.squareup.square.types.SubscriptionEvent;
import com.squareup.square.types.SwapPlanRequest;
import com.squareup.square.types.SwapPlanResponse;
@@ -105,7 +105,7 @@ public CompletableFuture bulkSwapPlan(
* first by location, within location by customer ID, and within
* customer by subscription creation date.
*/
- public CompletableFuture search() {
+ public CompletableFuture> search() {
return this.rawClient.search().thenApply(response -> response.body());
}
@@ -123,7 +123,7 @@ public CompletableFuture search() {
* first by location, within location by customer ID, and within
* customer by subscription creation date.
*/
- public CompletableFuture search(SearchSubscriptionsRequest request) {
+ public CompletableFuture> search(SearchSubscriptionsRequest request) {
return this.rawClient.search(request).thenApply(response -> response.body());
}
@@ -141,7 +141,7 @@ public CompletableFuture search(SearchSubscriptions
* first by location, within location by customer ID, and within
* customer by subscription creation date.
*/
- public CompletableFuture search(
+ public CompletableFuture