Adding in types for purchaseType and recurringCycleLimit fields#4275
Adding in types for purchaseType and recurringCycleLimit fields#4275owenhuang88 wants to merge 2 commits into2026-04from
Conversation
🚨🚨🚨 Docs migration in progress 🚨🚨🚨We are actively migrating UI extension reference docs to MDX in the
During this migration, please be aware of the following:
Doc comments in Examples that previously lived in this repo are being moved to the What should I do?
Thanks for your patience while we complete the migration! 🙏 |
devisscher
left a comment
There was a problem hiding this comment.
Nice! This looks good to me. For @vividviolet, we were thinking of adding this as a patch. Owen mentioned this is ok. So we'll put it on 2026-04 branch and do we need to do anything for releasing the new patch?
vividviolet
left a comment
There was a problem hiding this comment.
A few things you need to do:
- You need to rebase the branch on
2026-04since the stable release already went out. - After the PR is merged to the stable branch
- Approve and merge the Versions PR that automatically gets created to do a patch release
- Run the
docs:synccommand to create a PR to update the docs on shopify.dev
| applyMetafieldChange: () => ({type: 'success'}), | ||
| updateDiscountClasses: () => ({success: true as const, value: []}), | ||
| updatePurchaseType: () => ({ | ||
| success: true as const, |
There was a problem hiding this comment.
Why is this hardcoded to true?
There was a problem hiding this comment.
Just for testing convenience with the factory, and following discount classes :)
4db0086 to
19df3d1
Compare
Stable 2026-04 release has shipped, so new fields ship as a patch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Add purchaseType and recurringCycleLimit to DiscountsApi
Background
Follow-up to the admin-web changes in https://github.com/shop/world/pull/411309 and https://github.com/shop/world/pull/411407, which add support for purchase type and recurring cycle limit fields in the discounts plugin.
This PR adds the corresponding types to
@shopify/ui-extensionsso that discount function settings extensions have access to these new fields in their type contract.Part of this release plan: https://docs.google.com/document/d/1cchvYA3UEDO2o651f_FgsdRqkBSRJLBO3Ac-EAMGCb8/edit?tab=t.0#heading=h.3twiyx2rdsvm
Changes
PurchaseTypetype ('one_time_purchase' | 'subscription' | 'both')purchaseType/updatePurchaseTypesignals toDiscountsApirecurringCycleLimit/updateRecurringCycleLimitsignals toDiscountsApidiscountsdefinition to the doc schema (pre-existing gap)References