inventory_api = client.inventory
InventoryApi
- Deprecated Retrieve Inventory Adjustment
- Retrieve Inventory Adjustment
- Deprecated Batch Change Inventory
- Deprecated Batch Retrieve Inventory Changes
- Deprecated Batch Retrieve Inventory Counts
- Batch Change Inventory
- Batch Retrieve Inventory Changes
- Batch Retrieve Inventory Counts
- Deprecated Retrieve Inventory Physical Count
- Retrieve Inventory Physical Count
- Retrieve Inventory Transfer
- Retrieve Inventory Count
- Retrieve Inventory Changes
This endpoint is deprecated.
Deprecated version of RetrieveInventoryAdjustment after the endpoint URL is updated to conform to the standard convention.
def deprecated_retrieve_inventory_adjustment(adjustment_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
adjustment_id |
String |
Template, Required | ID of the InventoryAdjustment to retrieve. |
Retrieve Inventory Adjustment Response Hash
adjustment_id = 'adjustment_id0'
result = inventory_api.deprecated_retrieve_inventory_adjustment(adjustment_id: adjustment_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Returns the InventoryAdjustment object
with the provided adjustment_id
.
def retrieve_inventory_adjustment(adjustment_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
adjustment_id |
String |
Template, Required | ID of the InventoryAdjustment to retrieve. |
Retrieve Inventory Adjustment Response Hash
adjustment_id = 'adjustment_id0'
result = inventory_api.retrieve_inventory_adjustment(adjustment_id: adjustment_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
This endpoint is deprecated.
Deprecated version of BatchChangeInventory after the endpoint URL is updated to conform to the standard convention.
def deprecated_batch_change_inventory(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Batch Change Inventory Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Batch Change Inventory Response Hash
body = {}
body[:idempotency_key] = '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe'
body[:changes] = []
body[:changes][0] = {}
body[:changes][0][:type] = 'PHYSICAL_COUNT'
body[:changes][0][:physical_count] = {}
body[:changes][0][:physical_count][:reference_id] = '1536bfbf-efed-48bf-b17d-a197141b2a92'
body[:changes][0][:physical_count][:catalog_object_id] = 'W62UWFY35CWMYGVWK6TWJDNI'
body[:changes][0][:physical_count][:state] = 'IN_STOCK'
body[:changes][0][:physical_count][:location_id] = 'C6W5YS5QM06F5'
body[:changes][0][:physical_count][:quantity] = '53'
body[:changes][0][:physical_count][:team_member_id] = 'LRK57NSQ5X7PUD05'
body[:changes][0][:physical_count][:occurred_at] = '2016-11-16T22:25:24.878Z'
body[:ignore_unchanged_counts] = true
result = inventory_api.deprecated_batch_change_inventory(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
This endpoint is deprecated.
Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL is updated to conform to the standard convention.
def deprecated_batch_retrieve_inventory_changes(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Batch Retrieve Inventory Changes Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Batch Retrieve Inventory Changes Response Hash
body = {}
body[:catalog_object_ids] = ['W62UWFY35CWMYGVWK6TWJDNI']
body[:location_ids] = ['C6W5YS5QM06F5']
body[:types] = ['PHYSICAL_COUNT']
body[:states] = ['IN_STOCK']
body[:updated_after] = '2016-11-01T00:00:00Z'
body[:updated_before] = '2016-12-01T00:00:00Z'
result = inventory_api.deprecated_batch_retrieve_inventory_changes(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
This endpoint is deprecated.
Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL is updated to conform to the standard convention.
def deprecated_batch_retrieve_inventory_counts(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Batch Retrieve Inventory Counts Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Batch Retrieve Inventory Counts Response Hash
body = {}
body[:catalog_object_ids] = ['W62UWFY35CWMYGVWK6TWJDNI']
body[:location_ids] = ['59TNP9SA8VGDA']
body[:updated_after] = '2016-11-16T00:00:00Z'
result = inventory_api.deprecated_batch_retrieve_inventory_counts(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def batch_change_inventory(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Batch Change Inventory Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Batch Change Inventory Response Hash
body = {}
body[:idempotency_key] = '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe'
body[:changes] = []
body[:changes][0] = {}
body[:changes][0][:type] = 'PHYSICAL_COUNT'
body[:changes][0][:physical_count] = {}
body[:changes][0][:physical_count][:reference_id] = '1536bfbf-efed-48bf-b17d-a197141b2a92'
body[:changes][0][:physical_count][:catalog_object_id] = 'W62UWFY35CWMYGVWK6TWJDNI'
body[:changes][0][:physical_count][:state] = 'IN_STOCK'
body[:changes][0][:physical_count][:location_id] = 'C6W5YS5QM06F5'
body[:changes][0][:physical_count][:quantity] = '53'
body[:changes][0][:physical_count][:team_member_id] = 'LRK57NSQ5X7PUD05'
body[:changes][0][:physical_count][:occurred_at] = '2016-11-16T22:25:24.878Z'
body[:ignore_unchanged_counts] = true
result = inventory_api.batch_change_inventory(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def batch_retrieve_inventory_changes(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Batch Retrieve Inventory Changes Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Batch Retrieve Inventory Changes Response Hash
body = {}
body[:catalog_object_ids] = ['W62UWFY35CWMYGVWK6TWJDNI']
body[:location_ids] = ['C6W5YS5QM06F5']
body[:types] = ['PHYSICAL_COUNT']
body[:states] = ['IN_STOCK']
body[:updated_after] = '2016-11-01T00:00:00Z'
body[:updated_before] = '2016-12-01T00:00:00Z'
result = inventory_api.batch_retrieve_inventory_changes(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def batch_retrieve_inventory_counts(body:)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
Batch Retrieve Inventory Counts Request Hash |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Batch Retrieve Inventory Counts Response Hash
body = {}
body[:catalog_object_ids] = ['W62UWFY35CWMYGVWK6TWJDNI']
body[:location_ids] = ['59TNP9SA8VGDA']
body[:updated_after] = '2016-11-16T00:00:00Z'
result = inventory_api.batch_retrieve_inventory_counts(body: body)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
This endpoint is deprecated.
Deprecated version of RetrieveInventoryPhysicalCount after the endpoint URL is updated to conform to the standard convention.
def deprecated_retrieve_inventory_physical_count(physical_count_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
physical_count_id |
String |
Template, Required | ID of the InventoryPhysicalCount to retrieve. |
Retrieve Inventory Physical Count Response Hash
physical_count_id = 'physical_count_id2'
result = inventory_api.deprecated_retrieve_inventory_physical_count(physical_count_id: physical_count_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Returns the InventoryPhysicalCount
object with the provided physical_count_id
.
def retrieve_inventory_physical_count(physical_count_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
physical_count_id |
String |
Template, Required | ID of the InventoryPhysicalCount to retrieve. |
Retrieve Inventory Physical Count Response Hash
physical_count_id = 'physical_count_id2'
result = inventory_api.retrieve_inventory_physical_count(physical_count_id: physical_count_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
Returns the InventoryTransfer object
with the provided transfer_id
.
def retrieve_inventory_transfer(transfer_id:)
Parameter | Type | Tags | Description |
---|---|---|---|
transfer_id |
String |
Template, Required | ID of the InventoryTransfer to retrieve. |
Retrieve Inventory Transfer Response Hash
transfer_id = 'transfer_id6'
result = inventory_api.retrieve_inventory_transfer(transfer_id: transfer_id)
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def retrieve_inventory_count(catalog_object_id:,
location_ids: nil,
cursor: nil)
Parameter | Type | Tags | Description |
---|---|---|---|
catalog_object_id |
String |
Template, Required | ID of the CatalogObject to retrieve. |
location_ids |
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. |
Retrieve Inventory Count Response Hash
catalog_object_id = 'catalog_object_id6'
result = inventory_api.retrieve_inventory_count(catalog_object_id: catalog_object_id, )
if result.success?
puts result.data
elsif result.error?
warn result.errors
end
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.
def retrieve_inventory_changes(catalog_object_id:,
location_ids: nil,
cursor: nil)
Parameter | Type | Tags | Description |
---|---|---|---|
catalog_object_id |
String |
Template, Required | ID of the CatalogObject to retrieve. |
location_ids |
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. |
Retrieve Inventory Changes Response Hash
catalog_object_id = 'catalog_object_id6'
result = inventory_api.retrieve_inventory_changes(catalog_object_id: catalog_object_id, )
if result.success?
puts result.data
elsif result.error?
warn result.errors
end