Discounts
Discount details pages display information about a specific discount, including its type, value, conditions, and usage limits. Extensions on these pages help merchants manage promotional campaigns and customize discount workflows.
Anchor to Use casesUse cases
- Sync with marketing platforms: Automatically sync discount codes with external marketing tools like email campaigns, social media ads, or affiliate networks.
- Validate discount rules: Check discount configurations against business rules or inventory levels before merchants activate promotions.
- Track promotion performance: Display real-time analytics and conversion metrics for active discount campaigns from external analytics systems.
- Bulk discount management: Enable merchants to update, duplicate, or archive multiple discounts at once from the discount index page.
- Generate unique codes: Create batches of unique discount codes for influencer campaigns or customer loyalty programs.
Anchor to Discount details targetsDiscount details targets
Use action targets to extend the discount details page with workflows. Action targets open as modal overlays from the More actions menu.
The examples demonstrate fetching data from Shopify's direct API or your app's backend.
Anchor to Discount details action ,[object Object]Discount details action target
admin.discount-details.action.render
Renders an admin action extension on the discounts details page. Merchants can access this extension from the More actions menu. Use this target to provide workflows that operate on discounts data, such as syncing with external systems, exporting discounts information, or managing credit terms.
Extensions at this target can access discount data through the data property in the Action Extension API. The action renders in a modal overlay, providing space for multi-step workflows, forms, and confirmations.
Supported components
- Admin action
- Avatar
- Badge
- Banner
- Box
- Button
- Button group
- Checkbox
- Chip
- Choice list
- Clickable
- Clickable chip
- Color field
- Color picker
- Date field
- Date picker
- Divider
- Drop zone
- Email field
- Grid
- Heading
- Icon
- Image
- Link
- Menu
- Money field
- Number field
- Ordered list
- Paragraph
- Password field
- Query container
- Search field
- Section
- Select
- Spinner
- Stack
- Switch
- Table
- Text
- Text area
- Text field
- Thumbnail
- Tooltip
- Url field
- Unordered list
Available APIs
Supported components
- Admin action
- Avatar
- Badge
- Banner
- Box
- Button
- Button group
- Checkbox
- Chip
- Choice list
- Clickable
- Clickable chip
- Color field
- Color picker
- Date field
- Date picker
- Divider
- Drop zone
- Email field
- Grid
- Heading
- Icon
- Image
- Link
- Menu
- Money field
- Number field
- Ordered list
- Paragraph
- Password field
- Query container
- Search field
- Section
- Select
- Spinner
- Stack
- Switch
- Table
- Text
- Text area
- Text field
- Thumbnail
- Tooltip
- Url field
- Unordered list
Available APIs
Anchor to Discount details action (should render) ,[object Object]Discount details action (should render) target
admin.discount-details.action.should-render
Controls the render state of an admin action extension on the discounts details page. Use this target to conditionally show or hide your action extension based on the discount's properties, such as status, configuration, or specific business requirements.
This target returns a boolean value that determines whether the corresponding action extension appears in the More actions menu. The extension evaluates each time the page loads.
Supported components
Available APIs
Supported components
Available APIs
Anchor to Discount index targetsDiscount index targets
Use action targets to extend the discount index page with bulk operations and workflows that help merchants manage multiple discounts efficiently.
Anchor to Discount index action ,[object Object]Discount index action target
admin.discount-index.action.render
Renders an admin action extension on the discounts index page. Merchants can access this extension from the More actions menu. Use this target to provide workflows that operate on discounts data, such as syncing with external systems, exporting discounts information, or managing credit terms.
Extensions at this target can access discount data through the data property in the Action Extension API. The action renders in a modal overlay, providing space for multi-step workflows, forms, and confirmations.
Supported components
- Admin action
- Avatar
- Badge
- Banner
- Box
- Button
- Button group
- Checkbox
- Chip
- Choice list
- Clickable
- Clickable chip
- Color field
- Color picker
- Date field
- Date picker
- Divider
- Drop zone
- Email field
- Grid
- Heading
- Icon
- Image
- Link
- Menu
- Money field
- Number field
- Ordered list
- Paragraph
- Password field
- Query container
- Search field
- Section
- Select
- Spinner
- Stack
- Switch
- Table
- Text
- Text area
- Text field
- Thumbnail
- Tooltip
- Url field
- Unordered list
Available APIs
Supported components
- Admin action
- Avatar
- Badge
- Banner
- Box
- Button
- Button group
- Checkbox
- Chip
- Choice list
- Clickable
- Clickable chip
- Color field
- Color picker
- Date field
- Date picker
- Divider
- Drop zone
- Email field
- Grid
- Heading
- Icon
- Image
- Link
- Menu
- Money field
- Number field
- Ordered list
- Paragraph
- Password field
- Query container
- Search field
- Section
- Select
- Spinner
- Stack
- Switch
- Table
- Text
- Text area
- Text field
- Thumbnail
- Tooltip
- Url field
- Unordered list
Available APIs
Anchor to Discount index action (should render) ,[object Object]Discount index action (should render) target
admin.discount-index.action.should-render
Controls the render state of an admin action extension on the discounts index page. Use this target to conditionally show or hide your action extension based on the discount's properties, such as status, configuration, or specific business requirements.
This target returns a boolean value that determines whether the corresponding action extension appears in the More actions menu. The extension evaluates each time the page loads.
Supported components
Available APIs
Supported components
Available APIs
Anchor to Best practicesBest practices
- Differentiate discount types: Discounts come in multiple types (basic, BXGY, free shipping, automatic vs code-based). Before displaying discount actions, check the discount type using GraphQL to ensure your extension supports it. For example, POS sync may only work with certain discount types.
- Validate discount dates: Always check
startsAtandendsAtwhen displaying or syncing discounts. Syncing expired or not-yet-active discounts to external systems can create customer confusion and needs special handling or filtering. - Show usage vs limits clearly: When displaying discount analytics, show both
asyncUsageCountandusageLimittogether. Merchants need to see how close a discount is to its usage limit to decide whether to extend it or create a new code. - Handle discount combinations: Shopify has complex discount combination rules. If your extension recommends or creates discounts, validate that they're compatible with existing discount configurations to avoid conflicts that prevent customers from completing checkouts.
- Account for attribution delays: Discount usage counts (
asyncUsageCount) update asynchronously and may lag by several minutes. When displaying real-time analytics, indicate that counts are approximate and mention the last update time if available from your system.
Anchor to LimitationsLimitations
- Single target per module: Each
[[extensions.targeting]]entry in your TOML configuration maps one target to one module file. - Multiple discount type schemas: Discounts are a GraphQL union type with eight possible types:
DiscountAutomaticBasic,DiscountCodeBasic,DiscountAutomaticBxgy,DiscountCodeBxgy,DiscountAutomaticFreeShipping,DiscountCodeFreeShipping,DiscountCodeApp,DiscountAutomaticApp. Each type has different fields. - Asynchronous usage count: The
asyncUsageCountfield on GraphQLDiscountunion types is updated asynchronously and might show a lower count until the process is completed.