All URIs are relative to https://connect.squareup.com
Method | HTTP request | Description |
---|---|---|
batchChangeInventory | POST /v2/inventory/batch-change | BatchChangeInventory |
batchRetrieveInventoryChanges | POST /v2/inventory/batch-retrieve-changes | BatchRetrieveInventoryChanges |
batchRetrieveInventoryCounts | POST /v2/inventory/batch-retrieve-counts | BatchRetrieveInventoryCounts |
retrieveInventoryAdjustment | GET /v2/inventory/adjustment/{adjustment_id} | RetrieveInventoryAdjustment |
retrieveInventoryChanges | GET /v2/inventory/{catalog_object_id}/changes | RetrieveInventoryChanges |
retrieveInventoryCount | GET /v2/inventory/{catalog_object_id} | RetrieveInventoryCount |
retrieveInventoryPhysicalCount | GET /v2/inventory/physical-count/{physical_count_id} | RetrieveInventoryPhysicalCount |
BatchChangeInventoryResponse batchChangeInventory(body)
BatchChangeInventory
Applies adjustments and counts to the provided item quantities. On success: returns the current calculated counts for all objects referenced in the request. On failure: returns a list of related errors.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
BatchChangeInventoryRequest body = new BatchChangeInventoryRequest(); // BatchChangeInventoryRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
BatchChangeInventoryResponse result = apiInstance.batchChangeInventory(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#batchChangeInventory");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | BatchChangeInventoryRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
- Content-Type: application/json
- Accept: application/json
BatchRetrieveInventoryChangesResponse batchRetrieveInventoryChanges(body)
BatchRetrieveInventoryChanges
Returns historical physical counts and adjustments based on the provided filter criteria. Results are paginated and sorted in ascending order according their `occurred_at` timestamp (oldest first). BatchRetrieveInventoryChanges is a catch-all query endpoint for queries that cannot be handled by other, simpler endpoints.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest(); // BatchRetrieveInventoryChangesRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
BatchRetrieveInventoryChangesResponse result = apiInstance.batchRetrieveInventoryChanges(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#batchRetrieveInventoryChanges");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | BatchRetrieveInventoryChangesRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
BatchRetrieveInventoryChangesResponse
- Content-Type: application/json
- Accept: application/json
BatchRetrieveInventoryCountsResponse batchRetrieveInventoryCounts(body)
BatchRetrieveInventoryCounts
Returns current counts for the provided CatalogObjects at the requested Locations. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_after` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a "sync" operation, for example in response to receiving a Webhook notification.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest(); // BatchRetrieveInventoryCountsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
BatchRetrieveInventoryCountsResponse result = apiInstance.batchRetrieveInventoryCounts(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#batchRetrieveInventoryCounts");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | BatchRetrieveInventoryCountsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
BatchRetrieveInventoryCountsResponse
- Content-Type: application/json
- Accept: application/json
RetrieveInventoryAdjustmentResponse retrieveInventoryAdjustment(adjustmentId)
RetrieveInventoryAdjustment
Returns the InventoryAdjustment object with the provided `adjustment_id`.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
String adjustmentId = "adjustmentId_example"; // String | ID of the `InventoryAdjustment` to retrieve.
try {
RetrieveInventoryAdjustmentResponse result = apiInstance.retrieveInventoryAdjustment(adjustmentId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#retrieveInventoryAdjustment");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
adjustmentId | String | ID of the `InventoryAdjustment` to retrieve. |
RetrieveInventoryAdjustmentResponse
- Content-Type: application/json
- Accept: application/json
RetrieveInventoryChangesResponse retrieveInventoryChanges(catalogObjectId, locationIds, cursor)
RetrieveInventoryChanges
Returns a set of physical counts and inventory adjustments for the provided CatalogObject at the requested Locations. Results are paginated and sorted in descending order according to their `occurred_at` timestamp (newest first). There are no limits on how far back the caller can page. This endpoint is useful when displaying recent changes for a specific item. For more sophisticated queries, use a batch endpoint.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
String catalogObjectId = "catalogObjectId_example"; // String | ID of the `CatalogObject` to retrieve.
String locationIds = "locationIds_example"; // String | The `Location` IDs to look up as a comma-separated list. An empty list queries all locations.
String cursor = "cursor_example"; // String | 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 the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information.
try {
RetrieveInventoryChangesResponse result = apiInstance.retrieveInventoryChanges(catalogObjectId, locationIds, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#retrieveInventoryChanges");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
catalogObjectId | String | ID of the `CatalogObject` to retrieve. | |
locationIds | String | The `Location` IDs to look up as a comma-separated list. An empty list queries all locations. | [optional] |
cursor | String | 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 the Pagination guide for more information. | [optional] |
RetrieveInventoryChangesResponse
- Content-Type: application/json
- Accept: application/json
RetrieveInventoryCountResponse retrieveInventoryCount(catalogObjectId, locationIds, cursor)
RetrieveInventoryCount
Retrieves the current calculated stock count for a given CatalogObject at a given set of Locations. Responses are paginated and unsorted. For more sophisticated queries, use a batch endpoint.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
String catalogObjectId = "catalogObjectId_example"; // String | ID of the `CatalogObject` to retrieve.
String locationIds = "locationIds_example"; // String | The `Location` IDs to look up as a comma-separated list. An empty list queries all locations.
String cursor = "cursor_example"; // String | 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 the [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination) guide for more information.
try {
RetrieveInventoryCountResponse result = apiInstance.retrieveInventoryCount(catalogObjectId, locationIds, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#retrieveInventoryCount");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
catalogObjectId | String | ID of the `CatalogObject` to retrieve. | |
locationIds | String | The `Location` IDs to look up as a comma-separated list. An empty list queries all locations. | [optional] |
cursor | String | 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 the Pagination guide for more information. | [optional] |
RetrieveInventoryCountResponse
- Content-Type: application/json
- Accept: application/json
RetrieveInventoryPhysicalCountResponse retrieveInventoryPhysicalCount(physicalCountId)
RetrieveInventoryPhysicalCount
Returns the InventoryPhysicalCount object with the provided `physical_count_id`.
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.InventoryApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");
InventoryApi apiInstance = new InventoryApi();
String physicalCountId = "physicalCountId_example"; // String | ID of the `InventoryPhysicalCount` to retrieve.
try {
RetrieveInventoryPhysicalCountResponse result = apiInstance.retrieveInventoryPhysicalCount(physicalCountId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InventoryApi#retrieveInventoryPhysicalCount");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
physicalCountId | String | ID of the `InventoryPhysicalCount` to retrieve. |
RetrieveInventoryPhysicalCountResponse
- Content-Type: application/json
- Accept: application/json