IInventoryService

public interface IInventoryService implements IInterface

An interface for interacting with the Clover inventory service. The inventory service is a bound AIDL service. Bind to this service as follows:


Intent serviceIntent = new Intent(InventoryIntent.ACTION_INVENTORY_SERVICE_V3);
serviceIntent.putExtra(Intents.EXTRA_ACCOUNT, CloverAccount.getAccount(context));
serviceIntent.putExtra(Intents.EXTRA_VERSION, 3);
context.bindService(serviceIntent);
For more information about bound services, refer to the Android documentation: Bound Services .

You may also interact with this service through the InventoryConnector class, which handles binding and asynchronous invocation of service methods.

Prefer the InventoryContract over the getter methods in this class, the contract offers better performance and is not subject to large inventory limitations that can cause the getter methods here to fail.

This service is backed by a local database which is synced to cloud. Thus changes made by calling methods here will be reflected on all of a merchant's devices and on the web.

Typically a merchant customizes their inventory either by importing data from a spreadsheet or manually entering their inventory data on the web or through the Clover Inventory app.

Invoking methods through this service generally requires INVENTORY_R and/or INVENTORY_W permission. See Clover app permissions

Items

The basic unit of a merchant's inventory is the Item. Items could be goods such as shoes and socks, or services such as a haircut. Merchants that simply take payments on their devices may have no inventory items at all.

Discounts

A Discount may be associated with an entire Order subtotal or an individual Item. Discounts are named and given either a percentage value or fixed amount. Discounts appear as choices in Clover Register and are printed on bills.

Tax Rates

A TaxRate is used to add taxes to an Order when computing the total. Default tax rates are applied to all items that do not override the defaults. An Item may override the default tax rates and be associated with specific (or no) tax rates.

Categories

Categories alter the user interface of the Clover Register app. Items appear in the Clover Register app within categories they are members of. Items may be associated with no, one or many categories. Items are displayed in Clover Register in the order in which they are added to a category. Categories are displayed in Register using the sort order value for each category. Categories are designed only to be use for anything other modifying the user experience of Register, for a more generic organization mechanism see the section on Tags.

Modifier Groups and Modifiers

Modifiers are used by Clover Register to make adjustments to associated items. A modifier may or may not increase the price of an item. For example a Burger item may be associated with the Condiment modifier group which contains mayo (no charge) and avocado (additional $2.00). A modifier group may specify that an exact number of modifiers be selected when an item is selected in Clover Register. Modifiers are printed on bills and order receipts.

Item Groups (aka Item with variants), Attributes and Options

Item Groups help merchants create and manage large groups of related items. This is described to merchants as an 'Item with variants'. For example a merchants may sell a t-shirt that is available in numerous various sizes and colors. Each of the t-shirt variations is an item and belongs to the t-shirt item group. Once an item group is created it appears in Register as a single button and tapping it brings up a choice of which variation is to be sold. Before adding items to an item group you first need to create the item group, then create attributes ('size', 'color') and then options for each attribute ('small', 'blue'), then associate options with an item and then associate items with an item group. The name of an item which is a member of an item group is automatically generated by the Clover server as a combination of the item group name and the name of all the options associated with that item. It cannot be changed. If the item group name is changed, or if an option name is changed, then the item names will be automatically regenerated. An item can only be a member of a single item group and once it is part of an item group it can never be removed or moved to another item group, it can only be deleted.

Tags (aka Labels)

Similarly to how they are described by wikipedia, tags are an informal way of establishing a relationship. Tags currently may be associated with items and printers. When an tag is associated with both an item and a printer that establishes a special relationship that results in those items being printed out on the associated printer when printing an order. Other than that special case there is no effect when an item is associated with a tag. Developers may use tags to establish a relationship meaningful for their needs.

OrderFees

An OrderFee is any type of additional fee, which could be associated with an entire Order subtotal. OrderFees are named and given either a percentage value or fixed amount. Order fees could be set default to be applied automatically to an Order. OrderFees appear as choices in Clover Register/Clover Dining and are printed on bills.

See also

Inheritors

Types

Link copied to clipboard
public class _Parcel
Link copied to clipboard
public class Default implements IInventoryService
Default implementation for IInventoryService.
Link copied to clipboard
public abstract class Stub extends Binder implements IInventoryService
Local-side IPC implementation stub class.

Functions

Link copied to clipboard
public abstract void addItemToCategory(String itemId, String categoryId, ResultStatus resultStatus)
Adds an item to a category.
Link copied to clipboard
public abstract IBinder asBinder()
Link copied to clipboard
public abstract void assignCategoriesToItem(String itemId, List<String> categoryIds, ResultStatus resultStatus)
Associates categories with an item.
Link copied to clipboard
public abstract void assignItemsToTag(String tagId, List<String> items, ResultStatus resultStatus)
Assign a list of items (identified by their unique ID) to a tag.
Link copied to clipboard
public abstract void assignModifierGroupToItem(String modifierGroupId, String itemId, ResultStatus resultStatus)
Associates a modifier group with an item.
Link copied to clipboard
public abstract void assignOptionsToItem(String itemId, List<String> optionIds, ResultStatus resultStatus)
Associate the given options with an item.
Link copied to clipboard
public abstract void assignTagsToItem(String itemId, List<String> tags, ResultStatus resultStatus)
Assign a list of tags (identified by their unique ID) to an item.
Link copied to clipboard
public abstract void assignTagsToPrinter(String printerUid, List<String> tags, ResultStatus resultStatus)
Assign a list of tags (identified by their unique ID) to a printer.
Link copied to clipboard
public abstract void assignTaxRatesToItem(String itemId, List<String> taxRates, ResultStatus resultStatus)
Assign a list of tax rates (identified by their unique ID) to an item.
Link copied to clipboard
public abstract void bulkAssignColorToItems(List<String> itemIds, String colorHexCode, ResultStatus resultStatus)
Assign given color to list of items.
Link copied to clipboard
public abstract Attribute createAttribute(Attribute attribute, ResultStatus resultStatus)
Creates a new attribute.
Link copied to clipboard
public abstract Category createCategory(Category category, ResultStatus resultStatus)
Adds a new category.
Link copied to clipboard
public abstract Discount createDiscount(Discount discount, ResultStatus resultStatus)
Adds a new discount.
Link copied to clipboard
public abstract Item createItem(Item item, ResultStatus resultStatus)
Inserts a new item into the database.
Link copied to clipboard
public abstract ItemGroup createItemGroup(ItemGroup itemGroup, ResultStatus resultStatus)
Creates a new item group.
Link copied to clipboard
public abstract Modifier createModifier(String modifierGroupId, Modifier modifier, ResultStatus resultStatus)
Adds a new modifier.
Link copied to clipboard
public abstract ModifierGroup createModifierGroup(ModifierGroup group, ResultStatus resultStatus)
Adds a new modifier group.
Link copied to clipboard
public abstract Option createOption(Option option, ResultStatus resultStatus)
Creates a new option.
Link copied to clipboard
public abstract OrderFee createOrderFee(OrderFee orderFee, ResultStatus resultStatus)
Not available to non-Clover apps.
Link copied to clipboard
public abstract Tag createTag(Tag tag, ResultStatus resultStatus)
Creates a new tag.
Link copied to clipboard
public abstract TaxRate createTaxRate(TaxRate taxRate, ResultStatus resultStatus)
Creates a new tax rate.
Link copied to clipboard
public abstract void deleteAttribute(String attributeId, ResultStatus resultStatus)
Deletes an attribute, deletes all the options in that attribute and removes all the associations between those options and items.
Link copied to clipboard
public abstract void deleteCategories(List<String> categoryIds, ResultStatus resultStatus)
Bulk delete categories.
Link copied to clipboard
public abstract void deleteCategory(String categoryId, ResultStatus resultStatus)
Deletes an existing category.
Link copied to clipboard
public abstract void deleteDiscount(String discountId, ResultStatus resultStatus)
Deletes a discount.
Link copied to clipboard
public abstract void deleteItem(String itemId, ResultStatus resultStatus)
Deletes an existing item.
Link copied to clipboard
public abstract void deleteItemGroup(String itemGroupId, ResultStatus resultStatus)
Deletes an item group, but does not delete the items in a group, they become items without an item group.
Link copied to clipboard
public abstract void deleteItems(List<String> itemIds, ResultStatus resultStatus)
Bulk delete items.
Link copied to clipboard
public abstract void deleteModifier(String modifierId, ResultStatus resultStatus)
Deletes an existing modifier.
Link copied to clipboard
public abstract void deleteModifierGroup(String groupId, ResultStatus resultStatus)
Deletes an existing modifier group.
Link copied to clipboard
public abstract void deleteModifierGroups(List<String> groupIds, ResultStatus resultStatus)
Bulk delete modifier groups.
Link copied to clipboard
public abstract void deleteOption(String optionId, ResultStatus resultStatus)
Deletes an option and removes all the associations between that option and items.
Link copied to clipboard
public abstract void deleteOrderFee(String orderFeeId, ResultStatus resultStatus)
Not available to non-Clover apps.
Link copied to clipboard
public abstract void deleteTag(String tagId, ResultStatus resultStatus)
Deletes a tag.
Link copied to clipboard
public abstract void deleteTags(List<String> tagIds, ResultStatus resultStatus)
Bulk delete tags.
Link copied to clipboard
public abstract void deleteTaxRate(String taxRateId, ResultStatus resultStatus)
Deletes a tax rate.
Link copied to clipboard
public abstract Attribute getAttribute(String attributeId, ResultStatus resultStatus)
Gets a single attribute identified by its unique ID.
Link copied to clipboard
public abstract List<Attribute> getAttributes(ResultStatus resultStatus)
Gets all defined attributes for the merchant.
Link copied to clipboard
public abstract List<Category> getCategories(ResultStatus resultStatus)
Retrieve the list of categories.
Link copied to clipboard
public abstract Discount getDiscount(String discountId, ResultStatus resultStatus)
Gets a single discount identified by its unique ID.
Link copied to clipboard
public abstract List<Discount> getDiscounts(ResultStatus resultStatus)
Retrieve the list of discounts.
Link copied to clipboard
public abstract Item getItem(String itemId, ResultStatus resultStatus)
Retrieve an individual item using the item ID.
Link copied to clipboard
public abstract ItemGroup getItemGroup(String itemGroupId, ResultStatus resultStatus)
Gets a single item group identified by its unique ID.
Link copied to clipboard
public abstract List<String> getItemIds(ResultStatus resultStatus)
Link copied to clipboard
public abstract List<Item> getItems(ResultStatus resultStatus)
Link copied to clipboard
public abstract List<Item> getItemsForModifierGroup(String modifierGroupId, ResultStatus resultStatus)
Retrieve list of items that use the specified Modifier Group
Link copied to clipboard
public abstract List<Item> getItemsWithCategories(ResultStatus resultStatus)
Link copied to clipboard
public abstract Item getItemWithCategories(String itemId, ResultStatus resultStatus)
Same as getItem but also includes the list of categories to which the item belongs.
Link copied to clipboard
public abstract List<ModifierGroup> getModifierGroups(ResultStatus resultStatus)
Retrieve the list of all modifier groups.
Link copied to clipboard
public abstract List<ModifierGroup> getModifierGroupsForItem(String itemId, ResultStatus resultStatus)
Retrieve the list of modifier groups for a particular item.
Link copied to clipboard
public abstract List<Modifier> getModifiers(String modifierGroupId, ResultStatus resultStatus)
Retrieve the list of modifiers belonging to a modifier group.
Link copied to clipboard
public abstract Option getOption(String optionId, ResultStatus resultStatus)
Gets a single option identified by its unique ID.
Link copied to clipboard
public abstract List<Option> getOptions(ResultStatus resultStatus)
Gets all defined options for the merchant.
Link copied to clipboard
public abstract List<Option> getOptionsForItem(String itemId, ResultStatus resultStatus)
Retrieve the list of options for an item.
Link copied to clipboard
public abstract OrderFee getOrderFee(String orderFeeId, ResultStatus resultStatus)
Gets a single order fee identified by its unique ID.
Link copied to clipboard
public abstract List<OrderFee> getOrderFees(ResultStatus resultStatus)
Retrieve the list of order fees.
Link copied to clipboard
public abstract Item getPosMenuItem(String itemId, String menuId, ResultStatus resultStatus)
Retrieve an individual item using the item ID.
Link copied to clipboard
public abstract Tag getTag(String tagId, ResultStatus resultStatus)
Gets a single tag identified by its unique ID.
Link copied to clipboard
public abstract List<Tag> getTags(ResultStatus resultStatus)
Gets all defined tags for the merchant.
Link copied to clipboard
public abstract List<Tag> getTagsForItem(String itemId, ResultStatus resultStatus)
Retrieve the list of tags for an item.
Link copied to clipboard
public abstract List<Tag> getTagsForPrinter(String printerMac, ResultStatus resultStatus)
Retrieve the list of tags for a printer.
Link copied to clipboard
public abstract TaxRate getTaxRate(String taxRateId, ResultStatus resultStatus)
Gets a single tax rate identified by its unique ID.
Link copied to clipboard
public abstract List<TaxRate> getTaxRates(ResultStatus resultStatus)
Gets all defined tax rates for the merchant.
Link copied to clipboard
public abstract List<TaxRate> getTaxRatesExcludedForItem(String orderTypeId, String itemId, ResultStatus resultStatus)
Retrieve the list of tax rates excluded for an item, given the order-type-id
Link copied to clipboard
public abstract List<TaxRate> getTaxRatesForItem(String itemId, ResultStatus resultStatus)
Retrieve the list of tax rates for an item.
Link copied to clipboard
public abstract void moveItemInCategoryLayout(String itemId, String categoryId, int direction, ResultStatus resultStatus)
Moves an item's position within an existing category.
Link copied to clipboard
public abstract void removeCategoriesFromItem(String itemId, List<String> categoryIds, ResultStatus resultStatus)
Removes categories association from an item.
Link copied to clipboard
public abstract void removeItemFromCategory(String itemId, String categoryId, ResultStatus resultStatus)
Removes an item from a category.
Link copied to clipboard
public abstract void removeItemsFromTag(String tagId, List<String> items, ResultStatus resultStatus)
Remove a list of items (identified by their unique ID) from a tag.
Link copied to clipboard
public abstract void removeItemStock(String itemId, ResultStatus resultStatus)
Remove stock count for an item.
Link copied to clipboard
public abstract void removeModifierGroupFromItem(String modifierGroupId, String itemId, ResultStatus resultStatus)
Removes a modifier group association from an item.
Link copied to clipboard
public abstract void removeOptionsFromItem(String itemId, List<String> optionIds, ResultStatus resultStatus)
Remove the association between the given options and an item.
Link copied to clipboard
public abstract void removeTagsFromItem(String itemId, List<String> tags, ResultStatus resultStatus)
Remove a list of tags (identified by their unique ID) from an item.
Link copied to clipboard
public abstract void removeTagsFromPrinter(String printerUid, List<String> tags, ResultStatus resultStatus)
Remove a list of tags (identified by their unique ID) from a printer.
Link copied to clipboard
public abstract void removeTaxRatesFromItem(String itemId, List<String> taxRates, ResultStatus resultStatus)
Remove a list of tax rates (identified by their unique ID) from an item.
Link copied to clipboard
public abstract void updateAttribute(Attribute attribute, ResultStatus resultStatus)
Updates an existing attribute.
Link copied to clipboard
public abstract void updateCategory(Category category, ResultStatus resultStatus)
Updates an existing category.
Link copied to clipboard
public abstract void updateCategoryItems(String categoryId, List<String> itemIds, ResultStatus resultStatus)
Updates all items of a category.
Link copied to clipboard
public abstract void updateCategorySortOrders(List<Category> categories, ResultStatus resultStatus)
Update category sort orders.
Link copied to clipboard
public abstract void updateDiscount(Discount discount, ResultStatus resultStatus)
Updates an existing discount.
Link copied to clipboard
public abstract void updateItem(Item item, ResultStatus resultStatus)
Updates an existing item.
Link copied to clipboard
public abstract void updateItemGroup(ItemGroup itemGroup, ResultStatus resultStatus)
Updates an existing item group.
Link copied to clipboard
public abstract void updateItemStock(String itemId, long stockCount, ResultStatus resultStatus)
Update stock count for an item.
Link copied to clipboard
public abstract void updateItemStockQuantity(String itemId, double quantity, ResultStatus resultStatus)
Update stock for an item.
Link copied to clipboard
public abstract void updateModifier(Modifier modifier, ResultStatus resultStatus)
Updates an existing modifier.
Link copied to clipboard
public abstract void updateModifierGroup(ModifierGroup group, ResultStatus resultStatus)
Updates an existing modifier group.
Link copied to clipboard
public abstract void updateModifierGroupSortOrders(List<ModifierGroup> groups, ResultStatus resultStatus)
Updates the sort orders for a list of modifier groups.
Link copied to clipboard
public abstract void updateModifierSortOrder(String modifierGroupId, List<String> modifierIds, ResultStatus resultStatus)
Update modifier sort order for a modifier group.
Link copied to clipboard
public abstract void updateOption(Option option, ResultStatus resultStatus)
Updates an existing option.
Link copied to clipboard
public abstract void updateOrderFee(OrderFee orderFee, ResultStatus resultStatus)
Not available to non-Clover apps.
Link copied to clipboard
public abstract void updateTag(Tag tag, ResultStatus resultStatus)
Updates an existing tag.
Link copied to clipboard
public abstract void updateTaxRate(TaxRate taxRate, ResultStatus resultStatus)
Updates an existing tax rate.