lib/square/api/locations_api.rb
# Creates a [location](https://developer.squareup.com/docs/locations-api).
# Creating new locations allows for separate configuration of receipt
# layouts, item prices,
# and sales reports. Developers can use locations to separate sales activity
# via applications
# that integrate with Square from sales activity elsewhere in a seller's
# account.
# Locations created programmatically with the Locations API will last
# forever and
# are visible to the seller for their own management, so ensure that
# each location has a sensible and unique name.
# @param [CreateLocationRequest] body Required parameter: An object
# containing the fields to POST for the request.  See the corresponding
# object definition for field details.
# @return [CreateLocationResponse Hash] response from the API call
Creates a [location].
Creating new locations allows for separate configuration of receipt
layouts, item prices,
and sales reports. Developers can use locations to separate sales activity
via applications
that integrate with Square from sales activity elsewhere in a seller's
account.
Locations created programmatically with the Locations API will last
forever and
are visible to the seller for their own management, so ensure that
each location has a sensible and unique name.
Creates a [ location ] . Creating new locations allows for separate configuration of receipt layouts item prices and sales reports . Developers can use locations to separate sales activity via applications that integrate with Square from sales activity elsewhere in a seller ' s account . Locations created programmatically with the Locations API will last forever and are visible to the seller for their own management so ensure that each location has a sensible and unique name .
def create_location(body:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/locations'
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json',
        'Content-Type' => 'application/json'
      }
      _request = config.http_client.post(
        _query_url,
        headers: _headers,
        parameters: body.to_json
      )
      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 create_location ( body : ) _query_builder = config . get_base_uri _query_builder << '/v2/locations' _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' , 'Content-Type' => 'application/json' } _request = config . http_client . post ( _query_url , headers : _headers , parameters : body . to_json ) 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
Creates a [location](https://developer.squareup.com/docs/locations-api).
Creates a [ location ] ( https : // developer . squareup . com / docs / locations - api ) .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
CreateLocationResponse Hash
body
<not_specific>
<not_specific>
body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details.
body Required parameter : An object containing the fields to POST for the request . See the corresponding object definition for field details .