Create offers and offer codes from Xcode
A 7-day free trial for new subscribers, a code for your newsletter, a discount for people who cancelled. Ask Xcode and MetaRun stages the right Apple offer type for each audience, with prices for every storefront.
Setup checked October 2026 against Apple: extending and customizing agents, giving external agents access to Xcode
Connect Xcode once
01 · Add the MetaRun plug-in
In Xcode 27, open Settings, Intelligence, Plug-ins. Choose Add Plug-in, then Add from URL, and paste:
https://github.com/metarun/metarun-skills02 · Or with one click
Opens Xcode's plug-in sheet with the repository filled in.
xcode://agent-plugin-clone?repo=https%3A%2F%2Fgithub.com%2Fmetarun%2Fmetarun-skills03 · Sign in
Install MetaRun from the list, then click Sign in next to it. MetaRun opens in your browser; pick read-only or read and change.
04 · Ask the coding assistant
Claude Agent, Codex and Gemini in Xcode all get MetaRun's tools and its six workflow skills.
Attach build 312 to version 2.4 and tell me what blocks submission.What Xcode handles here
Apple has four offer types for subscriptions and they target different people: introductory offers for those who never subscribed, promotional offers for current subscribers, offer codes for anyone with a code, and win-back offers for people who left. Each has its own screens in App Store Connect and its own rules about price and eligibility.
MetaRun exposes each one as a preview and apply pair. Xcode can create them, generate one-time codes, turn codes on and off, and read back what's live.
Before you start
- A subscription to attach the offer to.
- Who the offer is for: new, current, lapsed, or anyone with a code.
- Prices per storefront for paid offers; free trials only need territories.
How it runs
- 01
Match the offer to the audience
Xcode picks the offer type from who it's for: never subscribed, subscribed now, lapsed, or anyone holding a code.
- 02
Price it per storefront
Paid offers take a price per territory. Free trials take a list of territories instead, because Apple wants no price on a free row.
- 03
Preview the offer
The preview shows the offer, its duration and where it applies, with a confirm token.
- 04
Generate and track codes
One-time codes are generated in a batch after the campaign exists. Campaigns can be switched off later without deleting them.
An example session in Xcode
Our paywall shows a free trial. Make sure the yearly plan actually has one in every storefront we sell in.
- apple_list_subscription_offersThe yearly plan has no introductory offer.
- apple_preview_create_intro_offerPreview: one-week free trial for new subscribers, every territory.
- Xcode asks before running apple_apply_create_intro_offer. You read the preview above and approve.
- apple_apply_create_intro_offerCreated in every storefront.
- apple_preview_create_offer_codePreview: NEWSLETTER, 50% off for three months.
Illustrative: your apps, versions and numbers will differ. The tool names and their order are real.
The MetaRun tools Xcode calls
| Tool | What it does |
|---|---|
| apple_list_subscription_offersread | Every offer on a subscription, across all four types. |
| apple_preview_create_intro_offerpreview + apply | Free trial, pay as you go, or pay up front for new subscribers. |
| apple_preview_create_promotional_offerpreview + apply | A discount current or lapsed subscribers can redeem in the app. |
| apple_preview_create_offer_codepreview + apply | An offer code campaign, with custom codes or one-time codes. |
| apple_preview_generate_offer_codespreview + apply | Mint a batch of one-time-use codes. |
| apple_preview_set_offer_code_activepreview + apply | Turn a code campaign on or off. |
| apple_preview_create_winback_offerpreview + apply | A win-back offer for people who cancelled (iOS 18 and later). |
| apple_preview_create_iap_offer_codepreview + apply | Offer codes for in-app purchases. |
Each preview has an apply twin (the same name with apply instead of preview) that only runs with the confirm token from a fresh preview, and refuses if App Store Connect changed in between. MetaRun tools save to your MetaRun workspace only (studio projects, tracked keywords), never to Apple.
What Apple enforces, and how MetaRun handles it
Intro offers are stored per territory
Apple keeps an introductory offer as one resource per storefront, so a 3-day trial in 175 storefronts is 175 records. MetaRun reads them back as one offer with a territory count.
Free trials carry no price
A free trial's price rows must have no price point. MetaRun takes territories instead of prices for free offers and refuses a mixed request at preview rather than repricing silently.
Issued codes can't be taken back
Generating codes isn't revertible, since a code already handed out can't be un-issued. Deactivating the campaign is the lever instead.
Win-back offers need iOS 18
Win-back offers reach people who subscribed before and cancelled, and only on iOS 18 and later.
What to ask Xcode
- Ask Xcode: Our paywall shows a free trial. Make sure the yearly plan actually has one in every storefront we sell in.
- Ask Xcode: Create a promotional offer we can present from the app for users who downgrade.
- Ask Xcode: Generate 200 one-time codes for the beta testers.
How Xcode asks before a change
Xcode asks before an agent uses a tool it hasn't been allowed. Tools you've allowed are listed in Settings, Intelligence, under Permissions, where you can remove them. Leave MetaRun's apply tools off that list so every App Store change asks first; reads and previews are safe to allow.
Frequently asked questions
Which offer type should I use?
Introductory offers for people who never subscribed, promotional offers for current subscribers, win-back offers for people who left, and offer codes when you hand out a code yourself. Xcode can pick based on who you describe.
Can Xcode generate one-time offer codes?
Yes. Create the campaign, then generate a batch of one-time-use codes. Generation isn't revertible, so it always previews first.
Can I offer a free trial in some countries only?
Yes. Free trials take a list of territories; leave it out for every storefront.
Do offers work for in-app purchases?
Offer codes do, through apple_preview_create_iap_offer_code. Introductory, promotional and win-back offers are subscription features in Apple's model.
How do I connect Xcode to App Store Connect?
In Xcode 27, add the plug-in from https://github.com/metarun/metarun-skills (Settings, Intelligence, Plug-ins, Add from URL) and click Sign in next to MetaRun. After that, ask for "offers and offer codes" in plain words and Xcode picks the MetaRun tools.
Does Xcode see my App Store Connect key?
No. Your App Store Connect API key stays envelope-encrypted on MetaRun's servers and is decrypted per request. Xcode holds a MetaRun token that you can revoke in Settings at any time.
More with Xcode
Xcode
Subscriptions and IAPs
Create subscription groups, subscriptions and in-app purchases with copy and prices.
OpenXcode
Price by country
Reprice an app, IAP or subscription across 175 storefronts with PPP or Big Mac indexes.
OpenXcode
Reply to reviews
Triage App Store reviews, find the themes, and post replies you've approved.
OpenXcode
Submit for review
Attach the build, clear export compliance, run the readiness sweep, submit.
OpenOffers and offer codes with another agent
In depth: Bulk App Store pricing
Agent access
14-day free trial with agent access. No credit card. Your Apple key stays encrypted on MetaRun.