lib/square/api/customers_api.rb
# 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.
# @param [String] 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/working-with-apis/paginat
# ion).
# @param [Integer] 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. The limit is ignored if it is less than 1
# or greater than 100. The default value is 100.  For more information, see
# [Pagination](https://developer.squareup.com/docs/working-with-apis/paginat
# ion).
# @param [CustomerSortField] sort_field Optional parameter: Indicates how
# customers should be sorted.  The default value is `DEFAULT`.
# @param [SortOrder] sort_order Optional parameter: Indicates whether
# customers should be sorted in ascending (`ASC`) or descending (`DESC`)
# order.  The default value is `ASC`.
# @return [ListCustomersResponse Hash] response from the API call
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.
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 .
def list_customers(cursor: nil,
                       limit: nil,
                       sort_field: nil,
                       sort_order: nil)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/customers'
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'cursor' => cursor,
        'limit' => limit,
        'sort_field' => sort_field,
        'sort_order' => sort_order
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.get(
        _query_url,
        headers: _headers
      )
      OAuth2.apply(config, _request)
      _response = execute_request(_request)
      decoded = APIHelper.json_deserialize(_response.raw_body)
      _errors = APIHelper.map_response(decoded, ['errors'])
      ApiResponse.new(
        _response, data: decoded, errors: _errors
      )
    end
def list_customers ( cursor : nil , limit : nil , sort_field : nil , sort_order : nil ) _query_builder = config . get_base_uri _query_builder << '/v2/customers' _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'cursor' => cursor , 'limit' => limit , 'sort_field' => sort_field , 'sort_order' => sort_order ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . get ( _query_url , headers : _headers ) OAuth2 . apply ( config , _request ) _response = execute_request ( _request ) decoded = APIHelper . json_deserialize ( _response . raw_body ) _errors = APIHelper . map_response ( decoded , [ 'errors' ] ) ApiResponse . new ( _response , data : decoded , errors : _errors ) end
Lists customer profiles associated with a Square account.
Lists customer profiles associated with a Square account .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
ListCustomersResponse Hash
cursor
<not_specific>
limit
<not_specific>
sort_field
<not_specific>
sort_order
<not_specific>
<not_specific>
sort_order Optional parameter: Indicates whether customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. The default value is `ASC`.
sort_order Optional parameter : Indicates whether customers should be sorted in ascending ( ` ASC ` ) or descending ( ` DESC ` ) order . The default value is ` ASC ` .