lib/square/api/catalog_api.rb
# Creates or updates up to 10,000 target objects based on the provided
# list of objects. The target objects are grouped into batches and each
# batch is
# inserted/updated in an all-or-nothing manner. If an object within a batch
# is
# malformed in some way, or violates a database constraint, the entire batch
# containing that item will be disregarded. However, other batches in the
# same
# request may still succeed. Each batch may contain up to 1,000 objects, and
# batches will be processed in order as long as the total object count for
# the
# request (items, variations, modifier lists, discounts, and taxes) is no
# more
# than 10,000.
# @param [BatchUpsertCatalogObjectsRequest] body Required parameter: An
# object containing the fields to POST for the request.  See the
# corresponding object definition for field details.
# @return [BatchUpsertCatalogObjectsResponse Hash] response from the API call
Creates or updates up to 10,000 target objects based on the provided
list of objects. The target objects are grouped into batches and each
batch is
inserted/updated in an all-or-nothing manner. If an object within a batch
is
malformed in some way, or violates a database constraint, the entire batch
containing that item will be disregarded. However, other batches in the
same
request may still succeed. Each batch may contain up to 1,000 objects, and
batches will be processed in order as long as the total object count for
the
request (items, variations, modifier lists, discounts, and taxes) is no
more
than 10,000.
Creates or updates up to 10 000 target objects based on the provided list of objects . The target objects are grouped into batches and each batch is inserted / updated in an all - or - nothing manner . If an object within a batch is malformed in some way or violates a database constraint the entire batch containing that item will be disregarded . However other batches in the same request may still succeed . Each batch may contain up to 1 000 objects and batches will be processed in order as long as the total object count for the request ( items variations modifier lists discounts and taxes ) is no more than 10 000 .
def batch_upsert_catalog_objects(body:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/catalog/batch-upsert'
      _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 batch_upsert_catalog_objects ( body : ) _query_builder = config . get_base_uri _query_builder << '/v2/catalog/batch-upsert' _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 or updates up to 10,000 target objects based on the provided
list of objects.
Creates or updates up to 10 000 target objects based on the provided list of objects .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
BatchUpsertCatalogObjectsResponse 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 .