The Order Discount API enables you to create a new type of discount that is applied to all merchandise in the cart. ## Extension targets The Order Discount API exposes the following [targets](/docs/apps/build/app-extensions/configure-app-extensions#targets): | Target | Output type | Description | | ------ | ----------- | ----------- | | `purchase.order-discount.run` | [FunctionRunResult](#functionrunresult) | Outputs the order-level discount that should be applied to the cart | ## Input The `RunInput` object is the complete schema that your function can receive as [input](/docs/apps/build/functions/input-output#input). For a list of fields that the Order Discount API's `Input` object accepts, refer to [Input](/docs/api/functions/reference/order-discounts/graphql/input). ### Example The following example shows an input query:

The following example shows the resulting input to the query:

## FunctionRunResult The [`FunctionRunResult`](/docs/api/functions/reference/order-discounts/graphql/functionrunresult) object is the expected [output](/docs/apps/build/functions/input-output#output) for the `purchase.order-discount.run` target. ### Example The following function result includes one discount of 10% off the order subtotal amount: