src/main/java/com/squareup/connect/api/TransactionsApi.java
@Deprecated
  public CreateRefundResponse createRefund(String locationId, String transactionId, CreateRefundRequest body) throws ApiException {
    Object localVarPostBody = body;
    
    // verify the required parameter 'locationId' is set
    if (locationId == null) {
      throw new ApiException(400, "Missing the required parameter 'locationId' when calling createRefund");
    }
    
    // verify the required parameter 'transactionId' is set
    if (transactionId == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionId' when calling createRefund");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createRefund");
    }
    
    // create path and map variables
    String localVarPath = "/v2/locations/{location_id}/transactions/{transaction_id}/refund"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
      .replaceAll("\\{" + "transaction_id" + "\\}", apiClient.escapeString(transactionId.toString()));

    // 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");

    
    
    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<CreateRefundResponse> localVarReturnType = new GenericType<CreateRefundResponse>() {};
    CompleteResponse<CreateRefundResponse> completeResponse = (CompleteResponse<CreateRefundResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
/**
   * CreateRefund
   * Initiates a refund for a previously charged tender.  Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment)  You must issue a refund within 120 days of the associated payment. See [this article](https://squareup.com/help/us/en/article/5060) for more information on refund behavior.  NOTE: Card-present transactions with Interac credit cards **cannot be refunded using the Connect API**. Interac transactions must refunded in-person (e.g., dipping the card using POS app).
   * @param locationId The ID of the original transaction&#39;s associated location. (required)
   * @param transactionId The ID of the original transaction that includes the tender to refund. (required)
   * @param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
   * @return CreateRefundResponse
   * @throws ApiException if fails to make API call
   */
CreateRefund
Initiates a refund for a previously charged tender.  Deprecated - recommend using [RefundPayment](#endpoint-refunds-refundpayment)  You must issue a refund within 120 days of the associated payment. See [this article] for more information on refund behavior.  NOTE: Card-present transactions with Interac credit cards **cannot be refunded using the Connect API**. Interac transactions must refunded in-person .
@param locationId The ID of the original transaction's associated location. (required)
@param transactionId The ID of the original transaction that includes the tender to refund. (required)
@param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
@return CreateRefundResponse
@throws ApiException if fails to make API call
CreateRefund Initiates a refund for a previously charged tender . Deprecated - recommend using [ RefundPayment ] ( #endpoint - refunds - refundpayment ) You must issue a refund within 120 days of the associated payment . See [ this article ] for more information on refund behavior . NOTE : Card - present transactions with Interac credit cards ** cannot be refunded using the Connect API ** . Interac transactions must refunded in - person . @param locationId The ID of the original transaction ' s associated location . ( required ) @param transactionId The ID of the original transaction that includes the tender to refund . ( required ) @param body An object containing the fields to POST for the request . See the corresponding object definition for field details . ( required ) @return CreateRefundResponse @throws ApiException if fails to make API call
@Deprecated
  public CreateRefundResponse createRefund(String locationId, String transactionId, CreateRefundRequest body) throws ApiException {
    Object localVarPostBody = body;
    if (locationId == null) {
      throw new ApiException(400, "Missing the required parameter 'locationId' when calling createRefund");
    }
    if (transactionId == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionId' when calling createRefund");
    }
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createRefund");
    }
    String localVarPath = "/v2/locations/{location_id}/transactions/{transaction_id}/refund"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
      .replaceAll("\\{" + "transaction_id" + "\\}", apiClient.escapeString(transactionId.toString()));
    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");
    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<CreateRefundResponse> localVarReturnType = new GenericType<CreateRefundResponse>() {};
    CompleteResponse<CreateRefundResponse> completeResponse = (CompleteResponse<CreateRefundResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
@ Deprecated public CreateRefundResponse createRefund ( String locationId , String transactionId , CreateRefundRequest body ) throws ApiException { Object localVarPostBody = body ; if ( locationId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'locationId' when calling createRefund" ) ; } if ( transactionId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'transactionId' when calling createRefund" ) ; } if ( body == null ) { throw new ApiException ( 400 , "Missing the required parameter 'body' when calling createRefund" ) ; } String localVarPath = "/v2/locations/{location_id}/transactions/{transaction_id}/refund" . replaceAll ( "\\{" + "location_id" + "\\}" , apiClient . escapeString ( locationId . toString ( ) ) ) . replaceAll ( "\\{" + "transaction_id" + "\\}" , apiClient . escapeString ( transactionId . toString ( ) ) ) ; 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" ) ; 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 < CreateRefundResponse > localVarReturnType = new GenericType < CreateRefundResponse > ( ) { } ; CompleteResponse < CreateRefundResponse > completeResponse = ( CompleteResponse < CreateRefundResponse > ) apiClient . invokeAPI ( localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; return completeResponse . getData ( ) ; }
CreateRefund
 Initiates a refund for a previously charged tender.
CreateRefund Initiates a refund for a previously charged tender .
// verify the required parameter 'locationId' is set // verify the required parameter 'transactionId' is set // verify the required parameter 'body' is set // create path and map variables // query params