Repository navigation
v1.2.0: Subscription Retention Offers
What's Changed
- feat: retention offers.
gpc subscriptions offers create <product> <base-plan> --retention cohort|per-user --offer-id <id> --discount <fraction>builds the offer from the base plan, copying its billing period and regions. Cohort offers take--min-duration,--multiple-claims,--cooldown,--startand--end. The offer is created as a draft;--activatealso activates it.offers updateaccepts the same targeting flags. New Retention Offers guide. - feat:
offers createandoffers updatecheck a retention offer against Google's rules before sending it and list every problem at once (RETENTION_OFFER_INVALID, exit 2).gpc subscriptions offers template retention [--per-user]prints a starting file. - feat:
gpc purchases subscription target-offer <token> --offer <id>anduntarget-offershow a per-user retention offer to one subscriber, or stop showing it. Google's errors map toOFFER_NOT_PER_USER,OFFER_NEVER_ACTIVATEDandSUBSCRIPTION_EXPIRED. - feat: accepted offers.
gpc rtdn decodenames notification type 21,SUBSCRIPTION_PLAN_TRANSITION_UPDATED, andgpc purchases subscription getshows aplanTransitionrow and the offers targeted at the subscriber. - feat:
gpc purchases subscription cancel-transition <token> --product-id <id>cancels a pending plan transition. It is marked experimental because Google documents no error responses for it yet. - feat:
cancel-v2andrevokeaccept--etag, so Google applies the request only if the subscription has not changed since you read it. A mismatch exits 4 (SUBSCRIPTION_ETAG_MISMATCH). - fix (breaking for CI scripts):
cancel,cancel-v2,defer,defer-v2,target-offeranduntarget-offerused to run without confirmation in CI. They change what a subscriber pays, so a non-interactive run now needs--yes, or it fails withCONFIRMATION_REQUIRED(exit 2) and sends nothing.--dry-runneeds no--yes, but it now rejects a bad--expiryor--typejust as the real run does. - fix:
defer --expirymust be an RFC 3339 time with a time zone (SUBSCRIPTION_EXPIRY_INVALID), andcancel-v2 --typemust beUSER_REQUESTED_STOP_RENEWALSorDEVELOPER_REQUESTED_STOP_PAYMENTS(CANCELLATION_TYPE_INVALID). Both exit 2 before any request. - fix: v1
deferreads the current expiry through the v2 API, so it keeps working until defer itself shuts down on August 31, 2028.gpc rtdn decodemarks notification type 8 andsubscriptionIdas deprecated, and v1acknowledgeno longer warns, because Google has not deprecated it. - fix: a
vitals.thresholdsconfig value that is blank,true/falseor not a number is rejected withTHRESHOLD_INVALID(exit 2) bygpc vitals,gpc watchandreleases rollout increase --vitals-gate. It used to count as 0, so a gate fired on any crash. - fix: an offer or subscription file saved from
getand passed back toupdateno longer fails on read-only fields. - fix: three Google errors now say what to do:
API_REGIONS_VERSION_TOO_OLDandAPI_REGIONS_VERSION_INVALIDfor--regions-version, andAPI_OFFER_NOT_DRAFTwhen you delete an offer that was activated (deactivate it instead). - feat: the
billing-library-deprecatedpreflight finding names Google's Android CLI skill that upgrades the Billing Library. - docs: the authentication pages describe what GPC ships: a service account key or Application Default Credentials. The OAuth browser flow and keychain storage they described never existed.
CI impact: gpc purchases subscription cancel, cancel-v2, defer, defer-v2, target-offer and untarget-offer now need --yes in a non-interactive run. Without it they exit 2 with CONFIRMATION_REQUIRED and send nothing. --dry-run needs no --yes.
Not yet tested against a live subscription: target-offer, untarget-offer, cancel-transition, v1 defer, the planTransition row in subscription get and RTDN type 21 need a real purchase token. They are covered by tests built from Google's documented responses. Please open an issue if one behaves differently on your app.
Full Changelog: v1.1.0...v1.2.0