Rules and conditions
Read-only: the vocabulary sale conditions are written against, and the operations rules price through.
Read-only. The vocabulary a sale's conditions are written against, and the operations its rules can price through. Both are published rather than guessed at, so an admin, an integration or an AI client can list what exists before writing a rule. See Rules and conditions.
List rule attributes
/api/v1/kahunacart/rules/vocabulary
The published vocabulary a sale's conditions are written against: every attribute, its type, the operators it offers, whether it is a fact about the cart, one line, the customer or the order, and which picker the admin draws for it. Read this before writing conditions — an attribute that is not in this list is refused when the sale is saved, never silently ignored. Add-on plugins contribute attributes here too. A money attribute takes an optional currency beside its value in a condition; with none it is in the store currency.
List rule operations
/api/v1/kahunacart/rules/operations
Every operation a sale rule can price through, with the arguments each takes. percent_off and amount_off are the two a rule's mode and percent/amount columns are the legacy form of; quantity_tiers is the quantity ladder; bogo is buy X get Y at a percentage off; and cheapest_free discounts the cheapest of every N. scope says whether an operation prices one line or counts the whole covered set. Add-on plugins contribute operations here too, and an unknown code is refused when the sale is saved.
vocabulary answers every attribute with its type, what it is a fact about (cart, customer, order or line), the operators its type allows, and the picker the admin should draw. operations answers every operation with its scope (line or set) and the blueprint of its arguments. An add-on that registered an operation or an attribute appears in both the moment its plugin is enabled.