Module: LoyverseApi::Endpoints::Inventory
- Included in:
- Client
- Defined in:
- lib/loyverse_api/endpoints/inventory.rb
Instance Method Summary collapse
-
#list_inventory(variant_id: nil, store_id: nil, updated_at_min: nil, updated_at_max: nil, limit: 250, cursor: nil) ⇒ Hash
List inventory levels.
-
#update_inventory(variant_id:, store_id:, in_stock:) ⇒ Hash
Update inventory level for a variant at a specific store.
Instance Method Details
#list_inventory(variant_id: nil, store_id: nil, updated_at_min: nil, updated_at_max: nil, limit: 250, cursor: nil) ⇒ Hash
List inventory levels
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/loyverse_api/endpoints/inventory.rb', line 12 def list_inventory(variant_id: nil, store_id: nil, updated_at_min: nil, updated_at_max: nil, limit: 250, cursor: nil) params = { limit: limit, variant_id: variant_id, store_id: store_id, cursor: cursor, updated_at_min: format_time(updated_at_min), updated_at_max: format_time(updated_at_max) }.compact get("inventory", params: params) end |
#update_inventory(variant_id:, store_id:, in_stock:) ⇒ Hash
Update inventory level for a variant at a specific store
30 31 32 33 34 35 36 37 38 |
# File 'lib/loyverse_api/endpoints/inventory.rb', line 30 def update_inventory(variant_id:, store_id:, in_stock:) body = { variant_id: variant_id, store_id: store_id, in_stock: in_stock } put("inventory", body: body) end |