chore: sync test with main (api#878 sessions + claim)

Merged
RE
3mo ago
+2989-217

Summary

  • Merges main into test so test-recoup-api.vercel.app picks up optional-auth POST /api/subscriptions/sessions + claim from api#878 (and the earlier #877/#876 plan/lifecycle work).
  • Unblocks marketing preview testing that posts { plan, successUrl, cancelUrl } against the test API.

Test plan

  • CI green on this PR
  • After merge, POST https://test-recoup-api.vercel.app/api/subscriptions/sessions with {plan,successUrl,cancelUrl} returns 200 + Stripe URL (not 400 unrecognized keys)

Made with Cursor


Summary by cubic

Merges main into test so the test environment picks up the plan-gating and checkout work from #877/#878. POST /api/subscriptions/sessions now accepts { plan, successUrl, cancelUrl } with auth optional (it previously required auth and rejected unrecognized keys), and new POST /api/subscriptions/claim attaches a subscription bought anonymously to an authenticated account.

Notes

  • Also brings in plan entitlements with a 402 plan_limit task gate, the abandoned-checkout follow-up email, and anonymous checkout webhooks.
  • After merge, POST https://test-recoup-api.vercel.app/api/subscriptions/sessions with { plan, successUrl, cancelUrl } should return 200 with a Stripe URL.