lib/square/api/subscriptions_api.rb
# Searches for subscriptions.
# Results are ordered chronologically by subscription creation date. If
# the request specifies more than one location ID,
# the endpoint orders the result
# by location ID, and then by creation date within each location. If no
# locations are given
# in the query, all locations are searched.
# You can also optionally specify `customer_ids` to search by customer.
# If left unset, all customers
# associated with the specified locations are returned.
# If the request specifies customer IDs, the endpoint orders results
# first by location, within location by customer ID, and within
# customer by subscription creation date.
# For more information, see
# [Retrieve
# subscriptions](https://developer.squareup.com/docs/subscriptions-api/overv
# iew#retrieve-subscriptions).
# @param [SearchSubscriptionsRequest] body Required parameter: An object
# containing the fields to POST for the request.  See the corresponding
# object definition for field details.
# @return [SearchSubscriptionsResponse Hash] response from the API call
Searches for subscriptions.
Results are ordered chronologically by subscription creation date. If
the request specifies more than one location ID,
the endpoint orders the result
by location ID, and then by creation date within each location. If no
locations are given
in the query, all locations are searched.
You can also optionally specify `customer_ids` to search by customer.
If left unset, all customers
associated with the specified locations are returned.
If the request specifies customer IDs, the endpoint orders results
first by location, within location by customer ID, and within
customer by subscription creation date.
Searches for subscriptions . Results are ordered chronologically by subscription creation date . If the request specifies more than one location ID the endpoint orders the result by location ID and then by creation date within each location . If no locations are given in the query all locations are searched . You can also optionally specify ` customer_ids ` to search by customer . If left unset all customers associated with the specified locations are returned . If the request specifies customer IDs the endpoint orders results first by location within location by customer ID and within customer by subscription creation date .
def search_subscriptions(body:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/subscriptions/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_subscriptions ( body : ) _query_builder = config . get_base_uri _query_builder << '/v2/subscriptions/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 subscriptions.
Searches for subscriptions .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
SearchSubscriptionsResponse 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 .