Skip to content

Autumn: move a paid customer to another plan on its Stripe subscription - #39

Merged
RhysSullivan merged 1 commit into
mainfrom
autumn-carry-over
Oct 25, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
autumn-carry-over

Conversation

@RhysSullivan

Copy link
Copy Markdown

Adds what Executor's v1 import needs to move a paid customer between two Autumn catalogs in one account, modelled on what the real sandbox did (x-api-version 2.3.0):

  • customers.update with new_customer_id. Subscriptions, Stripe subscription and usage stay. A taken id gets 409 customer_already_exists.
  • billing.preview_attach, which takes the same body as attach and changes nothing.
  • billing.attach with remove_plan_ids and proration_behavior: "none". The new plan takes over the removed paid plan's Stripe subscription with its period and a running trial. Nothing is charged and there is no checkout. A cancellation at the end of the cycle is dropped, and a scheduled plan stays scheduled. customize (flat price, items) and version are supported. Removing a running trial without proration gets 400, a missing plan gets 404 product_not_found, and attaching a plan already held gets 409.
  • customers.get with expand: ["subscriptions.plan"] returns the version each subscription bills.
  • billing.verify lists each paid plan's Stripe subscription.
  • customers.delete.
  • Seed config: a plan's versions, and a subscription's version and stripe_subscription_id.

Tests: src/__tests__/autumn-carry-over.test.ts. The package suite passes (69 tests).

This only adds behaviour. Existing routes are unchanged except that a checkout-settled paid plan now records a Stripe subscription id. Executor's tests PR for the billing carry-over can't pass until this is deployed to emulators.dev.

@RhysSullivan
RhysSullivan marked this pull request as ready for review October 25, 2026 18:31
@RhysSullivan
RhysSullivan merged commit b2929ce into main Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant