question

eatcube avatar image
eatcube asked ·

Clover Inventory API to load Category & items only with Modifier groups

Can anyone suggest the best way to extract clover inventory items? I tried https://www.clover.com/api_docs/#!/inventory/GetI... but having some issues .

My scenario Inventory has Modifiers too in the categories section .. Right now this is being loaded as the main item which is wrong .. example: Pizza topping cannot be the main item. How do we work with this sheet? All I need is to extract Categories and respective Items for it and get their respective modifier groups .. This is for Mobile app ...we are trying to connect clover. Everything looks good except this issue.. Can anyone help me out here .. PHP is what I am coding.
App MarketInventory
sheet1.png (202.6 KiB)
sheet2.png (151.3 KiB)
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

zgreathouse avatar image
zgreathouse answered ·
I believe there may be a disconnect here concerning our overall architecture surrounding items, categories, and modifiers.

A simplistic breakdown of how the three are related:
- An item can belong to a category, a category can have many items
- A modifier belongs to a modifierGroup, a modifierGroup can have many modifiers
- An item can have many modifierGroups, a modifierGroup can have many items


In terms of associations:
- An item can be associated with a category.
- A separate association can be made between the item and a modifierGroup.
- When an Item has been associated with a modifierGroup, you can then apply any of the modifiers from the modifierGroup to said item. (based on the rules prescribed to the modifier group - minRequired, maxAllowed)

*Note: there is no association between categories and modifierGroups


In practice:
To make your toppings modifiers, rather than items, you could adhere to an inventory structure like following:
- Create an item ("Pizza")
- Create a Modifier Group ("Vegetable Toppings")
- Create a modifier for each topping ("Peppers", "Olives", "Mushrooms"...etc)
- Make an association between the item ("Pizza") and the modifierGroup ("Vegetable Toppings")

*Note: Once the associations is made you can now add the modifiers ("Peppers", "Olives", "Mushrooms"...etc) from the modifierGroup ("Vegetable Toppings") to that item ("Pizza") and the modifiers will not show up as whole inventory items.

I hope this is helpful! Please let me know if any of this is unclear.
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community