> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieve a collection of bookings.
* To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
diff --git a/src/main/java/com/squareup/square/AsyncCardsClient.java b/src/main/java/com/squareup/square/AsyncCardsClient.java
index 8aa15949..efbfcac3 100644
--- a/src/main/java/com/squareup/square/AsyncCardsClient.java
+++ b/src/main/java/com/squareup/square/AsyncCardsClient.java
@@ -41,6 +41,14 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Retrieves a list of cards owned by the account making the request.
+ * A max of 25 cards will be returned.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieves a list of cards owned by the account making the request.
* A max of 25 cards will be returned.
diff --git a/src/main/java/com/squareup/square/AsyncCatalogClient.java b/src/main/java/com/squareup/square/AsyncCatalogClient.java
index 5e174f3b..8d7f7df5 100644
--- a/src/main/java/com/squareup/square/AsyncCatalogClient.java
+++ b/src/main/java/com/squareup/square/AsyncCatalogClient.java
@@ -179,6 +179,18 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Returns a list of all CatalogObjects of the specified types in the catalog.
+ * The types parameter is specified as a comma-separated list of the CatalogObjectType values,
+ * for example, "ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX, IMAGE".
+ * Important: ListCatalog does not return deleted catalog items. To retrieve
+ * deleted catalog items, use SearchCatalogObjects
+ * and set the include_deleted_objects attribute value to true.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns a list of all CatalogObjects of the specified types in the catalog.
* The types parameter is specified as a comma-separated list of the CatalogObjectType values,
@@ -220,6 +232,22 @@ public CompletableFuture search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Searches for CatalogObject of any type by matching supported search attribute values,
+ * excluding custom attribute values on items or item variations, against one or more of the specified query filters.
+ * This (SearchCatalogObjects) endpoint differs from the SearchCatalogItems
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints have different call conventions, including the query filter formats.
+ *
+ */
+ public CompletableFuture search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches for CatalogObject of any type by matching supported search attribute values,
* excluding custom attribute values on items or item variations, against one or more of the specified query filters.
@@ -269,6 +297,22 @@ public CompletableFuture searchItems() {
return this.rawClient.searchItems().thenApply(response -> response.body());
}
+ /**
+ * Searches for catalog items or item variations by matching supported search attribute values, including
+ * custom attribute values, against one or more of the specified query filters.
+ * This (SearchCatalogItems) endpoint differs from the SearchCatalogObjects
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints use different call conventions, including the query filter formats.
+ *
+ */
+ public CompletableFuture searchItems(RequestOptions requestOptions) {
+ return this.rawClient.searchItems(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches for catalog items or item variations by matching supported search attribute values, including
* custom attribute values, against one or more of the specified query filters.
diff --git a/src/main/java/com/squareup/square/AsyncChannelsClient.java b/src/main/java/com/squareup/square/AsyncChannelsClient.java
index 5d1c9280..f60cff5e 100644
--- a/src/main/java/com/squareup/square/AsyncChannelsClient.java
+++ b/src/main/java/com/squareup/square/AsyncChannelsClient.java
@@ -35,6 +35,10 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
public CompletableFuture> list(ListChannelsRequest request) {
return this.rawClient.list(request).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..a3047518 100644
--- a/src/main/java/com/squareup/square/AsyncCustomersClient.java
+++ b/src/main/java/com/squareup/square/AsyncCustomersClient.java
@@ -78,6 +78,16 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Lists customer profiles associated with a Square account.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * for the listing 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> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Lists customer profiles associated with a Square account.
* Under normal operating conditions, newly created or updated customer profiles become available
@@ -115,6 +125,22 @@ public CompletableFuture create() {
return this.rawClient.create().thenApply(response -> response.body());
}
+ /**
+ * Creates a new customer for a business.
+ * You must provide at least one of the following values in your request to this
+ * endpoint:
+ *
+ * given_name
+ * family_name
+ * company_name
+ * email_address
+ * phone_number
+ *
+ */
+ public CompletableFuture create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Creates a new customer for a business.
* You must provide at least one of the following values in your request to this
@@ -246,6 +272,19 @@ public CompletableFuture search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Searches the customer profiles associated with a Square account using one or more supported query filters.
+ * Calling SearchCustomers without any explicit query filter returns all
+ * customer profiles ordered alphabetically based on given_name and
+ * family_name.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * 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(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches the customer profiles associated with a Square account using one or more supported query filters.
* Calling SearchCustomers without any explicit query filter returns all
diff --git a/src/main/java/com/squareup/square/AsyncDevicesClient.java b/src/main/java/com/squareup/square/AsyncDevicesClient.java
index fadb420c..5a107aaa 100644
--- a/src/main/java/com/squareup/square/AsyncDevicesClient.java
+++ b/src/main/java/com/squareup/square/AsyncDevicesClient.java
@@ -43,6 +43,14 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * List devices associated with the merchant. Currently, only Terminal API
+ * devices are supported.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
diff --git a/src/main/java/com/squareup/square/AsyncDisputesClient.java b/src/main/java/com/squareup/square/AsyncDisputesClient.java
index 614412a1..30d0adb9 100644
--- a/src/main/java/com/squareup/square/AsyncDisputesClient.java
+++ b/src/main/java/com/squareup/square/AsyncDisputesClient.java
@@ -50,6 +50,13 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Returns a list of disputes associated with a particular account.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns a list of disputes associated with a particular account.
*/
diff --git a/src/main/java/com/squareup/square/AsyncEmployeesClient.java b/src/main/java/com/squareup/square/AsyncEmployeesClient.java
index 145086ee..b3ccab23 100644
--- a/src/main/java/com/squareup/square/AsyncEmployeesClient.java
+++ b/src/main/java/com/squareup/square/AsyncEmployeesClient.java
@@ -33,6 +33,10 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
public CompletableFuture> list(ListEmployeesRequest request) {
return this.rawClient.list(request).thenApply(response -> response.body());
}
diff --git a/src/main/java/com/squareup/square/AsyncEventsClient.java b/src/main/java/com/squareup/square/AsyncEventsClient.java
index d234bad3..c7e62f53 100644
--- a/src/main/java/com/squareup/square/AsyncEventsClient.java
+++ b/src/main/java/com/squareup/square/AsyncEventsClient.java
@@ -37,6 +37,13 @@ public CompletableFuture searchEvents() {
return this.rawClient.searchEvents().thenApply(response -> response.body());
}
+ /**
+ * Search for Square API events that occur within a 28-day timeframe.
+ */
+ public CompletableFuture searchEvents(RequestOptions requestOptions) {
+ return this.rawClient.searchEvents(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Search for Square API events that occur within a 28-day timeframe.
*/
@@ -91,6 +98,13 @@ public CompletableFuture listEventTypes() {
return this.rawClient.listEventTypes().thenApply(response -> response.body());
}
+ /**
+ * Lists all event types that you can subscribe to as webhooks or query using the Events API.
+ */
+ public CompletableFuture listEventTypes(RequestOptions requestOptions) {
+ return this.rawClient.listEventTypes(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Lists all event types that you can subscribe to as webhooks or query using the Events API.
*/
diff --git a/src/main/java/com/squareup/square/AsyncGiftCardsClient.java b/src/main/java/com/squareup/square/AsyncGiftCardsClient.java
index 11765160..9934b68f 100644
--- a/src/main/java/com/squareup/square/AsyncGiftCardsClient.java
+++ b/src/main/java/com/squareup/square/AsyncGiftCardsClient.java
@@ -53,6 +53,14 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Lists all gift cards. You can specify optional filters to retrieve
+ * a subset of the gift cards. Results are sorted by created_at in ascending order.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Lists all gift cards. You can specify optional filters to retrieve
* a subset of the gift cards. Results are sorted by created_at in ascending order.
diff --git a/src/main/java/com/squareup/square/AsyncInventoryClient.java b/src/main/java/com/squareup/square/AsyncInventoryClient.java
index 59ec2fad..51a1eb9e 100644
--- a/src/main/java/com/squareup/square/AsyncInventoryClient.java
+++ b/src/main/java/com/squareup/square/AsyncInventoryClient.java
@@ -103,6 +103,15 @@ public CompletableFuture deprecatedBatchGetCha
return this.rawClient.deprecatedBatchGetChanges().thenApply(response -> response.body());
}
+ /**
+ * Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
+ * is updated to conform to the standard convention.
+ */
+ public CompletableFuture deprecatedBatchGetChanges(
+ RequestOptions requestOptions) {
+ return this.rawClient.deprecatedBatchGetChanges(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
@@ -129,6 +138,14 @@ public CompletableFuture deprecatedBatchGetCoun
return this.rawClient.deprecatedBatchGetCounts().thenApply(response -> response.body());
}
+ /**
+ * Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
+ * is updated to conform to the standard convention.
+ */
+ public CompletableFuture deprecatedBatchGetCounts(RequestOptions requestOptions) {
+ return this.rawClient.deprecatedBatchGetCounts(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
@@ -180,6 +197,18 @@ public CompletableFuture> batchGetChanges()
return this.rawClient.batchGetChanges().thenApply(response -> response.body());
}
+ /**
+ * Returns historical physical counts and adjustments based on the
+ * provided filter criteria.
+ * Results are paginated and sorted in ascending order according their
+ * occurred_at timestamp (oldest first).
+ * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries
+ * that cannot be handled by other, simpler endpoints.
+ */
+ public CompletableFuture> batchGetChanges(RequestOptions requestOptions) {
+ return this.rawClient.batchGetChanges(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns historical physical counts and adjustments based on the
* provided filter criteria.
@@ -221,6 +250,21 @@ public CompletableFuture> batchGetCounts() {
return this.rawClient.batchGetCounts().thenApply(response -> response.body());
}
+ /**
+ * Returns current counts for the provided
+ * CatalogObjects at the requested
+ * Locations.
+ * Results are paginated and sorted in descending order according to their
+ * calculated_at timestamp (newest first).
+ * When updated_after is specified, only counts that have changed since that
+ * time (based on the server timestamp for the most recent change) are
+ * returned. This allows clients to perform a "sync" operation, for example
+ * in response to receiving a Webhook notification.
+ */
+ public CompletableFuture> batchGetCounts(RequestOptions requestOptions) {
+ return this.rawClient.batchGetCounts(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns current counts for the provided
* CatalogObjects at the requested
diff --git a/src/main/java/com/squareup/square/AsyncLaborClient.java b/src/main/java/com/squareup/square/AsyncLaborClient.java
index 83864ef1..0f4339f0 100644
--- a/src/main/java/com/squareup/square/AsyncLaborClient.java
+++ b/src/main/java/com/squareup/square/AsyncLaborClient.java
@@ -133,6 +133,14 @@ public CompletableFuture searchScheduledShifts()
return this.rawClient.searchScheduledShifts().thenApply(response -> response.body());
}
+ /**
+ * Returns a paginated list of scheduled shifts, with optional filter and sort settings.
+ * By default, results are sorted by start_at in ascending order.
+ */
+ public CompletableFuture searchScheduledShifts(RequestOptions requestOptions) {
+ return this.rawClient.searchScheduledShifts(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns a paginated list of scheduled shifts, with optional filter and sort settings.
* By default, results are sorted by start_at in ascending order.
@@ -294,6 +302,29 @@ public CompletableFuture searchTimecards() {
return this.rawClient.searchTimecards().thenApply(response -> response.body());
}
+ /**
+ * Returns a paginated list of Timecard records for a business.
+ * The list to be returned can be filtered by:
+ *
+ * - Location IDs
+ * - Team member IDs
+ * - Timecard status (
OPEN or CLOSED)
+ * - Timecard start
+ * - Timecard end
+ * - Workday details
+ *
+ * The list can be sorted by:
+ *
+ * START_AT
+ * END_AT
+ * CREATED_AT
+ * UPDATED_AT
+ *
+ */
+ public CompletableFuture searchTimecards(RequestOptions requestOptions) {
+ return this.rawClient.searchTimecards(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns a paginated list of Timecard records for a business.
* The list to be returned can be filtered by:
diff --git a/src/main/java/com/squareup/square/AsyncLocationsClient.java b/src/main/java/com/squareup/square/AsyncLocationsClient.java
index 94b5e1f9..70c9d0e8 100644
--- a/src/main/java/com/squareup/square/AsyncLocationsClient.java
+++ b/src/main/java/com/squareup/square/AsyncLocationsClient.java
@@ -77,6 +77,19 @@ public CompletableFuture create() {
return this.rawClient.create().thenApply(response -> response.body());
}
+ /**
+ * Creates a location.
+ * Creating new locations allows for separate configuration of receipt layouts, item prices,
+ * and sales reports. Developers can use locations to separate sales activity through applications
+ * that integrate with Square from sales activity elsewhere in a seller's account.
+ * Locations created programmatically with the Locations API last forever and
+ * are visible to the seller for their own management. Therefore, ensure that
+ * each location has a sensible and unique name.
+ */
+ public CompletableFuture create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Creates a location.
* Creating new locations allows for separate configuration of receipt layouts, item prices,
diff --git a/src/main/java/com/squareup/square/AsyncLoyaltyClient.java b/src/main/java/com/squareup/square/AsyncLoyaltyClient.java
index 574c6516..73603e68 100644
--- a/src/main/java/com/squareup/square/AsyncLoyaltyClient.java
+++ b/src/main/java/com/squareup/square/AsyncLoyaltyClient.java
@@ -52,6 +52,18 @@ public CompletableFuture searchEvents() {
return this.rawClient.searchEvents().thenApply(response -> response.body());
}
+ /**
+ * Searches for loyalty events.
+ * A Square loyalty program maintains a ledger of events that occur during the lifetime of a
+ * buyer's loyalty account. Each change in the point balance
+ * (for example, points earned, points redeemed, and points expired) is
+ * 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(RequestOptions requestOptions) {
+ return this.rawClient.searchEvents(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches for loyalty events.
* A Square loyalty program maintains a ledger of events that occur during the lifetime of a
diff --git a/src/main/java/com/squareup/square/AsyncMerchantsClient.java b/src/main/java/com/squareup/square/AsyncMerchantsClient.java
index 9394fca5..9406ac8a 100644
--- a/src/main/java/com/squareup/square/AsyncMerchantsClient.java
+++ b/src/main/java/com/squareup/square/AsyncMerchantsClient.java
@@ -54,6 +54,20 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Provides details about the merchant associated with a given access token.
+ * The access token used to connect your application to a Square seller is associated
+ * with a single merchant. That means that ListMerchants returns a list
+ * with a single Merchant object. You can specify your personal access token
+ * to get your own merchant information or specify an OAuth token to get the
+ * information for the merchant that granted your application access.
+ * If you know the merchant ID, you can also use the RetrieveMerchant
+ * endpoint to retrieve the merchant information.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Provides details about the merchant associated with a given access token.
* The access token used to connect your application to a Square seller is associated
diff --git a/src/main/java/com/squareup/square/AsyncMobileClient.java b/src/main/java/com/squareup/square/AsyncMobileClient.java
index 0ed850de..1004e78d 100644
--- a/src/main/java/com/squareup/square/AsyncMobileClient.java
+++ b/src/main/java/com/squareup/square/AsyncMobileClient.java
@@ -5,8 +5,6 @@
import com.squareup.square.core.ClientOptions;
import com.squareup.square.core.RequestOptions;
-import com.squareup.square.types.CreateMobileAuthorizationCodeRequest;
-import com.squareup.square.types.CreateMobileAuthorizationCodeResponse;
import java.util.concurrent.CompletableFuture;
public class AsyncMobileClient {
@@ -26,50 +24,11 @@ public AsyncRawMobileClient withRawResponse() {
return this.rawClient;
}
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- *
Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CompletableFuture authorizationCode() {
+ public CompletableFuture authorizationCode() {
return this.rawClient.authorizationCode().thenApply(response -> response.body());
}
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- * Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CompletableFuture authorizationCode(
- CreateMobileAuthorizationCodeRequest request) {
- return this.rawClient.authorizationCode(request).thenApply(response -> response.body());
- }
-
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- * Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CompletableFuture authorizationCode(
- CreateMobileAuthorizationCodeRequest request, RequestOptions requestOptions) {
- return this.rawClient.authorizationCode(request, requestOptions).thenApply(response -> response.body());
+ public CompletableFuture authorizationCode(RequestOptions requestOptions) {
+ return this.rawClient.authorizationCode(requestOptions).thenApply(response -> response.body());
}
}
diff --git a/src/main/java/com/squareup/square/AsyncOAuthClient.java b/src/main/java/com/squareup/square/AsyncOAuthClient.java
index 5c6e2ce7..ffe68f17 100644
--- a/src/main/java/com/squareup/square/AsyncOAuthClient.java
+++ b/src/main/java/com/squareup/square/AsyncOAuthClient.java
@@ -44,6 +44,21 @@ public CompletableFuture revokeToken() {
return this.rawClient.revokeToken().thenApply(response -> response.body());
}
+ /**
+ * Revokes an access token generated with the OAuth flow.
+ * If an account has more than one OAuth access token for your application, this
+ * endpoint revokes all of them, regardless of which token you specify.
+ * Important: The Authorization header for this endpoint must have the
+ * following format:
+ * Authorization: Client APPLICATION_SECRET
+ *
+ * Replace APPLICATION_SECRET with the application secret on the OAuth
+ * page for your application in the Developer Dashboard.
+ */
+ public CompletableFuture revokeToken(RequestOptions requestOptions) {
+ return this.rawClient.revokeToken(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Revokes an access token generated with the OAuth flow.
* If an account has more than one OAuth access token for your application, this
diff --git a/src/main/java/com/squareup/square/AsyncOrdersClient.java b/src/main/java/com/squareup/square/AsyncOrdersClient.java
index c614e34f..52e6fc46 100644
--- a/src/main/java/com/squareup/square/AsyncOrdersClient.java
+++ b/src/main/java/com/squareup/square/AsyncOrdersClient.java
@@ -62,6 +62,17 @@ public CompletableFuture create() {
return this.rawClient.create().thenApply(response -> response.body());
}
+ /**
+ * Creates a new order that can include information about products for
+ * purchase and settings to apply to the purchase.
+ * To pay for a created order, see
+ * Pay for Orders.
+ * You can modify open orders using the UpdateOrder endpoint.
+ */
+ public CompletableFuture create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Creates a new order that can include information about products for
* purchase and settings to apply to the purchase.
@@ -152,6 +163,26 @@ public CompletableFuture search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Search all orders for one or more locations. Orders include all sales,
+ * returns, and exchanges regardless of how or when they entered the Square
+ * ecosystem (such as Point of Sale, Invoices, and Connect APIs).
+ * SearchOrders requests need to specify which locations to search and define a
+ * SearchOrdersQuery object that controls
+ * how to sort or filter the results. Your SearchOrdersQuery can:
+ * Set filter criteria.
+ * Set the sort order.
+ * Determine whether to return results as complete Order objects or as
+ * OrderEntry objects.
+ * Note that details for orders processed with Square Point of Sale while in
+ * offline mode might not be transmitted to Square for up to 72 hours. Offline
+ * 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(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Search all orders for one or more locations. Orders include all sales,
* returns, and exchanges regardless of how or when they entered the Square
diff --git a/src/main/java/com/squareup/square/AsyncPaymentsClient.java b/src/main/java/com/squareup/square/AsyncPaymentsClient.java
index 213aa59e..d79ac6db 100644
--- a/src/main/java/com/squareup/square/AsyncPaymentsClient.java
+++ b/src/main/java/com/squareup/square/AsyncPaymentsClient.java
@@ -49,6 +49,16 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Retrieves a list of payments taken by the account making the request.
+ * Results are eventually consistent, and new payments or changes to payments might take several
+ * seconds to appear.
+ * The maximum results per page is 100.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieves a list of payments taken by the account making the request.
* Results are eventually consistent, and new payments or changes to payments might take several
diff --git a/src/main/java/com/squareup/square/AsyncPayoutsClient.java b/src/main/java/com/squareup/square/AsyncPayoutsClient.java
index 29a882dd..4268fe59 100644
--- a/src/main/java/com/squareup/square/AsyncPayoutsClient.java
+++ b/src/main/java/com/squareup/square/AsyncPayoutsClient.java
@@ -40,6 +40,15 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Retrieves a list of all payouts for the default location.
+ * You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
+ * To call this endpoint, set PAYOUTS_READ for the OAuth scope.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieves a list of all payouts for the default location.
* You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
diff --git a/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java b/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java
index 94ad3043..93c04a34 100644
--- a/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawBankAccountsClient.java
@@ -3,7 +3,9 @@
*/
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;
@@ -12,6 +14,10 @@
import com.squareup.square.core.SquareException;
import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BankAccount;
+import com.squareup.square.types.CreateBankAccountRequest;
+import com.squareup.square.types.CreateBankAccountResponse;
+import com.squareup.square.types.DisableBankAccountRequest;
+import com.squareup.square.types.DisableBankAccountResponse;
import com.squareup.square.types.GetBankAccountByV1IdResponse;
import com.squareup.square.types.GetBankAccountResponse;
import com.squareup.square.types.GetBankAccountsRequest;
@@ -30,6 +36,7 @@
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
+import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
import org.jetbrains.annotations.NotNull;
@@ -48,6 +55,14 @@ public CompletableFutureBankAccount objects linked to a Square account.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListBankAccountsRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a list of BankAccount objects linked to a Square account.
*/
@@ -76,6 +91,10 @@ public CompletableFuture> createBankAccount(
+ CreateBankAccountRequest request) {
+ return createBankAccount(request, null);
+ }
+
+ /**
+ * Store a bank account on file for a square account
+ */
+ public CompletableFuture> createBankAccount(
+ CreateBankAccountRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/bank-accounts")
+ .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()) {
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, CreateBankAccountResponse.class),
+ response));
+ return;
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, 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;
+ }
+
/**
* Returns details of a BankAccount identified by V1 bank account ID.
*/
@@ -192,16 +276,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
}
/**
- * Returns details of a BankAccount
- * linked to a Square account.
+ * Retrieve details of a BankAccount bank account linked to a Square account.
*/
public CompletableFuture> get(GetBankAccountsRequest request) {
return get(request, null);
}
/**
- * Returns details of a BankAccount
- * linked to a Square account.
+ * Retrieve details of a BankAccount bank account linked to a Square account.
*/
public CompletableFuture> get(
GetBankAccountsRequest request, RequestOptions requestOptions) {
@@ -248,4 +330,63 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
});
return future;
}
+
+ /**
+ * Disable a bank account.
+ */
+ public CompletableFuture> disableBankAccount(
+ DisableBankAccountRequest request) {
+ return disableBankAccount(request, null);
+ }
+
+ /**
+ * Disable a bank account.
+ */
+ public CompletableFuture> disableBankAccount(
+ DisableBankAccountRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/bank-accounts")
+ .addPathSegment(request.getBankAccountId())
+ .addPathSegments("disable")
+ .build();
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", RequestBody.create("", 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()) {
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ future.complete(new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(
+ responseBodyString, DisableBankAccountResponse.class),
+ response));
+ return;
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ future.completeExceptionally(new SquareApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, 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/AsyncRawBookingsClient.java b/src/main/java/com/squareup/square/AsyncRawBookingsClient.java
index 1216b65b..387e78ec 100644
--- a/src/main/java/com/squareup/square/AsyncRawBookingsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawBookingsClient.java
@@ -66,6 +66,16 @@ public CompletableFuture>>
return list(ListBookingsRequest.builder().build());
}
+ /**
+ * Retrieve a collection of bookings.
+ * To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
+ * To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for the OAuth scope.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListBookingsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieve a collection of bookings.
* To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
diff --git a/src/main/java/com/squareup/square/AsyncRawCardsClient.java b/src/main/java/com/squareup/square/AsyncRawCardsClient.java
index b4368aad..f34826cb 100644
--- a/src/main/java/com/squareup/square/AsyncRawCardsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCardsClient.java
@@ -54,6 +54,14 @@ public CompletableFuture>> lis
return list(ListCardsRequest.builder().build());
}
+ /**
+ * Retrieves a list of cards owned by the account making the request.
+ * A max of 25 cards will be returned.
+ */
+ public CompletableFuture>> list(RequestOptions requestOptions) {
+ return list(ListCardsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieves a list of cards owned by the account making the request.
* A max of 25 cards will be returned.
diff --git a/src/main/java/com/squareup/square/AsyncRawCatalogClient.java b/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
index d65f7705..290ef2de 100644
--- a/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCatalogClient.java
@@ -374,6 +374,19 @@ public CompletableFutureCatalogObjects of the specified types in the catalog.
+ * The types parameter is specified as a comma-separated list of the CatalogObjectType values,
+ * for example, "ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX, IMAGE".
+ * Important: ListCatalog does not return deleted catalog items. To retrieve
+ * deleted catalog items, use SearchCatalogObjects
+ * and set the include_deleted_objects attribute value to true.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListCatalogRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a list of all CatalogObjects of the specified types in the catalog.
* The types parameter is specified as a comma-separated list of the CatalogObjectType values,
@@ -485,6 +498,23 @@ public CompletableFuture>
return search(SearchCatalogObjectsRequest.builder().build());
}
+ /**
+ * Searches for CatalogObject of any type by matching supported search attribute values,
+ * excluding custom attribute values on items or item variations, against one or more of the specified query filters.
+ * This (SearchCatalogObjects) endpoint differs from the SearchCatalogItems
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints have different call conventions, including the query filter formats.
+ *
+ */
+ public CompletableFuture> search(
+ RequestOptions requestOptions) {
+ return search(SearchCatalogObjectsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for CatalogObject of any type by matching supported search attribute values,
* excluding custom attribute values on items or item variations, against one or more of the specified query filters.
@@ -584,6 +614,23 @@ public CompletableFuture> s
return searchItems(SearchCatalogItemsRequest.builder().build());
}
+ /**
+ * Searches for catalog items or item variations by matching supported search attribute values, including
+ * custom attribute values, against one or more of the specified query filters.
+ * This (SearchCatalogItems) endpoint differs from the SearchCatalogObjects
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints use different call conventions, including the query filter formats.
+ *
+ */
+ public CompletableFuture> searchItems(
+ RequestOptions requestOptions) {
+ return searchItems(SearchCatalogItemsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for catalog items or item variations by matching supported search attribute values, including
* custom attribute values, against one or more of the specified query filters.
diff --git a/src/main/java/com/squareup/square/AsyncRawChannelsClient.java b/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
index 9ca8fc0b..0beb2ce8 100644
--- a/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawChannelsClient.java
@@ -48,6 +48,11 @@ public CompletableFuture>>
return list(ListChannelsRequest.builder().build());
}
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListChannelsRequest.builder().build(), requestOptions);
+ }
+
public CompletableFuture>> list(ListChannelsRequest request) {
return list(request, null);
}
diff --git a/src/main/java/com/squareup/square/AsyncRawCustomersClient.java b/src/main/java/com/squareup/square/AsyncRawCustomersClient.java
index 13a0b377..3746ac58 100644
--- a/src/main/java/com/squareup/square/AsyncRawCustomersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawCustomersClient.java
@@ -68,6 +68,17 @@ public CompletableFuture>>
return list(ListCustomersRequest.builder().build());
}
+ /**
+ * Lists customer profiles associated with a Square account.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * for the listing 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>> list(
+ RequestOptions requestOptions) {
+ return list(ListCustomersRequest.builder().build(), requestOptions);
+ }
+
/**
* Lists customer profiles associated with a Square account.
* Under normal operating conditions, newly created or updated customer profiles become available
@@ -182,6 +193,22 @@ public CompletableFuture> creat
return create(CreateCustomerRequest.builder().build());
}
+ /**
+ * Creates a new customer for a business.
+ * You must provide at least one of the following values in your request to this
+ * endpoint:
+ *
+ * given_name
+ * family_name
+ * company_name
+ * email_address
+ * phone_number
+ *
+ */
+ public CompletableFuture> create(RequestOptions requestOptions) {
+ return create(CreateCustomerRequest.builder().build(), requestOptions);
+ }
+
/**
* Creates a new customer for a business.
* You must provide at least one of the following values in your request to this
@@ -560,6 +587,19 @@ public CompletableFuture> sear
return search(SearchCustomersRequest.builder().build());
}
+ /**
+ * Searches the customer profiles associated with a Square account using one or more supported query filters.
+ * Calling SearchCustomers without any explicit query filter returns all
+ * customer profiles ordered alphabetically based on given_name and
+ * family_name.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * 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(RequestOptions requestOptions) {
+ return search(SearchCustomersRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches the customer profiles associated with a Square account using one or more supported query filters.
* Calling SearchCustomers without any explicit query filter returns all
diff --git a/src/main/java/com/squareup/square/AsyncRawDevicesClient.java b/src/main/java/com/squareup/square/AsyncRawDevicesClient.java
index fbf38cb8..5dc7fd67 100644
--- a/src/main/java/com/squareup/square/AsyncRawDevicesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawDevicesClient.java
@@ -47,6 +47,14 @@ public CompletableFuture>> l
return list(ListDevicesRequest.builder().build());
}
+ /**
+ * List devices associated with the merchant. Currently, only Terminal API
+ * devices are supported.
+ */
+ public CompletableFuture>> list(RequestOptions requestOptions) {
+ return list(ListDevicesRequest.builder().build(), requestOptions);
+ }
+
/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
diff --git a/src/main/java/com/squareup/square/AsyncRawDisputesClient.java b/src/main/java/com/squareup/square/AsyncRawDisputesClient.java
index c6a8e53d..a32662d8 100644
--- a/src/main/java/com/squareup/square/AsyncRawDisputesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawDisputesClient.java
@@ -60,6 +60,14 @@ public CompletableFuture>>
return list(ListDisputesRequest.builder().build());
}
+ /**
+ * Returns a list of disputes associated with a particular account.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListDisputesRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a list of disputes associated with a particular account.
*/
diff --git a/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java b/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java
index 43f269f1..af975ef0 100644
--- a/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawEmployeesClient.java
@@ -43,6 +43,11 @@ public CompletableFuture>>
return list(ListEmployeesRequest.builder().build());
}
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListEmployeesRequest.builder().build(), requestOptions);
+ }
+
public CompletableFuture>> list(
ListEmployeesRequest request) {
return list(request, null);
diff --git a/src/main/java/com/squareup/square/AsyncRawEventsClient.java b/src/main/java/com/squareup/square/AsyncRawEventsClient.java
index dd4c3eb6..3aac832c 100644
--- a/src/main/java/com/squareup/square/AsyncRawEventsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawEventsClient.java
@@ -45,6 +45,14 @@ public CompletableFuture> searchE
return searchEvents(SearchEventsRequest.builder().build());
}
+ /**
+ * Search for Square API events that occur within a 28-day timeframe.
+ */
+ public CompletableFuture> searchEvents(
+ RequestOptions requestOptions) {
+ return searchEvents(SearchEventsRequest.builder().build(), requestOptions);
+ }
+
/**
* Search for Square API events that occur within a 28-day timeframe.
*/
@@ -229,6 +237,14 @@ public CompletableFuture> listE
return listEventTypes(ListEventTypesRequest.builder().build());
}
+ /**
+ * Lists all event types that you can subscribe to as webhooks or query using the Events API.
+ */
+ public CompletableFuture> listEventTypes(
+ RequestOptions requestOptions) {
+ return listEventTypes(ListEventTypesRequest.builder().build(), requestOptions);
+ }
+
/**
* Lists all event types that you can subscribe to as webhooks or query using the Events API.
*/
diff --git a/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java b/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java
index 00ae0015..728ec6c0 100644
--- a/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawGiftCardsClient.java
@@ -60,6 +60,15 @@ public CompletableFuture>>
return list(ListGiftCardsRequest.builder().build());
}
+ /**
+ * Lists all gift cards. You can specify optional filters to retrieve
+ * a subset of the gift cards. Results are sorted by created_at in ascending order.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListGiftCardsRequest.builder().build(), requestOptions);
+ }
+
/**
* Lists all gift cards. You can specify optional filters to retrieve
* a subset of the gift cards. Results are sorted by created_at in ascending order.
diff --git a/src/main/java/com/squareup/square/AsyncRawInventoryClient.java b/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
index 6de8d935..17795c1a 100644
--- a/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawInventoryClient.java
@@ -253,6 +253,16 @@ public CompletableFutureBatchRetrieveInventoryChanges after the endpoint URL
+ * is updated to conform to the standard convention.
+ */
+ public CompletableFuture> deprecatedBatchGetChanges(
+ RequestOptions requestOptions) {
+ return deprecatedBatchGetChanges(
+ BatchRetrieveInventoryChangesRequest.builder().build(), requestOptions);
+ }
+
/**
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
@@ -329,6 +339,15 @@ public CompletableFutureBatchRetrieveInventoryCounts after the endpoint URL
+ * is updated to conform to the standard convention.
+ */
+ public CompletableFuture> deprecatedBatchGetCounts(
+ RequestOptions requestOptions) {
+ return deprecatedBatchGetCounts(BatchGetInventoryCountsRequest.builder().build(), requestOptions);
+ }
+
/**
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
@@ -479,6 +498,19 @@ public CompletableFutureResults are paginated and sorted in ascending order according their
+ * occurred_at timestamp (oldest first).
+ * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries
+ * that cannot be handled by other, simpler endpoints.
+ */
+ public CompletableFuture>> batchGetChanges(
+ RequestOptions requestOptions) {
+ return batchGetChanges(BatchRetrieveInventoryChangesRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns historical physical counts and adjustments based on the
* provided filter criteria.
@@ -588,6 +620,22 @@ public CompletableFutureCatalogObjects at the requested
+ * Locations.
+ * Results are paginated and sorted in descending order according to their
+ * calculated_at timestamp (newest first).
+ * When updated_after is specified, only counts that have changed since that
+ * time (based on the server timestamp for the most recent change) are
+ * returned. This allows clients to perform a "sync" operation, for example
+ * in response to receiving a Webhook notification.
+ */
+ public CompletableFuture>> batchGetCounts(
+ RequestOptions requestOptions) {
+ return batchGetCounts(BatchGetInventoryCountsRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns current counts for the provided
* CatalogObjects at the requested
diff --git a/src/main/java/com/squareup/square/AsyncRawLaborClient.java b/src/main/java/com/squareup/square/AsyncRawLaborClient.java
index 83fe68d1..39757426 100644
--- a/src/main/java/com/squareup/square/AsyncRawLaborClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawLaborClient.java
@@ -216,6 +216,15 @@ public CompletableFuture
return searchScheduledShifts(SearchScheduledShiftsRequest.builder().build());
}
+ /**
+ * Returns a paginated list of scheduled shifts, with optional filter and sort settings.
+ * By default, results are sorted by start_at in ascending order.
+ */
+ public CompletableFuture> searchScheduledShifts(
+ RequestOptions requestOptions) {
+ return searchScheduledShifts(SearchScheduledShiftsRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a paginated list of scheduled shifts, with optional filter and sort settings.
* By default, results are sorted by start_at in ascending order.
@@ -619,6 +628,30 @@ public CompletableFuture> sear
return searchTimecards(SearchTimecardsRequest.builder().build());
}
+ /**
+ * Returns a paginated list of Timecard records for a business.
+ * The list to be returned can be filtered by:
+ *
+ * - Location IDs
+ * - Team member IDs
+ * - Timecard status (
OPEN or CLOSED)
+ * - Timecard start
+ * - Timecard end
+ * - Workday details
+ *
+ * The list can be sorted by:
+ *
+ * START_AT
+ * END_AT
+ * CREATED_AT
+ * UPDATED_AT
+ *
+ */
+ public CompletableFuture> searchTimecards(
+ RequestOptions requestOptions) {
+ return searchTimecards(SearchTimecardsRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a paginated list of Timecard records for a business.
* The list to be returned can be filtered by:
diff --git a/src/main/java/com/squareup/square/AsyncRawLocationsClient.java b/src/main/java/com/squareup/square/AsyncRawLocationsClient.java
index 553bd8b3..82187940 100644
--- a/src/main/java/com/squareup/square/AsyncRawLocationsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawLocationsClient.java
@@ -109,6 +109,19 @@ public CompletableFuture> creat
return create(CreateLocationRequest.builder().build());
}
+ /**
+ * Creates a location.
+ * Creating new locations allows for separate configuration of receipt layouts, item prices,
+ * and sales reports. Developers can use locations to separate sales activity through applications
+ * that integrate with Square from sales activity elsewhere in a seller's account.
+ * Locations created programmatically with the Locations API last forever and
+ * are visible to the seller for their own management. Therefore, ensure that
+ * each location has a sensible and unique name.
+ */
+ public CompletableFuture> create(RequestOptions requestOptions) {
+ return create(CreateLocationRequest.builder().build(), requestOptions);
+ }
+
/**
* Creates a location.
* Creating new locations allows for separate configuration of receipt layouts, item prices,
diff --git a/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java b/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java
index aa31a3d1..6e9a24a1 100644
--- a/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawLoyaltyClient.java
@@ -45,6 +45,19 @@ public CompletableFuture>
return searchEvents(SearchLoyaltyEventsRequest.builder().build());
}
+ /**
+ * Searches for loyalty events.
+ * A Square loyalty program maintains a ledger of events that occur during the lifetime of a
+ * buyer's loyalty account. Each change in the point balance
+ * (for example, points earned, points redeemed, and points expired) is
+ * 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(
+ RequestOptions requestOptions) {
+ return searchEvents(SearchLoyaltyEventsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for loyalty events.
* A Square loyalty program maintains a ledger of events that occur during the lifetime of a
diff --git a/src/main/java/com/squareup/square/AsyncRawMerchantsClient.java b/src/main/java/com/squareup/square/AsyncRawMerchantsClient.java
index 7683af5d..d62e1267 100644
--- a/src/main/java/com/squareup/square/AsyncRawMerchantsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawMerchantsClient.java
@@ -53,6 +53,21 @@ public CompletableFuture>>
return list(ListMerchantsRequest.builder().build());
}
+ /**
+ * Provides details about the merchant associated with a given access token.
+ * The access token used to connect your application to a Square seller is associated
+ * with a single merchant. That means that ListMerchants returns a list
+ * with a single Merchant object. You can specify your personal access token
+ * to get your own merchant information or specify an OAuth token to get the
+ * information for the merchant that granted your application access.
+ * If you know the merchant ID, you can also use the RetrieveMerchant
+ * endpoint to retrieve the merchant information.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListMerchantsRequest.builder().build(), requestOptions);
+ }
+
/**
* Provides details about the merchant associated with a given access token.
* The access token used to connect your application to a Square seller is associated
diff --git a/src/main/java/com/squareup/square/AsyncRawMobileClient.java b/src/main/java/com/squareup/square/AsyncRawMobileClient.java
index c6a5831b..1d22f7a5 100644
--- a/src/main/java/com/squareup/square/AsyncRawMobileClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawMobileClient.java
@@ -3,16 +3,12 @@
*/
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.RequestOptions;
import com.squareup.square.core.SquareApiException;
import com.squareup.square.core.SquareClientHttpResponse;
import com.squareup.square.core.SquareException;
-import com.squareup.square.types.CreateMobileAuthorizationCodeRequest;
-import com.squareup.square.types.CreateMobileAuthorizationCodeResponse;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import okhttp3.Call;
@@ -33,86 +29,34 @@ public AsyncRawMobileClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
}
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- *
Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CompletableFuture> authorizationCode() {
- return authorizationCode(CreateMobileAuthorizationCodeRequest.builder().build());
+ public CompletableFuture> authorizationCode() {
+ return authorizationCode(null);
}
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- * Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CompletableFuture> authorizationCode(
- CreateMobileAuthorizationCodeRequest request) {
- return authorizationCode(request, null);
- }
-
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- * Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CompletableFuture> authorizationCode(
- CreateMobileAuthorizationCodeRequest request, RequestOptions requestOptions) {
+ public CompletableFuture> authorizationCode(RequestOptions requestOptions) {
HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("mobile/authorization-code")
.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)
+ .method("POST", RequestBody.create("", null))
.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<>();
+ 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()) {
- String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
- future.complete(new SquareClientHttpResponse<>(
- ObjectMappers.JSON_MAPPER.readValue(
- responseBodyString, CreateMobileAuthorizationCodeResponse.class),
- response));
+ future.complete(new SquareClientHttpResponse<>(null, response));
return;
}
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
future.completeExceptionally(new SquareApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
diff --git a/src/main/java/com/squareup/square/AsyncRawOAuthClient.java b/src/main/java/com/squareup/square/AsyncRawOAuthClient.java
index f05fe7e6..9d96fd9c 100644
--- a/src/main/java/com/squareup/square/AsyncRawOAuthClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawOAuthClient.java
@@ -51,6 +51,21 @@ public CompletableFuture> revokeTo
return revokeToken(RevokeTokenRequest.builder().build());
}
+ /**
+ * Revokes an access token generated with the OAuth flow.
+ * If an account has more than one OAuth access token for your application, this
+ * endpoint revokes all of them, regardless of which token you specify.
+ * Important: The Authorization header for this endpoint must have the
+ * following format:
+ * Authorization: Client APPLICATION_SECRET
+ *
+ * Replace APPLICATION_SECRET with the application secret on the OAuth
+ * page for your application in the Developer Dashboard.
+ */
+ public CompletableFuture> revokeToken(RequestOptions requestOptions) {
+ return revokeToken(RevokeTokenRequest.builder().build(), requestOptions);
+ }
+
/**
* Revokes an access token generated with the OAuth flow.
* If an account has more than one OAuth access token for your application, this
diff --git a/src/main/java/com/squareup/square/AsyncRawOrdersClient.java b/src/main/java/com/squareup/square/AsyncRawOrdersClient.java
index 990b8541..7704a402 100644
--- a/src/main/java/com/squareup/square/AsyncRawOrdersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawOrdersClient.java
@@ -58,6 +58,17 @@ public CompletableFuture> create()
return create(CreateOrderRequest.builder().build());
}
+ /**
+ * Creates a new order that can include information about products for
+ * purchase and settings to apply to the purchase.
+ * To pay for a created order, see
+ * Pay for Orders.
+ * You can modify open orders using the UpdateOrder endpoint.
+ */
+ public CompletableFuture> create(RequestOptions requestOptions) {
+ return create(CreateOrderRequest.builder().build(), requestOptions);
+ }
+
/**
* Creates a new order that can include information about products for
* purchase and settings to apply to the purchase.
@@ -343,6 +354,26 @@ public CompletableFuture> search(
return search(SearchOrdersRequest.builder().build());
}
+ /**
+ * Search all orders for one or more locations. Orders include all sales,
+ * returns, and exchanges regardless of how or when they entered the Square
+ * ecosystem (such as Point of Sale, Invoices, and Connect APIs).
+ * SearchOrders requests need to specify which locations to search and define a
+ * SearchOrdersQuery object that controls
+ * how to sort or filter the results. Your SearchOrdersQuery can:
+ * Set filter criteria.
+ * Set the sort order.
+ * Determine whether to return results as complete Order objects or as
+ * OrderEntry objects.
+ * Note that details for orders processed with Square Point of Sale while in
+ * offline mode might not be transmitted to Square for up to 72 hours. Offline
+ * 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(RequestOptions requestOptions) {
+ return search(SearchOrdersRequest.builder().build(), requestOptions);
+ }
+
/**
* Search all orders for one or more locations. Orders include all sales,
* returns, and exchanges regardless of how or when they entered the Square
diff --git a/src/main/java/com/squareup/square/AsyncRawPaymentsClient.java b/src/main/java/com/squareup/square/AsyncRawPaymentsClient.java
index 7b191908..7409b66c 100644
--- a/src/main/java/com/squareup/square/AsyncRawPaymentsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawPaymentsClient.java
@@ -62,6 +62,17 @@ public CompletableFuture>>
return list(ListPaymentsRequest.builder().build());
}
+ /**
+ * Retrieves a list of payments taken by the account making the request.
+ * Results are eventually consistent, and new payments or changes to payments might take several
+ * seconds to appear.
+ * The maximum results per page is 100.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListPaymentsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieves a list of payments taken by the account making the request.
* Results are eventually consistent, and new payments or changes to payments might take several
diff --git a/src/main/java/com/squareup/square/AsyncRawPayoutsClient.java b/src/main/java/com/squareup/square/AsyncRawPayoutsClient.java
index ff14e1d8..c652bbaf 100644
--- a/src/main/java/com/squareup/square/AsyncRawPayoutsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawPayoutsClient.java
@@ -51,6 +51,15 @@ public CompletableFuture>> l
return list(ListPayoutsRequest.builder().build());
}
+ /**
+ * Retrieves a list of all payouts for the default location.
+ * You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
+ * To call this endpoint, set PAYOUTS_READ for the OAuth scope.
+ */
+ public CompletableFuture>> list(RequestOptions requestOptions) {
+ return list(ListPayoutsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieves a list of all payouts for the default location.
* You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
diff --git a/src/main/java/com/squareup/square/AsyncRawRefundsClient.java b/src/main/java/com/squareup/square/AsyncRawRefundsClient.java
index af462e63..5b19892b 100644
--- a/src/main/java/com/squareup/square/AsyncRawRefundsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawRefundsClient.java
@@ -54,6 +54,17 @@ public CompletableFutureResults are eventually consistent, and new refunds or changes to refunds might take several
+ * seconds to appear.
+ * The maximum results per page is 100.
+ */
+ public CompletableFuture>> list(
+ RequestOptions requestOptions) {
+ return list(ListRefundsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieves a list of refunds for the account making the request.
* Results are eventually consistent, and new refunds or changes to refunds might take several
diff --git a/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java b/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java
index d43b19c2..eb59092f 100644
--- a/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawSubscriptionsClient.java
@@ -220,6 +220,25 @@ public CompletableFuture>
return search(SearchSubscriptionsRequest.builder().build());
}
+ /**
+ * Searches for subscriptions.
+ * Results are ordered chronologically by subscription creation date. If
+ * the request specifies more than one location ID,
+ * the endpoint orders the result
+ * by location ID, and then by creation date within each location. If no locations are given
+ * in the query, all locations are searched.
+ * You can also optionally specify customer_ids to search by customer.
+ * If left unset, all customers
+ * associated with the specified locations are returned.
+ * If the request specifies customer IDs, the endpoint orders results
+ * first by location, within location by customer ID, and within
+ * customer by subscription creation date.
+ */
+ public CompletableFuture> search(
+ RequestOptions requestOptions) {
+ return search(SearchSubscriptionsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for subscriptions.
* Results are ordered chronologically by subscription creation date. If
diff --git a/src/main/java/com/squareup/square/AsyncRawTeamClient.java b/src/main/java/com/squareup/square/AsyncRawTeamClient.java
index ac794200..17cd6cb5 100644
--- a/src/main/java/com/squareup/square/AsyncRawTeamClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawTeamClient.java
@@ -47,6 +47,13 @@ public CompletableFuture> listJobs()
return listJobs(ListJobsRequest.builder().build());
}
+ /**
+ * Lists jobs in a seller account. Results are sorted by title in ascending order.
+ */
+ public CompletableFuture> listJobs(RequestOptions requestOptions) {
+ return listJobs(ListJobsRequest.builder().build(), requestOptions);
+ }
+
/**
* Lists jobs in a seller account. Results are sorted by title in ascending order.
*/
diff --git a/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java b/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java
index ee010008..5dd4b1cf 100644
--- a/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawTeamMembersClient.java
@@ -56,6 +56,19 @@ public CompletableFuture> cre
return create(CreateTeamMemberRequest.builder().build());
}
+ /**
+ * Creates a single TeamMember object. The TeamMember object is returned on successful creates.
+ * You must provide the following values in your request to this endpoint:
+ *
+ * given_name
+ * family_name
+ *
+ * Learn about Troubleshooting the Team API.
+ */
+ public CompletableFuture> create(RequestOptions requestOptions) {
+ return create(CreateTeamMemberRequest.builder().build(), requestOptions);
+ }
+
/**
* Creates a single TeamMember object. The TeamMember object is returned on successful creates.
* You must provide the following values in your request to this endpoint:
@@ -287,6 +300,16 @@ public CompletableFuture> se
return search(SearchTeamMembersRequest.builder().build());
}
+ /**
+ * Returns a paginated list of TeamMember objects for a business.
+ * 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(
+ RequestOptions requestOptions) {
+ return search(SearchTeamMembersRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a paginated list of TeamMember objects for a business.
* The list can be filtered by location IDs, ACTIVE or INACTIVE status, or whether
diff --git a/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java b/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java
index 467fc380..7a069cff 100644
--- a/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawTransferOrdersClient.java
@@ -171,6 +171,21 @@ public CompletableFutureTransferOrders sorted by creation date.
+ * Common search scenarios:
+ *
+ */
+ public CompletableFuture>> search(
+ RequestOptions requestOptions) {
+ return search(SearchTransferOrdersRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for transfer orders using filters. Returns a paginated list of matching
* TransferOrders sorted by creation date.
diff --git a/src/main/java/com/squareup/square/AsyncRawVendorsClient.java b/src/main/java/com/squareup/square/AsyncRawVendorsClient.java
index 349d95d6..c662f46e 100644
--- a/src/main/java/com/squareup/square/AsyncRawVendorsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRawVendorsClient.java
@@ -117,6 +117,14 @@ public CompletableFuture> batc
return batchGet(BatchGetVendorsRequest.builder().build());
}
+ /**
+ * Retrieves one or more vendors of specified Vendor IDs.
+ */
+ public CompletableFuture> batchGet(
+ RequestOptions requestOptions) {
+ return batchGet(BatchGetVendorsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieves one or more vendors of specified Vendor IDs.
*/
@@ -316,6 +324,13 @@ 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(RequestOptions requestOptions) {
+ return search(SearchVendorsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for vendors using a filter against supported Vendor properties and a supported sorter.
*/
diff --git a/src/main/java/com/squareup/square/AsyncRefundsClient.java b/src/main/java/com/squareup/square/AsyncRefundsClient.java
index 3abc0206..efae16b9 100644
--- a/src/main/java/com/squareup/square/AsyncRefundsClient.java
+++ b/src/main/java/com/squareup/square/AsyncRefundsClient.java
@@ -41,6 +41,16 @@ public CompletableFuture> list() {
return this.rawClient.list().thenApply(response -> response.body());
}
+ /**
+ * Retrieves a list of refunds for the account making the request.
+ * Results are eventually consistent, and new refunds or changes to refunds might take several
+ * seconds to appear.
+ * The maximum results per page is 100.
+ */
+ public CompletableFuture> list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieves a list of refunds for the account making the request.
* Results are eventually consistent, and new refunds or changes to refunds might take several
diff --git a/src/main/java/com/squareup/square/AsyncSquareClient.java b/src/main/java/com/squareup/square/AsyncSquareClient.java
index c78a23b4..32b618e7 100644
--- a/src/main/java/com/squareup/square/AsyncSquareClient.java
+++ b/src/main/java/com/squareup/square/AsyncSquareClient.java
@@ -12,8 +12,6 @@
public class AsyncSquareClient {
protected final ClientOptions clientOptions;
- protected final Supplier mobileClient;
-
protected final Supplier oAuthClient;
protected final Supplier v1TransactionsClient;
@@ -80,13 +78,14 @@ public class AsyncSquareClient {
protected final Supplier vendorsClient;
+ protected final Supplier mobileClient;
+
protected final Supplier cashDrawersClient;
protected final Supplier webhooksClient;
public AsyncSquareClient(ClientOptions clientOptions) {
this.clientOptions = clientOptions;
- this.mobileClient = Suppliers.memoize(() -> new AsyncMobileClient(clientOptions));
this.oAuthClient = Suppliers.memoize(() -> new AsyncOAuthClient(clientOptions));
this.v1TransactionsClient = Suppliers.memoize(() -> new AsyncV1TransactionsClient(clientOptions));
this.applePayClient = Suppliers.memoize(() -> new AsyncApplePayClient(clientOptions));
@@ -120,14 +119,11 @@ public AsyncSquareClient(ClientOptions clientOptions) {
this.terminalClient = Suppliers.memoize(() -> new AsyncTerminalClient(clientOptions));
this.transferOrdersClient = Suppliers.memoize(() -> new AsyncTransferOrdersClient(clientOptions));
this.vendorsClient = Suppliers.memoize(() -> new AsyncVendorsClient(clientOptions));
+ this.mobileClient = Suppliers.memoize(() -> new AsyncMobileClient(clientOptions));
this.cashDrawersClient = Suppliers.memoize(() -> new AsyncCashDrawersClient(clientOptions));
this.webhooksClient = Suppliers.memoize(() -> new AsyncWebhooksClient(clientOptions));
}
- public AsyncMobileClient mobile() {
- return this.mobileClient.get();
- }
-
public AsyncOAuthClient oAuth() {
return this.oAuthClient.get();
}
@@ -260,6 +256,10 @@ public AsyncVendorsClient vendors() {
return this.vendorsClient.get();
}
+ public AsyncMobileClient mobile() {
+ return this.mobileClient.get();
+ }
+
public AsyncCashDrawersClient cashDrawers() {
return this.cashDrawersClient.get();
}
diff --git a/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java b/src/main/java/com/squareup/square/AsyncSquareClientBuilder.java
index 2c0155a9..0bd04578 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-10-16";
+ private String version = "2026-01-22";
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..43db1a33 100644
--- a/src/main/java/com/squareup/square/AsyncSubscriptionsClient.java
+++ b/src/main/java/com/squareup/square/AsyncSubscriptionsClient.java
@@ -109,6 +109,24 @@ public CompletableFuture search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Searches for subscriptions.
+ * Results are ordered chronologically by subscription creation date. If
+ * the request specifies more than one location ID,
+ * the endpoint orders the result
+ * by location ID, and then by creation date within each location. If no locations are given
+ * in the query, all locations are searched.
+ * You can also optionally specify customer_ids to search by customer.
+ * If left unset, all customers
+ * associated with the specified locations are returned.
+ * If the request specifies customer IDs, the endpoint orders results
+ * first by location, within location by customer ID, and within
+ * customer by subscription creation date.
+ */
+ public CompletableFuture search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches for subscriptions.
* Results are ordered chronologically by subscription creation date. If
diff --git a/src/main/java/com/squareup/square/AsyncTeamClient.java b/src/main/java/com/squareup/square/AsyncTeamClient.java
index f087ca29..da9a9277 100644
--- a/src/main/java/com/squareup/square/AsyncTeamClient.java
+++ b/src/main/java/com/squareup/square/AsyncTeamClient.java
@@ -39,6 +39,13 @@ public CompletableFuture listJobs() {
return this.rawClient.listJobs().thenApply(response -> response.body());
}
+ /**
+ * Lists jobs in a seller account. Results are sorted by title in ascending order.
+ */
+ public CompletableFuture listJobs(RequestOptions requestOptions) {
+ return this.rawClient.listJobs(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Lists jobs in a seller account. Results are sorted by title in ascending order.
*/
diff --git a/src/main/java/com/squareup/square/AsyncTeamMembersClient.java b/src/main/java/com/squareup/square/AsyncTeamMembersClient.java
index 0c09eeb5..92e0a351 100644
--- a/src/main/java/com/squareup/square/AsyncTeamMembersClient.java
+++ b/src/main/java/com/squareup/square/AsyncTeamMembersClient.java
@@ -55,6 +55,19 @@ public CompletableFuture create() {
return this.rawClient.create().thenApply(response -> response.body());
}
+ /**
+ * Creates a single TeamMember object. The TeamMember object is returned on successful creates.
+ * You must provide the following values in your request to this endpoint:
+ *
+ * given_name
+ * family_name
+ *
+ * Learn about Troubleshooting the Team API.
+ */
+ public CompletableFuture create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Creates a single TeamMember object. The TeamMember object is returned on successful creates.
* You must provide the following values in your request to this endpoint:
@@ -137,6 +150,15 @@ public CompletableFuture search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Returns a paginated list of TeamMember objects for a business.
+ * 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(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Returns a paginated list of TeamMember objects for a business.
* The list can be filtered by location IDs, ACTIVE or INACTIVE status, or whether
diff --git a/src/main/java/com/squareup/square/AsyncTransferOrdersClient.java b/src/main/java/com/squareup/square/AsyncTransferOrdersClient.java
index 356796b9..abeff934 100644
--- a/src/main/java/com/squareup/square/AsyncTransferOrdersClient.java
+++ b/src/main/java/com/squareup/square/AsyncTransferOrdersClient.java
@@ -108,6 +108,20 @@ public CompletableFuture> search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Searches for transfer orders using filters. Returns a paginated list of matching
+ * TransferOrders sorted by creation date.
+ * Common search scenarios:
+ *
+ */
+ public CompletableFuture> search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches for transfer orders using filters. Returns a paginated list of matching
* TransferOrders sorted by creation date.
diff --git a/src/main/java/com/squareup/square/AsyncVendorsClient.java b/src/main/java/com/squareup/square/AsyncVendorsClient.java
index 6d6f281a..6f789958 100644
--- a/src/main/java/com/squareup/square/AsyncVendorsClient.java
+++ b/src/main/java/com/squareup/square/AsyncVendorsClient.java
@@ -60,6 +60,13 @@ public CompletableFuture batchGet() {
return this.rawClient.batchGet().thenApply(response -> response.body());
}
+ /**
+ * Retrieves one or more vendors of specified Vendor IDs.
+ */
+ public CompletableFuture batchGet(RequestOptions requestOptions) {
+ return this.rawClient.batchGet(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Retrieves one or more vendors of specified Vendor IDs.
*/
@@ -111,6 +118,13 @@ public CompletableFuture search() {
return this.rawClient.search().thenApply(response -> response.body());
}
+ /**
+ * Searches for vendors using a filter against supported Vendor properties and a supported sorter.
+ */
+ public CompletableFuture search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).thenApply(response -> response.body());
+ }
+
/**
* Searches for vendors using a filter against supported Vendor properties and a supported sorter.
*/
diff --git a/src/main/java/com/squareup/square/BankAccountsClient.java b/src/main/java/com/squareup/square/BankAccountsClient.java
index 23cb3dda..e32a4911 100644
--- a/src/main/java/com/squareup/square/BankAccountsClient.java
+++ b/src/main/java/com/squareup/square/BankAccountsClient.java
@@ -7,6 +7,10 @@
import com.squareup.square.core.RequestOptions;
import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BankAccount;
+import com.squareup.square.types.CreateBankAccountRequest;
+import com.squareup.square.types.CreateBankAccountResponse;
+import com.squareup.square.types.DisableBankAccountRequest;
+import com.squareup.square.types.DisableBankAccountResponse;
import com.squareup.square.types.GetBankAccountByV1IdResponse;
import com.squareup.square.types.GetBankAccountResponse;
import com.squareup.square.types.GetBankAccountsRequest;
@@ -37,6 +41,13 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Returns a list of BankAccount objects linked to a Square account.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Returns a list of BankAccount objects linked to a Square account.
*/
@@ -51,6 +62,21 @@ public SyncPagingIterable list(ListBankAccountsRequest request, Req
return this.rawClient.list(request, requestOptions).body();
}
+ /**
+ * Store a bank account on file for a square account
+ */
+ public CreateBankAccountResponse createBankAccount(CreateBankAccountRequest request) {
+ return this.rawClient.createBankAccount(request).body();
+ }
+
+ /**
+ * Store a bank account on file for a square account
+ */
+ public CreateBankAccountResponse createBankAccount(
+ CreateBankAccountRequest request, RequestOptions requestOptions) {
+ return this.rawClient.createBankAccount(request, requestOptions).body();
+ }
+
/**
* Returns details of a BankAccount identified by V1 bank account ID.
*/
@@ -66,18 +92,31 @@ public GetBankAccountByV1IdResponse getByV1Id(GetByV1IdBankAccountsRequest reque
}
/**
- * Returns details of a BankAccount
- * linked to a Square account.
+ * Retrieve details of a BankAccount bank account linked to a Square account.
*/
public GetBankAccountResponse get(GetBankAccountsRequest request) {
return this.rawClient.get(request).body();
}
/**
- * Returns details of a BankAccount
- * linked to a Square account.
+ * Retrieve details of a BankAccount bank account linked to a Square account.
*/
public GetBankAccountResponse get(GetBankAccountsRequest request, RequestOptions requestOptions) {
return this.rawClient.get(request, requestOptions).body();
}
+
+ /**
+ * Disable a bank account.
+ */
+ public DisableBankAccountResponse disableBankAccount(DisableBankAccountRequest request) {
+ return this.rawClient.disableBankAccount(request).body();
+ }
+
+ /**
+ * Disable a bank account.
+ */
+ public DisableBankAccountResponse disableBankAccount(
+ DisableBankAccountRequest request, RequestOptions requestOptions) {
+ return this.rawClient.disableBankAccount(request, requestOptions).body();
+ }
}
diff --git a/src/main/java/com/squareup/square/BookingsClient.java b/src/main/java/com/squareup/square/BookingsClient.java
index 862002f5..44f5edf4 100644
--- a/src/main/java/com/squareup/square/BookingsClient.java
+++ b/src/main/java/com/squareup/square/BookingsClient.java
@@ -71,6 +71,15 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Retrieve a collection of bookings.
+ * To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
+ * To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for the OAuth scope.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Retrieve a collection of bookings.
* To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
diff --git a/src/main/java/com/squareup/square/CardsClient.java b/src/main/java/com/squareup/square/CardsClient.java
index 44653d26..3124d14e 100644
--- a/src/main/java/com/squareup/square/CardsClient.java
+++ b/src/main/java/com/squareup/square/CardsClient.java
@@ -40,6 +40,14 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Retrieves a list of cards owned by the account making the request.
+ * A max of 25 cards will be returned.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Retrieves a list of cards owned by the account making the request.
* A max of 25 cards will be returned.
diff --git a/src/main/java/com/squareup/square/CatalogClient.java b/src/main/java/com/squareup/square/CatalogClient.java
index 1be6dec3..bc24c0bf 100644
--- a/src/main/java/com/squareup/square/CatalogClient.java
+++ b/src/main/java/com/squareup/square/CatalogClient.java
@@ -178,6 +178,18 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Returns a list of all CatalogObjects of the specified types in the catalog.
+ * The types parameter is specified as a comma-separated list of the CatalogObjectType values,
+ * for example, "ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX, IMAGE".
+ * Important: ListCatalog does not return deleted catalog items. To retrieve
+ * deleted catalog items, use SearchCatalogObjects
+ * and set the include_deleted_objects attribute value to true.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Returns a list of all CatalogObjects of the specified types in the catalog.
* The types parameter is specified as a comma-separated list of the CatalogObjectType values,
@@ -218,6 +230,22 @@ public SearchCatalogObjectsResponse search() {
return this.rawClient.search().body();
}
+ /**
+ * Searches for CatalogObject of any type by matching supported search attribute values,
+ * excluding custom attribute values on items or item variations, against one or more of the specified query filters.
+ *
This (SearchCatalogObjects) endpoint differs from the SearchCatalogItems
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints have different call conventions, including the query filter formats.
+ *
+ */
+ public SearchCatalogObjectsResponse search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).body();
+ }
+
/**
* Searches for CatalogObject of any type by matching supported search attribute values,
* excluding custom attribute values on items or item variations, against one or more of the specified query filters.
@@ -266,6 +294,22 @@ public SearchCatalogItemsResponse searchItems() {
return this.rawClient.searchItems().body();
}
+ /**
+ * Searches for catalog items or item variations by matching supported search attribute values, including
+ * custom attribute values, against one or more of the specified query filters.
+ * This (SearchCatalogItems) endpoint differs from the SearchCatalogObjects
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints use different call conventions, including the query filter formats.
+ *
+ */
+ public SearchCatalogItemsResponse searchItems(RequestOptions requestOptions) {
+ return this.rawClient.searchItems(requestOptions).body();
+ }
+
/**
* Searches for catalog items or item variations by matching supported search attribute values, including
* custom attribute values, against one or more of the specified query filters.
diff --git a/src/main/java/com/squareup/square/ChannelsClient.java b/src/main/java/com/squareup/square/ChannelsClient.java
index 0d74ed7c..2f6362b7 100644
--- a/src/main/java/com/squareup/square/ChannelsClient.java
+++ b/src/main/java/com/squareup/square/ChannelsClient.java
@@ -34,6 +34,10 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
public SyncPagingIterable list(ListChannelsRequest request) {
return this.rawClient.list(request).body();
}
diff --git a/src/main/java/com/squareup/square/CustomersClient.java b/src/main/java/com/squareup/square/CustomersClient.java
index e714cdd4..90b49d34 100644
--- a/src/main/java/com/squareup/square/CustomersClient.java
+++ b/src/main/java/com/squareup/square/CustomersClient.java
@@ -77,6 +77,16 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Lists customer profiles associated with a Square account.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * for the listing 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 SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Lists customer profiles associated with a Square account.
* Under normal operating conditions, newly created or updated customer profiles become available
@@ -113,6 +123,22 @@ public CreateCustomerResponse create() {
return this.rawClient.create().body();
}
+ /**
+ * Creates a new customer for a business.
+ *
You must provide at least one of the following values in your request to this
+ * endpoint:
+ *
+ * given_name
+ * family_name
+ * company_name
+ * email_address
+ * phone_number
+ *
+ */
+ public CreateCustomerResponse create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).body();
+ }
+
/**
* Creates a new customer for a business.
* You must provide at least one of the following values in your request to this
@@ -241,6 +267,19 @@ public SearchCustomersResponse search() {
return this.rawClient.search().body();
}
+ /**
+ * Searches the customer profiles associated with a Square account using one or more supported query filters.
+ *
Calling SearchCustomers without any explicit query filter returns all
+ * customer profiles ordered alphabetically based on given_name and
+ * family_name.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * 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 SearchCustomersResponse search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).body();
+ }
+
/**
* Searches the customer profiles associated with a Square account using one or more supported query filters.
* Calling SearchCustomers without any explicit query filter returns all
diff --git a/src/main/java/com/squareup/square/DevicesClient.java b/src/main/java/com/squareup/square/DevicesClient.java
index 3d996e73..4d71db1b 100644
--- a/src/main/java/com/squareup/square/DevicesClient.java
+++ b/src/main/java/com/squareup/square/DevicesClient.java
@@ -42,6 +42,14 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * List devices associated with the merchant. Currently, only Terminal API
+ * devices are supported.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
diff --git a/src/main/java/com/squareup/square/DisputesClient.java b/src/main/java/com/squareup/square/DisputesClient.java
index 81cf2821..c5b83c14 100644
--- a/src/main/java/com/squareup/square/DisputesClient.java
+++ b/src/main/java/com/squareup/square/DisputesClient.java
@@ -49,6 +49,13 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Returns a list of disputes associated with a particular account.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Returns a list of disputes associated with a particular account.
*/
diff --git a/src/main/java/com/squareup/square/EmployeesClient.java b/src/main/java/com/squareup/square/EmployeesClient.java
index 5cdc8257..900b226d 100644
--- a/src/main/java/com/squareup/square/EmployeesClient.java
+++ b/src/main/java/com/squareup/square/EmployeesClient.java
@@ -32,6 +32,10 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
public SyncPagingIterable list(ListEmployeesRequest request) {
return this.rawClient.list(request).body();
}
diff --git a/src/main/java/com/squareup/square/EventsClient.java b/src/main/java/com/squareup/square/EventsClient.java
index 8b00d6d8..43d4df50 100644
--- a/src/main/java/com/squareup/square/EventsClient.java
+++ b/src/main/java/com/squareup/square/EventsClient.java
@@ -36,6 +36,13 @@ public SearchEventsResponse searchEvents() {
return this.rawClient.searchEvents().body();
}
+ /**
+ * Search for Square API events that occur within a 28-day timeframe.
+ */
+ public SearchEventsResponse searchEvents(RequestOptions requestOptions) {
+ return this.rawClient.searchEvents(requestOptions).body();
+ }
+
/**
* Search for Square API events that occur within a 28-day timeframe.
*/
@@ -89,6 +96,13 @@ public ListEventTypesResponse listEventTypes() {
return this.rawClient.listEventTypes().body();
}
+ /**
+ * Lists all event types that you can subscribe to as webhooks or query using the Events API.
+ */
+ public ListEventTypesResponse listEventTypes(RequestOptions requestOptions) {
+ return this.rawClient.listEventTypes(requestOptions).body();
+ }
+
/**
* Lists all event types that you can subscribe to as webhooks or query using the Events API.
*/
diff --git a/src/main/java/com/squareup/square/GiftCardsClient.java b/src/main/java/com/squareup/square/GiftCardsClient.java
index 4b040cc7..f1ebdfa8 100644
--- a/src/main/java/com/squareup/square/GiftCardsClient.java
+++ b/src/main/java/com/squareup/square/GiftCardsClient.java
@@ -52,6 +52,14 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Lists all gift cards. You can specify optional filters to retrieve
+ * a subset of the gift cards. Results are sorted by created_at in ascending order.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Lists all gift cards. You can specify optional filters to retrieve
* a subset of the gift cards. Results are sorted by created_at in ascending order.
diff --git a/src/main/java/com/squareup/square/InventoryClient.java b/src/main/java/com/squareup/square/InventoryClient.java
index c7ff71c6..c5619180 100644
--- a/src/main/java/com/squareup/square/InventoryClient.java
+++ b/src/main/java/com/squareup/square/InventoryClient.java
@@ -101,6 +101,14 @@ public BatchGetInventoryChangesResponse deprecatedBatchGetChanges() {
return this.rawClient.deprecatedBatchGetChanges().body();
}
+ /**
+ * Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
+ * is updated to conform to the standard convention.
+ */
+ public BatchGetInventoryChangesResponse deprecatedBatchGetChanges(RequestOptions requestOptions) {
+ return this.rawClient.deprecatedBatchGetChanges(requestOptions).body();
+ }
+
/**
* Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL
* is updated to conform to the standard convention.
@@ -126,6 +134,14 @@ public BatchGetInventoryCountsResponse deprecatedBatchGetCounts() {
return this.rawClient.deprecatedBatchGetCounts().body();
}
+ /**
+ * Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
+ * is updated to conform to the standard convention.
+ */
+ public BatchGetInventoryCountsResponse deprecatedBatchGetCounts(RequestOptions requestOptions) {
+ return this.rawClient.deprecatedBatchGetCounts(requestOptions).body();
+ }
+
/**
* Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL
* is updated to conform to the standard convention.
@@ -176,6 +192,18 @@ public SyncPagingIterable batchGetChanges() {
return this.rawClient.batchGetChanges().body();
}
+ /**
+ * Returns historical physical counts and adjustments based on the
+ * provided filter criteria.
+ * Results are paginated and sorted in ascending order according their
+ * occurred_at timestamp (oldest first).
+ * BatchRetrieveInventoryChanges is a catch-all query endpoint for queries
+ * that cannot be handled by other, simpler endpoints.
+ */
+ public SyncPagingIterable batchGetChanges(RequestOptions requestOptions) {
+ return this.rawClient.batchGetChanges(requestOptions).body();
+ }
+
/**
* Returns historical physical counts and adjustments based on the
* provided filter criteria.
@@ -216,6 +244,21 @@ public SyncPagingIterable batchGetCounts() {
return this.rawClient.batchGetCounts().body();
}
+ /**
+ * Returns current counts for the provided
+ * CatalogObjects at the requested
+ * Locations.
+ * Results are paginated and sorted in descending order according to their
+ * calculated_at timestamp (newest first).
+ * When updated_after is specified, only counts that have changed since that
+ * time (based on the server timestamp for the most recent change) are
+ * returned. This allows clients to perform a "sync" operation, for example
+ * in response to receiving a Webhook notification.
+ */
+ public SyncPagingIterable batchGetCounts(RequestOptions requestOptions) {
+ return this.rawClient.batchGetCounts(requestOptions).body();
+ }
+
/**
* Returns current counts for the provided
* CatalogObjects at the requested
diff --git a/src/main/java/com/squareup/square/LaborClient.java b/src/main/java/com/squareup/square/LaborClient.java
index d3d6a2d5..ab6daa1d 100644
--- a/src/main/java/com/squareup/square/LaborClient.java
+++ b/src/main/java/com/squareup/square/LaborClient.java
@@ -131,6 +131,14 @@ public SearchScheduledShiftsResponse searchScheduledShifts() {
return this.rawClient.searchScheduledShifts().body();
}
+ /**
+ * Returns a paginated list of scheduled shifts, with optional filter and sort settings.
+ * By default, results are sorted by start_at in ascending order.
+ */
+ public SearchScheduledShiftsResponse searchScheduledShifts(RequestOptions requestOptions) {
+ return this.rawClient.searchScheduledShifts(requestOptions).body();
+ }
+
/**
* Returns a paginated list of scheduled shifts, with optional filter and sort settings.
* By default, results are sorted by start_at in ascending order.
@@ -288,6 +296,29 @@ public SearchTimecardsResponse searchTimecards() {
return this.rawClient.searchTimecards().body();
}
+ /**
+ * Returns a paginated list of Timecard records for a business.
+ * The list to be returned can be filtered by:
+ *
+ * - Location IDs
+ * - Team member IDs
+ * - Timecard status (
OPEN or CLOSED)
+ * - Timecard start
+ * - Timecard end
+ * - Workday details
+ *
+ * The list can be sorted by:
+ *
+ * START_AT
+ * END_AT
+ * CREATED_AT
+ * UPDATED_AT
+ *
+ */
+ public SearchTimecardsResponse searchTimecards(RequestOptions requestOptions) {
+ return this.rawClient.searchTimecards(requestOptions).body();
+ }
+
/**
* Returns a paginated list of Timecard records for a business.
* The list to be returned can be filtered by:
diff --git a/src/main/java/com/squareup/square/LocationsClient.java b/src/main/java/com/squareup/square/LocationsClient.java
index a0d75735..a970824f 100644
--- a/src/main/java/com/squareup/square/LocationsClient.java
+++ b/src/main/java/com/squareup/square/LocationsClient.java
@@ -76,6 +76,19 @@ public CreateLocationResponse create() {
return this.rawClient.create().body();
}
+ /**
+ * Creates a location.
+ * Creating new locations allows for separate configuration of receipt layouts, item prices,
+ * and sales reports. Developers can use locations to separate sales activity through applications
+ * that integrate with Square from sales activity elsewhere in a seller's account.
+ * Locations created programmatically with the Locations API last forever and
+ * are visible to the seller for their own management. Therefore, ensure that
+ * each location has a sensible and unique name.
+ */
+ public CreateLocationResponse create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).body();
+ }
+
/**
* Creates a location.
* Creating new locations allows for separate configuration of receipt layouts, item prices,
diff --git a/src/main/java/com/squareup/square/LoyaltyClient.java b/src/main/java/com/squareup/square/LoyaltyClient.java
index 430835f3..b53c9b34 100644
--- a/src/main/java/com/squareup/square/LoyaltyClient.java
+++ b/src/main/java/com/squareup/square/LoyaltyClient.java
@@ -51,6 +51,18 @@ public SearchLoyaltyEventsResponse searchEvents() {
return this.rawClient.searchEvents().body();
}
+ /**
+ * Searches for loyalty events.
+ * A Square loyalty program maintains a ledger of events that occur during the lifetime of a
+ * buyer's loyalty account. Each change in the point balance
+ * (for example, points earned, points redeemed, and points expired) is
+ * 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 SearchLoyaltyEventsResponse searchEvents(RequestOptions requestOptions) {
+ return this.rawClient.searchEvents(requestOptions).body();
+ }
+
/**
* Searches for loyalty events.
* A Square loyalty program maintains a ledger of events that occur during the lifetime of a
diff --git a/src/main/java/com/squareup/square/MerchantsClient.java b/src/main/java/com/squareup/square/MerchantsClient.java
index a2dd98d8..8d83641d 100644
--- a/src/main/java/com/squareup/square/MerchantsClient.java
+++ b/src/main/java/com/squareup/square/MerchantsClient.java
@@ -53,6 +53,20 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Provides details about the merchant associated with a given access token.
+ * The access token used to connect your application to a Square seller is associated
+ * with a single merchant. That means that ListMerchants returns a list
+ * with a single Merchant object. You can specify your personal access token
+ * to get your own merchant information or specify an OAuth token to get the
+ * information for the merchant that granted your application access.
+ * If you know the merchant ID, you can also use the RetrieveMerchant
+ * endpoint to retrieve the merchant information.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Provides details about the merchant associated with a given access token.
* The access token used to connect your application to a Square seller is associated
diff --git a/src/main/java/com/squareup/square/MobileClient.java b/src/main/java/com/squareup/square/MobileClient.java
index 8c6378bd..a319dcc3 100644
--- a/src/main/java/com/squareup/square/MobileClient.java
+++ b/src/main/java/com/squareup/square/MobileClient.java
@@ -5,8 +5,6 @@
import com.squareup.square.core.ClientOptions;
import com.squareup.square.core.RequestOptions;
-import com.squareup.square.types.CreateMobileAuthorizationCodeRequest;
-import com.squareup.square.types.CreateMobileAuthorizationCodeResponse;
public class MobileClient {
protected final ClientOptions clientOptions;
@@ -25,49 +23,11 @@ public RawMobileClient withRawResponse() {
return this.rawClient;
}
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- *
Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CreateMobileAuthorizationCodeResponse authorizationCode() {
- return this.rawClient.authorizationCode().body();
- }
-
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- * Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CreateMobileAuthorizationCodeResponse authorizationCode(CreateMobileAuthorizationCodeRequest request) {
- return this.rawClient.authorizationCode(request).body();
+ public void authorizationCode() {
+ this.rawClient.authorizationCode().body();
}
- /**
- * Note: This endpoint is used by the deprecated Reader SDK.
- * Developers should update their integration to use the Mobile Payments SDK, which includes its own authorization methods.
- * Generates code to authorize a mobile application to connect to a Square card reader.
- * Authorization codes are one-time-use codes and expire 60 minutes after being issued.
- * The Authorization header you provide to this endpoint must have the following format:
- * Authorization: Bearer ACCESS_TOKEN
- *
- * Replace ACCESS_TOKEN with a
- * valid production authorization credential.
- */
- public CreateMobileAuthorizationCodeResponse authorizationCode(
- CreateMobileAuthorizationCodeRequest request, RequestOptions requestOptions) {
- return this.rawClient.authorizationCode(request, requestOptions).body();
+ public void authorizationCode(RequestOptions requestOptions) {
+ this.rawClient.authorizationCode(requestOptions).body();
}
}
diff --git a/src/main/java/com/squareup/square/OAuthClient.java b/src/main/java/com/squareup/square/OAuthClient.java
index efa15128..116f8fa6 100644
--- a/src/main/java/com/squareup/square/OAuthClient.java
+++ b/src/main/java/com/squareup/square/OAuthClient.java
@@ -43,6 +43,21 @@ public RevokeTokenResponse revokeToken() {
return this.rawClient.revokeToken().body();
}
+ /**
+ * Revokes an access token generated with the OAuth flow.
+ * If an account has more than one OAuth access token for your application, this
+ * endpoint revokes all of them, regardless of which token you specify.
+ * Important: The Authorization header for this endpoint must have the
+ * following format:
+ * Authorization: Client APPLICATION_SECRET
+ *
+ * Replace APPLICATION_SECRET with the application secret on the OAuth
+ * page for your application in the Developer Dashboard.
+ */
+ public RevokeTokenResponse revokeToken(RequestOptions requestOptions) {
+ return this.rawClient.revokeToken(requestOptions).body();
+ }
+
/**
* Revokes an access token generated with the OAuth flow.
* If an account has more than one OAuth access token for your application, this
diff --git a/src/main/java/com/squareup/square/OrdersClient.java b/src/main/java/com/squareup/square/OrdersClient.java
index a0310b5d..04b3ac15 100644
--- a/src/main/java/com/squareup/square/OrdersClient.java
+++ b/src/main/java/com/squareup/square/OrdersClient.java
@@ -61,6 +61,17 @@ public CreateOrderResponse create() {
return this.rawClient.create().body();
}
+ /**
+ * Creates a new order that can include information about products for
+ * purchase and settings to apply to the purchase.
+ *
To pay for a created order, see
+ * Pay for Orders.
+ * You can modify open orders using the UpdateOrder endpoint.
+ */
+ public CreateOrderResponse create(RequestOptions requestOptions) {
+ return this.rawClient.create(requestOptions).body();
+ }
+
/**
* Creates a new order that can include information about products for
* purchase and settings to apply to the purchase.
@@ -149,6 +160,26 @@ public SearchOrdersResponse search() {
return this.rawClient.search().body();
}
+ /**
+ * Search all orders for one or more locations. Orders include all sales,
+ * returns, and exchanges regardless of how or when they entered the Square
+ * ecosystem (such as Point of Sale, Invoices, and Connect APIs).
+ * SearchOrders requests need to specify which locations to search and define a
+ * SearchOrdersQuery object that controls
+ * how to sort or filter the results. Your SearchOrdersQuery can:
+ * Set filter criteria.
+ * Set the sort order.
+ * Determine whether to return results as complete Order objects or as
+ * OrderEntry objects.
+ * Note that details for orders processed with Square Point of Sale while in
+ * offline mode might not be transmitted to Square for up to 72 hours. Offline
+ * orders have a created_at value that reflects the time the order was created,
+ * not the time it was subsequently transmitted to Square.
+ */
+ public SearchOrdersResponse search(RequestOptions requestOptions) {
+ return this.rawClient.search(requestOptions).body();
+ }
+
/**
* Search all orders for one or more locations. Orders include all sales,
* returns, and exchanges regardless of how or when they entered the Square
diff --git a/src/main/java/com/squareup/square/PaymentsClient.java b/src/main/java/com/squareup/square/PaymentsClient.java
index 6d905270..66ccc358 100644
--- a/src/main/java/com/squareup/square/PaymentsClient.java
+++ b/src/main/java/com/squareup/square/PaymentsClient.java
@@ -48,6 +48,16 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Retrieves a list of payments taken by the account making the request.
+ * Results are eventually consistent, and new payments or changes to payments might take several
+ * seconds to appear.
+ * The maximum results per page is 100.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Retrieves a list of payments taken by the account making the request.
* Results are eventually consistent, and new payments or changes to payments might take several
diff --git a/src/main/java/com/squareup/square/PayoutsClient.java b/src/main/java/com/squareup/square/PayoutsClient.java
index 831ae0fb..8e2a8d1e 100644
--- a/src/main/java/com/squareup/square/PayoutsClient.java
+++ b/src/main/java/com/squareup/square/PayoutsClient.java
@@ -39,6 +39,15 @@ public SyncPagingIterable list() {
return this.rawClient.list().body();
}
+ /**
+ * Retrieves a list of all payouts for the default location.
+ * You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
+ * To call this endpoint, set PAYOUTS_READ for the OAuth scope.
+ */
+ public SyncPagingIterable list(RequestOptions requestOptions) {
+ return this.rawClient.list(requestOptions).body();
+ }
+
/**
* Retrieves a list of all payouts for the default location.
* You can filter payouts by location ID, status, time range, and order them in ascending or descending order.
diff --git a/src/main/java/com/squareup/square/RawBankAccountsClient.java b/src/main/java/com/squareup/square/RawBankAccountsClient.java
index 8e79642c..6b58a9db 100644
--- a/src/main/java/com/squareup/square/RawBankAccountsClient.java
+++ b/src/main/java/com/squareup/square/RawBankAccountsClient.java
@@ -3,7 +3,9 @@
*/
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;
@@ -12,6 +14,10 @@
import com.squareup.square.core.SquareException;
import com.squareup.square.core.SyncPagingIterable;
import com.squareup.square.types.BankAccount;
+import com.squareup.square.types.CreateBankAccountRequest;
+import com.squareup.square.types.CreateBankAccountResponse;
+import com.squareup.square.types.DisableBankAccountRequest;
+import com.squareup.square.types.DisableBankAccountResponse;
import com.squareup.square.types.GetBankAccountByV1IdResponse;
import com.squareup.square.types.GetBankAccountResponse;
import com.squareup.square.types.GetBankAccountsRequest;
@@ -26,6 +32,7 @@
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
+import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.ResponseBody;
@@ -43,6 +50,13 @@ public SquareClientHttpResponse> list() {
return list(ListBankAccountsRequest.builder().build());
}
+ /**
+ * Returns a list of BankAccount objects linked to a Square account.
+ */
+ public SquareClientHttpResponse> list(RequestOptions requestOptions) {
+ return list(ListBankAccountsRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a list of BankAccount objects linked to a Square account.
*/
@@ -70,6 +84,10 @@ public SquareClientHttpResponse> list(
QueryStringMapper.addQueryParameter(
httpUrl, "location_id", request.getLocationId().get(), false);
}
+ if (request.getCustomerId().isPresent()) {
+ QueryStringMapper.addQueryParameter(
+ httpUrl, "customer_id", request.getCustomerId().get(), false);
+ }
Request.Builder _requestBuilder = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
@@ -107,6 +125,56 @@ public SquareClientHttpResponse> list(
}
}
+ /**
+ * Store a bank account on file for a square account
+ */
+ public SquareClientHttpResponse createBankAccount(CreateBankAccountRequest request) {
+ return createBankAccount(request, null);
+ }
+
+ /**
+ * Store a bank account on file for a square account
+ */
+ public SquareClientHttpResponse createBankAccount(
+ CreateBankAccountRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/bank-accounts")
+ .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);
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ return new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateBankAccountResponse.class),
+ response);
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ throw new SquareApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (IOException e) {
+ throw new SquareException("Network error executing HTTP request", e);
+ }
+ }
+
/**
* Returns details of a BankAccount identified by V1 bank account ID.
*/
@@ -151,16 +219,14 @@ public SquareClientHttpResponse getByV1Id(
}
/**
- * Returns details of a BankAccount
- * linked to a Square account.
+ * Retrieve details of a BankAccount bank account linked to a Square account.
*/
public SquareClientHttpResponse get(GetBankAccountsRequest request) {
return get(request, null);
}
/**
- * Returns details of a BankAccount
- * linked to a Square account.
+ * Retrieve details of a BankAccount bank account linked to a Square account.
*/
public SquareClientHttpResponse get(
GetBankAccountsRequest request, RequestOptions requestOptions) {
@@ -194,4 +260,48 @@ public SquareClientHttpResponse get(
throw new SquareException("Network error executing HTTP request", e);
}
}
+
+ /**
+ * Disable a bank account.
+ */
+ public SquareClientHttpResponse disableBankAccount(DisableBankAccountRequest request) {
+ return disableBankAccount(request, null);
+ }
+
+ /**
+ * Disable a bank account.
+ */
+ public SquareClientHttpResponse disableBankAccount(
+ DisableBankAccountRequest request, RequestOptions requestOptions) {
+ HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
+ .newBuilder()
+ .addPathSegments("v2/bank-accounts")
+ .addPathSegment(request.getBankAccountId())
+ .addPathSegments("disable")
+ .build();
+ Request.Builder _requestBuilder = new Request.Builder()
+ .url(httpUrl)
+ .method("POST", RequestBody.create("", 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);
+ }
+ try (Response response = client.newCall(okhttpRequest).execute()) {
+ ResponseBody responseBody = response.body();
+ String responseBodyString = responseBody != null ? responseBody.string() : "{}";
+ if (response.isSuccessful()) {
+ return new SquareClientHttpResponse<>(
+ ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DisableBankAccountResponse.class),
+ response);
+ }
+ Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
+ throw new SquareApiException(
+ "Error with status code " + response.code(), response.code(), errorBody, response);
+ } catch (IOException e) {
+ throw new SquareException("Network error executing HTTP request", e);
+ }
+ }
}
diff --git a/src/main/java/com/squareup/square/RawBookingsClient.java b/src/main/java/com/squareup/square/RawBookingsClient.java
index c02a19d7..bd2065f8 100644
--- a/src/main/java/com/squareup/square/RawBookingsClient.java
+++ b/src/main/java/com/squareup/square/RawBookingsClient.java
@@ -61,6 +61,15 @@ public SquareClientHttpResponse> list() {
return list(ListBookingsRequest.builder().build());
}
+ /**
+ * Retrieve a collection of bookings.
+ * To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
+ * To call this endpoint with seller-level permissions, set APPOINTMENTS_ALL_READ and APPOINTMENTS_READ for the OAuth scope.
+ */
+ public SquareClientHttpResponse> list(RequestOptions requestOptions) {
+ return list(ListBookingsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieve a collection of bookings.
* To call this endpoint with buyer-level permissions, set APPOINTMENTS_READ for the OAuth scope.
diff --git a/src/main/java/com/squareup/square/RawCardsClient.java b/src/main/java/com/squareup/square/RawCardsClient.java
index d5c28c01..1649c3e7 100644
--- a/src/main/java/com/squareup/square/RawCardsClient.java
+++ b/src/main/java/com/squareup/square/RawCardsClient.java
@@ -49,6 +49,14 @@ public SquareClientHttpResponse> list() {
return list(ListCardsRequest.builder().build());
}
+ /**
+ * Retrieves a list of cards owned by the account making the request.
+ * A max of 25 cards will be returned.
+ */
+ public SquareClientHttpResponse> list(RequestOptions requestOptions) {
+ return list(ListCardsRequest.builder().build(), requestOptions);
+ }
+
/**
* Retrieves a list of cards owned by the account making the request.
* A max of 25 cards will be returned.
diff --git a/src/main/java/com/squareup/square/RawCatalogClient.java b/src/main/java/com/squareup/square/RawCatalogClient.java
index 9fdd259f..b039d54a 100644
--- a/src/main/java/com/squareup/square/RawCatalogClient.java
+++ b/src/main/java/com/squareup/square/RawCatalogClient.java
@@ -312,6 +312,18 @@ public SquareClientHttpResponse> list() {
return list(ListCatalogRequest.builder().build());
}
+ /**
+ * Returns a list of all CatalogObjects of the specified types in the catalog.
+ * The types parameter is specified as a comma-separated list of the CatalogObjectType values,
+ * for example, "ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX, IMAGE".
+ * Important: ListCatalog does not return deleted catalog items. To retrieve
+ * deleted catalog items, use SearchCatalogObjects
+ * and set the include_deleted_objects attribute value to true.
+ */
+ public SquareClientHttpResponse> list(RequestOptions requestOptions) {
+ return list(ListCatalogRequest.builder().build(), requestOptions);
+ }
+
/**
* Returns a list of all CatalogObjects of the specified types in the catalog.
* The types parameter is specified as a comma-separated list of the CatalogObjectType values,
@@ -402,6 +414,22 @@ public SquareClientHttpResponse search() {
return search(SearchCatalogObjectsRequest.builder().build());
}
+ /**
+ * Searches for CatalogObject of any type by matching supported search attribute values,
+ * excluding custom attribute values on items or item variations, against one or more of the specified query filters.
+ * This (SearchCatalogObjects) endpoint differs from the SearchCatalogItems
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints have different call conventions, including the query filter formats.
+ *
+ */
+ public SquareClientHttpResponse search(RequestOptions requestOptions) {
+ return search(SearchCatalogObjectsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for CatalogObject of any type by matching supported search attribute values,
* excluding custom attribute values on items or item variations, against one or more of the specified query filters.
@@ -486,6 +514,22 @@ public SquareClientHttpResponse searchItems() {
return searchItems(SearchCatalogItemsRequest.builder().build());
}
+ /**
+ * Searches for catalog items or item variations by matching supported search attribute values, including
+ * custom attribute values, against one or more of the specified query filters.
+ * This (SearchCatalogItems) endpoint differs from the SearchCatalogObjects
+ * endpoint in the following aspects:
+ *
+ * SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
+ * SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
+ * SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
+ * - The both endpoints use different call conventions, including the query filter formats.
+ *
+ */
+ public SquareClientHttpResponse searchItems(RequestOptions requestOptions) {
+ return searchItems(SearchCatalogItemsRequest.builder().build(), requestOptions);
+ }
+
/**
* Searches for catalog items or item variations by matching supported search attribute values, including
* custom attribute values, against one or more of the specified query filters.
diff --git a/src/main/java/com/squareup/square/RawChannelsClient.java b/src/main/java/com/squareup/square/RawChannelsClient.java
index f30fe1a7..1e851073 100644
--- a/src/main/java/com/squareup/square/RawChannelsClient.java
+++ b/src/main/java/com/squareup/square/RawChannelsClient.java
@@ -43,6 +43,10 @@ public SquareClientHttpResponse> list() {
return list(ListChannelsRequest.builder().build());
}
+ public SquareClientHttpResponse> list(RequestOptions requestOptions) {
+ return list(ListChannelsRequest.builder().build(), requestOptions);
+ }
+
public SquareClientHttpResponse> list(ListChannelsRequest request) {
return list(request, null);
}
diff --git a/src/main/java/com/squareup/square/RawCustomersClient.java b/src/main/java/com/squareup/square/RawCustomersClient.java
index 39ab3d55..c50a652e 100644
--- a/src/main/java/com/squareup/square/RawCustomersClient.java
+++ b/src/main/java/com/squareup/square/RawCustomersClient.java
@@ -63,6 +63,16 @@ public SquareClientHttpResponse> list() {
return list(ListCustomersRequest.builder().build());
}
+ /**
+ * Lists customer profiles associated with a Square account.
+ * Under normal operating conditions, newly created or updated customer profiles become available
+ * for the listing 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 SquareClientHttpResponse> list(RequestOptions requestOptions) {
+ return list(ListCustomersRequest.builder().build(), requestOptions);
+ }
+
/**
* Lists customer profiles associated with a Square account.
*