lib/square/api/catalog_api.rb
# Searches for [CatalogObject]($m/CatalogObject) of any type by matching
# supported search attribute values,
# excluding custom attribute values on items or item variations, against one
# or more of the specified query filters.
# This (`SearchCatalogObjects`) endpoint differs from the
# [SearchCatalogItems]($e/Catalog/SearchCatalogItems)
# endpoint in the following aspects:
# - `SearchCatalogItems` can only search for items or item variations,
# whereas `SearchCatalogObjects` can search for any type of catalog objects.
# - `SearchCatalogItems` supports the custom attribute query filters to
# return items or item variations that contain custom attribute values,
# where `SearchCatalogObjects` does not.
# - `SearchCatalogItems` does not support the `include_deleted_objects`
# filter to search for deleted items or item variations, whereas
# `SearchCatalogObjects` does.
# - The both endpoints have different call conventions, including the query
# filter formats.
# @param [SearchCatalogObjectsRequest] body Required parameter: An object
# containing the fields to POST for the request.  See the corresponding
# object definition for field details.
# @return [SearchCatalogObjectsResponse Hash] response from the API call
Searches for [CatalogObject]($m/CatalogObject) of any type by matching
supported search attribute values,
excluding custom attribute values on items or item variations, against one
or more of the specified query filters.
Searches for [ CatalogObject ] ( $m / CatalogObject ) of any type by matching supported search attribute values excluding custom attribute values on items or item variations against one or more of the specified query filters .
def search_catalog_objects(body:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/catalog/search'
      _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 search_catalog_objects ( body : ) _query_builder = config . get_base_uri _query_builder << '/v2/catalog/search' _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
Searches for [CatalogObject]($m/CatalogObject) of any type by matching
supported search attribute values,
excluding custom attribute values on items or item variations, against one
or more of the specified query filters.
Searches for [ CatalogObject ] ( $m / CatalogObject ) of any type by matching supported search attribute values excluding custom attribute values on items or item variations against one or more of the specified query filters .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
SearchCatalogObjectsResponse 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 .