src/main/java/com/squareup/connect/api/V1ItemsApi.java
@Deprecated
  public V1Item createItem(String locationId, V1Item 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 createItem");
    }
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createItem");
    }
    
    // create path and map variables
    String localVarPath = "/v1/{location_id}/items"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.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<V1Item> localVarReturnType = new GenericType<V1Item>() {};
    CompleteResponse<V1Item> completeResponse = (CompleteResponse<V1Item>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
/**
   * CreateItem
   * Creates an item and at least one variation for it.  ---  - __Deprecation date__: 2019-11-20 - [__Retirement date__](/build-basics/api-lifecycle#deprecated): 2020-11-18 - [Migration guide](/migrate-from-v1/guides/v1-items)  ---   Item-related entities include fields you can use to associate them with entities in a non-Square system.  When you create an item-related entity, you can optionally specify &#x60;id&#x60;. This value must be unique among all IDs ever specified for the account, including those specified by other applications. You can never reuse an entity ID. If you do not specify an ID, Square generates one for the entity.  Item variations have a &#x60;user_data&#x60; string that lets you associate arbitrary metadata with the variation. The string cannot exceed 255 characters.
   * @param locationId The ID of the location to create an item for. (required)
   * @param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
   * @return V1Item
   * @throws ApiException if fails to make API call
   */
CreateItem
Creates an item and at least one variation for it.
CreateItem Creates an item and at least one variation for it .
@Deprecated
  public V1Item createItem(String locationId, V1Item body) throws ApiException {
    Object localVarPostBody = body;
    if (locationId == null) {
      throw new ApiException(400, "Missing the required parameter 'locationId' when calling createItem");
    }
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createItem");
    }
    String localVarPath = "/v1/{location_id}/items"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.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<V1Item> localVarReturnType = new GenericType<V1Item>() {};
    CompleteResponse<V1Item> completeResponse = (CompleteResponse<V1Item>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
@ Deprecated public V1Item createItem ( String locationId , V1Item body ) throws ApiException { Object localVarPostBody = body ; if ( locationId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'locationId' when calling createItem" ) ; } if ( body == null ) { throw new ApiException ( 400 , "Missing the required parameter 'body' when calling createItem" ) ; } String localVarPath = "/v1/{location_id}/items" . replaceAll ( "\\{" + "location_id" + "\\}" , apiClient . escapeString ( locationId . 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 < V1Item > localVarReturnType = new GenericType < V1Item > ( ) { } ; CompleteResponse < V1Item > completeResponse = ( CompleteResponse < V1Item > ) apiClient . invokeAPI ( localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; return completeResponse . getData ( ) ; }
CreateItem
 Creates an item and at least one variation for it.
CreateItem Creates an item and at least one variation for it .
// verify the required parameter 'locationId' is set // verify the required parameter 'body' is set // create path and map variables // query params