lib/square/api/customers_api.rb
# Deletes a customer profile from a business. This operation also unlinks
# any associated cards on file.
# As a best practice, you should include the `version` field in the request
# to enable [optimistic
# concurrency](https://developer.squareup.com/docs/working-with-apis/optimis
# tic-concurrency) control. The value must be set to the current version of
# the customer profile.
# To delete a customer profile that was created by merging existing
# profiles, you must use the ID of the newly created profile.
# @param [String] customer_id Required parameter: The ID of the customer to
# delete.
# @param [Long] 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/working-with-apis/optimis
# tic-concurrency) control.  For more information, see [Delete a customer
# profile](https://developer.squareup.com/docs/customers-api/use-the-api/kee
# p-records#delete-customer-profile).
# @return [DeleteCustomerResponse Hash] response from the API call
Deletes a customer profile from a business. This operation also unlinks
any associated cards on file.
Deletes a customer profile from a business . This operation also unlinks any associated cards on file .
def delete_customer(customer_id:,
                        version: nil)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/customers/{customer_id}'
      _query_builder = APIHelper.append_url_with_template_parameters(
        _query_builder,
        'customer_id' => { 'value' => customer_id, 'encode' => true }
      )
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'version' => version
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.delete(
        _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 delete_customer ( customer_id : , version : nil ) _query_builder = config . get_base_uri _query_builder << '/v2/customers/{customer_id}' _query_builder = APIHelper . append_url_with_template_parameters ( _query_builder , 'customer_id' => { 'value' => customer_id , 'encode' => true } ) _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'version' => version ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . delete ( _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
Deletes a customer profile from a business.
Deletes a customer profile from a business .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
DeleteCustomerResponse Hash
customer_id
<not_specific>
version
<not_specific>
<not_specific>
version Optional parameter: The current version of the customer profile. As a best practice, you should include this parameter to enable [optimistic concurrency] control. For more information, see [Delete a customer profile].
version Optional parameter : The current version of the customer profile . As a best practice you should include this parameter to enable [ optimistic concurrency ] control . For more information see [ Delete a customer profile ] .