src/main/java/com/squareup/connect/api/OrdersApi.java
public SearchOrdersResponse searchOrders(SearchOrdersRequest body) throws ApiException {
    Object localVarPostBody = body;
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling searchOrders");
    }
    
    // create path and map variables
    String localVarPath = "/v2/orders/search";

    // 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<SearchOrdersResponse> localVarReturnType = new GenericType<SearchOrdersResponse>() {};
    CompleteResponse<SearchOrdersResponse> completeResponse = (CompleteResponse<SearchOrdersResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
/**
   * SearchOrders
   * Search all orders for one or more locations. Orders include all sales, returns, and exchanges regardless of how or when they entered the Square Ecosystem (e.g. Point of Sale, Invoices, Connect APIs, etc).  SearchOrders requests need to specify which locations to search and define a [&#x60;SearchOrdersQuery&#x60;](#type-searchordersquery) object which controls how to sort or filter the results. Your SearchOrdersQuery can:    Set filter criteria.   Set sort order.   Determine whether to return results as complete Order objects, or as [OrderEntry](#type-orderentry) objects.  Note that details for orders processed with Square Point of Sale while in offline mode may not be transmitted to Square for up to 72 hours. Offline orders have a &#x60;created_at&#x60; value that reflects the time the order was created, not the time it was subsequently transmitted to Square.
   * @param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
   * @return SearchOrdersResponse
   * @throws ApiException if fails to make API call
   */
SearchOrders
Search all orders for one or more locations. Orders include all sales, returns, and exchanges regardless of how or when they entered the Square Ecosystem .  SearchOrders requests need to specify which locations to search and define a [`SearchOrdersQuery`](#type-searchordersquery) object which controls how to sort or filter the results. Your SearchOrdersQuery can:    Set filter criteria.   Set sort order.   Determine whether to return results as complete Order objects, or as [OrderEntry](#type-orderentry) objects.  Note that details for orders processed with Square Point of Sale while in offline mode may not be transmitted to Square for up to 72 hours. Offline orders have a `created_at` value that reflects the time the order was created, not the time it was subsequently transmitted to Square.
@param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
@return SearchOrdersResponse
@throws ApiException if fails to make API call
SearchOrders Search all orders for one or more locations . Orders include all sales returns and exchanges regardless of how or when they entered the Square Ecosystem . SearchOrders requests need to specify which locations to search and define a [ ` SearchOrdersQuery ` ] ( #type - searchordersquery ) object which controls how to sort or filter the results . Your SearchOrdersQuery can : Set filter criteria . Set sort order . Determine whether to return results as complete Order objects or as [ OrderEntry ] ( #type - orderentry ) objects . Note that details for orders processed with Square Point of Sale while in offline mode may not be transmitted to Square for up to 72 hours . Offline orders have a ` created_at ` value that reflects the time the order was created not the time it was subsequently transmitted to Square . @param body An object containing the fields to POST for the request . See the corresponding object definition for field details . ( required ) @return SearchOrdersResponse @throws ApiException if fails to make API call
public SearchOrdersResponse searchOrders(SearchOrdersRequest body) throws ApiException {
    Object localVarPostBody = body;
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling searchOrders");
    }
    String localVarPath = "/v2/orders/search";
    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<SearchOrdersResponse> localVarReturnType = new GenericType<SearchOrdersResponse>() {};
    CompleteResponse<SearchOrdersResponse> completeResponse = (CompleteResponse<SearchOrdersResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
public SearchOrdersResponse searchOrders ( SearchOrdersRequest body ) throws ApiException { Object localVarPostBody = body ; if ( body == null ) { throw new ApiException ( 400 , "Missing the required parameter 'body' when calling searchOrders" ) ; } String localVarPath = "/v2/orders/search" ; 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 < SearchOrdersResponse > localVarReturnType = new GenericType < SearchOrdersResponse > ( ) { } ; CompleteResponse < SearchOrdersResponse > completeResponse = ( CompleteResponse < SearchOrdersResponse > ) apiClient . invokeAPI ( localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; return completeResponse . getData ( ) ; }
SearchOrders
 Search all orders for one or more locations.
SearchOrders Search all orders for one or more locations .
// verify the required parameter 'body' is set // create path and map variables // query params