Skip to content

feat(billing): Add ApplySponsorship checkout endpoint - #479

Draft
sentry-junior[bot] wants to merge 4 commits into
mainfrom
stevekonves/reveng-663-apply-sponsorship
Draft

sentry-junior[bot] wants to merge 4 commits into
mainfrom
stevekonves/reveng-663-apply-sponsorship

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The billing platform had no service method for sponsoring a contract. Sponsorships for orgs migrated to the platform (Education activation, _admin sponsoring) were orchestrated in getsentry outside the platform, using an invoicer method with no proto behind it. This adds the interface so it can be a real CheckoutService method.

  • checkout/v1/endpoint_apply_sponsorship.proto (new): ApplySponsorshipRequest { organization_id, sponsored_type } → ApplySponsorshipResponse { invoice_id }. Moves the contract onto the package the sponsorship grants, now, in a new term, and clears paid-plan reservations, caps, and activations. A sponsorship that ends with its term (Education) also stages the free downgrade, like CancelContract. Partner-billed contracts are refused.
  • PackageCatalog.sponsored_packages (new field 4, SponsoredPackageOption { sponsored_type, package_uid }): the catalog names which package each sponsored type grants, next to free_package_uid. That way checkout reads the mapping from PackageService and doesn't hard-code package uids. Fly.io and Nintendo have no entry because their partners provision them.
  • BillContractChangeRequest: comment only. It now says that when the credit for unused time is larger than the invoice's charges, the surplus goes onto the new contract's balance instead of being forgiven. Moving onto a $0 sponsored package is the first caller that reaches this case.

All changes are additive, so the wire format stays compatible.

Consumer: getsentry/getsentry#22711. It needs this released and sentry's sentry-protos pin bumped before its CI can pass.

Refs REVENG-663

via Steve Konves.

--

View Junior Session in Sentry

Sponsoring a contract on the billing platform had no service method, so
getsentry orchestrated it outside the platform with an unwrapped invoicer
call.

ApplySponsorship moves a contract onto the package a sponsorship grants
in a new term. The package catalog now names the package each sponsored
type grants, so checkout does not hard-code package uids, and
BillContractChange documents that a credit larger than the invoice's
charges carries onto the new contract's balance.

Refs REVENG-663

Co-Authored-By: Steve Konves <steve.konves@sentry.io>
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

REVENG-663

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 23, 2026, 8:18 PM

This branch has not been deployed

No deployments
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