The Square Connect Java SDK is retired (EOL) as of 2019-12-17 and will no longer receive bug fixes or product updates.
If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new slack community for Square Developers
Java 8
Building the API client library requires Maven to be installed.
Add this dependency to your project's POM:
<dependency>
<groupId>com.squareup</groupId>
<artifactId>connect</artifactId>
<version>2.20191120.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "com.squareup:connect:2.20191120.0"
To install the API client library to your local Maven repository, simply execute:
mvn install -DskipTests
To run tests, you would need to create below accounts.json under travis-ci folder.
{
"US-Prod": {
"email": "your_email",
"access_token": "your_access_token",
"location_id": "your_location_id",
"application_id": "your_application_id"
},
"US-Prod-Sandbox": {
"email": "your_email",
"access_token": "your_sandbox_access_token",
"location_id": "your_sandbox_location_id",
"application_id": "your_sandbox_application_id"
}
}
mvn install
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/connect-2.20191120.0.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.squareup.connect.ApiClient;
import com.squareup.connect.ApiException;
import com.squareup.connect.Configuration;
import com.squareup.connect.api.LocationsApi;
import com.squareup.connect.auth.OAuth;
import com.squareup.connect.models.Location;
import java.io.File;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiClient apiClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) apiClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR_ACCESS_TOKEN");
// List all locations
LocationsApi locationsApi = new LocationsApi();
locationsApi.setApiClient(apiClient);
try {
List<Location> locations = locationsApi.listLocations().getLocations();
System.out.println(locations);
} catch (ApiException e) {
System.err.println("Exception when calling API");
e.printStackTrace();
}
}
}
import com.squareup.connect.ApiClient;
import com.squareup.connect.ApiException;
import com.squareup.connect.Configuration;
import com.squareup.connect.api.LocationsApi;
import com.squareup.connect.auth.OAuth;
import com.squareup.connect.models.Location;
import java.io.File;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiClient apiClient = Configuration.getDefaultApiClient();
// Set sandbox url
apiClient.setBasePath('https://connect.squareupsandbox.com');
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) apiClient.getAuthentication("oauth2");
// Set your sandbox token
oauth2.setAccessToken("YOUR_SANDBOX_ACCESS_TOKEN");
LocationsApi locationsApi = new LocationsApi();
}
}
All URIs are relative to https://connect.squareup.com
Class | Method | HTTP request | Description |
---|---|---|---|
ApplePayApi | registerDomain | POST /v2/apple-pay/domains | RegisterDomain |
CatalogApi | batchDeleteCatalogObjects | POST /v2/catalog/batch-delete | BatchDeleteCatalogObjects |
CatalogApi | batchRetrieveCatalogObjects | POST /v2/catalog/batch-retrieve | BatchRetrieveCatalogObjects |
CatalogApi | batchUpsertCatalogObjects | POST /v2/catalog/batch-upsert | BatchUpsertCatalogObjects |
CatalogApi | catalogInfo | GET /v2/catalog/info | CatalogInfo |
CatalogApi | deleteCatalogObject | DELETE /v2/catalog/object/{object_id} | DeleteCatalogObject |
CatalogApi | listCatalog | GET /v2/catalog/list | ListCatalog |
CatalogApi | retrieveCatalogObject | GET /v2/catalog/object/{object_id} | RetrieveCatalogObject |
CatalogApi | searchCatalogObjects | POST /v2/catalog/search | SearchCatalogObjects |
CatalogApi | updateItemModifierLists | POST /v2/catalog/update-item-modifier-lists | UpdateItemModifierLists |
CatalogApi | updateItemTaxes | POST /v2/catalog/update-item-taxes | UpdateItemTaxes |
CatalogApi | upsertCatalogObject | POST /v2/catalog/object | UpsertCatalogObject |
CheckoutApi | createCheckout | POST /v2/locations/{location_id}/checkouts | CreateCheckout |
CustomersApi | createCustomer | POST /v2/customers | CreateCustomer |
CustomersApi | createCustomerCard | POST /v2/customers/{customer_id}/cards | CreateCustomerCard |
CustomersApi | deleteCustomer | DELETE /v2/customers/{customer_id} | DeleteCustomer |
CustomersApi | deleteCustomerCard | DELETE /v2/customers/{customer_id}/cards/{card_id} | DeleteCustomerCard |
CustomersApi | listCustomers | GET /v2/customers | ListCustomers |
CustomersApi | retrieveCustomer | GET /v2/customers/{customer_id} | RetrieveCustomer |
CustomersApi | searchCustomers | POST /v2/customers/search | SearchCustomers |
CustomersApi | updateCustomer | PUT /v2/customers/{customer_id} | UpdateCustomer |
EmployeesApi | listEmployees | GET /v2/employees | ListEmployees |
EmployeesApi | retrieveEmployee | GET /v2/employees/{id} | RetrieveEmployee |
InventoryApi | batchChangeInventory | POST /v2/inventory/batch-change | BatchChangeInventory |
InventoryApi | batchRetrieveInventoryChanges | POST /v2/inventory/batch-retrieve-changes | BatchRetrieveInventoryChanges |
InventoryApi | batchRetrieveInventoryCounts | POST /v2/inventory/batch-retrieve-counts | BatchRetrieveInventoryCounts |
InventoryApi | retrieveInventoryAdjustment | GET /v2/inventory/adjustment/{adjustment_id} | RetrieveInventoryAdjustment |
InventoryApi | retrieveInventoryChanges | GET /v2/inventory/{catalog_object_id}/changes | RetrieveInventoryChanges |
InventoryApi | retrieveInventoryCount | GET /v2/inventory/{catalog_object_id} | RetrieveInventoryCount |
InventoryApi | retrieveInventoryPhysicalCount | GET /v2/inventory/physical-count/{physical_count_id} | RetrieveInventoryPhysicalCount |
LaborApi | createBreakType | POST /v2/labor/break-types | CreateBreakType |
LaborApi | createShift | POST /v2/labor/shifts | CreateShift |
LaborApi | deleteBreakType | DELETE /v2/labor/break-types/{id} | DeleteBreakType |
LaborApi | deleteShift | DELETE /v2/labor/shifts/{id} | DeleteShift |
LaborApi | getBreakType | GET /v2/labor/break-types/{id} | GetBreakType |
LaborApi | getEmployeeWage | GET /v2/labor/employee-wages/{id} | GetEmployeeWage |
LaborApi | getShift | GET /v2/labor/shifts/{id} | GetShift |
LaborApi | listBreakTypes | GET /v2/labor/break-types | ListBreakTypes |
LaborApi | listEmployeeWages | GET /v2/labor/employee-wages | ListEmployeeWages |
LaborApi | listWorkweekConfigs | GET /v2/labor/workweek-configs | ListWorkweekConfigs |
LaborApi | searchShifts | POST /v2/labor/shifts/search | SearchShifts |
LaborApi | updateBreakType | PUT /v2/labor/break-types/{id} | UpdateBreakType |
LaborApi | updateShift | PUT /v2/labor/shifts/{id} | UpdateShift |
LaborApi | updateWorkweekConfig | PUT /v2/labor/workweek-configs/{id} | UpdateWorkweekConfig |
LocationsApi | createLocation | POST /v2/locations | CreateLocation |
LocationsApi | listLocations | GET /v2/locations | ListLocations |
LocationsApi | retrieveLocation | GET /v2/locations/{location_id} | RetrieveLocation |
LocationsApi | updateLocation | PUT /v2/locations/{location_id} | UpdateLocation |
MerchantsApi | listMerchants | GET /v2/merchants | ListMerchants |
MerchantsApi | retrieveMerchant | GET /v2/merchants/{merchant_id} | RetrieveMerchant |
MobileAuthorizationApi | createMobileAuthorizationCode | POST /mobile/authorization-code | CreateMobileAuthorizationCode |
OAuthApi | obtainToken | POST /oauth2/token | ObtainToken |
OAuthApi | renewToken | POST /oauth2/clients/{client_id}/access-token/renew | RenewToken |
OAuthApi | revokeToken | POST /oauth2/revoke | RevokeToken |
OrdersApi | batchRetrieveOrders | POST /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders |
OrdersApi | createOrder | POST /v2/locations/{location_id}/orders | CreateOrder |
OrdersApi | payOrder | POST /v2/orders/{order_id}/pay | PayOrder |
OrdersApi | searchOrders | POST /v2/orders/search | SearchOrders |
OrdersApi | updateOrder | PUT /v2/locations/{location_id}/orders/{order_id} | UpdateOrder |
PaymentsApi | cancelPayment | POST /v2/payments/{payment_id}/cancel | CancelPayment |
PaymentsApi | cancelPaymentByIdempotencyKey | POST /v2/payments/cancel | CancelPaymentByIdempotencyKey |
PaymentsApi | completePayment | POST /v2/payments/{payment_id}/complete | CompletePayment |
PaymentsApi | createPayment | POST /v2/payments | CreatePayment |
PaymentsApi | getPayment | GET /v2/payments/{payment_id} | GetPayment |
PaymentsApi | listPayments | GET /v2/payments | ListPayments |
RefundsApi | getPaymentRefund | GET /v2/refunds/{refund_id} | GetPaymentRefund |
RefundsApi | listPaymentRefunds | GET /v2/refunds | ListPaymentRefunds |
RefundsApi | refundPayment | POST /v2/refunds | RefundPayment |
ReportingApi | listAdditionalRecipientReceivableRefunds | GET /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds |
ReportingApi | listAdditionalRecipientReceivables | GET /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables |
TransactionsApi | captureTransaction | POST /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction |
TransactionsApi | charge | POST /v2/locations/{location_id}/transactions | Charge |
TransactionsApi | createRefund | POST /v2/locations/{location_id}/transactions/{transaction_id}/refund | CreateRefund |
TransactionsApi | listRefunds | GET /v2/locations/{location_id}/refunds | ListRefunds |
TransactionsApi | listTransactions | GET /v2/locations/{location_id}/transactions | ListTransactions |
TransactionsApi | retrieveTransaction | GET /v2/locations/{location_id}/transactions/{transaction_id} | RetrieveTransaction |
TransactionsApi | voidTransaction | POST /v2/locations/{location_id}/transactions/{transaction_id}/void | VoidTransaction |
V1EmployeesApi | createEmployee | POST /v1/me/employees | CreateEmployee |
V1EmployeesApi | createEmployeeRole | POST /v1/me/roles | CreateEmployeeRole |
V1EmployeesApi | createTimecard | POST /v1/me/timecards | CreateTimecard |
V1EmployeesApi | deleteTimecard | DELETE /v1/me/timecards/{timecard_id} | DeleteTimecard |
V1EmployeesApi | listCashDrawerShifts | GET /v1/{location_id}/cash-drawer-shifts | ListCashDrawerShifts |
V1EmployeesApi | listEmployeeRoles | GET /v1/me/roles | ListEmployeeRoles |
V1EmployeesApi | listEmployees | GET /v1/me/employees | ListEmployees |
V1EmployeesApi | listTimecardEvents | GET /v1/me/timecards/{timecard_id}/events | ListTimecardEvents |
V1EmployeesApi | listTimecards | GET /v1/me/timecards | ListTimecards |
V1EmployeesApi | retrieveCashDrawerShift | GET /v1/{location_id}/cash-drawer-shifts/{shift_id} | RetrieveCashDrawerShift |
V1EmployeesApi | retrieveEmployee | GET /v1/me/employees/{employee_id} | RetrieveEmployee |
V1EmployeesApi | retrieveEmployeeRole | GET /v1/me/roles/{role_id} | RetrieveEmployeeRole |
V1EmployeesApi | retrieveTimecard | GET /v1/me/timecards/{timecard_id} | RetrieveTimecard |
V1EmployeesApi | updateEmployee | PUT /v1/me/employees/{employee_id} | UpdateEmployee |
V1EmployeesApi | updateEmployeeRole | PUT /v1/me/roles/{role_id} | UpdateEmployeeRole |
V1EmployeesApi | updateTimecard | PUT /v1/me/timecards/{timecard_id} | UpdateTimecard |
V1ItemsApi | adjustInventory | POST /v1/{location_id}/inventory/{variation_id} | AdjustInventory |
V1ItemsApi | applyFee | PUT /v1/{location_id}/items/{item_id}/fees/{fee_id} | ApplyFee |
V1ItemsApi | applyModifierList | PUT /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id} | ApplyModifierList |
V1ItemsApi | createCategory | POST /v1/{location_id}/categories | CreateCategory |
V1ItemsApi | createDiscount | POST /v1/{location_id}/discounts | CreateDiscount |
V1ItemsApi | createFee | POST /v1/{location_id}/fees | CreateFee |
V1ItemsApi | createItem | POST /v1/{location_id}/items | CreateItem |
V1ItemsApi | createModifierList | POST /v1/{location_id}/modifier-lists | CreateModifierList |
V1ItemsApi | createModifierOption | POST /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options | CreateModifierOption |
V1ItemsApi | createPage | POST /v1/{location_id}/pages | CreatePage |
V1ItemsApi | createVariation | POST /v1/{location_id}/items/{item_id}/variations | CreateVariation |
V1ItemsApi | deleteCategory | DELETE /v1/{location_id}/categories/{category_id} | DeleteCategory |
V1ItemsApi | deleteDiscount | DELETE /v1/{location_id}/discounts/{discount_id} | DeleteDiscount |
V1ItemsApi | deleteFee | DELETE /v1/{location_id}/fees/{fee_id} | DeleteFee |
V1ItemsApi | deleteItem | DELETE /v1/{location_id}/items/{item_id} | DeleteItem |
V1ItemsApi | deleteModifierList | DELETE /v1/{location_id}/modifier-lists/{modifier_list_id} | DeleteModifierList |
V1ItemsApi | deleteModifierOption | DELETE /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id} | DeleteModifierOption |
V1ItemsApi | deletePage | DELETE /v1/{location_id}/pages/{page_id} | DeletePage |
V1ItemsApi | deletePageCell | DELETE /v1/{location_id}/pages/{page_id}/cells | DeletePageCell |
V1ItemsApi | deleteVariation | DELETE /v1/{location_id}/items/{item_id}/variations/{variation_id} | DeleteVariation |
V1ItemsApi | listCategories | GET /v1/{location_id}/categories | ListCategories |
V1ItemsApi | listDiscounts | GET /v1/{location_id}/discounts | ListDiscounts |
V1ItemsApi | listFees | GET /v1/{location_id}/fees | ListFees |
V1ItemsApi | listInventory | GET /v1/{location_id}/inventory | ListInventory |
V1ItemsApi | listItems | GET /v1/{location_id}/items | ListItems |
V1ItemsApi | listModifierLists | GET /v1/{location_id}/modifier-lists | ListModifierLists |
V1ItemsApi | listPages | GET /v1/{location_id}/pages | ListPages |
V1ItemsApi | removeFee | DELETE /v1/{location_id}/items/{item_id}/fees/{fee_id} | RemoveFee |
V1ItemsApi | removeModifierList | DELETE /v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id} | RemoveModifierList |
V1ItemsApi | retrieveItem | GET /v1/{location_id}/items/{item_id} | RetrieveItem |
V1ItemsApi | retrieveModifierList | GET /v1/{location_id}/modifier-lists/{modifier_list_id} | RetrieveModifierList |
V1ItemsApi | updateCategory | PUT /v1/{location_id}/categories/{category_id} | UpdateCategory |
V1ItemsApi | updateDiscount | PUT /v1/{location_id}/discounts/{discount_id} | UpdateDiscount |
V1ItemsApi | updateFee | PUT /v1/{location_id}/fees/{fee_id} | UpdateFee |
V1ItemsApi | updateItem | PUT /v1/{location_id}/items/{item_id} | UpdateItem |
V1ItemsApi | updateModifierList | PUT /v1/{location_id}/modifier-lists/{modifier_list_id} | UpdateModifierList |
V1ItemsApi | updateModifierOption | PUT /v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id} | UpdateModifierOption |
V1ItemsApi | updatePage | PUT /v1/{location_id}/pages/{page_id} | UpdatePage |
V1ItemsApi | updatePageCell | PUT /v1/{location_id}/pages/{page_id}/cells | UpdatePageCell |
V1ItemsApi | updateVariation | PUT /v1/{location_id}/items/{item_id}/variations/{variation_id} | UpdateVariation |
V1LocationsApi | listLocations | GET /v1/me/locations | ListLocations |
V1LocationsApi | retrieveBusiness | GET /v1/me | RetrieveBusiness |
V1TransactionsApi | createRefund | POST /v1/{location_id}/refunds | CreateRefund |
V1TransactionsApi | listBankAccounts | GET /v1/{location_id}/bank-accounts | ListBankAccounts |
V1TransactionsApi | listOrders | GET /v1/{location_id}/orders | ListOrders |
V1TransactionsApi | listPayments | GET /v1/{location_id}/payments | ListPayments |
V1TransactionsApi | listRefunds | GET /v1/{location_id}/refunds | ListRefunds |
V1TransactionsApi | listSettlements | GET /v1/{location_id}/settlements | ListSettlements |
V1TransactionsApi | retrieveBankAccount | GET /v1/{location_id}/bank-accounts/{bank_account_id} | RetrieveBankAccount |
V1TransactionsApi | retrieveOrder | GET /v1/{location_id}/orders/{order_id} | RetrieveOrder |
V1TransactionsApi | retrievePayment | GET /v1/{location_id}/payments/{payment_id} | RetrievePayment |
V1TransactionsApi | retrieveSettlement | GET /v1/{location_id}/settlements/{settlement_id} | RetrieveSettlement |
V1TransactionsApi | updateOrder | PUT /v1/{location_id}/orders/{order_id} | UpdateOrder |
- AdditionalRecipient
- AdditionalRecipientReceivable
- AdditionalRecipientReceivableRefund
- Address
- BalancePaymentDetails
- BatchChangeInventoryRequest
- BatchChangeInventoryResponse
- BatchDeleteCatalogObjectsRequest
- BatchDeleteCatalogObjectsResponse
- BatchRetrieveCatalogObjectsRequest
- BatchRetrieveCatalogObjectsResponse
- BatchRetrieveInventoryChangesRequest
- BatchRetrieveInventoryChangesResponse
- BatchRetrieveInventoryCountsRequest
- BatchRetrieveInventoryCountsResponse
- BatchRetrieveOrdersRequest
- BatchRetrieveOrdersResponse
- BatchUpsertCatalogObjectsRequest
- BatchUpsertCatalogObjectsResponse
- BreakType
- BusinessHours
- BusinessHoursPeriod
- CancelPaymentByIdempotencyKeyRequest
- CancelPaymentByIdempotencyKeyResponse
- CancelPaymentRequest
- CancelPaymentResponse
- CaptureTransactionRequest
- CaptureTransactionResponse
- Card
- CardBrand
- CardPaymentDetails
- CashPaymentDetails
- CatalogCategory
- CatalogDiscount
- CatalogDiscountModifyTaxBasis
- CatalogDiscountType
- CatalogIdMapping
- CatalogImage
- CatalogInfoRequest
- CatalogInfoResponse
- CatalogInfoResponseLimits
- CatalogItem
- CatalogItemModifierListInfo
- CatalogItemOption
- CatalogItemOptionForItem
- CatalogItemOptionValue
- CatalogItemOptionValueForItemVariation
- CatalogItemProductType
- CatalogItemVariation
- CatalogMeasurementUnit
- CatalogModifier
- CatalogModifierList
- CatalogModifierListSelectionType
- CatalogModifierOverride
- CatalogObject
- CatalogObjectBatch
- CatalogObjectType
- CatalogPricingRule
- CatalogPricingType
- CatalogProductSet
- CatalogQuery
- CatalogQueryCustomAttributeUsage
- CatalogQueryExact
- CatalogQueryFilteredItems
- CatalogQueryFilteredItemsCustomAttributeFilter
- CatalogQueryFilteredItemsCustomAttributeFilterFilterType
- CatalogQueryFilteredItemsNullableAttribute
- CatalogQueryFilteredItemsStockLevel
- CatalogQueryItemVariationsForItemOptionValues
- CatalogQueryItemsForItemOptions
- CatalogQueryItemsForModifierList
- CatalogQueryItemsForTax
- CatalogQueryPrefix
- CatalogQueryRange
- CatalogQuerySortedAttribute
- CatalogQueryText
- CatalogTax
- CatalogTimePeriod
- CatalogV1Id
- ChargeRequest
- ChargeRequestAdditionalRecipient
- ChargeResponse
- Checkout
- CompletePaymentRequest
- CompletePaymentResponse
- Coordinates
- Country
- CreateBreakTypeRequest
- CreateBreakTypeResponse
- CreateCatalogImageRequest
- CreateCatalogImageResponse
- CreateCheckoutRequest
- CreateCheckoutResponse
- CreateCustomerCardRequest
- CreateCustomerCardResponse
- CreateCustomerRequest
- CreateCustomerResponse
- CreateLocationRequest
- CreateLocationResponse
- CreateMobileAuthorizationCodeRequest
- CreateMobileAuthorizationCodeResponse
- CreateOrderRequest
- CreateOrderRequestDiscount
- CreateOrderRequestLineItem
- CreateOrderRequestModifier
- CreateOrderRequestTax
- CreateOrderResponse
- CreatePaymentRequest
- CreatePaymentResponse
- CreateRefundRequest
- CreateRefundResponse
- CreateShiftRequest
- CreateShiftResponse
- Currency
- Customer
- CustomerCreationSource
- CustomerCreationSourceFilter
- CustomerFilter
- CustomerGroupInfo
- CustomerInclusionExclusion
- CustomerPreferences
- CustomerQuery
- CustomerSort
- CustomerSortField
- DateRange
- DayOfWeek
- DeleteBreakTypeRequest
- DeleteBreakTypeResponse
- DeleteCatalogObjectRequest
- DeleteCatalogObjectResponse
- DeleteCustomerCardRequest
- DeleteCustomerCardResponse
- DeleteCustomerRequest
- DeleteCustomerResponse
- DeleteShiftRequest
- DeleteShiftResponse
- Device
- Employee
- EmployeeStatus
- EmployeeWage
- Error
- ErrorCategory
- ErrorCode
- ExcludeStrategy
- ExternalPaymentDetails
- GetBreakTypeRequest
- GetBreakTypeResponse
- GetEmployeeWageRequest
- GetEmployeeWageResponse
- GetPaymentRefundRequest
- GetPaymentRefundResponse
- GetPaymentRequest
- GetPaymentResponse
- GetShiftRequest
- GetShiftResponse
- InventoryAdjustment
- InventoryAlertType
- InventoryChange
- InventoryChangeType
- InventoryCount
- InventoryPhysicalCount
- InventoryState
- InventoryTransfer
- ItemVariationLocationOverrides
- ListAdditionalRecipientReceivableRefundsRequest
- ListAdditionalRecipientReceivableRefundsResponse
- ListAdditionalRecipientReceivablesRequest
- ListAdditionalRecipientReceivablesResponse
- ListBreakTypesRequest
- ListBreakTypesResponse
- ListCatalogRequest
- ListCatalogResponse
- ListCustomersRequest
- ListCustomersResponse
- ListEmployeeWagesRequest
- ListEmployeeWagesResponse
- ListEmployeesRequest
- ListEmployeesResponse
- ListLocationsRequest
- ListLocationsResponse
- ListMerchantsRequest
- ListMerchantsResponse
- ListPaymentRefundsRequest
- ListPaymentRefundsResponse
- ListPaymentsRequest
- ListPaymentsResponse
- ListRefundsRequest
- ListRefundsResponse
- ListTransactionsRequest
- ListTransactionsResponse
- ListWorkweekConfigsRequest
- ListWorkweekConfigsResponse
- Location
- LocationCapability
- LocationStatus
- LocationType
- MeasurementUnit
- MeasurementUnitArea
- MeasurementUnitCustom
- MeasurementUnitGeneric
- MeasurementUnitLength
- MeasurementUnitTime
- MeasurementUnitUnitType
- MeasurementUnitVolume
- MeasurementUnitWeight
- Merchant
- MerchantStatus
- ModelBreak
- Money
- ObtainTokenRequest
- ObtainTokenResponse
- Order
- OrderEntry
- OrderFulfillment
- OrderFulfillmentPickupDetails
- OrderFulfillmentPickupDetailsScheduleType
- OrderFulfillmentRecipient
- OrderFulfillmentShipmentDetails
- OrderFulfillmentState
- OrderFulfillmentType
- OrderLineItem
- OrderLineItemAppliedDiscount
- OrderLineItemAppliedTax
- OrderLineItemDiscount
- OrderLineItemDiscountScope
- OrderLineItemDiscountType
- OrderLineItemModifier
- OrderLineItemTax
- OrderLineItemTaxScope
- OrderLineItemTaxType
- OrderMoneyAmounts
- OrderQuantityUnit
- OrderReturn
- OrderReturnDiscount
- OrderReturnLineItem
- OrderReturnLineItemModifier
- OrderReturnServiceCharge
- OrderReturnTax
- OrderRoundingAdjustment
- OrderServiceCharge
- OrderServiceChargeCalculationPhase
- OrderSource
- OrderState
- PayOrderRequest
- PayOrderResponse
- Payment
- PaymentRefund
- ProcessingFee
- Product
- Refund
- RefundPaymentRequest
- RefundPaymentResponse
- RefundStatus
- RegisterDomainRequest
- RegisterDomainResponse
- RegisterDomainResponseStatus
- RenewTokenRequest
- RenewTokenResponse
- RetrieveCatalogObjectRequest
- RetrieveCatalogObjectResponse
- RetrieveCustomerRequest
- RetrieveCustomerResponse
- RetrieveEmployeeRequest
- RetrieveEmployeeResponse
- RetrieveInventoryAdjustmentRequest
- RetrieveInventoryAdjustmentResponse
- RetrieveInventoryChangesRequest
- RetrieveInventoryChangesResponse
- RetrieveInventoryCountRequest
- RetrieveInventoryCountResponse
- RetrieveInventoryPhysicalCountRequest
- RetrieveInventoryPhysicalCountResponse
- RetrieveLocationRequest
- RetrieveLocationResponse
- RetrieveMerchantRequest
- RetrieveMerchantResponse
- RetrieveTransactionRequest
- RetrieveTransactionResponse
- RevokeTokenRequest
- RevokeTokenResponse
- SearchCatalogObjectsRequest
- SearchCatalogObjectsResponse
- SearchCustomersRequest
- SearchCustomersResponse
- SearchOrdersCustomerFilter
- SearchOrdersDateTimeFilter
- SearchOrdersFilter
- SearchOrdersFulfillmentFilter
- SearchOrdersQuery
- SearchOrdersRequest
- SearchOrdersResponse
- SearchOrdersSort
- SearchOrdersSortField
- SearchOrdersSourceFilter
- SearchOrdersStateFilter
- SearchShiftsRequest
- SearchShiftsResponse
- Shift
- ShiftFilter
- ShiftFilterStatus
- ShiftQuery
- ShiftSort
- ShiftSortField
- ShiftStatus
- ShiftWage
- ShiftWorkday
- ShiftWorkdayMatcher
- SortOrder
- SourceApplication
- StandardUnitDescription
- StandardUnitDescriptionGroup
- TaxCalculationPhase
- TaxInclusionType
- Tender
- TenderCardDetails
- TenderCardDetailsEntryMethod
- TenderCardDetailsStatus
- TenderCashDetails
- TenderType
- TimeRange
- Transaction
- TransactionProduct
- UpdateBreakTypeRequest
- UpdateBreakTypeResponse
- UpdateCustomerRequest
- UpdateCustomerResponse
- UpdateItemModifierListsRequest
- UpdateItemModifierListsResponse
- UpdateItemTaxesRequest
- UpdateItemTaxesResponse
- UpdateLocationRequest
- UpdateLocationResponse
- UpdateOrderRequest
- UpdateOrderResponse
- UpdateShiftRequest
- UpdateShiftResponse
- UpdateWorkweekConfigRequest
- UpdateWorkweekConfigResponse
- UpsertCatalogObjectRequest
- UpsertCatalogObjectResponse
- V1AdjustInventoryRequest
- V1AdjustInventoryRequestAdjustmentType
- V1ApplyFeeRequest
- V1ApplyModifierListRequest
- V1BankAccount
- V1BankAccountType
- V1CashDrawerEvent
- V1CashDrawerEventEventType
- V1CashDrawerShift
- V1CashDrawerShiftEventType
- V1Category
- V1CreateCategoryRequest
- V1CreateDiscountRequest
- V1CreateEmployeeRoleRequest
- V1CreateFeeRequest
- V1CreateItemRequest
- V1CreateModifierListRequest
- V1CreateModifierOptionRequest
- V1CreatePageRequest
- V1CreateRefundRequest
- V1CreateRefundRequestType
- V1CreateVariationRequest
- V1DeleteCategoryRequest
- V1DeleteDiscountRequest
- V1DeleteFeeRequest
- V1DeleteItemRequest
- V1DeleteModifierListRequest
- V1DeleteModifierOptionRequest
- V1DeletePageCellRequest
- V1DeletePageRequest
- V1DeleteTimecardRequest
- V1DeleteTimecardResponse
- V1DeleteVariationRequest
- V1Discount
- V1DiscountColor
- V1DiscountDiscountType
- V1Employee
- V1EmployeeRole
- V1EmployeeRolePermissions
- V1EmployeeStatus
- V1Fee
- V1FeeAdjustmentType
- V1FeeCalculationPhase
- V1FeeInclusionType
- V1FeeType
- V1InventoryEntry
- V1Item
- V1ItemColor
- V1ItemImage
- V1ItemType
- V1ItemVisibility
- V1ListBankAccountsRequest
- V1ListBankAccountsResponse
- V1ListCashDrawerShiftsRequest
- V1ListCashDrawerShiftsResponse
- V1ListCategoriesRequest
- V1ListCategoriesResponse
- V1ListDiscountsRequest
- V1ListDiscountsResponse
- V1ListEmployeeRolesRequest
- V1ListEmployeeRolesResponse
- V1ListEmployeesRequest
- V1ListEmployeesRequestStatus
- V1ListEmployeesResponse
- V1ListFeesRequest
- V1ListFeesResponse
- V1ListInventoryRequest
- V1ListInventoryResponse
- V1ListItemsRequest
- V1ListItemsResponse
- V1ListLocationsRequest
- V1ListLocationsResponse
- V1ListModifierListsRequest
- V1ListModifierListsResponse
- V1ListOrdersRequest
- V1ListOrdersResponse
- V1ListPagesRequest
- V1ListPagesResponse
- V1ListPaymentsRequest
- V1ListPaymentsResponse
- V1ListRefundsRequest
- V1ListRefundsResponse
- V1ListSettlementsRequest
- V1ListSettlementsRequestStatus
- V1ListSettlementsResponse
- V1ListTimecardEventsRequest
- V1ListTimecardEventsResponse
- V1ListTimecardsRequest
- V1ListTimecardsResponse
- V1Merchant
- V1MerchantAccountType
- V1MerchantBusinessType
- V1MerchantLocationDetails
- V1ModifierList
- V1ModifierListSelectionType
- V1ModifierOption
- V1Money
- V1Order
- V1OrderHistoryEntry
- V1OrderHistoryEntryAction
- V1OrderState
- V1Page
- V1PageCell
- V1PageCellObjectType
- V1PageCellPlaceholderType
- V1Payment
- V1PaymentDiscount
- V1PaymentItemDetail
- V1PaymentItemization
- V1PaymentItemizationItemizationType
- V1PaymentModifier
- V1PaymentSurcharge
- V1PaymentSurchargeType
- V1PaymentTax
- V1PaymentTaxInclusionType
- V1PhoneNumber
- V1Refund
- V1RefundType
- V1RemoveFeeRequest
- V1RemoveModifierListRequest
- V1RetrieveBankAccountRequest
- V1RetrieveBusinessRequest
- V1RetrieveCashDrawerShiftRequest
- V1RetrieveEmployeeRequest
- V1RetrieveEmployeeRoleRequest
- V1RetrieveItemRequest
- V1RetrieveModifierListRequest
- V1RetrieveOrderRequest
- V1RetrievePaymentRequest
- V1RetrieveSettlementRequest
- V1RetrieveTimecardRequest
- V1Settlement
- V1SettlementEntry
- V1SettlementEntryType
- V1SettlementStatus
- V1Tender
- V1TenderCardBrand
- V1TenderEntryMethod
- V1TenderType
- V1Timecard
- V1TimecardEvent
- V1TimecardEventEventType
- V1UpdateCategoryRequest
- V1UpdateDiscountRequest
- V1UpdateEmployeeRequest
- V1UpdateEmployeeRoleRequest
- V1UpdateFeeRequest
- V1UpdateItemRequest
- V1UpdateModifierListRequest
- V1UpdateModifierListRequestSelectionType
- V1UpdateModifierOptionRequest
- V1UpdateOrderRequest
- V1UpdateOrderRequestAction
- V1UpdatePageCellRequest
- V1UpdatePageRequest
- V1UpdateTimecardRequest
- V1UpdateVariationRequest
- V1Variation
- V1VariationInventoryAlertType
- V1VariationPricingType
- VoidTransactionRequest
- VoidTransactionResponse
- Weekday
- WorkweekConfig
Authentication schemes defined for the API:
- Type: OAuth
- Flow: accessCode
- Authorization URL: https://connect.squareup.com/oauth2/authorize
- Scopes:
- BANK_ACCOUNTS_READ: HTTP Method: `GET` Grants read access to bank account information associated with the targeted Square account. For example, to call the Connect v1 ListBankAccounts endpoint.
- CUSTOMERS_READ: HTTP Method: `GET` Grants read access to customer information. For example, to call the ListCustomers endpoint.
- CUSTOMERS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to customer information. For example, to create and update customer profiles.
- EMPLOYEES_READ: HTTP Method: `GET` Grants read access to employee profile information. For example, to call the Connect v1 Employees API.
- EMPLOYEES_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee profile information. For example, to create and modify employee profiles.
- INVENTORY_READ: HTTP Method: `GET` Grants read access to inventory information. For example, to call the RetrieveInventoryCount endpoint.
- INVENTORY_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to inventory information. For example, to call the BatchChangeInventory endpoint.
- ITEMS_READ: HTTP Method: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
- ITEMS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to product catalog information. For example, to modify or add to a product catalog.
- MERCHANT_PROFILE_READ: HTTP Method: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
- ORDERS_READ: HTTP Method: `GET` Grants read access to order information. For example, to call the BatchRetrieveOrders endpoint.
- ORDERS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to order information. For example, to call the CreateCheckout endpoint.
- PAYMENTS_READ: HTTP Method: `GET` Grants read access to transaction and refund information. For example, to call the RetrieveTransaction endpoint.
- PAYMENTS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to transaction and refunds information. For example, to process payments with the Payments or Checkout API.
- PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS: HTTP Method: `POST`, `PUT`, `DELETE` Allow third party applications to deduct a portion of each transaction amount. Required to use multiparty transaction functionality with the Payments API.
- PAYMENTS_WRITE_IN_PERSON: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to payments and refunds information. For example, to process in-person payments.
- SETTLEMENTS_READ: HTTP Method: `GET` Grants read access to settlement (deposit) information. For example, to call the Connect v1 ListSettlements endpoint.
- TIMECARDS_READ: HTTP Method: `GET` Grants read access to employee timecard information. For example, to call the Connect v2 SearchShifts endpoint.
- TIMECARDS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee shift information. For example, to create and modify employee shifts.
- TIMECARDS_SETTINGS_READ: HTTP Method: `GET` Grants read access to employee timecard settings information. For example, to call the GetBreakType endpoint.
- TIMECARDS_SETTINGS_WRITE: HTTP Method: `POST`, `PUT`, `DELETE` Grants write access to employee timecard settings information. For example, to call the UpdateBreakType endpoint.
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
V1 Endpoints return pagination information via HTTP headers. In order to obtain
response headers and extract the batch_token
parameter you will need to follow
the following steps:
-
Use the full information endpoint methods of each API to get the response HTTP Headers. They are named as their simple counterpart with a
WithHttpInfo
suffix. HencelistEmployeeRoles
would be calledlistEmployeeRolesWithHttpInfo
. This method returns aCompleteResponse
object with the response data deserialized along with a helper to retrieve the token if present. -
Use
String batchToken = completeResponse.getBatchToken();
to extract the token and proceed to get the following page if a token is present.
// Import classes:
//import .ApiClient;
//import .ApiException;
//import .Configuration;
//import .CompleteResponse;
//import .auth.*;
//import .api.V1EmployeesApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
V1EmployeesApi apiInstance = new V1EmployeesApi();
String order = "order_example"; // String | The order in which employees are listed in the response, based on their created_at field.Default value: ASC
Integer limit = 56; // Integer | The maximum integer number of employee entities to return in a single response. Default 100, maximum 200.
String batchToken = null;
try {
do {
CompleteResponse<List<V1EmployeeRole>> completeResponse = apiInstance.listEmployeeRoles(order, limit, batchToken);
System.out.println(completeResponse.getData());
batchToken = completeResponse.getBatchToken();
} while (batchToken != null);
} catch (ApiException e) {
System.err.println("Exception when calling V1EmployeesApi#listEmployeeRoles");
e.printStackTrace();
}
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.