lib/square/api/customers_api.rb
# Adds a group membership to a customer.
# The customer is identified by the `customer_id` value
# and the customer group is identified by the `group_id` value.
# @param [String] customer_id Required parameter: The ID of the customer to
# add to a group.
# @param [String] group_id Required parameter: The ID of the customer group
# to add the customer to.
# @return [AddGroupToCustomerResponse Hash] response from the API call
Adds a group membership to a customer.
The customer is identified by the `customer_id` value
and the customer group is identified by the `group_id` value.
Adds a group membership to a customer . The customer is identified by the ` customer_id ` value and the customer group is identified by the ` group_id ` value .
def add_group_to_customer(customer_id:,
                              group_id:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/customers/{customer_id}/groups/{group_id}'
      _query_builder = APIHelper.append_url_with_template_parameters(
        _query_builder,
        'customer_id' => { 'value' => customer_id, 'encode' => true },
        'group_id' => { 'value' => group_id, 'encode' => true }
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.put(
        _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 add_group_to_customer ( customer_id : , group_id : ) _query_builder = config . get_base_uri _query_builder << '/v2/customers/{customer_id}/groups/{group_id}' _query_builder = APIHelper . append_url_with_template_parameters ( _query_builder , 'customer_id' => { 'value' => customer_id , 'encode' => true } , 'group_id' => { 'value' => group_id , 'encode' => true } ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . put ( _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
Adds a group membership to a customer.
Adds a group membership to a customer .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
AddGroupToCustomerResponse Hash
customer_id
<not_specific>
group_id
<not_specific>
<not_specific>
group_id Required parameter: The ID of the customer group to add the customer to.
group_id Required parameter : The ID of the customer group to add the customer to .