src/main/java/com/squareup/connect/api/RefundsApi.java
public ListPaymentRefundsResponse listPaymentRefunds(String beginTime, String endTime, String sortOrder, String cursor, String locationId, String status, String sourceType) throws ApiException {
    Object localVarPostBody = null;
    
    // create path and map variables
    String localVarPath = "/v2/refunds";

    // query params
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    localVarHeaderParams.put("Square-Version", "2019-11-20");
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "begin_time", beginTime));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_time", endTime));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_order", sortOrder));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "cursor", cursor));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "location_id", locationId));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "source_type", sourceType));

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "oauth2" };

    GenericType<ListPaymentRefundsResponse> localVarReturnType = new GenericType<ListPaymentRefundsResponse>() {};
    CompleteResponse<ListPaymentRefundsResponse> completeResponse = (CompleteResponse<ListPaymentRefundsResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
/**
   * ListPaymentRefunds
   * Retrieves a list of refunds for the account making the request.  Max results per page: 100
   * @param beginTime Timestamp for the beginning of the requested reporting period, in RFC 3339 format.  Default: The current time minus one year. (optional)
   * @param endTime Timestamp for the end of the requested reporting period, in RFC 3339 format.  Default: The current time. (optional)
   * @param sortOrder The order in which results are listed. - &#x60;ASC&#x60; - oldest to newest - &#x60;DESC&#x60; - newest to oldest (default). (optional)
   * @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.  See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. (optional)
   * @param locationId ID of location associated with payment. (optional)
   * @param status If provided, only refunds with the given status are returned. For a list of refund status values, see &#x60;PaymentRefund&#x60;.  Default: If omitted refunds are returned regardless of status. (optional)
   * @param sourceType If provided, only refunds with the given source type are returned. - &#x60;CARD&#x60; - List refunds only for payments where card was specified as payment source.  Default: If omitted refunds are returned regardless of source type. (optional)
   * @return ListPaymentRefundsResponse
   * @throws ApiException if fails to make API call
   */
ListPaymentRefunds
Retrieves a list of refunds for the account making the request.  Max results per page: 100
@param beginTime Timestamp for the beginning of the requested reporting period, in RFC 3339 format.  Default: The current time minus one year. (optional)
@param endTime Timestamp for the end of the requested reporting period, in RFC 3339 format.  Default: The current time. (optional)
@param sortOrder The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). (optional)
@param cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.  See [Pagination] for more information. (optional)
@param locationId ID of location associated with payment. (optional)
@param status If provided, only refunds with the given status are returned. For a list of refund status values, see `PaymentRefund`.  Default: If omitted refunds are returned regardless of status. (optional)
@param sourceType If provided, only refunds with the given source type are returned. - `CARD` - List refunds only for payments where card was specified as payment source.  Default: If omitted refunds are returned regardless of source type. (optional)
@return ListPaymentRefundsResponse
@throws ApiException if fails to make API call
ListPaymentRefunds Retrieves a list of refunds for the account making the request . Max results per page : 100 @param beginTime Timestamp for the beginning of the requested reporting period in RFC 3339 format . Default : The current time minus one year . ( optional ) @param endTime Timestamp for the end of the requested reporting period in RFC 3339 format . Default : The current time . ( optional ) @param sortOrder The order in which results are listed . - ` ASC ` - oldest to newest - ` DESC ` - newest to oldest ( default ) . ( optional ) @param cursor A pagination cursor returned by a previous call to this endpoint . Provide this to retrieve the next set of results for the original query . See [ Pagination ] for more information . ( optional ) @param locationId ID of location associated with payment . ( optional ) @param status If provided only refunds with the given status are returned . For a list of refund status values see ` PaymentRefund ` . Default : If omitted refunds are returned regardless of status . ( optional ) @param sourceType If provided only refunds with the given source type are returned . - ` CARD ` - List refunds only for payments where card was specified as payment source . Default : If omitted refunds are returned regardless of source type . ( optional ) @return ListPaymentRefundsResponse @throws ApiException if fails to make API call
public ListPaymentRefundsResponse listPaymentRefunds(String beginTime, String endTime, String sortOrder, String cursor, String locationId, String status, String sourceType) throws ApiException {
    Object localVarPostBody = null;
    String localVarPath = "/v2/refunds";
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    localVarHeaderParams.put("Square-Version", "2019-11-20");
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "begin_time", beginTime));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_time", endTime));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort_order", sortOrder));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "cursor", cursor));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "location_id", locationId));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
    localVarQueryParams.addAll(apiClient.parameterToPairs("", "source_type", sourceType));
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    String[] localVarAuthNames = new String[] { "oauth2" };
    GenericType<ListPaymentRefundsResponse> localVarReturnType = new GenericType<ListPaymentRefundsResponse>() {};
    CompleteResponse<ListPaymentRefundsResponse> completeResponse = (CompleteResponse<ListPaymentRefundsResponse>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
public ListPaymentRefundsResponse listPaymentRefunds ( String beginTime , String endTime , String sortOrder , String cursor , String locationId , String status , String sourceType ) throws ApiException { Object localVarPostBody = null ; String localVarPath = "/v2/refunds" ; List < Pair > localVarQueryParams = new ArrayList < Pair > ( ) ; Map < String , String > localVarHeaderParams = new HashMap < String , String > ( ) ; Map < String , Object > localVarFormParams = new HashMap < String , Object > ( ) ; localVarHeaderParams . put ( "Square-Version" , "2019-11-20" ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "begin_time" , beginTime ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "end_time" , endTime ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "sort_order" , sortOrder ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "cursor" , cursor ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "location_id" , locationId ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "status" , status ) ) ; localVarQueryParams . addAll ( apiClient . parameterToPairs ( "" , "source_type" , sourceType ) ) ; final String [ ] localVarAccepts = { "application/json" } ; final String localVarAccept = apiClient . selectHeaderAccept ( localVarAccepts ) ; final String [ ] localVarContentTypes = { "application/json" } ; final String localVarContentType = apiClient . selectHeaderContentType ( localVarContentTypes ) ; String [ ] localVarAuthNames = new String [ ] { "oauth2" } ; GenericType < ListPaymentRefundsResponse > localVarReturnType = new GenericType < ListPaymentRefundsResponse > ( ) { } ; CompleteResponse < ListPaymentRefundsResponse > completeResponse = ( CompleteResponse < ListPaymentRefundsResponse > ) apiClient . invokeAPI ( localVarPath , "GET" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; return completeResponse . getData ( ) ; }
ListPaymentRefunds
 Retrieves a list of refunds for the account making the request.
ListPaymentRefunds Retrieves a list of refunds for the account making the request .
// create path and map variables // query params