Skip to content

Latest commit

 

History

History
627 lines (464 loc) · 20.5 KB

inventory.md

File metadata and controls

627 lines (464 loc) · 20.5 KB

Inventory

InventoryApi inventoryApi = client.getInventoryApi();

Class Name

InventoryApi

Methods

Deprecated Retrieve Inventory Adjustment

This endpoint is deprecated.

Deprecated version of RetrieveInventoryAdjustment after the endpoint URL is updated to conform to the standard convention.

CompletableFuture<RetrieveInventoryAdjustmentResponse> deprecatedRetrieveInventoryAdjustmentAsync(
    final String adjustmentId)

Parameters

Parameter Type Tags Description
adjustmentId String Template, Required ID of the InventoryAdjustment to retrieve.

Response Type

RetrieveInventoryAdjustmentResponse

Example Usage

String adjustmentId = "adjustment_id0";

inventoryApi.deprecatedRetrieveInventoryAdjustmentAsync(adjustmentId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Retrieve Inventory Adjustment

Returns the InventoryAdjustment object with the provided adjustment_id.

CompletableFuture<RetrieveInventoryAdjustmentResponse> retrieveInventoryAdjustmentAsync(
    final String adjustmentId)

Parameters

Parameter Type Tags Description
adjustmentId String Template, Required ID of the InventoryAdjustment to retrieve.

Response Type

RetrieveInventoryAdjustmentResponse

Example Usage

String adjustmentId = "adjustment_id0";

inventoryApi.retrieveInventoryAdjustmentAsync(adjustmentId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Deprecated Batch Change Inventory

This endpoint is deprecated.

Deprecated version of BatchChangeInventory after the endpoint URL is updated to conform to the standard convention.

CompletableFuture<BatchChangeInventoryResponse> deprecatedBatchChangeInventoryAsync(
    final BatchChangeInventoryRequest body)

Parameters

Parameter Type Tags Description
body BatchChangeInventoryRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

BatchChangeInventoryResponse

Example Usage

BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder(
    "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe"
)
.changes(Arrays.asList(
        new InventoryChange.Builder()
            .type("PHYSICAL_COUNT")
            .physicalCount(new InventoryPhysicalCount.Builder()
                .referenceId("1536bfbf-efed-48bf-b17d-a197141b2a92")
                .catalogObjectId("W62UWFY35CWMYGVWK6TWJDNI")
                .state("IN_STOCK")
                .locationId("C6W5YS5QM06F5")
                .quantity("53")
                .teamMemberId("LRK57NSQ5X7PUD05")
                .occurredAt("2016-11-16T22:25:24.878Z")
                .build())
            .build()
    ))
.ignoreUnchangedCounts(true)
.build();

inventoryApi.deprecatedBatchChangeInventoryAsync(body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Deprecated Batch Retrieve Inventory Changes

This endpoint is deprecated.

Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL is updated to conform to the standard convention.

CompletableFuture<BatchRetrieveInventoryChangesResponse> deprecatedBatchRetrieveInventoryChangesAsync(
    final BatchRetrieveInventoryChangesRequest body)

Parameters

Parameter Type Tags Description
body BatchRetrieveInventoryChangesRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

BatchRetrieveInventoryChangesResponse

Example Usage

BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest.Builder()
    .catalogObjectIds(Arrays.asList(
        "W62UWFY35CWMYGVWK6TWJDNI"
    ))
    .locationIds(Arrays.asList(
        "C6W5YS5QM06F5"
    ))
    .types(Arrays.asList(
        "PHYSICAL_COUNT"
    ))
    .states(Arrays.asList(
        "IN_STOCK"
    ))
    .updatedAfter("2016-11-01T00:00:00.000Z")
    .updatedBefore("2016-12-01T00:00:00.000Z")
    .build();

inventoryApi.deprecatedBatchRetrieveInventoryChangesAsync(body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Deprecated Batch Retrieve Inventory Counts

This endpoint is deprecated.

Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL is updated to conform to the standard convention.

CompletableFuture<BatchRetrieveInventoryCountsResponse> deprecatedBatchRetrieveInventoryCountsAsync(
    final BatchRetrieveInventoryCountsRequest body)

Parameters

Parameter Type Tags Description
body BatchRetrieveInventoryCountsRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

BatchRetrieveInventoryCountsResponse

Example Usage

BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest.Builder()
    .catalogObjectIds(Arrays.asList(
        "W62UWFY35CWMYGVWK6TWJDNI"
    ))
    .locationIds(Arrays.asList(
        "59TNP9SA8VGDA"
    ))
    .updatedAfter("2016-11-16T00:00:00.000Z")
    .build();

inventoryApi.deprecatedBatchRetrieveInventoryCountsAsync(body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Batch Change Inventory

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.

CompletableFuture<BatchChangeInventoryResponse> batchChangeInventoryAsync(
    final BatchChangeInventoryRequest body)

Parameters

Parameter Type Tags Description
body BatchChangeInventoryRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

BatchChangeInventoryResponse

Example Usage

BatchChangeInventoryRequest body = new BatchChangeInventoryRequest.Builder(
    "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe"
)
.changes(Arrays.asList(
        new InventoryChange.Builder()
            .type("PHYSICAL_COUNT")
            .physicalCount(new InventoryPhysicalCount.Builder()
                .referenceId("1536bfbf-efed-48bf-b17d-a197141b2a92")
                .catalogObjectId("W62UWFY35CWMYGVWK6TWJDNI")
                .state("IN_STOCK")
                .locationId("C6W5YS5QM06F5")
                .quantity("53")
                .teamMemberId("LRK57NSQ5X7PUD05")
                .occurredAt("2016-11-16T22:25:24.878Z")
                .build())
            .build()
    ))
.ignoreUnchangedCounts(true)
.build();

inventoryApi.batchChangeInventoryAsync(body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Batch Retrieve Inventory Changes

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.

CompletableFuture<BatchRetrieveInventoryChangesResponse> batchRetrieveInventoryChangesAsync(
    final BatchRetrieveInventoryChangesRequest body)

Parameters

Parameter Type Tags Description
body BatchRetrieveInventoryChangesRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

BatchRetrieveInventoryChangesResponse

Example Usage

BatchRetrieveInventoryChangesRequest body = new BatchRetrieveInventoryChangesRequest.Builder()
    .catalogObjectIds(Arrays.asList(
        "W62UWFY35CWMYGVWK6TWJDNI"
    ))
    .locationIds(Arrays.asList(
        "C6W5YS5QM06F5"
    ))
    .types(Arrays.asList(
        "PHYSICAL_COUNT"
    ))
    .states(Arrays.asList(
        "IN_STOCK"
    ))
    .updatedAfter("2016-11-01T00:00:00.000Z")
    .updatedBefore("2016-12-01T00:00:00.000Z")
    .build();

inventoryApi.batchRetrieveInventoryChangesAsync(body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Batch Retrieve Inventory Counts

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.

CompletableFuture<BatchRetrieveInventoryCountsResponse> batchRetrieveInventoryCountsAsync(
    final BatchRetrieveInventoryCountsRequest body)

Parameters

Parameter Type Tags Description
body BatchRetrieveInventoryCountsRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

BatchRetrieveInventoryCountsResponse

Example Usage

BatchRetrieveInventoryCountsRequest body = new BatchRetrieveInventoryCountsRequest.Builder()
    .catalogObjectIds(Arrays.asList(
        "W62UWFY35CWMYGVWK6TWJDNI"
    ))
    .locationIds(Arrays.asList(
        "59TNP9SA8VGDA"
    ))
    .updatedAfter("2016-11-16T00:00:00.000Z")
    .build();

inventoryApi.batchRetrieveInventoryCountsAsync(body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Deprecated Retrieve Inventory Physical Count

This endpoint is deprecated.

Deprecated version of RetrieveInventoryPhysicalCount after the endpoint URL is updated to conform to the standard convention.

CompletableFuture<RetrieveInventoryPhysicalCountResponse> deprecatedRetrieveInventoryPhysicalCountAsync(
    final String physicalCountId)

Parameters

Parameter Type Tags Description
physicalCountId String Template, Required ID of the
InventoryPhysicalCount to retrieve.

Response Type

RetrieveInventoryPhysicalCountResponse

Example Usage

String physicalCountId = "physical_count_id2";

inventoryApi.deprecatedRetrieveInventoryPhysicalCountAsync(physicalCountId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Retrieve Inventory Physical Count

Returns the InventoryPhysicalCount object with the provided physical_count_id.

CompletableFuture<RetrieveInventoryPhysicalCountResponse> retrieveInventoryPhysicalCountAsync(
    final String physicalCountId)

Parameters

Parameter Type Tags Description
physicalCountId String Template, Required ID of the
InventoryPhysicalCount to retrieve.

Response Type

RetrieveInventoryPhysicalCountResponse

Example Usage

String physicalCountId = "physical_count_id2";

inventoryApi.retrieveInventoryPhysicalCountAsync(physicalCountId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Retrieve Inventory Transfer

Returns the InventoryTransfer object with the provided transfer_id.

CompletableFuture<RetrieveInventoryTransferResponse> retrieveInventoryTransferAsync(
    final String transferId)

Parameters

Parameter Type Tags Description
transferId String Template, Required ID of the InventoryTransfer to retrieve.

Response Type

RetrieveInventoryTransferResponse

Example Usage

String transferId = "transfer_id6";

inventoryApi.retrieveInventoryTransferAsync(transferId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Retrieve Inventory Count

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.

CompletableFuture<RetrieveInventoryCountResponse> retrieveInventoryCountAsync(
    final String catalogObjectId,
    final String locationIds,
    final String cursor)

Parameters

Parameter Type Tags Description
catalogObjectId String Template, Required ID of the CatalogObject to retrieve.
locationIds String Query, Optional The Location IDs to look up as a comma-separated
list. An empty list queries all locations.
cursor String Query, Optional 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.

Response Type

RetrieveInventoryCountResponse

Example Usage

String catalogObjectId = "catalog_object_id6";

inventoryApi.retrieveInventoryCountAsync(catalogObjectId, null, null).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

Retrieve Inventory Changes

This endpoint is deprecated.

Returns a set of physical counts and inventory adjustments for the provided CatalogObject at the requested Locations.

You can achieve the same result by calling BatchRetrieveInventoryChanges and having the catalog_object_ids list contain a single element of the CatalogObject ID.

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 can be used to display recent changes for a specific item. For more sophisticated queries, use a batch endpoint.

CompletableFuture<RetrieveInventoryChangesResponse> retrieveInventoryChangesAsync(
    final String catalogObjectId,
    final String locationIds,
    final String cursor)

Parameters

Parameter Type Tags Description
catalogObjectId String Template, Required ID of the CatalogObject to retrieve.
locationIds String Query, Optional The Location IDs to look up as a comma-separated
list. An empty list queries all locations.
cursor String Query, Optional 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.

Response Type

RetrieveInventoryChangesResponse

Example Usage

String catalogObjectId = "catalog_object_id6";

inventoryApi.retrieveInventoryChangesAsync(catalogObjectId, null, null).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});