Product Discount API reference
The Product Discount API enables you to create a new type of discount that is applied to a particular product or product variant in the cart. The API includes two key objects:
FunctionResultAnchor link to section titled "FunctionResult"
The following function result includes one discount of 20% off a target product variant: