Order Discount API reference
The Order Discount API enables you to create a new type of discount that is applied to all merchandise in the cart.
Extension targets
Anchor link to section titled "Extension targets"The Order Discount API exposes the following targets:
Target | Output type | Description |
---|---|---|
purchase.order-discount.run |
FunctionRunResult | Outputs the order-level discount that should be applied to the cart |
The RunInput
object is the complete schema that your function can receive as input.
For a list of fields that the Order 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:
FunctionRunResult
Anchor link to section titled "FunctionRunResult"The FunctionRunResult
object is the expected output for the purchase.order-discount.run
target.
The following function result includes one discount of 10% off the order subtotal amount: