Skip to content

Commit 0f29d04

Browse files
committed
feat(offer-code): add per-territory pricing and auto-renew options
- Support full territory price list on offer-code create for IAP and Subscription - Add CLI flags and REST fields for `--price`, `--free-territory`, and `--auto-renew` - Fix bug causing missing prices on offer codes created via CLI
1 parent dd7591f commit 0f29d04

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- **`--environment` flag on one-time-codes create**`asc iap-offer-code-one-time-codes create --environment sandbox` and `asc subscription-offer-code-one-time-codes create --environment sandbox`. Default is `production`, matching prior behaviour. Maps to the SDK's `Attributes(environment:)` field on the create-request body so sandbox batches can be generated from CLI.
1414
- **REST endpoints for one-time-codes**`GET/POST /api/v1/iap-offer-codes/:offerCodeId/one-time-codes`, `PATCH /api/v1/iap-offer-code-one-time-codes/:oneTimeCodeId`, and the subscription mirrors. POST body accepts `{numberOfCodes, expirationDate, environment?}` so REST clients can generate sandbox redemption batches without dropping to CLI. Each batch row's `_links` resolves `listOneTimeCodes` to the nested parent path.
1515
- **`createOfferCode` affordance + POST endpoints**`InAppPurchase` and `Subscription` now advertise `createOfferCode` in `_links`, mirroring the iOS app's "+ New offer code" affordance. `POST /api/v1/iap/:iapId/offer-codes` accepts `{name, customerEligibilities[]}`; `POST /api/v1/subscriptions/:subscriptionId/offer-codes` accepts `{name, duration, mode, periods, customerEligibilities[], offerEligibility}`. Previously these were CLI-only.
16+
- **Per-territory `prices` on offer-code create (IAP + Subscription)** — both CLI and REST now accept the full territory price list at creation time, matching ASC's actual contract. CLI: `--price <territory>=<price-point-id>` (repeatable, paid) and `--free-territory <territory>` (repeatable). REST: `prices: [{territory, pricePointId?}]` in POST body — omit `pricePointId` for free. New shared `OfferCodePriceInput` domain type. SDK adapters compose the `included[InAppPurchaseOfferPriceInlineCreate]` / `included[SubscriptionOfferCodePriceInlineCreate]` payload with `${local-price-N}` placeholder ids referenced from `relationships.prices.data` — same pattern as the existing IAP price-schedule create. **Fixes a long-standing bug**: previous `createOfferCode` calls sent an empty `prices` relationship, so every offer code created via asc-cli was missing per-territory pricing (and ASC's `prices` is read-only post-create — there was no recovery path).
17+
- **`--auto-renew` on subscription offer-code create** — CLI flag (default `true`) and REST body field `isAutoRenewEnabled` (also accepts `autoRenew`). Setting it `false` creates a non-renewing/one-time offer; ASC only accepts `--mode FREE_TRIAL` in that case. Previously not exposed.
1618

1719
---
1820

0 commit comments

Comments
 (0)