feat: Add Expensify code feature in Subscription settings - #79829
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
There was a problem hiding this comment.
Pull request overview
This PR adds support for applying Expensify discount codes to user subscriptions. Users can now navigate to subscription settings and enter discount codes through a dedicated page that validates the code through the backend and applies it to their subscription.
Changes:
- Added new Expensify code field to subscription data model
- Created new page for entering and applying discount codes with form validation
- Integrated discount code display in subscription settings and plan summary
- Added translations for all supported languages
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/onyx/PrivateSubscription.ts | Added optional expensifyCode field to subscription type |
| src/types/form/SubscriptionExpensifyCodeForm.ts | Created new form type for expensify code input |
| src/pages/settings/Subscription/ExpensifyCodePage/index.tsx | New page component for entering and applying discount codes |
| src/libs/actions/Subscription.ts | Added applyExpensifyCode action with optimistic/success/failure data handling |
| src/pages/settings/Subscription/SubscriptionSettings/index.tsx | Added menu item to display and access expensify code feature |
| src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCardActionButton.tsx | Updated summary to conditionally include expensify code |
| src/languages/*.ts | Added translations for expensify code feature in all supported languages |
| src/SCREENS.ts, src/ROUTES.ts, src/ONYXKEYS.ts | Added new screen, route, and form keys for expensify code |
| src/libs/Navigation/* | Added navigation configuration for new expensify code page |
| src/libs/API/types.ts, src/libs/API/parameters/* | Added API command and parameters for applying expensify code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b9f1d15ba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Change makes sense from a product perspective 👍
|
Writing unit tests and implementing PERF fix suggestions. Will mark the PR ready for review shortly. |
|
@eVoloshchak Please take a look when you get a moment. |
|
Looks good and tests well!
@samranahm, does BE return the flag and do we handle in on FE? Is there a way for QA to test this? |
|
We are currently not handling this on the FE. |
|
cc @flodnv , but I think: The flag is called isSecretPromoCode and it's stored as a field inside the private_promoDiscount NVP. |
|
That looks correct |
|
Added |
|
@samranahm, is not displaying this functionality on native devices a hard requirement? Feels weird that you can add a promo code using the webside on your smartphone, but cannot do the same using the native app on that same smartphone |
|
@eVoloshchak We don’t allow users to make any changes to their subscription on native devices, not even subscription size. So, I believe we should keep the same behavior for this feature. Here’s the current UI of the Subscription Settings page on native.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppN/A Android: mWeb ChromeScreen.Recording.2026-02-16.at.15.10.17.moviOS: HybridAppN/A iOS: mWeb SafariScreen.Recording.2026-02-16.at.14.22.06.movMacOS: Chrome / SafariScreen.Recording.2026-02-16.at.14.18.11.mov |
|
@nkuoch All yours, please take a look. |
|
🚧 @nkuoch has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/nkuoch in version: 9.3.21-0 🚀
|
|
Hi @samranahm.Which valid discount code can we use for Test 1?
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.21-4 🚀
|
|
Coming from #90007 |


Explanation of Change
This PR adds support for applying Expensify codes to user subscriptions. Users can now enter and apply discount codes through a dedicated page from the subscription settings.
Fixed Issues
$ #79087
PROPOSAL: #79087 (comment)
Tests
Precondition: User has at least one workspace and is an admin of that workspace.
Test 01
Test 02
Test 03
Precondition:
https://dev.new.expensify.com:8082/settings/subscription/details/expensify-codeTest 04
Precondition:
Expensify code:TEST123is not display in Subscription page > Your plan > Subscription settings menu itemhttps://dev.new.expensify.com:8082/settings/subscription/details/expensify-codeOffline tests
QA Steps
Same as tests
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android.Native.mp4
Android: mWeb Chrome
Android.mWeb.Chrome.mp4
iOS: Native
IOS.Native.mp4
iOS: mWeb Safari
IOS.mWeb.Safari.mp4
MacOS: Chrome / Safari
macOS.Chrome.mp4