Make offer codes for a one-time purchase
Have an Agent create an offer code for a one-off product such as a consumable or a non-consumable, add a custom code or a batch of one-time codes, send you the codes, and turn them off.
An offer code gives people one of your app’s one-off products at a lower price, or for free. Apple’s help says people redeem a code through a redemption URL, by entering it in the App Store, or in your app. See Apple’s Create offer codes for In-App Purchases ↗.
How an offer code works
The offer code is the offer itself: who can redeem it, and its price in each country or region. The codes people type are added to it afterward, in two kinds:
| Kind | What it is | asc iap offer-codes |
|---|---|---|
| Custom code | One code you name, such as SPRING26. Apple’s help says many people can redeem it, up to a limit you set. An end date is optional. |
custom-codes create |
| One-time codes | A batch of codes Apple generates. Apple’s help says each one is redeemed once. An end date is required. | one-time-codes create |
Apple’s help says you can create the offer and sandbox codes whatever your app’s status, but to generate one-time or custom codes, your app must be Ready for Distribution and the in-app purchase must be Approved. It also sets how many codes a batch can have and how far out they can expire: see Apple’s page above.
Create the offer
Ask in the Project’s chat, for example:
Make an offer code called SPRING for the Pro unlock: free in the United States and Canada, for people who have never bought anything in the app.- The Agent finds the product. You can name it by its reference name or its product ID.
- It sets a price for each country or region you name:
FREE, or one of Apple’s price steps for that product, which it looks up withasc iap pricing price-points list. - It sets who can redeem it. Apple’s help lists three groups: people who have never bought anything in your app, people who bought in the last 30 days, and people who bought more than 30 days ago. In
ascthey’reNON_SPENDER,ACTIVE_SPENDERandCHURNED_SPENDER. Theaschelp lists these values without saying which group each one is. If you don’t say, the command picks all three. - It creates the offer with
asc iap offer-codes createand tells you in the chat.
Check the offer before it’s made: Apple’s help says an offer can’t be edited once it’s created. To change it, make a new one.
Add a custom code
Add the custom code SPRING26 to the SPRING offer, for 500 redemptions, ending June 30.The Agent adds it with asc iap offer-codes custom-codes create. It takes the code, how many redemptions (--quantity, which the help calls the number of codes) and, if you give one, the end date (--expiration-date).
Make one-time codes
Generate 1,000 one-time codes for the SPRING offer, ending June 30, and send them to me as a file.- The Agent asks Apple for the batch with
asc iap offer-codes one-time-codes create, with how many codes (--quantity) and the day they stop working (--expiration-date). - It fetches the codes with
asc iap offer-codes one-time-codes values, which gets the code values of a batch, and sends them to you in the chat.
To try redeeming before you hand codes out, ask for sandbox codes, for example “Generate 10 sandbox codes for the SPRING offer, ending next month.” The command takes --environment SANDBOX (or PRODUCTION). Apple’s help calls these one-time codes for testing. For sandbox testers, see Test in-app purchases before release.
See your offers and codes
| Ask | asc iap offer-codes |
|---|---|
| “Which offer codes does the Pro unlock have?” | list |
| “Show me the SPRING offer.” | view |
| “What does the SPRING offer cost in each country?” | prices |
| “Which custom codes does the SPRING offer have?” | custom-codes list |
| “Which batches of one-time codes does the SPRING offer have?” | one-time-codes list |
| “Send me the codes from the June batch again.” | one-time-codes values |
In App Store Connect, open your app’s in-app purchase: Apple’s help puts its offers in the Offer Codes section.
Turn off an offer or its codes
asc has no command to delete an offer code. You turn it off instead:
| Ask | What happens |
|---|---|
| “Turn off the SPRING offer.” | offer-codes update --active false. The command also takes --active true. |
| “Turn off the custom code SPRING26.” | custom-codes update --active false. The help calls it “Turn a custom code on or off.” |
| “Turn off the June batch of one-time codes.” | one-time-codes update --active false. This can’t be undone: “Turning a batch off is permanent: Apple rejects –active true on an inactive batch.” The command runs only with --confirm, so the Agent asks you first. |
Questions
Why doesn't my product have an Offers page?
App Store Connect won't generate codes.
The Agent says eligibilities must be one of NON_SPENDER, ACTIVE_SPENDER, CHURNED_SPENDER.
The Agent says the quantity must be a positive integer.
--quantity must be a positive integer. Give the number of codes or redemptions as a whole number, such as 500.The Agent says the environment must be PRODUCTION or SANDBOX.
PRODUCTION) or for testing (SANDBOX). Say which you want.