code: public BillingPaymentsResponse listPayments(String accountId, BillingApi.ListPaymentsOptions options) throws ApiException {
      Object localVarPostBody = "{}";
      
        // verify the required parameter 'accountId' is set
        if (accountId == null) {
        throw new ApiException(400, "Missing the required parameter 'accountId' when calling listPayments");
        }
      
      // create path and map variables
      String localVarPath = "/v2/accounts/{accountId}/billing_payments".replaceAll("\\{format\\}","json")
        .replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));
  
      // query params
      java.util.List<Pair> localVarQueryParams = new java.util.ArrayList<Pair>();
      java.util.Map<String, String> localVarHeaderParams = new java.util.HashMap<String, String>();
      java.util.Map<String, Object> localVarFormParams = new java.util.HashMap<String, Object>();
  
      if (options != null) {
         localVarQueryParams.addAll(apiClient.parameterToPairs("", "from_date", options.fromDate));
         localVarQueryParams.addAll(apiClient.parameterToPairs("", "to_date", options.toDate));
      }
      
      
        final String[] localVarAccepts = {
      "application/json"
        };
        final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
  
        final String[] localVarContentTypes = {
      
        };
        final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
  
        String[] localVarAuthNames = new String[] { "docusignAccessCode" }; //{  };
  
          GenericType<BillingPaymentsResponse> localVarReturnType = new GenericType<BillingPaymentsResponse>() {};
          return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
            }
docs: Gets payment information for one or more payments.
  Retrieves a list containing information about one or more payments. If the from date or to date queries are not used, the response returns payment information for the last 365 days.   Privileges required: account administrator
  @param accountId The external account number (int) or account ID Guid. (required)
  @param options for modifying the method behavior.
  @return BillingPaymentsResponse
  @throws ApiException if fails to make API call