lib/square/api/transactions_api.rb
# Lists transactions for a particular location.
# Transactions include payment information from sales and exchanges and
# refund
# information from returns and exchanges.
# Max results per
# [page](https://developer.squareup.com/docs/working-with-apis/pagination):
# 50
# @param [String] location_id Required parameter: The ID of the location to
# list transactions for.
# @param [String] begin_time Optional parameter: The beginning of the
# requested reporting period, in RFC 3339 format.  See [Date
# ranges](https://developer.squareup.com/docs/build-basics/working-with-date
# s) for details on date inclusivity/exclusivity.  Default value: The
# current time minus one year.
# @param [String] end_time Optional parameter: The end of the requested
# reporting period, in RFC 3339 format.  See [Date
# ranges](https://developer.squareup.com/docs/build-basics/working-with-date
# s) for details on date inclusivity/exclusivity.  Default value: The
# current time.
# @param [SortOrder] sort_order Optional parameter: The order in which
# results are listed in the response (`ASC` for oldest first, `DESC` for
# newest first).  Default value: `DESC`
# @param [String] cursor Optional parameter: A pagination cursor returned by
# a previous call to this endpoint. Provide this to retrieve the next set of
# results for your original query.  See [Paginating
# results](https://developer.squareup.com/docs/working-with-apis/pagination)
# for more information.
# @return [ListTransactionsResponse Hash] response from the API call
Lists transactions for a particular location.
Transactions include payment information from sales and exchanges and
refund
information from returns and exchanges.
Max results per
[page]:
50
Lists transactions for a particular location . Transactions include payment information from sales and exchanges and refund information from returns and exchanges . Max results per [ page ] : 50
def list_transactions(location_id:,
                          begin_time: nil,
                          end_time: nil,
                          sort_order: nil,
                          cursor: nil)
      warn 'Endpoint list_transactions in TransactionsApi is deprecated'
      _query_builder = config.get_base_uri
      _query_builder << '/v2/locations/{location_id}/transactions'
      _query_builder = APIHelper.append_url_with_template_parameters(
        _query_builder,
        'location_id' => { 'value' => location_id, 'encode' => true }
      )
      _query_builder = APIHelper.append_url_with_query_parameters(
        _query_builder,
        'begin_time' => begin_time,
        'end_time' => end_time,
        'sort_order' => sort_order,
        'cursor' => cursor
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.get(
        _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 list_transactions ( location_id : , begin_time : nil , end_time : nil , sort_order : nil , cursor : nil ) warn 'Endpoint list_transactions in TransactionsApi is deprecated' _query_builder = config . get_base_uri _query_builder << '/v2/locations/{location_id}/transactions' _query_builder = APIHelper . append_url_with_template_parameters ( _query_builder , 'location_id' => { 'value' => location_id , 'encode' => true } ) _query_builder = APIHelper . append_url_with_query_parameters ( _query_builder , 'begin_time' => begin_time , 'end_time' => end_time , 'sort_order' => sort_order , 'cursor' => cursor ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . get ( _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
Lists transactions for a particular location.
Lists transactions for a particular location .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
ListTransactionsResponse Hash
location_id
<not_specific>
begin_time
<not_specific>
end_time
<not_specific>
sort_order
<not_specific>
cursor
<not_specific>
<not_specific>
cursor Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results] for more information.
cursor Optional parameter : A pagination cursor returned by a previous call to this endpoint . Provide this to retrieve the next set of results for your original query . See [ Paginating results ] for more information .