class Retailigence::Inventory

Retrieve the inventory for a product at a specific location.

Attributes

Public Class Methods

fetch(product_id = nil, location_id = nil) click to toggle source

Retrieve the inventory information for the provided product_id and location_id

Returns

Inventory

# File lib/retailigence/inventory.rb, line 22
def self.fetch(product_id = nil, location_id = nil)
  params = {
    productId: product_id,
    locationId: location_id
  }

  results = get('inventory', params)['RetailigenceAPIResult']['results']

  Inventory.new(results.first['ProductLocation'])
end