class Retailigence::Inventory
Retrieve the inventory for a product at a specific location.
Attributes¶ ↑
-
product_id
- The Product#id -
retailer_id
- The Retailer#id -
location_id
- The Location#id -
price
- The price -
currency
- The price’s respective currency -
quantity
- Number of items in stock -
quantity_text
- Detail about the current stock -
product_name
- The Product#name
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¶ ↑
# 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