Discount codes
Create and manage InAppify web discount codes, including percentage discounts, eligible products and customers, duration, and checkout use.
Discount codes reduce a purchase price for eligible customers: for example, a first-purchase offer, a sales campaign, or a returning-customer offer. Create the discount rules first, then add one or more codes using those rules.
This guide covers project web discounts, not discounts on your InAppify account bill. These are not Cafe Bazaar or Myket discount codes; store purchase prices and promotions follow the store's own mechanism.
Before you start
Prepare your products and offering and packages. For hosted web checkout, you also need a payment link. Team members need the corresponding permission to view, create, or edit discounts.
Discount, identifier, and code
- Discount: rules defining the percentage, products, customer eligibility, and duration.
- Discount identifier: the key identifying those rules to the system and API, such as
welcome_offer. - Discount code: the text entered by the customer, such as
WELCOME20. Multiple codes can share one discount's rules. - Package discount: a percentage configured on an offering package. It does not require entering a code.
When generating a personalized code through the API, send the discount identifier, not its display name or public code.
Create a discount in the dashboard
- Sign in to the InAppify dashboard and select your project.
- Open Product catalog → Web discounts.
- Select the create-discount action.
- Enter an English identifier and display name, such as
welcome_offerand “Welcome offer”. - Set the percentage, product scope, duration, and eligible customers.
- Enter a code in the codes section and select Add code.
- Select Save. Adding a code to the form does not persist it until you save.
Percentage and product scope
The current form supports a percentage discount, with an integer from 1 to 100, not a fixed monetary deduction.
- All products: no selected-product restriction; the other rules still apply.
- Specific products: only selected products qualify. Select the product belonging to the correct app; matching names or identifiers across apps do not select both records.
The current dashboard product picker lists web-app products. If a product is missing, check the app and product you created.
Eligible customers
| Dashboard option | System check |
|---|---|
| Everyone | No purchase-history restriction; a code's personalized customer restriction still applies. |
| Never purchased | No successful non-trial payment. Failed or trial payments do not disqualify the customer. |
| No subscription yet | No normal entitlement history; having no currently active subscription is not sufficient. |
| Never had this subscription | No normal entitlement history for the selected product, not simply a matching subscription name. |
| Previously subscribed | Normal entitlement history exists; it does not have to be active. |
Use a stable customer identity. A personalized code must match the app_user_identifier used in the purchase flow. A phone number is appropriate only if it is actually your customer identifier. See customer identity.
Duration is not code expiration
Duration concerns discount applications in a subscription chain, not a calendar expiration date for the code.
- First payment only: intended for the first discount application in the subscription chain.
- Multiple periods: the initial purchase and a configured number of subsequent periods. A value of 2 means the initial purchase and two renewals, not necessarily two calendar months.
- All periods: this setting imposes no period-count restriction; activation, product scope, and all other rules still apply.
This setting does not create automatic renewals or automatic charging. Each purchase must qualify again. The current period check depends on redemption history and entitlement chains. Test renewal behavior before launch for customers with multiple or expired subscriptions; do not treat this option as a global code-redemption limit.
Public and personalized codes
Public code
Enter a code such as WELCOME20 and leave App User Identifier empty. No individual customer is assigned, but product scope and customer eligibility still apply.
Use English letters, digits, and underscores. Leading and trailing whitespace is removed, and the dashboard stores codes in uppercase. Purchase validation is case-insensitive.
Personalized code
Enter a customer identifier such as customer_123 alongside the code. Only that customer can use it. Personalized does not mean single-use: entering a customer identifier in the manual dashboard form does not automatically impose a one-redemption limit.
For a personalized single-use code, use the discount-code generation API. Newly generated codes have a one-redemption limit. Repeating the request for the same discount and customer returns the existing code without resetting its redemption count; a consumed code does not become usable again.
The current dashboard form has no separate controls for per-code expiration dates or redemption limits. Do not assume these are configurable through that form.
Use a code in web checkout
Enable discount codes in the purchase-link settings to show the code input. The customer enters and applies a code; eligible product prices update. Acceptance for one product does not mean every package in the offering qualifies.
You can also add a code query parameter to an existing purchase link. Use & if the link already has query parameters:
Preserve the correct customer identity required by your purchase flow. Adding a code to the URL does not bypass product or customer rules. The server calculates the final amount; a browser-supplied price is not authoritative.
Combining package and code discounts
The package discount is applied first. The code percentage then applies to the remaining amount; percentages are not added together.
For a 100,000-toman product with a 10% package discount and a 20% code:
- After the package discount: 90,000 toman.
- Code deduction: 18,000 toman.
- Final amount: 72,000 toman; the total reduction is 28%, not 30%.
These are illustrative display amounts in toman. In integrations, follow the monetary unit of the specific API contract. Code acceptance is not final redemption: in the web payment flow, redemption is recorded when payment completes successfully.
Edit and deactivate
Open a discount's details or edit action from Web discounts. You can change rules and codes, copy codes, and inspect recorded usage counts. Removing a code from the form takes effect when you save.
To stop a campaign, deactivate the discount from its list action or details page. Its codes no longer validate; previous successful purchases are not cancelled. Re-adding the same deleted code to the same discount does not reset its recorded usage count.
Why a code does not apply
- Wrong project or inactive discount.
- Missing or inactive code, or an exhausted API-generated code limit.
- The selected product is outside the discount scope.
- Customer history does not meet the eligibility rule.
- The purchase identity differs from the code's assigned customer.
- The allowed discount periods have been exhausted.
- No code input: check the purchase link's discount-code setting.
A generic invalid-code message can indicate a product or customer mismatch, not only a typing error.
Test before launching
Test eligible and ineligible customers, included and excluded products, public and personalized codes, and the final price when a package discount also applies. For an API-generated code, attempt reuse after a successful purchase; validation or opening checkout alone does not test single-use behavior.
Continue with the code-generation API reference and offerings and paywalls.