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.
Extension targetsAnchor link to section titled "Extension targets"
The Product Discount API exposes the following targets:
||FunctionRunResult||Outputs the product-level discount that should be applied to the cart|
Input object is the complete schema that your function can receive as input.
For a list of fields that the Product Discount API's
Input object accepts, refer to Input.
The following example shows an input query:
The following example shows the resulting input to the query:
FunctionRunResultAnchor link to section titled "FunctionRunResult"
The following function result includes one discount of 20% off a target product variant: