public interface CustomersApi
ListCustomersResponse listCustomers(String cursor, Integer limit, String sortField, String sortOrder) throws ApiException, IOException
cursor
- Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for your original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit
- Optional parameter: The maximum number of results to return in a single page.
This limit is advisory. The response might contain more or fewer results. If the
specified limit is less than 1 or greater than 100, Square returns a `400
VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100. For more
information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).sortField
- Optional parameter: Indicates how customers should be sorted. The default
value is `DEFAULT`.sortOrder
- Optional parameter: Indicates whether customers should be sorted in
ascending (`ASC`) or descending (`DESC`) order. The default value is `ASC`.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<ListCustomersResponse> listCustomersAsync(String cursor, Integer limit, String sortField, String sortOrder)
cursor
- Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for your original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit
- Optional parameter: The maximum number of results to return in a single page.
This limit is advisory. The response might contain more or fewer results. If the
specified limit is less than 1 or greater than 100, Square returns a `400
VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100. For more
information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).sortField
- Optional parameter: Indicates how customers should be sorted. The default
value is `DEFAULT`.sortOrder
- Optional parameter: Indicates whether customers should be sorted in
ascending (`ASC`) or descending (`DESC`) order. The default value is `ASC`.CreateCustomerResponse createCustomer(CreateCustomerRequest body) throws ApiException, IOException
body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<CreateCustomerResponse> createCustomerAsync(CreateCustomerRequest body)
body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.SearchCustomersResponse searchCustomers(SearchCustomersRequest body) throws ApiException, IOException
body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<SearchCustomersResponse> searchCustomersAsync(SearchCustomersRequest body)
body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.DeleteCustomerResponse deleteCustomer(String customerId, Long version) throws ApiException, IOException
customerId
- Required parameter: The ID of the customer to delete.version
- Optional parameter: The current version of the customer profile. As a best
practice, you should include this parameter to enable [optimistic
concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control. For more information, see [Delete a customer
profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<DeleteCustomerResponse> deleteCustomerAsync(String customerId, Long version)
customerId
- Required parameter: The ID of the customer to delete.version
- Optional parameter: The current version of the customer profile. As a best
practice, you should include this parameter to enable [optimistic
concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control. For more information, see [Delete a customer
profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#delete-customer-profile).RetrieveCustomerResponse retrieveCustomer(String customerId) throws ApiException, IOException
customerId
- Required parameter: The ID of the customer to retrieve.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<RetrieveCustomerResponse> retrieveCustomerAsync(String customerId)
customerId
- Required parameter: The ID of the customer to retrieve.UpdateCustomerResponse updateCustomer(String customerId, UpdateCustomerRequest body) throws ApiException, IOException
customerId
- Required parameter: The ID of the customer to update.body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<UpdateCustomerResponse> updateCustomerAsync(String customerId, UpdateCustomerRequest body)
customerId
- Required parameter: The ID of the customer to update.body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.@Deprecated CreateCustomerCardResponse createCustomerCard(String customerId, CreateCustomerCardRequest body) throws ApiException, IOException
customerId
- Required parameter: The Square ID of the customer profile the card is
linked to.body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.@Deprecated CompletableFuture<CreateCustomerCardResponse> createCustomerCardAsync(String customerId, CreateCustomerCardRequest body)
customerId
- Required parameter: The Square ID of the customer profile the card is
linked to.body
- Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.@Deprecated DeleteCustomerCardResponse deleteCustomerCard(String customerId, String cardId) throws ApiException, IOException
customerId
- Required parameter: The ID of the customer that the card on file belongs
to.cardId
- Required parameter: The ID of the card on file to delete.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.@Deprecated CompletableFuture<DeleteCustomerCardResponse> deleteCustomerCardAsync(String customerId, String cardId)
customerId
- Required parameter: The ID of the customer that the card on file belongs
to.cardId
- Required parameter: The ID of the card on file to delete.RemoveGroupFromCustomerResponse removeGroupFromCustomer(String customerId, String groupId) throws ApiException, IOException
customerId
- Required parameter: The ID of the customer to remove from the group.groupId
- Required parameter: The ID of the customer group to remove the customer
from.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<RemoveGroupFromCustomerResponse> removeGroupFromCustomerAsync(String customerId, String groupId)
customerId
- Required parameter: The ID of the customer to remove from the group.groupId
- Required parameter: The ID of the customer group to remove the customer
from.AddGroupToCustomerResponse addGroupToCustomer(String customerId, String groupId) throws ApiException, IOException
customerId
- Required parameter: The ID of the customer to add to a group.groupId
- Required parameter: The ID of the customer group to add the customer to.ApiException
- Represents error response from the server.IOException
- Signals that an I/O exception of some sort has occurred.CompletableFuture<AddGroupToCustomerResponse> addGroupToCustomerAsync(String customerId, String groupId)
customerId
- Required parameter: The ID of the customer to add to a group.groupId
- Required parameter: The ID of the customer group to add the customer to.Copyright © 2022. All rights reserved.