Skip to content

Latest commit

 

History

History
612 lines (423 loc) · 18.5 KB

inventory.md

File metadata and controls

612 lines (423 loc) · 18.5 KB

Inventory

inventory_api = client.inventory

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.

def deprecated_retrieve_inventory_adjustment(adjustment_id:)

Parameters

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

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Adjustment Response Hash.

Example Usage

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

Retrieve Inventory Adjustment

Returns the InventoryAdjustment object with the provided adjustment_id.

def retrieve_inventory_adjustment(adjustment_id:)

Parameters

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

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Adjustment Response Hash.

Example Usage

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

Deprecated Batch Change Inventory

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:)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Batch Change Inventory Response Hash.

Example Usage

body = {
  :idempotency_key => '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe',
  :changes => [
    {
      :type => 'PHYSICAL_COUNT',
      :physical_count => {
        :reference_id => '1536bfbf-efed-48bf-b17d-a197141b2a92',
        :catalog_object_id => 'W62UWFY35CWMYGVWK6TWJDNI',
        :state => 'IN_STOCK',
        :location_id => 'C6W5YS5QM06F5',
        :quantity => '53',
        :team_member_id => 'LRK57NSQ5X7PUD05',
        :occurred_at => '2016-11-16T22:25:24.878Z'
      }
    }
  ],
  :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

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.

def deprecated_batch_retrieve_inventory_changes(body:)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Batch Retrieve Inventory Changes Response Hash.

Example Usage

body = {
  :catalog_object_ids => [
    'W62UWFY35CWMYGVWK6TWJDNI'
  ],
  :location_ids => [
    'C6W5YS5QM06F5'
  ],
  :types => [
    'PHYSICAL_COUNT'
  ],
  :states => [
    'IN_STOCK'
  ],
  :updated_after => '2016-11-01T00:00:00.000Z',
  :updated_before => '2016-12-01T00:00:00.000Z'
}


result = inventory_api.deprecated_batch_retrieve_inventory_changes(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

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.

def deprecated_batch_retrieve_inventory_counts(body:)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Batch Retrieve Inventory Counts Response Hash.

Example Usage

body = {
  :catalog_object_ids => [
    'W62UWFY35CWMYGVWK6TWJDNI'
  ],
  :location_ids => [
    '59TNP9SA8VGDA'
  ],
  :updated_after => '2016-11-16T00:00:00.000Z'
}


result = inventory_api.deprecated_batch_retrieve_inventory_counts(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

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.

def batch_change_inventory(body:)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Batch Change Inventory Response Hash.

Example Usage

body = {
  :idempotency_key => '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe',
  :changes => [
    {
      :type => 'PHYSICAL_COUNT',
      :physical_count => {
        :reference_id => '1536bfbf-efed-48bf-b17d-a197141b2a92',
        :catalog_object_id => 'W62UWFY35CWMYGVWK6TWJDNI',
        :state => 'IN_STOCK',
        :location_id => 'C6W5YS5QM06F5',
        :quantity => '53',
        :team_member_id => 'LRK57NSQ5X7PUD05',
        :occurred_at => '2016-11-16T22:25:24.878Z'
      }
    }
  ],
  :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

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.

def batch_retrieve_inventory_changes(body:)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Batch Retrieve Inventory Changes Response Hash.

Example Usage

body = {
  :catalog_object_ids => [
    'W62UWFY35CWMYGVWK6TWJDNI'
  ],
  :location_ids => [
    'C6W5YS5QM06F5'
  ],
  :types => [
    'PHYSICAL_COUNT'
  ],
  :states => [
    'IN_STOCK'
  ],
  :updated_after => '2016-11-01T00:00:00.000Z',
  :updated_before => '2016-12-01T00:00:00.000Z'
}


result = inventory_api.batch_retrieve_inventory_changes(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

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.

def batch_retrieve_inventory_counts(body:)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Batch Retrieve Inventory Counts Response Hash.

Example Usage

body = {
  :catalog_object_ids => [
    'W62UWFY35CWMYGVWK6TWJDNI'
  ],
  :location_ids => [
    '59TNP9SA8VGDA'
  ],
  :updated_after => '2016-11-16T00:00:00.000Z'
}


result = inventory_api.batch_retrieve_inventory_counts(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

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.

def deprecated_retrieve_inventory_physical_count(physical_count_id:)

Parameters

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

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Physical Count Response Hash.

Example Usage

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

Retrieve Inventory Physical Count

Returns the InventoryPhysicalCount object with the provided physical_count_id.

def retrieve_inventory_physical_count(physical_count_id:)

Parameters

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

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Physical Count Response Hash.

Example Usage

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

Retrieve Inventory Transfer

Returns the InventoryTransfer object with the provided transfer_id.

def retrieve_inventory_transfer(transfer_id:)

Parameters

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

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Transfer Response Hash.

Example Usage

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

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.

def retrieve_inventory_count(catalog_object_id:,
                             location_ids: nil,
                             cursor: nil)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Count Response Hash.

Example Usage

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

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.

def retrieve_inventory_changes(catalog_object_id:,
                               location_ids: nil,
                               cursor: nil)

Parameters

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.

Response Type

This method returns a ApiResponse instance. The data property in this instance returns the response data which is of type Retrieve Inventory Changes Response Hash.

Example Usage

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