Identify the cartPredicate syntax: the DSL supports field paths like lineItems[].productType.id = "<uuid>" or lineItems[].categories contains any ("<uuid>") to target specific items
Call POST /cart-discounts with cartPredicate, target (multiBuyLineItems or lineItems with a discountedQuantity/selector), value (relative with permyriad), sortOrder, and isActive:true
Set requiresDiscountCode:false for automatic discounts or true if it should only apply when a discount code is entered; create a matching DiscountCode object if the latter
Test the predicate by adding qualifying and non-qualifying items to a test cart and calling POST /carts/{id} with a recalculate update action; inspect discountedPrice on lineItems
Monitor for predicate evaluation errors in the API response — invalid predicate syntax returns a 400 with a message describing the parse failure
Known gotchas
The cartPredicate DSL uses centAmount for monetary comparisons (not decimal values); writing totalPrice > 50 will be interpreted as 50 cents, not 50 currency units
Category predicates match only direct category assignments on the product, not inherited parent categories — if your taxonomy is hierarchical you must enumerate all relevant category IDs
Cart discount sortOrder is a string representing a decimal between 0 and 1 and determines application order when multiple discounts apply; duplicates are rejected, so maintain a registry of used sortOrder values
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp